1(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["vendor"],{ 2
vendor: 244,818 bytes, lines 3-5588
3/***/ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js": 4/*!**********************************************************************!*\ 5 !*** ./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js ***! 6 \**********************************************************************/ 7/*! exports provided: APP_BASE_HREF, AsyncPipe, CommonModule, CurrencyPipe, DOCUMENT, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, LOCATION_INITIALIZED, Location, LocationStrategy, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PathLocationStrategy, PercentPipe, PlatformLocation, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, VERSION, ViewportScroller, WeekDay, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits, isPlatformBrowser, isPlatformServer, isPlatformWorkerApp, isPlatformWorkerUi, registerLocaleData, ɵBrowserPlatformLocation, ɵDomAdapter, ɵNullViewportScroller, ɵPLATFORM_BROWSER_ID, ɵPLATFORM_SERVER_ID, ɵPLATFORM_WORKER_APP_ID, ɵPLATFORM_WORKER_UI_ID, ɵangular_packages_common_common_a, ɵangular_packages_common_common_b, ɵangular_packages_common_common_c, ɵangular_packages_common_common_d, ɵangular_packages_common_common_e, ɵangular_packages_common_common_f, ɵgetDOM, ɵparseCookieValue, ɵsetRootDomAdapter */ 8/***/ (function(module, __webpack_exports__, __webpack_require__) { 9 10"use strict"; 11__webpack_require__.r(__webpack_exports__); 12/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_BASE_HREF", function() { return APP_BASE_HREF; }); 13/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncPipe", function() { return AsyncPipe; }); 14/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommonModule", function() { return CommonModule; }); 15/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CurrencyPipe", function() { return CurrencyPipe; }); 16/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOCUMENT", function() { return DOCUMENT; }); 17/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DatePipe", function() { return DatePipe; }); 18/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecimalPipe", function() { return DecimalPipe; }); 19/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormStyle", function() { return FormStyle; }); 20/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormatWidth", function() { return FormatWidth; }); 21/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HashLocationStrategy", function() { return HashLocationStrategy; }); 22/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I18nPluralPipe", function() { return I18nPluralPipe; }); 23/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I18nSelectPipe", function() { return I18nSelectPipe; }); 24/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonPipe", function() { return JsonPipe; }); 25/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyValuePipe", function() { return KeyValuePipe; }); 26/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCATION_INITIALIZED", function() { return LOCATION_INITIALIZED; }); 27/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; }); 28/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationStrategy", function() { return LocationStrategy; }); 29/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LowerCasePipe", function() { return LowerCasePipe; }); 30/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgClass", function() { return NgClass; }); 31/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgComponentOutlet", function() { return NgComponentOutlet; }); 32/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForOf", function() { return NgForOf; }); 33/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForOfContext", function() { return NgForOfContext; }); 34/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgIf", function() { return NgIf; }); 35/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgIfContext", function() { return NgIfContext; }); 36/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgLocaleLocalization", function() { return NgLocaleLocalization; }); 37/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgLocalization", function() { return NgLocalization; }); 38/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgPlural", function() { return NgPlural; }); 39/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgPluralCase", function() { return NgPluralCase; }); 40/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgStyle", function() { return NgStyle; }); 41/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitch", function() { return NgSwitch; }); 42/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitchCase", function() { return NgSwitchCase; }); 43/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitchDefault", function() { return NgSwitchDefault; }); 44/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgTemplateOutlet", function() { return NgTemplateOutlet; }); 45/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberFormatStyle", function() { return NumberFormatStyle; }); 46/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberSymbol", function() { return NumberSymbol; }); 47/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathLocationStrategy", function() { return PathLocationStrategy; }); 48/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PercentPipe", function() { return PercentPipe; }); 49/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlatformLocation", function() { return PlatformLocation; }); 50/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plural", function() { return Plural; }); 51/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SlicePipe", function() { return SlicePipe; }); 52/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TitleCasePipe", function() { return TitleCasePipe; }); 53/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationWidth", function() { return TranslationWidth; }); 54/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UpperCasePipe", function() { return UpperCasePipe; }); 55/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); 56/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewportScroller", function() { return ViewportScroller; }); 57/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WeekDay", function() { return WeekDay; }); 58/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatCurrency", function() { return formatCurrency; }); 59/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDate", function() { return formatDate; }); 60/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatNumber", function() { return formatNumber; }); 61/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatPercent", function() { return formatPercent; }); 62/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrencySymbol", function() { return getCurrencySymbol; }); 63/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleCurrencyCode", function() { return getLocaleCurrencyCode; }); 64/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleCurrencyName", function() { return getLocaleCurrencyName; }); 65/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleCurrencySymbol", function() { return getLocaleCurrencySymbol; }); 66/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDateFormat", function() { return getLocaleDateFormat; }); 67/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDateTimeFormat", function() { return getLocaleDateTimeFormat; }); 68/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDayNames", function() { return getLocaleDayNames; }); 69/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDayPeriods", function() { return getLocaleDayPeriods; }); 70/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDirection", function() { return getLocaleDirection; }); 71/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleEraNames", function() { return getLocaleEraNames; }); 72/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleExtraDayPeriodRules", function() { return getLocaleExtraDayPeriodRules; }); 73/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleExtraDayPeriods", function() { return getLocaleExtraDayPeriods; }); 74/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleFirstDayOfWeek", function() { return getLocaleFirstDayOfWeek; }); 75/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleId", function() { return getLocaleId; }); 76/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleMonthNames", function() { return getLocaleMonthNames; }); 77/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleNumberFormat", function() { return getLocaleNumberFormat; }); 78/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleNumberSymbol", function() { return getLocaleNumberSymbol; }); 79/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalePluralCase", function() { return getLocalePluralCase; }); 80/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleTimeFormat", function() { return getLocaleTimeFormat; }); 81/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleWeekEndRange", function() { return getLocaleWeekEndRange; }); 82/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNumberOfCurrencyDigits", function() { return getNumberOfCurrencyDigits; }); 83/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformBrowser", function() { return isPlatformBrowser; }); 84/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformServer", function() { return isPlatformServer; }); 85/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformWorkerApp", function() { return isPlatformWorkerApp; }); 86/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformWorkerUi", function() { return isPlatformWorkerUi; }); 87/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerLocaleData", function() { return registerLocaleData; }); 88/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserPlatformLocation", function() { return BrowserPlatformLocation; }); 89/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomAdapter", function() { return DomAdapter; }); 90/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNullViewportScroller", function() { return NullViewportScroller; }); 91/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_BROWSER_ID", function() { return PLATFORM_BROWSER_ID; }); 92/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_SERVER_ID", function() { return PLATFORM_SERVER_ID; }); 93/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_WORKER_APP_ID", function() { return PLATFORM_WORKER_APP_ID; }); 94/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_WORKER_UI_ID", function() { return PLATFORM_WORKER_UI_ID; }); 95/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_a", function() { return useBrowserPlatformLocation; }); 96/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_b", function() { return createBrowserPlatformLocation; }); 97/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_c", function() { return createLocation; }); 98/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_d", function() { return provideLocationStrategy; }); 99/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_e", function() { return COMMON_DIRECTIVES; }); 100/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_f", function() { return COMMON_PIPES; }); 101/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDOM", function() { return getDOM; }); 102/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵparseCookieValue", function() { return parseCookieValue; }); 103/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetRootDomAdapter", function() { return setRootDomAdapter; }); 104/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js"); 105/** 106 * @license Angular v10.0.14 107 * (c) 2010-2020 Google LLC. https://angular.io/ 108 * License: MIT 109 */ 110 111 112 113/** 114 * @license 115 * Copyright Google LLC All Rights Reserved. 116 * 117 * Use of this source code is governed by an MIT-style license that can be 118 * found in the LICENSE file at https://angular.io/license 119 */ 120 121let _DOM = null; 122function getDOM() { 123 return _DOM; 124} 125function setDOM(adapter) { 126 _DOM = adapter; 127} 128function setRootDomAdapter(adapter) { 129 if (!_DOM) { 130 _DOM = adapter; 131 } 132} 133/* tslint:disable:requireParameterType */ 134/** 135 * Provides DOM operations in an environment-agnostic way. 136 * 137 * @security Tread carefully! Interacting with the DOM directly is dangerous and 138 * can introduce XSS risks. 139 */ 140class DomAdapter { 141} 142 143/** 144 * @license 145 * Copyright Google LLC All Rights Reserved. 146 * 147 * Use of this source code is governed by an MIT-style license that can be 148 * found in the LICENSE file at https://angular.io/license 149 */ 150/** 151 * A DI Token representing the main rendering context. In a browser this is the DOM Document. 152 * 153 * Note: Document might not be available in the Application Context when Application and Rendering 154 * Contexts are not the same (e.g. when running the application in a Web Worker). 155 * 156 * @publicApi 157 */ 158const DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('DocumentToken'); 159 160/** 161 * @license 162 * Copyright Google LLC All Rights Reserved. 163 * 164 * Use of this source code is governed by an MIT-style license that can be 165 * found in the LICENSE file at https://angular.io/license 166 */ 167/** 168 * This class should not be used directly by an application developer. Instead, use 169 * {@link Location}. 170 * 171 * `PlatformLocation` encapsulates all calls to DOM APIs, which allows the Router to be 172 * platform-agnostic. 173 * This means that we can have different implementation of `PlatformLocation` for the different 174 * platforms that Angular supports. For example, `@angular/platform-browser` provides an 175 * implementation specific to the browser environment, while `@angular/platform-server` provides 176 * one suitable for use with server-side rendering. 177 * 178 * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy} 179 * when they need to interact with the DOM APIs like pushState, popState, etc. 180 * 181 * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly 182 * by the {@link Router} in order to navigate between routes. Since all interactions between {@link 183 * Router} / 184 * {@link Location} / {@link LocationStrategy} and DOM APIs flow through the `PlatformLocation` 185 * class, they are all platform-agnostic. 186 * 187 * @publicApi 188 */ 189class PlatformLocation { 190} 191PlatformLocation.ɵfac = function PlatformLocation_Factory(t) { return new (t || PlatformLocation)(); }; 192PlatformLocation.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: useBrowserPlatformLocation, token: PlatformLocation, providedIn: "platform" }); 193/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PlatformLocation, [{ 194 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], 195 args: [{ 196 providedIn: 'platform', 197 // See #23917 198 useFactory: useBrowserPlatformLocation 199 }] 200 }], null, null); })(); 201function useBrowserPlatformLocation() { 202 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(BrowserPlatformLocation); 203} 204/** 205 * @description 206 * Indicates when a location is initialized. 207 * 208 * @publicApi 209 */ 210const LOCATION_INITIALIZED = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Location Initialized'); 211/** 212 * `PlatformLocation` encapsulates all of the direct calls to platform APIs. 213 * This class should not be used directly by an application developer. Instead, use 214 * {@link Location}. 215 */ 216class BrowserPlatformLocation extends PlatformLocation { 217 constructor(_doc) { 218 super(); 219 this._doc = _doc; 220 this._init(); 221 } 222 // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it 223 /** @internal */ 224 _init() { 225 this.location = getDOM().getLocation(); 226 this._history = getDOM().getHistory(); 227 } 228 getBaseHrefFromDOM() { 229 return getDOM().getBaseHref(this._doc); 230 } 231 onPopState(fn) { 232 getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false); 233 } 234 onHashChange(fn) { 235 getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false); 236 } 237 get href() { 238 return this.location.href; 239 } 240 get protocol() { 241 return this.location.protocol; 242 } 243 get hostname() { 244 return this.location.hostname; 245 } 246 get port() { 247 return this.location.port; 248 } 249 get pathname() { 250 return this.location.pathname; 251 } 252 get search() { 253 return this.location.search; 254 } 255 get hash() { 256 return this.location.hash; 257 } 258 set pathname(newPath) { 259 this.location.pathname = newPath; 260 } 261 pushState(state, title, url) { 262 if (supportsState()) { 263 this._history.pushState(state, title, url); 264 } 265 else { 266 this.location.hash = url; 267 } 268 } 269 replaceState(state, title, url) { 270 if (supportsState()) { 271 this._history.replaceState(state, title, url); 272 } 273 else { 274 this.location.hash = url; 275 } 276 } 277 forward() { 278 this._history.forward(); 279 } 280 back() { 281 this._history.back(); 282 } 283 getState() { 284 return this._history.state; 285 } 286} 287BrowserPlatformLocation.ɵfac = function BrowserPlatformLocation_Factory(t) { return new (t || BrowserPlatformLocation)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](DOCUMENT)); }; 288BrowserPlatformLocation.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: createBrowserPlatformLocation, token: BrowserPlatformLocation, providedIn: "platform" }); 289BrowserPlatformLocation.ctorParameters = () => [ 290 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [DOCUMENT,] }] } 291]; 292/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](BrowserPlatformLocation, [{ 293 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], 294 args: [{ 295 providedIn: 'platform', 296 // See #23917 297 useFactory: createBrowserPlatformLocation 298 }] 299 }], function () { return [{ type: undefined, decorators: [{ 300 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 301 args: [DOCUMENT] 302 }] }]; }, null); })(); 303function supportsState() { 304 return !!window.history.pushState; 305} 306function createBrowserPlatformLocation() { 307 return new BrowserPlatformLocation(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT)); 308} 309 310/** 311 * @license 312 * Copyright Google LLC All Rights Reserved. 313 * 314 * Use of this source code is governed by an MIT-style license that can be 315 * found in the LICENSE file at https://angular.io/license 316 */ 317 318/** 319 * @license 320 * Copyright Google LLC All Rights Reserved. 321 * 322 * Use of this source code is governed by an MIT-style license that can be 323 * found in the LICENSE file at https://angular.io/license 324 */ 325/** 326 * Joins two parts of a URL with a slash if needed. 327 * 328 * @param start URL string 329 * @param end URL string 330 * 331 * 332 * @returns The joined URL string. 333 */ 334function joinWithSlash(start, end) { 335 if (start.length == 0) { 336 return end; 337 } 338 if (end.length == 0) { 339 return start; 340 } 341 let slashes = 0; 342 if (start.endsWith('/')) { 343 slashes++; 344 } 345 if (end.startsWith('/')) { 346 slashes++; 347 } 348 if (slashes == 2) { 349 return start + end.substring(1); 350 } 351 if (slashes == 1) { 352 return start + end; 353 } 354 return start + '/' + end; 355} 356/** 357 * Removes a trailing slash from a URL string if needed. 358 * Looks for the first occurrence of either `#`, `?`, or the end of the 359 * line as `/` characters and removes the trailing slash if one exists. 360 * 361 * @param url URL string. 362 * 363 * @returns The URL string, modified if needed. 364 */ 365function stripTrailingSlash(url) { 366 const match = url.match(/#|\?|$/); 367 const pathEndIdx = match && match.index || url.length; 368 const droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0); 369 return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx); 370} 371/** 372 * Normalizes URL parameters by prepending with `?` if needed. 373 * 374 * @param params String of URL parameters. 375 * 376 * @returns The normalized URL parameters string. 377 */ 378function normalizeQueryParams(params) { 379 return params && params[0] !== '?' ? '?' + params : params; 380} 381 382/** 383 * @license 384 * Copyright Google LLC All Rights Reserved. 385 * 386 * Use of this source code is governed by an MIT-style license that can be 387 * found in the LICENSE file at https://angular.io/license 388 */ 389/** 390 * Enables the `Location` service to read route state from the browser's URL. 391 * Angular provides two strategies: 392 * `HashLocationStrategy` and `PathLocationStrategy`. 393 * 394 * Applications should use the `Router` or `Location` services to 395 * interact with application route state. 396 * 397 * For instance, `HashLocationStrategy` produces URLs like 398 * <code class="no-auto-link">http://example.com#/foo</code>, 399 * and `PathLocationStrategy` produces 400 * <code class="no-auto-link">http://example.com/foo</code> as an equivalent URL. 401 * 402 * See these two classes for more. 403 * 404 * @publicApi 405 */ 406class LocationStrategy { 407} 408LocationStrategy.ɵfac = function LocationStrategy_Factory(t) { return new (t || LocationStrategy)(); }; 409LocationStrategy.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: provideLocationStrategy, token: LocationStrategy, providedIn: "root" }); 410/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LocationStrategy, [{ 411 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], 412 args: [{ providedIn: 'root', useFactory: provideLocationStrategy }] 413 }], null, null); })(); 414function provideLocationStrategy(platformLocation) { 415 // See #23917 416 const location = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT).location; 417 return new PathLocationStrategy(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(PlatformLocation), location && location.origin || ''); 418} 419/** 420 * A predefined [DI token](guide/glossary#di-token) for the base href 421 * to be used with the `PathLocationStrategy`. 422 * The base href is the URL prefix that should be preserved when generating 423 * and recognizing URLs. 424 * 425 * @usageNotes 426 * 427 * The following example shows how to use this token to configure the root app injector 428 * with a base href value, so that the DI framework can supply the dependency anywhere in the app. 429 * 430 * ```typescript 431 * import {Component, NgModule} from '@angular/core'; 432 * import {APP_BASE_HREF} from '@angular/common'; 433 * 434 * @NgModule({ 435 * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}] 436 * }) 437 * class AppModule {} 438 * ``` 439 * 440 * @publicApi 441 */ 442const APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('appBaseHref'); 443/** 444 * @description 445 * A {@link LocationStrategy} used to configure the {@link Location} service to 446 * represent its state in the 447 * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the 448 * browser's URL. 449 * 450 * If you're using `PathLocationStrategy`, you must provide a {@link APP_BASE_HREF} 451 * or add a `<base href>` element to the document. 452 * 453 * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call 454 * `location.go('/foo')`, the browser's URL will become 455 * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly, 456 * the `<base href>` and/or `APP_BASE_HREF` should end with a `/`. 457 * 458 * Similarly, if you add `<base href='/my/app/'/>` to the document and call 459 * `location.go('/foo')`, the browser's URL will become 460 * `example.com/my/app/foo`. 461 * 462 * Note that when using `PathLocationStrategy`, neither the query nor 463 * the fragment in the `<base href>` will be preserved, as outlined 464 * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2). 465 * 466 * @usageNotes 467 * 468 * ### Example 469 * 470 * {@example common/location/ts/path_location_component.ts region='LocationComponent'} 471 * 472 * @publicApi 473 */ 474class PathLocationStrategy extends LocationStrategy { 475 constructor(_platformLocation, href) { 476 super(); 477 this._platformLocation = _platformLocation; 478 if (href == null) { 479 href = this._platformLocation.getBaseHrefFromDOM(); 480 } 481 if (href == null) { 482 throw new Error(`No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.`); 483 } 484 this._baseHref = href; 485 } 486 onPopState(fn) { 487 this._platformLocation.onPopState(fn); 488 this._platformLocation.onHashChange(fn); 489 } 490 getBaseHref() { 491 return this._baseHref; 492 } 493 prepareExternalUrl(internal) { 494 return joinWithSlash(this._baseHref, internal); 495 } 496 path(includeHash = false) { 497 const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search); 498 const hash = this._platformLocation.hash; 499 return hash && includeHash ? `${pathname}${hash}` : pathname; 500 } 501 pushState(state, title, url, queryParams) { 502 const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams)); 503 this._platformLocation.pushState(state, title, externalUrl); 504 } 505 replaceState(state, title, url, queryParams) { 506 const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams)); 507 this._platformLocation.replaceState(state, title, externalUrl); 508 } 509 forward() { 510 this._platformLocation.forward(); 511 } 512 back() { 513 this._platformLocation.back(); 514 } 515} 516PathLocationStrategy.ɵfac = function PathLocationStrategy_Factory(t) { return new (t || PathLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8)); }; 517PathLocationStrategy.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: PathLocationStrategy, factory: PathLocationStrategy.ɵfac }); 518PathLocationStrategy.ctorParameters = () => [ 519 { type: PlatformLocation }, 520 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [APP_BASE_HREF,] }] } 521]; 522/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PathLocationStrategy, [{ 523 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 524 }], function () { return [{ type: PlatformLocation }, { type: String, decorators: [{ 525 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 526 }, { 527 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 528 args: [APP_BASE_HREF] 529 }] }]; }, null); })(); 530 531/** 532 * @license 533 * Copyright Google LLC All Rights Reserved. 534 * 535 * Use of this source code is governed by an MIT-style license that can be 536 * found in the LICENSE file at https://angular.io/license 537 */ 538/** 539 * @description 540 * A {@link LocationStrategy} used to configure the {@link Location} service to 541 * represent its state in the 542 * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) 543 * of the browser's URL. 544 * 545 * For instance, if you call `location.go('/foo')`, the browser's URL will become 546 * `example.com#/foo`. 547 * 548 * @usageNotes 549 * 550 * ### Example 551 * 552 * {@example common/location/ts/hash_location_component.ts region='LocationComponent'} 553 * 554 * @publicApi 555 */ 556class HashLocationStrategy extends LocationStrategy { 557 constructor(_platformLocation, _baseHref) { 558 super(); 559 this._platformLocation = _platformLocation; 560 this._baseHref = ''; 561 if (_baseHref != null) { 562 this._baseHref = _baseHref; 563 } 564 } 565 onPopState(fn) { 566 this._platformLocation.onPopState(fn); 567 this._platformLocation.onHashChange(fn); 568 } 569 getBaseHref() { 570 return this._baseHref; 571 } 572 path(includeHash = false) { 573 // the hash value is always prefixed with a `#` 574 // and if it is empty then it will stay empty 575 let path = this._platformLocation.hash; 576 if (path == null) 577 path = '#'; 578 return path.length > 0 ? path.substring(1) : path; 579 } 580 prepareExternalUrl(internal) { 581 const url = joinWithSlash(this._baseHref, internal); 582 return url.length > 0 ? ('#' + url) : url; 583 } 584 pushState(state, title, path, queryParams) { 585 let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)); 586 if (url.length == 0) { 587 url = this._platformLocation.pathname; 588 } 589 this._platformLocation.pushState(state, title, url); 590 } 591 replaceState(state, title, path, queryParams) { 592 let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)); 593 if (url.length == 0) { 594 url = this._platformLocation.pathname; 595 } 596 this._platformLocation.replaceState(state, title, url); 597 } 598 forward() { 599 this._platformLocation.forward(); 600 } 601 back() { 602 this._platformLocation.back(); 603 } 604} 605HashLocationStrategy.ɵfac = function HashLocationStrategy_Factory(t) { return new (t || HashLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8)); }; 606HashLocationStrategy.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HashLocationStrategy, factory: HashLocationStrategy.ɵfac }); 607HashLocationStrategy.ctorParameters = () => [ 608 { type: PlatformLocation }, 609 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [APP_BASE_HREF,] }] } 610]; 611/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HashLocationStrategy, [{ 612 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 613 }], function () { return [{ type: PlatformLocation }, { type: String, decorators: [{ 614 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 615 }, { 616 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 617 args: [APP_BASE_HREF] 618 }] }]; }, null); })(); 619 620/** 621 * @license 622 * Copyright Google LLC All Rights Reserved. 623 * 624 * Use of this source code is governed by an MIT-style license that can be 625 * found in the LICENSE file at https://angular.io/license 626 */ 627/** 628 * @description 629 * 630 * A service that applications can use to interact with a browser's URL. 631 * 632 * Depending on the `LocationStrategy` used, `Location` persists 633 * to the URL's path or the URL's hash segment. 634 * 635 * @usageNotes 636 * 637 * It's better to use the `Router#navigate` service to trigger route changes. Use 638 * `Location` only if you need to interact with or create normalized URLs outside of 639 * routing. 640 * 641 * `Location` is responsible for normalizing the URL against the application's base href. 642 * A normalized URL is absolute from the URL host, includes the application's base href, and has no 643 * trailing slash: 644 * - `/my/app/user/123` is normalized 645 * - `my/app/user/123` **is not** normalized 646 * - `/my/app/user/123/` **is not** normalized 647 * 648 * ### Example 649 * 650 * <code-example path='common/location/ts/path_location_component.ts' 651 * region='LocationComponent'></code-example> 652 * 653 * @publicApi 654 */ 655class Location { 656 constructor(platformStrategy, platformLocation) { 657 /** @internal */ 658 this._subject = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); 659 /** @internal */ 660 this._urlChangeListeners = []; 661 this._platformStrategy = platformStrategy; 662 const browserBaseHref = this._platformStrategy.getBaseHref(); 663 this._platformLocation = platformLocation; 664 this._baseHref = stripTrailingSlash(_stripIndexHtml(browserBaseHref)); 665 this._platformStrategy.onPopState((ev) => { 666 this._subject.emit({ 667 'url': this.path(true), 668 'pop': true, 669 'state': ev.state, 670 'type': ev.type, 671 }); 672 }); 673 } 674 /** 675 * Normalizes the URL path for this location. 676 * 677 * @param includeHash True to include an anchor fragment in the path. 678 * 679 * @returns The normalized URL path. 680 */ 681 // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is 682 // removed. 683 path(includeHash = false) { 684 return this.normalize(this._platformStrategy.path(includeHash)); 685 } 686 /** 687 * Reports the current state of the location history. 688 * @returns The current value of the `history.state` object. 689 */ 690 getState() { 691 return this._platformLocation.getState(); 692 } 693 /** 694 * Normalizes the given path and compares to the current normalized path. 695 * 696 * @param path The given URL path. 697 * @param query Query parameters. 698 * 699 * @returns True if the given URL path is equal to the current normalized path, false 700 * otherwise. 701 */ 702 isCurrentPathEqualTo(path, query = '') { 703 return this.path() == this.normalize(path + normalizeQueryParams(query)); 704 } 705 /** 706 * Normalizes a URL path by stripping any trailing slashes. 707 * 708 * @param url String representing a URL. 709 * 710 * @returns The normalized URL string. 711 */ 712 normalize(url) { 713 return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url))); 714 } 715 /** 716 * Normalizes an external URL path. 717 * If the given URL doesn't begin with a leading slash (`'/'`), adds one 718 * before normalizing. Adds a hash if `HashLocationStrategy` is 719 * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use. 720 * 721 * @param url String representing a URL. 722 * 723 * @returns A normalized platform-specific URL. 724 */ 725 prepareExternalUrl(url) { 726 if (url && url[0] !== '/') { 727 url = '/' + url; 728 } 729 return this._platformStrategy.prepareExternalUrl(url); 730 } 731 // TODO: rename this method to pushState 732 /** 733 * Changes the browser's URL to a normalized version of a given URL, and pushes a 734 * new item onto the platform's history. 735 * 736 * @param path URL path to normalize. 737 * @param query Query parameters. 738 * @param state Location history state. 739 * 740 */ 741 go(path, query = '', state = null) { 742 this._platformStrategy.pushState(state, '', path, query); 743 this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state); 744 } 745 /** 746 * Changes the browser's URL to a normalized version of the given URL, and replaces 747 * the top item on the platform's history stack. 748 * 749 * @param path URL path to normalize. 750 * @param query Query parameters. 751 * @param state Location history state. 752 */ 753 replaceState(path, query = '', state = null) { 754 this._platformStrategy.replaceState(state, '', path, query); 755 this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state); 756 } 757 /** 758 * Navigates forward in the platform's history. 759 */ 760 forward() { 761 this._platformStrategy.forward(); 762 } 763 /** 764 * Navigates back in the platform's history. 765 */ 766 back() { 767 this._platformStrategy.back(); 768 } 769 /** 770 * Registers a URL change listener. Use to catch updates performed by the Angular 771 * framework that are not detectible through "popstate" or "hashchange" events. 772 * 773 * @param fn The change handler function, which take a URL and a location history state. 774 */ 775 onUrlChange(fn) { 776 this._urlChangeListeners.push(fn); 777 if (!this._urlChangeSubscription) { 778 this._urlChangeSubscription = this.subscribe(v => { 779 this._notifyUrlChangeListeners(v.url, v.state); 780 }); 781 } 782 } 783 /** @internal */ 784 _notifyUrlChangeListeners(url = '', state) { 785 this._urlChangeListeners.forEach(fn => fn(url, state)); 786 } 787 /** 788 * Subscribes to the platform's `popState` events. 789 * 790 * @param value Event that is triggered when the state history changes. 791 * @param exception The exception to throw. 792 * 793 * @returns Subscribed events. 794 */ 795 subscribe(onNext, onThrow, onReturn) { 796 return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn }); 797 } 798} 799Location.ɵfac = function Location_Factory(t) { return new (t || Location)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](LocationStrategy), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation)); }; 800/** 801 * Normalizes URL parameters by prepending with `?` if needed. 802 * 803 * @param params String of URL parameters. 804 * 805 * @returns The normalized URL parameters string. 806 */ 807Location.normalizeQueryParams = normalizeQueryParams; 808/** 809 * Joins two parts of a URL with a slash if needed. 810 * 811 * @param start URL string 812 * @param end URL string 813 * 814 * 815 * @returns The joined URL string. 816 */ 817Location.joinWithSlash = joinWithSlash; 818/** 819 * Removes a trailing slash from a URL string if needed. 820 * Looks for the first occurrence of either `#`, `?`, or the end of the 821 * line as `/` characters and removes the trailing slash if one exists. 822 * 823 * @param url URL string. 824 * 825 * @returns The URL string, modified if needed. 826 */ 827Location.stripTrailingSlash = stripTrailingSlash; 828Location.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: createLocation, token: Location, providedIn: "root" }); 829Location.ctorParameters = () => [ 830 { type: LocationStrategy }, 831 { type: PlatformLocation } 832]; 833/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](Location, [{ 834 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], 835 args: [{ 836 providedIn: 'root', 837 // See #23917 838 useFactory: createLocation 839 }] 840 }], function () { return [{ type: LocationStrategy }, { type: PlatformLocation }]; }, null); })(); 841function createLocation() { 842 return new Location(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(LocationStrategy), Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(PlatformLocation)); 843} 844function _stripBaseHref(baseHref, url) { 845 return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url; 846} 847function _stripIndexHtml(url) { 848 return url.replace(/\/index.html$/, ''); 849} 850 851/** 852 * @license 853 * Copyright Google LLC All Rights Reserved. 854 * 855 * Use of this source code is governed by an MIT-style license that can be 856 * found in the LICENSE file at https://angular.io/license 857 */ 858 859/** 860 * @license 861 * Copyright Google LLC All Rights Reserved. 862 * 863 * Use of this source code is governed by an MIT-style license that can be 864 * found in the LICENSE file at https://angular.io/license 865 */ 866/** @internal */ 867const CURRENCIES_EN = { 868 'ADP': [undefined, undefined, 0], 869 'AFN': [undefined, undefined, 0], 870 'ALL': [undefined, undefined, 0], 871 'AMD': [undefined, undefined, 2], 872 'AOA': [undefined, 'Kz'], 873 'ARS': [undefined, '$'], 874 'AUD': ['A$', '$'], 875 'BAM': [undefined, 'KM'], 876 'BBD': [undefined, '$'], 877 'BDT': [undefined, 'à§³'], 878 'BHD': [undefined, undefined, 3], 879 'BIF': [undefined, undefined, 0], 880 'BMD': [undefined, '$'], 881 'BND': [undefined, '$'], 882 'BOB': [undefined, 'Bs'], 883 'BRL': ['R$'], 884 'BSD': [undefined, '$'], 885 'BWP': [undefined, 'P'], 886 'BYN': [undefined, 'Ñ.', 2], 887 'BYR': [undefined, undefined, 0], 888 'BZD': [undefined, '$'], 889 'CAD': ['CA$', '$', 2], 890 'CHF': [undefined, undefined, 2], 891 'CLF': [undefined, undefined, 4], 892 'CLP': [undefined, '$', 0], 893 'CNY': ['CNÂ¥', 'Â¥'], 894 'COP': [undefined, '$', 2], 895 'CRC': [undefined, 'â¡', 2], 896 'CUC': [undefined, '$'], 897 'CUP': [undefined, '$'], 898 'CZK': [undefined, 'KÄ', 2], 899 'DJF': [undefined, undefined, 0], 900 'DKK': [undefined, 'kr', 2], 901 'DOP': [undefined, '$'], 902 'EGP': [undefined, 'E£'], 903 'ESP': [undefined, 'â§', 0], 904 'EUR': ['â¬'], 905 'FJD': [undefined, '$'], 906 'FKP': [undefined, '£'], 907 'GBP': ['£'], 908 'GEL': [undefined, 'â¾'], 909 'GIP': [undefined, '£'], 910 'GNF': [undefined, 'FG', 0], 911 'GTQ': [undefined, 'Q'], 912 'GYD': [undefined, '$', 2], 913 'HKD': ['HK$', '$'], 914 'HNL': [undefined, 'L'], 915 'HRK': [undefined, 'kn'], 916 'HUF': [undefined, 'Ft', 2], 917 'IDR': [undefined, 'Rp', 2], 918 'ILS': ['âª'], 919 'INR': ['â¹'], 920 'IQD': [undefined, undefined, 0], 921 'IRR': [undefined, undefined, 0], 922 'ISK': [undefined, 'kr', 0], 923 'ITL': [undefined, undefined, 0], 924 'JMD': [undefined, '$'], 925 'JOD': [undefined, undefined, 3], 926 'JPY': ['Â¥', undefined, 0], 927 'KHR': [undefined, 'á'], 928 'KMF': [undefined, 'CF', 0], 929 'KPW': [undefined, 'â©', 0], 930 'KRW': ['â©', undefined, 0], 931 'KWD': [undefined, undefined, 3], 932 'KYD': [undefined, '$'], 933 'KZT': [undefined, 'â¸'], 934 'LAK': [undefined, 'â', 0], 935 'LBP': [undefined, 'L£', 0], 936 'LKR': [undefined, 'Rs'], 937 'LRD': [undefined, '$'], 938 'LTL': [undefined, 'Lt'], 939 'LUF': [undefined, undefined, 0], 940 'LVL': [undefined, 'Ls'], 941 'LYD': [undefined, undefined, 3], 942 'MGA': [undefined, 'Ar', 0], 943 'MGF': [undefined, undefined, 0], 944 'MMK': [undefined, 'K', 0], 945 'MNT': [undefined, 'â®', 2], 946 'MRO': [undefined, undefined, 0], 947 'MUR': [undefined, 'Rs', 2], 948 'MXN': ['MX$', '$'], 949 'MYR': [undefined, 'RM'], 950 'NAD': [undefined, '$'], 951 'NGN': [undefined, 'â¦'], 952 'NIO': [undefined, 'C$'], 953 'NOK': [undefined, 'kr', 2], 954 'NPR': [undefined, 'Rs'], 955 'NZD': ['NZ$', '$'], 956 'OMR': [undefined, undefined, 3], 957 'PHP': [undefined, 'â±'], 958 'PKR': [undefined, 'Rs', 2], 959 'PLN': [undefined, 'zÅ'], 960 'PYG': [undefined, 'â²', 0], 961 'RON': [undefined, 'lei'], 962 'RSD': [undefined, undefined, 0], 963 'RUB': [undefined, 'â½'], 964 'RUR': [undefined, 'Ñ.'], 965 'RWF': [undefined, 'RF', 0], 966 'SBD': [undefined, '$'], 967 'SEK': [undefined, 'kr', 2], 968 'SGD': [undefined, '$'], 969 'SHP': [undefined, '£'], 970 'SLL': [undefined, undefined, 0], 971 'SOS': [undefined, undefined, 0], 972 'SRD': [undefined, '$'], 973 'SSP': [undefined, '£'], 974 'STD': [undefined, undefined, 0], 975 'STN': [undefined, 'Db'], 976 'SYP': [undefined, '£', 0], 977 'THB': [undefined, '฿'], 978 'TMM': [undefined, undefined, 0], 979 'TND': [undefined, undefined, 3], 980 'TOP': [undefined, 'T$'], 981 'TRL': [undefined, undefined, 0], 982 'TRY': [undefined, 'âº'], 983 'TTD': [undefined, '$'], 984 'TWD': ['NT$', '$', 2], 985 'TZS': [undefined, undefined, 2], 986 'UAH': [undefined, 'â´'], 987 'UGX': [undefined, undefined, 0], 988 'USD': ['$'], 989 'UYI': [undefined, undefined, 0], 990 'UYU': [undefined, '$'], 991 'UYW': [undefined, undefined, 4], 992 'UZS': [undefined, undefined, 2], 993 'VEF': [undefined, 'Bs', 2], 994 'VND': ['â«', undefined, 0], 995 'VUV': [undefined, undefined, 0], 996 'XAF': ['FCFA', undefined, 0], 997 'XCD': ['EC$', '$'], 998 'XOF': ['CFA', undefined, 0], 999 'XPF': ['CFPF', undefined, 0], 1000 'XXX': ['¤'], 1001 'YER': [undefined, undefined, 0], 1002 'ZAR': [undefined, 'R'], 1003 'ZMK': [undefined, undefined, 0], 1004 'ZMW': [undefined, 'ZK'], 1005 'ZWD': [undefined, undefined, 0] 1006}; 1007 1008/** 1009 * @license 1010 * Copyright Google LLC All Rights Reserved. 1011 * 1012 * Use of this source code is governed by an MIT-style license that can be 1013 * found in the LICENSE file at https://angular.io/license 1014 */ 1015/** 1016 * Format styles that can be used to represent numbers. 1017 * @see `getLocaleNumberFormat()`. 1018 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1019 * 1020 * @publicApi 1021 */ 1022var NumberFormatStyle; 1023(function (NumberFormatStyle) { 1024 NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; 1025 NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; 1026 NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; 1027 NumberFormatStyle[NumberFormatStyle["Scientific"] = 3] = "Scientific"; 1028})(NumberFormatStyle || (NumberFormatStyle = {})); 1029/** 1030 * Plurality cases used for translating plurals to different languages. 1031 * 1032 * @see `NgPlural` 1033 * @see `NgPluralCase` 1034 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1035 * 1036 * @publicApi 1037 */ 1038var Plural; 1039(function (Plural) { 1040 Plural[Plural["Zero"] = 0] = "Zero"; 1041 Plural[Plural["One"] = 1] = "One"; 1042 Plural[Plural["Two"] = 2] = "Two"; 1043 Plural[Plural["Few"] = 3] = "Few"; 1044 Plural[Plural["Many"] = 4] = "Many"; 1045 Plural[Plural["Other"] = 5] = "Other"; 1046})(Plural || (Plural = {})); 1047/** 1048 * Context-dependant translation forms for strings. 1049 * Typically the standalone version is for the nominative form of the word, 1050 * and the format version is used for the genitive case. 1051 * @see [CLDR website](http://cldr.unicode.org/translation/date-time-1/date-time#TOC-Standalone-vs.-Format-Styles) 1052 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1053 * 1054 * @publicApi 1055 */ 1056var FormStyle; 1057(function (FormStyle) { 1058 FormStyle[FormStyle["Format"] = 0] = "Format"; 1059 FormStyle[FormStyle["Standalone"] = 1] = "Standalone"; 1060})(FormStyle || (FormStyle = {})); 1061/** 1062 * String widths available for translations. 1063 * The specific character widths are locale-specific. 1064 * Examples are given for the word "Sunday" in English. 1065 * 1066 * @publicApi 1067 */ 1068var TranslationWidth; 1069(function (TranslationWidth) { 1070 /** 1 character for `en-US`. For example: 'S' */ 1071 TranslationWidth[TranslationWidth["Narrow"] = 0] = "Narrow"; 1072 /** 3 characters for `en-US`. For example: 'Sun' */ 1073 TranslationWidth[TranslationWidth["Abbreviated"] = 1] = "Abbreviated"; 1074 /** Full length for `en-US`. For example: "Sunday" */ 1075 TranslationWidth[TranslationWidth["Wide"] = 2] = "Wide"; 1076 /** 2 characters for `en-US`, For example: "Su" */ 1077 TranslationWidth[TranslationWidth["Short"] = 3] = "Short"; 1078})(TranslationWidth || (TranslationWidth = {})); 1079/** 1080 * String widths available for date-time formats. 1081 * The specific character widths are locale-specific. 1082 * Examples are given for `en-US`. 1083 * 1084 * @see `getLocaleDateFormat()` 1085 * @see `getLocaleTimeFormat()`` 1086 * @see `getLocaleDateTimeFormat()` 1087 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1088 * @publicApi 1089 */ 1090var FormatWidth; 1091(function (FormatWidth) { 1092 /** 1093 * For `en-US`, 'M/d/yy, h:mm a'` 1094 * (Example: `6/15/15, 9:03 AM`) 1095 */ 1096 FormatWidth[FormatWidth["Short"] = 0] = "Short"; 1097 /** 1098 * For `en-US`, `'MMM d, y, h:mm:ss a'` 1099 * (Example: `Jun 15, 2015, 9:03:01 AM`) 1100 */ 1101 FormatWidth[FormatWidth["Medium"] = 1] = "Medium"; 1102 /** 1103 * For `en-US`, `'MMMM d, y, h:mm:ss a z'` 1104 * (Example: `June 15, 2015 at 9:03:01 AM GMT+1`) 1105 */ 1106 FormatWidth[FormatWidth["Long"] = 2] = "Long"; 1107 /** 1108 * For `en-US`, `'EEEE, MMMM d, y, h:mm:ss a zzzz'` 1109 * (Example: `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00`) 1110 */ 1111 FormatWidth[FormatWidth["Full"] = 3] = "Full"; 1112})(FormatWidth || (FormatWidth = {})); 1113/** 1114 * Symbols that can be used to replace placeholders in number patterns. 1115 * Examples are based on `en-US` values. 1116 * 1117 * @see `getLocaleNumberSymbol()` 1118 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1119 * 1120 * @publicApi 1121 */ 1122var NumberSymbol; 1123(function (NumberSymbol) { 1124 /** 1125 * Decimal separator. 1126 * For `en-US`, the dot character. 1127 * Example : 2,345`.`67 1128 */ 1129 NumberSymbol[NumberSymbol["Decimal"] = 0] = "Decimal"; 1130 /** 1131 * Grouping separator, typically for thousands. 1132 * For `en-US`, the comma character. 1133 * Example: 2`,`345.67 1134 */ 1135 NumberSymbol[NumberSymbol["Group"] = 1] = "Group"; 1136 /** 1137 * List-item separator. 1138 * Example: "one, two, and three" 1139 */ 1140 NumberSymbol[NumberSymbol["List"] = 2] = "List"; 1141 /** 1142 * Sign for percentage (out of 100). 1143 * Example: 23.4% 1144 */ 1145 NumberSymbol[NumberSymbol["PercentSign"] = 3] = "PercentSign"; 1146 /** 1147 * Sign for positive numbers. 1148 * Example: +23 1149 */ 1150 NumberSymbol[NumberSymbol["PlusSign"] = 4] = "PlusSign"; 1151 /** 1152 * Sign for negative numbers. 1153 * Example: -23 1154 */ 1155 NumberSymbol[NumberSymbol["MinusSign"] = 5] = "MinusSign"; 1156 /** 1157 * Computer notation for exponential value (n times a power of 10). 1158 * Example: 1.2E3 1159 */ 1160 NumberSymbol[NumberSymbol["Exponential"] = 6] = "Exponential"; 1161 /** 1162 * Human-readable format of exponential. 1163 * Example: 1.2x103 1164 */ 1165 NumberSymbol[NumberSymbol["SuperscriptingExponent"] = 7] = "SuperscriptingExponent"; 1166 /** 1167 * Sign for permille (out of 1000). 1168 * Example: 23.4â° 1169 */ 1170 NumberSymbol[NumberSymbol["PerMille"] = 8] = "PerMille"; 1171 /** 1172 * Infinity, can be used with plus and minus. 1173 * Example: â, +â, -â 1174 */ 1175 NumberSymbol[NumberSymbol["Infinity"] = 9] = "Infinity"; 1176 /** 1177 * Not a number. 1178 * Example: NaN 1179 */ 1180 NumberSymbol[NumberSymbol["NaN"] = 10] = "NaN"; 1181 /** 1182 * Symbol used between time units. 1183 * Example: 10:52 1184 */ 1185 NumberSymbol[NumberSymbol["TimeSeparator"] = 11] = "TimeSeparator"; 1186 /** 1187 * Decimal separator for currency values (fallback to `Decimal`). 1188 * Example: $2,345.67 1189 */ 1190 NumberSymbol[NumberSymbol["CurrencyDecimal"] = 12] = "CurrencyDecimal"; 1191 /** 1192 * Group separator for currency values (fallback to `Group`). 1193 * Example: $2,345.67 1194 */ 1195 NumberSymbol[NumberSymbol["CurrencyGroup"] = 13] = "CurrencyGroup"; 1196})(NumberSymbol || (NumberSymbol = {})); 1197/** 1198 * The value for each day of the week, based on the `en-US` locale 1199 * 1200 * @publicApi 1201 */ 1202var WeekDay; 1203(function (WeekDay) { 1204 WeekDay[WeekDay["Sunday"] = 0] = "Sunday"; 1205 WeekDay[WeekDay["Monday"] = 1] = "Monday"; 1206 WeekDay[WeekDay["Tuesday"] = 2] = "Tuesday"; 1207 WeekDay[WeekDay["Wednesday"] = 3] = "Wednesday"; 1208 WeekDay[WeekDay["Thursday"] = 4] = "Thursday"; 1209 WeekDay[WeekDay["Friday"] = 5] = "Friday"; 1210 WeekDay[WeekDay["Saturday"] = 6] = "Saturday"; 1211})(WeekDay || (WeekDay = {})); 1212/** 1213 * Retrieves the locale ID from the currently loaded locale. 1214 * The loaded locale could be, for example, a global one rather than a regional one. 1215 * @param locale A locale code, such as `fr-FR`. 1216 * @returns The locale code. For example, `fr`. 1217 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1218 * 1219 * @publicApi 1220 */ 1221function getLocaleId(locale) { 1222 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].LocaleId]; 1223} 1224/** 1225 * Retrieves day period strings for the given locale. 1226 * 1227 * @param locale A locale code for the locale format rules to use. 1228 * @param formStyle The required grammatical form. 1229 * @param width The required character width. 1230 * @returns An array of localized period strings. For example, `[AM, PM]` for `en-US`. 1231 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1232 * 1233 * @publicApi 1234 */ 1235function getLocaleDayPeriods(locale, formStyle, width) { 1236 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1237 const amPmData = [ 1238 data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DayPeriodsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DayPeriodsStandalone] 1239 ]; 1240 const amPm = getLastDefinedValue(amPmData, formStyle); 1241 return getLastDefinedValue(amPm, width); 1242} 1243/** 1244 * Retrieves days of the week for the given locale, using the Gregorian calendar. 1245 * 1246 * @param locale A locale code for the locale format rules to use. 1247 * @param formStyle The required grammatical form. 1248 * @param width The required character width. 1249 * @returns An array of localized name strings. 1250 * For example,`[Sunday, Monday, ... Saturday]` for `en-US`. 1251 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1252 * 1253 * @publicApi 1254 */ 1255function getLocaleDayNames(locale, formStyle, width) { 1256 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1257 const daysData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DaysFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DaysStandalone]]; 1258 const days = getLastDefinedValue(daysData, formStyle); 1259 return getLastDefinedValue(days, width); 1260} 1261/** 1262 * Retrieves months of the year for the given locale, using the Gregorian calendar. 1263 * 1264 * @param locale A locale code for the locale format rules to use. 1265 * @param formStyle The required grammatical form. 1266 * @param width The required character width. 1267 * @returns An array of localized name strings. 1268 * For example, `[January, February, ...]` for `en-US`. 1269 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1270 * 1271 * @publicApi 1272 */ 1273function getLocaleMonthNames(locale, formStyle, width) { 1274 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1275 const monthsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].MonthsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].MonthsStandalone]]; 1276 const months = getLastDefinedValue(monthsData, formStyle); 1277 return getLastDefinedValue(months, width); 1278} 1279/** 1280 * Retrieves Gregorian-calendar eras for the given locale. 1281 * @param locale A locale code for the locale format rules to use. 1282 * @param formStyle The required grammatical form. 1283 * @param width The required character width. 1284 1285 * @returns An array of localized era strings. 1286 * For example, `[AD, BC]` for `en-US`. 1287 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1288 * 1289 * @publicApi 1290 */ 1291function getLocaleEraNames(locale, width) { 1292 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1293 const erasData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Eras]; 1294 return getLastDefinedValue(erasData, width); 1295} 1296/** 1297 * Retrieves the first day of the week for the given locale. 1298 * 1299 * @param locale A locale code for the locale format rules to use. 1300 * @returns A day index number, using the 0-based week-day index for `en-US` 1301 * (Sunday = 0, Monday = 1, ...). 1302 * For example, for `fr-FR`, returns 1 to indicate that the first day is Monday. 1303 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1304 * 1305 * @publicApi 1306 */ 1307function getLocaleFirstDayOfWeek(locale) { 1308 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1309 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].FirstDayOfWeek]; 1310} 1311/** 1312 * Range of week days that are considered the week-end for the given locale. 1313 * 1314 * @param locale A locale code for the locale format rules to use. 1315 * @returns The range of day values, `[startDay, endDay]`. 1316 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1317 * 1318 * @publicApi 1319 */ 1320function getLocaleWeekEndRange(locale) { 1321 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1322 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].WeekendRange]; 1323} 1324/** 1325 * Retrieves a localized date-value formating string. 1326 * 1327 * @param locale A locale code for the locale format rules to use. 1328 * @param width The format type. 1329 * @returns The localized formating string. 1330 * @see `FormatWidth` 1331 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1332 * 1333 * @publicApi 1334 */ 1335function getLocaleDateFormat(locale, width) { 1336 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1337 return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DateFormat], width); 1338} 1339/** 1340 * Retrieves a localized time-value formatting string. 1341 * 1342 * @param locale A locale code for the locale format rules to use. 1343 * @param width The format type. 1344 * @returns The localized formatting string. 1345 * @see `FormatWidth` 1346 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1347 1348 * @publicApi 1349 */ 1350function getLocaleTimeFormat(locale, width) { 1351 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1352 return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].TimeFormat], width); 1353} 1354/** 1355 * Retrieves a localized date-time formatting string. 1356 * 1357 * @param locale A locale code for the locale format rules to use. 1358 * @param width The format type. 1359 * @returns The localized formatting string. 1360 * @see `FormatWidth` 1361 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1362 * 1363 * @publicApi 1364 */ 1365function getLocaleDateTimeFormat(locale, width) { 1366 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1367 const dateTimeFormatData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DateTimeFormat]; 1368 return getLastDefinedValue(dateTimeFormatData, width); 1369} 1370/** 1371 * Retrieves a localized number symbol that can be used to replace placeholders in number formats. 1372 * @param locale The locale code. 1373 * @param symbol The symbol to localize. 1374 * @returns The character for the localized symbol. 1375 * @see `NumberSymbol` 1376 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1377 * 1378 * @publicApi 1379 */ 1380function getLocaleNumberSymbol(locale, symbol) { 1381 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1382 const res = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][symbol]; 1383 if (typeof res === 'undefined') { 1384 if (symbol === NumberSymbol.CurrencyDecimal) { 1385 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][NumberSymbol.Decimal]; 1386 } 1387 else if (symbol === NumberSymbol.CurrencyGroup) { 1388 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][NumberSymbol.Group]; 1389 } 1390 } 1391 return res; 1392} 1393/** 1394 * Retrieves a number format for a given locale. 1395 * 1396 * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00` 1397 * when used to format the number 12345.678 could result in "12'345,678". That would happen if the 1398 * grouping separator for your language is an apostrophe, and the decimal separator is a comma. 1399 * 1400 * <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders 1401 * that stand for the decimal separator, and so on, and are NOT real characters. 1402 * You must NOT "translate" the placeholders. For example, don't change `.` to `,` even though in 1403 * your language the decimal point is written with a comma. The symbols should be replaced by the 1404 * local equivalents, using the appropriate `NumberSymbol` for your language. 1405 * 1406 * Here are the special characters used in number patterns: 1407 * 1408 * | Symbol | Meaning | 1409 * |--------|---------| 1410 * | . | Replaced automatically by the character used for the decimal point. | 1411 * | , | Replaced by the "grouping" (thousands) separator. | 1412 * | 0 | Replaced by a digit (or zero if there aren't enough digits). | 1413 * | # | Replaced by a digit (or nothing if there aren't enough). | 1414 * | ¤ | Replaced by a currency symbol, such as $ or USD. | 1415 * | % | Marks a percent format. The % symbol may change position, but must be retained. | 1416 * | E | Marks a scientific format. The E symbol may change position, but must be retained. | 1417 * | ' | Special characters used as literal characters are quoted with ASCII single quotes. | 1418 * 1419 * @param locale A locale code for the locale format rules to use. 1420 * @param type The type of numeric value to be formatted (such as `Decimal` or `Currency`.) 1421 * @returns The localized format string. 1422 * @see `NumberFormatStyle` 1423 * @see [CLDR website](http://cldr.unicode.org/translation/number-patterns) 1424 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1425 * 1426 * @publicApi 1427 */ 1428function getLocaleNumberFormat(locale, type) { 1429 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1430 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberFormats][type]; 1431} 1432/** 1433 * Retrieves the symbol used to represent the currency for the main country 1434 * corresponding to a given locale. For example, '$' for `en-US`. 1435 * 1436 * @param locale A locale code for the locale format rules to use. 1437 * @returns The localized symbol character, 1438 * or `null` if the main country cannot be determined. 1439 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1440 * 1441 * @publicApi 1442 */ 1443function getLocaleCurrencySymbol(locale) { 1444 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1445 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].CurrencySymbol] || null; 1446} 1447/** 1448 * Retrieves the name of the currency for the main country corresponding 1449 * to a given locale. For example, 'US Dollar' for `en-US`. 1450 * @param locale A locale code for the locale format rules to use. 1451 * @returns The currency name, 1452 * or `null` if the main country cannot be determined. 1453 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1454 * 1455 * @publicApi 1456 */ 1457function getLocaleCurrencyName(locale) { 1458 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1459 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].CurrencyName] || null; 1460} 1461/** 1462 * Retrieves the default currency code for the given locale. 1463 * 1464 * The default is defined as the first currency which is still in use. 1465 * 1466 * @param locale The code of the locale whose currency code we want. 1467 * @returns The code of the default currency for the given locale. 1468 * 1469 * @publicApi 1470 */ 1471function getLocaleCurrencyCode(locale) { 1472 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵgetLocaleCurrencyCode"])(locale); 1473} 1474/** 1475 * Retrieves the currency values for a given locale. 1476 * @param locale A locale code for the locale format rules to use. 1477 * @returns The currency values. 1478 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1479 */ 1480function getLocaleCurrencies(locale) { 1481 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1482 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Currencies]; 1483} 1484/** 1485 * @alias core/ɵgetLocalePluralCase 1486 * @publicApi 1487 */ 1488const getLocalePluralCase = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵgetLocalePluralCase"]; 1489function checkFullData(data) { 1490 if (!data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData]) { 1491 throw new Error(`Missing extra locale data for the locale "${data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"] 1492 .LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`); 1493 } 1494} 1495/** 1496 * Retrieves locale-specific rules used to determine which day period to use 1497 * when more than one period is defined for a locale. 1498 * 1499 * There is a rule for each defined day period. The 1500 * first rule is applied to the first day period and so on. 1501 * Fall back to AM/PM when no rules are available. 1502 * 1503 * A rule can specify a period as time range, or as a single time value. 1504 * 1505 * This functionality is only available when you have loaded the full locale data. 1506 * See the ["I18n guide"](guide/i18n#i18n-pipes). 1507 * 1508 * @param locale A locale code for the locale format rules to use. 1509 * @returns The rules for the locale, a single time value or array of *from-time, to-time*, 1510 * or null if no periods are available. 1511 * 1512 * @see `getLocaleExtraDayPeriods()` 1513 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1514 * 1515 * @publicApi 1516 */ 1517function getLocaleExtraDayPeriodRules(locale) { 1518 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1519 checkFullData(data); 1520 const rules = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][2 /* ExtraDayPeriodsRules */] || []; 1521 return rules.map((rule) => { 1522 if (typeof rule === 'string') { 1523 return extractTime(rule); 1524 } 1525 return [extractTime(rule[0]), extractTime(rule[1])]; 1526 }); 1527} 1528/** 1529 * Retrieves locale-specific day periods, which indicate roughly how a day is broken up 1530 * in different languages. 1531 * For example, for `en-US`, periods are morning, noon, afternoon, evening, and midnight. 1532 * 1533 * This functionality is only available when you have loaded the full locale data. 1534 * See the ["I18n guide"](guide/i18n#i18n-pipes). 1535 * 1536 * @param locale A locale code for the locale format rules to use. 1537 * @param formStyle The required grammatical form. 1538 * @param width The required character width. 1539 * @returns The translated day-period strings. 1540 * @see `getLocaleExtraDayPeriodRules()` 1541 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1542 * 1543 * @publicApi 1544 */ 1545function getLocaleExtraDayPeriods(locale, formStyle, width) { 1546 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1547 checkFullData(data); 1548 const dayPeriodsData = [ 1549 data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][0 /* ExtraDayPeriodFormats */], 1550 data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][1 /* ExtraDayPeriodStandalone */] 1551 ]; 1552 const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || []; 1553 return getLastDefinedValue(dayPeriods, width) || []; 1554} 1555/** 1556 * Retrieves the writing direction of a specified locale 1557 * @param locale A locale code for the locale format rules to use. 1558 * @publicApi 1559 * @returns 'rtl' or 'ltr' 1560 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1561 */ 1562function getLocaleDirection(locale) { 1563 const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale); 1564 return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Directionality]; 1565} 1566/** 1567 * Retrieves the first value that is defined in an array, going backwards from an index position. 1568 * 1569 * To avoid repeating the same data (as when the "format" and "standalone" forms are the same) 1570 * add the first value to the locale data arrays, and add other values only if they are different. 1571 * 1572 * @param data The data array to retrieve from. 1573 * @param index A 0-based index into the array to start from. 1574 * @returns The value immediately before the given index position. 1575 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1576 * 1577 * @publicApi 1578 */ 1579function getLastDefinedValue(data, index) { 1580 for (let i = index; i > -1; i--) { 1581 if (typeof data[i] !== 'undefined') { 1582 return data[i]; 1583 } 1584 } 1585 throw new Error('Locale data API: locale data undefined'); 1586} 1587/** 1588 * Extracts the hours and minutes from a string like "15:45" 1589 */ 1590function extractTime(time) { 1591 const [h, m] = time.split(':'); 1592 return { hours: +h, minutes: +m }; 1593} 1594/** 1595 * Retrieves the currency symbol for a given currency code. 1596 * 1597 * For example, for the default `en-US` locale, the code `USD` can 1598 * be represented by the narrow symbol `$` or the wide symbol `US$`. 1599 * 1600 * @param code The currency code. 1601 * @param format The format, `wide` or `narrow`. 1602 * @param locale A locale code for the locale format rules to use. 1603 * 1604 * @returns The symbol, or the currency code if no symbol is available. 1605 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1606 * 1607 * @publicApi 1608 */ 1609function getCurrencySymbol(code, format, locale = 'en') { 1610 const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || []; 1611 const symbolNarrow = currency[1 /* SymbolNarrow */]; 1612 if (format === 'narrow' && typeof symbolNarrow === 'string') { 1613 return symbolNarrow; 1614 } 1615 return currency[0 /* Symbol */] || code; 1616} 1617// Most currencies have cents, that's why the default is 2 1618const DEFAULT_NB_OF_CURRENCY_DIGITS = 2; 1619/** 1620 * Reports the number of decimal digits for a given currency. 1621 * The value depends upon the presence of cents in that particular currency. 1622 * 1623 * @param code The currency code. 1624 * @returns The number of decimal digits, typically 0 or 2. 1625 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1626 * 1627 * @publicApi 1628 */ 1629function getNumberOfCurrencyDigits(code) { 1630 let digits; 1631 const currency = CURRENCIES_EN[code]; 1632 if (currency) { 1633 digits = currency[2 /* NbOfDigits */]; 1634 } 1635 return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS; 1636} 1637 1638/** 1639 * @license 1640 * Copyright Google LLC All Rights Reserved. 1641 * 1642 * Use of this source code is governed by an MIT-style license that can be 1643 * found in the LICENSE file at https://angular.io/license 1644 */ 1645const ISO8601_DATE_REGEX = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; 1646// 1 2 3 4 5 6 7 8 9 10 11 1647const NAMED_FORMATS = {}; 1648const DATE_FORMATS_SPLIT = /((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/; 1649var ZoneWidth; 1650(function (ZoneWidth) { 1651 ZoneWidth[ZoneWidth["Short"] = 0] = "Short"; 1652 ZoneWidth[ZoneWidth["ShortGMT"] = 1] = "ShortGMT"; 1653 ZoneWidth[ZoneWidth["Long"] = 2] = "Long"; 1654 ZoneWidth[ZoneWidth["Extended"] = 3] = "Extended"; 1655})(ZoneWidth || (ZoneWidth = {})); 1656var DateType; 1657(function (DateType) { 1658 DateType[DateType["FullYear"] = 0] = "FullYear"; 1659 DateType[DateType["Month"] = 1] = "Month"; 1660 DateType[DateType["Date"] = 2] = "Date"; 1661 DateType[DateType["Hours"] = 3] = "Hours"; 1662 DateType[DateType["Minutes"] = 4] = "Minutes"; 1663 DateType[DateType["Seconds"] = 5] = "Seconds"; 1664 DateType[DateType["FractionalSeconds"] = 6] = "FractionalSeconds"; 1665 DateType[DateType["Day"] = 7] = "Day"; 1666})(DateType || (DateType = {})); 1667var TranslationType; 1668(function (TranslationType) { 1669 TranslationType[TranslationType["DayPeriods"] = 0] = "DayPeriods"; 1670 TranslationType[TranslationType["Days"] = 1] = "Days"; 1671 TranslationType[TranslationType["Months"] = 2] = "Months"; 1672 TranslationType[TranslationType["Eras"] = 3] = "Eras"; 1673})(TranslationType || (TranslationType = {})); 1674/** 1675 * @ngModule CommonModule 1676 * @description 1677 * 1678 * Formats a date according to locale rules. 1679 * 1680 * @param value The date to format, as a Date, or a number (milliseconds since UTC epoch) 1681 * or an [ISO date-time string](https://www.w3.org/TR/NOTE-datetime). 1682 * @param format The date-time components to include. See `DatePipe` for details. 1683 * @param locale A locale code for the locale format rules to use. 1684 * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`), 1685 * or a standard UTC/GMT or continental US time zone abbreviation. 1686 * If not specified, uses host system settings. 1687 * 1688 * @returns The formatted date string. 1689 * 1690 * @see `DatePipe` 1691 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 1692 * 1693 * @publicApi 1694 */ 1695function formatDate(value, format, locale, timezone) { 1696 let date = toDate(value); 1697 const namedFormat = getNamedFormat(locale, format); 1698 format = namedFormat || format; 1699 let parts = []; 1700 let match; 1701 while (format) { 1702 match = DATE_FORMATS_SPLIT.exec(format); 1703 if (match) { 1704 parts = parts.concat(match.slice(1)); 1705 const part = parts.pop(); 1706 if (!part) { 1707 break; 1708 } 1709 format = part; 1710 } 1711 else { 1712 parts.push(format); 1713 break; 1714 } 1715 } 1716 let dateTimezoneOffset = date.getTimezoneOffset(); 1717 if (timezone) { 1718 dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); 1719 date = convertTimezoneToLocal(date, timezone, true); 1720 } 1721 let text = ''; 1722 parts.forEach(value => { 1723 const dateFormatter = getDateFormatter(value); 1724 text += dateFormatter ? 1725 dateFormatter(date, locale, dateTimezoneOffset) : 1726 value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\''); 1727 }); 1728 return text; 1729} 1730function getNamedFormat(locale, format) { 1731 const localeId = getLocaleId(locale); 1732 NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {}; 1733 if (NAMED_FORMATS[localeId][format]) { 1734 return NAMED_FORMATS[localeId][format]; 1735 } 1736 let formatValue = ''; 1737 switch (format) { 1738 case 'shortDate': 1739 formatValue = getLocaleDateFormat(locale, FormatWidth.Short); 1740 break; 1741 case 'mediumDate': 1742 formatValue = getLocaleDateFormat(locale, FormatWidth.Medium); 1743 break; 1744 case 'longDate': 1745 formatValue = getLocaleDateFormat(locale, FormatWidth.Long); 1746 break; 1747 case 'fullDate': 1748 formatValue = getLocaleDateFormat(locale, FormatWidth.Full); 1749 break; 1750 case 'shortTime': 1751 formatValue = getLocaleTimeFormat(locale, FormatWidth.Short); 1752 break; 1753 case 'mediumTime': 1754 formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium); 1755 break; 1756 case 'longTime': 1757 formatValue = getLocaleTimeFormat(locale, FormatWidth.Long); 1758 break; 1759 case 'fullTime': 1760 formatValue = getLocaleTimeFormat(locale, FormatWidth.Full); 1761 break; 1762 case 'short': 1763 const shortTime = getNamedFormat(locale, 'shortTime'); 1764 const shortDate = getNamedFormat(locale, 'shortDate'); 1765 formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]); 1766 break; 1767 case 'medium': 1768 const mediumTime = getNamedFormat(locale, 'mediumTime'); 1769 const mediumDate = getNamedFormat(locale, 'mediumDate'); 1770 formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]); 1771 break; 1772 case 'long': 1773 const longTime = getNamedFormat(locale, 'longTime'); 1774 const longDate = getNamedFormat(locale, 'longDate'); 1775 formatValue = 1776 formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]); 1777 break; 1778 case 'full': 1779 const fullTime = getNamedFormat(locale, 'fullTime'); 1780 const fullDate = getNamedFormat(locale, 'fullDate'); 1781 formatValue = 1782 formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]); 1783 break; 1784 } 1785 if (formatValue) { 1786 NAMED_FORMATS[localeId][format] = formatValue; 1787 } 1788 return formatValue; 1789} 1790function formatDateTime(str, opt_values) { 1791 if (opt_values) { 1792 str = str.replace(/\{([^}]+)}/g, function (match, key) { 1793 return (opt_values != null && key in opt_values) ? opt_values[key] : match; 1794 }); 1795 } 1796 return str; 1797} 1798function padNumber(num, digits, minusSign = '-', trim, negWrap) { 1799 let neg = ''; 1800 if (num < 0 || (negWrap && num <= 0)) { 1801 if (negWrap) { 1802 num = -num + 1; 1803 } 1804 else { 1805 num = -num; 1806 neg = minusSign; 1807 } 1808 } 1809 let strNum = String(num); 1810 while (strNum.length < digits) { 1811 strNum = '0' + strNum; 1812 } 1813 if (trim) { 1814 strNum = strNum.substr(strNum.length - digits); 1815 } 1816 return neg + strNum; 1817} 1818function formatFractionalSeconds(milliseconds, digits) { 1819 const strMs = padNumber(milliseconds, 3); 1820 return strMs.substr(0, digits); 1821} 1822/** 1823 * Returns a date formatter that transforms a date into its locale digit representation 1824 */ 1825function dateGetter(name, size, offset = 0, trim = false, negWrap = false) { 1826 return function (date, locale) { 1827 let part = getDatePart(name, date); 1828 if (offset > 0 || part > -offset) { 1829 part += offset; 1830 } 1831 if (name === DateType.Hours) { 1832 if (part === 0 && offset === -12) { 1833 part = 12; 1834 } 1835 } 1836 else if (name === DateType.FractionalSeconds) { 1837 return formatFractionalSeconds(part, size); 1838 } 1839 const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign); 1840 return padNumber(part, size, localeMinus, trim, negWrap); 1841 }; 1842} 1843function getDatePart(part, date) { 1844 switch (part) { 1845 case DateType.FullYear: 1846 return date.getFullYear(); 1847 case DateType.Month: 1848 return date.getMonth(); 1849 case DateType.Date: 1850 return date.getDate(); 1851 case DateType.Hours: 1852 return date.getHours(); 1853 case DateType.Minutes: 1854 return date.getMinutes(); 1855 case DateType.Seconds: 1856 return date.getSeconds(); 1857 case DateType.FractionalSeconds: 1858 return date.getMilliseconds(); 1859 case DateType.Day: 1860 return date.getDay(); 1861 default: 1862 throw new Error(`Unknown DateType value "${part}".`); 1863 } 1864} 1865/** 1866 * Returns a date formatter that transforms a date into its locale string representation 1867 */ 1868function dateStrGetter(name, width, form = FormStyle.Format, extended = false) { 1869 return function (date, locale) { 1870 return getDateTranslation(date, locale, name, width, form, extended); 1871 }; 1872} 1873/** 1874 * Returns the locale translation of a date for a given form, type and width 1875 */ 1876function getDateTranslation(date, locale, name, width, form, extended) { 1877 switch (name) { 1878 case TranslationType.Months: 1879 return getLocaleMonthNames(locale, form, width)[date.getMonth()]; 1880 case TranslationType.Days: 1881 return getLocaleDayNames(locale, form, width)[date.getDay()]; 1882 case TranslationType.DayPeriods: 1883 const currentHours = date.getHours(); 1884 const currentMinutes = date.getMinutes(); 1885 if (extended) { 1886 const rules = getLocaleExtraDayPeriodRules(locale); 1887 const dayPeriods = getLocaleExtraDayPeriods(locale, form, width); 1888 const index = rules.findIndex(rule => { 1889 if (Array.isArray(rule)) { 1890 // morning, afternoon, evening, night 1891 const [from, to] = rule; 1892 const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes; 1893 const beforeTo = (currentHours < to.hours || 1894 (currentHours === to.hours && currentMinutes < to.minutes)); 1895 // We must account for normal rules that span a period during the day (e.g. 6am-9am) 1896 // where `from` is less (earlier) than `to`. But also rules that span midnight (e.g. 1897 // 10pm - 5am) where `from` is greater (later!) than `to`. 1898 // 1899 // In the first case the current time must be BOTH after `from` AND before `to` 1900 // (e.g. 8am is after 6am AND before 10am). 1901 // 1902 // In the second case the current time must be EITHER after `from` OR before `to` 1903 // (e.g. 4am is before 5am but not after 10pm; and 11pm is not before 5am but it is 1904 // after 10pm). 1905 if (from.hours < to.hours) { 1906 if (afterFrom && beforeTo) { 1907 return true; 1908 } 1909 } 1910 else if (afterFrom || beforeTo) { 1911 return true; 1912 } 1913 } 1914 else { // noon or midnight 1915 if (rule.hours === currentHours && rule.minutes === currentMinutes) { 1916 return true; 1917 } 1918 } 1919 return false; 1920 }); 1921 if (index !== -1) { 1922 return dayPeriods[index]; 1923 } 1924 } 1925 // if no rules for the day periods, we use am/pm by default 1926 return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1]; 1927 case TranslationType.Eras: 1928 return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1]; 1929 default: 1930 // This default case is not needed by TypeScript compiler, as the switch is exhaustive. 1931 // However Closure Compiler does not understand that and reports an error in typed mode. 1932 // The `throw new Error` below works around the problem, and the unexpected: never variable 1933 // makes sure tsc still checks this code is unreachable. 1934 const unexpected = name; 1935 throw new Error(`unexpected translation type ${unexpected}`); 1936 } 1937} 1938/** 1939 * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or 1940 * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30, 1941 * extended = +04:30) 1942 */ 1943function timeZoneGetter(width) { 1944 return function (date, locale, offset) { 1945 const zone = -1 * offset; 1946 const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign); 1947 const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60); 1948 switch (width) { 1949 case ZoneWidth.Short: 1950 return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + 1951 padNumber(Math.abs(zone % 60), 2, minusSign); 1952 case ZoneWidth.ShortGMT: 1953 return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign); 1954 case ZoneWidth.Long: 1955 return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + 1956 padNumber(Math.abs(zone % 60), 2, minusSign); 1957 case ZoneWidth.Extended: 1958 if (offset === 0) { 1959 return 'Z'; 1960 } 1961 else { 1962 return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + 1963 padNumber(Math.abs(zone % 60), 2, minusSign); 1964 } 1965 default: 1966 throw new Error(`Unknown zone width "${width}"`); 1967 } 1968 }; 1969} 1970const JANUARY = 0; 1971const THURSDAY = 4; 1972function getFirstThursdayOfYear(year) { 1973 const firstDayOfYear = (new Date(year, JANUARY, 1)).getDay(); 1974 return new Date(year, 0, 1 + ((firstDayOfYear <= THURSDAY) ? THURSDAY : THURSDAY + 7) - firstDayOfYear); 1975} 1976function getThursdayThisWeek(datetime) { 1977 return new Date(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay())); 1978} 1979function weekGetter(size, monthBased = false) { 1980 return function (date, locale) { 1981 let result; 1982 if (monthBased) { 1983 const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1; 1984 const today = date.getDate(); 1985 result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7); 1986 } 1987 else { 1988 const firstThurs = getFirstThursdayOfYear(date.getFullYear()); 1989 const thisThurs = getThursdayThisWeek(date); 1990 const diff = thisThurs.getTime() - firstThurs.getTime(); 1991 result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week 1992 } 1993 return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); 1994 }; 1995} 1996const DATE_FORMATS = {}; 1997// Based on CLDR formats: 1998// See complete list: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table 1999// See also explanations: http://cldr.unicode.org/translation/date-time 2000// TODO(ocombe): support all missing cldr formats: Y, U, Q, D, F, e, c, j, J, C, A, v, V, X, x 2001function getDateFormatter(format) { 2002 if (DATE_FORMATS[format]) { 2003 return DATE_FORMATS[format]; 2004 } 2005 let formatter; 2006 switch (format) { 2007 // Era name (AD/BC) 2008 case 'G': 2009 case 'GG': 2010 case 'GGG': 2011 formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated); 2012 break; 2013 case 'GGGG': 2014 formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide); 2015 break; 2016 case 'GGGGG': 2017 formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow); 2018 break; 2019 // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199) 2020 case 'y': 2021 formatter = dateGetter(DateType.FullYear, 1, 0, false, true); 2022 break; 2023 // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) 2024 case 'yy': 2025 formatter = dateGetter(DateType.FullYear, 2, 0, true, true); 2026 break; 2027 // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10) 2028 case 'yyy': 2029 formatter = dateGetter(DateType.FullYear, 3, 0, false, true); 2030 break; 2031 // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010) 2032 case 'yyyy': 2033 formatter = dateGetter(DateType.FullYear, 4, 0, false, true); 2034 break; 2035 // Month of the year (1-12), numeric 2036 case 'M': 2037 case 'L': 2038 formatter = dateGetter(DateType.Month, 1, 1); 2039 break; 2040 case 'MM': 2041 case 'LL': 2042 formatter = dateGetter(DateType.Month, 2, 1); 2043 break; 2044 // Month of the year (January, ...), string, format 2045 case 'MMM': 2046 formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated); 2047 break; 2048 case 'MMMM': 2049 formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide); 2050 break; 2051 case 'MMMMM': 2052 formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow); 2053 break; 2054 // Month of the year (January, ...), string, standalone 2055 case 'LLL': 2056 formatter = 2057 dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone); 2058 break; 2059 case 'LLLL': 2060 formatter = 2061 dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone); 2062 break; 2063 case 'LLLLL': 2064 formatter = 2065 dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone); 2066 break; 2067 // Week of the year (1, ... 52) 2068 case 'w': 2069 formatter = weekGetter(1); 2070 break; 2071 case 'ww': 2072 formatter = weekGetter(2); 2073 break; 2074 // Week of the month (1, ...) 2075 case 'W': 2076 formatter = weekGetter(1, true); 2077 break; 2078 // Day of the month (1-31) 2079 case 'd': 2080 formatter = dateGetter(DateType.Date, 1); 2081 break; 2082 case 'dd': 2083 formatter = dateGetter(DateType.Date, 2); 2084 break; 2085 // Day of the Week 2086 case 'E': 2087 case 'EE': 2088 case 'EEE': 2089 formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated); 2090 break; 2091 case 'EEEE': 2092 formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide); 2093 break; 2094 case 'EEEEE': 2095 formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow); 2096 break; 2097 case 'EEEEEE': 2098 formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short); 2099 break; 2100 // Generic period of the day (am-pm) 2101 case 'a': 2102 case 'aa': 2103 case 'aaa': 2104 formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated); 2105 break; 2106 case 'aaaa': 2107 formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide); 2108 break; 2109 case 'aaaaa': 2110 formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow); 2111 break; 2112 // Extended period of the day (midnight, at night, ...), standalone 2113 case 'b': 2114 case 'bb': 2115 case 'bbb': 2116 formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true); 2117 break; 2118 case 'bbbb': 2119 formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true); 2120 break; 2121 case 'bbbbb': 2122 formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true); 2123 break; 2124 // Extended period of the day (midnight, night, ...), standalone 2125 case 'B': 2126 case 'BB': 2127 case 'BBB': 2128 formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true); 2129 break; 2130 case 'BBBB': 2131 formatter = 2132 dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true); 2133 break; 2134 case 'BBBBB': 2135 formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true); 2136 break; 2137 // Hour in AM/PM, (1-12) 2138 case 'h': 2139 formatter = dateGetter(DateType.Hours, 1, -12); 2140 break; 2141 case 'hh': 2142 formatter = dateGetter(DateType.Hours, 2, -12); 2143 break; 2144 // Hour of the day (0-23) 2145 case 'H': 2146 formatter = dateGetter(DateType.Hours, 1); 2147 break; 2148 // Hour in day, padded (00-23) 2149 case 'HH': 2150 formatter = dateGetter(DateType.Hours, 2); 2151 break; 2152 // Minute of the hour (0-59) 2153 case 'm': 2154 formatter = dateGetter(DateType.Minutes, 1); 2155 break; 2156 case 'mm': 2157 formatter = dateGetter(DateType.Minutes, 2); 2158 break; 2159 // Second of the minute (0-59) 2160 case 's': 2161 formatter = dateGetter(DateType.Seconds, 1); 2162 break; 2163 case 'ss': 2164 formatter = dateGetter(DateType.Seconds, 2); 2165 break; 2166 // Fractional second 2167 case 'S': 2168 formatter = dateGetter(DateType.FractionalSeconds, 1); 2169 break; 2170 case 'SS': 2171 formatter = dateGetter(DateType.FractionalSeconds, 2); 2172 break; 2173 case 'SSS': 2174 formatter = dateGetter(DateType.FractionalSeconds, 3); 2175 break; 2176 // Timezone ISO8601 short format (-0430) 2177 case 'Z': 2178 case 'ZZ': 2179 case 'ZZZ': 2180 formatter = timeZoneGetter(ZoneWidth.Short); 2181 break; 2182 // Timezone ISO8601 extended format (-04:30) 2183 case 'ZZZZZ': 2184 formatter = timeZoneGetter(ZoneWidth.Extended); 2185 break; 2186 // Timezone GMT short format (GMT+4) 2187 case 'O': 2188 case 'OO': 2189 case 'OOO': 2190 // Should be location, but fallback to format O instead because we don't have the data yet 2191 case 'z': 2192 case 'zz': 2193 case 'zzz': 2194 formatter = timeZoneGetter(ZoneWidth.ShortGMT); 2195 break; 2196 // Timezone GMT long format (GMT+0430) 2197 case 'OOOO': 2198 case 'ZZZZ': 2199 // Should be location, but fallback to format O instead because we don't have the data yet 2200 case 'zzzz': 2201 formatter = timeZoneGetter(ZoneWidth.Long); 2202 break; 2203 default: 2204 return null; 2205 } 2206 DATE_FORMATS[format] = formatter; 2207 return formatter; 2208} 2209function timezoneToOffset(timezone, fallback) { 2210 // Support: IE 9-11 only, Edge 13-15+ 2211 // IE/Edge do not "understand" colon (`:`) in timezone 2212 timezone = timezone.replace(/:/g, ''); 2213 const requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000; 2214 return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset; 2215} 2216function addDateMinutes(date, minutes) { 2217 date = new Date(date.getTime()); 2218 date.setMinutes(date.getMinutes() + minutes); 2219 return date; 2220} 2221function convertTimezoneToLocal(date, timezone, reverse) { 2222 const reverseValue = reverse ? -1 : 1; 2223 const dateTimezoneOffset = date.getTimezoneOffset(); 2224 const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); 2225 return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset)); 2226} 2227/** 2228 * Converts a value to date. 2229 * 2230 * Supported input formats: 2231 * - `Date` 2232 * - number: timestamp 2233 * - string: numeric (e.g. "1234"), ISO and date strings in a format supported by 2234 * [Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). 2235 * Note: ISO strings without time return a date without timeoffset. 2236 * 2237 * Throws if unable to convert to a date. 2238 */ 2239function toDate(value) { 2240 if (isDate(value)) { 2241 return value; 2242 } 2243 if (typeof value === 'number' && !isNaN(value)) { 2244 return new Date(value); 2245 } 2246 if (typeof value === 'string') { 2247 value = value.trim(); 2248 const parsedNb = parseFloat(value); 2249 // any string that only contains numbers, like "1234" but not like "1234hello" 2250 if (!isNaN(value - parsedNb)) { 2251 return new Date(parsedNb); 2252 } 2253 if (/^(\d{4}-\d{1,2}-\d{1,2})$/.test(value)) { 2254 /* For ISO Strings without time the day, month and year must be extracted from the ISO String 2255 before Date creation to avoid time offset and errors in the new Date. 2256 If we only replace '-' with ',' in the ISO String ("2015,01,01"), and try to create a new 2257 date, some browsers (e.g. IE 9) will throw an invalid Date error. 2258 If we leave the '-' ("2015-01-01") and try to create a new Date("2015-01-01") the timeoffset 2259 is applied. 2260 Note: ISO months are 0 for January, 1 for February, ... */ 2261 const [y, m, d] = value.split('-').map((val) => +val); 2262 return new Date(y, m - 1, d); 2263 } 2264 let match; 2265 if (match = value.match(ISO8601_DATE_REGEX)) { 2266 return isoStringToDate(match); 2267 } 2268 } 2269 const date = new Date(value); 2270 if (!isDate(date)) { 2271 throw new Error(`Unable to convert "${value}" into a date`); 2272 } 2273 return date; 2274} 2275/** 2276 * Converts a date in ISO8601 to a Date. 2277 * Used instead of `Date.parse` because of browser discrepancies. 2278 */ 2279function isoStringToDate(match) { 2280 const date = new Date(0); 2281 let tzHour = 0; 2282 let tzMin = 0; 2283 // match[8] means that the string contains "Z" (UTC) or a timezone like "+01:00" or "+0100" 2284 const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear; 2285 const timeSetter = match[8] ? date.setUTCHours : date.setHours; 2286 // if there is a timezone defined like "+01:00" or "+0100" 2287 if (match[9]) { 2288 tzHour = Number(match[9] + match[10]); 2289 tzMin = Number(match[9] + match[11]); 2290 } 2291 dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3])); 2292 const h = Number(match[4] || 0) - tzHour; 2293 const m = Number(match[5] || 0) - tzMin; 2294 const s = Number(match[6] || 0); 2295 const ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); 2296 timeSetter.call(date, h, m, s, ms); 2297 return date; 2298} 2299function isDate(value) { 2300 return value instanceof Date && !isNaN(value.valueOf()); 2301} 2302 2303/** 2304 * @license 2305 * Copyright Google LLC All Rights Reserved. 2306 * 2307 * Use of this source code is governed by an MIT-style license that can be 2308 * found in the LICENSE file at https://angular.io/license 2309 */ 2310const NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/; 2311const MAX_DIGITS = 22; 2312const DECIMAL_SEP = '.'; 2313const ZERO_CHAR = '0'; 2314const PATTERN_SEP = ';'; 2315const GROUP_SEP = ','; 2316const DIGIT_CHAR = '#'; 2317const CURRENCY_CHAR = '¤'; 2318const PERCENT_CHAR = '%'; 2319/** 2320 * Transforms a number to a locale string based on a style and a format. 2321 */ 2322function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) { 2323 let formattedText = ''; 2324 let isZero = false; 2325 if (!isFinite(value)) { 2326 formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity); 2327 } 2328 else { 2329 let parsedNumber = parseNumber(value); 2330 if (isPercent) { 2331 parsedNumber = toPercent(parsedNumber); 2332 } 2333 let minInt = pattern.minInt; 2334 let minFraction = pattern.minFrac; 2335 let maxFraction = pattern.maxFrac; 2336 if (digitsInfo) { 2337 const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP); 2338 if (parts === null) { 2339 throw new Error(`${digitsInfo} is not a valid digit info`); 2340 } 2341 const minIntPart = parts[1]; 2342 const minFractionPart = parts[3]; 2343 const maxFractionPart = parts[5]; 2344 if (minIntPart != null) { 2345 minInt = parseIntAutoRadix(minIntPart); 2346 } 2347 if (minFractionPart != null) { 2348 minFraction = parseIntAutoRadix(minFractionPart); 2349 } 2350 if (maxFractionPart != null) { 2351 maxFraction = parseIntAutoRadix(maxFractionPart); 2352 } 2353 else if (minFractionPart != null && minFraction > maxFraction) { 2354 maxFraction = minFraction; 2355 } 2356 } 2357 roundNumber(parsedNumber, minFraction, maxFraction); 2358 let digits = parsedNumber.digits; 2359 let integerLen = parsedNumber.integerLen; 2360 const exponent = parsedNumber.exponent; 2361 let decimals = []; 2362 isZero = digits.every(d => !d); 2363 // pad zeros for small numbers 2364 for (; integerLen < minInt; integerLen++) { 2365 digits.unshift(0); 2366 } 2367 // pad zeros for small numbers 2368 for (; integerLen < 0; integerLen++) { 2369 digits.unshift(0); 2370 } 2371 // extract decimals digits 2372 if (integerLen > 0) { 2373 decimals = digits.splice(integerLen, digits.length); 2374 } 2375 else { 2376 decimals = digits; 2377 digits = [0]; 2378 } 2379 // format the integer digits with grouping separators 2380 const groups = []; 2381 if (digits.length >= pattern.lgSize) { 2382 groups.unshift(digits.splice(-pattern.lgSize, digits.length).join('')); 2383 } 2384 while (digits.length > pattern.gSize) { 2385 groups.unshift(digits.splice(-pattern.gSize, digits.length).join('')); 2386 } 2387 if (digits.length) { 2388 groups.unshift(digits.join('')); 2389 } 2390 formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol)); 2391 // append the decimal digits 2392 if (decimals.length) { 2393 formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join(''); 2394 } 2395 if (exponent) { 2396 formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent; 2397 } 2398 } 2399 if (value < 0 && !isZero) { 2400 formattedText = pattern.negPre + formattedText + pattern.negSuf; 2401 } 2402 else { 2403 formattedText = pattern.posPre + formattedText + pattern.posSuf; 2404 } 2405 return formattedText; 2406} 2407/** 2408 * @ngModule CommonModule 2409 * @description 2410 * 2411 * Formats a number as currency using locale rules. 2412 * 2413 * @param value The number to format. 2414 * @param locale A locale code for the locale format rules to use. 2415 * @param currency A string containing the currency symbol or its name, 2416 * such as "$" or "Canadian Dollar". Used in output string, but does not affect the operation 2417 * of the function. 2418 * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 2419 * currency code, such as `USD` for the US dollar and `EUR` for the euro. 2420 * Used to determine the number of digits in the decimal part. 2421 * @param digitInfo Decimal representation options, specified by a string in the following format: 2422 * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details. 2423 * 2424 * @returns The formatted currency value. 2425 * 2426 * @see `formatNumber()` 2427 * @see `DecimalPipe` 2428 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 2429 * 2430 * @publicApi 2431 */ 2432function formatCurrency(value, locale, currency, currencyCode, digitsInfo) { 2433 const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency); 2434 const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); 2435 pattern.minFrac = getNumberOfCurrencyDigits(currencyCode); 2436 pattern.maxFrac = pattern.minFrac; 2437 const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo); 2438 return res 2439 .replace(CURRENCY_CHAR, currency) 2440 // if we have 2 time the currency character, the second one is ignored 2441 .replace(CURRENCY_CHAR, '') 2442 // If there is a spacing between currency character and the value and 2443 // the currency character is supressed by passing an empty string, the 2444 // spacing character would remain as part of the string. Then we 2445 // should remove it. 2446 .trim(); 2447} 2448/** 2449 * @ngModule CommonModule 2450 * @description 2451 * 2452 * Formats a number as a percentage according to locale rules. 2453 * 2454 * @param value The number to format. 2455 * @param locale A locale code for the locale format rules to use. 2456 * @param digitInfo Decimal representation options, specified by a string in the following format: 2457 * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details. 2458 * 2459 * @returns The formatted percentage value. 2460 * 2461 * @see `formatNumber()` 2462 * @see `DecimalPipe` 2463 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 2464 * @publicApi 2465 * 2466 */ 2467function formatPercent(value, locale, digitsInfo) { 2468 const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent); 2469 const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); 2470 const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true); 2471 return res.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign)); 2472} 2473/** 2474 * @ngModule CommonModule 2475 * @description 2476 * 2477 * Formats a number as text, with group sizing, separator, and other 2478 * parameters based on the locale. 2479 * 2480 * @param value The number to format. 2481 * @param locale A locale code for the locale format rules to use. 2482 * @param digitInfo Decimal representation options, specified by a string in the following format: 2483 * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details. 2484 * 2485 * @returns The formatted text string. 2486 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 2487 * 2488 * @publicApi 2489 */ 2490function formatNumber(value, locale, digitsInfo) { 2491 const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal); 2492 const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); 2493 return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo); 2494} 2495function parseNumberFormat(format, minusSign = '-') { 2496 const p = { 2497 minInt: 1, 2498 minFrac: 0, 2499 maxFrac: 0, 2500 posPre: '', 2501 posSuf: '', 2502 negPre: '', 2503 negSuf: '', 2504 gSize: 0, 2505 lgSize: 0 2506 }; 2507 const patternParts = format.split(PATTERN_SEP); 2508 const positive = patternParts[0]; 2509 const negative = patternParts[1]; 2510 const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? 2511 positive.split(DECIMAL_SEP) : 2512 [ 2513 positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), 2514 positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1) 2515 ], integer = positiveParts[0], fraction = positiveParts[1] || ''; 2516 p.posPre = integer.substr(0, integer.indexOf(DIGIT_CHAR)); 2517 for (let i = 0; i < fraction.length; i++) { 2518 const ch = fraction.charAt(i); 2519 if (ch === ZERO_CHAR) { 2520 p.minFrac = p.maxFrac = i + 1; 2521 } 2522 else if (ch === DIGIT_CHAR) { 2523 p.maxFrac = i + 1; 2524 } 2525 else { 2526 p.posSuf += ch; 2527 } 2528 } 2529 const groups = integer.split(GROUP_SEP); 2530 p.gSize = groups[1] ? groups[1].length : 0; 2531 p.lgSize = (groups[2] || groups[1]) ? (groups[2] || groups[1]).length : 0; 2532 if (negative) { 2533 const trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR); 2534 p.negPre = negative.substr(0, pos).replace(/'/g, ''); 2535 p.negSuf = negative.substr(pos + trunkLen).replace(/'/g, ''); 2536 } 2537 else { 2538 p.negPre = minusSign + p.posPre; 2539 p.negSuf = p.posSuf; 2540 } 2541 return p; 2542} 2543// Transforms a parsed number into a percentage by multiplying it by 100 2544function toPercent(parsedNumber) { 2545 // if the number is 0, don't do anything 2546 if (parsedNumber.digits[0] === 0) { 2547 return parsedNumber; 2548 } 2549 // Getting the current number of decimals 2550 const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen; 2551 if (parsedNumber.exponent) { 2552 parsedNumber.exponent += 2; 2553 } 2554 else { 2555 if (fractionLen === 0) { 2556 parsedNumber.digits.push(0, 0); 2557 } 2558 else if (fractionLen === 1) { 2559 parsedNumber.digits.push(0); 2560 } 2561 parsedNumber.integerLen += 2; 2562 } 2563 return parsedNumber; 2564} 2565/** 2566 * Parses a number. 2567 * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/ 2568 */ 2569function parseNumber(num) { 2570 let numStr = Math.abs(num) + ''; 2571 let exponent = 0, digits, integerLen; 2572 let i, j, zeros; 2573 // Decimal point? 2574 if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) { 2575 numStr = numStr.replace(DECIMAL_SEP, ''); 2576 } 2577 // Exponential form? 2578 if ((i = numStr.search(/e/i)) > 0) { 2579 // Work out the exponent. 2580 if (integerLen < 0) 2581 integerLen = i; 2582 integerLen += +numStr.slice(i + 1); 2583 numStr = numStr.substring(0, i); 2584 } 2585 else if (integerLen < 0) { 2586 // There was no decimal point or exponent so it is an integer. 2587 integerLen = numStr.length; 2588 } 2589 // Count the number of leading zeros. 2590 for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */ 2591 } 2592 if (i === (zeros = numStr.length)) { 2593 // The digits are all zero. 2594 digits = [0]; 2595 integerLen = 1; 2596 } 2597 else { 2598 // Count the number of trailing zeros 2599 zeros--; 2600 while (numStr.charAt(zeros) === ZERO_CHAR) 2601 zeros--; 2602 // Trailing zeros are insignificant so ignore them 2603 integerLen -= i; 2604 digits = []; 2605 // Convert string to array of digits without leading/trailing zeros. 2606 for (j = 0; i <= zeros; i++, j++) { 2607 digits[j] = Number(numStr.charAt(i)); 2608 } 2609 } 2610 // If the number overflows the maximum allowed digits then use an exponent. 2611 if (integerLen > MAX_DIGITS) { 2612 digits = digits.splice(0, MAX_DIGITS - 1); 2613 exponent = integerLen - 1; 2614 integerLen = 1; 2615 } 2616 return { digits, exponent, integerLen }; 2617} 2618/** 2619 * Round the parsed number to the specified number of decimal places 2620 * This function changes the parsedNumber in-place 2621 */ 2622function roundNumber(parsedNumber, minFrac, maxFrac) { 2623 if (minFrac > maxFrac) { 2624 throw new Error(`The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`); 2625 } 2626 let digits = parsedNumber.digits; 2627 let fractionLen = digits.length - parsedNumber.integerLen; 2628 const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac); 2629 // The index of the digit to where rounding is to occur 2630 let roundAt = fractionSize + parsedNumber.integerLen; 2631 let digit = digits[roundAt]; 2632 if (roundAt > 0) { 2633 // Drop fractional digits beyond `roundAt` 2634 digits.splice(Math.max(parsedNumber.integerLen, roundAt)); 2635 // Set non-fractional digits beyond `roundAt` to 0 2636 for (let j = roundAt; j < digits.length; j++) { 2637 digits[j] = 0; 2638 } 2639 } 2640 else { 2641 // We rounded to zero so reset the parsedNumber 2642 fractionLen = Math.max(0, fractionLen); 2643 parsedNumber.integerLen = 1; 2644 digits.length = Math.max(1, roundAt = fractionSize + 1); 2645 digits[0] = 0; 2646 for (let i = 1; i < roundAt; i++) 2647 digits[i] = 0; 2648 } 2649 if (digit >= 5) { 2650 if (roundAt - 1 < 0) { 2651 for (let k = 0; k > roundAt; k--) { 2652 digits.unshift(0); 2653 parsedNumber.integerLen++; 2654 } 2655 digits.unshift(1); 2656 parsedNumber.integerLen++; 2657 } 2658 else { 2659 digits[roundAt - 1]++; 2660 } 2661 } 2662 // Pad out with zeros to get the required fraction length 2663 for (; fractionLen < Math.max(0, fractionSize); fractionLen++) 2664 digits.push(0); 2665 let dropTrailingZeros = fractionSize !== 0; 2666 // Minimal length = nb of decimals required + current nb of integers 2667 // Any number besides that is optional and can be removed if it's a trailing 0 2668 const minLen = minFrac + parsedNumber.integerLen; 2669 // Do any carrying, e.g. a digit was rounded up to 10 2670 const carry = digits.reduceRight(function (carry, d, i, digits) { 2671 d = d + carry; 2672 digits[i] = d < 10 ? d : d - 10; // d % 10 2673 if (dropTrailingZeros) { 2674 // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52) 2675 if (digits[i] === 0 && i >= minLen) { 2676 digits.pop(); 2677 } 2678 else { 2679 dropTrailingZeros = false; 2680 } 2681 } 2682 return d >= 10 ? 1 : 0; // Math.floor(d / 10); 2683 }, 0); 2684 if (carry) { 2685 digits.unshift(carry); 2686 parsedNumber.integerLen++; 2687 } 2688} 2689function parseIntAutoRadix(text) { 2690 const result = parseInt(text); 2691 if (isNaN(result)) { 2692 throw new Error('Invalid integer literal when parsing ' + text); 2693 } 2694 return result; 2695} 2696 2697/** 2698 * @license 2699 * Copyright Google LLC All Rights Reserved. 2700 * 2701 * Use of this source code is governed by an MIT-style license that can be 2702 * found in the LICENSE file at https://angular.io/license 2703 */ 2704/** 2705 * @publicApi 2706 */ 2707class NgLocalization { 2708} 2709/** 2710 * Returns the plural category for a given value. 2711 * - "=value" when the case exists, 2712 * - the plural category otherwise 2713 */ 2714function getPluralCategory(value, cases, ngLocalization, locale) { 2715 let key = `=${value}`; 2716 if (cases.indexOf(key) > -1) { 2717 return key; 2718 } 2719 key = ngLocalization.getPluralCategory(value, locale); 2720 if (cases.indexOf(key) > -1) { 2721 return key; 2722 } 2723 if (cases.indexOf('other') > -1) { 2724 return 'other'; 2725 } 2726 throw new Error(`No plural message found for value "${value}"`); 2727} 2728/** 2729 * Returns the plural case based on the locale 2730 * 2731 * @publicApi 2732 */ 2733class NgLocaleLocalization extends NgLocalization { 2734 constructor(locale) { 2735 super(); 2736 this.locale = locale; 2737 } 2738 getPluralCategory(value, locale) { 2739 const plural = getLocalePluralCase(locale || this.locale)(value); 2740 switch (plural) { 2741 case Plural.Zero: 2742 return 'zero'; 2743 case Plural.One: 2744 return 'one'; 2745 case Plural.Two: 2746 return 'two'; 2747 case Plural.Few: 2748 return 'few'; 2749 case Plural.Many: 2750 return 'many'; 2751 default: 2752 return 'other'; 2753 } 2754 } 2755} 2756NgLocaleLocalization.ɵfac = function NgLocaleLocalization_Factory(t) { return new (t || NgLocaleLocalization)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])); }; 2757NgLocaleLocalization.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: NgLocaleLocalization, factory: NgLocaleLocalization.ɵfac }); 2758NgLocaleLocalization.ctorParameters = () => [ 2759 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] } 2760]; 2761/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgLocaleLocalization, [{ 2762 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 2763 }], function () { return [{ type: String, decorators: [{ 2764 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 2765 args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]] 2766 }] }]; }, null); })(); 2767 2768/** 2769 * @license 2770 * Copyright Google LLC All Rights Reserved. 2771 * 2772 * Use of this source code is governed by an MIT-style license that can be 2773 * found in the LICENSE file at https://angular.io/license 2774 */ 2775/** 2776 * Register global data to be used internally by Angular. See the 2777 * ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale data. 2778 * 2779 * The signature registerLocaleData(data: any, extraData?: any) is deprecated since v5.1 2780 * 2781 * @publicApi 2782 */ 2783function registerLocaleData(data, localeId, extraData) { 2784 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵregisterLocaleData"])(data, localeId, extraData); 2785} 2786 2787/** 2788 * @license 2789 * Copyright Google LLC All Rights Reserved. 2790 * 2791 * Use of this source code is governed by an MIT-style license that can be 2792 * found in the LICENSE file at https://angular.io/license 2793 */ 2794function parseCookieValue(cookieStr, name) { 2795 name = encodeURIComponent(name); 2796 for (const cookie of cookieStr.split(';')) { 2797 const eqIndex = cookie.indexOf('='); 2798 const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)]; 2799 if (cookieName.trim() === name) { 2800 return decodeURIComponent(cookieValue); 2801 } 2802 } 2803 return null; 2804} 2805 2806/** 2807 * @license 2808 * Copyright Google LLC All Rights Reserved. 2809 * 2810 * Use of this source code is governed by an MIT-style license that can be 2811 * found in the LICENSE file at https://angular.io/license 2812 */ 2813/** 2814 * @ngModule CommonModule 2815 * 2816 * @usageNotes 2817 * ``` 2818 * <some-element [ngClass]="'first second'">...</some-element> 2819 * 2820 * <some-element [ngClass]="['first', 'second']">...</some-element> 2821 * 2822 * <some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element> 2823 * 2824 * <some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element> 2825 * 2826 * <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element> 2827 * ``` 2828 * 2829 * @description 2830 * 2831 * Adds and removes CSS classes on an HTML element. 2832 * 2833 * The CSS classes are updated as follows, depending on the type of the expression evaluation: 2834 * - `string` - the CSS classes listed in the string (space delimited) are added, 2835 * - `Array` - the CSS classes declared as Array elements are added, 2836 * - `Object` - keys are CSS classes that get added when the expression given in the value 2837 * evaluates to a truthy value, otherwise they are removed. 2838 * 2839 * @publicApi 2840 */ 2841class NgClass { 2842 constructor(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { 2843 this._iterableDiffers = _iterableDiffers; 2844 this._keyValueDiffers = _keyValueDiffers; 2845 this._ngEl = _ngEl; 2846 this._renderer = _renderer; 2847 this._iterableDiffer = null; 2848 this._keyValueDiffer = null; 2849 this._initialClasses = []; 2850 this._rawClass = null; 2851 } 2852 set klass(value) { 2853 this._removeClasses(this._initialClasses); 2854 this._initialClasses = typeof value === 'string' ? value.split(/\s+/) : []; 2855 this._applyClasses(this._initialClasses); 2856 this._applyClasses(this._rawClass); 2857 } 2858 set ngClass(value) { 2859 this._removeClasses(this._rawClass); 2860 this._applyClasses(this._initialClasses); 2861 this._iterableDiffer = null; 2862 this._keyValueDiffer = null; 2863 this._rawClass = typeof value === 'string' ? value.split(/\s+/) : value; 2864 if (this._rawClass) { 2865 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisListLikeIterable"])(this._rawClass)) { 2866 this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create(); 2867 } 2868 else { 2869 this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create(); 2870 } 2871 } 2872 } 2873 ngDoCheck() { 2874 if (this._iterableDiffer) { 2875 const iterableChanges = this._iterableDiffer.diff(this._rawClass); 2876 if (iterableChanges) { 2877 this._applyIterableChanges(iterableChanges); 2878 } 2879 } 2880 else if (this._keyValueDiffer) { 2881 const keyValueChanges = this._keyValueDiffer.diff(this._rawClass); 2882 if (keyValueChanges) { 2883 this._applyKeyValueChanges(keyValueChanges); 2884 } 2885 } 2886 } 2887 _applyKeyValueChanges(changes) { 2888 changes.forEachAddedItem((record) => this._toggleClass(record.key, record.currentValue)); 2889 changes.forEachChangedItem((record) => this._toggleClass(record.key, record.currentValue)); 2890 changes.forEachRemovedItem((record) => { 2891 if (record.previousValue) { 2892 this._toggleClass(record.key, false); 2893 } 2894 }); 2895 } 2896 _applyIterableChanges(changes) { 2897 changes.forEachAddedItem((record) => { 2898 if (typeof record.item === 'string') { 2899 this._toggleClass(record.item, true); 2900 } 2901 else { 2902 throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(record.item)}`); 2903 } 2904 }); 2905 changes.forEachRemovedItem((record) => this._toggleClass(record.item, false)); 2906 } 2907 /** 2908 * Applies a collection of CSS classes to the DOM element. 2909 * 2910 * For argument of type Set and Array CSS class names contained in those collections are always 2911 * added. 2912 * For argument of type Map CSS class name in the map's key is toggled based on the value (added 2913 * for truthy and removed for falsy). 2914 */ 2915 _applyClasses(rawClassVal) { 2916 if (rawClassVal) { 2917 if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) { 2918 rawClassVal.forEach((klass) => this._toggleClass(klass, true)); 2919 } 2920 else { 2921 Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, !!rawClassVal[klass])); 2922 } 2923 } 2924 } 2925 /** 2926 * Removes a collection of CSS classes from the DOM element. This is mostly useful for cleanup 2927 * purposes. 2928 */ 2929 _removeClasses(rawClassVal) { 2930 if (rawClassVal) { 2931 if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) { 2932 rawClassVal.forEach((klass) => this._toggleClass(klass, false)); 2933 } 2934 else { 2935 Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false)); 2936 } 2937 } 2938 } 2939 _toggleClass(klass, enabled) { 2940 klass = klass.trim(); 2941 if (klass) { 2942 klass.split(/\s+/g).forEach(klass => { 2943 if (enabled) { 2944 this._renderer.addClass(this._ngEl.nativeElement, klass); 2945 } 2946 else { 2947 this._renderer.removeClass(this._ngEl.nativeElement, klass); 2948 } 2949 }); 2950 } 2951 } 2952} 2953NgClass.ɵfac = function NgClass_Factory(t) { return new (t || NgClass)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"])); }; 2954NgClass.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgClass, selectors: [["", "ngClass", ""]], inputs: { klass: ["class", "klass"], ngClass: "ngClass" } }); 2955NgClass.ctorParameters = () => [ 2956 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] }, 2957 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }, 2958 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, 2959 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] } 2960]; 2961NgClass.propDecorators = { 2962 klass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['class',] }], 2963 ngClass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngClass',] }] 2964}; 2965/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgClass, [{ 2966 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 2967 args: [{ selector: '[ngClass]' }] 2968 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }]; }, { klass: [{ 2969 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 2970 args: ['class'] 2971 }], ngClass: [{ 2972 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 2973 args: ['ngClass'] 2974 }] }); })(); 2975 2976/** 2977 * @license 2978 * Copyright Google LLC All Rights Reserved. 2979 * 2980 * Use of this source code is governed by an MIT-style license that can be 2981 * found in the LICENSE file at https://angular.io/license 2982 */ 2983/** 2984 * Instantiates a single {@link Component} type and inserts its Host View into current View. 2985 * `NgComponentOutlet` provides a declarative approach for dynamic component creation. 2986 * 2987 * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and 2988 * any existing component will get destroyed. 2989 * 2990 * @usageNotes 2991 * 2992 * ### Fine tune control 2993 * 2994 * You can control the component creation process by using the following optional attributes: 2995 * 2996 * * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for 2997 * the Component. Defaults to the injector of the current view container. 2998 * 2999 * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content 3000 * section of the component, if exists. 3001 * 3002 * * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other 3003 * module, then load a component from that module. 3004 * 3005 * ### Syntax 3006 * 3007 * Simple 3008 * ``` 3009 * <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container> 3010 * ``` 3011 * 3012 * Customized injector/content 3013 * ``` 3014 * <ng-container *ngComponentOutlet="componentTypeExpression; 3015 * injector: injectorExpression; 3016 * content: contentNodesExpression;"> 3017 * </ng-container> 3018 * ``` 3019 * 3020 * Customized ngModuleFactory 3021 * ``` 3022 * <ng-container *ngComponentOutlet="componentTypeExpression; 3023 * ngModuleFactory: moduleFactory;"> 3024 * </ng-container> 3025 * ``` 3026 * 3027 * ### A simple example 3028 * 3029 * {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'} 3030 * 3031 * A more complete example with additional options: 3032 * 3033 * {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'} 3034 * 3035 * @publicApi 3036 * @ngModule CommonModule 3037 */ 3038class NgComponentOutlet { 3039 constructor(_viewContainerRef) { 3040 this._viewContainerRef = _viewContainerRef; 3041 this._componentRef = null; 3042 this._moduleRef = null; 3043 } 3044 ngOnChanges(changes) { 3045 this._viewContainerRef.clear(); 3046 this._componentRef = null; 3047 if (this.ngComponentOutlet) { 3048 const elInjector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector; 3049 if (changes['ngComponentOutletNgModuleFactory']) { 3050 if (this._moduleRef) 3051 this._moduleRef.destroy(); 3052 if (this.ngComponentOutletNgModuleFactory) { 3053 const parentModule = elInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModuleRef"]); 3054 this._moduleRef = this.ngComponentOutletNgModuleFactory.create(parentModule.injector); 3055 } 3056 else { 3057 this._moduleRef = null; 3058 } 3059 } 3060 const componentFactoryResolver = this._moduleRef ? this._moduleRef.componentFactoryResolver : 3061 elInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ComponentFactoryResolver"]); 3062 const componentFactory = componentFactoryResolver.resolveComponentFactory(this.ngComponentOutlet); 3063 this._componentRef = this._viewContainerRef.createComponent(componentFactory, this._viewContainerRef.length, elInjector, this.ngComponentOutletContent); 3064 } 3065 } 3066 ngOnDestroy() { 3067 if (this._moduleRef) 3068 this._moduleRef.destroy(); 3069 } 3070} 3071NgComponentOutlet.ɵfac = function NgComponentOutlet_Factory(t) { return new (t || NgComponentOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"])); }; 3072NgComponentOutlet.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgComponentOutlet, selectors: [["", "ngComponentOutlet", ""]], inputs: { ngComponentOutlet: "ngComponentOutlet", ngComponentOutletInjector: "ngComponentOutletInjector", ngComponentOutletContent: "ngComponentOutletContent", ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 3073NgComponentOutlet.ctorParameters = () => [ 3074 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] } 3075]; 3076NgComponentOutlet.propDecorators = { 3077 ngComponentOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 3078 ngComponentOutletInjector: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 3079 ngComponentOutletContent: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 3080 ngComponentOutletNgModuleFactory: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 3081}; 3082/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgComponentOutlet, [{ 3083 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 3084 args: [{ selector: '[ngComponentOutlet]' }] 3085 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }]; }, { ngComponentOutlet: [{ 3086 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3087 }], ngComponentOutletInjector: [{ 3088 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3089 }], ngComponentOutletContent: [{ 3090 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3091 }], ngComponentOutletNgModuleFactory: [{ 3092 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3093 }] }); })(); 3094 3095/** 3096 * @license 3097 * Copyright Google LLC All Rights Reserved. 3098 * 3099 * Use of this source code is governed by an MIT-style license that can be 3100 * found in the LICENSE file at https://angular.io/license 3101 */ 3102/** 3103 * @publicApi 3104 */ 3105class NgForOfContext { 3106 constructor($implicit, ngForOf, index, count) { 3107 this.$implicit = $implicit; 3108 this.ngForOf = ngForOf; 3109 this.index = index; 3110 this.count = count; 3111 } 3112 get first() { 3113 return this.index === 0; 3114 } 3115 get last() { 3116 return this.index === this.count - 1; 3117 } 3118 get even() { 3119 return this.index % 2 === 0; 3120 } 3121 get odd() { 3122 return !this.even; 3123 } 3124} 3125/** 3126 * A [structural directive](guide/structural-directives) that renders 3127 * a template for each item in a collection. 3128 * The directive is placed on an element, which becomes the parent 3129 * of the cloned templates. 3130 * 3131 * The `ngForOf` directive is generally used in the 3132 * [shorthand form](guide/structural-directives#the-asterisk--prefix) `*ngFor`. 3133 * In this form, the template to be rendered for each iteration is the content 3134 * of an anchor element containing the directive. 3135 * 3136 * The following example shows the shorthand syntax with some options, 3137 * contained in an `<li>` element. 3138 * 3139 * ``` 3140 * <li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li> 3141 * ``` 3142 * 3143 * The shorthand form expands into a long form that uses the `ngForOf` selector 3144 * on an `<ng-template>` element. 3145 * The content of the `<ng-template>` element is the `<li>` element that held the 3146 * short-form directive. 3147 * 3148 * Here is the expanded version of the short-form example. 3149 * 3150 * ``` 3151 * <ng-template ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn"> 3152 * <li>...</li> 3153 * </ng-template> 3154 * ``` 3155 * 3156 * Angular automatically expands the shorthand syntax as it compiles the template. 3157 * The context for each embedded view is logically merged to the current component 3158 * context according to its lexical position. 3159 * 3160 * When using the shorthand syntax, Angular allows only [one structural directive 3161 * on an element](guide/structural-directives#one-structural-directive-per-host-element). 3162 * If you want to iterate conditionally, for example, 3163 * put the `*ngIf` on a container element that wraps the `*ngFor` element. 3164 * For futher discussion, see 3165 * [Structural Directives](guide/structural-directives#one-per-element). 3166 * 3167 * @usageNotes 3168 * 3169 * ### Local variables 3170 * 3171 * `NgForOf` provides exported values that can be aliased to local variables. 3172 * For example: 3173 * 3174 * ``` 3175 * <li *ngFor="let user of users; index as i; first as isFirst"> 3176 * {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span> 3177 * </li> 3178 * ``` 3179 * 3180 * The following exported values can be aliased to local variables: 3181 * 3182 * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`). 3183 * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is 3184 * more complex then a property access, for example when using the async pipe (`userStreams | 3185 * async`). 3186 * - `index: number`: The index of the current item in the iterable. 3187 * - `count: number`: The length of the iterable. 3188 * - `first: boolean`: True when the item is the first item in the iterable. 3189 * - `last: boolean`: True when the item is the last item in the iterable. 3190 * - `even: boolean`: True when the item has an even index in the iterable. 3191 * - `odd: boolean`: True when the item has an odd index in the iterable. 3192 * 3193 * ### Change propagation 3194 * 3195 * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM: 3196 * 3197 * * When an item is added, a new instance of the template is added to the DOM. 3198 * * When an item is removed, its template instance is removed from the DOM. 3199 * * When items are reordered, their respective templates are reordered in the DOM. 3200 * 3201 * Angular uses object identity to track insertions and deletions within the iterator and reproduce 3202 * those changes in the DOM. This has important implications for animations and any stateful 3203 * controls that are present, such as `<input>` elements that accept user input. Inserted rows can 3204 * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state 3205 * such as user input. 3206 * For more on animations, see [Transitions and Triggers](guide/transition-and-triggers). 3207 * 3208 * The identities of elements in the iterator can change while the data does not. 3209 * This can happen, for example, if the iterator is produced from an RPC to the server, and that 3210 * RPC is re-run. Even if the data hasn't changed, the second response produces objects with 3211 * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old 3212 * elements were deleted and all new elements inserted). 3213 * 3214 * To avoid this expensive operation, you can customize the default tracking algorithm. 3215 * by supplying the `trackBy` option to `NgForOf`. 3216 * `trackBy` takes a function that has two arguments: `index` and `item`. 3217 * If `trackBy` is given, Angular tracks changes by the return value of the function. 3218 * 3219 * @see [Structural Directives](guide/structural-directives) 3220 * @ngModule CommonModule 3221 * @publicApi 3222 */ 3223class NgForOf { 3224 constructor(_viewContainer, _template, _differs) { 3225 this._viewContainer = _viewContainer; 3226 this._template = _template; 3227 this._differs = _differs; 3228 this._ngForOf = null; 3229 this._ngForOfDirty = true; 3230 this._differ = null; 3231 } 3232 /** 3233 * The value of the iterable expression, which can be used as a 3234 * [template input variable](guide/structural-directives#template-input-variable). 3235 */ 3236 set ngForOf(ngForOf) { 3237 this._ngForOf = ngForOf; 3238 this._ngForOfDirty = true; 3239 } 3240 /** 3241 * A function that defines how to track changes for items in the iterable. 3242 * 3243 * When items are added, moved, or removed in the iterable, 3244 * the directive must re-render the appropriate DOM nodes. 3245 * To minimize churn in the DOM, only nodes that have changed 3246 * are re-rendered. 3247 * 3248 * By default, the change detector assumes that 3249 * the object instance identifies the node in the iterable. 3250 * When this function is supplied, the directive uses 3251 * the result of calling this function to identify the item node, 3252 * rather than the identity of the object itself. 3253 * 3254 * The function receives two inputs, 3255 * the iteration index and the associated node data. 3256 */ 3257 set ngForTrackBy(fn) { 3258 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["isDevMode"])() && fn != null && typeof fn !== 'function') { 3259 // TODO(vicb): use a log service once there is a public one available 3260 if (console && console.warn) { 3261 console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + 3262 `See https://angular.io/api/common/NgForOf#change-propagation for more information.`); 3263 } 3264 } 3265 this._trackByFn = fn; 3266 } 3267 get ngForTrackBy() { 3268 return this._trackByFn; 3269 } 3270 /** 3271 * A reference to the template that is stamped out for each item in the iterable. 3272 * @see [template reference variable](guide/template-reference-variables) 3273 */ 3274 set ngForTemplate(value) { 3275 // TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1 3276 // The current type is too restrictive; a template that just uses index, for example, 3277 // should be acceptable. 3278 if (value) { 3279 this._template = value; 3280 } 3281 } 3282 /** 3283 * Applies the changes when needed. 3284 */ 3285 ngDoCheck() { 3286 if (this._ngForOfDirty) { 3287 this._ngForOfDirty = false; 3288 // React on ngForOf changes only once all inputs have been initialized 3289 const value = this._ngForOf; 3290 if (!this._differ && value) { 3291 try { 3292 this._differ = this._differs.find(value).create(this.ngForTrackBy); 3293 } 3294 catch (_a) { 3295 throw new Error(`Cannot find a differ supporting object '${value}' of type '${getTypeName(value)}'. NgFor only supports binding to Iterables such as Arrays.`); 3296 } 3297 } 3298 } 3299 if (this._differ) { 3300 const changes = this._differ.diff(this._ngForOf); 3301 if (changes) 3302 this._applyChanges(changes); 3303 } 3304 } 3305 _applyChanges(changes) { 3306 const insertTuples = []; 3307 changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => { 3308 if (item.previousIndex == null) { 3309 // NgForOf is never "null" or "undefined" here because the differ detected 3310 // that a new item needs to be inserted from the iterable. This implies that 3311 // there is an iterable value for "_ngForOf". 3312 const view = this._viewContainer.createEmbeddedView(this._template, new NgForOfContext(null, this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex); 3313 const tuple = new RecordViewTuple(item, view); 3314 insertTuples.push(tuple); 3315 } 3316 else if (currentIndex == null) { 3317 this._viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex); 3318 } 3319 else if (adjustedPreviousIndex !== null) { 3320 const view = this._viewContainer.get(adjustedPreviousIndex); 3321 this._viewContainer.move(view, currentIndex); 3322 const tuple = new RecordViewTuple(item, view); 3323 insertTuples.push(tuple); 3324 } 3325 }); 3326 for (let i = 0; i < insertTuples.length; i++) { 3327 this._perViewChange(insertTuples[i].view, insertTuples[i].record); 3328 } 3329 for (let i = 0, ilen = this._viewContainer.length; i < ilen; i++) { 3330 const viewRef = this._viewContainer.get(i); 3331 viewRef.context.index = i; 3332 viewRef.context.count = ilen; 3333 viewRef.context.ngForOf = this._ngForOf; 3334 } 3335 changes.forEachIdentityChange((record) => { 3336 const viewRef = this._viewContainer.get(record.currentIndex); 3337 viewRef.context.$implicit = record.item; 3338 }); 3339 } 3340 _perViewChange(view, record) { 3341 view.context.$implicit = record.item; 3342 } 3343 /** 3344 * Asserts the correct type of the context for the template that `NgForOf` will render. 3345 * 3346 * The presence of this method is a signal to the Ivy template type-check compiler that the 3347 * `NgForOf` structural directive renders its template with a specific context type. 3348 */ 3349 static ngTemplateContextGuard(dir, ctx) { 3350 return true; 3351 } 3352} 3353NgForOf.ɵfac = function NgForOf_Factory(t) { return new (t || NgForOf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"])); }; 3354NgForOf.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgForOf, selectors: [["", "ngFor", "", "ngForOf", ""]], inputs: { ngForOf: "ngForOf", ngForTrackBy: "ngForTrackBy", ngForTemplate: "ngForTemplate" } }); 3355NgForOf.ctorParameters = () => [ 3356 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, 3357 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, 3358 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] } 3359]; 3360NgForOf.propDecorators = { 3361 ngForOf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 3362 ngForTrackBy: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 3363 ngForTemplate: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 3364}; 3365/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgForOf, [{ 3366 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 3367 args: [{ selector: '[ngFor][ngForOf]' }] 3368 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] }]; }, { ngForOf: [{ 3369 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3370 }], ngForTrackBy: [{ 3371 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3372 }], ngForTemplate: [{ 3373 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3374 }] }); })(); 3375class RecordViewTuple { 3376 constructor(record, view) { 3377 this.record = record; 3378 this.view = view; 3379 } 3380} 3381function getTypeName(type) { 3382 return type['name'] || typeof type; 3383} 3384 3385/** 3386 * @license 3387 * Copyright Google LLC All Rights Reserved. 3388 * 3389 * Use of this source code is governed by an MIT-style license that can be 3390 * found in the LICENSE file at https://angular.io/license 3391 */ 3392/** 3393 * A structural directive that conditionally includes a template based on the value of 3394 * an expression coerced to Boolean. 3395 * When the expression evaluates to true, Angular renders the template 3396 * provided in a `then` clause, and when false or null, 3397 * Angular renders the template provided in an optional `else` clause. The default 3398 * template for the `else` clause is blank. 3399 * 3400 * A [shorthand form](guide/structural-directives#the-asterisk--prefix) of the directive, 3401 * `*ngIf="condition"`, is generally used, provided 3402 * as an attribute of the anchor element for the inserted template. 3403 * Angular expands this into a more explicit version, in which the anchor element 3404 * is contained in an `<ng-template>` element. 3405 * 3406 * Simple form with shorthand syntax: 3407 * 3408 * ``` 3409 * <div *ngIf="condition">Content to render when condition is true.</div> 3410 * ``` 3411 * 3412 * Simple form with expanded syntax: 3413 * 3414 * ``` 3415 * <ng-template [ngIf]="condition"><div>Content to render when condition is 3416 * true.</div></ng-template> 3417 * ``` 3418 * 3419 * Form with an "else" block: 3420 * 3421 * ``` 3422 * <div *ngIf="condition; else elseBlock">Content to render when condition is true.</div> 3423 * <ng-template #elseBlock>Content to render when condition is false.</ng-template> 3424 * ``` 3425 * 3426 * Shorthand form with "then" and "else" blocks: 3427 * 3428 * ``` 3429 * <div *ngIf="condition; then thenBlock else elseBlock"></div> 3430 * <ng-template #thenBlock>Content to render when condition is true.</ng-template> 3431 * <ng-template #elseBlock>Content to render when condition is false.</ng-template> 3432 * ``` 3433 * 3434 * Form with storing the value locally: 3435 * 3436 * ``` 3437 * <div *ngIf="condition as value; else elseBlock">{{value}}</div> 3438 * <ng-template #elseBlock>Content to render when value is null.</ng-template> 3439 * ``` 3440 * 3441 * @usageNotes 3442 * 3443 * The `*ngIf` directive is most commonly used to conditionally show an inline template, 3444 * as seen in the following example. 3445 * The default `else` template is blank. 3446 * 3447 * {@example common/ngIf/ts/module.ts region='NgIfSimple'} 3448 * 3449 * ### Showing an alternative template using `else` 3450 * 3451 * To display a template when `expression` evaluates to false, use an `else` template 3452 * binding as shown in the following example. 3453 * The `else` binding points to an `<ng-template>` element labeled `#elseBlock`. 3454 * The template can be defined anywhere in the component view, but is typically placed right after 3455 * `ngIf` for readability. 3456 * 3457 * {@example common/ngIf/ts/module.ts region='NgIfElse'} 3458 * 3459 * ### Using an external `then` template 3460 * 3461 * In the previous example, the then-clause template is specified inline, as the content of the 3462 * tag that contains the `ngIf` directive. You can also specify a template that is defined 3463 * externally, by referencing a labeled `<ng-template>` element. When you do this, you can 3464 * change which template to use at runtime, as shown in the following example. 3465 * 3466 * {@example common/ngIf/ts/module.ts region='NgIfThenElse'} 3467 * 3468 * ### Storing a conditional result in a variable 3469 * 3470 * You might want to show a set of properties from the same object. If you are waiting 3471 * for asynchronous data, the object can be undefined. 3472 * In this case, you can use `ngIf` and store the result of the condition in a local 3473 * variable as shown in the the following example. 3474 * 3475 * {@example common/ngIf/ts/module.ts region='NgIfAs'} 3476 * 3477 * This code uses only one `AsyncPipe`, so only one subscription is created. 3478 * The conditional statement stores the result of `userStream|async` in the local variable `user`. 3479 * You can then bind the local `user` repeatedly. 3480 * 3481 * The conditional displays the data only if `userStream` returns a value, 3482 * so you don't need to use the 3483 * [safe-navigation-operator](guide/template-expression-operators#safe-navigation-operator) (`?.`) 3484 * to guard against null values when accessing properties. 3485 * You can display an alternative template while waiting for the data. 3486 * 3487 * ### Shorthand syntax 3488 * 3489 * The shorthand syntax `*ngIf` expands into two separate template specifications 3490 * for the "then" and "else" clauses. For example, consider the following shorthand statement, 3491 * that is meant to show a loading page while waiting for data to be loaded. 3492 * 3493 * ``` 3494 * <div class="hero-list" *ngIf="heroes else loading"> 3495 * ... 3496 * </div> 3497 * 3498 * <ng-template #loading> 3499 * <div>Loading...</div> 3500 * </ng-template> 3501 * ``` 3502 * 3503 * You can see that the "else" clause references the `<ng-template>` 3504 * with the `#loading` label, and the template for the "then" clause 3505 * is provided as the content of the anchor element. 3506 * 3507 * However, when Angular expands the shorthand syntax, it creates 3508 * another `<ng-template>` tag, with `ngIf` and `ngIfElse` directives. 3509 * The anchor element containing the template for the "then" clause becomes 3510 * the content of this unlabeled `<ng-template>` tag. 3511 * 3512 * ``` 3513 * <ng-template [ngIf]="heroes" [ngIfElse]="loading"> 3514 * <div class="hero-list"> 3515 * ... 3516 * </div> 3517 * </ng-template> 3518 * 3519 * <ng-template #loading> 3520 * <div>Loading...</div> 3521 * </ng-template> 3522 * ``` 3523 * 3524 * The presence of the implicit template object has implications for the nesting of 3525 * structural directives. For more on this subject, see 3526 * [Structural Directives](https://angular.io/guide/structural-directives#one-per-element). 3527 * 3528 * @ngModule CommonModule 3529 * @publicApi 3530 */ 3531class NgIf { 3532 constructor(_viewContainer, templateRef) { 3533 this._viewContainer = _viewContainer; 3534 this._context = new NgIfContext(); 3535 this._thenTemplateRef = null; 3536 this._elseTemplateRef = null; 3537 this._thenViewRef = null; 3538 this._elseViewRef = null; 3539 this._thenTemplateRef = templateRef; 3540 } 3541 /** 3542 * The Boolean expression to evaluate as the condition for showing a template. 3543 */ 3544 set ngIf(condition) { 3545 this._context.$implicit = this._context.ngIf = condition; 3546 this._updateView(); 3547 } 3548 /** 3549 * A template to show if the condition expression evaluates to true. 3550 */ 3551 set ngIfThen(templateRef) { 3552 assertTemplate('ngIfThen', templateRef); 3553 this._thenTemplateRef = templateRef; 3554 this._thenViewRef = null; // clear previous view if any. 3555 this._updateView(); 3556 } 3557 /** 3558 * A template to show if the condition expression evaluates to false. 3559 */ 3560 set ngIfElse(templateRef) { 3561 assertTemplate('ngIfElse', templateRef); 3562 this._elseTemplateRef = templateRef; 3563 this._elseViewRef = null; // clear previous view if any. 3564 this._updateView(); 3565 } 3566 _updateView() { 3567 if (this._context.$implicit) { 3568 if (!this._thenViewRef) { 3569 this._viewContainer.clear(); 3570 this._elseViewRef = null; 3571 if (this._thenTemplateRef) { 3572 this._thenViewRef = 3573 this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context); 3574 } 3575 } 3576 } 3577 else { 3578 if (!this._elseViewRef) { 3579 this._viewContainer.clear(); 3580 this._thenViewRef = null; 3581 if (this._elseTemplateRef) { 3582 this._elseViewRef = 3583 this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context); 3584 } 3585 } 3586 } 3587 } 3588 /** 3589 * Asserts the correct type of the context for the template that `NgIf` will render. 3590 * 3591 * The presence of this method is a signal to the Ivy template type-check compiler that the 3592 * `NgIf` structural directive renders its template with a specific context type. 3593 */ 3594 static ngTemplateContextGuard(dir, ctx) { 3595 return true; 3596 } 3597} 3598NgIf.ɵfac = function NgIf_Factory(t) { return new (t || NgIf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"])); }; 3599NgIf.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgIf, selectors: [["", "ngIf", ""]], inputs: { ngIf: "ngIf", ngIfThen: "ngIfThen", ngIfElse: "ngIfElse" } }); 3600NgIf.ctorParameters = () => [ 3601 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, 3602 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] } 3603]; 3604NgIf.propDecorators = { 3605 ngIf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 3606 ngIfThen: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 3607 ngIfElse: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 3608}; 3609/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgIf, [{ 3610 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 3611 args: [{ selector: '[ngIf]' }] 3612 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }]; }, { ngIf: [{ 3613 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3614 }], ngIfThen: [{ 3615 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3616 }], ngIfElse: [{ 3617 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3618 }] }); })(); 3619/** 3620 * @publicApi 3621 */ 3622class NgIfContext { 3623 constructor() { 3624 this.$implicit = null; 3625 this.ngIf = null; 3626 } 3627} 3628function assertTemplate(property, templateRef) { 3629 const isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView); 3630 if (!isTemplateRefOrNull) { 3631 throw new Error(`${property} must be a TemplateRef, but received '${Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(templateRef)}'.`); 3632 } 3633} 3634 3635/** 3636 * @license 3637 * Copyright Google LLC All Rights Reserved. 3638 * 3639 * Use of this source code is governed by an MIT-style license that can be 3640 * found in the LICENSE file at https://angular.io/license 3641 */ 3642class SwitchView { 3643 constructor(_viewContainerRef, _templateRef) { 3644 this._viewContainerRef = _viewContainerRef; 3645 this._templateRef = _templateRef; 3646 this._created = false; 3647 } 3648 create() { 3649 this._created = true; 3650 this._viewContainerRef.createEmbeddedView(this._templateRef); 3651 } 3652 destroy() { 3653 this._created = false; 3654 this._viewContainerRef.clear(); 3655 } 3656 enforceState(created) { 3657 if (created && !this._created) { 3658 this.create(); 3659 } 3660 else if (!created && this._created) { 3661 this.destroy(); 3662 } 3663 } 3664} 3665/** 3666 * @ngModule CommonModule 3667 * 3668 * @description 3669 * The `[ngSwitch]` directive on a container specifies an expression to match against. 3670 * The expressions to match are provided by `ngSwitchCase` directives on views within the container. 3671 * - Every view that matches is rendered. 3672 * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered. 3673 * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase` 3674 * or `ngSwitchDefault` directive are preserved at the location. 3675 * 3676 * @usageNotes 3677 * Define a container element for the directive, and specify the switch expression 3678 * to match against as an attribute: 3679 * 3680 * ``` 3681 * <container-element [ngSwitch]="switch_expression"> 3682 * ``` 3683 * 3684 * Within the container, `*ngSwitchCase` statements specify the match expressions 3685 * as attributes. Include `*ngSwitchDefault` as the final case. 3686 * 3687 * ``` 3688 * <container-element [ngSwitch]="switch_expression"> 3689 * <some-element *ngSwitchCase="match_expression_1">...</some-element> 3690 * ... 3691 * <some-element *ngSwitchDefault>...</some-element> 3692 * </container-element> 3693 * ``` 3694 * 3695 * ### Usage Examples 3696 * 3697 * The following example shows how to use more than one case to display the same view: 3698 * 3699 * ``` 3700 * <container-element [ngSwitch]="switch_expression"> 3701 * <!-- the same view can be shown in more than one case --> 3702 * <some-element *ngSwitchCase="match_expression_1">...</some-element> 3703 * <some-element *ngSwitchCase="match_expression_2">...</some-element> 3704 * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element> 3705 * <!--default case when there are no matches --> 3706 * <some-element *ngSwitchDefault>...</some-element> 3707 * </container-element> 3708 * ``` 3709 * 3710 * The following example shows how cases can be nested: 3711 * ``` 3712 * <container-element [ngSwitch]="switch_expression"> 3713 * <some-element *ngSwitchCase="match_expression_1">...</some-element> 3714 * <some-element *ngSwitchCase="match_expression_2">...</some-element> 3715 * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element> 3716 * <ng-container *ngSwitchCase="match_expression_3"> 3717 * <!-- use a ng-container to group multiple root nodes --> 3718 * <inner-element></inner-element> 3719 * <inner-other-element></inner-other-element> 3720 * </ng-container> 3721 * <some-element *ngSwitchDefault>...</some-element> 3722 * </container-element> 3723 * ``` 3724 * 3725 * @publicApi 3726 * @see `NgSwitchCase` 3727 * @see `NgSwitchDefault` 3728 * @see [Structural Directives](guide/structural-directives) 3729 * 3730 */ 3731class NgSwitch { 3732 constructor() { 3733 this._defaultUsed = false; 3734 this._caseCount = 0; 3735 this._lastCaseCheckIndex = 0; 3736 this._lastCasesMatched = false; 3737 } 3738 set ngSwitch(newValue) { 3739 this._ngSwitch = newValue; 3740 if (this._caseCount === 0) { 3741 this._updateDefaultCases(true); 3742 } 3743 } 3744 /** @internal */ 3745 _addCase() { 3746 return this._caseCount++; 3747 } 3748 /** @internal */ 3749 _addDefault(view) { 3750 if (!this._defaultViews) { 3751 this._defaultViews = []; 3752 } 3753 this._defaultViews.push(view); 3754 } 3755 /** @internal */ 3756 _matchCase(value) { 3757 const matched = value == this._ngSwitch; 3758 this._lastCasesMatched = this._lastCasesMatched || matched; 3759 this._lastCaseCheckIndex++; 3760 if (this._lastCaseCheckIndex === this._caseCount) { 3761 this._updateDefaultCases(!this._lastCasesMatched); 3762 this._lastCaseCheckIndex = 0; 3763 this._lastCasesMatched = false; 3764 } 3765 return matched; 3766 } 3767 _updateDefaultCases(useDefault) { 3768 if (this._defaultViews && useDefault !== this._defaultUsed) { 3769 this._defaultUsed = useDefault; 3770 for (let i = 0; i < this._defaultViews.length; i++) { 3771 const defaultView = this._defaultViews[i]; 3772 defaultView.enforceState(useDefault); 3773 } 3774 } 3775 } 3776} 3777NgSwitch.ɵfac = function NgSwitch_Factory(t) { return new (t || NgSwitch)(); }; 3778NgSwitch.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitch, selectors: [["", "ngSwitch", ""]], inputs: { ngSwitch: "ngSwitch" } }); 3779NgSwitch.propDecorators = { 3780 ngSwitch: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 3781}; 3782/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitch, [{ 3783 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 3784 args: [{ selector: '[ngSwitch]' }] 3785 }], function () { return []; }, { ngSwitch: [{ 3786 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3787 }] }); })(); 3788/** 3789 * @ngModule CommonModule 3790 * 3791 * @description 3792 * Provides a switch case expression to match against an enclosing `ngSwitch` expression. 3793 * When the expressions match, the given `NgSwitchCase` template is rendered. 3794 * If multiple match expressions match the switch expression value, all of them are displayed. 3795 * 3796 * @usageNotes 3797 * 3798 * Within a switch container, `*ngSwitchCase` statements specify the match expressions 3799 * as attributes. Include `*ngSwitchDefault` as the final case. 3800 * 3801 * ``` 3802 * <container-element [ngSwitch]="switch_expression"> 3803 * <some-element *ngSwitchCase="match_expression_1">...</some-element> 3804 * ... 3805 * <some-element *ngSwitchDefault>...</some-element> 3806 * </container-element> 3807 * ``` 3808 * 3809 * Each switch-case statement contains an in-line HTML template or template reference 3810 * that defines the subtree to be selected if the value of the match expression 3811 * matches the value of the switch expression. 3812 * 3813 * Unlike JavaScript, which uses strict equality, Angular uses loose equality. 3814 * This means that the empty string, `""` matches 0. 3815 * 3816 * @publicApi 3817 * @see `NgSwitch` 3818 * @see `NgSwitchDefault` 3819 * 3820 */ 3821class NgSwitchCase { 3822 constructor(viewContainer, templateRef, ngSwitch) { 3823 this.ngSwitch = ngSwitch; 3824 ngSwitch._addCase(); 3825 this._view = new SwitchView(viewContainer, templateRef); 3826 } 3827 /** 3828 * Performs case matching. For internal use only. 3829 */ 3830 ngDoCheck() { 3831 this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); 3832 } 3833} 3834NgSwitchCase.ɵfac = function NgSwitchCase_Factory(t) { return new (t || NgSwitchCase)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgSwitch, 1)); }; 3835NgSwitchCase.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitchCase, selectors: [["", "ngSwitchCase", ""]], inputs: { ngSwitchCase: "ngSwitchCase" } }); 3836NgSwitchCase.ctorParameters = () => [ 3837 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, 3838 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, 3839 { type: NgSwitch, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] } 3840]; 3841NgSwitchCase.propDecorators = { 3842 ngSwitchCase: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 3843}; 3844/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitchCase, [{ 3845 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 3846 args: [{ selector: '[ngSwitchCase]' }] 3847 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, { type: NgSwitch, decorators: [{ 3848 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 3849 }] }]; }, { ngSwitchCase: [{ 3850 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3851 }] }); })(); 3852/** 3853 * @ngModule CommonModule 3854 * 3855 * @description 3856 * 3857 * Creates a view that is rendered when no `NgSwitchCase` expressions 3858 * match the `NgSwitch` expression. 3859 * This statement should be the final case in an `NgSwitch`. 3860 * 3861 * @publicApi 3862 * @see `NgSwitch` 3863 * @see `NgSwitchCase` 3864 * 3865 */ 3866class NgSwitchDefault { 3867 constructor(viewContainer, templateRef, ngSwitch) { 3868 ngSwitch._addDefault(new SwitchView(viewContainer, templateRef)); 3869 } 3870} 3871NgSwitchDefault.ɵfac = function NgSwitchDefault_Factory(t) { return new (t || NgSwitchDefault)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgSwitch, 1)); }; 3872NgSwitchDefault.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitchDefault, selectors: [["", "ngSwitchDefault", ""]] }); 3873NgSwitchDefault.ctorParameters = () => [ 3874 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, 3875 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, 3876 { type: NgSwitch, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] } 3877]; 3878/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitchDefault, [{ 3879 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 3880 args: [{ selector: '[ngSwitchDefault]' }] 3881 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, { type: NgSwitch, decorators: [{ 3882 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 3883 }] }]; }, null); })(); 3884 3885/** 3886 * @license 3887 * Copyright Google LLC All Rights Reserved. 3888 * 3889 * Use of this source code is governed by an MIT-style license that can be 3890 * found in the LICENSE file at https://angular.io/license 3891 */ 3892/** 3893 * @ngModule CommonModule 3894 * 3895 * @usageNotes 3896 * ``` 3897 * <some-element [ngPlural]="value"> 3898 * <ng-template ngPluralCase="=0">there is nothing</ng-template> 3899 * <ng-template ngPluralCase="=1">there is one</ng-template> 3900 * <ng-template ngPluralCase="few">there are a few</ng-template> 3901 * </some-element> 3902 * ``` 3903 * 3904 * @description 3905 * 3906 * Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization. 3907 * 3908 * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees 3909 * that match the switch expression's pluralization category. 3910 * 3911 * To use this directive you must provide a container element that sets the `[ngPlural]` attribute 3912 * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their 3913 * expression: 3914 * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value 3915 * matches the switch expression exactly, 3916 * - otherwise, the view will be treated as a "category match", and will only display if exact 3917 * value matches aren't found and the value maps to its category for the defined locale. 3918 * 3919 * See http://cldr.unicode.org/index/cldr-spec/plural-rules 3920 * 3921 * @publicApi 3922 */ 3923class NgPlural { 3924 constructor(_localization) { 3925 this._localization = _localization; 3926 this._caseViews = {}; 3927 } 3928 set ngPlural(value) { 3929 this._switchValue = value; 3930 this._updateView(); 3931 } 3932 addCase(value, switchView) { 3933 this._caseViews[value] = switchView; 3934 } 3935 _updateView() { 3936 this._clearViews(); 3937 const cases = Object.keys(this._caseViews); 3938 const key = getPluralCategory(this._switchValue, cases, this._localization); 3939 this._activateView(this._caseViews[key]); 3940 } 3941 _clearViews() { 3942 if (this._activeView) 3943 this._activeView.destroy(); 3944 } 3945 _activateView(view) { 3946 if (view) { 3947 this._activeView = view; 3948 this._activeView.create(); 3949 } 3950 } 3951} 3952NgPlural.ɵfac = function NgPlural_Factory(t) { return new (t || NgPlural)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgLocalization)); }; 3953NgPlural.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgPlural, selectors: [["", "ngPlural", ""]], inputs: { ngPlural: "ngPlural" } }); 3954NgPlural.ctorParameters = () => [ 3955 { type: NgLocalization } 3956]; 3957NgPlural.propDecorators = { 3958 ngPlural: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 3959}; 3960/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgPlural, [{ 3961 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 3962 args: [{ selector: '[ngPlural]' }] 3963 }], function () { return [{ type: NgLocalization }]; }, { ngPlural: [{ 3964 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 3965 }] }); })(); 3966/** 3967 * @ngModule CommonModule 3968 * 3969 * @description 3970 * 3971 * Creates a view that will be added/removed from the parent {@link NgPlural} when the 3972 * given expression matches the plural expression according to CLDR rules. 3973 * 3974 * @usageNotes 3975 * ``` 3976 * <some-element [ngPlural]="value"> 3977 * <ng-template ngPluralCase="=0">...</ng-template> 3978 * <ng-template ngPluralCase="other">...</ng-template> 3979 * </some-element> 3980 *``` 3981 * 3982 * See {@link NgPlural} for more details and example. 3983 * 3984 * @publicApi 3985 */ 3986class NgPluralCase { 3987 constructor(value, template, viewContainer, ngPlural) { 3988 this.value = value; 3989 const isANumber = !isNaN(Number(value)); 3990 ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template)); 3991 } 3992} 3993NgPluralCase.ɵfac = function NgPluralCase_Factory(t) { return new (t || NgPluralCase)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinjectAttribute"]('ngPluralCase'), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgPlural, 1)); }; 3994NgPluralCase.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgPluralCase, selectors: [["", "ngPluralCase", ""]] }); 3995NgPluralCase.ctorParameters = () => [ 3996 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"], args: ['ngPluralCase',] }] }, 3997 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, 3998 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, 3999 { type: NgPlural, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] } 4000]; 4001/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgPluralCase, [{ 4002 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 4003 args: [{ selector: '[ngPluralCase]' }] 4004 }], function () { return [{ type: String, decorators: [{ 4005 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"], 4006 args: ['ngPluralCase'] 4007 }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: NgPlural, decorators: [{ 4008 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 4009 }] }]; }, null); })(); 4010 4011/** 4012 * @license 4013 * Copyright Google LLC All Rights Reserved. 4014 * 4015 * Use of this source code is governed by an MIT-style license that can be 4016 * found in the LICENSE file at https://angular.io/license 4017 */ 4018/** 4019 * @ngModule CommonModule 4020 * 4021 * @usageNotes 4022 * 4023 * Set the font of the containing element to the result of an expression. 4024 * 4025 * ``` 4026 * <some-element [ngStyle]="{'font-style': styleExp}">...</some-element> 4027 * ``` 4028 * 4029 * Set the width of the containing element to a pixel value returned by an expression. 4030 * 4031 * ``` 4032 * <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element> 4033 * ``` 4034 * 4035 * Set a collection of style values using an expression that returns key-value pairs. 4036 * 4037 * ``` 4038 * <some-element [ngStyle]="objExp">...</some-element> 4039 * ``` 4040 * 4041 * @description 4042 * 4043 * An attribute directive that updates styles for the containing HTML element. 4044 * Sets one or more style properties, specified as colon-separated key-value pairs. 4045 * The key is a style name, with an optional `.<unit>` suffix 4046 * (such as 'top.px', 'font-style.em'). 4047 * The value is an expression to be evaluated. 4048 * The resulting non-null value, expressed in the given unit, 4049 * is assigned to the given style property. 4050 * If the result of evaluation is null, the corresponding style is removed. 4051 * 4052 * @publicApi 4053 */ 4054class NgStyle { 4055 constructor(_ngEl, _differs, _renderer) { 4056 this._ngEl = _ngEl; 4057 this._differs = _differs; 4058 this._renderer = _renderer; 4059 this._ngStyle = null; 4060 this._differ = null; 4061 } 4062 set ngStyle(values) { 4063 this._ngStyle = values; 4064 if (!this._differ && values) { 4065 this._differ = this._differs.find(values).create(); 4066 } 4067 } 4068 ngDoCheck() { 4069 if (this._differ) { 4070 const changes = this._differ.diff(this._ngStyle); 4071 if (changes) { 4072 this._applyChanges(changes); 4073 } 4074 } 4075 } 4076 _setStyle(nameAndUnit, value) { 4077 const [name, unit] = nameAndUnit.split('.'); 4078 value = value != null && unit ? `${value}${unit}` : value; 4079 if (value != null) { 4080 this._renderer.setStyle(this._ngEl.nativeElement, name, value); 4081 } 4082 else { 4083 this._renderer.removeStyle(this._ngEl.nativeElement, name); 4084 } 4085 } 4086 _applyChanges(changes) { 4087 changes.forEachRemovedItem((record) => this._setStyle(record.key, null)); 4088 changes.forEachAddedItem((record) => this._setStyle(record.key, record.currentValue)); 4089 changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue)); 4090 } 4091} 4092NgStyle.ɵfac = function NgStyle_Factory(t) { return new (t || NgStyle)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"])); }; 4093NgStyle.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgStyle, selectors: [["", "ngStyle", ""]], inputs: { ngStyle: "ngStyle" } }); 4094NgStyle.ctorParameters = () => [ 4095 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, 4096 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }, 4097 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] } 4098]; 4099NgStyle.propDecorators = { 4100 ngStyle: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngStyle',] }] 4101}; 4102/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgStyle, [{ 4103 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 4104 args: [{ selector: '[ngStyle]' }] 4105 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }]; }, { ngStyle: [{ 4106 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 4107 args: ['ngStyle'] 4108 }] }); })(); 4109 4110/** 4111 * @license 4112 * Copyright Google LLC All Rights Reserved. 4113 * 4114 * Use of this source code is governed by an MIT-style license that can be 4115 * found in the LICENSE file at https://angular.io/license 4116 */ 4117/** 4118 * @ngModule CommonModule 4119 * 4120 * @description 4121 * 4122 * Inserts an embedded view from a prepared `TemplateRef`. 4123 * 4124 * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`. 4125 * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding 4126 * by the local template `let` declarations. 4127 * 4128 * @usageNotes 4129 * ``` 4130 * <ng-container *ngTemplateOutlet="templateRefExp; context: contextExp"></ng-container> 4131 * ``` 4132 * 4133 * Using the key `$implicit` in the context object will set its value as default. 4134 * 4135 * ### Example 4136 * 4137 * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'} 4138 * 4139 * @publicApi 4140 */ 4141class NgTemplateOutlet { 4142 constructor(_viewContainerRef) { 4143 this._viewContainerRef = _viewContainerRef; 4144 this._viewRef = null; 4145 /** 4146 * A context object to attach to the {@link EmbeddedViewRef}. This should be an 4147 * object, the object's keys will be available for binding by the local template `let` 4148 * declarations. 4149 * Using the key `$implicit` in the context object will set its value as default. 4150 */ 4151 this.ngTemplateOutletContext = null; 4152 /** 4153 * A string defining the template reference and optionally the context object for the template. 4154 */ 4155 this.ngTemplateOutlet = null; 4156 } 4157 ngOnChanges(changes) { 4158 const recreateView = this._shouldRecreateView(changes); 4159 if (recreateView) { 4160 const viewContainerRef = this._viewContainerRef; 4161 if (this._viewRef) { 4162 viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef)); 4163 } 4164 this._viewRef = this.ngTemplateOutlet ? 4165 viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, this.ngTemplateOutletContext) : 4166 null; 4167 } 4168 else if (this._viewRef && this.ngTemplateOutletContext) { 4169 this._updateExistingContext(this.ngTemplateOutletContext); 4170 } 4171 } 4172 /** 4173 * We need to re-create existing embedded view if: 4174 * - templateRef has changed 4175 * - context has changes 4176 * 4177 * We mark context object as changed when the corresponding object 4178 * shape changes (new properties are added or existing properties are removed). 4179 * In other words we consider context with the same properties as "the same" even 4180 * if object reference changes (see https://github.com/angular/angular/issues/13407). 4181 */ 4182 _shouldRecreateView(changes) { 4183 const ctxChange = changes['ngTemplateOutletContext']; 4184 return !!changes['ngTemplateOutlet'] || (ctxChange && this._hasContextShapeChanged(ctxChange)); 4185 } 4186 _hasContextShapeChanged(ctxChange) { 4187 const prevCtxKeys = Object.keys(ctxChange.previousValue || {}); 4188 const currCtxKeys = Object.keys(ctxChange.currentValue || {}); 4189 if (prevCtxKeys.length === currCtxKeys.length) { 4190 for (let propName of currCtxKeys) { 4191 if (prevCtxKeys.indexOf(propName) === -1) { 4192 return true; 4193 } 4194 } 4195 return false; 4196 } 4197 return true; 4198 } 4199 _updateExistingContext(ctx) { 4200 for (let propName of Object.keys(ctx)) { 4201 this._viewRef.context[propName] = this.ngTemplateOutletContext[propName]; 4202 } 4203 } 4204} 4205NgTemplateOutlet.ɵfac = function NgTemplateOutlet_Factory(t) { return new (t || NgTemplateOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"])); }; 4206NgTemplateOutlet.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgTemplateOutlet, selectors: [["", "ngTemplateOutlet", ""]], inputs: { ngTemplateOutletContext: "ngTemplateOutletContext", ngTemplateOutlet: "ngTemplateOutlet" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 4207NgTemplateOutlet.ctorParameters = () => [ 4208 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] } 4209]; 4210NgTemplateOutlet.propDecorators = { 4211 ngTemplateOutletContext: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 4212 ngTemplateOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 4213}; 4214/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgTemplateOutlet, [{ 4215 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 4216 args: [{ selector: '[ngTemplateOutlet]' }] 4217 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }]; }, { ngTemplateOutletContext: [{ 4218 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 4219 }], ngTemplateOutlet: [{ 4220 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 4221 }] }); })(); 4222 4223/** 4224 * @license 4225 * Copyright Google LLC All Rights Reserved. 4226 * 4227 * Use of this source code is governed by an MIT-style license that can be 4228 * found in the LICENSE file at https://angular.io/license 4229 */ 4230/** 4231 * A collection of Angular directives that are likely to be used in each and every Angular 4232 * application. 4233 */ 4234const COMMON_DIRECTIVES = [ 4235 NgClass, 4236 NgComponentOutlet, 4237 NgForOf, 4238 NgIf, 4239 NgTemplateOutlet, 4240 NgStyle, 4241 NgSwitch, 4242 NgSwitchCase, 4243 NgSwitchDefault, 4244 NgPlural, 4245 NgPluralCase, 4246]; 4247 4248/** 4249 * @license 4250 * Copyright Google LLC All Rights Reserved. 4251 * 4252 * Use of this source code is governed by an MIT-style license that can be 4253 * found in the LICENSE file at https://angular.io/license 4254 */ 4255function invalidPipeArgumentError(type, value) { 4256 return Error(`InvalidPipeArgument: '${value}' for pipe '${Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(type)}'`); 4257} 4258 4259/** 4260 * @license 4261 * Copyright Google LLC All Rights Reserved. 4262 * 4263 * Use of this source code is governed by an MIT-style license that can be 4264 * found in the LICENSE file at https://angular.io/license 4265 */ 4266class ObservableStrategy { 4267 createSubscription(async, updateLatestValue) { 4268 return async.subscribe({ 4269 next: updateLatestValue, 4270 error: (e) => { 4271 throw e; 4272 } 4273 }); 4274 } 4275 dispose(subscription) { 4276 subscription.unsubscribe(); 4277 } 4278 onDestroy(subscription) { 4279 subscription.unsubscribe(); 4280 } 4281} 4282class PromiseStrategy { 4283 createSubscription(async, updateLatestValue) { 4284 return async.then(updateLatestValue, e => { 4285 throw e; 4286 }); 4287 } 4288 dispose(subscription) { } 4289 onDestroy(subscription) { } 4290} 4291const _promiseStrategy = new PromiseStrategy(); 4292const _observableStrategy = new ObservableStrategy(); 4293/** 4294 * @ngModule CommonModule 4295 * @description 4296 * 4297 * Unwraps a value from an asynchronous primitive. 4298 * 4299 * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has 4300 * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for 4301 * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid 4302 * potential memory leaks. 4303 * 4304 * @usageNotes 4305 * 4306 * ### Examples 4307 * 4308 * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the 4309 * promise. 4310 * 4311 * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'} 4312 * 4313 * It's also possible to use `async` with Observables. The example below binds the `time` Observable 4314 * to the view. The Observable continuously updates the view with the current time. 4315 * 4316 * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'} 4317 * 4318 * @publicApi 4319 */ 4320class AsyncPipe { 4321 constructor(_ref) { 4322 this._ref = _ref; 4323 this._latestValue = null; 4324 this._subscription = null; 4325 this._obj = null; 4326 this._strategy = null; 4327 } 4328 ngOnDestroy() { 4329 if (this._subscription) { 4330 this._dispose(); 4331 } 4332 } 4333 transform(obj) { 4334 if (!this._obj) { 4335 if (obj) { 4336 this._subscribe(obj); 4337 } 4338 return this._latestValue; 4339 } 4340 if (obj !== this._obj) { 4341 this._dispose(); 4342 return this.transform(obj); 4343 } 4344 return this._latestValue; 4345 } 4346 _subscribe(obj) { 4347 this._obj = obj; 4348 this._strategy = this._selectStrategy(obj); 4349 this._subscription = this._strategy.createSubscription(obj, (value) => this._updateLatestValue(obj, value)); 4350 } 4351 _selectStrategy(obj) { 4352 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisPromise"])(obj)) { 4353 return _promiseStrategy; 4354 } 4355 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisObservable"])(obj)) { 4356 return _observableStrategy; 4357 } 4358 throw invalidPipeArgumentError(AsyncPipe, obj); 4359 } 4360 _dispose() { 4361 this._strategy.dispose(this._subscription); 4362 this._latestValue = null; 4363 this._subscription = null; 4364 this._obj = null; 4365 } 4366 _updateLatestValue(async, value) { 4367 if (async === this._obj) { 4368 this._latestValue = value; 4369 this._ref.markForCheck(); 4370 } 4371 } 4372} 4373AsyncPipe.ɵfac = function AsyncPipe_Factory(t) { return new (t || AsyncPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinjectPipeChangeDetectorRef"]()); }; 4374AsyncPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "async", type: AsyncPipe, pure: false }); 4375AsyncPipe.ctorParameters = () => [ 4376 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"] } 4377]; 4378/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AsyncPipe, [{ 4379 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4380 args: [{ name: 'async', pure: false }] 4381 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"] }]; }, null); })(); 4382 4383/** 4384 * @license 4385 * Copyright Google LLC All Rights Reserved. 4386 * 4387 * Use of this source code is governed by an MIT-style license that can be 4388 * found in the LICENSE file at https://angular.io/license 4389 */ 4390/** 4391 * Transforms text to all lower case. 4392 * 4393 * @see `UpperCasePipe` 4394 * @see `TitleCasePipe` 4395 * @usageNotes 4396 * 4397 * The following example defines a view that allows the user to enter 4398 * text, and then uses the pipe to convert the input text to all lower case. 4399 * 4400 * <code-example path="common/pipes/ts/lowerupper_pipe.ts" region='LowerUpperPipe'></code-example> 4401 * 4402 * @ngModule CommonModule 4403 * @publicApi 4404 */ 4405class LowerCasePipe { 4406 /** 4407 * @param value The string to transform to lower case. 4408 */ 4409 transform(value) { 4410 if (!value) 4411 return value; 4412 if (typeof value !== 'string') { 4413 throw invalidPipeArgumentError(LowerCasePipe, value); 4414 } 4415 return value.toLowerCase(); 4416 } 4417} 4418LowerCasePipe.ɵfac = function LowerCasePipe_Factory(t) { return new (t || LowerCasePipe)(); }; 4419LowerCasePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "lowercase", type: LowerCasePipe, pure: true }); 4420/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LowerCasePipe, [{ 4421 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4422 args: [{ name: 'lowercase' }] 4423 }], null, null); })(); 4424// 4425// Regex below matches any Unicode word and compatible with ES5. In ES2018 the same result 4426// can be achieved by using /\p{L}\S*/gu and also known as Unicode Property Escapes 4427// (http://2ality.com/2017/07/regexp-unicode-property-escapes.html). Since there is no 4428// transpilation of this functionality down to ES5 without external tool, the only solution is 4429// to use already transpiled form. Example can be found here - 4430// https://mothereff.in/regexpu#input=var+regex+%3D+/%5Cp%7BL%7D/u%3B&unicodePropertyEscape=1 4431// 4432const unicodeWordMatch = /(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])\S*/g; 4433/** 4434 * Transforms text to title case. 4435 * Capitalizes the first letter of each word and transforms the 4436 * rest of the word to lower case. 4437 * Words are delimited by any whitespace character, such as a space, tab, or line-feed character. 4438 * 4439 * @see `LowerCasePipe` 4440 * @see `UpperCasePipe` 4441 * 4442 * @usageNotes 4443 * The following example shows the result of transforming various strings into title case. 4444 * 4445 * <code-example path="common/pipes/ts/titlecase_pipe.ts" region='TitleCasePipe'></code-example> 4446 * 4447 * @ngModule CommonModule 4448 * @publicApi 4449 */ 4450class TitleCasePipe { 4451 /** 4452 * @param value The string to transform to title case. 4453 */ 4454 transform(value) { 4455 if (!value) 4456 return value; 4457 if (typeof value !== 'string') { 4458 throw invalidPipeArgumentError(TitleCasePipe, value); 4459 } 4460 return value.replace(unicodeWordMatch, (txt => txt[0].toUpperCase() + txt.substr(1).toLowerCase())); 4461 } 4462} 4463TitleCasePipe.ɵfac = function TitleCasePipe_Factory(t) { return new (t || TitleCasePipe)(); }; 4464TitleCasePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "titlecase", type: TitleCasePipe, pure: true }); 4465/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TitleCasePipe, [{ 4466 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4467 args: [{ name: 'titlecase' }] 4468 }], null, null); })(); 4469/** 4470 * Transforms text to all upper case. 4471 * @see `LowerCasePipe` 4472 * @see `TitleCasePipe` 4473 * 4474 * @ngModule CommonModule 4475 * @publicApi 4476 */ 4477class UpperCasePipe { 4478 /** 4479 * @param value The string to transform to upper case. 4480 */ 4481 transform(value) { 4482 if (!value) 4483 return value; 4484 if (typeof value !== 'string') { 4485 throw invalidPipeArgumentError(UpperCasePipe, value); 4486 } 4487 return value.toUpperCase(); 4488 } 4489} 4490UpperCasePipe.ɵfac = function UpperCasePipe_Factory(t) { return new (t || UpperCasePipe)(); }; 4491UpperCasePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "uppercase", type: UpperCasePipe, pure: true }); 4492/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](UpperCasePipe, [{ 4493 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4494 args: [{ name: 'uppercase' }] 4495 }], null, null); })(); 4496 4497/** 4498 * @license 4499 * Copyright Google LLC All Rights Reserved. 4500 * 4501 * Use of this source code is governed by an MIT-style license that can be 4502 * found in the LICENSE file at https://angular.io/license 4503 */ 4504// clang-format off 4505/** 4506 * @ngModule CommonModule 4507 * @description 4508 * 4509 * Formats a date value according to locale rules. 4510 * 4511 * Only the `en-US` locale data comes with Angular. To localize dates 4512 * in another language, you must import the corresponding locale data. 4513 * See the [I18n guide](guide/i18n#i18n-pipes) for more information. 4514 * 4515 * @see `formatDate()` 4516 * 4517 * 4518 * @usageNotes 4519 * 4520 * The result of this pipe is not reevaluated when the input is mutated. To avoid the need to 4521 * reformat the date on every change-detection cycle, treat the date as an immutable object 4522 * and change the reference when the pipe needs to run again. 4523 * 4524 * ### Pre-defined format options 4525 * 4526 * Examples are given in `en-US` locale. 4527 * 4528 * - `'short'`: equivalent to `'M/d/yy, h:mm a'` (`6/15/15, 9:03 AM`). 4529 * - `'medium'`: equivalent to `'MMM d, y, h:mm:ss a'` (`Jun 15, 2015, 9:03:01 AM`). 4530 * - `'long'`: equivalent to `'MMMM d, y, h:mm:ss a z'` (`June 15, 2015 at 9:03:01 AM 4531 * GMT+1`). 4532 * - `'full'`: equivalent to `'EEEE, MMMM d, y, h:mm:ss a zzzz'` (`Monday, June 15, 2015 at 4533 * 9:03:01 AM GMT+01:00`). 4534 * - `'shortDate'`: equivalent to `'M/d/yy'` (`6/15/15`). 4535 * - `'mediumDate'`: equivalent to `'MMM d, y'` (`Jun 15, 2015`). 4536 * - `'longDate'`: equivalent to `'MMMM d, y'` (`June 15, 2015`). 4537 * - `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` (`Monday, June 15, 2015`). 4538 * - `'shortTime'`: equivalent to `'h:mm a'` (`9:03 AM`). 4539 * - `'mediumTime'`: equivalent to `'h:mm:ss a'` (`9:03:01 AM`). 4540 * - `'longTime'`: equivalent to `'h:mm:ss a z'` (`9:03:01 AM GMT+1`). 4541 * - `'fullTime'`: equivalent to `'h:mm:ss a zzzz'` (`9:03:01 AM GMT+01:00`). 4542 * 4543 * ### Custom format options 4544 * 4545 * You can construct a format string using symbols to specify the components 4546 * of a date-time value, as described in the following table. 4547 * Format details depend on the locale. 4548 * Fields marked with (*) are only available in the extra data set for the given locale. 4549 * 4550 * | Field type | Format | Description | Example Value | 4551 * |--------------------|-------------|---------------------------------------------------------------|------------------------------------------------------------| 4552 * | Era | G, GG & GGG | Abbreviated | AD | 4553 * | | GGGG | Wide | Anno Domini | 4554 * | | GGGGG | Narrow | A | 4555 * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 | 4556 * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 | 4557 * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 | 4558 * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 | 4559 * | Month | M | Numeric: 1 digit | 9, 12 | 4560 * | | MM | Numeric: 2 digits + zero padded | 09, 12 | 4561 * | | MMM | Abbreviated | Sep | 4562 * | | MMMM | Wide | September | 4563 * | | MMMMM | Narrow | S | 4564 * | Month standalone | L | Numeric: 1 digit | 9, 12 | 4565 * | | LL | Numeric: 2 digits + zero padded | 09, 12 | 4566 * | | LLL | Abbreviated | Sep | 4567 * | | LLLL | Wide | September | 4568 * | | LLLLL | Narrow | S | 4569 * | Week of year | w | Numeric: minimum digits | 1... 53 | 4570 * | | ww | Numeric: 2 digits + zero padded | 01... 53 | 4571 * | Week of month | W | Numeric: 1 digit | 1... 5 | 4572 * | Day of month | d | Numeric: minimum digits | 1 | 4573 * | | dd | Numeric: 2 digits + zero padded | 01 | 4574 * | Week day | E, EE & EEE | Abbreviated | Tue | 4575 * | | EEEE | Wide | Tuesday | 4576 * | | EEEEE | Narrow | T | 4577 * | | EEEEEE | Short | Tu | 4578 * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM | 4579 * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem | 4580 * | | aaaaa | Narrow | a/p | 4581 * | Period* | B, BB & BBB | Abbreviated | mid. | 4582 * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night | 4583 * | | BBBBB | Narrow | md | 4584 * | Period standalone* | b, bb & bbb | Abbreviated | mid. | 4585 * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night | 4586 * | | bbbbb | Narrow | md | 4587 * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 | 4588 * | | hh | Numeric: 2 digits + zero padded | 01, 12 | 4589 * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 | 4590 * | | HH | Numeric: 2 digits + zero padded | 00, 23 | 4591 * | Minute | m | Numeric: minimum digits | 8, 59 | 4592 * | | mm | Numeric: 2 digits + zero padded | 08, 59 | 4593 * | Second | s | Numeric: minimum digits | 0... 59 | 4594 * | | ss | Numeric: 2 digits + zero padded | 00... 59 | 4595 * | Fractional seconds | S | Numeric: 1 digit | 0... 9 | 4596 * | | SS | Numeric: 2 digits + zero padded | 00... 99 | 4597 * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 | 4598 * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 | 4599 * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 | 4600 * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 | 4601 * | | ZZZZ | Long localized GMT format | GMT-8:00 | 4602 * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 | 4603 * | | O, OO & OOO | Short localized GMT format | GMT-8 | 4604 * | | OOOO | Long localized GMT format | GMT-08:00 | 4605 * 4606 * Note that timezone correction is not applied to an ISO string that has no time component, such as "2016-09-19" 4607 * 4608 * ### Format examples 4609 * 4610 * These examples transform a date into various formats, 4611 * assuming that `dateObj` is a JavaScript `Date` object for 4612 * year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11, 4613 * given in the local time for the `en-US` locale. 4614 * 4615 * ``` 4616 * {{ dateObj | date }} // output is 'Jun 15, 2015' 4617 * {{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM' 4618 * {{ dateObj | date:'shortTime' }} // output is '9:43 PM' 4619 * {{ dateObj | date:'mm:ss' }} // output is '43:11' 4620 * ``` 4621 * 4622 * ### Usage example 4623 * 4624 * The following component uses a date pipe to display the current date in different formats. 4625 * 4626 * ``` 4627 * @Component({ 4628 * selector: 'date-pipe', 4629 * template: `<div> 4630 * <p>Today is {{today | date}}</p> 4631 * <p>Or if you prefer, {{today | date:'fullDate'}}</p> 4632 * <p>The time is {{today | date:'h:mm a z'}}</p> 4633 * </div>` 4634 * }) 4635 * // Get the current date and time as a date-time value. 4636 * export class DatePipeComponent { 4637 * today: number = Date.now(); 4638 * } 4639 * ``` 4640 * 4641 * @publicApi 4642 */ 4643// clang-format on 4644class DatePipe { 4645 constructor(locale) { 4646 this.locale = locale; 4647 } 4648 /** 4649 * @param value The date expression: a `Date` object, a number 4650 * (milliseconds since UTC epoch), or an ISO string (https://www.w3.org/TR/NOTE-datetime). 4651 * @param format The date/time components to include, using predefined options or a 4652 * custom format string. 4653 * @param timezone A timezone offset (such as `'+0430'`), or a standard 4654 * UTC/GMT or continental US timezone abbreviation. 4655 * When not supplied, uses the end-user's local system timezone. 4656 * @param locale A locale code for the locale format rules to use. 4657 * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default. 4658 * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app). 4659 * @returns A date string in the desired format. 4660 */ 4661 transform(value, format = 'mediumDate', timezone, locale) { 4662 if (value == null || value === '' || value !== value) 4663 return null; 4664 try { 4665 return formatDate(value, format, locale || this.locale, timezone); 4666 } 4667 catch (error) { 4668 throw invalidPipeArgumentError(DatePipe, error.message); 4669 } 4670 } 4671} 4672DatePipe.ɵfac = function DatePipe_Factory(t) { return new (t || DatePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])); }; 4673DatePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "date", type: DatePipe, pure: true }); 4674DatePipe.ctorParameters = () => [ 4675 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] } 4676]; 4677/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DatePipe, [{ 4678 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4679 args: [{ name: 'date', pure: true }] 4680 }], function () { return [{ type: String, decorators: [{ 4681 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 4682 args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]] 4683 }] }]; }, null); })(); 4684 4685/** 4686 * @license 4687 * Copyright Google LLC All Rights Reserved. 4688 * 4689 * Use of this source code is governed by an MIT-style license that can be 4690 * found in the LICENSE file at https://angular.io/license 4691 */ 4692const _INTERPOLATION_REGEXP = /#/g; 4693/** 4694 * @ngModule CommonModule 4695 * @description 4696 * 4697 * Maps a value to a string that pluralizes the value according to locale rules. 4698 * 4699 * @usageNotes 4700 * 4701 * ### Example 4702 * 4703 * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'} 4704 * 4705 * @publicApi 4706 */ 4707class I18nPluralPipe { 4708 constructor(_localization) { 4709 this._localization = _localization; 4710 } 4711 /** 4712 * @param value the number to be formatted 4713 * @param pluralMap an object that mimics the ICU format, see 4714 * http://userguide.icu-project.org/formatparse/messages. 4715 * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by 4716 * default). 4717 */ 4718 transform(value, pluralMap, locale) { 4719 if (value == null) 4720 return ''; 4721 if (typeof pluralMap !== 'object' || pluralMap === null) { 4722 throw invalidPipeArgumentError(I18nPluralPipe, pluralMap); 4723 } 4724 const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale); 4725 return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString()); 4726 } 4727} 4728I18nPluralPipe.ɵfac = function I18nPluralPipe_Factory(t) { return new (t || I18nPluralPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgLocalization)); }; 4729I18nPluralPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "i18nPlural", type: I18nPluralPipe, pure: true }); 4730I18nPluralPipe.ctorParameters = () => [ 4731 { type: NgLocalization } 4732]; 4733/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](I18nPluralPipe, [{ 4734 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4735 args: [{ name: 'i18nPlural', pure: true }] 4736 }], function () { return [{ type: NgLocalization }]; }, null); })(); 4737 4738/** 4739 * @license 4740 * Copyright Google LLC All Rights Reserved. 4741 * 4742 * Use of this source code is governed by an MIT-style license that can be 4743 * found in the LICENSE file at https://angular.io/license 4744 */ 4745/** 4746 * @ngModule CommonModule 4747 * @description 4748 * 4749 * Generic selector that displays the string that matches the current value. 4750 * 4751 * If none of the keys of the `mapping` match the `value`, then the content 4752 * of the `other` key is returned when present, otherwise an empty string is returned. 4753 * 4754 * @usageNotes 4755 * 4756 * ### Example 4757 * 4758 * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'} 4759 * 4760 * @publicApi 4761 */ 4762class I18nSelectPipe { 4763 /** 4764 * @param value a string to be internationalized. 4765 * @param mapping an object that indicates the text that should be displayed 4766 * for different values of the provided `value`. 4767 */ 4768 transform(value, mapping) { 4769 if (value == null) 4770 return ''; 4771 if (typeof mapping !== 'object' || typeof value !== 'string') { 4772 throw invalidPipeArgumentError(I18nSelectPipe, mapping); 4773 } 4774 if (mapping.hasOwnProperty(value)) { 4775 return mapping[value]; 4776 } 4777 if (mapping.hasOwnProperty('other')) { 4778 return mapping['other']; 4779 } 4780 return ''; 4781 } 4782} 4783I18nSelectPipe.ɵfac = function I18nSelectPipe_Factory(t) { return new (t || I18nSelectPipe)(); }; 4784I18nSelectPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "i18nSelect", type: I18nSelectPipe, pure: true }); 4785/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](I18nSelectPipe, [{ 4786 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4787 args: [{ name: 'i18nSelect', pure: true }] 4788 }], null, null); })(); 4789 4790/** 4791 * @license 4792 * Copyright Google LLC All Rights Reserved. 4793 * 4794 * Use of this source code is governed by an MIT-style license that can be 4795 * found in the LICENSE file at https://angular.io/license 4796 */ 4797/** 4798 * @ngModule CommonModule 4799 * @description 4800 * 4801 * Converts a value into its JSON-format representation. Useful for debugging. 4802 * 4803 * @usageNotes 4804 * 4805 * The following component uses a JSON pipe to convert an object 4806 * to JSON format, and displays the string in both formats for comparison. 4807 * 4808 * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'} 4809 * 4810 * @publicApi 4811 */ 4812class JsonPipe { 4813 /** 4814 * @param value A value of any type to convert into a JSON-format string. 4815 */ 4816 transform(value) { 4817 return JSON.stringify(value, null, 2); 4818 } 4819} 4820JsonPipe.ɵfac = function JsonPipe_Factory(t) { return new (t || JsonPipe)(); }; 4821JsonPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "json", type: JsonPipe, pure: false }); 4822/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](JsonPipe, [{ 4823 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4824 args: [{ name: 'json', pure: false }] 4825 }], null, null); })(); 4826 4827/** 4828 * @license 4829 * Copyright Google LLC All Rights Reserved. 4830 * 4831 * Use of this source code is governed by an MIT-style license that can be 4832 * found in the LICENSE file at https://angular.io/license 4833 */ 4834function makeKeyValuePair(key, value) { 4835 return { key: key, value: value }; 4836} 4837/** 4838 * @ngModule CommonModule 4839 * @description 4840 * 4841 * Transforms Object or Map into an array of key value pairs. 4842 * 4843 * The output array will be ordered by keys. 4844 * By default the comparator will be by Unicode point value. 4845 * You can optionally pass a compareFn if your keys are complex types. 4846 * 4847 * @usageNotes 4848 * ### Examples 4849 * 4850 * This examples show how an Object or a Map can be iterated by ngFor with the use of this keyvalue 4851 * pipe. 4852 * 4853 * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'} 4854 * 4855 * @publicApi 4856 */ 4857class KeyValuePipe { 4858 constructor(differs) { 4859 this.differs = differs; 4860 this.keyValues = []; 4861 } 4862 transform(input, compareFn = defaultComparator) { 4863 if (!input || (!(input instanceof Map) && typeof input !== 'object')) { 4864 return null; 4865 } 4866 if (!this.differ) { 4867 // make a differ for whatever type we've been passed in 4868 this.differ = this.differs.find(input).create(); 4869 } 4870 const differChanges = this.differ.diff(input); 4871 if (differChanges) { 4872 this.keyValues = []; 4873 differChanges.forEachItem((r) => { 4874 this.keyValues.push(makeKeyValuePair(r.key, r.currentValue)); 4875 }); 4876 this.keyValues.sort(compareFn); 4877 } 4878 return this.keyValues; 4879 } 4880} 4881KeyValuePipe.ɵfac = function KeyValuePipe_Factory(t) { return new (t || KeyValuePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"])); }; 4882KeyValuePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "keyvalue", type: KeyValuePipe, pure: false }); 4883KeyValuePipe.ctorParameters = () => [ 4884 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] } 4885]; 4886/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](KeyValuePipe, [{ 4887 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 4888 args: [{ name: 'keyvalue', pure: false }] 4889 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }]; }, null); })(); 4890function defaultComparator(keyValueA, keyValueB) { 4891 const a = keyValueA.key; 4892 const b = keyValueB.key; 4893 // if same exit with 0; 4894 if (a === b) 4895 return 0; 4896 // make sure that undefined are at the end of the sort. 4897 if (a === undefined) 4898 return 1; 4899 if (b === undefined) 4900 return -1; 4901 // make sure that nulls are at the end of the sort. 4902 if (a === null) 4903 return 1; 4904 if (b === null) 4905 return -1; 4906 if (typeof a == 'string' && typeof b == 'string') { 4907 return a < b ? -1 : 1; 4908 } 4909 if (typeof a == 'number' && typeof b == 'number') { 4910 return a - b; 4911 } 4912 if (typeof a == 'boolean' && typeof b == 'boolean') { 4913 return a < b ? -1 : 1; 4914 } 4915 // `a` and `b` are of different types. Compare their string values. 4916 const aString = String(a); 4917 const bString = String(b); 4918 return aString == bString ? 0 : aString < bString ? -1 : 1; 4919} 4920 4921/** 4922 * @license 4923 * Copyright Google LLC All Rights Reserved. 4924 * 4925 * Use of this source code is governed by an MIT-style license that can be 4926 * found in the LICENSE file at https://angular.io/license 4927 */ 4928/** 4929 * @ngModule CommonModule 4930 * @description 4931 * 4932 * Transforms a number into a string, 4933 * formatted according to locale rules that determine group sizing and 4934 * separator, decimal-point character, and other locale-specific 4935 * configurations. 4936 * 4937 * If no parameters are specified, the function rounds off to the nearest value using this 4938 * [rounding method](https://en.wikibooks.org/wiki/Arithmetic/Rounding). 4939 * The behavior differs from that of the JavaScript ```Math.round()``` function. 4940 * In the following case for example, the pipe rounds down where 4941 * ```Math.round()``` rounds up: 4942 * 4943 * ```html 4944 * -2.5 | number:'1.0-0' 4945 * > -3 4946 * Math.round(-2.5) 4947 * > -2 4948 * ``` 4949 * 4950 * @see `formatNumber()` 4951 * 4952 * @usageNotes 4953 * The following code shows how the pipe transforms numbers 4954 * into text strings, according to various format specifications, 4955 * where the caller's default locale is `en-US`. 4956 * 4957 * ### Example 4958 * 4959 * <code-example path="common/pipes/ts/number_pipe.ts" region='NumberPipe'></code-example> 4960 * 4961 * @publicApi 4962 */ 4963class DecimalPipe { 4964 constructor(_locale) { 4965 this._locale = _locale; 4966 } 4967 /** 4968 * @param value The number to be formatted. 4969 * @param digitsInfo Decimal representation options, specified by a string 4970 * in the following format:<br> 4971 * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>. 4972 * - `minIntegerDigits`: The minimum number of integer digits before the decimal point. 4973 * Default is `1`. 4974 * - `minFractionDigits`: The minimum number of digits after the decimal point. 4975 * Default is `0`. 4976 * - `maxFractionDigits`: The maximum number of digits after the decimal point. 4977 * Default is `3`. 4978 * @param locale A locale code for the locale format rules to use. 4979 * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default. 4980 * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app). 4981 */ 4982 transform(value, digitsInfo, locale) { 4983 if (isEmpty(value)) 4984 return null; 4985 locale = locale || this._locale; 4986 try { 4987 const num = strToNumber(value); 4988 return formatNumber(num, locale, digitsInfo); 4989 } 4990 catch (error) { 4991 throw invalidPipeArgumentError(DecimalPipe, error.message); 4992 } 4993 } 4994} 4995DecimalPipe.ɵfac = function DecimalPipe_Factory(t) { return new (t || DecimalPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])); }; 4996DecimalPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "number", type: DecimalPipe, pure: true }); 4997DecimalPipe.ctorParameters = () => [ 4998 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] } 4999]; 5000/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DecimalPipe, [{ 5001 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 5002 args: [{ name: 'number' }] 5003 }], function () { return [{ type: String, decorators: [{ 5004 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 5005 args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]] 5006 }] }]; }, null); })(); 5007/** 5008 * @ngModule CommonModule 5009 * @description 5010 * 5011 * Transforms a number to a percentage 5012 * string, formatted according to locale rules that determine group sizing and 5013 * separator, decimal-point character, and other locale-specific 5014 * configurations. 5015 * 5016 * @see `formatPercent()` 5017 * 5018 * @usageNotes 5019 * The following code shows how the pipe transforms numbers 5020 * into text strings, according to various format specifications, 5021 * where the caller's default locale is `en-US`. 5022 * 5023 * <code-example path="common/pipes/ts/percent_pipe.ts" region='PercentPipe'></code-example> 5024 * 5025 * @publicApi 5026 */ 5027class PercentPipe { 5028 constructor(_locale) { 5029 this._locale = _locale; 5030 } 5031 /** 5032 * 5033 * @param value The number to be formatted as a percentage. 5034 * @param digitsInfo Decimal representation options, specified by a string 5035 * in the following format:<br> 5036 * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>. 5037 * - `minIntegerDigits`: The minimum number of integer digits before the decimal point. 5038 * Default is `1`. 5039 * - `minFractionDigits`: The minimum number of digits after the decimal point. 5040 * Default is `0`. 5041 * - `maxFractionDigits`: The maximum number of digits after the decimal point. 5042 * Default is `0`. 5043 * @param locale A locale code for the locale format rules to use. 5044 * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default. 5045 * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app). 5046 */ 5047 transform(value, digitsInfo, locale) { 5048 if (isEmpty(value)) 5049 return null; 5050 locale = locale || this._locale; 5051 try { 5052 const num = strToNumber(value); 5053 return formatPercent(num, locale, digitsInfo); 5054 } 5055 catch (error) { 5056 throw invalidPipeArgumentError(PercentPipe, error.message); 5057 } 5058 } 5059} 5060PercentPipe.ɵfac = function PercentPipe_Factory(t) { return new (t || PercentPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])); }; 5061PercentPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "percent", type: PercentPipe, pure: true }); 5062PercentPipe.ctorParameters = () => [ 5063 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] } 5064]; 5065/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PercentPipe, [{ 5066 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 5067 args: [{ name: 'percent' }] 5068 }], function () { return [{ type: String, decorators: [{ 5069 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 5070 args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]] 5071 }] }]; }, null); })(); 5072/** 5073 * @ngModule CommonModule 5074 * @description 5075 * 5076 * Transforms a number to a currency string, formatted according to locale rules 5077 * that determine group sizing and separator, decimal-point character, 5078 * and other locale-specific configurations. 5079 * 5080 * {@a currency-code-deprecation} 5081 * <div class="alert is-helpful"> 5082 * 5083 * **Deprecation notice:** 5084 * 5085 * The default currency code is currently always `USD` but this is deprecated from v9. 5086 * 5087 * **In v11 the default currency code will be taken from the current locale identified by 5088 * the `LOCAL_ID` token. See the [i18n guide](guide/i18n#setting-up-the-locale-of-your-app) for 5089 * more information.** 5090 * 5091 * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in 5092 * your application `NgModule`: 5093 * 5094 * ```ts 5095 * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'} 5096 * ``` 5097 * 5098 * </div> 5099 * 5100 * @see `getCurrencySymbol()` 5101 * @see `formatCurrency()` 5102 * 5103 * @usageNotes 5104 * The following code shows how the pipe transforms numbers 5105 * into text strings, according to various format specifications, 5106 * where the caller's default locale is `en-US`. 5107 * 5108 * <code-example path="common/pipes/ts/currency_pipe.ts" region='CurrencyPipe'></code-example> 5109 * 5110 * @publicApi 5111 */ 5112class CurrencyPipe { 5113 constructor(_locale, _defaultCurrencyCode = 'USD') { 5114 this._locale = _locale; 5115 this._defaultCurrencyCode = _defaultCurrencyCode; 5116 } 5117 /** 5118 * 5119 * @param value The number to be formatted as currency. 5120 * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, 5121 * such as `USD` for the US dollar and `EUR` for the euro. The default currency code can be 5122 * configured using the `DEFAULT_CURRENCY_CODE` injection token. 5123 * @param display The format for the currency indicator. One of the following: 5124 * - `code`: Show the code (such as `USD`). 5125 * - `symbol`(default): Show the symbol (such as `$`). 5126 * - `symbol-narrow`: Use the narrow symbol for locales that have two symbols for their 5127 * currency. 5128 * For example, the Canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`. If the 5129 * locale has no narrow symbol, uses the standard symbol for the locale. 5130 * - String: Use the given string value instead of a code or a symbol. 5131 * For example, an empty string will suppress the currency & symbol. 5132 * - Boolean (marked deprecated in v5): `true` for symbol and false for `code`. 5133 * 5134 * @param digitsInfo Decimal representation options, specified by a string 5135 * in the following format:<br> 5136 * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>. 5137 * - `minIntegerDigits`: The minimum number of integer digits before the decimal point. 5138 * Default is `1`. 5139 * - `minFractionDigits`: The minimum number of digits after the decimal point. 5140 * Default is `2`. 5141 * - `maxFractionDigits`: The maximum number of digits after the decimal point. 5142 * Default is `2`. 5143 * If not provided, the number will be formatted with the proper amount of digits, 5144 * depending on what the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) specifies. 5145 * For example, the Canadian dollar has 2 digits, whereas the Chilean peso has none. 5146 * @param locale A locale code for the locale format rules to use. 5147 * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default. 5148 * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app). 5149 */ 5150 transform(value, currencyCode, display = 'symbol', digitsInfo, locale) { 5151 if (isEmpty(value)) 5152 return null; 5153 locale = locale || this._locale; 5154 if (typeof display === 'boolean') { 5155 if (console && console.warn) { 5156 console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`); 5157 } 5158 display = display ? 'symbol' : 'code'; 5159 } 5160 let currency = currencyCode || this._defaultCurrencyCode; 5161 if (display !== 'code') { 5162 if (display === 'symbol' || display === 'symbol-narrow') { 5163 currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale); 5164 } 5165 else { 5166 currency = display; 5167 } 5168 } 5169 try { 5170 const num = strToNumber(value); 5171 return formatCurrency(num, locale, currency, currencyCode, digitsInfo); 5172 } 5173 catch (error) { 5174 throw invalidPipeArgumentError(CurrencyPipe, error.message); 5175 } 5176 } 5177} 5178CurrencyPipe.ɵfac = function CurrencyPipe_Factory(t) { return new (t || CurrencyPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["DEFAULT_CURRENCY_CODE"])); }; 5179CurrencyPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "currency", type: CurrencyPipe, pure: true }); 5180CurrencyPipe.ctorParameters = () => [ 5181 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }, 5182 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["DEFAULT_CURRENCY_CODE"],] }] } 5183]; 5184/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CurrencyPipe, [{ 5185 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 5186 args: [{ name: 'currency' }] 5187 }], function () { return [{ type: String, decorators: [{ 5188 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 5189 args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]] 5190 }] }, { type: String, decorators: [{ 5191 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 5192 args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["DEFAULT_CURRENCY_CODE"]] 5193 }] }]; }, null); })(); 5194function isEmpty(value) { 5195 return value == null || value === '' || value !== value; 5196} 5197/** 5198 * Transforms a string into a number (if needed). 5199 */ 5200function strToNumber(value) { 5201 // Convert strings to numbers 5202 if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) { 5203 return Number(value); 5204 } 5205 if (typeof value !== 'number') { 5206 throw new Error(`${value} is not a number`); 5207 } 5208 return value; 5209} 5210 5211/** 5212 * @license 5213 * Copyright Google LLC All Rights Reserved. 5214 * 5215 * Use of this source code is governed by an MIT-style license that can be 5216 * found in the LICENSE file at https://angular.io/license 5217 */ 5218/** 5219 * @ngModule CommonModule 5220 * @description 5221 * 5222 * Creates a new `Array` or `String` containing a subset (slice) of the elements. 5223 * 5224 * @usageNotes 5225 * 5226 * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()` 5227 * and `String.prototype.slice()`. 5228 * 5229 * When operating on an `Array`, the returned `Array` is always a copy even when all 5230 * the elements are being returned. 5231 * 5232 * When operating on a blank value, the pipe returns the blank value. 5233 * 5234 * ### List Example 5235 * 5236 * This `ngFor` example: 5237 * 5238 * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'} 5239 * 5240 * produces the following: 5241 * 5242 * ```html 5243 * <li>b</li> 5244 * <li>c</li> 5245 * ``` 5246 * 5247 * ### String Examples 5248 * 5249 * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'} 5250 * 5251 * @publicApi 5252 */ 5253class SlicePipe { 5254 transform(value, start, end) { 5255 if (value == null) 5256 return value; 5257 if (!this.supports(value)) { 5258 throw invalidPipeArgumentError(SlicePipe, value); 5259 } 5260 return value.slice(start, end); 5261 } 5262 supports(obj) { 5263 return typeof obj === 'string' || Array.isArray(obj); 5264 } 5265} 5266SlicePipe.ɵfac = function SlicePipe_Factory(t) { return new (t || SlicePipe)(); }; 5267SlicePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "slice", type: SlicePipe, pure: false }); 5268/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](SlicePipe, [{ 5269 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"], 5270 args: [{ name: 'slice', pure: false }] 5271 }], null, null); })(); 5272 5273/** 5274 * @license 5275 * Copyright Google LLC All Rights Reserved. 5276 * 5277 * Use of this source code is governed by an MIT-style license that can be 5278 * found in the LICENSE file at https://angular.io/license 5279 */ 5280/** 5281 * A collection of Angular pipes that are likely to be used in each and every application. 5282 */ 5283const COMMON_PIPES = [ 5284 AsyncPipe, 5285 UpperCasePipe, 5286 LowerCasePipe, 5287 JsonPipe, 5288 SlicePipe, 5289 DecimalPipe, 5290 PercentPipe, 5291 TitleCasePipe, 5292 CurrencyPipe, 5293 DatePipe, 5294 I18nPluralPipe, 5295 I18nSelectPipe, 5296 KeyValuePipe, 5297]; 5298 5299/** 5300 * @license 5301 * Copyright Google LLC All Rights Reserved. 5302 * 5303 * Use of this source code is governed by an MIT-style license that can be 5304 * found in the LICENSE file at https://angular.io/license 5305 */ 5306// Note: This does not contain the location providers, 5307// as they need some platform specific implementations to work. 5308/** 5309 * Exports all the basic Angular directives and pipes, 5310 * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on. 5311 * Re-exported by `BrowserModule`, which is included automatically in the root 5312 * `AppModule` when you create a new app with the CLI `new` command. 5313 * 5314 * * The `providers` options configure the NgModule's injector to provide 5315 * localization dependencies to members. 5316 * * The `exports` options make the declared directives and pipes available for import 5317 * by other NgModules. 5318 * 5319 * @publicApi 5320 */ 5321class CommonModule { 5322} 5323CommonModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: CommonModule }); 5324CommonModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ factory: function CommonModule_Factory(t) { return new (t || CommonModule)(); }, providers: [ 5325 { provide: NgLocalization, useClass: NgLocaleLocalization }, 5326 ] }); 5327(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](CommonModule, { declarations: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe], exports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe] }); })(); 5328/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CommonModule, [{ 5329 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], 5330 args: [{ 5331 declarations: [COMMON_DIRECTIVES, COMMON_PIPES], 5332 exports: [COMMON_DIRECTIVES, COMMON_PIPES], 5333 providers: [ 5334 { provide: NgLocalization, useClass: NgLocaleLocalization }, 5335 ] 5336 }] 5337 }], null, null); })(); 5338 5339/** 5340 * @license 5341 * Copyright Google LLC All Rights Reserved. 5342 * 5343 * Use of this source code is governed by an MIT-style license that can be 5344 * found in the LICENSE file at https://angular.io/license 5345 */ 5346const PLATFORM_BROWSER_ID = 'browser'; 5347const PLATFORM_SERVER_ID = 'server'; 5348const PLATFORM_WORKER_APP_ID = 'browserWorkerApp'; 5349const PLATFORM_WORKER_UI_ID = 'browserWorkerUi'; 5350/** 5351 * Returns whether a platform id represents a browser platform. 5352 * @publicApi 5353 */ 5354function isPlatformBrowser(platformId) { 5355 return platformId === PLATFORM_BROWSER_ID; 5356} 5357/** 5358 * Returns whether a platform id represents a server platform. 5359 * @publicApi 5360 */ 5361function isPlatformServer(platformId) { 5362 return platformId === PLATFORM_SERVER_ID; 5363} 5364/** 5365 * Returns whether a platform id represents a web worker app platform. 5366 * @publicApi 5367 */ 5368function isPlatformWorkerApp(platformId) { 5369 return platformId === PLATFORM_WORKER_APP_ID; 5370} 5371/** 5372 * Returns whether a platform id represents a web worker UI platform. 5373 * @publicApi 5374 */ 5375function isPlatformWorkerUi(platformId) { 5376 return platformId === PLATFORM_WORKER_UI_ID; 5377} 5378 5379/** 5380 * @license 5381 * Copyright Google LLC All Rights Reserved. 5382 * 5383 * Use of this source code is governed by an MIT-style license that can be 5384 * found in the LICENSE file at https://angular.io/license 5385 */ 5386/** 5387 * @publicApi 5388 */ 5389const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Version"]('10.0.14'); 5390 5391/** 5392 * @license 5393 * Copyright Google LLC All Rights Reserved. 5394 * 5395 * Use of this source code is governed by an MIT-style license that can be 5396 * found in the LICENSE file at https://angular.io/license 5397 */ 5398/** 5399 * Defines a scroll position manager. Implemented by `BrowserViewportScroller`. 5400 * 5401 * @publicApi 5402 */ 5403class ViewportScroller { 5404} 5405// De-sugared tree-shakable injection 5406// See #23917 5407/** @nocollapse */ 5408ViewportScroller.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ 5409 token: ViewportScroller, 5410 providedIn: 'root', 5411 factory: () => new BrowserViewportScroller(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT), window, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ErrorHandler"])) 5412}); 5413/** 5414 * Manages the scroll position for a browser window. 5415 */ 5416class BrowserViewportScroller { 5417 constructor(document, window, errorHandler) { 5418 this.document = document; 5419 this.window = window; 5420 this.errorHandler = errorHandler; 5421 this.offset = () => [0, 0]; 5422 } 5423 /** 5424 * Configures the top offset used when scrolling to an anchor. 5425 * @param offset A position in screen coordinates (a tuple with x and y values) 5426 * or a function that returns the top offset position. 5427 * 5428 */ 5429 setOffset(offset) { 5430 if (Array.isArray(offset)) { 5431 this.offset = () => offset; 5432 } 5433 else { 5434 this.offset = offset; 5435 } 5436 } 5437 /** 5438 * Retrieves the current scroll position. 5439 * @returns The position in screen coordinates. 5440 */ 5441 getScrollPosition() { 5442 if (this.supportsScrolling()) { 5443 return [this.window.scrollX, this.window.scrollY]; 5444 } 5445 else { 5446 return [0, 0]; 5447 } 5448 } 5449 /** 5450 * Sets the scroll position. 5451 * @param position The new position in screen coordinates. 5452 */ 5453 scrollToPosition(position) { 5454 if (this.supportsScrolling()) { 5455 this.window.scrollTo(position[0], position[1]); 5456 } 5457 } 5458 /** 5459 * Scrolls to an anchor element. 5460 * @param anchor The ID of the anchor element. 5461 */ 5462 scrollToAnchor(anchor) { 5463 if (this.supportsScrolling()) { 5464 const elSelected = this.document.getElementById(anchor) || this.document.getElementsByName(anchor)[0]; 5465 if (elSelected) { 5466 this.scrollToElement(elSelected); 5467 } 5468 } 5469 } 5470 /** 5471 * Disables automatic scroll restoration provided by the browser. 5472 */ 5473 setHistoryScrollRestoration(scrollRestoration) { 5474 if (this.supportScrollRestoration()) { 5475 const history = this.window.history; 5476 if (history && history.scrollRestoration) { 5477 history.scrollRestoration = scrollRestoration; 5478 } 5479 } 5480 } 5481 scrollToElement(el) { 5482 const rect = el.getBoundingClientRect(); 5483 const left = rect.left + this.window.pageXOffset; 5484 const top = rect.top + this.window.pageYOffset; 5485 const offset = this.offset(); 5486 this.window.scrollTo(left - offset[0], top - offset[1]); 5487 } 5488 /** 5489 * We only support scroll restoration when we can get a hold of window. 5490 * This means that we do not support this behavior when running in a web worker. 5491 * 5492 * Lifting this restriction right now would require more changes in the dom adapter. 5493 * Since webworkers aren't widely used, we will lift it once RouterScroller is 5494 * battle-tested. 5495 */ 5496 supportScrollRestoration() { 5497 try { 5498 if (!this.window || !this.window.scrollTo) { 5499 return false; 5500 } 5501 // The `scrollRestoration` property could be on the `history` instance or its prototype. 5502 const scrollRestorationDescriptor = getScrollRestorationProperty(this.window.history) || 5503 getScrollRestorationProperty(Object.getPrototypeOf(this.window.history)); 5504 // We can write to the `scrollRestoration` property if it is a writable data field or it has a 5505 // setter function. 5506 return !!scrollRestorationDescriptor && 5507 !!(scrollRestorationDescriptor.writable || scrollRestorationDescriptor.set); 5508 } 5509 catch (_a) { 5510 return false; 5511 } 5512 } 5513 supportsScrolling() { 5514 try { 5515 return !!this.window.scrollTo; 5516 } 5517 catch (_a) { 5518 return false; 5519 } 5520 } 5521} 5522function getScrollRestorationProperty(obj) { 5523 return Object.getOwnPropertyDescriptor(obj, 'scrollRestoration'); 5524} 5525/** 5526 * Provides an empty implementation of the viewport scroller. This will 5527 * live in @angular/common as it will be used by both platform-server and platform-webworker. 5528 */ 5529class NullViewportScroller { 5530 /** 5531 * Empty implementation 5532 */ 5533 setOffset(offset) { } 5534 /** 5535 * Empty implementation 5536 */ 5537 getScrollPosition() { 5538 return [0, 0]; 5539 } 5540 /** 5541 * Empty implementation 5542 */ 5543 scrollToPosition(position) { } 5544 /** 5545 * Empty implementation 5546 */ 5547 scrollToAnchor(anchor) { } 5548 /** 5549 * Empty implementation 5550 */ 5551 setHistoryScrollRestoration(scrollRestoration) { } 5552} 5553 5554/** 5555 * @license 5556 * Copyright Google LLC All Rights Reserved. 5557 * 5558 * Use of this source code is governed by an MIT-style license that can be 5559 * found in the LICENSE file at https://angular.io/license 5560 */ 5561 5562/** 5563 * @license 5564 * Copyright Google LLC All Rights Reserved. 5565 * 5566 * Use of this source code is governed by an MIT-style license that can be 5567 * found in the LICENSE file at https://angular.io/license 5568 */ 5569// This file only reexports content of the `src` folder. Keep it that way. 5570 5571/** 5572 * @license 5573 * Copyright Google LLC All Rights Reserved. 5574 * 5575 * Use of this source code is governed by an MIT-style license that can be 5576 * found in the LICENSE file at https://angular.io/license 5577 */ 5578 5579/** 5580 * Generated bundle index. Do not edit. 5581 */ 5582 5583 5584 5585//# sourceMappingURL=common.js.map 5586 5587/***/ }), 5588
vendor: 95,671 bytes, lines 5589-7776
5589/***/ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js": 5590/*!********************************************************************!*\ 5591 !*** ./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js ***! 5592 \********************************************************************/ 5593/*! exports provided: HTTP_INTERCEPTORS, HttpBackend, HttpClient, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpErrorResponse, HttpEventType, HttpHandler, HttpHeaderResponse, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, XhrFactory, ɵHttpInterceptingHandler, ɵangular_packages_common_http_http_a, ɵangular_packages_common_http_http_b, ɵangular_packages_common_http_http_c, ɵangular_packages_common_http_http_d, ɵangular_packages_common_http_http_e, ɵangular_packages_common_http_http_f, ɵangular_packages_common_http_http_g, ɵangular_packages_common_http_http_h */ 5594/***/ (function(module, __webpack_exports__, __webpack_require__) { 5595 5596"use strict"; 5597__webpack_require__.r(__webpack_exports__); 5598/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HTTP_INTERCEPTORS", function() { return HTTP_INTERCEPTORS; }); 5599/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpBackend", function() { return HttpBackend; }); 5600/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClient", function() { return HttpClient; }); 5601/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClientJsonpModule", function() { return HttpClientJsonpModule; }); 5602/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClientModule", function() { return HttpClientModule; }); 5603/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClientXsrfModule", function() { return HttpClientXsrfModule; }); 5604/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpErrorResponse", function() { return HttpErrorResponse; }); 5605/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpEventType", function() { return HttpEventType; }); 5606/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpHandler", function() { return HttpHandler; }); 5607/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpHeaderResponse", function() { return HttpHeaderResponse; }); 5608/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpHeaders", function() { return HttpHeaders; }); 5609/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpParams", function() { return HttpParams; }); 5610/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpRequest", function() { return HttpRequest; }); 5611/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpResponse", function() { return HttpResponse; }); 5612/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpResponseBase", function() { return HttpResponseBase; }); 5613/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpUrlEncodingCodec", function() { return HttpUrlEncodingCodec; }); 5614/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpXhrBackend", function() { return HttpXhrBackend; }); 5615/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpXsrfTokenExtractor", function() { return HttpXsrfTokenExtractor; }); 5616/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonpClientBackend", function() { return JsonpClientBackend; }); 5617/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonpInterceptor", function() { return JsonpInterceptor; }); 5618/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XhrFactory", function() { return XhrFactory; }); 5619/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵHttpInterceptingHandler", function() { return HttpInterceptingHandler; }); 5620/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_a", function() { return NoopInterceptor; }); 5621/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_b", function() { return JsonpCallbackContext; }); 5622/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_c", function() { return jsonpCallbackContext; }); 5623/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_d", function() { return BrowserXhr; }); 5624/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_e", function() { return XSRF_COOKIE_NAME; }); 5625/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_f", function() { return XSRF_HEADER_NAME; }); 5626/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_g", function() { return HttpXsrfCookieExtractor; }); 5627/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_http_http_h", function() { return HttpXsrfInterceptor; }); 5628/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js"); 5629/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); 5630/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js"); 5631/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js"); 5632/** 5633 * @license Angular v10.0.14 5634 * (c) 2010-2020 Google LLC. https://angular.io/ 5635 * License: MIT 5636 */ 5637 5638 5639 5640 5641 5642 5643/** 5644 * @license 5645 * Copyright Google LLC All Rights Reserved. 5646 * 5647 * Use of this source code is governed by an MIT-style license that can be 5648 * found in the LICENSE file at https://angular.io/license 5649 */ 5650/** 5651 * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a 5652 * `HttpResponse`. 5653 * 5654 * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the 5655 * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the 5656 * `HttpBackend`. 5657 * 5658 * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain. 5659 * 5660 * @publicApi 5661 */ 5662 5663class HttpHandler { 5664} 5665/** 5666 * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend. 5667 * 5668 * Interceptors sit between the `HttpClient` interface and the `HttpBackend`. 5669 * 5670 * When injected, `HttpBackend` dispatches requests directly to the backend, without going 5671 * through the interceptor chain. 5672 * 5673 * @publicApi 5674 */ 5675class HttpBackend { 5676} 5677 5678/** 5679 * @license 5680 * Copyright Google LLC All Rights Reserved. 5681 * 5682 * Use of this source code is governed by an MIT-style license that can be 5683 * found in the LICENSE file at https://angular.io/license 5684 */ 5685/** 5686 * Represents the header configuration options for an HTTP request. 5687 * Instances are immutable. Modifying methods return a cloned 5688 * instance with the change. The original object is never changed. 5689 * 5690 * @publicApi 5691 */ 5692class HttpHeaders { 5693 /** Constructs a new HTTP header object with the given values.*/ 5694 constructor(headers) { 5695 /** 5696 * Internal map of lowercased header names to the normalized 5697 * form of the name (the form seen first). 5698 */ 5699 this.normalizedNames = new Map(); 5700 /** 5701 * Queued updates to be materialized the next initialization. 5702 */ 5703 this.lazyUpdate = null; 5704 if (!headers) { 5705 this.headers = new Map(); 5706 } 5707 else if (typeof headers === 'string') { 5708 this.lazyInit = () => { 5709 this.headers = new Map(); 5710 headers.split('\n').forEach(line => { 5711 const index = line.indexOf(':'); 5712 if (index > 0) { 5713 const name = line.slice(0, index); 5714 const key = name.toLowerCase(); 5715 const value = line.slice(index + 1).trim(); 5716 this.maybeSetNormalizedName(name, key); 5717 if (this.headers.has(key)) { 5718 this.headers.get(key).push(value); 5719 } 5720 else { 5721 this.headers.set(key, [value]); 5722 } 5723 } 5724 }); 5725 }; 5726 } 5727 else { 5728 this.lazyInit = () => { 5729 this.headers = new Map(); 5730 Object.keys(headers).forEach(name => { 5731 let values = headers[name]; 5732 const key = name.toLowerCase(); 5733 if (typeof values === 'string') { 5734 values = [values]; 5735 } 5736 if (values.length > 0) { 5737 this.headers.set(key, values); 5738 this.maybeSetNormalizedName(name, key); 5739 } 5740 }); 5741 }; 5742 } 5743 } 5744 /** 5745 * Checks for existence of a given header. 5746 * 5747 * @param name The header name to check for existence. 5748 * 5749 * @returns True if the header exists, false otherwise. 5750 */ 5751 has(name) { 5752 this.init(); 5753 return this.headers.has(name.toLowerCase()); 5754 } 5755 /** 5756 * Retrieves the first value of a given header. 5757 * 5758 * @param name The header name. 5759 * 5760 * @returns The value string if the header exists, null otherwise 5761 */ 5762 get(name) { 5763 this.init(); 5764 const values = this.headers.get(name.toLowerCase()); 5765 return values && values.length > 0 ? values[0] : null; 5766 } 5767 /** 5768 * Retrieves the names of the headers. 5769 * 5770 * @returns A list of header names. 5771 */ 5772 keys() { 5773 this.init(); 5774 return Array.from(this.normalizedNames.values()); 5775 } 5776 /** 5777 * Retrieves a list of values for a given header. 5778 * 5779 * @param name The header name from which to retrieve values. 5780 * 5781 * @returns A string of values if the header exists, null otherwise. 5782 */ 5783 getAll(name) { 5784 this.init(); 5785 return this.headers.get(name.toLowerCase()) || null; 5786 } 5787 /** 5788 * Appends a new value to the existing set of values for a header 5789 * and returns them in a clone of the original instance. 5790 * 5791 * @param name The header name for which to append the values. 5792 * @param value The value to append. 5793 * 5794 * @returns A clone of the HTTP headers object with the value appended to the given header. 5795 */ 5796 append(name, value) { 5797 return this.clone({ name, value, op: 'a' }); 5798 } 5799 /** 5800 * Sets or modifies a value for a given header in a clone of the original instance. 5801 * If the header already exists, its value is replaced with the given value 5802 * in the returned object. 5803 * 5804 * @param name The header name. 5805 * @param value The value or values to set or overide for the given header. 5806 * 5807 * @returns A clone of the HTTP headers object with the newly set header value. 5808 */ 5809 set(name, value) { 5810 return this.clone({ name, value, op: 's' }); 5811 } 5812 /** 5813 * Deletes values for a given header in a clone of the original instance. 5814 * 5815 * @param name The header name. 5816 * @param value The value or values to delete for the given header. 5817 * 5818 * @returns A clone of the HTTP headers object with the given value deleted. 5819 */ 5820 delete(name, value) { 5821 return this.clone({ name, value, op: 'd' }); 5822 } 5823 maybeSetNormalizedName(name, lcName) { 5824 if (!this.normalizedNames.has(lcName)) { 5825 this.normalizedNames.set(lcName, name); 5826 } 5827 } 5828 init() { 5829 if (!!this.lazyInit) { 5830 if (this.lazyInit instanceof HttpHeaders) { 5831 this.copyFrom(this.lazyInit); 5832 } 5833 else { 5834 this.lazyInit(); 5835 } 5836 this.lazyInit = null; 5837 if (!!this.lazyUpdate) { 5838 this.lazyUpdate.forEach(update => this.applyUpdate(update)); 5839 this.lazyUpdate = null; 5840 } 5841 } 5842 } 5843 copyFrom(other) { 5844 other.init(); 5845 Array.from(other.headers.keys()).forEach(key => { 5846 this.headers.set(key, other.headers.get(key)); 5847 this.normalizedNames.set(key, other.normalizedNames.get(key)); 5848 }); 5849 } 5850 clone(update) { 5851 const clone = new HttpHeaders(); 5852 clone.lazyInit = 5853 (!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this; 5854 clone.lazyUpdate = (this.lazyUpdate || []).concat([update]); 5855 return clone; 5856 } 5857 applyUpdate(update) { 5858 const key = update.name.toLowerCase(); 5859 switch (update.op) { 5860 case 'a': 5861 case 's': 5862 let value = update.value; 5863 if (typeof value === 'string') { 5864 value = [value]; 5865 } 5866 if (value.length === 0) { 5867 return; 5868 } 5869 this.maybeSetNormalizedName(update.name, key); 5870 const base = (update.op === 'a' ? this.headers.get(key) : undefined) || []; 5871 base.push(...value); 5872 this.headers.set(key, base); 5873 break; 5874 case 'd': 5875 const toDelete = update.value; 5876 if (!toDelete) { 5877 this.headers.delete(key); 5878 this.normalizedNames.delete(key); 5879 } 5880 else { 5881 let existing = this.headers.get(key); 5882 if (!existing) { 5883 return; 5884 } 5885 existing = existing.filter(value => toDelete.indexOf(value) === -1); 5886 if (existing.length === 0) { 5887 this.headers.delete(key); 5888 this.normalizedNames.delete(key); 5889 } 5890 else { 5891 this.headers.set(key, existing); 5892 } 5893 } 5894 break; 5895 } 5896 } 5897 /** 5898 * @internal 5899 */ 5900 forEach(fn) { 5901 this.init(); 5902 Array.from(this.normalizedNames.keys()) 5903 .forEach(key => fn(this.normalizedNames.get(key), this.headers.get(key))); 5904 } 5905} 5906 5907/** 5908 * @license 5909 * Copyright Google LLC All Rights Reserved. 5910 * 5911 * Use of this source code is governed by an MIT-style license that can be 5912 * found in the LICENSE file at https://angular.io/license 5913 */ 5914/** 5915 * Provides encoding and decoding of URL parameter and query-string values. 5916 * 5917 * Serializes and parses URL parameter keys and values to encode and decode them. 5918 * If you pass URL query parameters without encoding, 5919 * the query parameters can be misinterpreted at the receiving end. 5920 * 5921 * 5922 * @publicApi 5923 */ 5924class HttpUrlEncodingCodec { 5925 /** 5926 * Encodes a key name for a URL parameter or query-string. 5927 * @param key The key name. 5928 * @returns The encoded key name. 5929 */ 5930 encodeKey(key) { 5931 return standardEncoding(key); 5932 } 5933 /** 5934 * Encodes the value of a URL parameter or query-string. 5935 * @param value The value. 5936 * @returns The encoded value. 5937 */ 5938 encodeValue(value) { 5939 return standardEncoding(value); 5940 } 5941 /** 5942 * Decodes an encoded URL parameter or query-string key. 5943 * @param key The encoded key name. 5944 * @returns The decoded key name. 5945 */ 5946 decodeKey(key) { 5947 return decodeURIComponent(key); 5948 } 5949 /** 5950 * Decodes an encoded URL parameter or query-string value. 5951 * @param value The encoded value. 5952 * @returns The decoded value. 5953 */ 5954 decodeValue(value) { 5955 return decodeURIComponent(value); 5956 } 5957} 5958function paramParser(rawParams, codec) { 5959 const map = new Map(); 5960 if (rawParams.length > 0) { 5961 const params = rawParams.split('&'); 5962 params.forEach((param) => { 5963 const eqIdx = param.indexOf('='); 5964 const [key, val] = eqIdx == -1 ? 5965 [codec.decodeKey(param), ''] : 5966 [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))]; 5967 const list = map.get(key) || []; 5968 list.push(val); 5969 map.set(key, list); 5970 }); 5971 } 5972 return map; 5973} 5974function standardEncoding(v) { 5975 return encodeURIComponent(v) 5976 .replace(/%40/gi, '@') 5977 .replace(/%3A/gi, ':') 5978 .replace(/%24/gi, '$') 5979 .replace(/%2C/gi, ',') 5980 .replace(/%3B/gi, ';') 5981 .replace(/%2B/gi, '+') 5982 .replace(/%3D/gi, '=') 5983 .replace(/%3F/gi, '?') 5984 .replace(/%2F/gi, '/'); 5985} 5986/** 5987 * An HTTP request/response body that represents serialized parameters, 5988 * per the MIME type `application/x-www-form-urlencoded`. 5989 * 5990 * This class is immutable; all mutation operations return a new instance. 5991 * 5992 * @publicApi 5993 */ 5994class HttpParams { 5995 constructor(options = {}) { 5996 this.updates = null; 5997 this.cloneFrom = null; 5998 this.encoder = options.encoder || new HttpUrlEncodingCodec(); 5999 if (!!options.fromString) { 6000 if (!!options.fromObject) { 6001 throw new Error(`Cannot specify both fromString and fromObject.`); 6002 } 6003 this.map = paramParser(options.fromString, this.encoder); 6004 } 6005 else if (!!options.fromObject) { 6006 this.map = new Map(); 6007 Object.keys(options.fromObject).forEach(key => { 6008 const value = options.fromObject[key]; 6009 this.map.set(key, Array.isArray(value) ? value : [value]); 6010 }); 6011 } 6012 else { 6013 this.map = null; 6014 } 6015 } 6016 /** 6017 * Reports whether the body includes one or more values for a given parameter. 6018 * @param param The parameter name. 6019 * @returns True if the parameter has one or more values, 6020 * false if it has no value or is not present. 6021 */ 6022 has(param) { 6023 this.init(); 6024 return this.map.has(param); 6025 } 6026 /** 6027 * Retrieves the first value for a parameter. 6028 * @param param The parameter name. 6029 * @returns The first value of the given parameter, 6030 * or `null` if the parameter is not present. 6031 */ 6032 get(param) { 6033 this.init(); 6034 const res = this.map.get(param); 6035 return !!res ? res[0] : null; 6036 } 6037 /** 6038 * Retrieves all values for a parameter. 6039 * @param param The parameter name. 6040 * @returns All values in a string array, 6041 * or `null` if the parameter not present. 6042 */ 6043 getAll(param) { 6044 this.init(); 6045 return this.map.get(param) || null; 6046 } 6047 /** 6048 * Retrieves all the parameters for this body. 6049 * @returns The parameter names in a string array. 6050 */ 6051 keys() { 6052 this.init(); 6053 return Array.from(this.map.keys()); 6054 } 6055 /** 6056 * Appends a new value to existing values for a parameter. 6057 * @param param The parameter name. 6058 * @param value The new value to add. 6059 * @return A new body with the appended value. 6060 */ 6061 append(param, value) { 6062 return this.clone({ param, value, op: 'a' }); 6063 } 6064 /** 6065 * Replaces the value for a parameter. 6066 * @param param The parameter name. 6067 * @param value The new value. 6068 * @return A new body with the new value. 6069 */ 6070 set(param, value) { 6071 return this.clone({ param, value, op: 's' }); 6072 } 6073 /** 6074 * Removes a given value or all values from a parameter. 6075 * @param param The parameter name. 6076 * @param value The value to remove, if provided. 6077 * @return A new body with the given value removed, or with all values 6078 * removed if no value is specified. 6079 */ 6080 delete(param, value) { 6081 return this.clone({ param, value, op: 'd' }); 6082 } 6083 /** 6084 * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are 6085 * separated by `&`s. 6086 */ 6087 toString() { 6088 this.init(); 6089 return this.keys() 6090 .map(key => { 6091 const eKey = this.encoder.encodeKey(key); 6092 // `a: ['1']` produces `'a=1'` 6093 // `b: []` produces `''` 6094 // `c: ['1', '2']` produces `'c=1&c=2'` 6095 return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value)) 6096 .join('&'); 6097 }) 6098 // filter out empty values because `b: []` produces `''` 6099 // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't 6100 .filter(param => param !== '') 6101 .join('&'); 6102 } 6103 clone(update) { 6104 const clone = new HttpParams({ encoder: this.encoder }); 6105 clone.cloneFrom = this.cloneFrom || this; 6106 clone.updates = (this.updates || []).concat([update]); 6107 return clone; 6108 } 6109 init() { 6110 if (this.map === null) { 6111 this.map = new Map(); 6112 } 6113 if (this.cloneFrom !== null) { 6114 this.cloneFrom.init(); 6115 this.cloneFrom.keys().forEach(key => this.map.set(key, this.cloneFrom.map.get(key))); 6116 this.updates.forEach(update => { 6117 switch (update.op) { 6118 case 'a': 6119 case 's': 6120 const base = (update.op === 'a' ? this.map.get(update.param) : undefined) || []; 6121 base.push(update.value); 6122 this.map.set(update.param, base); 6123 break; 6124 case 'd': 6125 if (update.value !== undefined) { 6126 let base = this.map.get(update.param) || []; 6127 const idx = base.indexOf(update.value); 6128 if (idx !== -1) { 6129 base.splice(idx, 1); 6130 } 6131 if (base.length > 0) { 6132 this.map.set(update.param, base); 6133 } 6134 else { 6135 this.map.delete(update.param); 6136 } 6137 } 6138 else { 6139 this.map.delete(update.param); 6140 break; 6141 } 6142 } 6143 }); 6144 this.cloneFrom = this.updates = null; 6145 } 6146 } 6147} 6148 6149/** 6150 * @license 6151 * Copyright Google LLC All Rights Reserved. 6152 * 6153 * Use of this source code is governed by an MIT-style license that can be 6154 * found in the LICENSE file at https://angular.io/license 6155 */ 6156/** 6157 * Determine whether the given HTTP method may include a body. 6158 */ 6159function mightHaveBody(method) { 6160 switch (method) { 6161 case 'DELETE': 6162 case 'GET': 6163 case 'HEAD': 6164 case 'OPTIONS': 6165 case 'JSONP': 6166 return false; 6167 default: 6168 return true; 6169 } 6170} 6171/** 6172 * Safely assert whether the given value is an ArrayBuffer. 6173 * 6174 * In some execution environments ArrayBuffer is not defined. 6175 */ 6176function isArrayBuffer(value) { 6177 return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer; 6178} 6179/** 6180 * Safely assert whether the given value is a Blob. 6181 * 6182 * In some execution environments Blob is not defined. 6183 */ 6184function isBlob(value) { 6185 return typeof Blob !== 'undefined' && value instanceof Blob; 6186} 6187/** 6188 * Safely assert whether the given value is a FormData instance. 6189 * 6190 * In some execution environments FormData is not defined. 6191 */ 6192function isFormData(value) { 6193 return typeof FormData !== 'undefined' && value instanceof FormData; 6194} 6195/** 6196 * An outgoing HTTP request with an optional typed body. 6197 * 6198 * `HttpRequest` represents an outgoing request, including URL, method, 6199 * headers, body, and other request configuration options. Instances should be 6200 * assumed to be immutable. To modify a `HttpRequest`, the `clone` 6201 * method should be used. 6202 * 6203 * @publicApi 6204 */ 6205class HttpRequest { 6206 constructor(method, url, third, fourth) { 6207 this.url = url; 6208 /** 6209 * The request body, or `null` if one isn't set. 6210 * 6211 * Bodies are not enforced to be immutable, as they can include a reference to any 6212 * user-defined data type. However, interceptors should take care to preserve 6213 * idempotence by treating them as such. 6214 */ 6215 this.body = null; 6216 /** 6217 * Whether this request should be made in a way that exposes progress events. 6218 * 6219 * Progress events are expensive (change detection runs on each event) and so 6220 * they should only be requested if the consumer intends to monitor them. 6221 */ 6222 this.reportProgress = false; 6223 /** 6224 * Whether this request should be sent with outgoing credentials (cookies). 6225 */ 6226 this.withCredentials = false; 6227 /** 6228 * The expected response type of the server. 6229 * 6230 * This is used to parse the response appropriately before returning it to 6231 * the requestee. 6232 */ 6233 this.responseType = 'json'; 6234 this.method = method.toUpperCase(); 6235 // Next, need to figure out which argument holds the HttpRequestInit 6236 // options, if any. 6237 let options; 6238 // Check whether a body argument is expected. The only valid way to omit 6239 // the body argument is to use a known no-body method like GET. 6240 if (mightHaveBody(this.method) || !!fourth) { 6241 // Body is the third argument, options are the fourth. 6242 this.body = (third !== undefined) ? third : null; 6243 options = fourth; 6244 } 6245 else { 6246 // No body required, options are the third argument. The body stays null. 6247 options = third; 6248 } 6249 // If options have been passed, interpret them. 6250 if (options) { 6251 // Normalize reportProgress and withCredentials. 6252 this.reportProgress = !!options.reportProgress; 6253 this.withCredentials = !!options.withCredentials; 6254 // Override default response type of 'json' if one is provided. 6255 if (!!options.responseType) { 6256 this.responseType = options.responseType; 6257 } 6258 // Override headers if they're provided. 6259 if (!!options.headers) { 6260 this.headers = options.headers; 6261 } 6262 if (!!options.params) { 6263 this.params = options.params; 6264 } 6265 } 6266 // If no headers have been passed in, construct a new HttpHeaders instance. 6267 if (!this.headers) { 6268 this.headers = new HttpHeaders(); 6269 } 6270 // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance. 6271 if (!this.params) { 6272 this.params = new HttpParams(); 6273 this.urlWithParams = url; 6274 } 6275 else { 6276 // Encode the parameters to a string in preparation for inclusion in the URL. 6277 const params = this.params.toString(); 6278 if (params.length === 0) { 6279 // No parameters, the visible URL is just the URL given at creation time. 6280 this.urlWithParams = url; 6281 } 6282 else { 6283 // Does the URL already have query parameters? Look for '?'. 6284 const qIdx = url.indexOf('?'); 6285 // There are 3 cases to handle: 6286 // 1) No existing parameters -> append '?' followed by params. 6287 // 2) '?' exists and is followed by existing query string -> 6288 // append '&' followed by params. 6289 // 3) '?' exists at the end of the url -> append params directly. 6290 // This basically amounts to determining the character, if any, with 6291 // which to join the URL and parameters. 6292 const sep = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : ''); 6293 this.urlWithParams = url + sep + params; 6294 } 6295 } 6296 } 6297 /** 6298 * Transform the free-form body into a serialized format suitable for 6299 * transmission to the server. 6300 */ 6301 serializeBody() { 6302 // If no body is present, no need to serialize it. 6303 if (this.body === null) { 6304 return null; 6305 } 6306 // Check whether the body is already in a serialized form. If so, 6307 // it can just be returned directly. 6308 if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) || 6309 typeof this.body === 'string') { 6310 return this.body; 6311 } 6312 // Check whether the body is an instance of HttpUrlEncodedParams. 6313 if (this.body instanceof HttpParams) { 6314 return this.body.toString(); 6315 } 6316 // Check whether the body is an object or array, and serialize with JSON if so. 6317 if (typeof this.body === 'object' || typeof this.body === 'boolean' || 6318 Array.isArray(this.body)) { 6319 return JSON.stringify(this.body); 6320 } 6321 // Fall back on toString() for everything else. 6322 return this.body.toString(); 6323 } 6324 /** 6325 * Examine the body and attempt to infer an appropriate MIME type 6326 * for it. 6327 * 6328 * If no such type can be inferred, this method will return `null`. 6329 */ 6330 detectContentTypeHeader() { 6331 // An empty body has no content type. 6332 if (this.body === null) { 6333 return null; 6334 } 6335 // FormData bodies rely on the browser's content type assignment. 6336 if (isFormData(this.body)) { 6337 return null; 6338 } 6339 // Blobs usually have their own content type. If it doesn't, then 6340 // no type can be inferred. 6341 if (isBlob(this.body)) { 6342 return this.body.type || null; 6343 } 6344 // Array buffers have unknown contents and thus no type can be inferred. 6345 if (isArrayBuffer(this.body)) { 6346 return null; 6347 } 6348 // Technically, strings could be a form of JSON data, but it's safe enough 6349 // to assume they're plain strings. 6350 if (typeof this.body === 'string') { 6351 return 'text/plain'; 6352 } 6353 // `HttpUrlEncodedParams` has its own content-type. 6354 if (this.body instanceof HttpParams) { 6355 return 'application/x-www-form-urlencoded;charset=UTF-8'; 6356 } 6357 // Arrays, objects, and numbers will be encoded as JSON. 6358 if (typeof this.body === 'object' || typeof this.body === 'number' || 6359 Array.isArray(this.body)) { 6360 return 'application/json'; 6361 } 6362 // No type could be inferred. 6363 return null; 6364 } 6365 clone(update = {}) { 6366 // For method, url, and responseType, take the current value unless 6367 // it is overridden in the update hash. 6368 const method = update.method || this.method; 6369 const url = update.url || this.url; 6370 const responseType = update.responseType || this.responseType; 6371 // The body is somewhat special - a `null` value in update.body means 6372 // whatever current body is present is being overridden with an empty 6373 // body, whereas an `undefined` value in update.body implies no 6374 // override. 6375 const body = (update.body !== undefined) ? update.body : this.body; 6376 // Carefully handle the boolean options to differentiate between 6377 // `false` and `undefined` in the update args. 6378 const withCredentials = (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials; 6379 const reportProgress = (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress; 6380 // Headers and params may be appended to if `setHeaders` or 6381 // `setParams` are used. 6382 let headers = update.headers || this.headers; 6383 let params = update.params || this.params; 6384 // Check whether the caller has asked to add headers. 6385 if (update.setHeaders !== undefined) { 6386 // Set every requested header. 6387 headers = 6388 Object.keys(update.setHeaders) 6389 .reduce((headers, name) => headers.set(name, update.setHeaders[name]), headers); 6390 } 6391 // Check whether the caller has asked to set params. 6392 if (update.setParams) { 6393 // Set every requested param. 6394 params = Object.keys(update.setParams) 6395 .reduce((params, param) => params.set(param, update.setParams[param]), params); 6396 } 6397 // Finally, construct the new HttpRequest using the pieces from above. 6398 return new HttpRequest(method, url, body, { 6399 params, 6400 headers, 6401 reportProgress, 6402 responseType, 6403 withCredentials, 6404 }); 6405 } 6406} 6407 6408/** 6409 * @license 6410 * Copyright Google LLC All Rights Reserved. 6411 * 6412 * Use of this source code is governed by an MIT-style license that can be 6413 * found in the LICENSE file at https://angular.io/license 6414 */ 6415/** 6416 * Type enumeration for the different kinds of `HttpEvent`. 6417 * 6418 * @publicApi 6419 */ 6420var HttpEventType; 6421(function (HttpEventType) { 6422 /** 6423 * The request was sent out over the wire. 6424 */ 6425 HttpEventType[HttpEventType["Sent"] = 0] = "Sent"; 6426 /** 6427 * An upload progress event was received. 6428 */ 6429 HttpEventType[HttpEventType["UploadProgress"] = 1] = "UploadProgress"; 6430 /** 6431 * The response status code and headers were received. 6432 */ 6433 HttpEventType[HttpEventType["ResponseHeader"] = 2] = "ResponseHeader"; 6434 /** 6435 * A download progress event was received. 6436 */ 6437 HttpEventType[HttpEventType["DownloadProgress"] = 3] = "DownloadProgress"; 6438 /** 6439 * The full response including the body was received. 6440 */ 6441 HttpEventType[HttpEventType["Response"] = 4] = "Response"; 6442 /** 6443 * A custom event from an interceptor or a backend. 6444 */ 6445 HttpEventType[HttpEventType["User"] = 5] = "User"; 6446})(HttpEventType || (HttpEventType = {})); 6447/** 6448 * Base class for both `HttpResponse` and `HttpHeaderResponse`. 6449 * 6450 * @publicApi 6451 */ 6452class HttpResponseBase { 6453 /** 6454 * Super-constructor for all responses. 6455 * 6456 * The single parameter accepted is an initialization hash. Any properties 6457 * of the response passed there will override the default values. 6458 */ 6459 constructor(init, defaultStatus = 200, defaultStatusText = 'OK') { 6460 // If the hash has values passed, use them to initialize the response. 6461 // Otherwise use the default values. 6462 this.headers = init.headers || new HttpHeaders(); 6463 this.status = init.status !== undefined ? init.status : defaultStatus; 6464 this.statusText = init.statusText || defaultStatusText; 6465 this.url = init.url || null; 6466 // Cache the ok value to avoid defining a getter. 6467 this.ok = this.status >= 200 && this.status < 300; 6468 } 6469} 6470/** 6471 * A partial HTTP response which only includes the status and header data, 6472 * but no response body. 6473 * 6474 * `HttpHeaderResponse` is a `HttpEvent` available on the response 6475 * event stream, only when progress events are requested. 6476 * 6477 * @publicApi 6478 */ 6479class HttpHeaderResponse extends HttpResponseBase { 6480 /** 6481 * Create a new `HttpHeaderResponse` with the given parameters. 6482 */ 6483 constructor(init = {}) { 6484 super(init); 6485 this.type = HttpEventType.ResponseHeader; 6486 } 6487 /** 6488 * Copy this `HttpHeaderResponse`, overriding its contents with the 6489 * given parameter hash. 6490 */ 6491 clone(update = {}) { 6492 // Perform a straightforward initialization of the new HttpHeaderResponse, 6493 // overriding the current parameters with new ones if given. 6494 return new HttpHeaderResponse({ 6495 headers: update.headers || this.headers, 6496 status: update.status !== undefined ? update.status : this.status, 6497 statusText: update.statusText || this.statusText, 6498 url: update.url || this.url || undefined, 6499 }); 6500 } 6501} 6502/** 6503 * A full HTTP response, including a typed response body (which may be `null` 6504 * if one was not returned). 6505 * 6506 * `HttpResponse` is a `HttpEvent` available on the response event 6507 * stream. 6508 * 6509 * @publicApi 6510 */ 6511class HttpResponse extends HttpResponseBase { 6512 /** 6513 * Construct a new `HttpResponse`. 6514 */ 6515 constructor(init = {}) { 6516 super(init); 6517 this.type = HttpEventType.Response; 6518 this.body = init.body !== undefined ? init.body : null; 6519 } 6520 clone(update = {}) { 6521 return new HttpResponse({ 6522 body: (update.body !== undefined) ? update.body : this.body, 6523 headers: update.headers || this.headers, 6524 status: (update.status !== undefined) ? update.status : this.status, 6525 statusText: update.statusText || this.statusText, 6526 url: update.url || this.url || undefined, 6527 }); 6528 } 6529} 6530/** 6531 * A response that represents an error or failure, either from a 6532 * non-successful HTTP status, an error while executing the request, 6533 * or some other failure which occurred during the parsing of the response. 6534 * 6535 * Any error returned on the `Observable` response stream will be 6536 * wrapped in an `HttpErrorResponse` to provide additional context about 6537 * the state of the HTTP layer when the error occurred. The error property 6538 * will contain either a wrapped Error object or the error response returned 6539 * from the server. 6540 * 6541 * @publicApi 6542 */ 6543class HttpErrorResponse extends HttpResponseBase { 6544 constructor(init) { 6545 // Initialize with a default status of 0 / Unknown Error. 6546 super(init, 0, 'Unknown Error'); 6547 this.name = 'HttpErrorResponse'; 6548 /** 6549 * Errors are never okay, even when the status code is in the 2xx success range. 6550 */ 6551 this.ok = false; 6552 // If the response was successful, then this was a parse error. Otherwise, it was 6553 // a protocol-level failure of some sort. Either the request failed in transit 6554 // or the server returned an unsuccessful status code. 6555 if (this.status >= 200 && this.status < 300) { 6556 this.message = `Http failure during parsing for ${init.url || '(unknown url)'}`; 6557 } 6558 else { 6559 this.message = `Http failure response for ${init.url || '(unknown url)'}: ${init.status} ${init.statusText}`; 6560 } 6561 this.error = init.error || null; 6562 } 6563} 6564 6565/** 6566 * @license 6567 * Copyright Google LLC All Rights Reserved. 6568 * 6569 * Use of this source code is governed by an MIT-style license that can be 6570 * found in the LICENSE file at https://angular.io/license 6571 */ 6572/** 6573 * Constructs an instance of `HttpRequestOptions<T>` from a source `HttpMethodOptions` and 6574 * the given `body`. This function clones the object and adds the body. 6575 * 6576 * Note that the `responseType` *options* value is a String that identifies the 6577 * single data type of the response. 6578 * A single overload version of the method handles each response type. 6579 * The value of `responseType` cannot be a union, as the combined signature could imply. 6580 * 6581 */ 6582function addBody(options, body) { 6583 return { 6584 body, 6585 headers: options.headers, 6586 observe: options.observe, 6587 params: options.params, 6588 reportProgress: options.reportProgress, 6589 responseType: options.responseType, 6590 withCredentials: options.withCredentials, 6591 }; 6592} 6593/** 6594 * Performs HTTP requests. 6595 * This service is available as an injectable class, with methods to perform HTTP requests. 6596 * Each request method has multiple signatures, and the return type varies based on 6597 * the signature that is called (mainly the values of `observe` and `responseType`). 6598 * 6599 * Note that the `responseType` *options* value is a String that identifies the 6600 * single data type of the response. 6601 * A single overload version of the method handles each response type. 6602 * The value of `responseType` cannot be a union, as the combined signature could imply. 6603 6604 * 6605 * @usageNotes 6606 * Sample HTTP requests for the [Tour of Heroes](/tutorial/toh-pt0) application. 6607 * 6608 * ### HTTP Request Example 6609 * 6610 * ``` 6611 * // GET heroes whose name contains search term 6612 * searchHeroes(term: string): observable<Hero[]>{ 6613 * 6614 * const params = new HttpParams({fromString: 'name=term'}); 6615 * return this.httpClient.request('GET', this.heroesUrl, {responseType:'json', params}); 6616 * } 6617 * ``` 6618 * ### JSONP Example 6619 * ``` 6620 * requestJsonp(url, callback = 'callback') { 6621 * return this.httpClient.jsonp(this.heroesURL, callback); 6622 * } 6623 * ``` 6624 * 6625 * ### PATCH Example 6626 * ``` 6627 * // PATCH one of the heroes' name 6628 * patchHero (id: number, heroName: string): Observable<{}> { 6629 * const url = `${this.heroesUrl}/${id}`; // PATCH api/heroes/42 6630 * return this.httpClient.patch(url, {name: heroName}, httpOptions) 6631 * .pipe(catchError(this.handleError('patchHero'))); 6632 * } 6633 * ``` 6634 * 6635 * @see [HTTP Guide](guide/http) 6636 * 6637 * @publicApi 6638 */ 6639class HttpClient { 6640 constructor(handler) { 6641 this.handler = handler; 6642 } 6643 /** 6644 * Constructs an observable for a generic HTTP request that, when subscribed, 6645 * fires the request through the chain of registered interceptors and on to the 6646 * server. 6647 * 6648 * You can pass an `HttpRequest` directly as the only parameter. In this case, 6649 * the call returns an observable of the raw `HttpEvent` stream. 6650 * 6651 * Alternatively you can pass an HTTP method as the first parameter, 6652 * a URL string as the second, and an options hash containing the request body as the third. 6653 * See `addBody()`. In this case, the specified `responseType` and `observe` options determine the 6654 * type of returned observable. 6655 * * The `responseType` value determines how a successful response body is parsed. 6656 * * If `responseType` is the default `json`, you can pass a type interface for the resulting 6657 * object as a type parameter to the call. 6658 * 6659 * The `observe` value determines the return type, according to what you are interested in 6660 * observing. 6661 * * An `observe` value of events returns an observable of the raw `HttpEvent` stream, including 6662 * progress events by default. 6663 * * An `observe` value of response returns an observable of `HttpResponse<T>`, 6664 * where the `T` parameter depends on the `responseType` and any optionally provided type 6665 * parameter. 6666 * * An `observe` value of body returns an observable of `<T>` with the same `T` body type. 6667 * 6668 */ 6669 request(first, url, options = {}) { 6670 let req; 6671 // First, check whether the primary argument is an instance of `HttpRequest`. 6672 if (first instanceof HttpRequest) { 6673 // It is. The other arguments must be undefined (per the signatures) and can be 6674 // ignored. 6675 req = first; 6676 } 6677 else { 6678 // It's a string, so it represents a URL. Construct a request based on it, 6679 // and incorporate the remaining arguments (assuming `GET` unless a method is 6680 // provided. 6681 // Figure out the headers. 6682 let headers = undefined; 6683 if (options.headers instanceof HttpHeaders) { 6684 headers = options.headers; 6685 } 6686 else { 6687 headers = new HttpHeaders(options.headers); 6688 } 6689 // Sort out parameters. 6690 let params = undefined; 6691 if (!!options.params) { 6692 if (options.params instanceof HttpParams) { 6693 params = options.params; 6694 } 6695 else { 6696 params = new HttpParams({ fromObject: options.params }); 6697 } 6698 } 6699 // Construct the request. 6700 req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), { 6701 headers, 6702 params, 6703 reportProgress: options.reportProgress, 6704 // By default, JSON is assumed to be returned for all calls. 6705 responseType: options.responseType || 'json', 6706 withCredentials: options.withCredentials, 6707 }); 6708 } 6709 // Start with an Observable.of() the initial request, and run the handler (which 6710 // includes all interceptors) inside a concatMap(). This way, the handler runs 6711 // inside an Observable chain, which causes interceptors to be re-run on every 6712 // subscription (this also makes retries re-run the handler, including interceptors). 6713 const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["of"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["concatMap"])((req) => this.handler.handle(req))); 6714 // If coming via the API signature which accepts a previously constructed HttpRequest, 6715 // the only option is to get the event stream. Otherwise, return the event stream if 6716 // that is what was requested. 6717 if (first instanceof HttpRequest || options.observe === 'events') { 6718 return events$; 6719 } 6720 // The requested stream contains either the full response or the body. In either 6721 // case, the first step is to filter the event stream to extract a stream of 6722 // responses(s). 6723 const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["filter"])((event) => event instanceof HttpResponse)); 6724 // Decide which stream to return. 6725 switch (options.observe || 'body') { 6726 case 'body': 6727 // The requested stream is the body. Map the response stream to the response 6728 // body. This could be done more simply, but a misbehaving interceptor might 6729 // transform the response body into a different format and ignore the requested 6730 // responseType. Guard against this by validating that the response is of the 6731 // requested type. 6732 switch (req.responseType) { 6733 case 'arraybuffer': 6734 return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["map"])((res) => { 6735 // Validate that the body is an ArrayBuffer. 6736 if (res.body !== null && !(res.body instanceof ArrayBuffer)) { 6737 throw new Error('Response is not an ArrayBuffer.'); 6738 } 6739 return res.body; 6740 })); 6741 case 'blob': 6742 return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["map"])((res) => { 6743 // Validate that the body is a Blob. 6744 if (res.body !== null && !(res.body instanceof Blob)) { 6745 throw new Error('Response is not a Blob.'); 6746 } 6747 return res.body; 6748 })); 6749 case 'text': 6750 return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["map"])((res) => { 6751 // Validate that the body is a string. 6752 if (res.body !== null && typeof res.body !== 'string') { 6753 throw new Error('Response is not a string.'); 6754 } 6755 return res.body; 6756 })); 6757 case 'json': 6758 default: 6759 // No validation needed for JSON responses, as they can be of any type. 6760 return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["map"])((res) => res.body)); 6761 } 6762 case 'response': 6763 // The response stream was requested directly, so return it. 6764 return res$; 6765 default: 6766 // Guard against new future observe types being added. 6767 throw new Error(`Unreachable: unhandled observe type ${options.observe}}`); 6768 } 6769 } 6770 /** 6771 * Constructs an observable that, when subscribed, causes the configured 6772 * `DELETE` request to execute on the server. See the individual overloads for 6773 * details on the return type. 6774 * 6775 * @param url The endpoint URL. 6776 * @param options The HTTP options to send with the request. 6777 * 6778 */ 6779 delete(url, options = {}) { 6780 return this.request('DELETE', url, options); 6781 } 6782 /** 6783 * Constructs an observable that, when subscribed, causes the configured 6784 * `GET` request to execute on the server. See the individual overloads for 6785 * details on the return type. 6786 */ 6787 get(url, options = {}) { 6788 return this.request('GET', url, options); 6789 } 6790 /** 6791 * Constructs an observable that, when subscribed, causes the configured 6792 * `HEAD` request to execute on the server. The `HEAD` method returns 6793 * meta information about the resource without transferring the 6794 * resource itself. See the individual overloads for 6795 * details on the return type. 6796 */ 6797 head(url, options = {}) { 6798 return this.request('HEAD', url, options); 6799 } 6800 /** 6801 * Constructs an `Observable` that, when subscribed, causes a request with the special method 6802 * `JSONP` to be dispatched via the interceptor pipeline. 6803 * The [JSONP pattern](https://en.wikipedia.org/wiki/JSONP) works around limitations of certain 6804 * API endpoints that don't support newer, 6805 * and preferable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) protocol. 6806 * JSONP treats the endpoint API as a JavaScript file and tricks the browser to process the 6807 * requests even if the API endpoint is not located on the same domain (origin) as the client-side 6808 * application making the request. 6809 * The endpoint API must support JSONP callback for JSONP requests to work. 6810 * The resource API returns the JSON response wrapped in a callback function. 6811 * You can pass the callback function name as one of the query parameters. 6812 * Note that JSONP requests can only be used with `GET` requests. 6813 * 6814 * @param url The resource URL. 6815 * @param callbackParam The callback function name. 6816 * 6817 */ 6818 jsonp(url, callbackParam) { 6819 return this.request('JSONP', url, { 6820 params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'), 6821 observe: 'body', 6822 responseType: 'json', 6823 }); 6824 } 6825 /** 6826 * Constructs an `Observable` that, when subscribed, causes the configured 6827 * `OPTIONS` request to execute on the server. This method allows the client 6828 * to determine the supported HTTP methods and other capabilites of an endpoint, 6829 * without implying a resource action. See the individual overloads for 6830 * details on the return type. 6831 */ 6832 options(url, options = {}) { 6833 return this.request('OPTIONS', url, options); 6834 } 6835 /** 6836 * Constructs an observable that, when subscribed, causes the configured 6837 * `PATCH` request to execute on the server. See the individual overloads for 6838 * details on the return type. 6839 */ 6840 patch(url, body, options = {}) { 6841 return this.request('PATCH', url, addBody(options, body)); 6842 } 6843 /** 6844 * Constructs an observable that, when subscribed, causes the configured 6845 * `POST` request to execute on the server. The server responds with the location of 6846 * the replaced resource. See the individual overloads for 6847 * details on the return type. 6848 */ 6849 post(url, body, options = {}) { 6850 return this.request('POST', url, addBody(options, body)); 6851 } 6852 /** 6853 * Constructs an observable that, when subscribed, causes the configured 6854 * `PUT` request to execute on the server. The `PUT` method replaces an existing resource 6855 * with a new set of values. 6856 * See the individual overloads for details on the return type. 6857 */ 6858 put(url, body, options = {}) { 6859 return this.request('PUT', url, addBody(options, body)); 6860 } 6861} 6862HttpClient.ɵfac = function HttpClient_Factory(t) { return new (t || HttpClient)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](HttpHandler)); }; 6863HttpClient.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HttpClient, factory: HttpClient.ɵfac }); 6864HttpClient.ctorParameters = () => [ 6865 { type: HttpHandler } 6866]; 6867/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HttpClient, [{ 6868 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 6869 }], function () { return [{ type: HttpHandler }]; }, null); })(); 6870 6871/** 6872 * @license 6873 * Copyright Google LLC All Rights Reserved. 6874 * 6875 * Use of this source code is governed by an MIT-style license that can be 6876 * found in the LICENSE file at https://angular.io/license 6877 */ 6878/** 6879 * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`. 6880 * 6881 * 6882 */ 6883class HttpInterceptorHandler { 6884 constructor(next, interceptor) { 6885 this.next = next; 6886 this.interceptor = interceptor; 6887 } 6888 handle(req) { 6889 return this.interceptor.intercept(req, this.next); 6890 } 6891} 6892/** 6893 * A multi-provider token that represents the array of registered 6894 * `HttpInterceptor` objects. 6895 * 6896 * @publicApi 6897 */ 6898const HTTP_INTERCEPTORS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('HTTP_INTERCEPTORS'); 6899class NoopInterceptor { 6900 intercept(req, next) { 6901 return next.handle(req); 6902 } 6903} 6904NoopInterceptor.ɵfac = function NoopInterceptor_Factory(t) { return new (t || NoopInterceptor)(); }; 6905NoopInterceptor.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: NoopInterceptor, factory: NoopInterceptor.ɵfac }); 6906/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NoopInterceptor, [{ 6907 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 6908 }], null, null); })(); 6909 6910/** 6911 * @license 6912 * Copyright Google LLC All Rights Reserved. 6913 * 6914 * Use of this source code is governed by an MIT-style license that can be 6915 * found in the LICENSE file at https://angular.io/license 6916 */ 6917// Every request made through JSONP needs a callback name that's unique across the 6918// whole page. Each request is assigned an id and the callback name is constructed 6919// from that. The next id to be assigned is tracked in a global variable here that 6920// is shared among all applications on the page. 6921let nextRequestId = 0; 6922// Error text given when a JSONP script is injected, but doesn't invoke the callback 6923// passed in its URL. 6924const JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.'; 6925// Error text given when a request is passed to the JsonpClientBackend that doesn't 6926// have a request method JSONP. 6927const JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.'; 6928const JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.'; 6929/** 6930 * DI token/abstract type representing a map of JSONP callbacks. 6931 * 6932 * In the browser, this should always be the `window` object. 6933 * 6934 * 6935 */ 6936class JsonpCallbackContext { 6937} 6938/** 6939 * Processes an `HttpRequest` with the JSONP method, 6940 * by performing JSONP style requests. 6941 * @see `HttpHandler` 6942 * @see `HttpXhrBackend` 6943 * 6944 * @publicApi 6945 */ 6946class JsonpClientBackend { 6947 constructor(callbackMap, document) { 6948 this.callbackMap = callbackMap; 6949 this.document = document; 6950 } 6951 /** 6952 * Get the name of the next callback method, by incrementing the global `nextRequestId`. 6953 */ 6954 nextCallback() { 6955 return `ng_jsonp_callback_${nextRequestId++}`; 6956 } 6957 /** 6958 * Processes a JSONP request and returns an event stream of the results. 6959 * @param req The request object. 6960 * @returns An observable of the response events. 6961 * 6962 */ 6963 handle(req) { 6964 // Firstly, check both the method and response type. If either doesn't match 6965 // then the request was improperly routed here and cannot be handled. 6966 if (req.method !== 'JSONP') { 6967 throw new Error(JSONP_ERR_WRONG_METHOD); 6968 } 6969 else if (req.responseType !== 'json') { 6970 throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE); 6971 } 6972 // Everything else happens inside the Observable boundary. 6973 return new rxjs__WEBPACK_IMPORTED_MODULE_1__["Observable"]((observer) => { 6974 // The first step to make a request is to generate the callback name, and replace the 6975 // callback placeholder in the URL with the name. Care has to be taken here to ensure 6976 // a trailing &, if matched, gets inserted back into the URL in the correct place. 6977 const callback = this.nextCallback(); 6978 const url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, `=${callback}$1`); 6979 // Construct the <script> tag and point it at the URL. 6980 const node = this.document.createElement('script'); 6981 node.src = url; 6982 // A JSONP request requires waiting for multiple callbacks. These variables 6983 // are closed over and track state across those callbacks. 6984 // The response object, if one has been received, or null otherwise. 6985 let body = null; 6986 // Whether the response callback has been called. 6987 let finished = false; 6988 // Whether the request has been cancelled (and thus any other callbacks) 6989 // should be ignored. 6990 let cancelled = false; 6991 // Set the response callback in this.callbackMap (which will be the window 6992 // object in the browser. The script being loaded via the <script> tag will 6993 // eventually call this callback. 6994 this.callbackMap[callback] = (data) => { 6995 // Data has been received from the JSONP script. Firstly, delete this callback. 6996 delete this.callbackMap[callback]; 6997 // Next, make sure the request wasn't cancelled in the meantime. 6998 if (cancelled) { 6999 return; 7000 } 7001 // Set state to indicate data was received. 7002 body = data; 7003 finished = true; 7004 }; 7005 // cleanup() is a utility closure that removes the <script> from the page and 7006 // the response callback from the window. This logic is used in both the 7007 // success, error, and cancellation paths, so it's extracted out for convenience. 7008 const cleanup = () => { 7009 // Remove the <script> tag if it's still on the page. 7010 if (node.parentNode) { 7011 node.parentNode.removeChild(node); 7012 } 7013 // Remove the response callback from the callbackMap (window object in the 7014 // browser). 7015 delete this.callbackMap[callback]; 7016 }; 7017 // onLoad() is the success callback which runs after the response callback 7018 // if the JSONP script loads successfully. The event itself is unimportant. 7019 // If something went wrong, onLoad() may run without the response callback 7020 // having been invoked. 7021 const onLoad = (event) => { 7022 // Do nothing if the request has been cancelled. 7023 if (cancelled) { 7024 return; 7025 } 7026 // Cleanup the page. 7027 cleanup(); 7028 // Check whether the response callback has run. 7029 if (!finished) { 7030 // It hasn't, something went wrong with the request. Return an error via 7031 // the Observable error path. All JSONP errors have status 0. 7032 observer.error(new HttpErrorResponse({ 7033 url, 7034 status: 0, 7035 statusText: 'JSONP Error', 7036 error: new Error(JSONP_ERR_NO_CALLBACK), 7037 })); 7038 return; 7039 } 7040 // Success. body either contains the response body or null if none was 7041 // returned. 7042 observer.next(new HttpResponse({ 7043 body, 7044 status: 200, 7045 statusText: 'OK', 7046 url, 7047 })); 7048 // Complete the stream, the response is over. 7049 observer.complete(); 7050 }; 7051 // onError() is the error callback, which runs if the script returned generates 7052 // a Javascript error. It emits the error via the Observable error channel as 7053 // a HttpErrorResponse. 7054 const onError = (error) => { 7055 // If the request was already cancelled, no need to emit anything. 7056 if (cancelled) { 7057 return; 7058 } 7059 cleanup(); 7060 // Wrap the error in a HttpErrorResponse. 7061 observer.error(new HttpErrorResponse({ 7062 error, 7063 status: 0, 7064 statusText: 'JSONP Error', 7065 url, 7066 })); 7067 }; 7068 // Subscribe to both the success (load) and error events on the <script> tag, 7069 // and add it to the page. 7070 node.addEventListener('load', onLoad); 7071 node.addEventListener('error', onError); 7072 this.document.body.appendChild(node); 7073 // The request has now been successfully sent. 7074 observer.next({ type: HttpEventType.Sent }); 7075 // Cancellation handler. 7076 return () => { 7077 // Track the cancellation so event listeners won't do anything even if already scheduled. 7078 cancelled = true; 7079 // Remove the event listeners so they won't run if the events later fire. 7080 node.removeEventListener('load', onLoad); 7081 node.removeEventListener('error', onError); 7082 // And finally, clean up the page. 7083 cleanup(); 7084 }; 7085 }); 7086 } 7087} 7088JsonpClientBackend.ɵfac = function JsonpClientBackend_Factory(t) { return new (t || JsonpClientBackend)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](JsonpCallbackContext), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"])); }; 7089JsonpClientBackend.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: JsonpClientBackend, factory: JsonpClientBackend.ɵfac }); 7090JsonpClientBackend.ctorParameters = () => [ 7091 { type: JsonpCallbackContext }, 7092 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] }] } 7093]; 7094/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](JsonpClientBackend, [{ 7095 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 7096 }], function () { return [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{ 7097 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 7098 args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"]] 7099 }] }]; }, null); })(); 7100/** 7101 * Identifies requests with the method JSONP and 7102 * shifts them to the `JsonpClientBackend`. 7103 * 7104 * @see `HttpInterceptor` 7105 * 7106 * @publicApi 7107 */ 7108class JsonpInterceptor { 7109 constructor(jsonp) { 7110 this.jsonp = jsonp; 7111 } 7112 /** 7113 * Identifies and handles a given JSONP request. 7114 * @param req The outgoing request object to handle. 7115 * @param next The next interceptor in the chain, or the backend 7116 * if no interceptors remain in the chain. 7117 * @returns An observable of the event stream. 7118 */ 7119 intercept(req, next) { 7120 if (req.method === 'JSONP') { 7121 return this.jsonp.handle(req); 7122 } 7123 // Fall through for normal HTTP requests. 7124 return next.handle(req); 7125 } 7126} 7127JsonpInterceptor.ɵfac = function JsonpInterceptor_Factory(t) { return new (t || JsonpInterceptor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](JsonpClientBackend)); }; 7128JsonpInterceptor.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: JsonpInterceptor, factory: JsonpInterceptor.ɵfac }); 7129JsonpInterceptor.ctorParameters = () => [ 7130 { type: JsonpClientBackend } 7131]; 7132/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](JsonpInterceptor, [{ 7133 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 7134 }], function () { return [{ type: JsonpClientBackend }]; }, null); })(); 7135 7136/** 7137 * @license 7138 * Copyright Google LLC All Rights Reserved. 7139 * 7140 * Use of this source code is governed by an MIT-style license that can be 7141 * found in the LICENSE file at https://angular.io/license 7142 */ 7143const XSSI_PREFIX = /^\)\]\}',?\n/; 7144/** 7145 * Determine an appropriate URL for the response, by checking either 7146 * XMLHttpRequest.responseURL or the X-Request-URL header. 7147 */ 7148function getResponseUrl(xhr) { 7149 if ('responseURL' in xhr && xhr.responseURL) { 7150 return xhr.responseURL; 7151 } 7152 if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) { 7153 return xhr.getResponseHeader('X-Request-URL'); 7154 } 7155 return null; 7156} 7157/** 7158 * A wrapper around the `XMLHttpRequest` constructor. 7159 * 7160 * @publicApi 7161 */ 7162class XhrFactory { 7163} 7164/** 7165 * A factory for `HttpXhrBackend` that uses the `XMLHttpRequest` browser API. 7166 * 7167 */ 7168class BrowserXhr { 7169 constructor() { } 7170 build() { 7171 return (new XMLHttpRequest()); 7172 } 7173} 7174BrowserXhr.ɵfac = function BrowserXhr_Factory(t) { return new (t || BrowserXhr)(); }; 7175BrowserXhr.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: BrowserXhr, factory: BrowserXhr.ɵfac }); 7176BrowserXhr.ctorParameters = () => []; 7177/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](BrowserXhr, [{ 7178 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 7179 }], function () { return []; }, null); })(); 7180/** 7181 * Uses `XMLHttpRequest` to send requests to a backend server. 7182 * @see `HttpHandler` 7183 * @see `JsonpClientBackend` 7184 * 7185 * @publicApi 7186 */ 7187class HttpXhrBackend { 7188 constructor(xhrFactory) { 7189 this.xhrFactory = xhrFactory; 7190 } 7191 /** 7192 * Processes a request and returns a stream of response events. 7193 * @param req The request object. 7194 * @returns An observable of the response events. 7195 */ 7196 handle(req) { 7197 // Quick check to give a better error message when a user attempts to use 7198 // HttpClient.jsonp() without installing the JsonpClientModule 7199 if (req.method === 'JSONP') { 7200 throw new Error(`Attempted to construct Jsonp request without JsonpClientModule installed.`); 7201 } 7202 // Everything happens on Observable subscription. 7203 return new rxjs__WEBPACK_IMPORTED_MODULE_1__["Observable"]((observer) => { 7204 // Start by setting up the XHR object with request method, URL, and withCredentials flag. 7205 const xhr = this.xhrFactory.build(); 7206 xhr.open(req.method, req.urlWithParams); 7207 if (!!req.withCredentials) { 7208 xhr.withCredentials = true; 7209 } 7210 // Add all the requested headers. 7211 req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(','))); 7212 // Add an Accept header if one isn't present already. 7213 if (!req.headers.has('Accept')) { 7214 xhr.setRequestHeader('Accept', 'application/json, text/plain, */*'); 7215 } 7216 // Auto-detect the Content-Type header if one isn't present already. 7217 if (!req.headers.has('Content-Type')) { 7218 const detectedType = req.detectContentTypeHeader(); 7219 // Sometimes Content-Type detection fails. 7220 if (detectedType !== null) { 7221 xhr.setRequestHeader('Content-Type', detectedType); 7222 } 7223 } 7224 // Set the responseType if one was requested. 7225 if (req.responseType) { 7226 const responseType = req.responseType.toLowerCase(); 7227 // JSON responses need to be processed as text. This is because if the server 7228 // returns an XSSI-prefixed JSON response, the browser will fail to parse it, 7229 // xhr.response will be null, and xhr.responseText cannot be accessed to 7230 // retrieve the prefixed JSON data in order to strip the prefix. Thus, all JSON 7231 // is parsed by first requesting text and then applying JSON.parse. 7232 xhr.responseType = ((responseType !== 'json') ? responseType : 'text'); 7233 } 7234 // Serialize the request body if one is present. If not, this will be set to null. 7235 const reqBody = req.serializeBody(); 7236 // If progress events are enabled, response headers will be delivered 7237 // in two events - the HttpHeaderResponse event and the full HttpResponse 7238 // event. However, since response headers don't change in between these 7239 // two events, it doesn't make sense to parse them twice. So headerResponse 7240 // caches the data extracted from the response whenever it's first parsed, 7241 // to ensure parsing isn't duplicated. 7242 let headerResponse = null; 7243 // partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest 7244 // state, and memoizes it into headerResponse. 7245 const partialFromXhr = () => { 7246 if (headerResponse !== null) { 7247 return headerResponse; 7248 } 7249 // Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450). 7250 const status = xhr.status === 1223 ? 204 : xhr.status; 7251 const statusText = xhr.statusText || 'OK'; 7252 // Parse headers from XMLHttpRequest - this step is lazy. 7253 const headers = new HttpHeaders(xhr.getAllResponseHeaders()); 7254 // Read the response URL from the XMLHttpResponse instance and fall back on the 7255 // request URL. 7256 const url = getResponseUrl(xhr) || req.url; 7257 // Construct the HttpHeaderResponse and memoize it. 7258 headerResponse = new HttpHeaderResponse({ headers, status, statusText, url }); 7259 return headerResponse; 7260 }; 7261 // Next, a few closures are defined for the various events which XMLHttpRequest can 7262 // emit. This allows them to be unregistered as event listeners later. 7263 // First up is the load event, which represents a response being fully available. 7264 const onLoad = () => { 7265 // Read response state from the memoized partial data. 7266 let { headers, status, statusText, url } = partialFromXhr(); 7267 // The body will be read out if present. 7268 let body = null; 7269 if (status !== 204) { 7270 // Use XMLHttpRequest.response if set, responseText otherwise. 7271 body = (typeof xhr.response === 'undefined') ? xhr.responseText : xhr.response; 7272 } 7273 // Normalize another potential bug (this one comes from CORS). 7274 if (status === 0) { 7275 status = !!body ? 200 : 0; 7276 } 7277 // ok determines whether the response will be transmitted on the event or 7278 // error channel. Unsuccessful status codes (not 2xx) will always be errors, 7279 // but a successful status code can still result in an error if the user 7280 // asked for JSON data and the body cannot be parsed as such. 7281 let ok = status >= 200 && status < 300; 7282 // Check whether the body needs to be parsed as JSON (in many cases the browser 7283 // will have done that already). 7284 if (req.responseType === 'json' && typeof body === 'string') { 7285 // Save the original body, before attempting XSSI prefix stripping. 7286 const originalBody = body; 7287 body = body.replace(XSSI_PREFIX, ''); 7288 try { 7289 // Attempt the parse. If it fails, a parse error should be delivered to the user. 7290 body = body !== '' ? JSON.parse(body) : null; 7291 } 7292 catch (error) { 7293 // Since the JSON.parse failed, it's reasonable to assume this might not have been a 7294 // JSON response. Restore the original body (including any XSSI prefix) to deliver 7295 // a better error response. 7296 body = originalBody; 7297 // If this was an error request to begin with, leave it as a string, it probably 7298 // just isn't JSON. Otherwise, deliver the parsing error to the user. 7299 if (ok) { 7300 // Even though the response status was 2xx, this is still an error. 7301 ok = false; 7302 // The parse error contains the text of the body that failed to parse. 7303 body = { error, text: body }; 7304 } 7305 } 7306 } 7307 if (ok) { 7308 // A successful response is delivered on the event stream. 7309 observer.next(new HttpResponse({ 7310 body, 7311 headers, 7312 status, 7313 statusText, 7314 url: url || undefined, 7315 })); 7316 // The full body has been received and delivered, no further events 7317 // are possible. This request is complete. 7318 observer.complete(); 7319 } 7320 else { 7321 // An unsuccessful request is delivered on the error channel. 7322 observer.error(new HttpErrorResponse({ 7323 // The error in this case is the response body (error from the server). 7324 error: body, 7325 headers, 7326 status, 7327 statusText, 7328 url: url || undefined, 7329 })); 7330 } 7331 }; 7332 // The onError callback is called when something goes wrong at the network level. 7333 // Connection timeout, DNS error, offline, etc. These are actual errors, and are 7334 // transmitted on the error channel. 7335 const onError = (error) => { 7336 const { url } = partialFromXhr(); 7337 const res = new HttpErrorResponse({ 7338 error, 7339 status: xhr.status || 0, 7340 statusText: xhr.statusText || 'Unknown Error', 7341 url: url || undefined, 7342 }); 7343 observer.error(res); 7344 }; 7345 // The sentHeaders flag tracks whether the HttpResponseHeaders event 7346 // has been sent on the stream. This is necessary to track if progress 7347 // is enabled since the event will be sent on only the first download 7348 // progerss event. 7349 let sentHeaders = false; 7350 // The download progress event handler, which is only registered if 7351 // progress events are enabled. 7352 const onDownProgress = (event) => { 7353 // Send the HttpResponseHeaders event if it hasn't been sent already. 7354 if (!sentHeaders) { 7355 observer.next(partialFromXhr()); 7356 sentHeaders = true; 7357 } 7358 // Start building the download progress event to deliver on the response 7359 // event stream. 7360 let progressEvent = { 7361 type: HttpEventType.DownloadProgress, 7362 loaded: event.loaded, 7363 }; 7364 // Set the total number of bytes in the event if it's available. 7365 if (event.lengthComputable) { 7366 progressEvent.total = event.total; 7367 } 7368 // If the request was for text content and a partial response is 7369 // available on XMLHttpRequest, include it in the progress event 7370 // to allow for streaming reads. 7371 if (req.responseType === 'text' && !!xhr.responseText) { 7372 progressEvent.partialText = xhr.responseText; 7373 } 7374 // Finally, fire the event. 7375 observer.next(progressEvent); 7376 }; 7377 // The upload progress event handler, which is only registered if 7378 // progress events are enabled. 7379 const onUpProgress = (event) => { 7380 // Upload progress events are simpler. Begin building the progress 7381 // event. 7382 let progress = { 7383 type: HttpEventType.UploadProgress, 7384 loaded: event.loaded, 7385 }; 7386 // If the total number of bytes being uploaded is available, include 7387 // it. 7388 if (event.lengthComputable) { 7389 progress.total = event.total; 7390 } 7391 // Send the event. 7392 observer.next(progress); 7393 }; 7394 // By default, register for load and error events. 7395 xhr.addEventListener('load', onLoad); 7396 xhr.addEventListener('error', onError); 7397 // Progress events are only enabled if requested. 7398 if (req.reportProgress) { 7399 // Download progress is always enabled if requested. 7400 xhr.addEventListener('progress', onDownProgress); 7401 // Upload progress depends on whether there is a body to upload. 7402 if (reqBody !== null && xhr.upload) { 7403 xhr.upload.addEventListener('progress', onUpProgress); 7404 } 7405 } 7406 // Fire the request, and notify the event stream that it was fired. 7407 xhr.send(reqBody); 7408 observer.next({ type: HttpEventType.Sent }); 7409 // This is the return from the Observable function, which is the 7410 // request cancellation handler. 7411 return () => { 7412 // On a cancellation, remove all registered event listeners. 7413 xhr.removeEventListener('error', onError); 7414 xhr.removeEventListener('load', onLoad); 7415 if (req.reportProgress) { 7416 xhr.removeEventListener('progress', onDownProgress); 7417 if (reqBody !== null && xhr.upload) { 7418 xhr.upload.removeEventListener('progress', onUpProgress); 7419 } 7420 } 7421 // Finally, abort the in-flight request. 7422 if (xhr.readyState !== xhr.DONE) { 7423 xhr.abort(); 7424 } 7425 }; 7426 }); 7427 } 7428} 7429HttpXhrBackend.ɵfac = function HttpXhrBackend_Factory(t) { return new (t || HttpXhrBackend)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](XhrFactory)); }; 7430HttpXhrBackend.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HttpXhrBackend, factory: HttpXhrBackend.ɵfac }); 7431HttpXhrBackend.ctorParameters = () => [ 7432 { type: XhrFactory } 7433]; 7434/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HttpXhrBackend, [{ 7435 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 7436 }], function () { return [{ type: XhrFactory }]; }, null); })(); 7437 7438/** 7439 * @license 7440 * Copyright Google LLC All Rights Reserved. 7441 * 7442 * Use of this source code is governed by an MIT-style license that can be 7443 * found in the LICENSE file at https://angular.io/license 7444 */ 7445const XSRF_COOKIE_NAME = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('XSRF_COOKIE_NAME'); 7446const XSRF_HEADER_NAME = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('XSRF_HEADER_NAME'); 7447/** 7448 * Retrieves the current XSRF token to use with the next outgoing request. 7449 * 7450 * @publicApi 7451 */ 7452class HttpXsrfTokenExtractor { 7453} 7454/** 7455 * `HttpXsrfTokenExtractor` which retrieves the token from a cookie. 7456 */ 7457class HttpXsrfCookieExtractor { 7458 constructor(doc, platform, cookieName) { 7459 this.doc = doc; 7460 this.platform = platform; 7461 this.cookieName = cookieName; 7462 this.lastCookieString = ''; 7463 this.lastToken = null; 7464 /** 7465 * @internal for testing 7466 */ 7467 this.parseCount = 0; 7468 } 7469 getToken() { 7470 if (this.platform === 'server') { 7471 return null; 7472 } 7473 const cookieString = this.doc.cookie || ''; 7474 if (cookieString !== this.lastCookieString) { 7475 this.parseCount++; 7476 this.lastToken = Object(_angular_common__WEBPACK_IMPORTED_MODULE_3__["ɵparseCookieValue"])(cookieString, this.cookieName); 7477 this.lastCookieString = cookieString; 7478 } 7479 return this.lastToken; 7480 } 7481} 7482HttpXsrfCookieExtractor.ɵfac = function HttpXsrfCookieExtractor_Factory(t) { return new (t || HttpXsrfCookieExtractor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](XSRF_COOKIE_NAME)); }; 7483HttpXsrfCookieExtractor.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HttpXsrfCookieExtractor, factory: HttpXsrfCookieExtractor.ɵfac }); 7484HttpXsrfCookieExtractor.ctorParameters = () => [ 7485 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"],] }] }, 7486 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"],] }] }, 7487 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [XSRF_COOKIE_NAME,] }] } 7488]; 7489/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HttpXsrfCookieExtractor, [{ 7490 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 7491 }], function () { return [{ type: undefined, decorators: [{ 7492 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 7493 args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["DOCUMENT"]] 7494 }] }, { type: String, decorators: [{ 7495 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 7496 args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["PLATFORM_ID"]] 7497 }] }, { type: String, decorators: [{ 7498 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 7499 args: [XSRF_COOKIE_NAME] 7500 }] }]; }, null); })(); 7501/** 7502 * `HttpInterceptor` which adds an XSRF token to eligible outgoing requests. 7503 */ 7504class HttpXsrfInterceptor { 7505 constructor(tokenService, headerName) { 7506 this.tokenService = tokenService; 7507 this.headerName = headerName; 7508 } 7509 intercept(req, next) { 7510 const lcUrl = req.url.toLowerCase(); 7511 // Skip both non-mutating requests and absolute URLs. 7512 // Non-mutating requests don't require a token, and absolute URLs require special handling 7513 // anyway as the cookie set 7514 // on our origin is not the same as the token expected by another origin. 7515 if (req.method === 'GET' || req.method === 'HEAD' || lcUrl.startsWith('http://') || 7516 lcUrl.startsWith('https://')) { 7517 return next.handle(req); 7518 } 7519 const token = this.tokenService.getToken(); 7520 // Be careful not to overwrite an existing header of the same name. 7521 if (token !== null && !req.headers.has(this.headerName)) { 7522 req = req.clone({ headers: req.headers.set(this.headerName, token) }); 7523 } 7524 return next.handle(req); 7525 } 7526} 7527HttpXsrfInterceptor.ɵfac = function HttpXsrfInterceptor_Factory(t) { return new (t || HttpXsrfInterceptor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](HttpXsrfTokenExtractor), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](XSRF_HEADER_NAME)); }; 7528HttpXsrfInterceptor.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HttpXsrfInterceptor, factory: HttpXsrfInterceptor.ɵfac }); 7529HttpXsrfInterceptor.ctorParameters = () => [ 7530 { type: HttpXsrfTokenExtractor }, 7531 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [XSRF_HEADER_NAME,] }] } 7532]; 7533/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HttpXsrfInterceptor, [{ 7534 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 7535 }], function () { return [{ type: HttpXsrfTokenExtractor }, { type: String, decorators: [{ 7536 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 7537 args: [XSRF_HEADER_NAME] 7538 }] }]; }, null); })(); 7539 7540/** 7541 * @license 7542 * Copyright Google LLC All Rights Reserved. 7543 * 7544 * Use of this source code is governed by an MIT-style license that can be 7545 * found in the LICENSE file at https://angular.io/license 7546 */ 7547/** 7548 * An injectable `HttpHandler` that applies multiple interceptors 7549 * to a request before passing it to the given `HttpBackend`. 7550 * 7551 * The interceptors are loaded lazily from the injector, to allow 7552 * interceptors to themselves inject classes depending indirectly 7553 * on `HttpInterceptingHandler` itself. 7554 * @see `HttpInterceptor` 7555 */ 7556class HttpInterceptingHandler { 7557 constructor(backend, injector) { 7558 this.backend = backend; 7559 this.injector = injector; 7560 this.chain = null; 7561 } 7562 handle(req) { 7563 if (this.chain === null) { 7564 const interceptors = this.injector.get(HTTP_INTERCEPTORS, []); 7565 this.chain = interceptors.reduceRight((next, interceptor) => new HttpInterceptorHandler(next, interceptor), this.backend); 7566 } 7567 return this.chain.handle(req); 7568 } 7569} 7570HttpInterceptingHandler.ɵfac = function HttpInterceptingHandler_Factory(t) { return new (t || HttpInterceptingHandler)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](HttpBackend), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"])); }; 7571HttpInterceptingHandler.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HttpInterceptingHandler, factory: HttpInterceptingHandler.ɵfac }); 7572HttpInterceptingHandler.ctorParameters = () => [ 7573 { type: HttpBackend }, 7574 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"] } 7575]; 7576/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HttpInterceptingHandler, [{ 7577 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 7578 }], function () { return [{ type: HttpBackend }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"] }]; }, null); })(); 7579/** 7580 * Constructs an `HttpHandler` that applies interceptors 7581 * to a request before passing it to the given `HttpBackend`. 7582 * 7583 * Use as a factory function within `HttpClientModule`. 7584 * 7585 * 7586 */ 7587function interceptingHandler(backend, interceptors = []) { 7588 if (!interceptors) { 7589 return backend; 7590 } 7591 return interceptors.reduceRight((next, interceptor) => new HttpInterceptorHandler(next, interceptor), backend); 7592} 7593/** 7594 * Factory function that determines where to store JSONP callbacks. 7595 * 7596 * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist 7597 * in test environments. In that case, callbacks are stored on an anonymous object instead. 7598 * 7599 * 7600 */ 7601function jsonpCallbackContext() { 7602 if (typeof window === 'object') { 7603 return window; 7604 } 7605 return {}; 7606} 7607/** 7608 * Configures XSRF protection support for outgoing requests. 7609 * 7610 * For a server that supports a cookie-based XSRF protection system, 7611 * use directly to configure XSRF protection with the correct 7612 * cookie and header names. 7613 * 7614 * If no names are supplied, the default cookie name is `XSRF-TOKEN` 7615 * and the default header name is `X-XSRF-TOKEN`. 7616 * 7617 * @publicApi 7618 */ 7619class HttpClientXsrfModule { 7620 /** 7621 * Disable the default XSRF protection. 7622 */ 7623 static disable() { 7624 return { 7625 ngModule: HttpClientXsrfModule, 7626 providers: [ 7627 { provide: HttpXsrfInterceptor, useClass: NoopInterceptor }, 7628 ], 7629 }; 7630 } 7631 /** 7632 * Configure XSRF protection. 7633 * @param options An object that can specify either or both 7634 * cookie name or header name. 7635 * - Cookie name default is `XSRF-TOKEN`. 7636 * - Header name default is `X-XSRF-TOKEN`. 7637 * 7638 */ 7639 static withOptions(options = {}) { 7640 return { 7641 ngModule: HttpClientXsrfModule, 7642 providers: [ 7643 options.cookieName ? { provide: XSRF_COOKIE_NAME, useValue: options.cookieName } : [], 7644 options.headerName ? { provide: XSRF_HEADER_NAME, useValue: options.headerName } : [], 7645 ], 7646 }; 7647 } 7648} 7649HttpClientXsrfModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: HttpClientXsrfModule }); 7650HttpClientXsrfModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ factory: function HttpClientXsrfModule_Factory(t) { return new (t || HttpClientXsrfModule)(); }, providers: [ 7651 HttpXsrfInterceptor, 7652 { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true }, 7653 { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor }, 7654 { provide: XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' }, 7655 { provide: XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' }, 7656 ] }); 7657/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HttpClientXsrfModule, [{ 7658 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], 7659 args: [{ 7660 providers: [ 7661 HttpXsrfInterceptor, 7662 { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true }, 7663 { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor }, 7664 { provide: XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' }, 7665 { provide: XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' }, 7666 ] 7667 }] 7668 }], null, null); })(); 7669/** 7670 * Configures the [dependency injector](guide/glossary#injector) for `HttpClient` 7671 * with supporting services for XSRF. Automatically imported by `HttpClientModule`. 7672 * 7673 * You can add interceptors to the chain behind `HttpClient` by binding them to the 7674 * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`. 7675 * 7676 * @publicApi 7677 */ 7678class HttpClientModule { 7679} 7680HttpClientModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: HttpClientModule }); 7681HttpClientModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ factory: function HttpClientModule_Factory(t) { return new (t || HttpClientModule)(); }, providers: [ 7682 HttpClient, 7683 { provide: HttpHandler, useClass: HttpInterceptingHandler }, 7684 HttpXhrBackend, 7685 { provide: HttpBackend, useExisting: HttpXhrBackend }, 7686 BrowserXhr, 7687 { provide: XhrFactory, useExisting: BrowserXhr }, 7688 ], imports: [[ 7689 HttpClientXsrfModule.withOptions({ 7690 cookieName: 'XSRF-TOKEN', 7691 headerName: 'X-XSRF-TOKEN' 7692 }), 7693 ]] }); 7694(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](HttpClientModule, { imports: [HttpClientXsrfModule] }); })(); 7695/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HttpClientModule, [{ 7696 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], 7697 args: [{ 7698 /** 7699 * Optional configuration for XSRF protection. 7700 */ 7701 imports: [ 7702 HttpClientXsrfModule.withOptions({ 7703 cookieName: 'XSRF-TOKEN', 7704 headerName: 'X-XSRF-TOKEN' 7705 }), 7706 ], 7707 /** 7708 * Configures the [dependency injector](guide/glossary#injector) where it is imported 7709 * with supporting services for HTTP communications. 7710 */ 7711 providers: [ 7712 HttpClient, 7713 { provide: HttpHandler, useClass: HttpInterceptingHandler }, 7714 HttpXhrBackend, 7715 { provide: HttpBackend, useExisting: HttpXhrBackend }, 7716 BrowserXhr, 7717 { provide: XhrFactory, useExisting: BrowserXhr }, 7718 ] 7719 }] 7720 }], null, null); })(); 7721/** 7722 * Configures the [dependency injector](guide/glossary#injector) for `HttpClient` 7723 * with supporting services for JSONP. 7724 * Without this module, Jsonp requests reach the backend 7725 * with method JSONP, where they are rejected. 7726 * 7727 * You can add interceptors to the chain behind `HttpClient` by binding them to the 7728 * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`. 7729 * 7730 * @publicApi 7731 */ 7732class HttpClientJsonpModule { 7733} 7734HttpClientJsonpModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: HttpClientJsonpModule }); 7735HttpClientJsonpModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ factory: function HttpClientJsonpModule_Factory(t) { return new (t || HttpClientJsonpModule)(); }, providers: [ 7736 JsonpClientBackend, 7737 { provide: JsonpCallbackContext, useFactory: jsonpCallbackContext }, 7738 { provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true }, 7739 ] }); 7740/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HttpClientJsonpModule, [{ 7741 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], 7742 args: [{ 7743 providers: [ 7744 JsonpClientBackend, 7745 { provide: JsonpCallbackContext, useFactory: jsonpCallbackContext }, 7746 { provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true }, 7747 ] 7748 }] 7749 }], null, null); })(); 7750 7751/** 7752 * @license 7753 * Copyright Google LLC All Rights Reserved. 7754 * 7755 * Use of this source code is governed by an MIT-style license that can be 7756 * found in the LICENSE file at https://angular.io/license 7757 */ 7758 7759/** 7760 * @license 7761 * Copyright Google LLC All Rights Reserved. 7762 * 7763 * Use of this source code is governed by an MIT-style license that can be 7764 * found in the LICENSE file at https://angular.io/license 7765 */ 7766 7767/** 7768 * Generated bundle index. Do not edit. 7769 */ 7770 7771 7772 7773//# sourceMappingURL=http.js.map 7774 7775/***/ }), 7776
vendor: 1,330,490 bytes, lines 7777-39986
7777/***/ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js": 7778/*!******************************************************************!*\ 7779 !*** ./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js ***! 7780 \******************************************************************/ 7781/*! exports provided: ANALYZE_FOR_ENTRY_COMPONENTS, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactoryResolver, ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ElementRef, EmbeddedViewRef, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory, NgModuleFactoryLoader, NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, SystemJsNgModuleLoader, SystemJsNgModuleLoaderConfig, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation, ViewRef, WrappedValue, asNativeElements, assertPlatform, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getPlatform, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ɵ0, ɵ1, ɵALLOW_MULTIPLE_PLATFORMS, ɵAPP_ID_RANDOM_PROVIDER, ɵChangeDetectorStatus, ɵCodegenComponentFactoryResolver, ɵCompiler_compileModuleAndAllComponentsAsync__POST_R3__, ɵCompiler_compileModuleAndAllComponentsSync__POST_R3__, ɵCompiler_compileModuleAsync__POST_R3__, ɵCompiler_compileModuleSync__POST_R3__, ɵComponentFactory, ɵConsole, ɵDEFAULT_LOCALE_ID, ɵEMPTY_ARRAY, ɵEMPTY_MAP, ɵINJECTOR_IMPL__POST_R3__, ɵINJECTOR_SCOPE, ɵLifecycleHooksFeature, ɵLocaleDataIndex, ɵNG_COMP_DEF, ɵNG_DIR_DEF, ɵNG_ELEMENT_ID, ɵNG_INJ_DEF, ɵNG_MOD_DEF, ɵNG_PIPE_DEF, ɵNG_PROV_DEF, ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, ɵNO_CHANGE, ɵNgModuleFactory, ɵNoopNgZone, ɵReflectionCapabilities, ɵRender3ComponentFactory, ɵRender3ComponentRef, ɵRender3NgModuleRef, ɵSWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__, ɵSWITCH_COMPILE_COMPONENT__POST_R3__, ɵSWITCH_COMPILE_DIRECTIVE__POST_R3__, ɵSWITCH_COMPILE_INJECTABLE__POST_R3__, ɵSWITCH_COMPILE_NGMODULE__POST_R3__, ɵSWITCH_COMPILE_PIPE__POST_R3__, ɵSWITCH_ELEMENT_REF_FACTORY__POST_R3__, ɵSWITCH_IVY_ENABLED__POST_R3__, ɵSWITCH_RENDERER2_FACTORY__POST_R3__, ɵSWITCH_TEMPLATE_REF_FACTORY__POST_R3__, ɵSWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__, ɵ_sanitizeHtml, ɵ_sanitizeUrl, ɵallowSanitizationBypassAndThrow, ɵand, ɵangular_packages_core_core_a, ɵangular_packages_core_core_b, ɵangular_packages_core_core_ba, ɵangular_packages_core_core_bb, ɵangular_packages_core_core_bc, ɵangular_packages_core_core_bd, ɵangular_packages_core_core_be, ɵangular_packages_core_core_bg, ɵangular_packages_core_core_bh, ɵangular_packages_core_core_bi, ɵangular_packages_core_core_bj, ɵangular_packages_core_core_bk, ɵangular_packages_core_core_bl, ɵangular_packages_core_core_bm, ɵangular_packages_core_core_bn, ɵangular_packages_core_core_bo, ɵangular_packages_core_core_bq, ɵangular_packages_core_core_br, ɵangular_packages_core_core_c, ɵangular_packages_core_core_d, ɵangular_packages_core_core_e, ɵangular_packages_core_core_f, ɵangular_packages_core_core_g, ɵangular_packages_core_core_h, ɵangular_packages_core_core_i, ɵangular_packages_core_core_j, ɵangular_packages_core_core_k, ɵangular_packages_core_core_l, ɵangular_packages_core_core_m, ɵangular_packages_core_core_n, ɵangular_packages_core_core_o, ɵangular_packages_core_core_p, ɵangular_packages_core_core_q, ɵangular_packages_core_core_r, ɵangular_packages_core_core_s, ɵangular_packages_core_core_t, ɵangular_packages_core_core_u, ɵangular_packages_core_core_v, ɵangular_packages_core_core_w, ɵangular_packages_core_core_x, ɵangular_packages_core_core_y, ɵangular_packages_core_core_z, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustResourceUrl, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustUrl, ɵccf, ɵclearOverrides, ɵclearResolutionOfComponentResourcesQueue, ɵcmf, ɵcompileComponent, ɵcompileDirective, ɵcompileNgModule, ɵcompileNgModuleDefs, ɵcompileNgModuleFactory__POST_R3__, ɵcompilePipe, ɵcreateInjector, ɵcrt, ɵdefaultIterableDiffers, ɵdefaultKeyValueDiffers, ɵdetectChanges, ɵdevModeEqual, ɵdid, ɵeld, ɵfindLocaleData, ɵflushModuleScopingQueueAsMuchAsPossible, ɵgetComponentViewDefinitionFactory, ɵgetDebugNodeR2, ɵgetDebugNode__POST_R3__, ɵgetDirectives, ɵgetHostElement, ɵgetInjectableDef, ɵgetLContext, ɵgetLocaleCurrencyCode, ɵgetLocalePluralCase, ɵgetModuleFactory__POST_R3__, ɵgetSanitizationBypassType, ɵglobal, ɵinitServicesIfNeeded, ɵinlineInterpolate, ɵinterpolate, ɵisBoundToModule__POST_R3__, ɵisDefaultChangeDetectionStrategy, ɵisListLikeIterable, ɵisObservable, ɵisPromise, ɵivyEnabled, ɵmakeDecorator, ɵmarkDirty, ɵmod, ɵmpd, ɵncd, ɵnoSideEffects, ɵnov, ɵoverrideComponentView, ɵoverrideProvider, ɵpad, ɵpatchComponentDefWithScope, ɵpid, ɵpod, ɵppd, ɵprd, ɵpublishDefaultGlobalUtils, ɵpublishGlobalUtil, ɵqud, ɵregisterLocaleData, ɵregisterModuleFactory, ɵregisterNgModuleType, ɵrenderComponent, ɵresetCompiledComponents, ɵresetJitOptions, ɵresolveComponentResources, ɵsetClassMetadata, ɵsetCurrentInjector, ɵsetDocument, ɵsetLocaleId, ɵstore, ɵstringify, ɵted, ɵtransitiveScopesFor, ɵunregisterLocaleData, ɵunv, ɵunwrapSafeValue, ɵvid, ɵwhenRendered, ɵɵCopyDefinitionFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetFactoryOf, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinjectPipeChangeDetectorRef, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵselect, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstaticContentQuery, ɵɵstaticViewQuery, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵviewQuery */ 7782/***/ (function(module, __webpack_exports__, __webpack_require__) { 7783 7784"use strict"; 7785__webpack_require__.r(__webpack_exports__); 7786/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ANALYZE_FOR_ENTRY_COMPONENTS", function() { return ANALYZE_FOR_ENTRY_COMPONENTS; }); 7787/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_BOOTSTRAP_LISTENER", function() { return APP_BOOTSTRAP_LISTENER; }); 7788/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_ID", function() { return APP_ID; }); 7789/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_INITIALIZER", function() { return APP_INITIALIZER; }); 7790/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationInitStatus", function() { return ApplicationInitStatus; }); 7791/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationModule", function() { return ApplicationModule; }); 7792/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationRef", function() { return ApplicationRef; }); 7793/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribute", function() { return Attribute; }); 7794/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMPILER_OPTIONS", function() { return COMPILER_OPTIONS; }); 7795/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CUSTOM_ELEMENTS_SCHEMA", function() { return CUSTOM_ELEMENTS_SCHEMA; }); 7796/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeDetectionStrategy", function() { return ChangeDetectionStrategy; }); 7797/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeDetectorRef", function() { return ChangeDetectorRef; }); 7798/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Compiler", function() { return Compiler; }); 7799/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompilerFactory", function() { return CompilerFactory; }); 7800/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return Component; }); 7801/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentFactory", function() { return ComponentFactory; }); 7802/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentFactoryResolver", function() { return ComponentFactoryResolver; }); 7803/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentRef", function() { return ComponentRef; }); 7804/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentChild", function() { return ContentChild; }); 7805/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentChildren", function() { return ContentChildren; }); 7806/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_CURRENCY_CODE", function() { return DEFAULT_CURRENCY_CODE; }); 7807/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DebugElement", function() { return DebugElement; }); 7808/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DebugEventListener", function() { return DebugEventListener; }); 7809/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DebugNode", function() { return DebugNode; }); 7810/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultIterableDiffer", function() { return DefaultIterableDiffer; }); 7811/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Directive", function() { return Directive; }); 7812/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementRef", function() { return ElementRef; }); 7813/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmbeddedViewRef", function() { return EmbeddedViewRef; }); 7814/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); 7815/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventEmitter", function() { return EventEmitter; }); 7816/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Host", function() { return Host; }); 7817/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HostBinding", function() { return HostBinding; }); 7818/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HostListener", function() { return HostListener; }); 7819/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INJECTOR", function() { return INJECTOR; }); 7820/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Inject", function() { return Inject; }); 7821/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InjectFlags", function() { return InjectFlags; }); 7822/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Injectable", function() { return Injectable; }); 7823/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InjectionToken", function() { return InjectionToken; }); 7824/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Injector", function() { return Injector; }); 7825/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; }); 7826/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IterableDiffers", function() { return IterableDiffers; }); 7827/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyValueDiffers", function() { return KeyValueDiffers; }); 7828/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCALE_ID", function() { return LOCALE_ID$1; }); 7829/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MissingTranslationStrategy", function() { return MissingTranslationStrategy; }); 7830/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleWithComponentFactories", function() { return ModuleWithComponentFactories; }); 7831/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_ERRORS_SCHEMA", function() { return NO_ERRORS_SCHEMA; }); 7832/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModule", function() { return NgModule; }); 7833/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleFactory", function() { return NgModuleFactory; }); 7834/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleFactoryLoader", function() { return NgModuleFactoryLoader; }); 7835/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleRef", function() { return NgModuleRef; }); 7836/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgProbeToken", function() { return NgProbeToken; }); 7837/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgZone", function() { return NgZone; }); 7838/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return Optional; }); 7839/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; }); 7840/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PACKAGE_ROOT_URL", function() { return PACKAGE_ROOT_URL; }); 7841/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLATFORM_ID", function() { return PLATFORM_ID; }); 7842/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLATFORM_INITIALIZER", function() { return PLATFORM_INITIALIZER; }); 7843/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Pipe", function() { return Pipe; }); 7844/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlatformRef", function() { return PlatformRef; }); 7845/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Query", function() { return Query; }); 7846/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueryList", function() { return QueryList; }); 7847/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReflectiveInjector", function() { return ReflectiveInjector; }); 7848/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReflectiveKey", function() { return ReflectiveKey; }); 7849/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Renderer2", function() { return Renderer2; }); 7850/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RendererFactory2", function() { return RendererFactory2; }); 7851/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RendererStyleFlags2", function() { return RendererStyleFlags2; }); 7852/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedReflectiveFactory", function() { return ResolvedReflectiveFactory; }); 7853/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sanitizer", function() { return Sanitizer; }); 7854/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SecurityContext", function() { return SecurityContext; }); 7855/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Self", function() { return Self; }); 7856/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleChange", function() { return SimpleChange; }); 7857/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkipSelf", function() { return SkipSelf; }); 7858/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemJsNgModuleLoader", function() { return SystemJsNgModuleLoader; }); 7859/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemJsNgModuleLoaderConfig", function() { return SystemJsNgModuleLoaderConfig; }); 7860/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSLATIONS", function() { return TRANSLATIONS; }); 7861/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSLATIONS_FORMAT", function() { return TRANSLATIONS_FORMAT; }); 7862/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateRef", function() { return TemplateRef; }); 7863/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Testability", function() { return Testability; }); 7864/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestabilityRegistry", function() { return TestabilityRegistry; }); 7865/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Type", function() { return Type; }); 7866/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); 7867/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Version", function() { return Version; }); 7868/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewChild", function() { return ViewChild; }); 7869/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewChildren", function() { return ViewChildren; }); 7870/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewContainerRef", function() { return ViewContainerRef; }); 7871/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewEncapsulation", function() { return ViewEncapsulation$1; }); 7872/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewRef", function() { return ViewRef$1; }); 7873/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappedValue", function() { return WrappedValue; }); 7874/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asNativeElements", function() { return asNativeElements; }); 7875/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertPlatform", function() { return assertPlatform; }); 7876/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlatform", function() { return createPlatform; }); 7877/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlatformFactory", function() { return createPlatformFactory; }); 7878/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defineInjectable", function() { return defineInjectable; }); 7879/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "destroyPlatform", function() { return destroyPlatform; }); 7880/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableProdMode", function() { return enableProdMode; }); 7881/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forwardRef", function() { return forwardRef; }); 7882/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDebugNode", function() { return getDebugNode$1; }); 7883/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getModuleFactory", function() { return getModuleFactory; }); 7884/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPlatform", function() { return getPlatform; }); 7885/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return inject; }); 7886/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDevMode", function() { return isDevMode; }); 7887/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platformCore", function() { return platformCore; }); 7888/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolveForwardRef", function() { return resolveForwardRef; }); 7889/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestabilityGetter", function() { return setTestabilityGetter; }); 7890/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ0", function() { return ɵ0; }); 7891/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ1", function() { return ɵ1; }); 7892/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵALLOW_MULTIPLE_PLATFORMS", function() { return ALLOW_MULTIPLE_PLATFORMS; }); 7893/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAPP_ID_RANDOM_PROVIDER", function() { return APP_ID_RANDOM_PROVIDER; }); 7894/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵChangeDetectorStatus", function() { return ChangeDetectorStatus; }); 7895/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCodegenComponentFactoryResolver", function() { return CodegenComponentFactoryResolver; }); 7896/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompiler_compileModuleAndAllComponentsAsync__POST_R3__", function() { return Compiler_compileModuleAndAllComponentsAsync__POST_R3__; }); 7897/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompiler_compileModuleAndAllComponentsSync__POST_R3__", function() { return Compiler_compileModuleAndAllComponentsSync__POST_R3__; }); 7898/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompiler_compileModuleAsync__POST_R3__", function() { return Compiler_compileModuleAsync__POST_R3__; }); 7899/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompiler_compileModuleSync__POST_R3__", function() { return Compiler_compileModuleSync__POST_R3__; }); 7900/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵComponentFactory", function() { return ComponentFactory; }); 7901/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵConsole", function() { return Console; }); 7902/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDEFAULT_LOCALE_ID", function() { return DEFAULT_LOCALE_ID; }); 7903/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵEMPTY_ARRAY", function() { return EMPTY_ARRAY$4; }); 7904/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵEMPTY_MAP", function() { return EMPTY_MAP; }); 7905/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵINJECTOR_IMPL__POST_R3__", function() { return INJECTOR_IMPL__POST_R3__; }); 7906/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵINJECTOR_SCOPE", function() { return INJECTOR_SCOPE; }); 7907/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵLifecycleHooksFeature", function() { return LifecycleHooksFeature; }); 7908/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵLocaleDataIndex", function() { return LocaleDataIndex; }); 7909/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_COMP_DEF", function() { return NG_COMP_DEF; }); 7910/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_DIR_DEF", function() { return NG_DIR_DEF; }); 7911/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_ELEMENT_ID", function() { return NG_ELEMENT_ID; }); 7912/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_INJ_DEF", function() { return NG_INJ_DEF; }); 7913/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_MOD_DEF", function() { return NG_MOD_DEF; }); 7914/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_PIPE_DEF", function() { return NG_PIPE_DEF; }); 7915/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_PROV_DEF", function() { return NG_PROV_DEF; }); 7916/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR", function() { return NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR; }); 7917/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNO_CHANGE", function() { return NO_CHANGE; }); 7918/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNgModuleFactory", function() { return NgModuleFactory$1; }); 7919/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNoopNgZone", function() { return NoopNgZone; }); 7920/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵReflectionCapabilities", function() { return ReflectionCapabilities; }); 7921/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵRender3ComponentFactory", function() { return ComponentFactory$1; }); 7922/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵRender3ComponentRef", function() { return ComponentRef$1; }); 7923/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵRender3NgModuleRef", function() { return NgModuleRef$1; }); 7924/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__", function() { return SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__; }); 7925/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_COMPONENT__POST_R3__", function() { return SWITCH_COMPILE_COMPONENT__POST_R3__; }); 7926/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_DIRECTIVE__POST_R3__", function() { return SWITCH_COMPILE_DIRECTIVE__POST_R3__; }); 7927/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_INJECTABLE__POST_R3__", function() { return SWITCH_COMPILE_INJECTABLE__POST_R3__; }); 7928/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_NGMODULE__POST_R3__", function() { return SWITCH_COMPILE_NGMODULE__POST_R3__; }); 7929/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_PIPE__POST_R3__", function() { return SWITCH_COMPILE_PIPE__POST_R3__; }); 7930/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_ELEMENT_REF_FACTORY__POST_R3__", function() { return SWITCH_ELEMENT_REF_FACTORY__POST_R3__; }); 7931/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_IVY_ENABLED__POST_R3__", function() { return SWITCH_IVY_ENABLED__POST_R3__; }); 7932/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_RENDERER2_FACTORY__POST_R3__", function() { return SWITCH_RENDERER2_FACTORY__POST_R3__; }); 7933/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_TEMPLATE_REF_FACTORY__POST_R3__", function() { return SWITCH_TEMPLATE_REF_FACTORY__POST_R3__; }); 7934/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__", function() { return SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__; }); 7935/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ_sanitizeHtml", function() { return _sanitizeHtml; }); 7936/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ_sanitizeUrl", function() { return _sanitizeUrl; }); 7937/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵallowSanitizationBypassAndThrow", function() { return allowSanitizationBypassAndThrow; }); 7938/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵand", function() { return anchorDef; }); 7939/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_a", function() { return isForwardRef; }); 7940/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_b", function() { return injectInjectorOnly; }); 7941/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_ba", function() { return instructionState; }); 7942/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bb", function() { return getLView; }); 7943/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bc", function() { return getPreviousOrParentTNode; }); 7944/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bd", function() { return getBindingRoot; }); 7945/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_be", function() { return nextContextImpl; }); 7946/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bg", function() { return pureFunction1Internal; }); 7947/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bh", function() { return pureFunction2Internal; }); 7948/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bi", function() { return pureFunction3Internal; }); 7949/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bj", function() { return pureFunction4Internal; }); 7950/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bk", function() { return pureFunctionVInternal; }); 7951/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bl", function() { return getUrlSanitizer; }); 7952/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bm", function() { return makeParamDecorator; }); 7953/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bn", function() { return makePropDecorator; }); 7954/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bo", function() { return getClosureSafeProperty; }); 7955/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bq", function() { return getRootContext; }); 7956/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_br", function() { return i18nPostprocess; }); 7957/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_c", function() { return NullInjector; }); 7958/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_d", function() { return ReflectiveInjector_; }); 7959/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_e", function() { return ReflectiveDependency; }); 7960/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_f", function() { return resolveReflectiveProviders; }); 7961/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_g", function() { return _appIdRandomProviderFactory; }); 7962/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_h", function() { return createElementRef; }); 7963/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_i", function() { return createTemplateRef; }); 7964/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_j", function() { return getModuleFactory__PRE_R3__; }); 7965/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_k", function() { return DebugNode__PRE_R3__; }); 7966/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_l", function() { return DebugElement__PRE_R3__; }); 7967/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_m", function() { return getDebugNodeR2__PRE_R3__; }); 7968/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_n", function() { return DefaultIterableDifferFactory; }); 7969/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_o", function() { return DefaultKeyValueDifferFactory; }); 7970/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_p", function() { return _iterableDiffersFactory; }); 7971/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_q", function() { return _keyValueDiffersFactory; }); 7972/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_r", function() { return _localeFactory; }); 7973/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_s", function() { return APPLICATION_MODULE_PROVIDERS; }); 7974/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_t", function() { return zoneSchedulerFactory; }); 7975/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_u", function() { return USD_CURRENCY_CODE; }); 7976/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_v", function() { return _def; }); 7977/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_w", function() { return DebugContext; }); 7978/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_x", function() { return NgOnChangesFeatureImpl; }); 7979/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_y", function() { return SCHEDULER; }); 7980/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_z", function() { return injectAttributeImpl; }); 7981/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustHtml", function() { return bypassSanitizationTrustHtml; }); 7982/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustResourceUrl", function() { return bypassSanitizationTrustResourceUrl; }); 7983/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustScript", function() { return bypassSanitizationTrustScript; }); 7984/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustStyle", function() { return bypassSanitizationTrustStyle; }); 7985/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustUrl", function() { return bypassSanitizationTrustUrl; }); 7986/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵccf", function() { return createComponentFactory; }); 7987/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵclearOverrides", function() { return clearOverrides; }); 7988/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵclearResolutionOfComponentResourcesQueue", function() { return clearResolutionOfComponentResourcesQueue; }); 7989/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcmf", function() { return createNgModuleFactory; }); 7990/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileComponent", function() { return compileComponent; }); 7991/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileDirective", function() { return compileDirective; }); 7992/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileNgModule", function() { return compileNgModule; }); 7993/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileNgModuleDefs", function() { return compileNgModuleDefs; }); 7994/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileNgModuleFactory__POST_R3__", function() { return compileNgModuleFactory__POST_R3__; }); 7995/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompilePipe", function() { return compilePipe; }); 7996/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcreateInjector", function() { return createInjector; }); 7997/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcrt", function() { return createRendererType2; }); 7998/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdefaultIterableDiffers", function() { return defaultIterableDiffers; }); 7999/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdefaultKeyValueDiffers", function() { return defaultKeyValueDiffers; }); 8000/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdetectChanges", function() { return detectChanges; }); 8001/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdevModeEqual", function() { return devModeEqual; }); 8002/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdid", function() { return directiveDef; }); 8003/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵeld", function() { return elementDef; }); 8004/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵfindLocaleData", function() { return findLocaleData; }); 8005/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵflushModuleScopingQueueAsMuchAsPossible", function() { return flushModuleScopingQueueAsMuchAsPossible; }); 8006/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetComponentViewDefinitionFactory", function() { return getComponentViewDefinitionFactory; }); 8007/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDebugNodeR2", function() { return getDebugNodeR2; }); 8008/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDebugNode__POST_R3__", function() { return getDebugNode__POST_R3__; }); 8009/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDirectives", function() { return getDirectives; }); 8010/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetHostElement", function() { return getHostElement; }); 8011/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetInjectableDef", function() { return getInjectableDef; }); 8012/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetLContext", function() { return getLContext; }); 8013/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetLocaleCurrencyCode", function() { return getLocaleCurrencyCode; }); 8014/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetLocalePluralCase", function() { return getLocalePluralCase; }); 8015/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetModuleFactory__POST_R3__", function() { return getModuleFactory__POST_R3__; }); 8016/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetSanitizationBypassType", function() { return getSanitizationBypassType; }); 8017/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵglobal", function() { return _global; }); 8018/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinitServicesIfNeeded", function() { return initServicesIfNeeded; }); 8019/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinlineInterpolate", function() { return inlineInterpolate; }); 8020/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinterpolate", function() { return interpolate; }); 8021/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisBoundToModule__POST_R3__", function() { return isBoundToModule__POST_R3__; }); 8022/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisDefaultChangeDetectionStrategy", function() { return isDefaultChangeDetectionStrategy; }); 8023/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisListLikeIterable", function() { return isListLikeIterable; }); 8024/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisObservable", function() { return isObservable; }); 8025/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisPromise", function() { return isPromise; }); 8026/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵivyEnabled", function() { return ivyEnabled; }); 8027/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmakeDecorator", function() { return makeDecorator; }); 8028/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmarkDirty", function() { return markDirty; }); 8029/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmod", function() { return moduleDef; }); 8030/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmpd", function() { return moduleProvideDef; }); 8031/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵncd", function() { return ngContentDef; }); 8032/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵnoSideEffects", function() { return noSideEffects; }); 8033/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵnov", function() { return nodeValue; }); 8034/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵoverrideComponentView", function() { return overrideComponentView; }); 8035/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵoverrideProvider", function() { return overrideProvider; }); 8036/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpad", function() { return pureArrayDef; }); 8037/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpatchComponentDefWithScope", function() { return patchComponentDefWithScope; }); 8038/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpid", function() { return pipeDef; }); 8039/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpod", function() { return pureObjectDef; }); 8040/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵppd", function() { return purePipeDef; }); 8041/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵprd", function() { return providerDef; }); 8042/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpublishDefaultGlobalUtils", function() { return publishDefaultGlobalUtils; }); 8043/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpublishGlobalUtil", function() { return publishGlobalUtil; }); 8044/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵqud", function() { return queryDef; }); 8045/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵregisterLocaleData", function() { return registerLocaleData; }); 8046/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵregisterModuleFactory", function() { return registerModuleFactory; }); 8047/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵregisterNgModuleType", function() { return registerNgModuleType; }); 8048/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵrenderComponent", function() { return renderComponent$1; }); 8049/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵresetCompiledComponents", function() { return resetCompiledComponents; }); 8050/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵresetJitOptions", function() { return resetJitOptions; }); 8051/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵresolveComponentResources", function() { return resolveComponentResources; }); 8052/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetClassMetadata", function() { return setClassMetadata; }); 8053/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetCurrentInjector", function() { return setCurrentInjector; }); 8054/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetDocument", function() { return setDocument; }); 8055/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetLocaleId", function() { return setLocaleId; }); 8056/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵstore", function() { return store; }); 8057/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵstringify", function() { return stringify; }); 8058/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵted", function() { return textDef; }); 8059/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵtransitiveScopesFor", function() { return transitiveScopesFor; }); 8060/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵunregisterLocaleData", function() { return unregisterAllLocaleData; }); 8061/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵunv", function() { return unwrapValue; }); 8062/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵunwrapSafeValue", function() { return unwrapSafeValue; }); 8063/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵvid", function() { return viewDef; }); 8064/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵwhenRendered", function() { return whenRendered; }); 8065/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵCopyDefinitionFeature", function() { return ɵɵCopyDefinitionFeature; }); 8066/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵInheritDefinitionFeature", function() { return ɵɵInheritDefinitionFeature; }); 8067/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵNgOnChangesFeature", function() { return ɵɵNgOnChangesFeature; }); 8068/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵProvidersFeature", function() { return ɵɵProvidersFeature; }); 8069/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵadvance", function() { return ɵɵadvance; }); 8070/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattribute", function() { return ɵɵattribute; }); 8071/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate1", function() { return ɵɵattributeInterpolate1; }); 8072/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate2", function() { return ɵɵattributeInterpolate2; }); 8073/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate3", function() { return ɵɵattributeInterpolate3; }); 8074/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate4", function() { return ɵɵattributeInterpolate4; }); 8075/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate5", function() { return ɵɵattributeInterpolate5; }); 8076/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate6", function() { return ɵɵattributeInterpolate6; }); 8077/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate7", function() { return ɵɵattributeInterpolate7; }); 8078/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate8", function() { return ɵɵattributeInterpolate8; }); 8079/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolateV", function() { return ɵɵattributeInterpolateV; }); 8080/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMap", function() { return ɵɵclassMap; }); 8081/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate1", function() { return ɵɵclassMapInterpolate1; }); 8082/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate2", function() { return ɵɵclassMapInterpolate2; }); 8083/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate3", function() { return ɵɵclassMapInterpolate3; }); 8084/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate4", function() { return ɵɵclassMapInterpolate4; }); 8085/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate5", function() { return ɵɵclassMapInterpolate5; }); 8086/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate6", function() { return ɵɵclassMapInterpolate6; }); 8087/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate7", function() { return ɵɵclassMapInterpolate7; }); 8088/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate8", function() { return ɵɵclassMapInterpolate8; }); 8089/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolateV", function() { return ɵɵclassMapInterpolateV; }); 8090/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassProp", function() { return ɵɵclassProp; }); 8091/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵcontentQuery", function() { return ɵɵcontentQuery; }); 8092/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineComponent", function() { return ɵɵdefineComponent; }); 8093/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineDirective", function() { return ɵɵdefineDirective; }); 8094/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineInjectable", function() { return ɵɵdefineInjectable; }); 8095/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineInjector", function() { return ɵɵdefineInjector; }); 8096/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineNgModule", function() { return ɵɵdefineNgModule; }); 8097/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefinePipe", function() { return ɵɵdefinePipe; }); 8098/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdirectiveInject", function() { return ɵɵdirectiveInject; }); 8099/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdisableBindings", function() { return ɵɵdisableBindings; }); 8100/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelement", function() { return ɵɵelement; }); 8101/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementContainer", function() { return ɵɵelementContainer; }); 8102/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementContainerEnd", function() { return ɵɵelementContainerEnd; }); 8103/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementContainerStart", function() { return ɵɵelementContainerStart; }); 8104/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementEnd", function() { return ɵɵelementEnd; }); 8105/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementStart", function() { return ɵɵelementStart; }); 8106/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵenableBindings", function() { return ɵɵenableBindings; }); 8107/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵgetCurrentView", function() { return ɵɵgetCurrentView; }); 8108/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵgetFactoryOf", function() { return ɵɵgetFactoryOf; }); 8109/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵgetInheritedFactory", function() { return ɵɵgetInheritedFactory; }); 8110/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵhostProperty", function() { return ɵɵhostProperty; }); 8111/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18n", function() { return ɵɵi18n; }); 8112/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nApply", function() { return ɵɵi18nApply; }); 8113/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nAttributes", function() { return ɵɵi18nAttributes; }); 8114/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nEnd", function() { return ɵɵi18nEnd; }); 8115/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nExp", function() { return ɵɵi18nExp; }); 8116/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nPostprocess", function() { return ɵɵi18nPostprocess; }); 8117/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nStart", function() { return ɵɵi18nStart; }); 8118/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinject", function() { return ɵɵinject; }); 8119/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinjectAttribute", function() { return ɵɵinjectAttribute; }); 8120/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinjectPipeChangeDetectorRef", function() { return ɵɵinjectPipeChangeDetectorRef; }); 8121/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinvalidFactory", function() { return ɵɵinvalidFactory; }); 8122/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinvalidFactoryDep", function() { return ɵɵinvalidFactoryDep; }); 8123/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵlistener", function() { return ɵɵlistener; }); 8124/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵloadQuery", function() { return ɵɵloadQuery; }); 8125/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵnamespaceHTML", function() { return ɵɵnamespaceHTML; }); 8126/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵnamespaceMathML", function() { return ɵɵnamespaceMathML; }); 8127/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵnamespaceSVG", function() { return ɵɵnamespaceSVG; }); 8128/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵnextContext", function() { return ɵɵnextContext; }); 8129/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipe", function() { return ɵɵpipe; }); 8130/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBind1", function() { return ɵɵpipeBind1; }); 8131/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBind2", function() { return ɵɵpipeBind2; }); 8132/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBind3", function() { return ɵɵpipeBind3; }); 8133/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBind4", function() { return ɵɵpipeBind4; }); 8134/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBindV", function() { return ɵɵpipeBindV; }); 8135/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵprojection", function() { return ɵɵprojection; }); 8136/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵprojectionDef", function() { return ɵɵprojectionDef; }); 8137/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵproperty", function() { return ɵɵproperty; }); 8138/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate", function() { return ɵɵpropertyInterpolate; }); 8139/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate1", function() { return ɵɵpropertyInterpolate1; }); 8140/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate2", function() { return ɵɵpropertyInterpolate2; }); 8141/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate3", function() { return ɵɵpropertyInterpolate3; }); 8142/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate4", function() { return ɵɵpropertyInterpolate4; }); 8143/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate5", function() { return ɵɵpropertyInterpolate5; }); 8144/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate6", function() { return ɵɵpropertyInterpolate6; }); 8145/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate7", function() { return ɵɵpropertyInterpolate7; }); 8146/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate8", function() { return ɵɵpropertyInterpolate8; }); 8147/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolateV", function() { return ɵɵpropertyInterpolateV; }); 8148/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction0", function() { return ɵɵpureFunction0; }); 8149/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction1", function() { return ɵɵpureFunction1; }); 8150/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction2", function() { return ɵɵpureFunction2; }); 8151/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction3", function() { return ɵɵpureFunction3; }); 8152/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction4", function() { return ɵɵpureFunction4; }); 8153/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction5", function() { return ɵɵpureFunction5; }); 8154/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction6", function() { return ɵɵpureFunction6; }); 8155/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction7", function() { return ɵɵpureFunction7; }); 8156/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction8", function() { return ɵɵpureFunction8; }); 8157/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunctionV", function() { return ɵɵpureFunctionV; }); 8158/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵqueryRefresh", function() { return ɵɵqueryRefresh; }); 8159/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵreference", function() { return ɵɵreference; }); 8160/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵresolveBody", function() { return ɵɵresolveBody; }); 8161/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵresolveDocument", function() { return ɵɵresolveDocument; }); 8162/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵresolveWindow", function() { return ɵɵresolveWindow; }); 8163/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵrestoreView", function() { return ɵɵrestoreView; }); 8164/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeHtml", function() { return ɵɵsanitizeHtml; }); 8165/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeResourceUrl", function() { return ɵɵsanitizeResourceUrl; }); 8166/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeScript", function() { return ɵɵsanitizeScript; }); 8167/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeStyle", function() { return ɵɵsanitizeStyle; }); 8168/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeUrl", function() { return ɵɵsanitizeUrl; }); 8169/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeUrlOrResourceUrl", function() { return ɵɵsanitizeUrlOrResourceUrl; }); 8170/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵselect", function() { return ɵɵselect; }); 8171/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsetComponentScope", function() { return ɵɵsetComponentScope; }); 8172/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsetNgModuleScope", function() { return ɵɵsetNgModuleScope; }); 8173/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstaticContentQuery", function() { return ɵɵstaticContentQuery; }); 8174/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstaticViewQuery", function() { return ɵɵstaticViewQuery; }); 8175/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMap", function() { return ɵɵstyleMap; }); 8176/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate1", function() { return ɵɵstyleMapInterpolate1; }); 8177/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate2", function() { return ɵɵstyleMapInterpolate2; }); 8178/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate3", function() { return ɵɵstyleMapInterpolate3; }); 8179/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate4", function() { return ɵɵstyleMapInterpolate4; }); 8180/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate5", function() { return ɵɵstyleMapInterpolate5; }); 8181/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate6", function() { return ɵɵstyleMapInterpolate6; }); 8182/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate7", function() { return ɵɵstyleMapInterpolate7; }); 8183/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate8", function() { return ɵɵstyleMapInterpolate8; }); 8184/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolateV", function() { return ɵɵstyleMapInterpolateV; }); 8185/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleProp", function() { return ɵɵstyleProp; }); 8186/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate1", function() { return ɵɵstylePropInterpolate1; }); 8187/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate2", function() { return ɵɵstylePropInterpolate2; }); 8188/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate3", function() { return ɵɵstylePropInterpolate3; }); 8189/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate4", function() { return ɵɵstylePropInterpolate4; }); 8190/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate5", function() { return ɵɵstylePropInterpolate5; }); 8191/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate6", function() { return ɵɵstylePropInterpolate6; }); 8192/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate7", function() { return ɵɵstylePropInterpolate7; }); 8193/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate8", function() { return ɵɵstylePropInterpolate8; }); 8194/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolateV", function() { return ɵɵstylePropInterpolateV; }); 8195/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsyntheticHostListener", function() { return ɵɵsyntheticHostListener; }); 8196/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsyntheticHostProperty", function() { return ɵɵsyntheticHostProperty; }); 8197/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtemplate", function() { return ɵɵtemplate; }); 8198/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtemplateRefExtractor", function() { return ɵɵtemplateRefExtractor; }); 8199/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtext", function() { return ɵɵtext; }); 8200/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate", function() { return ɵɵtextInterpolate; }); 8201/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate1", function() { return ɵɵtextInterpolate1; }); 8202/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate2", function() { return ɵɵtextInterpolate2; }); 8203/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate3", function() { return ɵɵtextInterpolate3; }); 8204/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate4", function() { return ɵɵtextInterpolate4; }); 8205/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate5", function() { return ɵɵtextInterpolate5; }); 8206/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate6", function() { return ɵɵtextInterpolate6; }); 8207/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate7", function() { return ɵɵtextInterpolate7; }); 8208/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate8", function() { return ɵɵtextInterpolate8; }); 8209/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolateV", function() { return ɵɵtextInterpolateV; }); 8210/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵviewQuery", function() { return ɵɵviewQuery; }); 8211/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); 8212/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js"); 8213/** 8214 * @license Angular v10.0.14 8215 * (c) 2010-2020 Google LLC. https://angular.io/ 8216 * License: MIT 8217 */ 8218 8219 8220 8221 8222/** 8223 * @license 8224 * Copyright Google LLC All Rights Reserved. 8225 * 8226 * Use of this source code is governed by an MIT-style license that can be 8227 * found in the LICENSE file at https://angular.io/license 8228 */ 8229/** 8230 * Convince closure compiler that the wrapped function has no side-effects. 8231 * 8232 * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to 8233 * allow us to execute a function but have closure compiler mark the call as no-side-effects. 8234 * It is important that the return value for the `noSideEffects` function be assigned 8235 * to something which is retained otherwise the call to `noSideEffects` will be removed by closure 8236 * compiler. 8237 */ 8238function noSideEffects(fn) { 8239 return { toString: fn }.toString(); 8240} 8241 8242/** 8243 * @license 8244 * Copyright Google LLC All Rights Reserved. 8245 * 8246 * Use of this source code is governed by an MIT-style license that can be 8247 * found in the LICENSE file at https://angular.io/license 8248 */ 8249const ANNOTATIONS = '__annotations__'; 8250const PARAMETERS = '__parameters__'; 8251const PROP_METADATA = '__prop__metadata__'; 8252/** 8253 * @suppress {globalThis} 8254 */ 8255function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) { 8256 return noSideEffects(() => { 8257 const metaCtor = makeMetadataCtor(props); 8258 function DecoratorFactory(...args) { 8259 if (this instanceof DecoratorFactory) { 8260 metaCtor.call(this, ...args); 8261 return this; 8262 } 8263 const annotationInstance = new DecoratorFactory(...args); 8264 return function TypeDecorator(cls) { 8265 if (typeFn) 8266 typeFn(cls, ...args); 8267 // Use of Object.defineProperty is important since it creates non-enumerable property which 8268 // prevents the property is copied during subclassing. 8269 const annotations = cls.hasOwnProperty(ANNOTATIONS) ? 8270 cls[ANNOTATIONS] : 8271 Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS]; 8272 annotations.push(annotationInstance); 8273 if (additionalProcessing) 8274 additionalProcessing(cls); 8275 return cls; 8276 }; 8277 } 8278 if (parentClass) { 8279 DecoratorFactory.prototype = Object.create(parentClass.prototype); 8280 } 8281 DecoratorFactory.prototype.ngMetadataName = name; 8282 DecoratorFactory.annotationCls = DecoratorFactory; 8283 return DecoratorFactory; 8284 }); 8285} 8286function makeMetadataCtor(props) { 8287 return function ctor(...args) { 8288 if (props) { 8289 const values = props(...args); 8290 for (const propName in values) { 8291 this[propName] = values[propName]; 8292 } 8293 } 8294 }; 8295} 8296function makeParamDecorator(name, props, parentClass) { 8297 return noSideEffects(() => { 8298 const metaCtor = makeMetadataCtor(props); 8299 function ParamDecoratorFactory(...args) { 8300 if (this instanceof ParamDecoratorFactory) { 8301 metaCtor.apply(this, args); 8302 return this; 8303 } 8304 const annotationInstance = new ParamDecoratorFactory(...args); 8305 ParamDecorator.annotation = annotationInstance; 8306 return ParamDecorator; 8307 function ParamDecorator(cls, unusedKey, index) { 8308 // Use of Object.defineProperty is important since it creates non-enumerable property which 8309 // prevents the property is copied during subclassing. 8310 const parameters = cls.hasOwnProperty(PARAMETERS) ? 8311 cls[PARAMETERS] : 8312 Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS]; 8313 // there might be gaps if some in between parameters do not have annotations. 8314 // we pad with nulls. 8315 while (parameters.length <= index) { 8316 parameters.push(null); 8317 } 8318 (parameters[index] = parameters[index] || []).push(annotationInstance); 8319 return cls; 8320 } 8321 } 8322 if (parentClass) { 8323 ParamDecoratorFactory.prototype = Object.create(parentClass.prototype); 8324 } 8325 ParamDecoratorFactory.prototype.ngMetadataName = name; 8326 ParamDecoratorFactory.annotationCls = ParamDecoratorFactory; 8327 return ParamDecoratorFactory; 8328 }); 8329} 8330function makePropDecorator(name, props, parentClass, additionalProcessing) { 8331 return noSideEffects(() => { 8332 const metaCtor = makeMetadataCtor(props); 8333 function PropDecoratorFactory(...args) { 8334 if (this instanceof PropDecoratorFactory) { 8335 metaCtor.apply(this, args); 8336 return this; 8337 } 8338 const decoratorInstance = new PropDecoratorFactory(...args); 8339 function PropDecorator(target, name) { 8340 const constructor = target.constructor; 8341 // Use of Object.defineProperty is important because it creates a non-enumerable property 8342 // which prevents the property from being copied during subclassing. 8343 const meta = constructor.hasOwnProperty(PROP_METADATA) ? 8344 constructor[PROP_METADATA] : 8345 Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA]; 8346 meta[name] = meta.hasOwnProperty(name) && meta[name] || []; 8347 meta[name].unshift(decoratorInstance); 8348 if (additionalProcessing) 8349 additionalProcessing(target, name, ...args); 8350 } 8351 return PropDecorator; 8352 } 8353 if (parentClass) { 8354 PropDecoratorFactory.prototype = Object.create(parentClass.prototype); 8355 } 8356 PropDecoratorFactory.prototype.ngMetadataName = name; 8357 PropDecoratorFactory.annotationCls = PropDecoratorFactory; 8358 return PropDecoratorFactory; 8359 }); 8360} 8361 8362/** 8363 * @license 8364 * Copyright Google LLC All Rights Reserved. 8365 * 8366 * Use of this source code is governed by an MIT-style license that can be 8367 * found in the LICENSE file at https://angular.io/license 8368 */ 8369const ɵ0 = (token) => ({ token }); 8370/** 8371 * Inject decorator and metadata. 8372 * 8373 * @Annotation 8374 * @publicApi 8375 */ 8376const Inject = makeParamDecorator('Inject', ɵ0); 8377/** 8378 * Optional decorator and metadata. 8379 * 8380 * @Annotation 8381 * @publicApi 8382 */ 8383const Optional = makeParamDecorator('Optional'); 8384/** 8385 * Self decorator and metadata. 8386 * 8387 * @Annotation 8388 * @publicApi 8389 */ 8390const Self = makeParamDecorator('Self'); 8391/** 8392 * `SkipSelf` decorator and metadata. 8393 * 8394 * @Annotation 8395 * @publicApi 8396 */ 8397const SkipSelf = makeParamDecorator('SkipSelf'); 8398/** 8399 * Host decorator and metadata. 8400 * 8401 * @Annotation 8402 * @publicApi 8403 */ 8404const Host = makeParamDecorator('Host'); 8405const ɵ1 = (attributeName) => ({ attributeName }); 8406/** 8407 * Attribute decorator and metadata. 8408 * 8409 * @Annotation 8410 * @publicApi 8411 */ 8412const Attribute = makeParamDecorator('Attribute', ɵ1); 8413 8414/** 8415 * @license 8416 * Copyright Google LLC All Rights Reserved. 8417 * 8418 * Use of this source code is governed by an MIT-style license that can be 8419 * found in the LICENSE file at https://angular.io/license 8420 */ 8421/** 8422 * Injection flags for DI. 8423 * 8424 * @publicApi 8425 */ 8426var InjectFlags; 8427(function (InjectFlags) { 8428 // TODO(alxhub): make this 'const' when ngc no longer writes exports of it into ngfactory files. 8429 /** Check self and check parent injector if needed */ 8430 InjectFlags[InjectFlags["Default"] = 0] = "Default"; 8431 /** 8432 * Specifies that an injector should retrieve a dependency from any injector until reaching the 8433 * host element of the current component. (Only used with Element Injector) 8434 */ 8435 InjectFlags[InjectFlags["Host"] = 1] = "Host"; 8436 /** Don't ascend to ancestors of the node requesting injection. */ 8437 InjectFlags[InjectFlags["Self"] = 2] = "Self"; 8438 /** Skip the node that is requesting injection. */ 8439 InjectFlags[InjectFlags["SkipSelf"] = 4] = "SkipSelf"; 8440 /** Inject `defaultValue` instead if token not found. */ 8441 InjectFlags[InjectFlags["Optional"] = 8] = "Optional"; 8442})(InjectFlags || (InjectFlags = {})); 8443 8444/** 8445 * @license 8446 * Copyright Google LLC All Rights Reserved. 8447 * 8448 * Use of this source code is governed by an MIT-style license that can be 8449 * found in the LICENSE file at https://angular.io/license 8450 */ 8451function getClosureSafeProperty(objWithPropertyToExtract) { 8452 for (let key in objWithPropertyToExtract) { 8453 if (objWithPropertyToExtract[key] === getClosureSafeProperty) { 8454 return key; 8455 } 8456 } 8457 throw Error('Could not find renamed property on target object.'); 8458} 8459/** 8460 * Sets properties on a target object from a source object, but only if 8461 * the property doesn't already exist on the target object. 8462 * @param target The target to set properties on 8463 * @param source The source of the property keys and values to set 8464 */ 8465function fillProperties(target, source) { 8466 for (const key in source) { 8467 if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) { 8468 target[key] = source[key]; 8469 } 8470 } 8471} 8472 8473/** 8474 * @license 8475 * Copyright Google LLC All Rights Reserved. 8476 * 8477 * Use of this source code is governed by an MIT-style license that can be 8478 * found in the LICENSE file at https://angular.io/license 8479 */ 8480/** 8481 * Construct an `InjectableDef` which defines how a token will be constructed by the DI system, and 8482 * in which injectors (if any) it will be available. 8483 * 8484 * This should be assigned to a static `ɵprov` field on a type, which will then be an 8485 * `InjectableType`. 8486 * 8487 * Options: 8488 * * `providedIn` determines which injectors will include the injectable, by either associating it 8489 * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be 8490 * provided in the `'root'` injector, which will be the application-level injector in most apps. 8491 * * `factory` gives the zero argument function which will create an instance of the injectable. 8492 * The factory can call `inject` to access the `Injector` and request injection of dependencies. 8493 * 8494 * @codeGenApi 8495 * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm. 8496 */ 8497function ɵɵdefineInjectable(opts) { 8498 return { 8499 token: opts.token, 8500 providedIn: opts.providedIn || null, 8501 factory: opts.factory, 8502 value: undefined, 8503 }; 8504} 8505/** 8506 * @deprecated in v8, delete after v10. This API should be used only be generated code, and that 8507 * code should now use ɵɵdefineInjectable instead. 8508 * @publicApi 8509 */ 8510const defineInjectable = ɵɵdefineInjectable; 8511/** 8512 * Construct an `InjectorDef` which configures an injector. 8513 * 8514 * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an 8515 * `InjectorType`. 8516 * 8517 * Options: 8518 * 8519 * * `factory`: an `InjectorType` is an instantiable type, so a zero argument `factory` function to 8520 * create the type must be provided. If that factory function needs to inject arguments, it can 8521 * use the `inject` function. 8522 * * `providers`: an optional array of providers to add to the injector. Each provider must 8523 * either have a factory or point to a type which has a `ɵprov` static property (the 8524 * type must be an `InjectableType`). 8525 * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s 8526 * whose providers will also be added to the injector. Locally provided types will override 8527 * providers from imports. 8528 * 8529 * @codeGenApi 8530 */ 8531function ɵɵdefineInjector(options) { 8532 return { 8533 factory: options.factory, 8534 providers: options.providers || [], 8535 imports: options.imports || [], 8536 }; 8537} 8538/** 8539 * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading 8540 * inherited value. 8541 * 8542 * @param type A type which may have its own (non-inherited) `ɵprov`. 8543 */ 8544function getInjectableDef(type) { 8545 return getOwnDefinition(type, type[NG_PROV_DEF]) || 8546 getOwnDefinition(type, type[NG_INJECTABLE_DEF]); 8547} 8548/** 8549 * Return `def` only if it is defined directly on `type` and is not inherited from a base 8550 * class of `type`. 8551 * 8552 * The function `Object.hasOwnProperty` is not sufficient to distinguish this case because in older 8553 * browsers (e.g. IE10) static property inheritance is implemented by copying the properties. 8554 * 8555 * Instead, the definition's `token` is compared to the `type`, and if they don't match then the 8556 * property was not defined directly on the type itself, and was likely inherited. The definition 8557 * is only returned if the `type` matches the `def.token`. 8558 */ 8559function getOwnDefinition(type, def) { 8560 return def && def.token === type ? def : null; 8561} 8562/** 8563 * Read the injectable def (`ɵprov`) for `type` or read the `ɵprov` from one of its ancestors. 8564 * 8565 * @param type A type which may have `ɵprov`, via inheritance. 8566 * 8567 * @deprecated Will be removed in a future version of Angular, where an error will occur in the 8568 * scenario if we find the `ɵprov` on an ancestor only. 8569 */ 8570function getInheritedInjectableDef(type) { 8571 // See `jit/injectable.ts#compileInjectable` for context on NG_PROV_DEF_FALLBACK. 8572 const def = type && 8573 (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF] || 8574 (type[NG_PROV_DEF_FALLBACK] && type[NG_PROV_DEF_FALLBACK]())); 8575 if (def) { 8576 const typeName = getTypeName(type); 8577 // TODO(FW-1307): Re-add ngDevMode when closure can handle it 8578 // ngDevMode && 8579 console.warn(`DEPRECATED: DI is instantiating a token "${typeName}" that inherits its @Injectable decorator but does not provide one itself.\n` + 8580 `This will become an error in a future version of Angular. Please add @Injectable() to the "${typeName}" class.`); 8581 return def; 8582 } 8583 else { 8584 return null; 8585 } 8586} 8587/** Gets the name of a type, accounting for some cross-browser differences. */ 8588function getTypeName(type) { 8589 // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers 8590 // it'll always return the name of the function itself, no matter how many other functions it 8591 // inherits from. On IE the function doesn't have its own `name` property, but it takes it from 8592 // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most 8593 // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around 8594 // the issue by converting the function to a string and parsing its name out that way via a regex. 8595 if (type.hasOwnProperty('name')) { 8596 return type.name; 8597 } 8598 const match = ('' + type).match(/^function\s*([^\s(]+)/); 8599 return match === null ? '' : match[1]; 8600} 8601/** 8602 * Read the injector def type in a way which is immune to accidentally reading inherited value. 8603 * 8604 * @param type type which may have an injector def (`ɵinj`) 8605 */ 8606function getInjectorDef(type) { 8607 return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF)) ? 8608 type[NG_INJ_DEF] : 8609 null; 8610} 8611const NG_PROV_DEF = getClosureSafeProperty({ ɵprov: getClosureSafeProperty }); 8612const NG_INJ_DEF = getClosureSafeProperty({ ɵinj: getClosureSafeProperty }); 8613// On IE10 properties defined via `defineProperty` won't be inherited by child classes, 8614// which will break inheriting the injectable definition from a grandparent through an 8615// undecorated parent class. We work around it by defining a fallback method which will be 8616// used to retrieve the definition. This should only be a problem in JIT mode, because in 8617// AOT TypeScript seems to have a workaround for static properties. When inheriting from an 8618// undecorated parent is no longer supported in v10, this can safely be removed. 8619const NG_PROV_DEF_FALLBACK = getClosureSafeProperty({ ɵprovFallback: getClosureSafeProperty }); 8620// We need to keep these around so we can read off old defs if new defs are unavailable 8621const NG_INJECTABLE_DEF = getClosureSafeProperty({ ngInjectableDef: getClosureSafeProperty }); 8622const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafeProperty }); 8623 8624/** 8625 * @license 8626 * Copyright Google LLC All Rights Reserved. 8627 * 8628 * Use of this source code is governed by an MIT-style license that can be 8629 * found in the LICENSE file at https://angular.io/license 8630 */ 8631function stringify(token) { 8632 if (typeof token === 'string') { 8633 return token; 8634 } 8635 if (Array.isArray(token)) { 8636 return '[' + token.map(stringify).join(', ') + ']'; 8637 } 8638 if (token == null) { 8639 return '' + token; 8640 } 8641 if (token.overriddenName) { 8642 return `${token.overriddenName}`; 8643 } 8644 if (token.name) { 8645 return `${token.name}`; 8646 } 8647 const res = token.toString(); 8648 if (res == null) { 8649 return '' + res; 8650 } 8651 const newLineIndex = res.indexOf('\n'); 8652 return newLineIndex === -1 ? res : res.substring(0, newLineIndex); 8653} 8654/** 8655 * Concatenates two strings with separator, allocating new strings only when necessary. 8656 * 8657 * @param before before string. 8658 * @param separator separator string. 8659 * @param after after string. 8660 * @returns concatenated string. 8661 */ 8662function concatStringsWithSpace(before, after) { 8663 return (before == null || before === '') ? 8664 (after === null ? '' : after) : 8665 ((after == null || after === '') ? before : before + ' ' + after); 8666} 8667 8668/** 8669 * @license 8670 * Copyright Google LLC All Rights Reserved. 8671 * 8672 * Use of this source code is governed by an MIT-style license that can be 8673 * found in the LICENSE file at https://angular.io/license 8674 */ 8675const __forward_ref__ = getClosureSafeProperty({ __forward_ref__: getClosureSafeProperty }); 8676/** 8677 * Allows to refer to references which are not yet defined. 8678 * 8679 * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of 8680 * DI is declared, but not yet defined. It is also used when the `token` which we use when creating 8681 * a query is not yet defined. 8682 * 8683 * @usageNotes 8684 * ### Example 8685 * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'} 8686 * @publicApi 8687 */ 8688function forwardRef(forwardRefFn) { 8689 forwardRefFn.__forward_ref__ = forwardRef; 8690 forwardRefFn.toString = function () { 8691 return stringify(this()); 8692 }; 8693 return forwardRefFn; 8694} 8695/** 8696 * Lazily retrieves the reference value from a forwardRef. 8697 * 8698 * Acts as the identity function when given a non-forward-ref value. 8699 * 8700 * @usageNotes 8701 * ### Example 8702 * 8703 * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'} 8704 * 8705 * @see `forwardRef` 8706 * @publicApi 8707 */ 8708function resolveForwardRef(type) { 8709 return isForwardRef(type) ? type() : type; 8710} 8711/** Checks whether a function is wrapped by a `forwardRef`. */ 8712function isForwardRef(fn) { 8713 return typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) && 8714 fn.__forward_ref__ === forwardRef; 8715} 8716 8717/** 8718 * @license 8719 * Copyright Google LLC All Rights Reserved. 8720 * 8721 * Use of this source code is governed by an MIT-style license that can be 8722 * found in the LICENSE file at https://angular.io/license 8723 */ 8724const __globalThis = typeof globalThis !== 'undefined' && globalThis; 8725const __window = typeof window !== 'undefined' && window; 8726const __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' && 8727 self instanceof WorkerGlobalScope && self; 8728const __global = typeof global !== 'undefined' && global; 8729// Always use __globalThis if available, which is the spec-defined global variable across all 8730// environments, then fallback to __global first, because in Node tests both __global and 8731// __window may be defined and _global should be __global in that case. 8732const _global = __globalThis || __global || __window || __self; 8733 8734/** 8735 * @license 8736 * Copyright Google LLC All Rights Reserved. 8737 * 8738 * Use of this source code is governed by an MIT-style license that can be 8739 * found in the LICENSE file at https://angular.io/license 8740 */ 8741var R3ResolvedDependencyType; 8742(function (R3ResolvedDependencyType) { 8743 R3ResolvedDependencyType[R3ResolvedDependencyType["Token"] = 0] = "Token"; 8744 R3ResolvedDependencyType[R3ResolvedDependencyType["Attribute"] = 1] = "Attribute"; 8745 R3ResolvedDependencyType[R3ResolvedDependencyType["ChangeDetectorRef"] = 2] = "ChangeDetectorRef"; 8746 R3ResolvedDependencyType[R3ResolvedDependencyType["Invalid"] = 3] = "Invalid"; 8747})(R3ResolvedDependencyType || (R3ResolvedDependencyType = {})); 8748var R3FactoryTarget; 8749(function (R3FactoryTarget) { 8750 R3FactoryTarget[R3FactoryTarget["Directive"] = 0] = "Directive"; 8751 R3FactoryTarget[R3FactoryTarget["Component"] = 1] = "Component"; 8752 R3FactoryTarget[R3FactoryTarget["Injectable"] = 2] = "Injectable"; 8753 R3FactoryTarget[R3FactoryTarget["Pipe"] = 3] = "Pipe"; 8754 R3FactoryTarget[R3FactoryTarget["NgModule"] = 4] = "NgModule"; 8755})(R3FactoryTarget || (R3FactoryTarget = {})); 8756var ViewEncapsulation; 8757(function (ViewEncapsulation) { 8758 ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; 8759 ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; 8760 ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; 8761 ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom"; 8762})(ViewEncapsulation || (ViewEncapsulation = {})); 8763 8764/** 8765 * @license 8766 * Copyright Google LLC All Rights Reserved. 8767 * 8768 * Use of this source code is governed by an MIT-style license that can be 8769 * found in the LICENSE file at https://angular.io/license 8770 */ 8771function getCompilerFacade() { 8772 const globalNg = _global['ng']; 8773 if (!globalNg || !globalNg.ɵcompilerFacade) { 8774 throw new Error(`Angular JIT compilation failed: '@angular/compiler' not loaded!\n` + 8775 ` - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.\n` + 8776 ` - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?\n` + 8777 ` - Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping.`); 8778 } 8779 return globalNg.ɵcompilerFacade; 8780} 8781 8782/** 8783 * @license 8784 * Copyright Google LLC All Rights Reserved. 8785 * 8786 * Use of this source code is governed by an MIT-style license that can be 8787 * found in the LICENSE file at https://angular.io/license 8788 */ 8789const NG_COMP_DEF = getClosureSafeProperty({ ɵcmp: getClosureSafeProperty }); 8790const NG_DIR_DEF = getClosureSafeProperty({ ɵdir: getClosureSafeProperty }); 8791const NG_PIPE_DEF = getClosureSafeProperty({ ɵpipe: getClosureSafeProperty }); 8792const NG_MOD_DEF = getClosureSafeProperty({ ɵmod: getClosureSafeProperty }); 8793const NG_LOC_ID_DEF = getClosureSafeProperty({ ɵloc: getClosureSafeProperty }); 8794const NG_FACTORY_DEF = getClosureSafeProperty({ ɵfac: getClosureSafeProperty }); 8795/** 8796 * If a directive is diPublic, bloomAdd sets a property on the type with this constant as 8797 * the key and the directive's unique ID as the value. This allows us to map directives to their 8798 * bloom filter bit for DI. 8799 */ 8800// TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified. 8801const NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty }); 8802 8803/** 8804 * @license 8805 * Copyright Google LLC All Rights Reserved. 8806 * 8807 * Use of this source code is governed by an MIT-style license that can be 8808 * found in the LICENSE file at https://angular.io/license 8809 */ 8810function ngDevModeResetPerfCounters() { 8811 const locationString = typeof location !== 'undefined' ? location.toString() : ''; 8812 const newCounters = { 8813 namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1, 8814 firstCreatePass: 0, 8815 tNode: 0, 8816 tView: 0, 8817 rendererCreateTextNode: 0, 8818 rendererSetText: 0, 8819 rendererCreateElement: 0, 8820 rendererAddEventListener: 0, 8821 rendererSetAttribute: 0, 8822 rendererRemoveAttribute: 0, 8823 rendererSetProperty: 0, 8824 rendererSetClassName: 0, 8825 rendererAddClass: 0, 8826 rendererRemoveClass: 0, 8827 rendererSetStyle: 0, 8828 rendererRemoveStyle: 0, 8829 rendererDestroy: 0, 8830 rendererDestroyNode: 0, 8831 rendererMoveNode: 0, 8832 rendererRemoveNode: 0, 8833 rendererAppendChild: 0, 8834 rendererInsertBefore: 0, 8835 rendererCreateComment: 0, 8836 }; 8837 // Make sure to refer to ngDevMode as ['ngDevMode'] for closure. 8838 const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1; 8839 _global['ngDevMode'] = allowNgDevModeTrue && newCounters; 8840 return newCounters; 8841} 8842/** 8843 * This function checks to see if the `ngDevMode` has been set. If yes, 8844 * then we honor it, otherwise we default to dev mode with additional checks. 8845 * 8846 * The idea is that unless we are doing production build where we explicitly 8847 * set `ngDevMode == false` we should be helping the developer by providing 8848 * as much early warning and errors as possible. 8849 * 8850 * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions 8851 * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode 8852 * is defined for the entire instruction set. 8853 * 8854 * When checking `ngDevMode` on toplevel, always init it before referencing it 8855 * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can 8856 * get a `ReferenceError` like in https://github.com/angular/angular/issues/31595. 8857 * 8858 * Details on possible values for `ngDevMode` can be found on its docstring. 8859 * 8860 * NOTE: 8861 * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`. 8862 */ 8863function initNgDevMode() { 8864 // The below checks are to ensure that calling `initNgDevMode` multiple times does not 8865 // reset the counters. 8866 // If the `ngDevMode` is not an object, then it means we have not created the perf counters 8867 // yet. 8868 if (typeof ngDevMode === 'undefined' || ngDevMode) { 8869 if (typeof ngDevMode !== 'object') { 8870 ngDevModeResetPerfCounters(); 8871 } 8872 return !!ngDevMode; 8873 } 8874 return false; 8875} 8876 8877/** 8878 * @license 8879 * Copyright Google LLC All Rights Reserved. 8880 * 8881 * Use of this source code is governed by an MIT-style license that can be 8882 * found in the LICENSE file at https://angular.io/license 8883 */ 8884/** 8885 * Creates a token that can be used in a DI Provider. 8886 * 8887 * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a 8888 * runtime representation) such as when injecting an interface, callable type, array or 8889 * parameterized type. 8890 * 8891 * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by 8892 * the `Injector`. This provides additional level of type safety. 8893 * 8894 * ``` 8895 * interface MyInterface {...} 8896 * var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken')); 8897 * // myInterface is inferred to be MyInterface. 8898 * ``` 8899 * 8900 * When creating an `InjectionToken`, you can optionally specify a factory function which returns 8901 * (possibly by creating) a default value of the parameterized type `T`. This sets up the 8902 * `InjectionToken` using this factory as a provider as if it was defined explicitly in the 8903 * application's root injector. If the factory function, which takes zero arguments, needs to inject 8904 * dependencies, it can do so using the `inject` function. See below for an example. 8905 * 8906 * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which 8907 * overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As 8908 * mentioned above, `'root'` is the default value for `providedIn`. 8909 * 8910 * @usageNotes 8911 * ### Basic Example 8912 * 8913 * ### Plain InjectionToken 8914 * 8915 * {@example core/di/ts/injector_spec.ts region='InjectionToken'} 8916 * 8917 * ### Tree-shakable InjectionToken 8918 * 8919 * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'} 8920 * 8921 * 8922 * @publicApi 8923 */ 8924class InjectionToken { 8925 constructor(_desc, options) { 8926 this._desc = _desc; 8927 /** @internal */ 8928 this.ngMetadataName = 'InjectionToken'; 8929 this.ɵprov = undefined; 8930 if (typeof options == 'number') { 8931 // This is a special hack to assign __NG_ELEMENT_ID__ to this instance. 8932 // __NG_ELEMENT_ID__ is Used by Ivy to determine bloom filter id. 8933 // We are using it to assign `-1` which is used to identify `Injector`. 8934 this.__NG_ELEMENT_ID__ = options; 8935 } 8936 else if (options !== undefined) { 8937 this.ɵprov = ɵɵdefineInjectable({ 8938 token: this, 8939 providedIn: options.providedIn || 'root', 8940 factory: options.factory, 8941 }); 8942 } 8943 } 8944 toString() { 8945 return `InjectionToken ${this._desc}`; 8946 } 8947} 8948 8949/** 8950 * @license 8951 * Copyright Google LLC All Rights Reserved. 8952 * 8953 * Use of this source code is governed by an MIT-style license that can be 8954 * found in the LICENSE file at https://angular.io/license 8955 */ 8956/** 8957 * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors. 8958 * 8959 * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a 8960 * project. 8961 * 8962 * @publicApi 8963 */ 8964const INJECTOR = new InjectionToken('INJECTOR', -1 // `-1` is used by Ivy DI system as special value to recognize it as `Injector`. 8965); 8966const _THROW_IF_NOT_FOUND = {}; 8967const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND; 8968const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath'; 8969const NG_TOKEN_PATH = 'ngTokenPath'; 8970const NEW_LINE = /\n/gm; 8971const NO_NEW_LINE = 'ɵ'; 8972const SOURCE = '__source'; 8973const ɵ0$1 = getClosureSafeProperty; 8974const USE_VALUE = getClosureSafeProperty({ provide: String, useValue: ɵ0$1 }); 8975/** 8976 * Current injector value used by `inject`. 8977 * - `undefined`: it is an error to call `inject` 8978 * - `null`: `inject` can be called but there is no injector (limp-mode). 8979 * - Injector instance: Use the injector for resolution. 8980 */ 8981let _currentInjector = undefined; 8982function setCurrentInjector(injector) { 8983 const former = _currentInjector; 8984 _currentInjector = injector; 8985 return former; 8986} 8987/** 8988 * Current implementation of inject. 8989 * 8990 * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed 8991 * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this 8992 * way for two reasons: 8993 * 1. `Injector` should not depend on ivy logic. 8994 * 2. To maintain tree shake-ability we don't want to bring in unnecessary code. 8995 */ 8996let _injectImplementation; 8997/** 8998 * Sets the current inject implementation. 8999 */ 9000function setInjectImplementation(impl) { 9001 const previous = _injectImplementation; 9002 _injectImplementation = impl; 9003 return previous; 9004} 9005function injectInjectorOnly(token, flags = InjectFlags.Default) { 9006 if (_currentInjector === undefined) { 9007 throw new Error(`inject() must be called from an injection context`); 9008 } 9009 else if (_currentInjector === null) { 9010 return injectRootLimpMode(token, undefined, flags); 9011 } 9012 else { 9013 return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags); 9014 } 9015} 9016function ɵɵinject(token, flags = InjectFlags.Default) { 9017 return (_injectImplementation || injectInjectorOnly)(resolveForwardRef(token), flags); 9018} 9019/** 9020 * Throws an error indicating that a factory function could not be generated by the compiler for a 9021 * particular class. 9022 * 9023 * This instruction allows the actual error message to be optimized away when ngDevMode is turned 9024 * off, saving bytes of generated code while still providing a good experience in dev mode. 9025 * 9026 * The name of the class is not mentioned here, but will be in the generated factory function name 9027 * and thus in the stack trace. 9028 * 9029 * @codeGenApi 9030 */ 9031function ɵɵinvalidFactoryDep(index) { 9032 const msg = ngDevMode ? 9033 `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid. 9034This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator. 9035 9036Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.` : 9037 'invalid'; 9038 throw new Error(msg); 9039} 9040/** 9041 * Injects a token from the currently active injector. 9042 * 9043 * Must be used in the context of a factory function such as one defined for an 9044 * `InjectionToken`. Throws an error if not called from such a context. 9045 * 9046 * Within such a factory function, using this function to request injection of a dependency 9047 * is faster and more type-safe than providing an additional array of dependencies 9048 * (as has been common with `useFactory` providers). 9049 * 9050 * @param token The injection token for the dependency to be injected. 9051 * @param flags Optional flags that control how injection is executed. 9052 * The flags correspond to injection strategies that can be specified with 9053 * parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`. 9054 * @returns True if injection is successful, null otherwise. 9055 * 9056 * @usageNotes 9057 * 9058 * ### Example 9059 * 9060 * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'} 9061 * 9062 * @publicApi 9063 */ 9064const inject = ɵɵinject; 9065/** 9066 * Injects `root` tokens in limp mode. 9067 * 9068 * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to 9069 * `"root"`. This is known as the limp mode injection. In such case the value is stored in the 9070 * `InjectableDef`. 9071 */ 9072function injectRootLimpMode(token, notFoundValue, flags) { 9073 const injectableDef = getInjectableDef(token); 9074 if (injectableDef && injectableDef.providedIn == 'root') { 9075 return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() : 9076 injectableDef.value; 9077 } 9078 if (flags & InjectFlags.Optional) 9079 return null; 9080 if (notFoundValue !== undefined) 9081 return notFoundValue; 9082 throw new Error(`Injector: NOT_FOUND [${stringify(token)}]`); 9083} 9084function injectArgs(types) { 9085 const args = []; 9086 for (let i = 0; i < types.length; i++) { 9087 const arg = resolveForwardRef(types[i]); 9088 if (Array.isArray(arg)) { 9089 if (arg.length === 0) { 9090 throw new Error('Arguments array must have arguments.'); 9091 } 9092 let type = undefined; 9093 let flags = InjectFlags.Default; 9094 for (let j = 0; j < arg.length; j++) { 9095 const meta = arg[j]; 9096 if (meta instanceof Optional || meta.ngMetadataName === 'Optional' || meta === Optional) { 9097 flags |= InjectFlags.Optional; 9098 } 9099 else if (meta instanceof SkipSelf || meta.ngMetadataName === 'SkipSelf' || meta === SkipSelf) { 9100 flags |= InjectFlags.SkipSelf; 9101 } 9102 else if (meta instanceof Self || meta.ngMetadataName === 'Self' || meta === Self) { 9103 flags |= InjectFlags.Self; 9104 } 9105 else if (meta instanceof Inject || meta === Inject) { 9106 type = meta.token; 9107 } 9108 else { 9109 type = meta; 9110 } 9111 } 9112 args.push(ɵɵinject(type, flags)); 9113 } 9114 else { 9115 args.push(ɵɵinject(arg)); 9116 } 9117 } 9118 return args; 9119} 9120class NullInjector { 9121 get(token, notFoundValue = THROW_IF_NOT_FOUND) { 9122 if (notFoundValue === THROW_IF_NOT_FOUND) { 9123 // Intentionally left behind: With dev tools open the debugger will stop here. There is no 9124 // reason why correctly written application should cause this exception. 9125 // TODO(misko): uncomment the next line once `ngDevMode` works with closure. 9126 // if (ngDevMode) debugger; 9127 const error = new Error(`NullInjectorError: No provider for ${stringify(token)}!`); 9128 error.name = 'NullInjectorError'; 9129 throw error; 9130 } 9131 return notFoundValue; 9132 } 9133} 9134function catchInjectorError(e, token, injectorErrorName, source) { 9135 const tokenPath = e[NG_TEMP_TOKEN_PATH]; 9136 if (token[SOURCE]) { 9137 tokenPath.unshift(token[SOURCE]); 9138 } 9139 e.message = formatError('\n' + e.message, tokenPath, injectorErrorName, source); 9140 e[NG_TOKEN_PATH] = tokenPath; 9141 e[NG_TEMP_TOKEN_PATH] = null; 9142 throw e; 9143} 9144function formatError(text, obj, injectorErrorName, source = null) { 9145 text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text; 9146 let context = stringify(obj); 9147 if (Array.isArray(obj)) { 9148 context = obj.map(stringify).join(' -> '); 9149 } 9150 else if (typeof obj === 'object') { 9151 let parts = []; 9152 for (let key in obj) { 9153 if (obj.hasOwnProperty(key)) { 9154 let value = obj[key]; 9155 parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value))); 9156 } 9157 } 9158 context = `{${parts.join(', ')}}`; 9159 } 9160 return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\n ')}`; 9161} 9162 9163/** 9164 * @license 9165 * Copyright Google LLC All Rights Reserved. 9166 * 9167 * Use of this source code is governed by an MIT-style license that can be 9168 * found in the LICENSE file at https://angular.io/license 9169 */ 9170/** 9171 * A mapping of the @angular/core API surface used in generated expressions to the actual symbols. 9172 * 9173 * This should be kept up to date with the public exports of @angular/core. 9174 */ 9175const angularCoreDiEnv = { 9176 'ɵɵdefineInjectable': ɵɵdefineInjectable, 9177 'ɵɵdefineInjector': ɵɵdefineInjector, 9178 'ɵɵinject': ɵɵinject, 9179 'ɵɵgetFactoryOf': getFactoryOf, 9180 'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep, 9181}; 9182function getFactoryOf(type) { 9183 const typeAny = type; 9184 if (isForwardRef(type)) { 9185 return (() => { 9186 const factory = getFactoryOf(resolveForwardRef(typeAny)); 9187 return factory ? factory() : null; 9188 }); 9189 } 9190 const def = getInjectableDef(typeAny) || getInjectorDef(typeAny); 9191 if (!def || def.factory === undefined) { 9192 return null; 9193 } 9194 return def.factory; 9195} 9196 9197/** 9198 * @license 9199 * Copyright Google LLC All Rights Reserved. 9200 * 9201 * Use of this source code is governed by an MIT-style license that can be 9202 * found in the LICENSE file at https://angular.io/license 9203 */ 9204/** 9205 * Represents an instance of an `NgModule` created by an `NgModuleFactory`. 9206 * Provides access to the `NgModule` instance and related objects. 9207 * 9208 * @publicApi 9209 */ 9210class NgModuleRef { 9211} 9212/** 9213 * @publicApi 9214 */ 9215class NgModuleFactory { 9216} 9217 9218/** 9219 * @license 9220 * Copyright Google LLC All Rights Reserved. 9221 * 9222 * Use of this source code is governed by an MIT-style license that can be 9223 * found in the LICENSE file at https://angular.io/license 9224 */ 9225function assertNumber(actual, msg) { 9226 if (!(typeof actual === 'number')) { 9227 throwError(msg, typeof actual, 'number', '==='); 9228 } 9229} 9230function assertNumberInRange(actual, minInclusive, maxInclusive) { 9231 assertNumber(actual, 'Expected a number'); 9232 assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to'); 9233 assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to'); 9234} 9235function assertString(actual, msg) { 9236 if (!(typeof actual === 'string')) { 9237 throwError(msg, actual === null ? 'null' : typeof actual, 'string', '==='); 9238 } 9239} 9240function assertEqual(actual, expected, msg) { 9241 if (!(actual == expected)) { 9242 throwError(msg, actual, expected, '=='); 9243 } 9244} 9245function assertNotEqual(actual, expected, msg) { 9246 if (!(actual != expected)) { 9247 throwError(msg, actual, expected, '!='); 9248 } 9249} 9250function assertSame(actual, expected, msg) { 9251 if (!(actual === expected)) { 9252 throwError(msg, actual, expected, '==='); 9253 } 9254} 9255function assertNotSame(actual, expected, msg) { 9256 if (!(actual !== expected)) { 9257 throwError(msg, actual, expected, '!=='); 9258 } 9259} 9260function assertLessThan(actual, expected, msg) { 9261 if (!(actual < expected)) { 9262 throwError(msg, actual, expected, '<'); 9263 } 9264} 9265function assertLessThanOrEqual(actual, expected, msg) { 9266 if (!(actual <= expected)) { 9267 throwError(msg, actual, expected, '<='); 9268 } 9269} 9270function assertGreaterThan(actual, expected, msg) { 9271 if (!(actual > expected)) { 9272 throwError(msg, actual, expected, '>'); 9273 } 9274} 9275function assertGreaterThanOrEqual(actual, expected, msg) { 9276 if (!(actual >= expected)) { 9277 throwError(msg, actual, expected, '>='); 9278 } 9279} 9280function assertNotDefined(actual, msg) { 9281 if (actual != null) { 9282 throwError(msg, actual, null, '=='); 9283 } 9284} 9285function assertDefined(actual, msg) { 9286 if (actual == null) { 9287 throwError(msg, actual, null, '!='); 9288 } 9289} 9290function throwError(msg, actual, expected, comparison) { 9291 throw new Error(`ASSERTION ERROR: ${msg}` + 9292 (comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`)); 9293} 9294function assertDomNode(node) { 9295 // If we're in a worker, `Node` will not be defined. 9296 assertEqual((typeof Node !== 'undefined' && node instanceof Node) || 9297 (typeof node === 'object' && node != null && 9298 node.constructor.name === 'WebWorkerRenderNode'), true, `The provided value must be an instance of a DOM Node but got ${stringify(node)}`); 9299} 9300function assertIndexInRange(arr, index) { 9301 const maxLen = arr ? arr.length : 0; 9302 assertLessThan(index, maxLen, `Index expected to be less than ${maxLen} but got ${index}`); 9303} 9304 9305/** 9306 * @license 9307 * Copyright Google LLC All Rights Reserved. 9308 * 9309 * Use of this source code is governed by an MIT-style license that can be 9310 * found in the LICENSE file at https://angular.io/license 9311 */ 9312/** 9313 * Equivalent to ES6 spread, add each item to an array. 9314 * 9315 * @param items The items to add 9316 * @param arr The array to which you want to add the items 9317 */ 9318function addAllToArray(items, arr) { 9319 for (let i = 0; i < items.length; i++) { 9320 arr.push(items[i]); 9321 } 9322} 9323/** 9324 * Flattens an array. 9325 */ 9326function flatten(list, dst) { 9327 if (dst === undefined) 9328 dst = list; 9329 for (let i = 0; i < list.length; i++) { 9330 let item = list[i]; 9331 if (Array.isArray(item)) { 9332 // we need to inline it. 9333 if (dst === list) { 9334 // Our assumption that the list was already flat was wrong and 9335 // we need to clone flat since we need to write to it. 9336 dst = list.slice(0, i); 9337 } 9338 flatten(item, dst); 9339 } 9340 else if (dst !== list) { 9341 dst.push(item); 9342 } 9343 } 9344 return dst; 9345} 9346function deepForEach(input, fn) { 9347 input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value)); 9348} 9349function addToArray(arr, index, value) { 9350 // perf: array.push is faster than array.splice! 9351 if (index >= arr.length) { 9352 arr.push(value); 9353 } 9354 else { 9355 arr.splice(index, 0, value); 9356 } 9357} 9358function removeFromArray(arr, index) { 9359 // perf: array.pop is faster than array.splice! 9360 if (index >= arr.length - 1) { 9361 return arr.pop(); 9362 } 9363 else { 9364 return arr.splice(index, 1)[0]; 9365 } 9366} 9367function newArray(size, value) { 9368 const list = []; 9369 for (let i = 0; i < size; i++) { 9370 list.push(value); 9371 } 9372 return list; 9373} 9374/** 9375 * Remove item from array (Same as `Array.splice()` but faster.) 9376 * 9377 * `Array.splice()` is not as fast because it has to allocate an array for the elements which were 9378 * removed. This causes memory pressure and slows down code when most of the time we don't 9379 * care about the deleted items array. 9380 * 9381 * https://jsperf.com/fast-array-splice (About 20x faster) 9382 * 9383 * @param array Array to splice 9384 * @param index Index of element in array to remove. 9385 * @param count Number of items to remove. 9386 */ 9387function arraySplice(array, index, count) { 9388 const length = array.length - count; 9389 while (index < length) { 9390 array[index] = array[index + count]; 9391 index++; 9392 } 9393 while (count--) { 9394 array.pop(); // shrink the array 9395 } 9396} 9397/** 9398 * Same as `Array.splice(index, 0, value)` but faster. 9399 * 9400 * `Array.splice()` is not fast because it has to allocate an array for the elements which were 9401 * removed. This causes memory pressure and slows down code when most of the time we don't 9402 * care about the deleted items array. 9403 * 9404 * @param array Array to splice. 9405 * @param index Index in array where the `value` should be added. 9406 * @param value Value to add to array. 9407 */ 9408function arrayInsert(array, index, value) { 9409 ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\'t insert past array end.'); 9410 let end = array.length; 9411 while (end > index) { 9412 const previousEnd = end - 1; 9413 array[end] = array[previousEnd]; 9414 end = previousEnd; 9415 } 9416 array[index] = value; 9417} 9418/** 9419 * Same as `Array.splice2(index, 0, value1, value2)` but faster. 9420 * 9421 * `Array.splice()` is not fast because it has to allocate an array for the elements which were 9422 * removed. This causes memory pressure and slows down code when most of the time we don't 9423 * care about the deleted items array. 9424 * 9425 * @param array Array to splice. 9426 * @param index Index in array where the `value` should be added. 9427 * @param value1 Value to add to array. 9428 * @param value2 Value to add to array. 9429 */ 9430function arrayInsert2(array, index, value1, value2) { 9431 ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\'t insert past array end.'); 9432 let end = array.length; 9433 if (end == index) { 9434 // inserting at the end. 9435 array.push(value1, value2); 9436 } 9437 else if (end === 1) { 9438 // corner case when we have less items in array than we have items to insert. 9439 array.push(value2, array[0]); 9440 array[0] = value1; 9441 } 9442 else { 9443 end--; 9444 array.push(array[end - 1], array[end]); 9445 while (end > index) { 9446 const previousEnd = end - 2; 9447 array[end] = array[previousEnd]; 9448 end--; 9449 } 9450 array[index] = value1; 9451 array[index + 1] = value2; 9452 } 9453} 9454/** 9455 * Insert a `value` into an `array` so that the array remains sorted. 9456 * 9457 * NOTE: 9458 * - Duplicates are not allowed, and are ignored. 9459 * - This uses binary search algorithm for fast inserts. 9460 * 9461 * @param array A sorted array to insert into. 9462 * @param value The value to insert. 9463 * @returns index of the inserted value. 9464 */ 9465function arrayInsertSorted(array, value) { 9466 let index = arrayIndexOfSorted(array, value); 9467 if (index < 0) { 9468 // if we did not find it insert it. 9469 index = ~index; 9470 arrayInsert(array, index, value); 9471 } 9472 return index; 9473} 9474/** 9475 * Remove `value` from a sorted `array`. 9476 * 9477 * NOTE: 9478 * - This uses binary search algorithm for fast removals. 9479 * 9480 * @param array A sorted array to remove from. 9481 * @param value The value to remove. 9482 * @returns index of the removed value. 9483 * - positive index if value found and removed. 9484 * - negative index if value not found. (`~index` to get the value where it should have been 9485 * inserted) 9486 */ 9487function arrayRemoveSorted(array, value) { 9488 const index = arrayIndexOfSorted(array, value); 9489 if (index >= 0) { 9490 arraySplice(array, index, 1); 9491 } 9492 return index; 9493} 9494/** 9495 * Get an index of an `value` in a sorted `array`. 9496 * 9497 * NOTE: 9498 * - This uses binary search algorithm for fast removals. 9499 * 9500 * @param array A sorted array to binary search. 9501 * @param value The value to look for. 9502 * @returns index of the value. 9503 * - positive index if value found. 9504 * - negative index if value not found. (`~index` to get the value where it should have been 9505 * located) 9506 */ 9507function arrayIndexOfSorted(array, value) { 9508 return _arrayIndexOfSorted(array, value, 0); 9509} 9510/** 9511 * Set a `value` for a `key`. 9512 * 9513 * @param keyValueArray to modify. 9514 * @param key The key to locate or create. 9515 * @param value The value to set for a `key`. 9516 * @returns index (always even) of where the value vas set. 9517 */ 9518function keyValueArraySet(keyValueArray, key, value) { 9519 let index = keyValueArrayIndexOf(keyValueArray, key); 9520 if (index >= 0) { 9521 // if we found it set it. 9522 keyValueArray[index | 1] = value; 9523 } 9524 else { 9525 index = ~index; 9526 arrayInsert2(keyValueArray, index, key, value); 9527 } 9528 return index; 9529} 9530/** 9531 * Retrieve a `value` for a `key` (on `undefined` if not found.) 9532 * 9533 * @param keyValueArray to search. 9534 * @param key The key to locate. 9535 * @return The `value` stored at the `key` location or `undefined if not found. 9536 */ 9537function keyValueArrayGet(keyValueArray, key) { 9538 const index = keyValueArrayIndexOf(keyValueArray, key); 9539 if (index >= 0) { 9540 // if we found it retrieve it. 9541 return keyValueArray[index | 1]; 9542 } 9543 return undefined; 9544} 9545/** 9546 * Retrieve a `key` index value in the array or `-1` if not found. 9547 * 9548 * @param keyValueArray to search. 9549 * @param key The key to locate. 9550 * @returns index of where the key is (or should have been.) 9551 * - positive (even) index if key found. 9552 * - negative index if key not found. (`~index` (even) to get the index where it should have 9553 * been inserted.) 9554 */ 9555function keyValueArrayIndexOf(keyValueArray, key) { 9556 return _arrayIndexOfSorted(keyValueArray, key, 1); 9557} 9558/** 9559 * Delete a `key` (and `value`) from the `KeyValueArray`. 9560 * 9561 * @param keyValueArray to modify. 9562 * @param key The key to locate or delete (if exist). 9563 * @returns index of where the key was (or should have been.) 9564 * - positive (even) index if key found and deleted. 9565 * - negative index if key not found. (`~index` (even) to get the index where it should have 9566 * been.) 9567 */ 9568function keyValueArrayDelete(keyValueArray, key) { 9569 const index = keyValueArrayIndexOf(keyValueArray, key); 9570 if (index >= 0) { 9571 // if we found it remove it. 9572 arraySplice(keyValueArray, index, 2); 9573 } 9574 return index; 9575} 9576/** 9577 * INTERNAL: Get an index of an `value` in a sorted `array` by grouping search by `shift`. 9578 * 9579 * NOTE: 9580 * - This uses binary search algorithm for fast removals. 9581 * 9582 * @param array A sorted array to binary search. 9583 * @param value The value to look for. 9584 * @param shift grouping shift. 9585 * - `0` means look at every location 9586 * - `1` means only look at every other (even) location (the odd locations are to be ignored as 9587 * they are values.) 9588 * @returns index of the value. 9589 * - positive index if value found. 9590 * - negative index if value not found. (`~index` to get the value where it should have been 9591 * inserted) 9592 */ 9593function _arrayIndexOfSorted(array, value, shift) { 9594 ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array'); 9595 let start = 0; 9596 let end = array.length >> shift; 9597 while (end !== start) { 9598 const middle = start + ((end - start) >> 1); // find the middle. 9599 const current = array[middle << shift]; 9600 if (value === current) { 9601 return (middle << shift); 9602 } 9603 else if (current > value) { 9604 end = middle; 9605 } 9606 else { 9607 start = middle + 1; // We already searched middle so make it non-inclusive by adding 1 9608 } 9609 } 9610 return ~(end << shift); 9611} 9612 9613/** 9614 * @license 9615 * Copyright Google LLC All Rights Reserved. 9616 * 9617 * Use of this source code is governed by an MIT-style license that can be 9618 * found in the LICENSE file at https://angular.io/license 9619 */ 9620/** 9621 * The strategy that the default change detector uses to detect changes. 9622 * When set, takes effect the next time change detection is triggered. 9623 * 9624 * @see {@link ChangeDetectorRef#usage-notes Change detection usage} 9625 * 9626 * @publicApi 9627 */ 9628var ChangeDetectionStrategy; 9629(function (ChangeDetectionStrategy) { 9630 /** 9631 * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated 9632 * until reactivated by setting the strategy to `Default` (`CheckAlways`). 9633 * Change detection can still be explicitly invoked. 9634 * This strategy applies to all child directives and cannot be overridden. 9635 */ 9636 ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush"; 9637 /** 9638 * Use the default `CheckAlways` strategy, in which change detection is automatic until 9639 * explicitly deactivated. 9640 */ 9641 ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default"; 9642})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {})); 9643/** 9644 * Defines the possible states of the default change detector. 9645 * @see `ChangeDetectorRef` 9646 */ 9647var ChangeDetectorStatus; 9648(function (ChangeDetectorStatus) { 9649 /** 9650 * A state in which, after calling `detectChanges()`, the change detector 9651 * state becomes `Checked`, and must be explicitly invoked or reactivated. 9652 */ 9653 ChangeDetectorStatus[ChangeDetectorStatus["CheckOnce"] = 0] = "CheckOnce"; 9654 /** 9655 * A state in which change detection is skipped until the change detector mode 9656 * becomes `CheckOnce`. 9657 */ 9658 ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked"; 9659 /** 9660 * A state in which change detection continues automatically until explicitly 9661 * deactivated. 9662 */ 9663 ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways"; 9664 /** 9665 * A state in which a change detector sub tree is not a part of the main tree and 9666 * should be skipped. 9667 */ 9668 ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached"; 9669 /** 9670 * Indicates that the change detector encountered an error checking a binding 9671 * or calling a directive lifecycle method and is now in an inconsistent state. Change 9672 * detectors in this state do not detect changes. 9673 */ 9674 ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "Errored"; 9675 /** 9676 * Indicates that the change detector has been destroyed. 9677 */ 9678 ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed"; 9679})(ChangeDetectorStatus || (ChangeDetectorStatus = {})); 9680/** 9681 * Reports whether a given strategy is currently the default for change detection. 9682 * @param changeDetectionStrategy The strategy to check. 9683 * @returns True if the given strategy is the current default, false otherwise. 9684 * @see `ChangeDetectorStatus` 9685 * @see `ChangeDetectorRef` 9686 */ 9687function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { 9688 return changeDetectionStrategy == null || 9689 changeDetectionStrategy === ChangeDetectionStrategy.Default; 9690} 9691 9692/** 9693 * @license 9694 * Copyright Google LLC All Rights Reserved. 9695 * 9696 * Use of this source code is governed by an MIT-style license that can be 9697 * found in the LICENSE file at https://angular.io/license 9698 */ 9699/** 9700 * Defines template and style encapsulation options available for Component's {@link Component}. 9701 * 9702 * See {@link Component#encapsulation encapsulation}. 9703 * 9704 * @usageNotes 9705 * ### Example 9706 * 9707 * {@example core/ts/metadata/encapsulation.ts region='longform'} 9708 * 9709 * @publicApi 9710 */ 9711var ViewEncapsulation$1; 9712(function (ViewEncapsulation) { 9713 /** 9714 * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host 9715 * Element and pre-processing the style rules provided via {@link Component#styles styles} or 9716 * {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all 9717 * selectors. 9718 * 9719 * This is the default option. 9720 */ 9721 ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; 9722 /** 9723 * @deprecated v6.1.0 - use {ViewEncapsulation.ShadowDom} instead. 9724 * Use the native encapsulation mechanism of the renderer. 9725 * 9726 * For the DOM this means using the deprecated [Shadow DOM 9727 * v0](https://w3c.github.io/webcomponents/spec/shadow/) and 9728 * creating a ShadowRoot for Component's Host Element. 9729 */ 9730 ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; 9731 /** 9732 * Don't provide any template or style encapsulation. 9733 */ 9734 ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; 9735 /** 9736 * Use Shadow DOM to encapsulate styles. 9737 * 9738 * For the DOM this means using modern [Shadow 9739 * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and 9740 * creating a ShadowRoot for Component's Host Element. 9741 */ 9742 ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom"; 9743})(ViewEncapsulation$1 || (ViewEncapsulation$1 = {})); 9744 9745/** 9746 * @license 9747 * Copyright Google LLC All Rights Reserved. 9748 * 9749 * Use of this source code is governed by an MIT-style license that can be 9750 * found in the LICENSE file at https://angular.io/license 9751 */ 9752/** 9753 * This file contains reuseable "empty" symbols that can be used as default return values 9754 * in different parts of the rendering code. Because the same symbols are returned, this 9755 * allows for identity checks against these values to be consistently used by the framework 9756 * code. 9757 */ 9758const EMPTY_OBJ = {}; 9759const EMPTY_ARRAY = []; 9760// freezing the values prevents any code from accidentally inserting new values in 9761if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) { 9762 // These property accesses can be ignored because ngDevMode will be set to false 9763 // when optimizing code and the whole if statement will be dropped. 9764 // tslint:disable-next-line:no-toplevel-property-access 9765 Object.freeze(EMPTY_OBJ); 9766 // tslint:disable-next-line:no-toplevel-property-access 9767 Object.freeze(EMPTY_ARRAY); 9768} 9769 9770/** 9771 * @license 9772 * Copyright Google LLC All Rights Reserved. 9773 * 9774 * Use of this source code is governed by an MIT-style license that can be 9775 * found in the LICENSE file at https://angular.io/license 9776 */ 9777let _renderCompCount = 0; 9778/** 9779 * Create a component definition object. 9780 * 9781 * 9782 * # Example 9783 * ``` 9784 * class MyDirective { 9785 * // Generated by Angular Template Compiler 9786 * // [Symbol] syntax will not be supported by TypeScript until v2.7 9787 * static ɵcmp = defineComponent({ 9788 * ... 9789 * }); 9790 * } 9791 * ``` 9792 * @codeGenApi 9793 */ 9794function ɵɵdefineComponent(componentDefinition) { 9795 return noSideEffects(() => { 9796 // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent. 9797 // See the `initNgDevMode` docstring for more information. 9798 (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode(); 9799 const type = componentDefinition.type; 9800 const typePrototype = type.prototype; 9801 const declaredInputs = {}; 9802 const def = { 9803 type: type, 9804 providersResolver: null, 9805 decls: componentDefinition.decls, 9806 vars: componentDefinition.vars, 9807 factory: null, 9808 template: componentDefinition.template || null, 9809 consts: componentDefinition.consts || null, 9810 ngContentSelectors: componentDefinition.ngContentSelectors, 9811 hostBindings: componentDefinition.hostBindings || null, 9812 hostVars: componentDefinition.hostVars || 0, 9813 hostAttrs: componentDefinition.hostAttrs || null, 9814 contentQueries: componentDefinition.contentQueries || null, 9815 declaredInputs: declaredInputs, 9816 inputs: null, 9817 outputs: null, 9818 exportAs: componentDefinition.exportAs || null, 9819 onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush, 9820 directiveDefs: null, 9821 pipeDefs: null, 9822 selectors: componentDefinition.selectors || EMPTY_ARRAY, 9823 viewQuery: componentDefinition.viewQuery || null, 9824 features: componentDefinition.features || null, 9825 data: componentDefinition.data || {}, 9826 // TODO(misko): convert ViewEncapsulation into const enum so that it can be used 9827 // directly in the next line. Also `None` should be 0 not 2. 9828 encapsulation: componentDefinition.encapsulation || ViewEncapsulation$1.Emulated, 9829 id: 'c', 9830 styles: componentDefinition.styles || EMPTY_ARRAY, 9831 _: null, 9832 setInput: null, 9833 schemas: componentDefinition.schemas || null, 9834 tView: null, 9835 }; 9836 const directiveTypes = componentDefinition.directives; 9837 const feature = componentDefinition.features; 9838 const pipeTypes = componentDefinition.pipes; 9839 def.id += _renderCompCount++; 9840 def.inputs = invertObject(componentDefinition.inputs, declaredInputs), 9841 def.outputs = invertObject(componentDefinition.outputs), 9842 feature && feature.forEach((fn) => fn(def)); 9843 def.directiveDefs = directiveTypes ? 9844 () => (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes) 9845 .map(extractDirectiveDef) : 9846 null; 9847 def.pipeDefs = pipeTypes ? 9848 () => (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef) : 9849 null; 9850 return def; 9851 }); 9852} 9853/** 9854 * @codeGenApi 9855 */ 9856function ɵɵsetComponentScope(type, directives, pipes) { 9857 const def = type.ɵcmp; 9858 def.directiveDefs = () => directives.map(extractDirectiveDef); 9859 def.pipeDefs = () => pipes.map(extractPipeDef); 9860} 9861function extractDirectiveDef(type) { 9862 const def = getComponentDef(type) || getDirectiveDef(type); 9863 if (ngDevMode && !def) { 9864 throw new Error(`'${type.name}' is neither 'ComponentType' or 'DirectiveType'.`); 9865 } 9866 return def; 9867} 9868function extractPipeDef(type) { 9869 const def = getPipeDef(type); 9870 if (ngDevMode && !def) { 9871 throw new Error(`'${type.name}' is not a 'PipeType'.`); 9872 } 9873 return def; 9874} 9875const autoRegisterModuleById = {}; 9876/** 9877 * @codeGenApi 9878 */ 9879function ɵɵdefineNgModule(def) { 9880 const res = { 9881 type: def.type, 9882 bootstrap: def.bootstrap || EMPTY_ARRAY, 9883 declarations: def.declarations || EMPTY_ARRAY, 9884 imports: def.imports || EMPTY_ARRAY, 9885 exports: def.exports || EMPTY_ARRAY, 9886 transitiveCompileScopes: null, 9887 schemas: def.schemas || null, 9888 id: def.id || null, 9889 }; 9890 if (def.id != null) { 9891 noSideEffects(() => { 9892 autoRegisterModuleById[def.id] = def.type; 9893 }); 9894 } 9895 return res; 9896} 9897/** 9898 * Adds the module metadata that is necessary to compute the module's transitive scope to an 9899 * existing module definition. 9900 * 9901 * Scope metadata of modules is not used in production builds, so calls to this function can be 9902 * marked pure to tree-shake it from the bundle, allowing for all referenced declarations 9903 * to become eligible for tree-shaking as well. 9904 * 9905 * @codeGenApi 9906 */ 9907function ɵɵsetNgModuleScope(type, scope) { 9908 return noSideEffects(() => { 9909 const ngModuleDef = getNgModuleDef(type, true); 9910 ngModuleDef.declarations = scope.declarations || EMPTY_ARRAY; 9911 ngModuleDef.imports = scope.imports || EMPTY_ARRAY; 9912 ngModuleDef.exports = scope.exports || EMPTY_ARRAY; 9913 }); 9914} 9915/** 9916 * Inverts an inputs or outputs lookup such that the keys, which were the 9917 * minified keys, are part of the values, and the values are parsed so that 9918 * the publicName of the property is the new key 9919 * 9920 * e.g. for 9921 * 9922 * ``` 9923 * class Comp { 9924 * @Input() 9925 * propName1: string; 9926 * 9927 * @Input('publicName2') 9928 * declaredPropName2: number; 9929 * } 9930 * ``` 9931 * 9932 * will be serialized as 9933 * 9934 * ``` 9935 * { 9936 * propName1: 'propName1', 9937 * declaredPropName2: ['publicName2', 'declaredPropName2'], 9938 * } 9939 * ``` 9940 * 9941 * which is than translated by the minifier as: 9942 * 9943 * ``` 9944 * { 9945 * minifiedPropName1: 'propName1', 9946 * minifiedPropName2: ['publicName2', 'declaredPropName2'], 9947 * } 9948 * ``` 9949 * 9950 * becomes: (public name => minifiedName) 9951 * 9952 * ``` 9953 * { 9954 * 'propName1': 'minifiedPropName1', 9955 * 'publicName2': 'minifiedPropName2', 9956 * } 9957 * ``` 9958 * 9959 * Optionally the function can take `secondary` which will result in: (public name => declared name) 9960 * 9961 * ``` 9962 * { 9963 * 'propName1': 'propName1', 9964 * 'publicName2': 'declaredPropName2', 9965 * } 9966 * ``` 9967 * 9968 9969 */ 9970function invertObject(obj, secondary) { 9971 if (obj == null) 9972 return EMPTY_OBJ; 9973 const newLookup = {}; 9974 for (const minifiedKey in obj) { 9975 if (obj.hasOwnProperty(minifiedKey)) { 9976 let publicName = obj[minifiedKey]; 9977 let declaredName = publicName; 9978 if (Array.isArray(publicName)) { 9979 declaredName = publicName[1]; 9980 publicName = publicName[0]; 9981 } 9982 newLookup[publicName] = minifiedKey; 9983 if (secondary) { 9984 (secondary[publicName] = declaredName); 9985 } 9986 } 9987 } 9988 return newLookup; 9989} 9990/** 9991 * Create a directive definition object. 9992 * 9993 * # Example 9994 * ```ts 9995 * class MyDirective { 9996 * // Generated by Angular Template Compiler 9997 * // [Symbol] syntax will not be supported by TypeScript until v2.7 9998 * static ɵdir = ɵɵdefineDirective({ 9999 * ... 10000 * }); 10001 * } 10002 * ``` 10003 * 10004 * @codeGenApi 10005 */ 10006const ɵɵdefineDirective = ɵɵdefineComponent; 10007/** 10008 * Create a pipe definition object. 10009 * 10010 * # Example 10011 * ``` 10012 * class MyPipe implements PipeTransform { 10013 * // Generated by Angular Template Compiler 10014 * static ɵpipe = definePipe({ 10015 * ... 10016 * }); 10017 * } 10018 * ``` 10019 * @param pipeDef Pipe definition generated by the compiler 10020 * 10021 * @codeGenApi 10022 */ 10023function ɵɵdefinePipe(pipeDef) { 10024 return { 10025 type: pipeDef.type, 10026 name: pipeDef.name, 10027 factory: null, 10028 pure: pipeDef.pure !== false, 10029 onDestroy: pipeDef.type.prototype.ngOnDestroy || null 10030 }; 10031} 10032/** 10033 * The following getter methods retrieve the definition form the type. Currently the retrieval 10034 * honors inheritance, but in the future we may change the rule to require that definitions are 10035 * explicit. This would require some sort of migration strategy. 10036 */ 10037function getComponentDef(type) { 10038 return type[NG_COMP_DEF] || null; 10039} 10040function getDirectiveDef(type) { 10041 return type[NG_DIR_DEF] || null; 10042} 10043function getPipeDef(type) { 10044 return type[NG_PIPE_DEF] || null; 10045} 10046function getFactoryDef(type, throwNotFound) { 10047 const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF); 10048 if (!hasFactoryDef && throwNotFound === true && ngDevMode) { 10049 throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`); 10050 } 10051 return hasFactoryDef ? type[NG_FACTORY_DEF] : null; 10052} 10053function getNgModuleDef(type, throwNotFound) { 10054 const ngModuleDef = type[NG_MOD_DEF] || null; 10055 if (!ngModuleDef && throwNotFound === true) { 10056 throw new Error(`Type ${stringify(type)} does not have 'ɵmod' property.`); 10057 } 10058 return ngModuleDef; 10059} 10060function getNgLocaleIdDef(type) { 10061 return type[NG_LOC_ID_DEF] || null; 10062} 10063 10064/** 10065 * @license 10066 * Copyright Google LLC All Rights Reserved. 10067 * 10068 * Use of this source code is governed by an MIT-style license that can be 10069 * found in the LICENSE file at https://angular.io/license 10070 */ 10071// Below are constants for LView indices to help us look up LView members 10072// without having to remember the specific indices. 10073// Uglify will inline these when minifying so there shouldn't be a cost. 10074const HOST = 0; 10075const TVIEW = 1; 10076const FLAGS = 2; 10077const PARENT = 3; 10078const NEXT = 4; 10079const TRANSPLANTED_VIEWS_TO_REFRESH = 5; 10080const T_HOST = 6; 10081const CLEANUP = 7; 10082const CONTEXT = 8; 10083const INJECTOR$1 = 9; 10084const RENDERER_FACTORY = 10; 10085const RENDERER = 11; 10086const SANITIZER = 12; 10087const CHILD_HEAD = 13; 10088const CHILD_TAIL = 14; 10089const DECLARATION_VIEW = 15; 10090const DECLARATION_COMPONENT_VIEW = 16; 10091const DECLARATION_LCONTAINER = 17; 10092const PREORDER_HOOK_FLAGS = 18; 10093const QUERIES = 19; 10094/** Size of LView's header. Necessary to adjust for it when setting slots. */ 10095const HEADER_OFFSET = 20; 10096// Note: This hack is necessary so we don't erroneously get a circular dependency 10097// failure based on types. 10098const unusedValueExportToPlacateAjd = 1; 10099 10100/** 10101 * @license 10102 * Copyright Google LLC All Rights Reserved. 10103 * 10104 * Use of this source code is governed by an MIT-style license that can be 10105 * found in the LICENSE file at https://angular.io/license 10106 */ 10107/** 10108 * Special location which allows easy identification of type. If we have an array which was 10109 * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is 10110 * `LContainer`. 10111 */ 10112const TYPE = 1; 10113/** 10114 * Below are constants for LContainer indices to help us look up LContainer members 10115 * without having to remember the specific indices. 10116 * Uglify will inline these when minifying so there shouldn't be a cost. 10117 */ 10118/** 10119 * Flag to signify that this `LContainer` may have transplanted views which need to be change 10120 * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`. 10121 * 10122 * This flag, once set, is never unset for the `LContainer`. This means that when unset we can skip 10123 * a lot of work in `refreshEmbeddedViews`. But when set we still need to verify 10124 * that the `MOVED_VIEWS` are transplanted and on-push. 10125 */ 10126const HAS_TRANSPLANTED_VIEWS = 2; 10127// PARENT, NEXT, TRANSPLANTED_VIEWS_TO_REFRESH are indices 3, 4, and 5 10128// As we already have these constants in LView, we don't need to re-create them. 10129// T_HOST is index 6 10130// We already have this constants in LView, we don't need to re-create it. 10131const NATIVE = 7; 10132const VIEW_REFS = 8; 10133const MOVED_VIEWS = 9; 10134/** 10135 * Size of LContainer's header. Represents the index after which all views in the 10136 * container will be inserted. We need to keep a record of current views so we know 10137 * which views are already in the DOM (and don't need to be re-added) and so we can 10138 * remove views from the DOM when they are no longer required. 10139 */ 10140const CONTAINER_HEADER_OFFSET = 10; 10141// Note: This hack is necessary so we don't erroneously get a circular dependency 10142// failure based on types. 10143const unusedValueExportToPlacateAjd$1 = 1; 10144 10145/** 10146 * @license 10147 * Copyright Google LLC All Rights Reserved. 10148 * 10149 * Use of this source code is governed by an MIT-style license that can be 10150 * found in the LICENSE file at https://angular.io/license 10151 */ 10152/** 10153 * True if `value` is `LView`. 10154 * @param value wrapped value of `RNode`, `LView`, `LContainer` 10155 */ 10156function isLView(value) { 10157 return Array.isArray(value) && typeof value[TYPE] === 'object'; 10158} 10159/** 10160 * True if `value` is `LContainer`. 10161 * @param value wrapped value of `RNode`, `LView`, `LContainer` 10162 */ 10163function isLContainer(value) { 10164 return Array.isArray(value) && value[TYPE] === true; 10165} 10166function isContentQueryHost(tNode) { 10167 return (tNode.flags & 8 /* hasContentQuery */) !== 0; 10168} 10169function isComponentHost(tNode) { 10170 return (tNode.flags & 2 /* isComponentHost */) === 2 /* isComponentHost */; 10171} 10172function isDirectiveHost(tNode) { 10173 return (tNode.flags & 1 /* isDirectiveHost */) === 1 /* isDirectiveHost */; 10174} 10175function isComponentDef(def) { 10176 return def.template !== null; 10177} 10178function isRootView(target) { 10179 return (target[FLAGS] & 512 /* IsRoot */) !== 0; 10180} 10181 10182/** 10183 * @license 10184 * Copyright Google LLC All Rights Reserved. 10185 * 10186 * Use of this source code is governed by an MIT-style license that can be 10187 * found in the LICENSE file at https://angular.io/license 10188 */ 10189// [Assert functions do not constraint type when they are guarded by a truthy 10190// expression.](https://github.com/microsoft/TypeScript/issues/37295) 10191function assertTNodeForLView(tNode, lView) { 10192 tNode.hasOwnProperty('tView_') && 10193 assertEqual(tNode.tView_, lView[TVIEW], 'This TNode does not belong to this LView.'); 10194} 10195function assertComponentType(actual, msg = 'Type passed in is not ComponentType, it does not have \'ɵcmp\' property.') { 10196 if (!getComponentDef(actual)) { 10197 throwError(msg); 10198 } 10199} 10200function assertNgModuleType(actual, msg = 'Type passed in is not NgModuleType, it does not have \'ɵmod\' property.') { 10201 if (!getNgModuleDef(actual)) { 10202 throwError(msg); 10203 } 10204} 10205function assertPreviousIsParent(isParent) { 10206 assertEqual(isParent, true, 'previousOrParentTNode should be a parent'); 10207} 10208function assertHasParent(tNode) { 10209 assertDefined(tNode, 'previousOrParentTNode should exist!'); 10210 assertDefined(tNode.parent, 'previousOrParentTNode should have a parent'); 10211} 10212function assertDataNext(lView, index, arr) { 10213 if (arr == null) 10214 arr = lView; 10215 assertEqual(arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`); 10216} 10217function assertLContainer(value) { 10218 assertDefined(value, 'LContainer must be defined'); 10219 assertEqual(isLContainer(value), true, 'Expecting LContainer'); 10220} 10221function assertLViewOrUndefined(value) { 10222 value && assertEqual(isLView(value), true, 'Expecting LView or undefined or null'); 10223} 10224function assertLView(value) { 10225 assertDefined(value, 'LView must be defined'); 10226 assertEqual(isLView(value), true, 'Expecting LView'); 10227} 10228function assertFirstCreatePass(tView, errMessage) { 10229 assertEqual(tView.firstCreatePass, true, errMessage || 'Should only be called in first create pass.'); 10230} 10231function assertFirstUpdatePass(tView, errMessage) { 10232 assertEqual(tView.firstUpdatePass, true, errMessage || 'Should only be called in first update pass.'); 10233} 10234/** 10235 * This is a basic sanity check that an object is probably a directive def. DirectiveDef is 10236 * an interface, so we can't do a direct instanceof check. 10237 */ 10238function assertDirectiveDef(obj) { 10239 if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) { 10240 throwError(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`); 10241 } 10242} 10243 10244/** 10245 * @license 10246 * Copyright Google LLC All Rights Reserved. 10247 * 10248 * Use of this source code is governed by an MIT-style license that can be 10249 * found in the LICENSE file at https://angular.io/license 10250 */ 10251/** 10252 * Represents a basic change from a previous to a new value for a single 10253 * property on a directive instance. Passed as a value in a 10254 * {@link SimpleChanges} object to the `ngOnChanges` hook. 10255 * 10256 * @see `OnChanges` 10257 * 10258 * @publicApi 10259 */ 10260class SimpleChange { 10261 constructor(previousValue, currentValue, firstChange) { 10262 this.previousValue = previousValue; 10263 this.currentValue = currentValue; 10264 this.firstChange = firstChange; 10265 } 10266 /** 10267 * Check whether the new value is the first value assigned. 10268 */ 10269 isFirstChange() { 10270 return this.firstChange; 10271 } 10272} 10273 10274/** 10275 * @license 10276 * Copyright Google LLC All Rights Reserved. 10277 * 10278 * Use of this source code is governed by an MIT-style license that can be 10279 * found in the LICENSE file at https://angular.io/license 10280 */ 10281/** 10282 * The NgOnChangesFeature decorates a component with support for the ngOnChanges 10283 * lifecycle hook, so it should be included in any component that implements 10284 * that hook. 10285 * 10286 * If the component or directive uses inheritance, the NgOnChangesFeature MUST 10287 * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise 10288 * inherited properties will not be propagated to the ngOnChanges lifecycle 10289 * hook. 10290 * 10291 * Example usage: 10292 * 10293 * ``` 10294 * static ɵcmp = defineComponent({ 10295 * ... 10296 * inputs: {name: 'publicName'}, 10297 * features: [NgOnChangesFeature] 10298 * }); 10299 * ``` 10300 * 10301 * @codeGenApi 10302 */ 10303function ɵɵNgOnChangesFeature() { 10304 return NgOnChangesFeatureImpl; 10305} 10306function NgOnChangesFeatureImpl(definition) { 10307 if (definition.type.prototype.ngOnChanges) { 10308 definition.setInput = ngOnChangesSetInput; 10309 } 10310 return rememberChangeHistoryAndInvokeOnChangesHook; 10311} 10312// This option ensures that the ngOnChanges lifecycle hook will be inherited 10313// from superclasses (in InheritDefinitionFeature). 10314/** @nocollapse */ 10315// tslint:disable-next-line:no-toplevel-property-access 10316ɵɵNgOnChangesFeature.ngInherit = true; 10317/** 10318 * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate 10319 * `ngOnChanges`. 10320 * 10321 * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are 10322 * found it invokes `ngOnChanges` on the component instance. 10323 * 10324 * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`, 10325 * it is guaranteed to be called with component instance. 10326 */ 10327function rememberChangeHistoryAndInvokeOnChangesHook() { 10328 const simpleChangesStore = getSimpleChangesStore(this); 10329 const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current; 10330 if (current) { 10331 const previous = simpleChangesStore.previous; 10332 if (previous === EMPTY_OBJ) { 10333 simpleChangesStore.previous = current; 10334 } 10335 else { 10336 // New changes are copied to the previous store, so that we don't lose history for inputs 10337 // which were not changed this time 10338 for (let key in current) { 10339 previous[key] = current[key]; 10340 } 10341 } 10342 simpleChangesStore.current = null; 10343 this.ngOnChanges(current); 10344 } 10345} 10346function ngOnChangesSetInput(instance, value, publicName, privateName) { 10347 const simpleChangesStore = getSimpleChangesStore(instance) || 10348 setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null }); 10349 const current = simpleChangesStore.current || (simpleChangesStore.current = {}); 10350 const previous = simpleChangesStore.previous; 10351 const declaredName = this.declaredInputs[publicName]; 10352 const previousChange = previous[declaredName]; 10353 current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ); 10354 instance[privateName] = value; 10355} 10356const SIMPLE_CHANGES_STORE = '__ngSimpleChanges__'; 10357function getSimpleChangesStore(instance) { 10358 return instance[SIMPLE_CHANGES_STORE] || null; 10359} 10360function setSimpleChangesStore(instance, store) { 10361 return instance[SIMPLE_CHANGES_STORE] = store; 10362} 10363 10364/** 10365 * @license 10366 * Copyright Google LLC All Rights Reserved. 10367 * 10368 * Use of this source code is governed by an MIT-style license that can be 10369 * found in the LICENSE file at https://angular.io/license 10370 */ 10371const SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; 10372const MATH_ML_NAMESPACE = 'http://www.w3.org/1998/MathML/'; 10373 10374/** 10375 * @license 10376 * Copyright Google LLC All Rights Reserved. 10377 * 10378 * Use of this source code is governed by an MIT-style license that can be 10379 * found in the LICENSE file at https://angular.io/license 10380 */ 10381/** 10382 * This property will be monkey-patched on elements, components and directives 10383 */ 10384const MONKEY_PATCH_KEY_NAME = '__ngContext__'; 10385 10386/** 10387 * @license 10388 * Copyright Google LLC All Rights Reserved. 10389 * 10390 * Use of this source code is governed by an MIT-style license that can be 10391 * found in the LICENSE file at https://angular.io/license 10392 */ 10393/** 10394 * Most of the use of `document` in Angular is from within the DI system so it is possible to simply 10395 * inject the `DOCUMENT` token and are done. 10396 * 10397 * Ivy is special because it does not rely upon the DI and must get hold of the document some other 10398 * way. 10399 * 10400 * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy. 10401 * Wherever ivy needs the global document, it calls `getDocument()` instead. 10402 * 10403 * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to 10404 * tell ivy what the global `document` is. 10405 * 10406 * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`) 10407 * by calling `setDocument()` when providing the `DOCUMENT` token. 10408 */ 10409let DOCUMENT = undefined; 10410/** 10411 * Tell ivy what the `document` is for this platform. 10412 * 10413 * It is only necessary to call this if the current platform is not a browser. 10414 * 10415 * @param document The object representing the global `document` in this environment. 10416 */ 10417function setDocument(document) { 10418 DOCUMENT = document; 10419} 10420/** 10421 * Access the object that represents the `document` for this platform. 10422 * 10423 * Ivy calls this whenever it needs to access the `document` object. 10424 * For example to create the renderer or to do sanitization. 10425 */ 10426function getDocument() { 10427 if (DOCUMENT !== undefined) { 10428 return DOCUMENT; 10429 } 10430 else if (typeof document !== 'undefined') { 10431 return document; 10432 } 10433 // No "document" can be found. This should only happen if we are running ivy outside Angular and 10434 // the current platform is not a browser. Since this is not a supported scenario at the moment 10435 // this should not happen in Angular apps. 10436 // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a 10437 // public API. Meanwhile we just return `undefined` and let the application fail. 10438 return undefined; 10439} 10440 10441/** 10442 * @license 10443 * Copyright Google LLC All Rights Reserved. 10444 * 10445 * Use of this source code is governed by an MIT-style license that can be 10446 * found in the LICENSE file at https://angular.io/license 10447 */ 10448// TODO: cleanup once the code is merged in angular/angular 10449var RendererStyleFlags3; 10450(function (RendererStyleFlags3) { 10451 RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important"; 10452 RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase"; 10453})(RendererStyleFlags3 || (RendererStyleFlags3 = {})); 10454/** Returns whether the `renderer` is a `ProceduralRenderer3` */ 10455function isProceduralRenderer(renderer) { 10456 return !!(renderer.listen); 10457} 10458const ɵ0$2 = (hostElement, rendererType) => { 10459 return getDocument(); 10460}; 10461const domRendererFactory3 = { 10462 createRenderer: ɵ0$2 10463}; 10464// Note: This hack is necessary so we don't erroneously get a circular dependency 10465// failure based on types. 10466const unusedValueExportToPlacateAjd$2 = 1; 10467 10468/** 10469 * @license 10470 * Copyright Google LLC All Rights Reserved. 10471 * 10472 * Use of this source code is governed by an MIT-style license that can be 10473 * found in the LICENSE file at https://angular.io/license 10474 */ 10475/** 10476 * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`) 10477 * in same location in `LView`. This is because we don't want to pre-allocate space for it 10478 * because the storage is sparse. This file contains utilities for dealing with such data types. 10479 * 10480 * How do we know what is stored at a given location in `LView`. 10481 * - `Array.isArray(value) === false` => `RNode` (The normal storage value) 10482 * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value. 10483 * - `typeof value[TYPE] === 'object'` => `LView` 10484 * - This happens when we have a component at a given location 10485 * - `typeof value[TYPE] === true` => `LContainer` 10486 * - This happens when we have `LContainer` binding at a given location. 10487 * 10488 * 10489 * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient. 10490 */ 10491/** 10492 * Returns `RNode`. 10493 * @param value wrapped value of `RNode`, `LView`, `LContainer` 10494 */ 10495function unwrapRNode(value) { 10496 while (Array.isArray(value)) { 10497 value = value[HOST]; 10498 } 10499 return value; 10500} 10501/** 10502 * Returns `LView` or `null` if not found. 10503 * @param value wrapped value of `RNode`, `LView`, `LContainer` 10504 */ 10505function unwrapLView(value) { 10506 while (Array.isArray(value)) { 10507 // This check is same as `isLView()` but we don't call at as we don't want to call 10508 // `Array.isArray()` twice and give JITer more work for inlining. 10509 if (typeof value[TYPE] === 'object') 10510 return value; 10511 value = value[HOST]; 10512 } 10513 return null; 10514} 10515/** 10516 * Returns `LContainer` or `null` if not found. 10517 * @param value wrapped value of `RNode`, `LView`, `LContainer` 10518 */ 10519function unwrapLContainer(value) { 10520 while (Array.isArray(value)) { 10521 // This check is same as `isLContainer()` but we don't call at as we don't want to call 10522 // `Array.isArray()` twice and give JITer more work for inlining. 10523 if (value[TYPE] === true) 10524 return value; 10525 value = value[HOST]; 10526 } 10527 return null; 10528} 10529/** 10530 * Retrieves an element value from the provided `viewData`, by unwrapping 10531 * from any containers, component views, or style contexts. 10532 */ 10533function getNativeByIndex(index, lView) { 10534 return unwrapRNode(lView[index + HEADER_OFFSET]); 10535} 10536/** 10537 * Retrieve an `RNode` for a given `TNode` and `LView`. 10538 * 10539 * This function guarantees in dev mode to retrieve a non-null `RNode`. 10540 * 10541 * @param tNode 10542 * @param lView 10543 */ 10544function getNativeByTNode(tNode, lView) { 10545 ngDevMode && assertTNodeForLView(tNode, lView); 10546 ngDevMode && assertIndexInRange(lView, tNode.index); 10547 const node = unwrapRNode(lView[tNode.index]); 10548 ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node); 10549 return node; 10550} 10551/** 10552 * Retrieve an `RNode` or `null` for a given `TNode` and `LView`. 10553 * 10554 * Some `TNode`s don't have associated `RNode`s. For example `Projection` 10555 * 10556 * @param tNode 10557 * @param lView 10558 */ 10559function getNativeByTNodeOrNull(tNode, lView) { 10560 const index = tNode.index; 10561 if (index !== -1) { 10562 ngDevMode && assertTNodeForLView(tNode, lView); 10563 const node = unwrapRNode(lView[index]); 10564 ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node); 10565 return node; 10566 } 10567 return null; 10568} 10569function getTNode(tView, index) { 10570 ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode'); 10571 ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode'); 10572 return tView.data[index + HEADER_OFFSET]; 10573} 10574/** Retrieves a value from any `LView` or `TData`. */ 10575function load(view, index) { 10576 ngDevMode && assertIndexInRange(view, index + HEADER_OFFSET); 10577 return view[index + HEADER_OFFSET]; 10578} 10579function getComponentLViewByIndex(nodeIndex, hostView) { 10580 // Could be an LView or an LContainer. If LContainer, unwrap to find LView. 10581 ngDevMode && assertIndexInRange(hostView, nodeIndex); 10582 const slotValue = hostView[nodeIndex]; 10583 const lView = isLView(slotValue) ? slotValue : slotValue[HOST]; 10584 return lView; 10585} 10586/** 10587 * Returns the monkey-patch value data present on the target (which could be 10588 * a component, directive or a DOM node). 10589 */ 10590function readPatchedData(target) { 10591 ngDevMode && assertDefined(target, 'Target expected'); 10592 return target[MONKEY_PATCH_KEY_NAME] || null; 10593} 10594function readPatchedLView(target) { 10595 const value = readPatchedData(target); 10596 if (value) { 10597 return Array.isArray(value) ? value : value.lView; 10598 } 10599 return null; 10600} 10601/** Checks whether a given view is in creation mode */ 10602function isCreationMode(view) { 10603 return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */; 10604} 10605/** 10606 * Returns a boolean for whether the view is attached to the change detection tree. 10607 * 10608 * Note: This determines whether a view should be checked, not whether it's inserted 10609 * into a container. For that, you'll want `viewAttachedToContainer` below. 10610 */ 10611function viewAttachedToChangeDetector(view) { 10612 return (view[FLAGS] & 128 /* Attached */) === 128 /* Attached */; 10613} 10614/** Returns a boolean for whether the view is attached to a container. */ 10615function viewAttachedToContainer(view) { 10616 return isLContainer(view[PARENT]); 10617} 10618/** Returns a constant from `TConstants` instance. */ 10619function getConstant(consts, index) { 10620 return consts === null || index == null ? null : consts[index]; 10621} 10622/** 10623 * Resets the pre-order hook flags of the view. 10624 * @param lView the LView on which the flags are reset 10625 */ 10626function resetPreOrderHookFlags(lView) { 10627 lView[PREORDER_HOOK_FLAGS] = 0; 10628} 10629/** 10630 * Updates the `TRANSPLANTED_VIEWS_TO_REFRESH` counter on the `LContainer` as well as the parents 10631 * whose 10632 * 1. counter goes from 0 to 1, indicating that there is a new child that has a view to refresh 10633 * or 10634 * 2. counter goes from 1 to 0, indicating there are no more descendant views to refresh 10635 */ 10636function updateTransplantedViewCount(lContainer, amount) { 10637 lContainer[TRANSPLANTED_VIEWS_TO_REFRESH] += amount; 10638 let viewOrContainer = lContainer; 10639 let parent = lContainer[PARENT]; 10640 while (parent !== null && 10641 ((amount === 1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 1) || 10642 (amount === -1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 0))) { 10643 parent[TRANSPLANTED_VIEWS_TO_REFRESH] += amount; 10644 viewOrContainer = parent; 10645 parent = parent[PARENT]; 10646 } 10647} 10648 10649/** 10650 * @license 10651 * Copyright Google LLC All Rights Reserved. 10652 * 10653 * Use of this source code is governed by an MIT-style license that can be 10654 * found in the LICENSE file at https://angular.io/license 10655 */ 10656const instructionState = { 10657 lFrame: createLFrame(null), 10658 bindingsEnabled: true, 10659 checkNoChangesMode: false, 10660}; 10661function getElementDepthCount() { 10662 return instructionState.lFrame.elementDepthCount; 10663} 10664function increaseElementDepthCount() { 10665 instructionState.lFrame.elementDepthCount++; 10666} 10667function decreaseElementDepthCount() { 10668 instructionState.lFrame.elementDepthCount--; 10669} 10670function getBindingsEnabled() { 10671 return instructionState.bindingsEnabled; 10672} 10673/** 10674 * Enables directive matching on elements. 10675 * 10676 * * Example: 10677 * ``` 10678 * <my-comp my-directive> 10679 * Should match component / directive. 10680 * </my-comp> 10681 * <div ngNonBindable> 10682 * <!-- ɵɵdisableBindings() --> 10683 * <my-comp my-directive> 10684 * Should not match component / directive because we are in ngNonBindable. 10685 * </my-comp> 10686 * <!-- ɵɵenableBindings() --> 10687 * </div> 10688 * ``` 10689 * 10690 * @codeGenApi 10691 */ 10692function ɵɵenableBindings() { 10693 instructionState.bindingsEnabled = true; 10694} 10695/** 10696 * Disables directive matching on element. 10697 * 10698 * * Example: 10699 * ``` 10700 * <my-comp my-directive> 10701 * Should match component / directive. 10702 * </my-comp> 10703 * <div ngNonBindable> 10704 * <!-- ɵɵdisableBindings() --> 10705 * <my-comp my-directive> 10706 * Should not match component / directive because we are in ngNonBindable. 10707 * </my-comp> 10708 * <!-- ɵɵenableBindings() --> 10709 * </div> 10710 * ``` 10711 * 10712 * @codeGenApi 10713 */ 10714function ɵɵdisableBindings() { 10715 instructionState.bindingsEnabled = false; 10716} 10717/** 10718 * Return the current `LView`. 10719 */ 10720function getLView() { 10721 return instructionState.lFrame.lView; 10722} 10723/** 10724 * Return the current `TView`. 10725 */ 10726function getTView() { 10727 return instructionState.lFrame.tView; 10728} 10729/** 10730 * Restores `contextViewData` to the given OpaqueViewState instance. 10731 * 10732 * Used in conjunction with the getCurrentView() instruction to save a snapshot 10733 * of the current view and restore it when listeners are invoked. This allows 10734 * walking the declaration view tree in listeners to get vars from parent views. 10735 * 10736 * @param viewToRestore The OpaqueViewState instance to restore. 10737 * 10738 * @codeGenApi 10739 */ 10740function ɵɵrestoreView(viewToRestore) { 10741 instructionState.lFrame.contextLView = viewToRestore; 10742} 10743function getPreviousOrParentTNode() { 10744 return instructionState.lFrame.previousOrParentTNode; 10745} 10746function setPreviousOrParentTNode(tNode, isParent) { 10747 instructionState.lFrame.previousOrParentTNode = tNode; 10748 instructionState.lFrame.isParent = isParent; 10749} 10750function getIsParent() { 10751 return instructionState.lFrame.isParent; 10752} 10753function setIsNotParent() { 10754 instructionState.lFrame.isParent = false; 10755} 10756function setIsParent() { 10757 instructionState.lFrame.isParent = true; 10758} 10759function getContextLView() { 10760 return instructionState.lFrame.contextLView; 10761} 10762function getCheckNoChangesMode() { 10763 // TODO(misko): remove this from the LView since it is ngDevMode=true mode only. 10764 return instructionState.checkNoChangesMode; 10765} 10766function setCheckNoChangesMode(mode) { 10767 instructionState.checkNoChangesMode = mode; 10768} 10769// top level variables should not be exported for performance reasons (PERF_NOTES.md) 10770function getBindingRoot() { 10771 const lFrame = instructionState.lFrame; 10772 let index = lFrame.bindingRootIndex; 10773 if (index === -1) { 10774 index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex; 10775 } 10776 return index; 10777} 10778function getBindingIndex() { 10779 return instructionState.lFrame.bindingIndex; 10780} 10781function setBindingIndex(value) { 10782 return instructionState.lFrame.bindingIndex = value; 10783} 10784function nextBindingIndex() { 10785 return instructionState.lFrame.bindingIndex++; 10786} 10787function incrementBindingIndex(count) { 10788 const lFrame = instructionState.lFrame; 10789 const index = lFrame.bindingIndex; 10790 lFrame.bindingIndex = lFrame.bindingIndex + count; 10791 return index; 10792} 10793/** 10794 * Set a new binding root index so that host template functions can execute. 10795 * 10796 * Bindings inside the host template are 0 index. But because we don't know ahead of time 10797 * how many host bindings we have we can't pre-compute them. For this reason they are all 10798 * 0 index and we just shift the root so that they match next available location in the LView. 10799 * 10800 * @param bindingRootIndex Root index for `hostBindings` 10801 * @param currentDirectiveIndex `TData[currentDirectiveIndex]` will point to the current directive 10802 * whose `hostBindings` are being processed. 10803 */ 10804function setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) { 10805 const lFrame = instructionState.lFrame; 10806 lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex; 10807 setCurrentDirectiveIndex(currentDirectiveIndex); 10808} 10809/** 10810 * When host binding is executing this points to the directive index. 10811 * `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef` 10812 * `LView[getCurrentDirectiveIndex()]` is directive instance. 10813 */ 10814function getCurrentDirectiveIndex() { 10815 return instructionState.lFrame.currentDirectiveIndex; 10816} 10817/** 10818 * Sets an index of a directive whose `hostBindings` are being processed. 10819 * 10820 * @param currentDirectiveIndex `TData` index where current directive instance can be found. 10821 */ 10822function setCurrentDirectiveIndex(currentDirectiveIndex) { 10823 instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex; 10824} 10825/** 10826 * Retrieve the current `DirectiveDef` which is active when `hostBindings` instruction is being 10827 * executed. 10828 * 10829 * @param tData Current `TData` where the `DirectiveDef` will be looked up at. 10830 */ 10831function getCurrentDirectiveDef(tData) { 10832 const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex; 10833 return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex]; 10834} 10835function getCurrentQueryIndex() { 10836 return instructionState.lFrame.currentQueryIndex; 10837} 10838function setCurrentQueryIndex(value) { 10839 instructionState.lFrame.currentQueryIndex = value; 10840} 10841/** 10842 * This is a light weight version of the `enterView` which is needed by the DI system. 10843 * @param newView 10844 * @param tNode 10845 */ 10846function enterDI(newView, tNode) { 10847 ngDevMode && assertLViewOrUndefined(newView); 10848 const newLFrame = allocLFrame(); 10849 instructionState.lFrame = newLFrame; 10850 newLFrame.previousOrParentTNode = tNode; 10851 newLFrame.lView = newView; 10852} 10853/** 10854 * Swap the current lView with a new lView. 10855 * 10856 * For performance reasons we store the lView in the top level of the module. 10857 * This way we minimize the number of properties to read. Whenever a new view 10858 * is entered we have to store the lView for later, and when the view is 10859 * exited the state has to be restored 10860 * 10861 * @param newView New lView to become active 10862 * @param tNode Element to which the View is a child of 10863 * @returns the previously active lView; 10864 */ 10865function enterView(newView, tNode) { 10866 ngDevMode && assertLViewOrUndefined(newView); 10867 const newLFrame = allocLFrame(); 10868 if (ngDevMode) { 10869 assertEqual(newLFrame.isParent, true, 'Expected clean LFrame'); 10870 assertEqual(newLFrame.lView, null, 'Expected clean LFrame'); 10871 assertEqual(newLFrame.tView, null, 'Expected clean LFrame'); 10872 assertEqual(newLFrame.selectedIndex, 0, 'Expected clean LFrame'); 10873 assertEqual(newLFrame.elementDepthCount, 0, 'Expected clean LFrame'); 10874 assertEqual(newLFrame.currentDirectiveIndex, -1, 'Expected clean LFrame'); 10875 assertEqual(newLFrame.currentNamespace, null, 'Expected clean LFrame'); 10876 assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame'); 10877 assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame'); 10878 } 10879 const tView = newView[TVIEW]; 10880 instructionState.lFrame = newLFrame; 10881 newLFrame.previousOrParentTNode = tNode; 10882 newLFrame.lView = newView; 10883 newLFrame.tView = tView; 10884 newLFrame.contextLView = newView; 10885 newLFrame.bindingIndex = tView.bindingStartIndex; 10886} 10887/** 10888 * Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure. 10889 */ 10890function allocLFrame() { 10891 const currentLFrame = instructionState.lFrame; 10892 const childLFrame = currentLFrame === null ? null : currentLFrame.child; 10893 const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame; 10894 return newLFrame; 10895} 10896function createLFrame(parent) { 10897 const lFrame = { 10898 previousOrParentTNode: null, 10899 isParent: true, 10900 lView: null, 10901 tView: null, 10902 selectedIndex: 0, 10903 contextLView: null, 10904 elementDepthCount: 0, 10905 currentNamespace: null, 10906 currentDirectiveIndex: -1, 10907 bindingRootIndex: -1, 10908 bindingIndex: -1, 10909 currentQueryIndex: 0, 10910 parent: parent, 10911 child: null, 10912 }; 10913 parent !== null && (parent.child = lFrame); // link the new LFrame for reuse. 10914 return lFrame; 10915} 10916/** 10917 * A lightweight version of leave which is used with DI. 10918 * 10919 * This function only resets `previousOrParentTNode` and `LView` as those are the only properties 10920 * used with DI (`enterDI()`). 10921 * 10922 * NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where 10923 * as `leaveViewLight` has `LFrame`. This is so that `leaveViewLight` can be used in `leaveView`. 10924 */ 10925function leaveViewLight() { 10926 const oldLFrame = instructionState.lFrame; 10927 instructionState.lFrame = oldLFrame.parent; 10928 oldLFrame.previousOrParentTNode = null; 10929 oldLFrame.lView = null; 10930 return oldLFrame; 10931} 10932/** 10933 * This is a lightweight version of the `leaveView` which is needed by the DI system. 10934 * 10935 * NOTE: this function is an alias so that we can change the type of the function to have `void` 10936 * return type. 10937 */ 10938const leaveDI = leaveViewLight; 10939/** 10940 * Leave the current `LView` 10941 * 10942 * This pops the `LFrame` with the associated `LView` from the stack. 10943 * 10944 * IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is 10945 * because for performance reasons we don't release `LFrame` but rather keep it for next use. 10946 */ 10947function leaveView() { 10948 const oldLFrame = leaveViewLight(); 10949 oldLFrame.isParent = true; 10950 oldLFrame.tView = null; 10951 oldLFrame.selectedIndex = 0; 10952 oldLFrame.contextLView = null; 10953 oldLFrame.elementDepthCount = 0; 10954 oldLFrame.currentDirectiveIndex = -1; 10955 oldLFrame.currentNamespace = null; 10956 oldLFrame.bindingRootIndex = -1; 10957 oldLFrame.bindingIndex = -1; 10958 oldLFrame.currentQueryIndex = 0; 10959} 10960function nextContextImpl(level) { 10961 const contextLView = instructionState.lFrame.contextLView = 10962 walkUpViews(level, instructionState.lFrame.contextLView); 10963 return contextLView[CONTEXT]; 10964} 10965function walkUpViews(nestingLevel, currentView) { 10966 while (nestingLevel > 0) { 10967 ngDevMode && 10968 assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.'); 10969 currentView = currentView[DECLARATION_VIEW]; 10970 nestingLevel--; 10971 } 10972 return currentView; 10973} 10974/** 10975 * Gets the currently selected element index. 10976 * 10977 * Used with {@link property} instruction (and more in the future) to identify the index in the 10978 * current `LView` to act on. 10979 */ 10980function getSelectedIndex() { 10981 return instructionState.lFrame.selectedIndex; 10982} 10983/** 10984 * Sets the most recent index passed to {@link select} 10985 * 10986 * Used with {@link property} instruction (and more in the future) to identify the index in the 10987 * current `LView` to act on. 10988 * 10989 * (Note that if an "exit function" was set earlier (via `setElementExitFn()`) then that will be 10990 * run if and when the provided `index` value is different from the current selected index value.) 10991 */ 10992function setSelectedIndex(index) { 10993 instructionState.lFrame.selectedIndex = index; 10994} 10995/** 10996 * Gets the `tNode` that represents currently selected element. 10997 */ 10998function getSelectedTNode() { 10999 const lFrame = instructionState.lFrame; 11000 return getTNode(lFrame.tView, lFrame.selectedIndex); 11001} 11002/** 11003 * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state. 11004 * 11005 * @codeGenApi 11006 */ 11007function ɵɵnamespaceSVG() { 11008 instructionState.lFrame.currentNamespace = SVG_NAMESPACE; 11009} 11010/** 11011 * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state. 11012 * 11013 * @codeGenApi 11014 */ 11015function ɵɵnamespaceMathML() { 11016 instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE; 11017} 11018/** 11019 * Sets the namespace used to create elements to `null`, which forces element creation to use 11020 * `createElement` rather than `createElementNS`. 11021 * 11022 * @codeGenApi 11023 */ 11024function ɵɵnamespaceHTML() { 11025 namespaceHTMLInternal(); 11026} 11027/** 11028 * Sets the namespace used to create elements to `null`, which forces element creation to use 11029 * `createElement` rather than `createElementNS`. 11030 */ 11031function namespaceHTMLInternal() { 11032 instructionState.lFrame.currentNamespace = null; 11033} 11034function getNamespace() { 11035 return instructionState.lFrame.currentNamespace; 11036} 11037 11038/** 11039 * @license 11040 * Copyright Google LLC All Rights Reserved. 11041 * 11042 * Use of this source code is governed by an MIT-style license that can be 11043 * found in the LICENSE file at https://angular.io/license 11044 */ 11045/** 11046 * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`. 11047 * 11048 * Must be run *only* on the first template pass. 11049 * 11050 * Sets up the pre-order hooks on the provided `tView`, 11051 * see {@link HookData} for details about the data structure. 11052 * 11053 * @param directiveIndex The index of the directive in LView 11054 * @param directiveDef The definition containing the hooks to setup in tView 11055 * @param tView The current TView 11056 */ 11057function registerPreOrderHooks(directiveIndex, directiveDef, tView) { 11058 ngDevMode && assertFirstCreatePass(tView); 11059 const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype; 11060 if (ngOnChanges) { 11061 const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef); 11062 (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges); 11063 (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])) 11064 .push(directiveIndex, wrappedOnChanges); 11065 } 11066 if (ngOnInit) { 11067 (tView.preOrderHooks || (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit); 11068 } 11069 if (ngDoCheck) { 11070 (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck); 11071 (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck); 11072 } 11073} 11074/** 11075 * 11076 * Loops through the directives on the provided `tNode` and queues hooks to be 11077 * run that are not initialization hooks. 11078 * 11079 * Should be executed during `elementEnd()` and similar to 11080 * preserve hook execution order. Content, view, and destroy hooks for projected 11081 * components and directives must be called *before* their hosts. 11082 * 11083 * Sets up the content, view, and destroy hooks on the provided `tView`, 11084 * see {@link HookData} for details about the data structure. 11085 * 11086 * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up 11087 * separately at `elementStart`. 11088 * 11089 * @param tView The current TView 11090 * @param tNode The TNode whose directives are to be searched for hooks to queue 11091 */ 11092function registerPostOrderHooks(tView, tNode) { 11093 ngDevMode && assertFirstCreatePass(tView); 11094 // It's necessary to loop through the directives at elementEnd() (rather than processing in 11095 // directiveCreate) so we can preserve the current hook order. Content, view, and destroy 11096 // hooks for projected components and directives must be called *before* their hosts. 11097 for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) { 11098 const directiveDef = tView.data[i]; 11099 const lifecycleHooks = directiveDef.type.prototype; 11100 const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy } = lifecycleHooks; 11101 if (ngAfterContentInit) { 11102 (tView.contentHooks || (tView.contentHooks = [])).push(-i, ngAfterContentInit); 11103 } 11104 if (ngAfterContentChecked) { 11105 (tView.contentHooks || (tView.contentHooks = [])).push(i, ngAfterContentChecked); 11106 (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked); 11107 } 11108 if (ngAfterViewInit) { 11109 (tView.viewHooks || (tView.viewHooks = [])).push(-i, ngAfterViewInit); 11110 } 11111 if (ngAfterViewChecked) { 11112 (tView.viewHooks || (tView.viewHooks = [])).push(i, ngAfterViewChecked); 11113 (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked); 11114 } 11115 if (ngOnDestroy != null) { 11116 (tView.destroyHooks || (tView.destroyHooks = [])).push(i, ngOnDestroy); 11117 } 11118 } 11119} 11120/** 11121 * Executing hooks requires complex logic as we need to deal with 2 constraints. 11122 * 11123 * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only 11124 * once, across many change detection cycles. This must be true even if some hooks throw, or if 11125 * some recursively trigger a change detection cycle. 11126 * To solve that, it is required to track the state of the execution of these init hooks. 11127 * This is done by storing and maintaining flags in the view: the {@link InitPhaseState}, 11128 * and the index within that phase. They can be seen as a cursor in the following structure: 11129 * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]] 11130 * They are are stored as flags in LView[FLAGS]. 11131 * 11132 * 2. Pre-order hooks can be executed in batches, because of the select instruction. 11133 * To be able to pause and resume their execution, we also need some state about the hook's array 11134 * that is being processed: 11135 * - the index of the next hook to be executed 11136 * - the number of init hooks already found in the processed part of the array 11137 * They are are stored as flags in LView[PREORDER_HOOK_FLAGS]. 11138 */ 11139/** 11140 * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were 11141 * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read 11142 * / write of the init-hooks related flags. 11143 * @param lView The LView where hooks are defined 11144 * @param hooks Hooks to be run 11145 * @param nodeIndex 3 cases depending on the value: 11146 * - undefined: all hooks from the array should be executed (post-order case) 11147 * - null: execute hooks only from the saved index until the end of the array (pre-order case, when 11148 * flushing the remaining hooks) 11149 * - number: execute hooks only from the saved index until that node index exclusive (pre-order 11150 * case, when executing select(number)) 11151 */ 11152function executeCheckHooks(lView, hooks, nodeIndex) { 11153 callHooks(lView, hooks, 3 /* InitPhaseCompleted */, nodeIndex); 11154} 11155/** 11156 * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked, 11157 * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed. 11158 * @param lView The LView where hooks are defined 11159 * @param hooks Hooks to be run 11160 * @param initPhase A phase for which hooks should be run 11161 * @param nodeIndex 3 cases depending on the value: 11162 * - undefined: all hooks from the array should be executed (post-order case) 11163 * - null: execute hooks only from the saved index until the end of the array (pre-order case, when 11164 * flushing the remaining hooks) 11165 * - number: execute hooks only from the saved index until that node index exclusive (pre-order 11166 * case, when executing select(number)) 11167 */ 11168function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) { 11169 ngDevMode && 11170 assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once'); 11171 if ((lView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) { 11172 callHooks(lView, hooks, initPhase, nodeIndex); 11173 } 11174} 11175function incrementInitPhaseFlags(lView, initPhase) { 11176 ngDevMode && 11177 assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.'); 11178 let flags = lView[FLAGS]; 11179 if ((flags & 3 /* InitPhaseStateMask */) === initPhase) { 11180 flags &= 2047 /* IndexWithinInitPhaseReset */; 11181 flags += 1 /* InitPhaseStateIncrementer */; 11182 lView[FLAGS] = flags; 11183 } 11184} 11185/** 11186 * Calls lifecycle hooks with their contexts, skipping init hooks if it's not 11187 * the first LView pass 11188 * 11189 * @param currentView The current view 11190 * @param arr The array in which the hooks are found 11191 * @param initPhaseState the current state of the init phase 11192 * @param currentNodeIndex 3 cases depending on the value: 11193 * - undefined: all hooks from the array should be executed (post-order case) 11194 * - null: execute hooks only from the saved index until the end of the array (pre-order case, when 11195 * flushing the remaining hooks) 11196 * - number: execute hooks only from the saved index until that node index exclusive (pre-order 11197 * case, when executing select(number)) 11198 */ 11199function callHooks(currentView, arr, initPhase, currentNodeIndex) { 11200 ngDevMode && 11201 assertEqual(getCheckNoChangesMode(), false, 'Hooks should never be run in the check no changes mode.'); 11202 const startIndex = currentNodeIndex !== undefined ? 11203 (currentView[PREORDER_HOOK_FLAGS] & 65535 /* IndexOfTheNextPreOrderHookMaskMask */) : 11204 0; 11205 const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1; 11206 let lastNodeIndexFound = 0; 11207 for (let i = startIndex; i < arr.length; i++) { 11208 const hook = arr[i + 1]; 11209 if (typeof hook === 'number') { 11210 lastNodeIndexFound = arr[i]; 11211 if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) { 11212 break; 11213 } 11214 } 11215 else { 11216 const isInitHook = arr[i] < 0; 11217 if (isInitHook) 11218 currentView[PREORDER_HOOK_FLAGS] += 65536 /* NumberOfInitHooksCalledIncrementer */; 11219 if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) { 11220 callHook(currentView, initPhase, arr, i); 11221 currentView[PREORDER_HOOK_FLAGS] = 11222 (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* NumberOfInitHooksCalledMask */) + i + 11223 2; 11224 } 11225 i++; 11226 } 11227 } 11228} 11229/** 11230 * Execute one hook against the current `LView`. 11231 * 11232 * @param currentView The current view 11233 * @param initPhaseState the current state of the init phase 11234 * @param arr The array in which the hooks are found 11235 * @param i The current index within the hook data array 11236 */ 11237function callHook(currentView, initPhase, arr, i) { 11238 const isInitHook = arr[i] < 0; 11239 const hook = arr[i + 1]; 11240 const directiveIndex = isInitHook ? -arr[i] : arr[i]; 11241 const directive = currentView[directiveIndex]; 11242 if (isInitHook) { 11243 const indexWithintInitPhase = currentView[FLAGS] >> 11 /* IndexWithinInitPhaseShift */; 11244 // The init phase state must be always checked here as it may have been recursively 11245 // updated 11246 if (indexWithintInitPhase < 11247 (currentView[PREORDER_HOOK_FLAGS] >> 16 /* NumberOfInitHooksCalledShift */) && 11248 (currentView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) { 11249 currentView[FLAGS] += 2048 /* IndexWithinInitPhaseIncrementer */; 11250 hook.call(directive); 11251 } 11252 } 11253 else { 11254 hook.call(directive); 11255 } 11256} 11257 11258/** 11259 * @license 11260 * Copyright Google LLC All Rights Reserved. 11261 * 11262 * Use of this source code is governed by an MIT-style license that can be 11263 * found in the LICENSE file at https://angular.io/license 11264 */ 11265const TNODE = 8; 11266const PARENT_INJECTOR = 8; 11267const INJECTOR_BLOOM_PARENT_SIZE = 9; 11268const NO_PARENT_INJECTOR = -1; 11269/** 11270 * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in 11271 * `TView.data`. This allows us to store information about the current node's tokens (which 11272 * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be 11273 * shared, so they live in `LView`). 11274 * 11275 * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter 11276 * determines whether a directive is available on the associated node or not. This prevents us 11277 * from searching the directives array at this level unless it's probable the directive is in it. 11278 * 11279 * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters. 11280 * 11281 * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed 11282 * using interfaces as they were previously. The start index of each `LInjector` and `TInjector` 11283 * will differ based on where it is flattened into the main array, so it's not possible to know 11284 * the indices ahead of time and save their types here. The interfaces are still included here 11285 * for documentation purposes. 11286 * 11287 * export interface LInjector extends Array<any> { 11288 * 11289 * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE) 11290 * [0]: number; 11291 * 11292 * // Cumulative bloom for directive IDs 32-63 11293 * [1]: number; 11294 * 11295 * // Cumulative bloom for directive IDs 64-95 11296 * [2]: number; 11297 * 11298 * // Cumulative bloom for directive IDs 96-127 11299 * [3]: number; 11300 * 11301 * // Cumulative bloom for directive IDs 128-159 11302 * [4]: number; 11303 * 11304 * // Cumulative bloom for directive IDs 160 - 191 11305 * [5]: number; 11306 * 11307 * // Cumulative bloom for directive IDs 192 - 223 11308 * [6]: number; 11309 * 11310 * // Cumulative bloom for directive IDs 224 - 255 11311 * [7]: number; 11312 * 11313 * // We need to store a reference to the injector's parent so DI can keep looking up 11314 * // the injector tree until it finds the dependency it's looking for. 11315 * [PARENT_INJECTOR]: number; 11316 * } 11317 * 11318 * export interface TInjector extends Array<any> { 11319 * 11320 * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE) 11321 * [0]: number; 11322 * 11323 * // Shared node bloom for directive IDs 32-63 11324 * [1]: number; 11325 * 11326 * // Shared node bloom for directive IDs 64-95 11327 * [2]: number; 11328 * 11329 * // Shared node bloom for directive IDs 96-127 11330 * [3]: number; 11331 * 11332 * // Shared node bloom for directive IDs 128-159 11333 * [4]: number; 11334 * 11335 * // Shared node bloom for directive IDs 160 - 191 11336 * [5]: number; 11337 * 11338 * // Shared node bloom for directive IDs 192 - 223 11339 * [6]: number; 11340 * 11341 * // Shared node bloom for directive IDs 224 - 255 11342 * [7]: number; 11343 * 11344 * // Necessary to find directive indices for a particular node. 11345 * [TNODE]: TElementNode|TElementContainerNode|TContainerNode; 11346 * } 11347 */ 11348/** 11349 * Factory for creating instances of injectors in the NodeInjector. 11350 * 11351 * This factory is complicated by the fact that it can resolve `multi` factories as well. 11352 * 11353 * NOTE: Some of the fields are optional which means that this class has two hidden classes. 11354 * - One without `multi` support (most common) 11355 * - One with `multi` values, (rare). 11356 * 11357 * Since VMs can cache up to 4 inline hidden classes this is OK. 11358 * 11359 * - Single factory: Only `resolving` and `factory` is defined. 11360 * - `providers` factory: `componentProviders` is a number and `index = -1`. 11361 * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`. 11362 */ 11363class NodeInjectorFactory { 11364 constructor( 11365 /** 11366 * Factory to invoke in order to create a new instance. 11367 */ 11368 factory, 11369 /** 11370 * Set to `true` if the token is declared in `viewProviders` (or if it is component). 11371 */ 11372 isViewProvider, injectImplementation) { 11373 this.factory = factory; 11374 /** 11375 * Marker set to true during factory invocation to see if we get into recursive loop. 11376 * Recursive loop causes an error to be displayed. 11377 */ 11378 this.resolving = false; 11379 this.canSeeViewProviders = isViewProvider; 11380 this.injectImpl = injectImplementation; 11381 } 11382} 11383function isFactory(obj) { 11384 return obj instanceof NodeInjectorFactory; 11385} 11386// Note: This hack is necessary so we don't erroneously get a circular dependency 11387// failure based on types. 11388const unusedValueExportToPlacateAjd$3 = 1; 11389 11390/** 11391 * @license 11392 * Copyright Google LLC All Rights Reserved. 11393 * 11394 * Use of this source code is governed by an MIT-style license that can be 11395 * found in the LICENSE file at https://angular.io/license 11396 */ 11397function assertNodeType(tNode, type) { 11398 assertDefined(tNode, 'should be called with a TNode'); 11399 assertEqual(tNode.type, type, `should be a ${typeName(type)}`); 11400} 11401function assertNodeOfPossibleTypes(tNode, types, message) { 11402 assertDefined(tNode, 'should be called with a TNode'); 11403 const found = types.some(type => tNode.type === type); 11404 assertEqual(found, true, message !== null && message !== void 0 ? message : `Should be one of ${types.map(typeName).join(', ')} but got ${typeName(tNode.type)}`); 11405} 11406function assertNodeNotOfTypes(tNode, types, message) { 11407 assertDefined(tNode, 'should be called with a TNode'); 11408 const found = types.some(type => tNode.type === type); 11409 assertEqual(found, false, message !== null && message !== void 0 ? message : `Should not be one of ${types.map(typeName).join(', ')} but got ${typeName(tNode.type)}`); 11410} 11411function typeName(type) { 11412 if (type == 1 /* Projection */) 11413 return 'Projection'; 11414 if (type == 0 /* Container */) 11415 return 'Container'; 11416 if (type == 5 /* IcuContainer */) 11417 return 'IcuContainer'; 11418 if (type == 2 /* View */) 11419 return 'View'; 11420 if (type == 3 /* Element */) 11421 return 'Element'; 11422 if (type == 4 /* ElementContainer */) 11423 return 'ElementContainer'; 11424 return '<unknown>'; 11425} 11426 11427/** 11428 * Assigns all attribute values to the provided element via the inferred renderer. 11429 * 11430 * This function accepts two forms of attribute entries: 11431 * 11432 * default: (key, value): 11433 * attrs = [key1, value1, key2, value2] 11434 * 11435 * namespaced: (NAMESPACE_MARKER, uri, name, value) 11436 * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value] 11437 * 11438 * The `attrs` array can contain a mix of both the default and namespaced entries. 11439 * The "default" values are set without a marker, but if the function comes across 11440 * a marker value then it will attempt to set a namespaced value. If the marker is 11441 * not of a namespaced value then the function will quit and return the index value 11442 * where it stopped during the iteration of the attrs array. 11443 * 11444 * See [AttributeMarker] to understand what the namespace marker value is. 11445 * 11446 * Note that this instruction does not support assigning style and class values to 11447 * an element. See `elementStart` and `elementHostAttrs` to learn how styling values 11448 * are applied to an element. 11449 * @param renderer The renderer to be used 11450 * @param native The element that the attributes will be assigned to 11451 * @param attrs The attribute array of values that will be assigned to the element 11452 * @returns the index value that was last accessed in the attributes array 11453 */ 11454function setUpAttributes(renderer, native, attrs) { 11455 const isProc = isProceduralRenderer(renderer); 11456 let i = 0; 11457 while (i < attrs.length) { 11458 const value = attrs[i]; 11459 if (typeof value === 'number') { 11460 // only namespaces are supported. Other value types (such as style/class 11461 // entries) are not supported in this function. 11462 if (value !== 0 /* NamespaceURI */) { 11463 break; 11464 } 11465 // we just landed on the marker value ... therefore 11466 // we should skip to the next entry 11467 i++; 11468 const namespaceURI = attrs[i++]; 11469 const attrName = attrs[i++]; 11470 const attrVal = attrs[i++]; 11471 ngDevMode && ngDevMode.rendererSetAttribute++; 11472 isProc ? 11473 renderer.setAttribute(native, attrName, attrVal, namespaceURI) : 11474 native.setAttributeNS(namespaceURI, attrName, attrVal); 11475 } 11476 else { 11477 // attrName is string; 11478 const attrName = value; 11479 const attrVal = attrs[++i]; 11480 // Standard attributes 11481 ngDevMode && ngDevMode.rendererSetAttribute++; 11482 if (isAnimationProp(attrName)) { 11483 if (isProc) { 11484 renderer.setProperty(native, attrName, attrVal); 11485 } 11486 } 11487 else { 11488 isProc ? 11489 renderer.setAttribute(native, attrName, attrVal) : 11490 native.setAttribute(attrName, attrVal); 11491 } 11492 i++; 11493 } 11494 } 11495 // another piece of code may iterate over the same attributes array. Therefore 11496 // it may be helpful to return the exact spot where the attributes array exited 11497 // whether by running into an unsupported marker or if all the static values were 11498 // iterated over. 11499 return i; 11500} 11501/** 11502 * Test whether the given value is a marker that indicates that the following 11503 * attribute values in a `TAttributes` array are only the names of attributes, 11504 * and not name-value pairs. 11505 * @param marker The attribute marker to test. 11506 * @returns true if the marker is a "name-only" marker (e.g. `Bindings`, `Template` or `I18n`). 11507 */ 11508function isNameOnlyAttributeMarker(marker) { 11509 return marker === 3 /* Bindings */ || marker === 4 /* Template */ || 11510 marker === 6 /* I18n */; 11511} 11512function isAnimationProp(name) { 11513 // Perf note: accessing charCodeAt to check for the first character of a string is faster as 11514 // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that 11515 // charCodeAt doesn't allocate memory to return a substring. 11516 return name.charCodeAt(0) === 64 /* AT_SIGN */; 11517} 11518/** 11519 * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process. 11520 * 11521 * This merge function keeps the order of attrs same. 11522 * 11523 * @param dst Location of where the merged `TAttributes` should end up. 11524 * @param src `TAttributes` which should be appended to `dst` 11525 */ 11526function mergeHostAttrs(dst, src) { 11527 if (src === null || src.length === 0) { 11528 // do nothing 11529 } 11530 else if (dst === null || dst.length === 0) { 11531 // We have source, but dst is empty, just make a copy. 11532 dst = src.slice(); 11533 } 11534 else { 11535 let srcMarker = -1 /* ImplicitAttributes */; 11536 for (let i = 0; i < src.length; i++) { 11537 const item = src[i]; 11538 if (typeof item === 'number') { 11539 srcMarker = item; 11540 } 11541 else { 11542 if (srcMarker === 0 /* NamespaceURI */) { 11543 // Case where we need to consume `key1`, `key2`, `value` items. 11544 } 11545 else if (srcMarker === -1 /* ImplicitAttributes */ || 11546 srcMarker === 2 /* Styles */) { 11547 // Case where we have to consume `key1` and `value` only. 11548 mergeHostAttribute(dst, srcMarker, item, null, src[++i]); 11549 } 11550 else { 11551 // Case where we have to consume `key1` only. 11552 mergeHostAttribute(dst, srcMarker, item, null, null); 11553 } 11554 } 11555 } 11556 } 11557 return dst; 11558} 11559/** 11560 * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account. 11561 * 11562 * @param dst `TAttributes` to append to. 11563 * @param marker Region where the `key`/`value` should be added. 11564 * @param key1 Key to add to `TAttributes` 11565 * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`) 11566 * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class. 11567 */ 11568function mergeHostAttribute(dst, marker, key1, key2, value) { 11569 let i = 0; 11570 // Assume that new markers will be inserted at the end. 11571 let markerInsertPosition = dst.length; 11572 // scan until correct type. 11573 if (marker === -1 /* ImplicitAttributes */) { 11574 markerInsertPosition = -1; 11575 } 11576 else { 11577 while (i < dst.length) { 11578 const dstValue = dst[i++]; 11579 if (typeof dstValue === 'number') { 11580 if (dstValue === marker) { 11581 markerInsertPosition = -1; 11582 break; 11583 } 11584 else if (dstValue > marker) { 11585 // We need to save this as we want the markers to be inserted in specific order. 11586 markerInsertPosition = i - 1; 11587 break; 11588 } 11589 } 11590 } 11591 } 11592 // search until you find place of insertion 11593 while (i < dst.length) { 11594 const item = dst[i]; 11595 if (typeof item === 'number') { 11596 // since `i` started as the index after the marker, we did not find it if we are at the next 11597 // marker 11598 break; 11599 } 11600 else if (item === key1) { 11601 // We already have same token 11602 if (key2 === null) { 11603 if (value !== null) { 11604 dst[i + 1] = value; 11605 } 11606 return; 11607 } 11608 else if (key2 === dst[i + 1]) { 11609 dst[i + 2] = value; 11610 return; 11611 } 11612 } 11613 // Increment counter. 11614 i++; 11615 if (key2 !== null) 11616 i++; 11617 if (value !== null) 11618 i++; 11619 } 11620 // insert at location. 11621 if (markerInsertPosition !== -1) { 11622 dst.splice(markerInsertPosition, 0, marker); 11623 i = markerInsertPosition + 1; 11624 } 11625 dst.splice(i++, 0, key1); 11626 if (key2 !== null) { 11627 dst.splice(i++, 0, key2); 11628 } 11629 if (value !== null) { 11630 dst.splice(i++, 0, value); 11631 } 11632} 11633 11634/** 11635 * @license 11636 * Copyright Google LLC All Rights Reserved. 11637 * 11638 * Use of this source code is governed by an MIT-style license that can be 11639 * found in the LICENSE file at https://angular.io/license 11640 */ 11641/// Parent Injector Utils /////////////////////////////////////////////////////////////// 11642function hasParentInjector(parentLocation) { 11643 return parentLocation !== NO_PARENT_INJECTOR; 11644} 11645function getParentInjectorIndex(parentLocation) { 11646 return parentLocation & 32767 /* InjectorIndexMask */; 11647} 11648function getParentInjectorViewOffset(parentLocation) { 11649 return parentLocation >> 16 /* ViewOffsetShift */; 11650} 11651/** 11652 * Unwraps a parent injector location number to find the view offset from the current injector, 11653 * then walks up the declaration view tree until the view is found that contains the parent 11654 * injector. 11655 * 11656 * @param location The location of the parent injector, which contains the view offset 11657 * @param startView The LView instance from which to start walking up the view tree 11658 * @returns The LView instance that contains the parent injector 11659 */ 11660function getParentInjectorView(location, startView) { 11661 let viewOffset = getParentInjectorViewOffset(location); 11662 let parentView = startView; 11663 // For most cases, the parent injector can be found on the host node (e.g. for component 11664 // or container), but we must keep the loop here to support the rarer case of deeply nested 11665 // <ng-template> tags or inline views, where the parent injector might live many views 11666 // above the child injector. 11667 while (viewOffset > 0) { 11668 parentView = parentView[DECLARATION_VIEW]; 11669 viewOffset--; 11670 } 11671 return parentView; 11672} 11673 11674/** 11675 * @license 11676 * Copyright Google LLC All Rights Reserved. 11677 * 11678 * Use of this source code is governed by an MIT-style license that can be 11679 * found in the LICENSE file at https://angular.io/license 11680 */ 11681/** 11682 * Used for stringify render output in Ivy. 11683 * Important! This function is very performance-sensitive and we should 11684 * be extra careful not to introduce megamorphic reads in it. 11685 */ 11686function renderStringify(value) { 11687 if (typeof value === 'string') 11688 return value; 11689 if (value == null) 11690 return ''; 11691 return '' + value; 11692} 11693/** 11694 * Used to stringify a value so that it can be displayed in an error message. 11695 * Important! This function contains a megamorphic read and should only be 11696 * used for error messages. 11697 */ 11698function stringifyForError(value) { 11699 if (typeof value === 'function') 11700 return value.name || value.toString(); 11701 if (typeof value === 'object' && value != null && typeof value.type === 'function') { 11702 return value.type.name || value.type.toString(); 11703 } 11704 return renderStringify(value); 11705} 11706const ɵ0$3 = () => (typeof requestAnimationFrame !== 'undefined' && 11707 requestAnimationFrame || // browser only 11708 setTimeout // everything else 11709) 11710 .bind(_global); 11711const defaultScheduler = (ɵ0$3)(); 11712/** 11713 * 11714 * @codeGenApi 11715 */ 11716function ɵɵresolveWindow(element) { 11717 return { name: 'window', target: element.ownerDocument.defaultView }; 11718} 11719/** 11720 * 11721 * @codeGenApi 11722 */ 11723function ɵɵresolveDocument(element) { 11724 return { name: 'document', target: element.ownerDocument }; 11725} 11726/** 11727 * 11728 * @codeGenApi 11729 */ 11730function ɵɵresolveBody(element) { 11731 return { name: 'body', target: element.ownerDocument.body }; 11732} 11733/** 11734 * The special delimiter we use to separate property names, prefixes, and suffixes 11735 * in property binding metadata. See storeBindingMetadata(). 11736 * 11737 * We intentionally use the Unicode "REPLACEMENT CHARACTER" (U+FFFD) as a delimiter 11738 * because it is a very uncommon character that is unlikely to be part of a user's 11739 * property names or interpolation strings. If it is in fact used in a property 11740 * binding, DebugElement.properties will not return the correct value for that 11741 * binding. However, there should be no runtime effect for real applications. 11742 * 11743 * This character is typically rendered as a question mark inside of a diamond. 11744 * See https://en.wikipedia.org/wiki/Specials_(Unicode_block) 11745 * 11746 */ 11747const INTERPOLATION_DELIMITER = `�`; 11748/** 11749 * Unwrap a value which might be behind a closure (for forward declaration reasons). 11750 */ 11751function maybeUnwrapFn(value) { 11752 if (value instanceof Function) { 11753 return value(); 11754 } 11755 else { 11756 return value; 11757 } 11758} 11759 11760/** 11761 * @license 11762 * Copyright Google LLC All Rights Reserved. 11763 * 11764 * Use of this source code is governed by an MIT-style license that can be 11765 * found in the LICENSE file at https://angular.io/license 11766 */ 11767/** 11768 * Defines if the call to `inject` should include `viewProviders` in its resolution. 11769 * 11770 * This is set to true when we try to instantiate a component. This value is reset in 11771 * `getNodeInjectable` to a value which matches the declaration location of the token about to be 11772 * instantiated. This is done so that if we are injecting a token which was declared outside of 11773 * `viewProviders` we don't accidentally pull `viewProviders` in. 11774 * 11775 * Example: 11776 * 11777 * ``` 11778 * @Injectable() 11779 * class MyService { 11780 * constructor(public value: String) {} 11781 * } 11782 * 11783 * @Component({ 11784 * providers: [ 11785 * MyService, 11786 * {provide: String, value: 'providers' } 11787 * ] 11788 * viewProviders: [ 11789 * {provide: String, value: 'viewProviders'} 11790 * ] 11791 * }) 11792 * class MyComponent { 11793 * constructor(myService: MyService, value: String) { 11794 * // We expect that Component can see into `viewProviders`. 11795 * expect(value).toEqual('viewProviders'); 11796 * // `MyService` was not declared in `viewProviders` hence it can't see it. 11797 * expect(myService.value).toEqual('providers'); 11798 * } 11799 * } 11800 * 11801 * ``` 11802 */ 11803let includeViewProviders = true; 11804function setIncludeViewProviders(v) { 11805 const oldValue = includeViewProviders; 11806 includeViewProviders = v; 11807 return oldValue; 11808} 11809/** 11810 * The number of slots in each bloom filter (used by DI). The larger this number, the fewer 11811 * directives that will share slots, and thus, the fewer false positives when checking for 11812 * the existence of a directive. 11813 */ 11814const BLOOM_SIZE = 256; 11815const BLOOM_MASK = BLOOM_SIZE - 1; 11816/** Counter used to generate unique IDs for directives. */ 11817let nextNgElementId = 0; 11818/** 11819 * Registers this directive as present in its node's injector by flipping the directive's 11820 * corresponding bit in the injector's bloom filter. 11821 * 11822 * @param injectorIndex The index of the node injector where this token should be registered 11823 * @param tView The TView for the injector's bloom filters 11824 * @param type The directive token to register 11825 */ 11826function bloomAdd(injectorIndex, tView, type) { 11827 ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true'); 11828 let id; 11829 if (typeof type === 'string') { 11830 id = type.charCodeAt(0) || 0; 11831 } 11832 else if (type.hasOwnProperty(NG_ELEMENT_ID)) { 11833 id = type[NG_ELEMENT_ID]; 11834 } 11835 // Set a unique ID on the directive type, so if something tries to inject the directive, 11836 // we can easily retrieve the ID and hash it into the bloom bit that should be checked. 11837 if (id == null) { 11838 id = type[NG_ELEMENT_ID] = nextNgElementId++; 11839 } 11840 // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each), 11841 // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter. 11842 const bloomBit = id & BLOOM_MASK; 11843 // Create a mask that targets the specific bit associated with the directive. 11844 // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding 11845 // to bit positions 0 - 31 in a 32 bit integer. 11846 const mask = 1 << bloomBit; 11847 // Use the raw bloomBit number to determine which bloom filter bucket we should check 11848 // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc 11849 const b7 = bloomBit & 0x80; 11850 const b6 = bloomBit & 0x40; 11851 const b5 = bloomBit & 0x20; 11852 const tData = tView.data; 11853 if (b7) { 11854 b6 ? (b5 ? (tData[injectorIndex + 7] |= mask) : (tData[injectorIndex + 6] |= mask)) : 11855 (b5 ? (tData[injectorIndex + 5] |= mask) : (tData[injectorIndex + 4] |= mask)); 11856 } 11857 else { 11858 b6 ? (b5 ? (tData[injectorIndex + 3] |= mask) : (tData[injectorIndex + 2] |= mask)) : 11859 (b5 ? (tData[injectorIndex + 1] |= mask) : (tData[injectorIndex] |= mask)); 11860 } 11861} 11862/** 11863 * Creates (or gets an existing) injector for a given element or container. 11864 * 11865 * @param tNode for which an injector should be retrieved / created. 11866 * @param hostView View where the node is stored 11867 * @returns Node injector 11868 */ 11869function getOrCreateNodeInjectorForNode(tNode, hostView) { 11870 const existingInjectorIndex = getInjectorIndex(tNode, hostView); 11871 if (existingInjectorIndex !== -1) { 11872 return existingInjectorIndex; 11873 } 11874 const tView = hostView[TVIEW]; 11875 if (tView.firstCreatePass) { 11876 tNode.injectorIndex = hostView.length; 11877 insertBloom(tView.data, tNode); // foundation for node bloom 11878 insertBloom(hostView, null); // foundation for cumulative bloom 11879 insertBloom(tView.blueprint, null); 11880 } 11881 const parentLoc = getParentInjectorLocation(tNode, hostView); 11882 const injectorIndex = tNode.injectorIndex; 11883 // If a parent injector can't be found, its location is set to -1. 11884 // In that case, we don't need to set up a cumulative bloom 11885 if (hasParentInjector(parentLoc)) { 11886 const parentIndex = getParentInjectorIndex(parentLoc); 11887 const parentLView = getParentInjectorView(parentLoc, hostView); 11888 const parentData = parentLView[TVIEW].data; 11889 // Creates a cumulative bloom filter that merges the parent's bloom filter 11890 // and its own cumulative bloom (which contains tokens for all ancestors) 11891 for (let i = 0; i < 8; i++) { 11892 hostView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i]; 11893 } 11894 } 11895 hostView[injectorIndex + PARENT_INJECTOR] = parentLoc; 11896 return injectorIndex; 11897} 11898function insertBloom(arr, footer) { 11899 arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer); 11900} 11901function getInjectorIndex(tNode, hostView) { 11902 if (tNode.injectorIndex === -1 || 11903 // If the injector index is the same as its parent's injector index, then the index has been 11904 // copied down from the parent node. No injector has been created yet on this node. 11905 (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) || 11906 // After the first template pass, the injector index might exist but the parent values 11907 // might not have been calculated yet for this instance 11908 hostView[tNode.injectorIndex + PARENT_INJECTOR] == null) { 11909 return -1; 11910 } 11911 else { 11912 return tNode.injectorIndex; 11913 } 11914} 11915/** 11916 * Finds the index of the parent injector, with a view offset if applicable. Used to set the 11917 * parent injector initially. 11918 * 11919 * Returns a combination of number of `ViewData` we have to go up and index in that `Viewdata` 11920 */ 11921function getParentInjectorLocation(tNode, view) { 11922 if (tNode.parent && tNode.parent.injectorIndex !== -1) { 11923 return tNode.parent.injectorIndex; // ViewOffset is 0 11924 } 11925 // For most cases, the parent injector index can be found on the host node (e.g. for component 11926 // or container), so this loop will be skipped, but we must keep the loop here to support 11927 // the rarer case of deeply nested <ng-template> tags or inline views. 11928 let hostTNode = view[T_HOST]; 11929 let viewOffset = 1; 11930 while (hostTNode && hostTNode.injectorIndex === -1) { 11931 view = view[DECLARATION_VIEW]; 11932 hostTNode = view ? view[T_HOST] : null; 11933 viewOffset++; 11934 } 11935 return hostTNode ? 11936 hostTNode.injectorIndex | (viewOffset << 16 /* ViewOffsetShift */) : 11937 -1; 11938} 11939/** 11940 * Makes a type or an injection token public to the DI system by adding it to an 11941 * injector's bloom filter. 11942 * 11943 * @param di The node injector in which a directive will be added 11944 * @param token The type or the injection token to be made public 11945 */ 11946function diPublicInInjector(injectorIndex, tView, token) { 11947 bloomAdd(injectorIndex, tView, token); 11948} 11949/** 11950 * Inject static attribute value into directive constructor. 11951 * 11952 * This method is used with `factory` functions which are generated as part of 11953 * `defineDirective` or `defineComponent`. The method retrieves the static value 11954 * of an attribute. (Dynamic attributes are not supported since they are not resolved 11955 * at the time of injection and can change over time.) 11956 * 11957 * # Example 11958 * Given: 11959 * ``` 11960 * @Component(...) 11961 * class MyComponent { 11962 * constructor(@Attribute('title') title: string) { ... } 11963 * } 11964 * ``` 11965 * When instantiated with 11966 * ``` 11967 * <my-component title="Hello"></my-component> 11968 * ``` 11969 * 11970 * Then factory method generated is: 11971 * ``` 11972 * MyComponent.ɵcmp = defineComponent({ 11973 * factory: () => new MyComponent(injectAttribute('title')) 11974 * ... 11975 * }) 11976 * ``` 11977 * 11978 * @publicApi 11979 */ 11980function injectAttributeImpl(tNode, attrNameToInject) { 11981 ngDevMode && 11982 assertNodeOfPossibleTypes(tNode, [0 /* Container */, 3 /* Element */, 4 /* ElementContainer */]); 11983 ngDevMode && assertDefined(tNode, 'expecting tNode'); 11984 if (attrNameToInject === 'class') { 11985 return tNode.classes; 11986 } 11987 if (attrNameToInject === 'style') { 11988 return tNode.styles; 11989 } 11990 const attrs = tNode.attrs; 11991 if (attrs) { 11992 const attrsLength = attrs.length; 11993 let i = 0; 11994 while (i < attrsLength) { 11995 const value = attrs[i]; 11996 // If we hit a `Bindings` or `Template` marker then we are done. 11997 if (isNameOnlyAttributeMarker(value)) 11998 break; 11999 // Skip namespaced attributes 12000 if (value === 0 /* NamespaceURI */) { 12001 // we skip the next two values 12002 // as namespaced attributes looks like 12003 // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist', 12004 // 'existValue', ...] 12005 i = i + 2; 12006 } 12007 else if (typeof value === 'number') { 12008 // Skip to the first value of the marked attribute. 12009 i++; 12010 while (i < attrsLength && typeof attrs[i] === 'string') { 12011 i++; 12012 } 12013 } 12014 else if (value === attrNameToInject) { 12015 return attrs[i + 1]; 12016 } 12017 else { 12018 i = i + 2; 12019 } 12020 } 12021 } 12022 return null; 12023} 12024/** 12025 * Returns the value associated to the given token from the NodeInjectors => ModuleInjector. 12026 * 12027 * Look for the injector providing the token by walking up the node injector tree and then 12028 * the module injector tree. 12029 * 12030 * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom 12031 * filter. Negative values are reserved for special objects. 12032 * - `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`) 12033 * 12034 * @param tNode The Node where the search for the injector should start 12035 * @param lView The `LView` that contains the `tNode` 12036 * @param token The token to look for 12037 * @param flags Injection flags 12038 * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional` 12039 * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided 12040 */ 12041function getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, notFoundValue) { 12042 if (tNode !== null) { 12043 const bloomHash = bloomHashBitOrFactory(token); 12044 // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef 12045 // so just call the factory function to create it. 12046 if (typeof bloomHash === 'function') { 12047 enterDI(lView, tNode); 12048 try { 12049 const value = bloomHash(); 12050 if (value == null && !(flags & InjectFlags.Optional)) { 12051 throw new Error(`No provider for ${stringifyForError(token)}!`); 12052 } 12053 else { 12054 return value; 12055 } 12056 } 12057 finally { 12058 leaveDI(); 12059 } 12060 } 12061 else if (typeof bloomHash == 'number') { 12062 if (bloomHash === -1) { 12063 // `-1` is a special value used to identify `Injector` types. 12064 return new NodeInjector(tNode, lView); 12065 } 12066 // If the token has a bloom hash, then it is a token which could be in NodeInjector. 12067 // A reference to the previous injector TView that was found while climbing the element 12068 // injector tree. This is used to know if viewProviders can be accessed on the current 12069 // injector. 12070 let previousTView = null; 12071 let injectorIndex = getInjectorIndex(tNode, lView); 12072 let parentLocation = NO_PARENT_INJECTOR; 12073 let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null; 12074 // If we should skip this injector, or if there is no injector on this node, start by 12075 // searching 12076 // the parent injector. 12077 if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) { 12078 parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : 12079 lView[injectorIndex + PARENT_INJECTOR]; 12080 if (!shouldSearchParent(flags, false)) { 12081 injectorIndex = -1; 12082 } 12083 else { 12084 previousTView = lView[TVIEW]; 12085 injectorIndex = getParentInjectorIndex(parentLocation); 12086 lView = getParentInjectorView(parentLocation, lView); 12087 } 12088 } 12089 // Traverse up the injector tree until we find a potential match or until we know there 12090 // *isn't* a match. 12091 while (injectorIndex !== -1) { 12092 parentLocation = lView[injectorIndex + PARENT_INJECTOR]; 12093 // Check the current injector. If it matches, see if it contains token. 12094 const tView = lView[TVIEW]; 12095 if (bloomHasToken(bloomHash, injectorIndex, tView.data)) { 12096 // At this point, we have an injector which *may* contain the token, so we step through 12097 // the providers and directives associated with the injector's corresponding node to get 12098 // the instance. 12099 const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode); 12100 if (instance !== NOT_FOUND) { 12101 return instance; 12102 } 12103 } 12104 if (shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + TNODE] === hostTElementNode) && 12105 bloomHasToken(bloomHash, injectorIndex, lView)) { 12106 // The def wasn't found anywhere on this node, so it was a false positive. 12107 // Traverse up the tree and continue searching. 12108 previousTView = tView; 12109 injectorIndex = getParentInjectorIndex(parentLocation); 12110 lView = getParentInjectorView(parentLocation, lView); 12111 } 12112 else { 12113 // If we should not search parent OR If the ancestor bloom filter value does not have the 12114 // bit corresponding to the directive we can give up on traversing up to find the specific 12115 // injector. 12116 injectorIndex = -1; 12117 } 12118 } 12119 } 12120 } 12121 if (flags & InjectFlags.Optional && notFoundValue === undefined) { 12122 // This must be set or the NullInjector will throw for optional deps 12123 notFoundValue = null; 12124 } 12125 if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) { 12126 const moduleInjector = lView[INJECTOR$1]; 12127 // switch to `injectInjectorOnly` implementation for module injector, since module injector 12128 // should not have access to Component/Directive DI scope (that may happen through 12129 // `directiveInject` implementation) 12130 const previousInjectImplementation = setInjectImplementation(undefined); 12131 try { 12132 if (moduleInjector) { 12133 return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional); 12134 } 12135 else { 12136 return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional); 12137 } 12138 } 12139 finally { 12140 setInjectImplementation(previousInjectImplementation); 12141 } 12142 } 12143 if (flags & InjectFlags.Optional) { 12144 return notFoundValue; 12145 } 12146 else { 12147 throw new Error(`NodeInjector: NOT_FOUND [${stringifyForError(token)}]`); 12148 } 12149} 12150const NOT_FOUND = {}; 12151function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) { 12152 const currentTView = lView[TVIEW]; 12153 const tNode = currentTView.data[injectorIndex + TNODE]; 12154 // First, we need to determine if view providers can be accessed by the starting element. 12155 // There are two possibities 12156 const canAccessViewProviders = previousTView == null ? 12157 // 1) This is the first invocation `previousTView == null` which means that we are at the 12158 // `TNode` of where injector is starting to look. In such a case the only time we are allowed 12159 // to look into the ViewProviders is if: 12160 // - we are on a component 12161 // - AND the injector set `includeViewProviders` to true (implying that the token can see 12162 // ViewProviders because it is the Component or a Service which itself was declared in 12163 // ViewProviders) 12164 (isComponentHost(tNode) && includeViewProviders) : 12165 // 2) `previousTView != null` which means that we are now walking across the parent nodes. 12166 // In such a case we are only allowed to look into the ViewProviders if: 12167 // - We just crossed from child View to Parent View `previousTView != currentTView` 12168 // - AND the parent TNode is an Element. 12169 // This means that we just came from the Component's View and therefore are allowed to see 12170 // into the ViewProviders. 12171 (previousTView != currentTView && (tNode.type === 3 /* Element */)); 12172 // This special case happens when there is a @host on the inject and when we are searching 12173 // on the host element node. 12174 const isHostSpecialCase = (flags & InjectFlags.Host) && hostTElementNode === tNode; 12175 const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase); 12176 if (injectableIdx !== null) { 12177 return getNodeInjectable(lView, currentTView, injectableIdx, tNode); 12178 } 12179 else { 12180 return NOT_FOUND; 12181 } 12182} 12183/** 12184 * Searches for the given token among the node's directives and providers. 12185 * 12186 * @param tNode TNode on which directives are present. 12187 * @param tView The tView we are currently processing 12188 * @param token Provider token or type of a directive to look for. 12189 * @param canAccessViewProviders Whether view providers should be considered. 12190 * @param isHostSpecialCase Whether the host special case applies. 12191 * @returns Index of a found directive or provider, or null when none found. 12192 */ 12193function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) { 12194 const nodeProviderIndexes = tNode.providerIndexes; 12195 const tInjectables = tView.data; 12196 const injectablesStart = nodeProviderIndexes & 1048575 /* ProvidersStartIndexMask */; 12197 const directivesStart = tNode.directiveStart; 12198 const directiveEnd = tNode.directiveEnd; 12199 const cptViewProvidersCount = nodeProviderIndexes >> 20 /* CptViewProvidersCountShift */; 12200 const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount; 12201 // When the host special case applies, only the viewProviders and the component are visible 12202 const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd; 12203 for (let i = startingIndex; i < endIndex; i++) { 12204 const providerTokenOrDef = tInjectables[i]; 12205 if (i < directivesStart && token === providerTokenOrDef || 12206 i >= directivesStart && providerTokenOrDef.type === token) { 12207 return i; 12208 } 12209 } 12210 if (isHostSpecialCase) { 12211 const dirDef = tInjectables[directivesStart]; 12212 if (dirDef && isComponentDef(dirDef) && dirDef.type === token) { 12213 return directivesStart; 12214 } 12215 } 12216 return null; 12217} 12218/** 12219 * Retrieve or instantiate the injectable from the `LView` at particular `index`. 12220 * 12221 * This function checks to see if the value has already been instantiated and if so returns the 12222 * cached `injectable`. Otherwise if it detects that the value is still a factory it 12223 * instantiates the `injectable` and caches the value. 12224 */ 12225function getNodeInjectable(lView, tView, index, tNode) { 12226 let value = lView[index]; 12227 const tData = tView.data; 12228 if (isFactory(value)) { 12229 const factory = value; 12230 if (factory.resolving) { 12231 throw new Error(`Circular dep for ${stringifyForError(tData[index])}`); 12232 } 12233 const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders); 12234 factory.resolving = true; 12235 let previousInjectImplementation; 12236 if (factory.injectImpl) { 12237 previousInjectImplementation = setInjectImplementation(factory.injectImpl); 12238 } 12239 enterDI(lView, tNode); 12240 try { 12241 value = lView[index] = factory.factory(undefined, tData, lView, tNode); 12242 // This code path is hit for both directives and providers. 12243 // For perf reasons, we want to avoid searching for hooks on providers. 12244 // It does no harm to try (the hooks just won't exist), but the extra 12245 // checks are unnecessary and this is a hot path. So we check to see 12246 // if the index of the dependency is in the directive range for this 12247 // tNode. If it's not, we know it's a provider and skip hook registration. 12248 if (tView.firstCreatePass && index >= tNode.directiveStart) { 12249 ngDevMode && assertDirectiveDef(tData[index]); 12250 registerPreOrderHooks(index, tData[index], tView); 12251 } 12252 } 12253 finally { 12254 if (factory.injectImpl) 12255 setInjectImplementation(previousInjectImplementation); 12256 setIncludeViewProviders(previousIncludeViewProviders); 12257 factory.resolving = false; 12258 leaveDI(); 12259 } 12260 } 12261 return value; 12262} 12263/** 12264 * Returns the bit in an injector's bloom filter that should be used to determine whether or not 12265 * the directive might be provided by the injector. 12266 * 12267 * When a directive is public, it is added to the bloom filter and given a unique ID that can be 12268 * retrieved on the Type. When the directive isn't public or the token is not a directive `null` 12269 * is returned as the node injector can not possibly provide that token. 12270 * 12271 * @param token the injection token 12272 * @returns the matching bit to check in the bloom filter or `null` if the token is not known. 12273 * When the returned value is negative then it represents special values such as `Injector`. 12274 */ 12275function bloomHashBitOrFactory(token) { 12276 ngDevMode && assertDefined(token, 'token must be defined'); 12277 if (typeof token === 'string') { 12278 return token.charCodeAt(0) || 0; 12279 } 12280 const tokenId = 12281 // First check with `hasOwnProperty` so we don't get an inherited ID. 12282 token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined; 12283 // Negative token IDs are used for special objects such as `Injector` 12284 return (typeof tokenId === 'number' && tokenId > 0) ? tokenId & BLOOM_MASK : tokenId; 12285} 12286function bloomHasToken(bloomHash, injectorIndex, injectorView) { 12287 // Create a mask that targets the specific bit associated with the directive we're looking for. 12288 // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding 12289 // to bit positions 0 - 31 in a 32 bit integer. 12290 const mask = 1 << bloomHash; 12291 const b7 = bloomHash & 0x80; 12292 const b6 = bloomHash & 0x40; 12293 const b5 = bloomHash & 0x20; 12294 // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets: 12295 // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc. 12296 // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit. 12297 let value; 12298 if (b7) { 12299 value = b6 ? (b5 ? injectorView[injectorIndex + 7] : injectorView[injectorIndex + 6]) : 12300 (b5 ? injectorView[injectorIndex + 5] : injectorView[injectorIndex + 4]); 12301 } 12302 else { 12303 value = b6 ? (b5 ? injectorView[injectorIndex + 3] : injectorView[injectorIndex + 2]) : 12304 (b5 ? injectorView[injectorIndex + 1] : injectorView[injectorIndex]); 12305 } 12306 // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on, 12307 // this injector is a potential match. 12308 return !!(value & mask); 12309} 12310/** Returns true if flags prevent parent injector from being searched for tokens */ 12311function shouldSearchParent(flags, isFirstHostTNode) { 12312 return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode); 12313} 12314class NodeInjector { 12315 constructor(_tNode, _lView) { 12316 this._tNode = _tNode; 12317 this._lView = _lView; 12318 } 12319 get(token, notFoundValue) { 12320 return getOrCreateInjectable(this._tNode, this._lView, token, undefined, notFoundValue); 12321 } 12322} 12323/** 12324 * @codeGenApi 12325 */ 12326function ɵɵgetFactoryOf(type) { 12327 const typeAny = type; 12328 if (isForwardRef(type)) { 12329 return (() => { 12330 const factory = ɵɵgetFactoryOf(resolveForwardRef(typeAny)); 12331 return factory ? factory() : null; 12332 }); 12333 } 12334 let factory = getFactoryDef(typeAny); 12335 if (factory === null) { 12336 const injectorDef = getInjectorDef(typeAny); 12337 factory = injectorDef && injectorDef.factory; 12338 } 12339 return factory || null; 12340} 12341/** 12342 * @codeGenApi 12343 */ 12344function ɵɵgetInheritedFactory(type) { 12345 return noSideEffects(() => { 12346 const ownConstructor = type.prototype.constructor; 12347 const ownFactory = ownConstructor[NG_FACTORY_DEF] || ɵɵgetFactoryOf(ownConstructor); 12348 const objectPrototype = Object.prototype; 12349 let parent = Object.getPrototypeOf(type.prototype).constructor; 12350 // Go up the prototype until we hit `Object`. 12351 while (parent && parent !== objectPrototype) { 12352 const factory = parent[NG_FACTORY_DEF] || ɵɵgetFactoryOf(parent); 12353 // If we hit something that has a factory and the factory isn't the same as the type, 12354 // we've found the inherited factory. Note the check that the factory isn't the type's 12355 // own factory is redundant in most cases, but if the user has custom decorators on the 12356 // class, this lookup will start one level down in the prototype chain, causing us to 12357 // find the own factory first and potentially triggering an infinite loop downstream. 12358 if (factory && factory !== ownFactory) { 12359 return factory; 12360 } 12361 parent = Object.getPrototypeOf(parent); 12362 } 12363 // There is no factory defined. Either this was improper usage of inheritance 12364 // (no Angular decorator on the superclass) or there is no constructor at all 12365 // in the inheritance chain. Since the two cases cannot be distinguished, the 12366 // latter has to be assumed. 12367 return t => new t(); 12368 }); 12369} 12370 12371/** 12372 * @license 12373 * Copyright Google LLC All Rights Reserved. 12374 * 12375 * Use of this source code is governed by an MIT-style license that can be 12376 * found in the LICENSE file at https://angular.io/license 12377 */ 12378const ERROR_TYPE = 'ngType'; 12379const ERROR_DEBUG_CONTEXT = 'ngDebugContext'; 12380const ERROR_ORIGINAL_ERROR = 'ngOriginalError'; 12381const ERROR_LOGGER = 'ngErrorLogger'; 12382function wrappedError(message, originalError) { 12383 const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`; 12384 const error = Error(msg); 12385 error[ERROR_ORIGINAL_ERROR] = originalError; 12386 return error; 12387} 12388 12389/** 12390 * @license 12391 * Copyright Google LLC All Rights Reserved. 12392 * 12393 * Use of this source code is governed by an MIT-style license that can be 12394 * found in the LICENSE file at https://angular.io/license 12395 */ 12396function getType(error) { 12397 return error[ERROR_TYPE]; 12398} 12399function getDebugContext(error) { 12400 return error[ERROR_DEBUG_CONTEXT]; 12401} 12402function getOriginalError(error) { 12403 return error[ERROR_ORIGINAL_ERROR]; 12404} 12405function getErrorLogger(error) { 12406 return error[ERROR_LOGGER] || defaultErrorLogger; 12407} 12408function defaultErrorLogger(console, ...values) { 12409 console.error(...values); 12410} 12411 12412/** 12413 * @license 12414 * Copyright Google LLC All Rights Reserved. 12415 * 12416 * Use of this source code is governed by an MIT-style license that can be 12417 * found in the LICENSE file at https://angular.io/license 12418 */ 12419/** 12420 * Provides a hook for centralized exception handling. 12421 * 12422 * The default implementation of `ErrorHandler` prints error messages to the `console`. To 12423 * intercept error handling, write a custom exception handler that replaces this default as 12424 * appropriate for your app. 12425 * 12426 * @usageNotes 12427 * ### Example 12428 * 12429 * ``` 12430 * class MyErrorHandler implements ErrorHandler { 12431 * handleError(error) { 12432 * // do something with the exception 12433 * } 12434 * } 12435 * 12436 * @NgModule({ 12437 * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}] 12438 * }) 12439 * class MyModule {} 12440 * ``` 12441 * 12442 * @publicApi 12443 */ 12444class ErrorHandler { 12445 constructor() { 12446 /** 12447 * @internal 12448 */ 12449 this._console = console; 12450 } 12451 handleError(error) { 12452 const originalError = this._findOriginalError(error); 12453 const context = this._findContext(error); 12454 // Note: Browser consoles show the place from where console.error was called. 12455 // We can use this to give users additional information about the error. 12456 const errorLogger = getErrorLogger(error); 12457 errorLogger(this._console, `ERROR`, error); 12458 if (originalError) { 12459 errorLogger(this._console, `ORIGINAL ERROR`, originalError); 12460 } 12461 if (context) { 12462 errorLogger(this._console, 'ERROR CONTEXT', context); 12463 } 12464 } 12465 /** @internal */ 12466 _findContext(error) { 12467 if (error) { 12468 return getDebugContext(error) ? getDebugContext(error) : 12469 this._findContext(getOriginalError(error)); 12470 } 12471 return null; 12472 } 12473 /** @internal */ 12474 _findOriginalError(error) { 12475 let e = getOriginalError(error); 12476 while (e && getOriginalError(e)) { 12477 e = getOriginalError(e); 12478 } 12479 return e; 12480 } 12481} 12482 12483/** 12484 * @license 12485 * Copyright Google LLC All Rights Reserved. 12486 * 12487 * Use of this source code is governed by an MIT-style license that can be 12488 * found in the LICENSE file at https://angular.io/license 12489 */ 12490/** 12491 * Defines a schema that allows an NgModule to contain the following: 12492 * - Non-Angular elements named with dash case (`-`). 12493 * - Element properties named with dash case (`-`). 12494 * Dash case is the naming convention for custom elements. 12495 * 12496 * @publicApi 12497 */ 12498const CUSTOM_ELEMENTS_SCHEMA = { 12499 name: 'custom-elements' 12500}; 12501/** 12502 * Defines a schema that allows any property on any element. 12503 * 12504 * @publicApi 12505 */ 12506const NO_ERRORS_SCHEMA = { 12507 name: 'no-errors-schema' 12508}; 12509 12510/** 12511 * @license 12512 * Copyright Google LLC All Rights Reserved. 12513 * 12514 * Use of this source code is governed by an MIT-style license that can be 12515 * found in the LICENSE file at https://angular.io/license 12516 */ 12517class SafeValueImpl { 12518 constructor(changingThisBreaksApplicationSecurity) { 12519 this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity; 12520 } 12521 toString() { 12522 return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` + 12523 ` (see http://g.co/ng/security#xss)`; 12524 } 12525} 12526class SafeHtmlImpl extends SafeValueImpl { 12527 getTypeName() { 12528 return "HTML" /* Html */; 12529 } 12530} 12531class SafeStyleImpl extends SafeValueImpl { 12532 getTypeName() { 12533 return "Style" /* Style */; 12534 } 12535} 12536class SafeScriptImpl extends SafeValueImpl { 12537 getTypeName() { 12538 return "Script" /* Script */; 12539 } 12540} 12541class SafeUrlImpl extends SafeValueImpl { 12542 getTypeName() { 12543 return "URL" /* Url */; 12544 } 12545} 12546class SafeResourceUrlImpl extends SafeValueImpl { 12547 getTypeName() { 12548 return "ResourceURL" /* ResourceUrl */; 12549 } 12550} 12551function unwrapSafeValue(value) { 12552 return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity : 12553 value; 12554} 12555function allowSanitizationBypassAndThrow(value, type) { 12556 const actualType = getSanitizationBypassType(value); 12557 if (actualType != null && actualType !== type) { 12558 // Allow ResourceURLs in URL contexts, they are strictly more trusted. 12559 if (actualType === "ResourceURL" /* ResourceUrl */ && type === "URL" /* Url */) 12560 return true; 12561 throw new Error(`Required a safe ${type}, got a ${actualType} (see http://g.co/ng/security#xss)`); 12562 } 12563 return actualType === type; 12564} 12565function getSanitizationBypassType(value) { 12566 return value instanceof SafeValueImpl && value.getTypeName() || null; 12567} 12568/** 12569 * Mark `html` string as trusted. 12570 * 12571 * This function wraps the trusted string in `String` and brands it in a way which makes it 12572 * recognizable to {@link htmlSanitizer} to be trusted implicitly. 12573 * 12574 * @param trustedHtml `html` string which needs to be implicitly trusted. 12575 * @returns a `html` which has been branded to be implicitly trusted. 12576 */ 12577function bypassSanitizationTrustHtml(trustedHtml) { 12578 return new SafeHtmlImpl(trustedHtml); 12579} 12580/** 12581 * Mark `style` string as trusted. 12582 * 12583 * This function wraps the trusted string in `String` and brands it in a way which makes it 12584 * recognizable to {@link styleSanitizer} to be trusted implicitly. 12585 * 12586 * @param trustedStyle `style` string which needs to be implicitly trusted. 12587 * @returns a `style` hich has been branded to be implicitly trusted. 12588 */ 12589function bypassSanitizationTrustStyle(trustedStyle) { 12590 return new SafeStyleImpl(trustedStyle); 12591} 12592/** 12593 * Mark `script` string as trusted. 12594 * 12595 * This function wraps the trusted string in `String` and brands it in a way which makes it 12596 * recognizable to {@link scriptSanitizer} to be trusted implicitly. 12597 * 12598 * @param trustedScript `script` string which needs to be implicitly trusted. 12599 * @returns a `script` which has been branded to be implicitly trusted. 12600 */ 12601function bypassSanitizationTrustScript(trustedScript) { 12602 return new SafeScriptImpl(trustedScript); 12603} 12604/** 12605 * Mark `url` string as trusted. 12606 * 12607 * This function wraps the trusted string in `String` and brands it in a way which makes it 12608 * recognizable to {@link urlSanitizer} to be trusted implicitly. 12609 * 12610 * @param trustedUrl `url` string which needs to be implicitly trusted. 12611 * @returns a `url` which has been branded to be implicitly trusted. 12612 */ 12613function bypassSanitizationTrustUrl(trustedUrl) { 12614 return new SafeUrlImpl(trustedUrl); 12615} 12616/** 12617 * Mark `url` string as trusted. 12618 * 12619 * This function wraps the trusted string in `String` and brands it in a way which makes it 12620 * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly. 12621 * 12622 * @param trustedResourceUrl `url` string which needs to be implicitly trusted. 12623 * @returns a `url` which has been branded to be implicitly trusted. 12624 */ 12625function bypassSanitizationTrustResourceUrl(trustedResourceUrl) { 12626 return new SafeResourceUrlImpl(trustedResourceUrl); 12627} 12628 12629/** 12630 * @license 12631 * Copyright Google LLC All Rights Reserved. 12632 * 12633 * Use of this source code is governed by an MIT-style license that can be 12634 * found in the LICENSE file at https://angular.io/license 12635 */ 12636/** 12637 * This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`. 12638 * 12639 * For more information on how to run and debug tests with either Ivy or View Engine (legacy), 12640 * please see [BAZEL.md](./docs/BAZEL.md). 12641 */ 12642let _devMode = true; 12643let _runModeLocked = false; 12644/** 12645 * Returns whether Angular is in development mode. After called once, 12646 * the value is locked and won't change any more. 12647 * 12648 * By default, this is true, unless a user calls `enableProdMode` before calling this. 12649 * 12650 * @publicApi 12651 */ 12652function isDevMode() { 12653 _runModeLocked = true; 12654 return _devMode; 12655} 12656/** 12657 * Disable Angular's development mode, which turns off assertions and other 12658 * checks within the framework. 12659 * 12660 * One important assertion this disables verifies that a change detection pass 12661 * does not result in additional changes to any bindings (also known as 12662 * unidirectional data flow). 12663 * 12664 * @publicApi 12665 */ 12666function enableProdMode() { 12667 if (_runModeLocked) { 12668 throw new Error('Cannot enable prod mode after platform setup.'); 12669 } 12670 _devMode = false; 12671} 12672 12673/** 12674 * @license 12675 * Copyright Google LLC All Rights Reserved. 12676 * 12677 * Use of this source code is governed by an MIT-style license that can be 12678 * found in the LICENSE file at https://angular.io/license 12679 */ 12680/** 12681 * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML 12682 * that needs sanitizing. 12683 * Depending upon browser support we use one of two strategies for doing this. 12684 * Default: DOMParser strategy 12685 * Fallback: InertDocument strategy 12686 */ 12687function getInertBodyHelper(defaultDoc) { 12688 return isDOMParserAvailable() ? new DOMParserHelper() : new InertDocumentHelper(defaultDoc); 12689} 12690/** 12691 * Uses DOMParser to create and fill an inert body element. 12692 * This is the default strategy used in browsers that support it. 12693 */ 12694class DOMParserHelper { 12695 getInertBodyElement(html) { 12696 // We add these extra elements to ensure that the rest of the content is parsed as expected 12697 // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the 12698 // `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags 12699 // in `html` from consuming the otherwise explicit `</body>` tag. 12700 html = '<body><remove></remove>' + html; 12701 try { 12702 const body = new window.DOMParser().parseFromString(html, 'text/html').body; 12703 body.removeChild(body.firstChild); 12704 return body; 12705 } 12706 catch (_a) { 12707 return null; 12708 } 12709 } 12710} 12711/** 12712 * Use an HTML5 `template` element, if supported, or an inert body element created via 12713 * `createHtmlDocument` to create and fill an inert DOM element. 12714 * This is the fallback strategy if the browser does not support DOMParser. 12715 */ 12716class InertDocumentHelper { 12717 constructor(defaultDoc) { 12718 this.defaultDoc = defaultDoc; 12719 this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert'); 12720 if (this.inertDocument.body == null) { 12721 // usually there should be only one body element in the document, but IE doesn't have any, so 12722 // we need to create one. 12723 const inertHtml = this.inertDocument.createElement('html'); 12724 this.inertDocument.appendChild(inertHtml); 12725 const inertBodyElement = this.inertDocument.createElement('body'); 12726 inertHtml.appendChild(inertBodyElement); 12727 } 12728 } 12729 getInertBodyElement(html) { 12730 // Prefer using <template> element if supported. 12731 const templateEl = this.inertDocument.createElement('template'); 12732 if ('content' in templateEl) { 12733 templateEl.innerHTML = html; 12734 return templateEl; 12735 } 12736 // Note that previously we used to do something like `this.inertDocument.body.innerHTML = html` 12737 // and we returned the inert `body` node. This was changed, because IE seems to treat setting 12738 // `innerHTML` on an inserted element differently, compared to one that hasn't been inserted 12739 // yet. In particular, IE appears to split some of the text into multiple text nodes rather 12740 // than keeping them in a single one which ends up messing with Ivy's i18n parsing further 12741 // down the line. This has been worked around by creating a new inert `body` and using it as 12742 // the root node in which we insert the HTML. 12743 const inertBody = this.inertDocument.createElement('body'); 12744 inertBody.innerHTML = html; 12745 // Support: IE 9-11 only 12746 // strip custom-namespaced attributes on IE<=11 12747 if (this.defaultDoc.documentMode) { 12748 this.stripCustomNsAttrs(inertBody); 12749 } 12750 return inertBody; 12751 } 12752 /** 12753 * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' 12754 * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g. 12755 * 'ns1:xlink:foo'). 12756 * 12757 * This is undesirable since we don't want to allow any of these custom attributes. This method 12758 * strips them all. 12759 */ 12760 stripCustomNsAttrs(el) { 12761 const elAttrs = el.attributes; 12762 // loop backwards so that we can support removals. 12763 for (let i = elAttrs.length - 1; 0 < i; i--) { 12764 const attrib = elAttrs.item(i); 12765 const attrName = attrib.name; 12766 if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) { 12767 el.removeAttribute(attrName); 12768 } 12769 } 12770 let childNode = el.firstChild; 12771 while (childNode) { 12772 if (childNode.nodeType === Node.ELEMENT_NODE) 12773 this.stripCustomNsAttrs(childNode); 12774 childNode = childNode.nextSibling; 12775 } 12776 } 12777} 12778/** 12779 * We need to determine whether the DOMParser exists in the global context and 12780 * supports parsing HTML; HTML parsing support is not as wide as other formats, see 12781 * https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility. 12782 * 12783 * @suppress {uselessCode} 12784 */ 12785function isDOMParserAvailable() { 12786 try { 12787 return !!new window.DOMParser().parseFromString('', 'text/html'); 12788 } 12789 catch (_a) { 12790 return false; 12791 } 12792} 12793 12794/** 12795 * @license 12796 * Copyright Google LLC All Rights Reserved. 12797 * 12798 * Use of this source code is governed by an MIT-style license that can be 12799 * found in the LICENSE file at https://angular.io/license 12800 */ 12801/** 12802 * A pattern that recognizes a commonly useful subset of URLs that are safe. 12803 * 12804 * This regular expression matches a subset of URLs that will not cause script 12805 * execution if used in URL context within a HTML document. Specifically, this 12806 * regular expression matches if (comment from here on and regex copied from 12807 * Soy's EscapingConventions): 12808 * (1) Either an allowed protocol (http, https, mailto or ftp). 12809 * (2) or no protocol. A protocol must be followed by a colon. The below 12810 * allows that by allowing colons only after one of the characters [/?#]. 12811 * A colon after a hash (#) must be in the fragment. 12812 * Otherwise, a colon after a (?) must be in a query. 12813 * Otherwise, a colon after a single solidus (/) must be in a path. 12814 * Otherwise, a colon after a double solidus (//) must be in the authority 12815 * (before port). 12816 * 12817 * The pattern disallows &, used in HTML entity declarations before 12818 * one of the characters in [/?#]. This disallows HTML entities used in the 12819 * protocol name, which should never happen, e.g. "http" for "http". 12820 * It also disallows HTML entities in the first path part of a relative path, 12821 * e.g. "foo<bar/baz". Our existing escaping functions should not produce 12822 * that. More importantly, it disallows masking of a colon, 12823 * e.g. "javascript:...". 12824 * 12825 * This regular expression was taken from the Closure sanitization library. 12826 */ 12827const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; 12828/* A pattern that matches safe srcset values */ 12829const SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi; 12830/** A pattern that matches safe data URLs. Only matches image, video and audio types. */ 12831const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i; 12832function _sanitizeUrl(url) { 12833 url = String(url); 12834 if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN)) 12835 return url; 12836 if (isDevMode()) { 12837 console.warn(`WARNING: sanitizing unsafe URL value ${url} (see http://g.co/ng/security#xss)`); 12838 } 12839 return 'unsafe:' + url; 12840} 12841function sanitizeSrcset(srcset) { 12842 srcset = String(srcset); 12843 return srcset.split(',').map((srcset) => _sanitizeUrl(srcset.trim())).join(', '); 12844} 12845 12846/** 12847 * @license 12848 * Copyright Google LLC All Rights Reserved. 12849 * 12850 * Use of this source code is governed by an MIT-style license that can be 12851 * found in the LICENSE file at https://angular.io/license 12852 */ 12853function tagSet(tags) { 12854 const res = {}; 12855 for (const t of tags.split(',')) 12856 res[t] = true; 12857 return res; 12858} 12859function merge(...sets) { 12860 const res = {}; 12861 for (const s of sets) { 12862 for (const v in s) { 12863 if (s.hasOwnProperty(v)) 12864 res[v] = true; 12865 } 12866 } 12867 return res; 12868} 12869// Good source of info about elements and attributes 12870// http://dev.w3.org/html5/spec/Overview.html#semantics 12871// http://simon.html5.org/html-elements 12872// Safe Void Elements - HTML5 12873// http://dev.w3.org/html5/spec/Overview.html#void-elements 12874const VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr'); 12875// Elements that you can, intentionally, leave open (and which close themselves) 12876// http://dev.w3.org/html5/spec/Overview.html#optional-tags 12877const OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'); 12878const OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt'); 12879const OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS); 12880// Safe Block Elements - HTML5 12881const BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' + 12882 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + 12883 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul')); 12884// Inline Elements - HTML5 12885const INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' + 12886 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' + 12887 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video')); 12888const VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS); 12889// Attributes that have href and hence need to be sanitized 12890const URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href'); 12891// Attributes that have special href set hence need to be sanitized 12892const SRCSET_ATTRS = tagSet('srcset'); 12893const HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' + 12894 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' + 12895 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' + 12896 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' + 12897 'valign,value,vspace,width'); 12898// Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018) 12899const ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' + 12900 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' + 12901 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' + 12902 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' + 12903 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' + 12904 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' + 12905 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext'); 12906// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security 12907// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via 12908// innerHTML is required, SVG attributes should be added here. 12909// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those 12910// can be sanitized, but they increase security surface area without a legitimate use case, so they 12911// are left out here. 12912const VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS, ARIA_ATTRS); 12913// Elements whose content should not be traversed/preserved, if the elements themselves are invalid. 12914// 12915// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve) 12916// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we 12917// don't want to preserve the content, if the elements themselves are going to be removed. 12918const SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template'); 12919/** 12920 * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe 12921 * attributes. 12922 */ 12923class SanitizingHtmlSerializer { 12924 constructor() { 12925 // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just 12926 // because characters were re-encoded. 12927 this.sanitizedSomething = false; 12928 this.buf = []; 12929 } 12930 sanitizeChildren(el) { 12931 // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters. 12932 // However this code never accesses properties off of `document` before deleting its contents 12933 // again, so it shouldn't be vulnerable to DOM clobbering. 12934 let current = el.firstChild; 12935 let traverseContent = true; 12936 while (current) { 12937 if (current.nodeType === Node.ELEMENT_NODE) { 12938 traverseContent = this.startElement(current); 12939 } 12940 else if (current.nodeType === Node.TEXT_NODE) { 12941 this.chars(current.nodeValue); 12942 } 12943 else { 12944 // Strip non-element, non-text nodes. 12945 this.sanitizedSomething = true; 12946 } 12947 if (traverseContent && current.firstChild) { 12948 current = current.firstChild; 12949 continue; 12950 } 12951 while (current) { 12952 // Leaving the element. Walk up and to the right, closing tags as we go. 12953 if (current.nodeType === Node.ELEMENT_NODE) { 12954 this.endElement(current); 12955 } 12956 let next = this.checkClobberedElement(current, current.nextSibling); 12957 if (next) { 12958 current = next; 12959 break; 12960 } 12961 current = this.checkClobberedElement(current, current.parentNode); 12962 } 12963 } 12964 return this.buf.join(''); 12965 } 12966 /** 12967 * Sanitizes an opening element tag (if valid) and returns whether the element's contents should 12968 * be traversed. Element content must always be traversed (even if the element itself is not 12969 * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`. 12970 * 12971 * @param element The element to sanitize. 12972 * @return True if the element's contents should be traversed. 12973 */ 12974 startElement(element) { 12975 const tagName = element.nodeName.toLowerCase(); 12976 if (!VALID_ELEMENTS.hasOwnProperty(tagName)) { 12977 this.sanitizedSomething = true; 12978 return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName); 12979 } 12980 this.buf.push('<'); 12981 this.buf.push(tagName); 12982 const elAttrs = element.attributes; 12983 for (let i = 0; i < elAttrs.length; i++) { 12984 const elAttr = elAttrs.item(i); 12985 const attrName = elAttr.name; 12986 const lower = attrName.toLowerCase(); 12987 if (!VALID_ATTRS.hasOwnProperty(lower)) { 12988 this.sanitizedSomething = true; 12989 continue; 12990 } 12991 let value = elAttr.value; 12992 // TODO(martinprobst): Special case image URIs for data:image/... 12993 if (URI_ATTRS[lower]) 12994 value = _sanitizeUrl(value); 12995 if (SRCSET_ATTRS[lower]) 12996 value = sanitizeSrcset(value); 12997 this.buf.push(' ', attrName, '="', encodeEntities(value), '"'); 12998 } 12999 this.buf.push('>'); 13000 return true; 13001 } 13002 endElement(current) { 13003 const tagName = current.nodeName.toLowerCase(); 13004 if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) { 13005 this.buf.push('</'); 13006 this.buf.push(tagName); 13007 this.buf.push('>'); 13008 } 13009 } 13010 chars(chars) { 13011 this.buf.push(encodeEntities(chars)); 13012 } 13013 checkClobberedElement(node, nextNode) { 13014 if (nextNode && 13015 (node.compareDocumentPosition(nextNode) & 13016 Node.DOCUMENT_POSITION_CONTAINED_BY) === Node.DOCUMENT_POSITION_CONTAINED_BY) { 13017 throw new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`); 13018 } 13019 return nextNode; 13020 } 13021} 13022// Regular Expressions for parsing tags and attributes 13023const SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; 13024// ! to ~ is the ASCII range. 13025const NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g; 13026/** 13027 * Escapes all potentially dangerous characters, so that the 13028 * resulting string can be safely inserted into attribute or 13029 * element text. 13030 * @param value 13031 */ 13032function encodeEntities(value) { 13033 return value.replace(/&/g, '&') 13034 .replace(SURROGATE_PAIR_REGEXP, function (match) { 13035 const hi = match.charCodeAt(0); 13036 const low = match.charCodeAt(1); 13037 return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'; 13038 }) 13039 .replace(NON_ALPHANUMERIC_REGEXP, function (match) { 13040 return '&#' + match.charCodeAt(0) + ';'; 13041 }) 13042 .replace(/</g, '<') 13043 .replace(/>/g, '>'); 13044} 13045let inertBodyHelper; 13046/** 13047 * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to 13048 * the DOM in a browser environment. 13049 */ 13050function _sanitizeHtml(defaultDoc, unsafeHtmlInput) { 13051 let inertBodyElement = null; 13052 try { 13053 inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc); 13054 // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime). 13055 let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : ''; 13056 inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml); 13057 // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser 13058 // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous. 13059 let mXSSAttempts = 5; 13060 let parsedHtml = unsafeHtml; 13061 do { 13062 if (mXSSAttempts === 0) { 13063 throw new Error('Failed to sanitize html because the input is unstable'); 13064 } 13065 mXSSAttempts--; 13066 unsafeHtml = parsedHtml; 13067 parsedHtml = inertBodyElement.innerHTML; 13068 inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml); 13069 } while (unsafeHtml !== parsedHtml); 13070 const sanitizer = new SanitizingHtmlSerializer(); 13071 const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement); 13072 if (isDevMode() && sanitizer.sanitizedSomething) { 13073 console.warn('WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss'); 13074 } 13075 return safeHtml; 13076 } 13077 finally { 13078 // In case anything goes wrong, clear out inertElement to reset the entire DOM structure. 13079 if (inertBodyElement) { 13080 const parent = getTemplateContent(inertBodyElement) || inertBodyElement; 13081 while (parent.firstChild) { 13082 parent.removeChild(parent.firstChild); 13083 } 13084 } 13085 } 13086} 13087function getTemplateContent(el) { 13088 return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el) ? 13089 el.content : 13090 null; 13091} 13092function isTemplateElement(el) { 13093 return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE'; 13094} 13095 13096/** 13097 * @license 13098 * Copyright Google LLC All Rights Reserved. 13099 * 13100 * Use of this source code is governed by an MIT-style license that can be 13101 * found in the LICENSE file at https://angular.io/license 13102 */ 13103/** 13104 * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property 13105 * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly 13106 * handled. 13107 * 13108 * See DomSanitizer for more details on security in Angular applications. 13109 * 13110 * @publicApi 13111 */ 13112var SecurityContext; 13113(function (SecurityContext) { 13114 SecurityContext[SecurityContext["NONE"] = 0] = "NONE"; 13115 SecurityContext[SecurityContext["HTML"] = 1] = "HTML"; 13116 SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE"; 13117 SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT"; 13118 SecurityContext[SecurityContext["URL"] = 4] = "URL"; 13119 SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL"; 13120})(SecurityContext || (SecurityContext = {})); 13121 13122/** 13123 * @license 13124 * Copyright Google LLC All Rights Reserved. 13125 * 13126 * Use of this source code is governed by an MIT-style license that can be 13127 * found in the LICENSE file at https://angular.io/license 13128 */ 13129/** 13130 * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing 13131 * dangerous content. 13132 * 13133 * This method parses the `html` and locates potentially dangerous content (such as urls and 13134 * javascript) and removes it. 13135 * 13136 * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}. 13137 * 13138 * @param unsafeHtml untrusted `html`, typically from the user. 13139 * @returns `html` string which is safe to display to user, because all of the dangerous javascript 13140 * and urls have been removed. 13141 * 13142 * @codeGenApi 13143 */ 13144function ɵɵsanitizeHtml(unsafeHtml) { 13145 const sanitizer = getSanitizer(); 13146 if (sanitizer) { 13147 return sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || ''; 13148 } 13149 if (allowSanitizationBypassAndThrow(unsafeHtml, "HTML" /* Html */)) { 13150 return unwrapSafeValue(unsafeHtml); 13151 } 13152 return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml)); 13153} 13154/** 13155 * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing 13156 * dangerous content. 13157 * 13158 * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}. 13159 * 13160 * @param unsafeStyle untrusted `style`, typically from the user. 13161 * @returns `style` string which is safe to bind to the `style` properties. 13162 * 13163 * @codeGenApi 13164 */ 13165function ɵɵsanitizeStyle(unsafeStyle) { 13166 const sanitizer = getSanitizer(); 13167 if (sanitizer) { 13168 return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || ''; 13169 } 13170 if (allowSanitizationBypassAndThrow(unsafeStyle, "Style" /* Style */)) { 13171 return unwrapSafeValue(unsafeStyle); 13172 } 13173 return renderStringify(unsafeStyle); 13174} 13175/** 13176 * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing 13177 * dangerous 13178 * content. 13179 * 13180 * This method parses the `url` and locates potentially dangerous content (such as javascript) and 13181 * removes it. 13182 * 13183 * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}. 13184 * 13185 * @param unsafeUrl untrusted `url`, typically from the user. 13186 * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because 13187 * all of the dangerous javascript has been removed. 13188 * 13189 * @codeGenApi 13190 */ 13191function ɵɵsanitizeUrl(unsafeUrl) { 13192 const sanitizer = getSanitizer(); 13193 if (sanitizer) { 13194 return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || ''; 13195 } 13196 if (allowSanitizationBypassAndThrow(unsafeUrl, "URL" /* Url */)) { 13197 return unwrapSafeValue(unsafeUrl); 13198 } 13199 return _sanitizeUrl(renderStringify(unsafeUrl)); 13200} 13201/** 13202 * A `url` sanitizer which only lets trusted `url`s through. 13203 * 13204 * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}. 13205 * 13206 * @param unsafeResourceUrl untrusted `url`, typically from the user. 13207 * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because 13208 * only trusted `url`s have been allowed to pass. 13209 * 13210 * @codeGenApi 13211 */ 13212function ɵɵsanitizeResourceUrl(unsafeResourceUrl) { 13213 const sanitizer = getSanitizer(); 13214 if (sanitizer) { 13215 return sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || ''; 13216 } 13217 if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* ResourceUrl */)) { 13218 return unwrapSafeValue(unsafeResourceUrl); 13219 } 13220 throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)'); 13221} 13222/** 13223 * A `script` sanitizer which only lets trusted javascript through. 13224 * 13225 * This passes only `script`s marked trusted by calling {@link 13226 * bypassSanitizationTrustScript}. 13227 * 13228 * @param unsafeScript untrusted `script`, typically from the user. 13229 * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`, 13230 * because only trusted `scripts` have been allowed to pass. 13231 * 13232 * @codeGenApi 13233 */ 13234function ɵɵsanitizeScript(unsafeScript) { 13235 const sanitizer = getSanitizer(); 13236 if (sanitizer) { 13237 return sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || ''; 13238 } 13239 if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* Script */)) { 13240 return unwrapSafeValue(unsafeScript); 13241 } 13242 throw new Error('unsafe value used in a script context'); 13243} 13244/** 13245 * Detects which sanitizer to use for URL property, based on tag name and prop name. 13246 * 13247 * The rules are based on the RESOURCE_URL context config from 13248 * `packages/compiler/src/schema/dom_security_schema.ts`. 13249 * If tag and prop names don't match Resource URL schema, use URL sanitizer. 13250 */ 13251function getUrlSanitizer(tag, prop) { 13252 if ((prop === 'src' && 13253 (tag === 'embed' || tag === 'frame' || tag === 'iframe' || tag === 'media' || 13254 tag === 'script')) || 13255 (prop === 'href' && (tag === 'base' || tag === 'link'))) { 13256 return ɵɵsanitizeResourceUrl; 13257 } 13258 return ɵɵsanitizeUrl; 13259} 13260/** 13261 * Sanitizes URL, selecting sanitizer function based on tag and property names. 13262 * 13263 * This function is used in case we can't define security context at compile time, when only prop 13264 * name is available. This happens when we generate host bindings for Directives/Components. The 13265 * host element is unknown at compile time, so we defer calculation of specific sanitizer to 13266 * runtime. 13267 * 13268 * @param unsafeUrl untrusted `url`, typically from the user. 13269 * @param tag target element tag name. 13270 * @param prop name of the property that contains the value. 13271 * @returns `url` string which is safe to bind. 13272 * 13273 * @codeGenApi 13274 */ 13275function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) { 13276 return getUrlSanitizer(tag, prop)(unsafeUrl); 13277} 13278function validateAgainstEventProperties(name) { 13279 if (name.toLowerCase().startsWith('on')) { 13280 const msg = `Binding to event property '${name}' is disallowed for security reasons, ` + 13281 `please use (${name.slice(2)})=...` + 13282 `\nIf '${name}' is a directive input, make sure the directive is imported by the` + 13283 ` current module.`; 13284 throw new Error(msg); 13285 } 13286} 13287function validateAgainstEventAttributes(name) { 13288 if (name.toLowerCase().startsWith('on')) { 13289 const msg = `Binding to event attribute '${name}' is disallowed for security reasons, ` + 13290 `please use (${name.slice(2)})=...`; 13291 throw new Error(msg); 13292 } 13293} 13294function getSanitizer() { 13295 const lView = getLView(); 13296 return lView && lView[SANITIZER]; 13297} 13298 13299/** 13300 * @license 13301 * Copyright Google LLC All Rights Reserved. 13302 * 13303 * Use of this source code is governed by an MIT-style license that can be 13304 * found in the LICENSE file at https://angular.io/license 13305 */ 13306/** 13307 * THIS FILE CONTAINS CODE WHICH SHOULD BE TREE SHAKEN AND NEVER CALLED FROM PRODUCTION CODE!!! 13308 */ 13309/** 13310 * Creates an `Array` construction with a given name. This is useful when 13311 * looking for memory consumption to see what time of array it is. 13312 * 13313 * 13314 * @param name Name to give to the constructor 13315 * @returns A subclass of `Array` if possible. This can only be done in 13316 * environments which support `class` construct. 13317 */ 13318function createNamedArrayType(name) { 13319 // This should never be called in prod mode, so let's verify that is the case. 13320 if (ngDevMode) { 13321 try { 13322 // We need to do it this way so that TypeScript does not down-level the below code. 13323 const FunctionConstructor = createNamedArrayType.constructor; 13324 return (new FunctionConstructor('Array', `return class ${name} extends Array{}`))(Array); 13325 } 13326 catch (e) { 13327 // If it does not work just give up and fall back to regular Array. 13328 return Array; 13329 } 13330 } 13331 else { 13332 throw new Error('Looks like we are in \'prod mode\', but we are creating a named Array type, which is wrong! Check your code'); 13333 } 13334} 13335 13336/** 13337 * @license 13338 * Copyright Google LLC All Rights Reserved. 13339 * 13340 * Use of this source code is governed by an MIT-style license that can be 13341 * found in the LICENSE file at https://angular.io/license 13342 */ 13343function normalizeDebugBindingName(name) { 13344 // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers 13345 name = camelCaseToDashCase(name.replace(/[$@]/g, '_')); 13346 return `ng-reflect-${name}`; 13347} 13348const CAMEL_CASE_REGEXP = /([A-Z])/g; 13349function camelCaseToDashCase(input) { 13350 return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase()); 13351} 13352function normalizeDebugBindingValue(value) { 13353 try { 13354 // Limit the size of the value as otherwise the DOM just gets polluted. 13355 return value != null ? value.toString().slice(0, 30) : value; 13356 } 13357 catch (e) { 13358 return '[ERROR] Exception while trying to serialize the value'; 13359 } 13360} 13361 13362/** 13363 * @license 13364 * Copyright Google LLC All Rights Reserved. 13365 * 13366 * Use of this source code is governed by an MIT-style license that can be 13367 * found in the LICENSE file at https://angular.io/license 13368 */ 13369/** 13370 * Returns the matching `LContext` data for a given DOM node, directive or component instance. 13371 * 13372 * This function will examine the provided DOM element, component, or directive instance\'s 13373 * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched 13374 * value will be that of the newly created `LContext`. 13375 * 13376 * If the monkey-patched value is the `LView` instance then the context value for that 13377 * target will be created and the monkey-patch reference will be updated. Therefore when this 13378 * function is called it may mutate the provided element\'s, component\'s or any of the associated 13379 * directive\'s monkey-patch values. 13380 * 13381 * If the monkey-patch value is not detected then the code will walk up the DOM until an element 13382 * is found which contains a monkey-patch reference. When that occurs then the provided element 13383 * will be updated with a new context (which is then returned). If the monkey-patch value is not 13384 * detected for a component/directive instance then it will throw an error (all components and 13385 * directives should be automatically monkey-patched by ivy). 13386 * 13387 * @param target Component, Directive or DOM Node. 13388 */ 13389function getLContext(target) { 13390 let mpValue = readPatchedData(target); 13391 if (mpValue) { 13392 // only when it's an array is it considered an LView instance 13393 // ... otherwise it's an already constructed LContext instance 13394 if (Array.isArray(mpValue)) { 13395 const lView = mpValue; 13396 let nodeIndex; 13397 let component = undefined; 13398 let directives = undefined; 13399 if (isComponentInstance(target)) { 13400 nodeIndex = findViaComponent(lView, target); 13401 if (nodeIndex == -1) { 13402 throw new Error('The provided component was not found in the application'); 13403 } 13404 component = target; 13405 } 13406 else if (isDirectiveInstance(target)) { 13407 nodeIndex = findViaDirective(lView, target); 13408 if (nodeIndex == -1) { 13409 throw new Error('The provided directive was not found in the application'); 13410 } 13411 directives = getDirectivesAtNodeIndex(nodeIndex, lView, false); 13412 } 13413 else { 13414 nodeIndex = findViaNativeElement(lView, target); 13415 if (nodeIndex == -1) { 13416 return null; 13417 } 13418 } 13419 // the goal is not to fill the entire context full of data because the lookups 13420 // are expensive. Instead, only the target data (the element, component, container, ICU 13421 // expression or directive details) are filled into the context. If called multiple times 13422 // with different target values then the missing target data will be filled in. 13423 const native = unwrapRNode(lView[nodeIndex]); 13424 const existingCtx = readPatchedData(native); 13425 const context = (existingCtx && !Array.isArray(existingCtx)) ? 13426 existingCtx : 13427 createLContext(lView, nodeIndex, native); 13428 // only when the component has been discovered then update the monkey-patch 13429 if (component && context.component === undefined) { 13430 context.component = component; 13431 attachPatchData(context.component, context); 13432 } 13433 // only when the directives have been discovered then update the monkey-patch 13434 if (directives && context.directives === undefined) { 13435 context.directives = directives; 13436 for (let i = 0; i < directives.length; i++) { 13437 attachPatchData(directives[i], context); 13438 } 13439 } 13440 attachPatchData(context.native, context); 13441 mpValue = context; 13442 } 13443 } 13444 else { 13445 const rElement = target; 13446 ngDevMode && assertDomNode(rElement); 13447 // if the context is not found then we need to traverse upwards up the DOM 13448 // to find the nearest element that has already been monkey patched with data 13449 let parent = rElement; 13450 while (parent = parent.parentNode) { 13451 const parentContext = readPatchedData(parent); 13452 if (parentContext) { 13453 let lView; 13454 if (Array.isArray(parentContext)) { 13455 lView = parentContext; 13456 } 13457 else { 13458 lView = parentContext.lView; 13459 } 13460 // the edge of the app was also reached here through another means 13461 // (maybe because the DOM was changed manually). 13462 if (!lView) { 13463 return null; 13464 } 13465 const index = findViaNativeElement(lView, rElement); 13466 if (index >= 0) { 13467 const native = unwrapRNode(lView[index]); 13468 const context = createLContext(lView, index, native); 13469 attachPatchData(native, context); 13470 mpValue = context; 13471 break; 13472 } 13473 } 13474 } 13475 } 13476 return mpValue || null; 13477} 13478/** 13479 * Creates an empty instance of a `LContext` context 13480 */ 13481function createLContext(lView, nodeIndex, native) { 13482 return { 13483 lView, 13484 nodeIndex, 13485 native, 13486 component: undefined, 13487 directives: undefined, 13488 localRefs: undefined, 13489 }; 13490} 13491/** 13492 * Takes a component instance and returns the view for that component. 13493 * 13494 * @param componentInstance 13495 * @returns The component's view 13496 */ 13497function getComponentViewByInstance(componentInstance) { 13498 let lView = readPatchedData(componentInstance); 13499 let view; 13500 if (Array.isArray(lView)) { 13501 const nodeIndex = findViaComponent(lView, componentInstance); 13502 view = getComponentLViewByIndex(nodeIndex, lView); 13503 const context = createLContext(lView, nodeIndex, view[HOST]); 13504 context.component = componentInstance; 13505 attachPatchData(componentInstance, context); 13506 attachPatchData(context.native, context); 13507 } 13508 else { 13509 const context = lView; 13510 view = getComponentLViewByIndex(context.nodeIndex, context.lView); 13511 } 13512 return view; 13513} 13514/** 13515 * Assigns the given data to the given target (which could be a component, 13516 * directive or DOM node instance) using monkey-patching. 13517 */ 13518function attachPatchData(target, data) { 13519 target[MONKEY_PATCH_KEY_NAME] = data; 13520} 13521function isComponentInstance(instance) { 13522 return instance && instance.constructor && instance.constructor.ɵcmp; 13523} 13524function isDirectiveInstance(instance) { 13525 return instance && instance.constructor && instance.constructor.ɵdir; 13526} 13527/** 13528 * Locates the element within the given LView and returns the matching index 13529 */ 13530function findViaNativeElement(lView, target) { 13531 let tNode = lView[TVIEW].firstChild; 13532 while (tNode) { 13533 const native = getNativeByTNodeOrNull(tNode, lView); 13534 if (native === target) { 13535 return tNode.index; 13536 } 13537 tNode = traverseNextElement(tNode); 13538 } 13539 return -1; 13540} 13541/** 13542 * Locates the next tNode (child, sibling or parent). 13543 */ 13544function traverseNextElement(tNode) { 13545 if (tNode.child) { 13546 return tNode.child; 13547 } 13548 else if (tNode.next) { 13549 return tNode.next; 13550 } 13551 else { 13552 // Let's take the following template: <div><span>text</span></div><component/> 13553 // After checking the text node, we need to find the next parent that has a "next" TNode, 13554 // in this case the parent `div`, so that we can find the component. 13555 while (tNode.parent && !tNode.parent.next) { 13556 tNode = tNode.parent; 13557 } 13558 return tNode.parent && tNode.parent.next; 13559 } 13560} 13561/** 13562 * Locates the component within the given LView and returns the matching index 13563 */ 13564function findViaComponent(lView, componentInstance) { 13565 const componentIndices = lView[TVIEW].components; 13566 if (componentIndices) { 13567 for (let i = 0; i < componentIndices.length; i++) { 13568 const elementComponentIndex = componentIndices[i]; 13569 const componentView = getComponentLViewByIndex(elementComponentIndex, lView); 13570 if (componentView[CONTEXT] === componentInstance) { 13571 return elementComponentIndex; 13572 } 13573 } 13574 } 13575 else { 13576 const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView); 13577 const rootComponent = rootComponentView[CONTEXT]; 13578 if (rootComponent === componentInstance) { 13579 // we are dealing with the root element here therefore we know that the 13580 // element is the very first element after the HEADER data in the lView 13581 return HEADER_OFFSET; 13582 } 13583 } 13584 return -1; 13585} 13586/** 13587 * Locates the directive within the given LView and returns the matching index 13588 */ 13589function findViaDirective(lView, directiveInstance) { 13590 // if a directive is monkey patched then it will (by default) 13591 // have a reference to the LView of the current view. The 13592 // element bound to the directive being search lives somewhere 13593 // in the view data. We loop through the nodes and check their 13594 // list of directives for the instance. 13595 let tNode = lView[TVIEW].firstChild; 13596 while (tNode) { 13597 const directiveIndexStart = tNode.directiveStart; 13598 const directiveIndexEnd = tNode.directiveEnd; 13599 for (let i = directiveIndexStart; i < directiveIndexEnd; i++) { 13600 if (lView[i] === directiveInstance) { 13601 return tNode.index; 13602 } 13603 } 13604 tNode = traverseNextElement(tNode); 13605 } 13606 return -1; 13607} 13608/** 13609 * Returns a list of directives extracted from the given view based on the 13610 * provided list of directive index values. 13611 * 13612 * @param nodeIndex The node index 13613 * @param lView The target view data 13614 * @param includeComponents Whether or not to include components in returned directives 13615 */ 13616function getDirectivesAtNodeIndex(nodeIndex, lView, includeComponents) { 13617 const tNode = lView[TVIEW].data[nodeIndex]; 13618 let directiveStartIndex = tNode.directiveStart; 13619 if (directiveStartIndex == 0) 13620 return EMPTY_ARRAY; 13621 const directiveEndIndex = tNode.directiveEnd; 13622 if (!includeComponents && tNode.flags & 2 /* isComponentHost */) 13623 directiveStartIndex++; 13624 return lView.slice(directiveStartIndex, directiveEndIndex); 13625} 13626function getComponentAtNodeIndex(nodeIndex, lView) { 13627 const tNode = lView[TVIEW].data[nodeIndex]; 13628 let directiveStartIndex = tNode.directiveStart; 13629 return tNode.flags & 2 /* isComponentHost */ ? lView[directiveStartIndex] : null; 13630} 13631/** 13632 * Returns a map of local references (local reference name => element or directive instance) that 13633 * exist on a given element. 13634 */ 13635function discoverLocalRefs(lView, nodeIndex) { 13636 const tNode = lView[TVIEW].data[nodeIndex]; 13637 if (tNode && tNode.localNames) { 13638 const result = {}; 13639 let localIndex = tNode.index + 1; 13640 for (let i = 0; i < tNode.localNames.length; i += 2) { 13641 result[tNode.localNames[i]] = lView[localIndex]; 13642 localIndex++; 13643 } 13644 return result; 13645 } 13646 return null; 13647} 13648 13649/** Called when directives inject each other (creating a circular dependency) */ 13650function throwCyclicDependencyError(token) { 13651 throw new Error(`Cannot instantiate cyclic dependency! ${token}`); 13652} 13653/** Called when there are multiple component selectors that match a given node */ 13654function throwMultipleComponentError(tNode) { 13655 throw new Error(`Multiple components match node with tagname ${tNode.tagName}`); 13656} 13657function throwMixedMultiProviderError() { 13658 throw new Error(`Cannot mix multi providers and regular providers`); 13659} 13660function throwInvalidProviderError(ngModuleType, providers, provider) { 13661 let ngModuleDetail = ''; 13662 if (ngModuleType && providers) { 13663 const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...'); 13664 ngModuleDetail = 13665 ` - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`; 13666 } 13667 throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}'` + ngModuleDetail); 13668} 13669/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */ 13670function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) { 13671 const field = propName ? ` for '${propName}'` : ''; 13672 let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${oldValue}'. Current value: '${currValue}'.`; 13673 if (creationMode) { 13674 msg += 13675 ` It seems like the view has been created after its parent and its children have been dirty checked.` + 13676 ` Has it been created in a change detection hook?`; 13677 } 13678 // TODO: include debug context, see `viewDebugError` function in 13679 // `packages/core/src/view/errors.ts` for reference. 13680 throw new Error(msg); 13681} 13682function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) { 13683 const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER); 13684 let oldValue = prefix, newValue = prefix; 13685 for (let i = 0; i < chunks.length; i++) { 13686 const slotIdx = rootIndex + i; 13687 oldValue += `${lView[slotIdx]}${chunks[i]}`; 13688 newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`; 13689 } 13690 return { propName, oldValue, newValue }; 13691} 13692/** 13693 * Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError: 13694 * - property name (for property bindings or interpolations) 13695 * - old and new values, enriched using information from metadata 13696 * 13697 * More information on the metadata storage format can be found in `storePropertyBindingMetadata` 13698 * function description. 13699 */ 13700function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) { 13701 const tData = lView[TVIEW].data; 13702 const metadata = tData[bindingIndex]; 13703 if (typeof metadata === 'string') { 13704 // metadata for property interpolation 13705 if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) { 13706 return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue); 13707 } 13708 // metadata for property binding 13709 return { propName: metadata, oldValue, newValue }; 13710 } 13711 // metadata is not available for this expression, check if this expression is a part of the 13712 // property interpolation by going from the current binding index left and look for a string that 13713 // contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this: 13714 // [..., 'id�Prefix � and � suffix', null, null, null, ...] 13715 if (metadata === null) { 13716 let idx = bindingIndex - 1; 13717 while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) { 13718 idx--; 13719 } 13720 const meta = tData[idx]; 13721 if (typeof meta === 'string') { 13722 const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g')); 13723 // first interpolation delimiter separates property name from interpolation parts (in case of 13724 // property interpolations), so we subtract one from total number of found delimiters 13725 if (matches && (matches.length - 1) > bindingIndex - idx) { 13726 return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue); 13727 } 13728 } 13729 } 13730 return { propName: undefined, oldValue, newValue }; 13731} 13732 13733/** 13734 * Converts `TNodeType` into human readable text. 13735 * Make sure this matches with `TNodeType` 13736 */ 13737const TNodeTypeAsString = [ 13738 'Container', 13739 'Projection', 13740 'View', 13741 'Element', 13742 'ElementContainer', 13743 'IcuContainer' // 5 13744]; 13745// Note: This hack is necessary so we don't erroneously get a circular dependency 13746// failure based on types. 13747const unusedValueExportToPlacateAjd$4 = 1; 13748/** 13749 * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding. 13750 * 13751 * ``` 13752 * <div my-dir [class]="exp"></div> 13753 * ``` 13754 * and 13755 * ``` 13756 * @Directive({ 13757 * }) 13758 * class MyDirective { 13759 * @Input() 13760 * class: string; 13761 * } 13762 * ``` 13763 * 13764 * In the above case it is necessary to write the reconciled styling information into the 13765 * directive's input. 13766 * 13767 * @param tNode 13768 */ 13769function hasClassInput(tNode) { 13770 return (tNode.flags & 16 /* hasClassInput */) !== 0; 13771} 13772/** 13773 * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding. 13774 * 13775 * ``` 13776 * <div my-dir [style]="exp"></div> 13777 * ``` 13778 * and 13779 * ``` 13780 * @Directive({ 13781 * }) 13782 * class MyDirective { 13783 * @Input() 13784 * class: string; 13785 * } 13786 * ``` 13787 * 13788 * In the above case it is necessary to write the reconciled styling information into the 13789 * directive's input. 13790 * 13791 * @param tNode 13792 */ 13793function hasStyleInput(tNode) { 13794 return (tNode.flags & 32 /* hasStyleInput */) !== 0; 13795} 13796 13797/** 13798 * @license 13799 * Copyright Google LLC All Rights Reserved. 13800 * 13801 * Use of this source code is governed by an MIT-style license that can be 13802 * found in the LICENSE file at https://angular.io/license 13803 */ 13804// Note: This hack is necessary so we don't erroneously get a circular dependency 13805// failure based on types. 13806const unusedValueExportToPlacateAjd$5 = 1; 13807 13808/** 13809 * @license 13810 * Copyright Google LLC All Rights Reserved. 13811 * 13812 * Use of this source code is governed by an MIT-style license that can be 13813 * found in the LICENSE file at https://angular.io/license 13814 */ 13815/** 13816 * Returns an index of `classToSearch` in `className` taking token boundaries into account. 13817 * 13818 * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`) 13819 * 13820 * @param className A string containing classes (whitespace separated) 13821 * @param classToSearch A class name to locate 13822 * @param startingIndex Starting location of search 13823 * @returns an index of the located class (or -1 if not found) 13824 */ 13825function classIndexOf(className, classToSearch, startingIndex) { 13826 ngDevMode && assertNotEqual(classToSearch, '', 'can not look for "" string.'); 13827 let end = className.length; 13828 while (true) { 13829 const foundIndex = className.indexOf(classToSearch, startingIndex); 13830 if (foundIndex === -1) 13831 return foundIndex; 13832 if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* SPACE */) { 13833 // Ensure that it has leading whitespace 13834 const length = classToSearch.length; 13835 if (foundIndex + length === end || 13836 className.charCodeAt(foundIndex + length) <= 32 /* SPACE */) { 13837 // Ensure that it has trailing whitespace 13838 return foundIndex; 13839 } 13840 } 13841 // False positive, keep searching from where we left off. 13842 startingIndex = foundIndex + 1; 13843 } 13844} 13845 13846/** 13847 * @license 13848 * Copyright Google LLC All Rights Reserved. 13849 * 13850 * Use of this source code is governed by an MIT-style license that can be 13851 * found in the LICENSE file at https://angular.io/license 13852 */ 13853const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5; 13854const NG_TEMPLATE_SELECTOR = 'ng-template'; 13855/** 13856 * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive) 13857 * 13858 * @param attrs `TAttributes` to search through. 13859 * @param cssClassToMatch class to match (lowercase) 13860 * @param isProjectionMode Whether or not class matching should look into the attribute `class` in 13861 * addition to the `AttributeMarker.Classes`. 13862 */ 13863function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) { 13864 // TODO(misko): The fact that this function needs to know about `isProjectionMode` seems suspect. 13865 // It is strange to me that sometimes the class information comes in form of `class` attribute 13866 // and sometimes in form of `AttributeMarker.Classes`. Some investigation is needed to determine 13867 // if that is the right behavior. 13868 ngDevMode && 13869 assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.'); 13870 let i = 0; 13871 while (i < attrs.length) { 13872 let item = attrs[i++]; 13873 if (isProjectionMode && item === 'class') { 13874 item = attrs[i]; 13875 if (classIndexOf(item.toLowerCase(), cssClassToMatch, 0) !== -1) { 13876 return true; 13877 } 13878 } 13879 else if (item === 1 /* Classes */) { 13880 // We found the classes section. Start searching for the class. 13881 while (i < attrs.length && typeof (item = attrs[i++]) == 'string') { 13882 // while we have strings 13883 if (item.toLowerCase() === cssClassToMatch) 13884 return true; 13885 } 13886 return false; 13887 } 13888 } 13889 return false; 13890} 13891/** 13892 * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`). 13893 * 13894 * @param tNode current TNode 13895 */ 13896function isInlineTemplate(tNode) { 13897 return tNode.type === 0 /* Container */ && tNode.tagName !== NG_TEMPLATE_SELECTOR; 13898} 13899/** 13900 * Function that checks whether a given tNode matches tag-based selector and has a valid type. 13901 * 13902 * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular 13903 * directive matching mode: 13904 * - in the "directive matching" mode we do _not_ take TContainer's tagName into account if it is 13905 * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a 13906 * tag name was extracted from * syntax so we would match the same directive twice); 13907 * - in the "projection" mode, we use a tag name potentially extracted from the * syntax processing 13908 * (applicable to TNodeType.Container only). 13909 */ 13910function hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) { 13911 const tagNameToCompare = tNode.type === 0 /* Container */ && !isProjectionMode ? 13912 NG_TEMPLATE_SELECTOR : 13913 tNode.tagName; 13914 return currentSelector === tagNameToCompare; 13915} 13916/** 13917 * A utility function to match an Ivy node static data against a simple CSS selector 13918 * 13919 * @param node static data of the node to match 13920 * @param selector The selector to try matching against the node. 13921 * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing 13922 * directive matching. 13923 * @returns true if node matches the selector. 13924 */ 13925function isNodeMatchingSelector(tNode, selector, isProjectionMode) { 13926 ngDevMode && assertDefined(selector[0], 'Selector should have a tag name'); 13927 let mode = 4 /* ELEMENT */; 13928 const nodeAttrs = tNode.attrs || []; 13929 // Find the index of first attribute that has no value, only a name. 13930 const nameOnlyMarkerIdx = getNameOnlyMarkerIndex(nodeAttrs); 13931 // When processing ":not" selectors, we skip to the next ":not" if the 13932 // current one doesn't match 13933 let skipToNextSelector = false; 13934 for (let i = 0; i < selector.length; i++) { 13935 const current = selector[i]; 13936 if (typeof current === 'number') { 13937 // If we finish processing a :not selector and it hasn't failed, return false 13938 if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) { 13939 return false; 13940 } 13941 // If we are skipping to the next :not() and this mode flag is positive, 13942 // it's a part of the current :not() selector, and we should keep skipping 13943 if (skipToNextSelector && isPositive(current)) 13944 continue; 13945 skipToNextSelector = false; 13946 mode = current | (mode & 1 /* NOT */); 13947 continue; 13948 } 13949 if (skipToNextSelector) 13950 continue; 13951 if (mode & 4 /* ELEMENT */) { 13952 mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */; 13953 if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) || 13954 current === '' && selector.length === 1) { 13955 if (isPositive(mode)) 13956 return false; 13957 skipToNextSelector = true; 13958 } 13959 } 13960 else { 13961 const selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i]; 13962 // special case for matching against classes when a tNode has been instantiated with 13963 // class and style values as separate attribute values (e.g. ['title', CLASS, 'foo']) 13964 if ((mode & 8 /* CLASS */) && tNode.attrs !== null) { 13965 if (!isCssClassMatching(tNode.attrs, selectorAttrValue, isProjectionMode)) { 13966 if (isPositive(mode)) 13967 return false; 13968 skipToNextSelector = true; 13969 } 13970 continue; 13971 } 13972 const attrName = (mode & 8 /* CLASS */) ? 'class' : current; 13973 const attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs, isInlineTemplate(tNode), isProjectionMode); 13974 if (attrIndexInNode === -1) { 13975 if (isPositive(mode)) 13976 return false; 13977 skipToNextSelector = true; 13978 continue; 13979 } 13980 if (selectorAttrValue !== '') { 13981 let nodeAttrValue; 13982 if (attrIndexInNode > nameOnlyMarkerIdx) { 13983 nodeAttrValue = ''; 13984 } 13985 else { 13986 ngDevMode && 13987 assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* NamespaceURI */, 'We do not match directives on namespaced attributes'); 13988 // we lowercase the attribute value to be able to match 13989 // selectors without case-sensitivity 13990 // (selectors are already in lowercase when generated) 13991 nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase(); 13992 } 13993 const compareAgainstClassName = mode & 8 /* CLASS */ ? nodeAttrValue : null; 13994 if (compareAgainstClassName && 13995 classIndexOf(compareAgainstClassName, selectorAttrValue, 0) !== -1 || 13996 mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) { 13997 if (isPositive(mode)) 13998 return false; 13999 skipToNextSelector = true; 14000 } 14001 } 14002 } 14003 } 14004 return isPositive(mode) || skipToNextSelector; 14005} 14006function isPositive(mode) { 14007 return (mode & 1 /* NOT */) === 0; 14008} 14009/** 14010 * Examines the attribute's definition array for a node to find the index of the 14011 * attribute that matches the given `name`. 14012 * 14013 * NOTE: This will not match namespaced attributes. 14014 * 14015 * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`. 14016 * The following table summarizes which types of attributes we attempt to match: 14017 * 14018 * =========================================================================================================== 14019 * Modes | Normal Attributes | Bindings Attributes | Template Attributes | I18n 14020 * Attributes 14021 * =========================================================================================================== 14022 * Inline + Projection | YES | YES | NO | YES 14023 * ----------------------------------------------------------------------------------------------------------- 14024 * Inline + Directive | NO | NO | YES | NO 14025 * ----------------------------------------------------------------------------------------------------------- 14026 * Non-inline + Projection | YES | YES | NO | YES 14027 * ----------------------------------------------------------------------------------------------------------- 14028 * Non-inline + Directive | YES | YES | NO | YES 14029 * =========================================================================================================== 14030 * 14031 * @param name the name of the attribute to find 14032 * @param attrs the attribute array to examine 14033 * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`) 14034 * rather than a manually expanded template node (e.g `<ng-template>`). 14035 * @param isProjectionMode true if we are matching against content projection otherwise we are 14036 * matching against directives. 14037 */ 14038function findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) { 14039 if (attrs === null) 14040 return -1; 14041 let i = 0; 14042 if (isProjectionMode || !isInlineTemplate) { 14043 let bindingsMode = false; 14044 while (i < attrs.length) { 14045 const maybeAttrName = attrs[i]; 14046 if (maybeAttrName === name) { 14047 return i; 14048 } 14049 else if (maybeAttrName === 3 /* Bindings */ || maybeAttrName === 6 /* I18n */) { 14050 bindingsMode = true; 14051 } 14052 else if (maybeAttrName === 1 /* Classes */ || maybeAttrName === 2 /* Styles */) { 14053 let value = attrs[++i]; 14054 // We should skip classes here because we have a separate mechanism for 14055 // matching classes in projection mode. 14056 while (typeof value === 'string') { 14057 value = attrs[++i]; 14058 } 14059 continue; 14060 } 14061 else if (maybeAttrName === 4 /* Template */) { 14062 // We do not care about Template attributes in this scenario. 14063 break; 14064 } 14065 else if (maybeAttrName === 0 /* NamespaceURI */) { 14066 // Skip the whole namespaced attribute and value. This is by design. 14067 i += 4; 14068 continue; 14069 } 14070 // In binding mode there are only names, rather than name-value pairs. 14071 i += bindingsMode ? 1 : 2; 14072 } 14073 // We did not match the attribute 14074 return -1; 14075 } 14076 else { 14077 return matchTemplateAttribute(attrs, name); 14078 } 14079} 14080function isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) { 14081 for (let i = 0; i < selector.length; i++) { 14082 if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) { 14083 return true; 14084 } 14085 } 14086 return false; 14087} 14088function getProjectAsAttrValue(tNode) { 14089 const nodeAttrs = tNode.attrs; 14090 if (nodeAttrs != null) { 14091 const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* ProjectAs */); 14092 // only check for ngProjectAs in attribute names, don't accidentally match attribute's value 14093 // (attribute names are stored at even indexes) 14094 if ((ngProjectAsAttrIdx & 1) === 0) { 14095 return nodeAttrs[ngProjectAsAttrIdx + 1]; 14096 } 14097 } 14098 return null; 14099} 14100function getNameOnlyMarkerIndex(nodeAttrs) { 14101 for (let i = 0; i < nodeAttrs.length; i++) { 14102 const nodeAttr = nodeAttrs[i]; 14103 if (isNameOnlyAttributeMarker(nodeAttr)) { 14104 return i; 14105 } 14106 } 14107 return nodeAttrs.length; 14108} 14109function matchTemplateAttribute(attrs, name) { 14110 let i = attrs.indexOf(4 /* Template */); 14111 if (i > -1) { 14112 i++; 14113 while (i < attrs.length) { 14114 const attr = attrs[i]; 14115 // Return in case we checked all template attrs and are switching to the next section in the 14116 // attrs array (that starts with a number that represents an attribute marker). 14117 if (typeof attr === 'number') 14118 return -1; 14119 if (attr === name) 14120 return i; 14121 i++; 14122 } 14123 } 14124 return -1; 14125} 14126/** 14127 * Checks whether a selector is inside a CssSelectorList 14128 * @param selector Selector to be checked. 14129 * @param list List in which to look for the selector. 14130 */ 14131function isSelectorInSelectorList(selector, list) { 14132 selectorListLoop: for (let i = 0; i < list.length; i++) { 14133 const currentSelectorInList = list[i]; 14134 if (selector.length !== currentSelectorInList.length) { 14135 continue; 14136 } 14137 for (let j = 0; j < selector.length; j++) { 14138 if (selector[j] !== currentSelectorInList[j]) { 14139 continue selectorListLoop; 14140 } 14141 } 14142 return true; 14143 } 14144 return false; 14145} 14146function maybeWrapInNotSelector(isNegativeMode, chunk) { 14147 return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk; 14148} 14149function stringifyCSSSelector(selector) { 14150 let result = selector[0]; 14151 let i = 1; 14152 let mode = 2 /* ATTRIBUTE */; 14153 let currentChunk = ''; 14154 let isNegativeMode = false; 14155 while (i < selector.length) { 14156 let valueOrMarker = selector[i]; 14157 if (typeof valueOrMarker === 'string') { 14158 if (mode & 2 /* ATTRIBUTE */) { 14159 const attrValue = selector[++i]; 14160 currentChunk += 14161 '[' + valueOrMarker + (attrValue.length > 0 ? '="' + attrValue + '"' : '') + ']'; 14162 } 14163 else if (mode & 8 /* CLASS */) { 14164 currentChunk += '.' + valueOrMarker; 14165 } 14166 else if (mode & 4 /* ELEMENT */) { 14167 currentChunk += ' ' + valueOrMarker; 14168 } 14169 } 14170 else { 14171 // 14172 // Append current chunk to the final result in case we come across SelectorFlag, which 14173 // indicates that the previous section of a selector is over. We need to accumulate content 14174 // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g. 14175 // ``` 14176 // ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC'] 14177 // ``` 14178 // should be transformed to `.classA :not(.classB .classC)`. 14179 // 14180 // Note: for negative selector part, we accumulate content between flags until we find the 14181 // next negative flag. This is needed to support a case where `:not()` rule contains more than 14182 // one chunk, e.g. the following selector: 14183 // ``` 14184 // ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar'] 14185 // ``` 14186 // should be stringified to `:not(p.foo) :not(.bar)` 14187 // 14188 if (currentChunk !== '' && !isPositive(valueOrMarker)) { 14189 result += maybeWrapInNotSelector(isNegativeMode, currentChunk); 14190 currentChunk = ''; 14191 } 14192 mode = valueOrMarker; 14193 // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative 14194 // mode is maintained for remaining chunks of a selector. 14195 isNegativeMode = isNegativeMode || !isPositive(mode); 14196 } 14197 i++; 14198 } 14199 if (currentChunk !== '') { 14200 result += maybeWrapInNotSelector(isNegativeMode, currentChunk); 14201 } 14202 return result; 14203} 14204/** 14205 * Generates string representation of CSS selector in parsed form. 14206 * 14207 * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing 14208 * additional parsing at runtime (for example, for directive matching). However in some cases (for 14209 * example, while bootstrapping a component), a string version of the selector is required to query 14210 * for the host element on the page. This function takes the parsed form of a selector and returns 14211 * its string representation. 14212 * 14213 * @param selectorList selector in parsed form 14214 * @returns string representation of a given selector 14215 */ 14216function stringifyCSSSelectorList(selectorList) { 14217 return selectorList.map(stringifyCSSSelector).join(','); 14218} 14219/** 14220 * Extracts attributes and classes information from a given CSS selector. 14221 * 14222 * This function is used while creating a component dynamically. In this case, the host element 14223 * (that is created dynamically) should contain attributes and classes specified in component's CSS 14224 * selector. 14225 * 14226 * @param selector CSS selector in parsed form (in a form of array) 14227 * @returns object with `attrs` and `classes` fields that contain extracted information 14228 */ 14229function extractAttrsAndClassesFromSelector(selector) { 14230 const attrs = []; 14231 const classes = []; 14232 let i = 1; 14233 let mode = 2 /* ATTRIBUTE */; 14234 while (i < selector.length) { 14235 let valueOrMarker = selector[i]; 14236 if (typeof valueOrMarker === 'string') { 14237 if (mode === 2 /* ATTRIBUTE */) { 14238 if (valueOrMarker !== '') { 14239 attrs.push(valueOrMarker, selector[++i]); 14240 } 14241 } 14242 else if (mode === 8 /* CLASS */) { 14243 classes.push(valueOrMarker); 14244 } 14245 } 14246 else { 14247 // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative 14248 // mode is maintained for remaining chunks of a selector. Since attributes and classes are 14249 // extracted only for "positive" part of the selector, we can stop here. 14250 if (!isPositive(mode)) 14251 break; 14252 mode = valueOrMarker; 14253 } 14254 i++; 14255 } 14256 return { attrs, classes }; 14257} 14258 14259/** 14260 * @license 14261 * Copyright Google LLC All Rights Reserved. 14262 * 14263 * Use of this source code is governed by an MIT-style license that can be 14264 * found in the LICENSE file at https://angular.io/license 14265 */ 14266/** A special value which designates that a value has not changed. */ 14267const NO_CHANGE = (typeof ngDevMode === 'undefined' || ngDevMode) ? { __brand__: 'NO_CHANGE' } : {}; 14268 14269/** 14270 * @license 14271 * Copyright Google LLC All Rights Reserved. 14272 * 14273 * Use of this source code is governed by an MIT-style license that can be 14274 * found in the LICENSE file at https://angular.io/license 14275 */ 14276/** 14277 * Gets the parent LView of the passed LView, if the PARENT is an LContainer, will get the parent of 14278 * that LContainer, which is an LView 14279 * @param lView the lView whose parent to get 14280 */ 14281function getLViewParent(lView) { 14282 ngDevMode && assertLView(lView); 14283 const parent = lView[PARENT]; 14284 return isLContainer(parent) ? parent[PARENT] : parent; 14285} 14286/** 14287 * Retrieve the root view from any component or `LView` by walking the parent `LView` until 14288 * reaching the root `LView`. 14289 * 14290 * @param componentOrLView any component or `LView` 14291 */ 14292function getRootView(componentOrLView) { 14293 ngDevMode && assertDefined(componentOrLView, 'component'); 14294 let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView); 14295 while (lView && !(lView[FLAGS] & 512 /* IsRoot */)) { 14296 lView = getLViewParent(lView); 14297 } 14298 ngDevMode && assertLView(lView); 14299 return lView; 14300} 14301/** 14302 * Returns the `RootContext` instance that is associated with 14303 * the application where the target is situated. It does this by walking the parent views until it 14304 * gets to the root view, then getting the context off of that. 14305 * 14306 * @param viewOrComponent the `LView` or component to get the root context for. 14307 */ 14308function getRootContext(viewOrComponent) { 14309 const rootView = getRootView(viewOrComponent); 14310 ngDevMode && 14311 assertDefined(rootView[CONTEXT], 'RootView has no context. Perhaps it is disconnected?'); 14312 return rootView[CONTEXT]; 14313} 14314/** 14315 * Gets the first `LContainer` in the LView or `null` if none exists. 14316 */ 14317function getFirstLContainer(lView) { 14318 return getNearestLContainer(lView[CHILD_HEAD]); 14319} 14320/** 14321 * Gets the next `LContainer` that is a sibling of the given container. 14322 */ 14323function getNextLContainer(container) { 14324 return getNearestLContainer(container[NEXT]); 14325} 14326function getNearestLContainer(viewOrContainer) { 14327 while (viewOrContainer !== null && !isLContainer(viewOrContainer)) { 14328 viewOrContainer = viewOrContainer[NEXT]; 14329 } 14330 return viewOrContainer; 14331} 14332 14333/** 14334 * @license 14335 * Copyright Google LLC All Rights Reserved. 14336 * 14337 * Use of this source code is governed by an MIT-style license that can be 14338 * found in the LICENSE file at https://angular.io/license 14339 */ 14340/** 14341 * Advances to an element for later binding instructions. 14342 * 14343 * Used in conjunction with instructions like {@link property} to act on elements with specified 14344 * indices, for example those created with {@link element} or {@link elementStart}. 14345 * 14346 * ```ts 14347 * (rf: RenderFlags, ctx: any) => { 14348 * if (rf & 1) { 14349 * text(0, 'Hello'); 14350 * text(1, 'Goodbye') 14351 * element(2, 'div'); 14352 * } 14353 * if (rf & 2) { 14354 * advance(2); // Advance twice to the <div>. 14355 * property('title', 'test'); 14356 * } 14357 * } 14358 * ``` 14359 * @param delta Number of elements to advance forwards by. 14360 * 14361 * @codeGenApi 14362 */ 14363function ɵɵadvance(delta) { 14364 ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward'); 14365 selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, getCheckNoChangesMode()); 14366} 14367/** 14368 * Selects an element for later binding instructions. 14369 * @deprecated No longer being generated, but still used in unit tests. 14370 * @codeGenApi 14371 */ 14372function ɵɵselect(index) { 14373 // TODO(misko): Remove this function as it is no longer being used. 14374 selectIndexInternal(getTView(), getLView(), index, getCheckNoChangesMode()); 14375} 14376function selectIndexInternal(tView, lView, index, checkNoChangesMode) { 14377 ngDevMode && assertGreaterThan(index, -1, 'Invalid index'); 14378 ngDevMode && assertIndexInRange(lView, index + HEADER_OFFSET); 14379 // Flush the initial hooks for elements in the view that have been added up to this point. 14380 // PERF WARNING: do NOT extract this to a separate function without running benchmarks 14381 if (!checkNoChangesMode) { 14382 const hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */; 14383 if (hooksInitPhaseCompleted) { 14384 const preOrderCheckHooks = tView.preOrderCheckHooks; 14385 if (preOrderCheckHooks !== null) { 14386 executeCheckHooks(lView, preOrderCheckHooks, index); 14387 } 14388 } 14389 else { 14390 const preOrderHooks = tView.preOrderHooks; 14391 if (preOrderHooks !== null) { 14392 executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, index); 14393 } 14394 } 14395 } 14396 // We must set the selected index *after* running the hooks, because hooks may have side-effects 14397 // that cause other template functions to run, thus updating the selected index, which is global 14398 // state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index 14399 // will be altered by the time we leave the `ɵɵadvance` instruction. 14400 setSelectedIndex(index); 14401} 14402 14403/** 14404 * @license 14405 * Copyright Google LLC All Rights Reserved. 14406 * 14407 * Use of this source code is governed by an MIT-style license that can be 14408 * found in the LICENSE file at https://angular.io/license 14409 */ 14410function toTStylingRange(prev, next) { 14411 ngDevMode && assertNumberInRange(prev, 0, 32767 /* UNSIGNED_MASK */); 14412 ngDevMode && assertNumberInRange(next, 0, 32767 /* UNSIGNED_MASK */); 14413 return (prev << 17 /* PREV_SHIFT */ | next << 2 /* NEXT_SHIFT */); 14414} 14415function getTStylingRangePrev(tStylingRange) { 14416 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14417 return (tStylingRange >> 17 /* PREV_SHIFT */) & 32767 /* UNSIGNED_MASK */; 14418} 14419function getTStylingRangePrevDuplicate(tStylingRange) { 14420 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14421 return (tStylingRange & 2 /* PREV_DUPLICATE */) == 14422 2 /* PREV_DUPLICATE */; 14423} 14424function setTStylingRangePrev(tStylingRange, previous) { 14425 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14426 ngDevMode && assertNumberInRange(previous, 0, 32767 /* UNSIGNED_MASK */); 14427 return ((tStylingRange & ~4294836224 /* PREV_MASK */) | 14428 (previous << 17 /* PREV_SHIFT */)); 14429} 14430function setTStylingRangePrevDuplicate(tStylingRange) { 14431 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14432 return (tStylingRange | 2 /* PREV_DUPLICATE */); 14433} 14434function getTStylingRangeNext(tStylingRange) { 14435 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14436 return (tStylingRange & 131068 /* NEXT_MASK */) >> 2 /* NEXT_SHIFT */; 14437} 14438function setTStylingRangeNext(tStylingRange, next) { 14439 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14440 ngDevMode && assertNumberInRange(next, 0, 32767 /* UNSIGNED_MASK */); 14441 return ((tStylingRange & ~131068 /* NEXT_MASK */) | // 14442 next << 2 /* NEXT_SHIFT */); 14443} 14444function getTStylingRangeNextDuplicate(tStylingRange) { 14445 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14446 return (tStylingRange & 1 /* NEXT_DUPLICATE */) === 14447 1 /* NEXT_DUPLICATE */; 14448} 14449function setTStylingRangeNextDuplicate(tStylingRange) { 14450 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14451 return (tStylingRange | 1 /* NEXT_DUPLICATE */); 14452} 14453function getTStylingRangeTail(tStylingRange) { 14454 ngDevMode && assertNumber(tStylingRange, 'expected number'); 14455 const next = getTStylingRangeNext(tStylingRange); 14456 return next === 0 ? getTStylingRangePrev(tStylingRange) : next; 14457} 14458 14459/** 14460 * @license 14461 * Copyright Google LLC All Rights Reserved. 14462 * 14463 * Use of this source code is governed by an MIT-style license that can be 14464 * found in the LICENSE file at https://angular.io/license 14465 */ 14466/** 14467 * Patch a `debug` property on top of the existing object. 14468 * 14469 * NOTE: always call this method with `ngDevMode && attachDebugObject(...)` 14470 * 14471 * @param obj Object to patch 14472 * @param debug Value to patch 14473 */ 14474function attachDebugObject(obj, debug) { 14475 if (ngDevMode) { 14476 Object.defineProperty(obj, 'debug', { value: debug, enumerable: false }); 14477 } 14478 else { 14479 throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!'); 14480 } 14481} 14482/** 14483 * Patch a `debug` property getter on top of the existing object. 14484 * 14485 * NOTE: always call this method with `ngDevMode && attachDebugObject(...)` 14486 * 14487 * @param obj Object to patch 14488 * @param debugGetter Getter returning a value to patch 14489 */ 14490function attachDebugGetter(obj, debugGetter) { 14491 if (ngDevMode) { 14492 Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false }); 14493 } 14494 else { 14495 throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!'); 14496 } 14497} 14498 14499/** 14500 * @license 14501 * Copyright Google LLC All Rights Reserved. 14502 * 14503 * Use of this source code is governed by an MIT-style license that can be 14504 * found in the LICENSE file at https://angular.io/license 14505 */ 14506const NG_DEV_MODE = ((typeof ngDevMode === 'undefined' || !!ngDevMode) && initNgDevMode()); 14507/* 14508 * This file contains conditionally attached classes which provide human readable (debug) level 14509 * information for `LView`, `LContainer` and other internal data structures. These data structures 14510 * are stored internally as array which makes it very difficult during debugging to reason about the 14511 * current state of the system. 14512 * 14513 * Patching the array with extra property does change the array's hidden class' but it does not 14514 * change the cost of access, therefore this patching should not have significant if any impact in 14515 * `ngDevMode` mode. (see: https://jsperf.com/array-vs-monkey-patch-array) 14516 * 14517 * So instead of seeing: 14518 * ``` 14519 * Array(30) [Object, 659, null, â¦] 14520 * ``` 14521 * 14522 * You get to see: 14523 * ``` 14524 * LViewDebug { 14525 * views: [...], 14526 * flags: {attached: true, ...} 14527 * nodes: [ 14528 * {html: '<div id="123">', ..., nodes: [ 14529 * {html: '<span>', ..., nodes: null} 14530 * ]} 14531 * ] 14532 * } 14533 * ``` 14534 */ 14535let LVIEW_COMPONENT_CACHE; 14536let LVIEW_EMBEDDED_CACHE; 14537let LVIEW_ROOT; 14538/** 14539 * This function clones a blueprint and creates LView. 14540 * 14541 * Simple slice will keep the same type, and we need it to be LView 14542 */ 14543function cloneToLViewFromTViewBlueprint(tView) { 14544 const debugTView = tView; 14545 const lView = getLViewToClone(debugTView.type, tView.template && tView.template.name); 14546 return lView.concat(tView.blueprint); 14547} 14548function getLViewToClone(type, name) { 14549 switch (type) { 14550 case 0 /* Root */: 14551 if (LVIEW_ROOT === undefined) 14552 LVIEW_ROOT = new (createNamedArrayType('LRootView'))(); 14553 return LVIEW_ROOT; 14554 case 1 /* Component */: 14555 if (LVIEW_COMPONENT_CACHE === undefined) 14556 LVIEW_COMPONENT_CACHE = new Map(); 14557 let componentArray = LVIEW_COMPONENT_CACHE.get(name); 14558 if (componentArray === undefined) { 14559 componentArray = new (createNamedArrayType('LComponentView' + nameSuffix(name)))(); 14560 LVIEW_COMPONENT_CACHE.set(name, componentArray); 14561 } 14562 return componentArray; 14563 case 2 /* Embedded */: 14564 if (LVIEW_EMBEDDED_CACHE === undefined) 14565 LVIEW_EMBEDDED_CACHE = new Map(); 14566 let embeddedArray = LVIEW_EMBEDDED_CACHE.get(name); 14567 if (embeddedArray === undefined) { 14568 embeddedArray = new (createNamedArrayType('LEmbeddedView' + nameSuffix(name)))(); 14569 LVIEW_EMBEDDED_CACHE.set(name, embeddedArray); 14570 } 14571 return embeddedArray; 14572 } 14573 throw new Error('unreachable code'); 14574} 14575function nameSuffix(text) { 14576 if (text == null) 14577 return ''; 14578 const index = text.lastIndexOf('_Template'); 14579 return '_' + (index === -1 ? text : text.substr(0, index)); 14580} 14581/** 14582 * This class is a debug version of Object literal so that we can have constructor name show up 14583 * in 14584 * debug tools in ngDevMode. 14585 */ 14586const TViewConstructor = class TView { 14587 constructor(type, // 14588 id, // 14589 blueprint, // 14590 template, // 14591 queries, // 14592 viewQuery, // 14593 node, // 14594 data, // 14595 bindingStartIndex, // 14596 expandoStartIndex, // 14597 expandoInstructions, // 14598 firstCreatePass, // 14599 firstUpdatePass, // 14600 staticViewQueries, // 14601 staticContentQueries, // 14602 preOrderHooks, // 14603 preOrderCheckHooks, // 14604 contentHooks, // 14605 contentCheckHooks, // 14606 viewHooks, // 14607 viewCheckHooks, // 14608 destroyHooks, // 14609 cleanup, // 14610 contentQueries, // 14611 components, // 14612 directiveRegistry, // 14613 pipeRegistry, // 14614 firstChild, // 14615 schemas, // 14616 consts, // 14617 incompleteFirstPass, // 14618 _decls, // 14619 _vars) { 14620 this.type = type; 14621 this.id = id; 14622 this.blueprint = blueprint; 14623 this.template = template; 14624 this.queries = queries; 14625 this.viewQuery = viewQuery; 14626 this.node = node; 14627 this.data = data; 14628 this.bindingStartIndex = bindingStartIndex; 14629 this.expandoStartIndex = expandoStartIndex; 14630 this.expandoInstructions = expandoInstructions; 14631 this.firstCreatePass = firstCreatePass; 14632 this.firstUpdatePass = firstUpdatePass; 14633 this.staticViewQueries = staticViewQueries; 14634 this.staticContentQueries = staticContentQueries; 14635 this.preOrderHooks = preOrderHooks; 14636 this.preOrderCheckHooks = preOrderCheckHooks; 14637 this.contentHooks = contentHooks; 14638 this.contentCheckHooks = contentCheckHooks; 14639 this.viewHooks = viewHooks; 14640 this.viewCheckHooks = viewCheckHooks; 14641 this.destroyHooks = destroyHooks; 14642 this.cleanup = cleanup; 14643 this.contentQueries = contentQueries; 14644 this.components = components; 14645 this.directiveRegistry = directiveRegistry; 14646 this.pipeRegistry = pipeRegistry; 14647 this.firstChild = firstChild; 14648 this.schemas = schemas; 14649 this.consts = consts; 14650 this.incompleteFirstPass = incompleteFirstPass; 14651 this._decls = _decls; 14652 this._vars = _vars; 14653 } 14654 get template_() { 14655 const buf = []; 14656 processTNodeChildren(this.firstChild, buf); 14657 return buf.join(''); 14658 } 14659}; 14660class TNode { 14661 constructor(tView_, // 14662 type, // 14663 index, // 14664 injectorIndex, // 14665 directiveStart, // 14666 directiveEnd, // 14667 directiveStylingLast, // 14668 propertyBindings, // 14669 flags, // 14670 providerIndexes, // 14671 tagName, // 14672 attrs, // 14673 mergedAttrs, // 14674 localNames, // 14675 initialInputs, // 14676 inputs, // 14677 outputs, // 14678 tViews, // 14679 next, // 14680 projectionNext, // 14681 child, // 14682 parent, // 14683 projection, // 14684 styles, // 14685 stylesWithoutHost, // 14686 residualStyles, // 14687 classes, // 14688 classesWithoutHost, // 14689 residualClasses, // 14690 classBindings, // 14691 styleBindings) { 14692 this.tView_ = tView_; 14693 this.type = type; 14694 this.index = index; 14695 this.injectorIndex = injectorIndex; 14696 this.directiveStart = directiveStart; 14697 this.directiveEnd = directiveEnd; 14698 this.directiveStylingLast = directiveStylingLast; 14699 this.propertyBindings = propertyBindings; 14700 this.flags = flags; 14701 this.providerIndexes = providerIndexes; 14702 this.tagName = tagName; 14703 this.attrs = attrs; 14704 this.mergedAttrs = mergedAttrs; 14705 this.localNames = localNames; 14706 this.initialInputs = initialInputs; 14707 this.inputs = inputs; 14708 this.outputs = outputs; 14709 this.tViews = tViews; 14710 this.next = next; 14711 this.projectionNext = projectionNext; 14712 this.child = child; 14713 this.parent = parent; 14714 this.projection = projection; 14715 this.styles = styles; 14716 this.stylesWithoutHost = stylesWithoutHost; 14717 this.residualStyles = residualStyles; 14718 this.classes = classes; 14719 this.classesWithoutHost = classesWithoutHost; 14720 this.residualClasses = residualClasses; 14721 this.classBindings = classBindings; 14722 this.styleBindings = styleBindings; 14723 } 14724 get type_() { 14725 switch (this.type) { 14726 case 0 /* Container */: 14727 return 'TNodeType.Container'; 14728 case 3 /* Element */: 14729 return 'TNodeType.Element'; 14730 case 4 /* ElementContainer */: 14731 return 'TNodeType.ElementContainer'; 14732 case 5 /* IcuContainer */: 14733 return 'TNodeType.IcuContainer'; 14734 case 1 /* Projection */: 14735 return 'TNodeType.Projection'; 14736 case 2 /* View */: 14737 return 'TNodeType.View'; 14738 default: 14739 return 'TNodeType.???'; 14740 } 14741 } 14742 get flags_() { 14743 const flags = []; 14744 if (this.flags & 16 /* hasClassInput */) 14745 flags.push('TNodeFlags.hasClassInput'); 14746 if (this.flags & 8 /* hasContentQuery */) 14747 flags.push('TNodeFlags.hasContentQuery'); 14748 if (this.flags & 32 /* hasStyleInput */) 14749 flags.push('TNodeFlags.hasStyleInput'); 14750 if (this.flags & 128 /* hasHostBindings */) 14751 flags.push('TNodeFlags.hasHostBindings'); 14752 if (this.flags & 2 /* isComponentHost */) 14753 flags.push('TNodeFlags.isComponentHost'); 14754 if (this.flags & 1 /* isDirectiveHost */) 14755 flags.push('TNodeFlags.isDirectiveHost'); 14756 if (this.flags & 64 /* isDetached */) 14757 flags.push('TNodeFlags.isDetached'); 14758 if (this.flags & 4 /* isProjected */) 14759 flags.push('TNodeFlags.isProjected'); 14760 return flags.join('|'); 14761 } 14762 get template_() { 14763 const buf = []; 14764 buf.push('<', this.tagName || this.type_); 14765 if (this.attrs) { 14766 for (let i = 0; i < this.attrs.length;) { 14767 const attrName = this.attrs[i++]; 14768 if (typeof attrName == 'number') { 14769 break; 14770 } 14771 const attrValue = this.attrs[i++]; 14772 buf.push(' ', attrName, '="', attrValue, '"'); 14773 } 14774 } 14775 buf.push('>'); 14776 processTNodeChildren(this.child, buf); 14777 buf.push('</', this.tagName || this.type_, '>'); 14778 return buf.join(''); 14779 } 14780 get styleBindings_() { 14781 return toDebugStyleBinding(this, false); 14782 } 14783 get classBindings_() { 14784 return toDebugStyleBinding(this, true); 14785 } 14786} 14787const TNodeDebug = TNode; 14788function toDebugStyleBinding(tNode, isClassBased) { 14789 const tData = tNode.tView_.data; 14790 const bindings = []; 14791 const range = isClassBased ? tNode.classBindings : tNode.styleBindings; 14792 const prev = getTStylingRangePrev(range); 14793 const next = getTStylingRangeNext(range); 14794 let isTemplate = next !== 0; 14795 let cursor = isTemplate ? next : prev; 14796 while (cursor !== 0) { 14797 const itemKey = tData[cursor]; 14798 const itemRange = tData[cursor + 1]; 14799 bindings.unshift({ 14800 key: itemKey, 14801 index: cursor, 14802 isTemplate: isTemplate, 14803 prevDuplicate: getTStylingRangePrevDuplicate(itemRange), 14804 nextDuplicate: getTStylingRangeNextDuplicate(itemRange), 14805 nextIndex: getTStylingRangeNext(itemRange), 14806 prevIndex: getTStylingRangePrev(itemRange), 14807 }); 14808 if (cursor === prev) 14809 isTemplate = false; 14810 cursor = getTStylingRangePrev(itemRange); 14811 } 14812 bindings.push((isClassBased ? tNode.residualClasses : tNode.residualStyles) || null); 14813 return bindings; 14814} 14815function processTNodeChildren(tNode, buf) { 14816 while (tNode) { 14817 buf.push(tNode.template_); 14818 tNode = tNode.next; 14819 } 14820} 14821const TViewData = NG_DEV_MODE && createNamedArrayType('TViewData') || null; 14822let TVIEWDATA_EMPTY; // can't initialize here or it will not be tree shaken, because 14823// `LView` constructor could have side-effects. 14824/** 14825 * This function clones a blueprint and creates TData. 14826 * 14827 * Simple slice will keep the same type, and we need it to be TData 14828 */ 14829function cloneToTViewData(list) { 14830 if (TVIEWDATA_EMPTY === undefined) 14831 TVIEWDATA_EMPTY = new TViewData(); 14832 return TVIEWDATA_EMPTY.concat(list); 14833} 14834const LViewBlueprint = NG_DEV_MODE && createNamedArrayType('LViewBlueprint') || null; 14835const MatchesArray = NG_DEV_MODE && createNamedArrayType('MatchesArray') || null; 14836const TViewComponents = NG_DEV_MODE && createNamedArrayType('TViewComponents') || null; 14837const TNodeLocalNames = NG_DEV_MODE && createNamedArrayType('TNodeLocalNames') || null; 14838const TNodeInitialInputs = NG_DEV_MODE && createNamedArrayType('TNodeInitialInputs') || null; 14839const TNodeInitialData = NG_DEV_MODE && createNamedArrayType('TNodeInitialData') || null; 14840const LCleanup = NG_DEV_MODE && createNamedArrayType('LCleanup') || null; 14841const TCleanup = NG_DEV_MODE && createNamedArrayType('TCleanup') || null; 14842function attachLViewDebug(lView) { 14843 attachDebugObject(lView, new LViewDebug(lView)); 14844} 14845function attachLContainerDebug(lContainer) { 14846 attachDebugObject(lContainer, new LContainerDebug(lContainer)); 14847} 14848function toDebug(obj) { 14849 if (obj) { 14850 const debug = obj.debug; 14851 assertDefined(debug, 'Object does not have a debug representation.'); 14852 return debug; 14853 } 14854 else { 14855 return obj; 14856 } 14857} 14858/** 14859 * Use this method to unwrap a native element in `LView` and convert it into HTML for easier 14860 * reading. 14861 * 14862 * @param value possibly wrapped native DOM node. 14863 * @param includeChildren If `true` then the serialized HTML form will include child elements 14864 * (same 14865 * as `outerHTML`). If `false` then the serialized HTML form will only contain the element 14866 * itself 14867 * (will not serialize child elements). 14868 */ 14869function toHtml(value, includeChildren = false) { 14870 const node = unwrapRNode(value); 14871 if (node) { 14872 switch (node.nodeType) { 14873 case Node.TEXT_NODE: 14874 return node.textContent; 14875 case Node.COMMENT_NODE: 14876 return `<!--${node.textContent}-->`; 14877 case Node.ELEMENT_NODE: 14878 const outerHTML = node.outerHTML; 14879 if (includeChildren) { 14880 return outerHTML; 14881 } 14882 else { 14883 const innerHTML = '>' + node.innerHTML + '<'; 14884 return (outerHTML.split(innerHTML)[0]) + '>'; 14885 } 14886 } 14887 } 14888 return null; 14889} 14890class LViewDebug { 14891 constructor(_raw_lView) { 14892 this._raw_lView = _raw_lView; 14893 } 14894 /** 14895 * Flags associated with the `LView` unpacked into a more readable state. 14896 */ 14897 get flags() { 14898 const flags = this._raw_lView[FLAGS]; 14899 return { 14900 __raw__flags__: flags, 14901 initPhaseState: flags & 3 /* InitPhaseStateMask */, 14902 creationMode: !!(flags & 4 /* CreationMode */), 14903 firstViewPass: !!(flags & 8 /* FirstLViewPass */), 14904 checkAlways: !!(flags & 16 /* CheckAlways */), 14905 dirty: !!(flags & 64 /* Dirty */), 14906 attached: !!(flags & 128 /* Attached */), 14907 destroyed: !!(flags & 256 /* Destroyed */), 14908 isRoot: !!(flags & 512 /* IsRoot */), 14909 indexWithinInitPhase: flags >> 11 /* IndexWithinInitPhaseShift */, 14910 }; 14911 } 14912 get parent() { 14913 return toDebug(this._raw_lView[PARENT]); 14914 } 14915 get hostHTML() { 14916 return toHtml(this._raw_lView[HOST], true); 14917 } 14918 get html() { 14919 return (this.nodes || []).map(node => toHtml(node.native, true)).join(''); 14920 } 14921 get context() { 14922 return this._raw_lView[CONTEXT]; 14923 } 14924 /** 14925 * The tree of nodes associated with the current `LView`. The nodes have been normalized into 14926 * a tree structure with relevant details pulled out for readability. 14927 */ 14928 get nodes() { 14929 const lView = this._raw_lView; 14930 const tNode = lView[TVIEW].firstChild; 14931 return toDebugNodes(tNode, lView); 14932 } 14933 get tView() { 14934 return this._raw_lView[TVIEW]; 14935 } 14936 get cleanup() { 14937 return this._raw_lView[CLEANUP]; 14938 } 14939 get injector() { 14940 return this._raw_lView[INJECTOR$1]; 14941 } 14942 get rendererFactory() { 14943 return this._raw_lView[RENDERER_FACTORY]; 14944 } 14945 get renderer() { 14946 return this._raw_lView[RENDERER]; 14947 } 14948 get sanitizer() { 14949 return this._raw_lView[SANITIZER]; 14950 } 14951 get childHead() { 14952 return toDebug(this._raw_lView[CHILD_HEAD]); 14953 } 14954 get next() { 14955 return toDebug(this._raw_lView[NEXT]); 14956 } 14957 get childTail() { 14958 return toDebug(this._raw_lView[CHILD_TAIL]); 14959 } 14960 get declarationView() { 14961 return toDebug(this._raw_lView[DECLARATION_VIEW]); 14962 } 14963 get queries() { 14964 return this._raw_lView[QUERIES]; 14965 } 14966 get tHost() { 14967 return this._raw_lView[T_HOST]; 14968 } 14969 get decls() { 14970 const tView = this.tView; 14971 const start = HEADER_OFFSET; 14972 return toLViewRange(this.tView, this._raw_lView, start, start + tView._decls); 14973 } 14974 get vars() { 14975 const tView = this.tView; 14976 const start = HEADER_OFFSET + tView._decls; 14977 return toLViewRange(this.tView, this._raw_lView, start, start + tView._vars); 14978 } 14979 get i18n() { 14980 const tView = this.tView; 14981 const start = HEADER_OFFSET + tView._decls + tView._vars; 14982 return toLViewRange(this.tView, this._raw_lView, start, this.tView.expandoStartIndex); 14983 } 14984 get expando() { 14985 const tView = this.tView; 14986 return toLViewRange(this.tView, this._raw_lView, this.tView.expandoStartIndex, this._raw_lView.length); 14987 } 14988 /** 14989 * Normalized view of child views (and containers) attached at this location. 14990 */ 14991 get childViews() { 14992 const childViews = []; 14993 let child = this.childHead; 14994 while (child) { 14995 childViews.push(child); 14996 child = child.next; 14997 } 14998 return childViews; 14999 } 15000} 15001function toLViewRange(tView, lView, start, end) { 15002 let content = []; 15003 for (let index = start; index < end; index++) { 15004 content.push({ index: index, t: tView.data[index], l: lView[index] }); 15005 } 15006 return { start: start, end: end, length: end - start, content: content }; 15007} 15008/** 15009 * Turns a flat list of nodes into a tree by walking the associated `TNode` tree. 15010 * 15011 * @param tNode 15012 * @param lView 15013 */ 15014function toDebugNodes(tNode, lView) { 15015 if (tNode) { 15016 const debugNodes = []; 15017 let tNodeCursor = tNode; 15018 while (tNodeCursor) { 15019 debugNodes.push(buildDebugNode(tNodeCursor, lView, tNodeCursor.index)); 15020 tNodeCursor = tNodeCursor.next; 15021 } 15022 return debugNodes; 15023 } 15024 else { 15025 return []; 15026 } 15027} 15028function buildDebugNode(tNode, lView, nodeIndex) { 15029 const rawValue = lView[nodeIndex]; 15030 const native = unwrapRNode(rawValue); 15031 return { 15032 html: toHtml(native), 15033 type: TNodeTypeAsString[tNode.type], 15034 native: native, 15035 children: toDebugNodes(tNode.child, lView), 15036 }; 15037} 15038class LContainerDebug { 15039 constructor(_raw_lContainer) { 15040 this._raw_lContainer = _raw_lContainer; 15041 } 15042 get hasTransplantedViews() { 15043 return this._raw_lContainer[HAS_TRANSPLANTED_VIEWS]; 15044 } 15045 get views() { 15046 return this._raw_lContainer.slice(CONTAINER_HEADER_OFFSET) 15047 .map(toDebug); 15048 } 15049 get parent() { 15050 return toDebug(this._raw_lContainer[PARENT]); 15051 } 15052 get movedViews() { 15053 return this._raw_lContainer[MOVED_VIEWS]; 15054 } 15055 get host() { 15056 return this._raw_lContainer[HOST]; 15057 } 15058 get native() { 15059 return this._raw_lContainer[NATIVE]; 15060 } 15061 get next() { 15062 return toDebug(this._raw_lContainer[NEXT]); 15063 } 15064} 15065/** 15066 * Return an `LView` value if found. 15067 * 15068 * @param value `LView` if any 15069 */ 15070function readLViewValue(value) { 15071 while (Array.isArray(value)) { 15072 // This check is not quite right, as it does not take into account `StylingContext` 15073 // This is why it is in debug, not in util.ts 15074 if (value.length >= HEADER_OFFSET - 1) 15075 return value; 15076 value = value[HOST]; 15077 } 15078 return null; 15079} 15080 15081const ɵ0$4 = () => Promise.resolve(null); 15082/** 15083 * A permanent marker promise which signifies that the current CD tree is 15084 * clean. 15085 */ 15086const _CLEAN_PROMISE = (ɵ0$4)(); 15087/** 15088 * Process the `TView.expandoInstructions`. (Execute the `hostBindings`.) 15089 * 15090 * @param tView `TView` containing the `expandoInstructions` 15091 * @param lView `LView` associated with the `TView` 15092 */ 15093function setHostBindingsByExecutingExpandoInstructions(tView, lView) { 15094 ngDevMode && assertSame(tView, lView[TVIEW], '`LView` is not associated with the `TView`!'); 15095 try { 15096 const expandoInstructions = tView.expandoInstructions; 15097 if (expandoInstructions !== null) { 15098 let bindingRootIndex = tView.expandoStartIndex; 15099 let currentDirectiveIndex = -1; 15100 let currentElementIndex = -1; 15101 // TODO(misko): PERF It is possible to get here with `TView.expandoInstructions` containing no 15102 // functions to execute. This is wasteful as there is no work to be done, but we still need 15103 // to iterate over the instructions. 15104 // In example of this is in this test: `host_binding_spec.ts` 15105 // `fit('should not cause problems if detectChanges is called when a property updates', ...` 15106 // In the above test we get here with expando [0, 0, 1] which requires a lot of processing but 15107 // there is no function to execute. 15108 for (let i = 0; i < expandoInstructions.length; i++) { 15109 const instruction = expandoInstructions[i]; 15110 if (typeof instruction === 'number') { 15111 if (instruction <= 0) { 15112 // Negative numbers mean that we are starting new EXPANDO block and need to update 15113 // the current element and directive index. 15114 // Important: In JS `-x` and `0-x` is not the same! If `x===0` then `-x` will produce 15115 // `-0` which requires non standard math arithmetic and it can prevent VM optimizations. 15116 // `0-0` will always produce `0` and will not cause a potential deoptimization in VM. 15117 // TODO(misko): PERF This should be refactored to use `~instruction` as that does not 15118 // suffer from `-0` and it is faster/more compact. 15119 currentElementIndex = 0 - instruction; 15120 setSelectedIndex(currentElementIndex); 15121 // Injector block and providers are taken into account. 15122 const providerCount = expandoInstructions[++i]; 15123 bindingRootIndex += INJECTOR_BLOOM_PARENT_SIZE + providerCount; 15124 currentDirectiveIndex = bindingRootIndex; 15125 } 15126 else { 15127 // This is either the injector size (so the binding root can skip over directives 15128 // and get to the first set of host bindings on this node) or the host var count 15129 // (to get to the next set of host bindings on this node). 15130 bindingRootIndex += instruction; 15131 } 15132 } 15133 else { 15134 // If it's not a number, it's a host binding function that needs to be executed. 15135 if (instruction !== null) { 15136 ngDevMode && 15137 assertLessThan(currentDirectiveIndex, 1048576 /* CptViewProvidersCountShifter */, 'Reached the max number of host bindings'); 15138 setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex); 15139 const hostCtx = lView[currentDirectiveIndex]; 15140 instruction(2 /* Update */, hostCtx); 15141 } 15142 // TODO(misko): PERF Relying on incrementing the `currentDirectiveIndex` here is 15143 // sub-optimal. The implications are that if we have a lot of directives but none of them 15144 // have host bindings we nevertheless need to iterate over the expando instructions to 15145 // update the counter. It would be much better if we could encode the 15146 // `currentDirectiveIndex` into the `expandoInstruction` array so that we only need to 15147 // iterate over those directives which actually have `hostBindings`. 15148 currentDirectiveIndex++; 15149 } 15150 } 15151 } 15152 } 15153 finally { 15154 setSelectedIndex(-1); 15155 } 15156} 15157/** Refreshes all content queries declared by directives in a given view */ 15158function refreshContentQueries(tView, lView) { 15159 const contentQueries = tView.contentQueries; 15160 if (contentQueries !== null) { 15161 for (let i = 0; i < contentQueries.length; i += 2) { 15162 const queryStartIdx = contentQueries[i]; 15163 const directiveDefIdx = contentQueries[i + 1]; 15164 if (directiveDefIdx !== -1) { 15165 const directiveDef = tView.data[directiveDefIdx]; 15166 ngDevMode && 15167 assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined'); 15168 setCurrentQueryIndex(queryStartIdx); 15169 directiveDef.contentQueries(2 /* Update */, lView[directiveDefIdx], directiveDefIdx); 15170 } 15171 } 15172 } 15173} 15174/** Refreshes child components in the current view (update mode). */ 15175function refreshChildComponents(hostLView, components) { 15176 for (let i = 0; i < components.length; i++) { 15177 refreshComponent(hostLView, components[i]); 15178 } 15179} 15180/** Renders child components in the current view (creation mode). */ 15181function renderChildComponents(hostLView, components) { 15182 for (let i = 0; i < components.length; i++) { 15183 renderComponent(hostLView, components[i]); 15184 } 15185} 15186/** 15187 * Creates a native element from a tag name, using a renderer. 15188 * @param name the tag name 15189 * @param renderer A renderer to use 15190 * @returns the element created 15191 */ 15192function elementCreate(name, renderer, namespace) { 15193 if (isProceduralRenderer(renderer)) { 15194 return renderer.createElement(name, namespace); 15195 } 15196 else { 15197 return namespace === null ? renderer.createElement(name) : 15198 renderer.createElementNS(namespace, name); 15199 } 15200} 15201function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector) { 15202 const lView = ngDevMode ? cloneToLViewFromTViewBlueprint(tView) : tView.blueprint.slice(); 15203 lView[HOST] = host; 15204 lView[FLAGS] = flags | 4 /* CreationMode */ | 128 /* Attached */ | 8 /* FirstLViewPass */; 15205 resetPreOrderHookFlags(lView); 15206 lView[PARENT] = lView[DECLARATION_VIEW] = parentLView; 15207 lView[CONTEXT] = context; 15208 lView[RENDERER_FACTORY] = (rendererFactory || parentLView && parentLView[RENDERER_FACTORY]); 15209 ngDevMode && assertDefined(lView[RENDERER_FACTORY], 'RendererFactory is required'); 15210 lView[RENDERER] = (renderer || parentLView && parentLView[RENDERER]); 15211 ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required'); 15212 lView[SANITIZER] = sanitizer || parentLView && parentLView[SANITIZER] || null; 15213 lView[INJECTOR$1] = injector || parentLView && parentLView[INJECTOR$1] || null; 15214 lView[T_HOST] = tHostNode; 15215 ngDevMode && 15216 assertEqual(tView.type == 2 /* Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView'); 15217 lView[DECLARATION_COMPONENT_VIEW] = 15218 tView.type == 2 /* Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView; 15219 ngDevMode && attachLViewDebug(lView); 15220 return lView; 15221} 15222function getOrCreateTNode(tView, tHostNode, index, type, name, attrs) { 15223 // Keep this function short, so that the VM will inline it. 15224 const adjustedIndex = index + HEADER_OFFSET; 15225 const tNode = tView.data[adjustedIndex] || 15226 createTNodeAtIndex(tView, tHostNode, adjustedIndex, type, name, attrs); 15227 setPreviousOrParentTNode(tNode, true); 15228 return tNode; 15229} 15230function createTNodeAtIndex(tView, tHostNode, adjustedIndex, type, name, attrs) { 15231 const previousOrParentTNode = getPreviousOrParentTNode(); 15232 const isParent = getIsParent(); 15233 const parent = isParent ? previousOrParentTNode : previousOrParentTNode && previousOrParentTNode.parent; 15234 // Parents cannot cross component boundaries because components will be used in multiple places, 15235 // so it's only set if the view is the same. 15236 const parentInSameView = parent && parent !== tHostNode; 15237 const tParentNode = parentInSameView ? parent : null; 15238 const tNode = tView.data[adjustedIndex] = 15239 createTNode(tView, tParentNode, type, adjustedIndex, name, attrs); 15240 // Assign a pointer to the first child node of a given view. The first node is not always the one 15241 // at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has 15242 // the index 1 or more, so we can't just check node index. 15243 if (tView.firstChild === null) { 15244 tView.firstChild = tNode; 15245 } 15246 if (previousOrParentTNode) { 15247 if (isParent && previousOrParentTNode.child == null && 15248 (tNode.parent !== null || previousOrParentTNode.type === 2 /* View */)) { 15249 // We are in the same view, which means we are adding content node to the parent view. 15250 previousOrParentTNode.child = tNode; 15251 } 15252 else if (!isParent) { 15253 previousOrParentTNode.next = tNode; 15254 } 15255 } 15256 return tNode; 15257} 15258function assignTViewNodeToLView(tView, tParentNode, index, lView) { 15259 // View nodes are not stored in data because they can be added / removed at runtime (which 15260 // would cause indices to change). Their TNodes are instead stored in tView.node. 15261 let tNode = tView.node; 15262 if (tNode == null) { 15263 ngDevMode && tParentNode && 15264 assertNodeOfPossibleTypes(tParentNode, [3 /* Element */, 0 /* Container */]); 15265 tView.node = tNode = createTNode(tView, tParentNode, // 15266 2 /* View */, index, null, null); 15267 } 15268 lView[T_HOST] = tNode; 15269} 15270/** 15271 * When elements are created dynamically after a view blueprint is created (e.g. through 15272 * i18nApply() or ComponentFactory.create), we need to adjust the blueprint for future 15273 * template passes. 15274 * 15275 * @param tView `TView` associated with `LView` 15276 * @param view The `LView` containing the blueprint to adjust 15277 * @param numSlotsToAlloc The number of slots to alloc in the LView, should be >0 15278 */ 15279function allocExpando(tView, lView, numSlotsToAlloc) { 15280 ngDevMode && 15281 assertGreaterThan(numSlotsToAlloc, 0, 'The number of slots to alloc should be greater than 0'); 15282 if (numSlotsToAlloc > 0) { 15283 if (tView.firstCreatePass) { 15284 for (let i = 0; i < numSlotsToAlloc; i++) { 15285 tView.blueprint.push(null); 15286 tView.data.push(null); 15287 lView.push(null); 15288 } 15289 // We should only increment the expando start index if there aren't already directives 15290 // and injectors saved in the "expando" section 15291 if (!tView.expandoInstructions) { 15292 tView.expandoStartIndex += numSlotsToAlloc; 15293 } 15294 else { 15295 // Since we're adding the dynamic nodes into the expando section, we need to let the host 15296 // bindings know that they should skip x slots 15297 tView.expandoInstructions.push(numSlotsToAlloc); 15298 } 15299 } 15300 } 15301} 15302////////////////////////// 15303//// Render 15304////////////////////////// 15305/** 15306 * Processes a view in the creation mode. This includes a number of steps in a specific order: 15307 * - creating view query functions (if any); 15308 * - executing a template function in the creation mode; 15309 * - updating static queries (if any); 15310 * - creating child components defined in a given view. 15311 */ 15312function renderView(tView, lView, context) { 15313 ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode'); 15314 enterView(lView, lView[T_HOST]); 15315 try { 15316 const viewQuery = tView.viewQuery; 15317 if (viewQuery !== null) { 15318 executeViewQueryFn(1 /* Create */, viewQuery, context); 15319 } 15320 // Execute a template associated with this view, if it exists. A template function might not be 15321 // defined for the root component views. 15322 const templateFn = tView.template; 15323 if (templateFn !== null) { 15324 executeTemplate(tView, lView, templateFn, 1 /* Create */, context); 15325 } 15326 // This needs to be set before children are processed to support recursive components. 15327 // This must be set to false immediately after the first creation run because in an 15328 // ngFor loop, all the views will be created together before update mode runs and turns 15329 // off firstCreatePass. If we don't set it here, instances will perform directive 15330 // matching, etc again and again. 15331 if (tView.firstCreatePass) { 15332 tView.firstCreatePass = false; 15333 } 15334 // We resolve content queries specifically marked as `static` in creation mode. Dynamic 15335 // content queries are resolved during change detection (i.e. update mode), after embedded 15336 // views are refreshed (see block above). 15337 if (tView.staticContentQueries) { 15338 refreshContentQueries(tView, lView); 15339 } 15340 // We must materialize query results before child components are processed 15341 // in case a child component has projected a container. The LContainer needs 15342 // to exist so the embedded views are properly attached by the container. 15343 if (tView.staticViewQueries) { 15344 executeViewQueryFn(2 /* Update */, tView.viewQuery, context); 15345 } 15346 // Render child component views. 15347 const components = tView.components; 15348 if (components !== null) { 15349 renderChildComponents(lView, components); 15350 } 15351 } 15352 catch (error) { 15353 // If we didn't manage to get past the first template pass due to 15354 // an error, mark the view as corrupted so we can try to recover. 15355 if (tView.firstCreatePass) { 15356 tView.incompleteFirstPass = true; 15357 } 15358 throw error; 15359 } 15360 finally { 15361 lView[FLAGS] &= ~4 /* CreationMode */; 15362 leaveView(); 15363 } 15364} 15365/** 15366 * Processes a view in update mode. This includes a number of steps in a specific order: 15367 * - executing a template function in update mode; 15368 * - executing hooks; 15369 * - refreshing queries; 15370 * - setting host bindings; 15371 * - refreshing child (embedded and component) views. 15372 */ 15373function refreshView(tView, lView, templateFn, context) { 15374 ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode'); 15375 const flags = lView[FLAGS]; 15376 if ((flags & 256 /* Destroyed */) === 256 /* Destroyed */) 15377 return; 15378 enterView(lView, lView[T_HOST]); 15379 const checkNoChangesMode = getCheckNoChangesMode(); 15380 try { 15381 resetPreOrderHookFlags(lView); 15382 setBindingIndex(tView.bindingStartIndex); 15383 if (templateFn !== null) { 15384 executeTemplate(tView, lView, templateFn, 2 /* Update */, context); 15385 } 15386 const hooksInitPhaseCompleted = (flags & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */; 15387 // execute pre-order hooks (OnInit, OnChanges, DoCheck) 15388 // PERF WARNING: do NOT extract this to a separate function without running benchmarks 15389 if (!checkNoChangesMode) { 15390 if (hooksInitPhaseCompleted) { 15391 const preOrderCheckHooks = tView.preOrderCheckHooks; 15392 if (preOrderCheckHooks !== null) { 15393 executeCheckHooks(lView, preOrderCheckHooks, null); 15394 } 15395 } 15396 else { 15397 const preOrderHooks = tView.preOrderHooks; 15398 if (preOrderHooks !== null) { 15399 executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, null); 15400 } 15401 incrementInitPhaseFlags(lView, 0 /* OnInitHooksToBeRun */); 15402 } 15403 } 15404 // First mark transplanted views that are declared in this lView as needing a refresh at their 15405 // insertion points. This is needed to avoid the situation where the template is defined in this 15406 // `LView` but its declaration appears after the insertion component. 15407 markTransplantedViewsForRefresh(lView); 15408 refreshEmbeddedViews(lView); 15409 // Content query results must be refreshed before content hooks are called. 15410 if (tView.contentQueries !== null) { 15411 refreshContentQueries(tView, lView); 15412 } 15413 // execute content hooks (AfterContentInit, AfterContentChecked) 15414 // PERF WARNING: do NOT extract this to a separate function without running benchmarks 15415 if (!checkNoChangesMode) { 15416 if (hooksInitPhaseCompleted) { 15417 const contentCheckHooks = tView.contentCheckHooks; 15418 if (contentCheckHooks !== null) { 15419 executeCheckHooks(lView, contentCheckHooks); 15420 } 15421 } 15422 else { 15423 const contentHooks = tView.contentHooks; 15424 if (contentHooks !== null) { 15425 executeInitAndCheckHooks(lView, contentHooks, 1 /* AfterContentInitHooksToBeRun */); 15426 } 15427 incrementInitPhaseFlags(lView, 1 /* AfterContentInitHooksToBeRun */); 15428 } 15429 } 15430 setHostBindingsByExecutingExpandoInstructions(tView, lView); 15431 // Refresh child component views. 15432 const components = tView.components; 15433 if (components !== null) { 15434 refreshChildComponents(lView, components); 15435 } 15436 // View queries must execute after refreshing child components because a template in this view 15437 // could be inserted in a child component. If the view query executes before child component 15438 // refresh, the template might not yet be inserted. 15439 const viewQuery = tView.viewQuery; 15440 if (viewQuery !== null) { 15441 executeViewQueryFn(2 /* Update */, viewQuery, context); 15442 } 15443 // execute view hooks (AfterViewInit, AfterViewChecked) 15444 // PERF WARNING: do NOT extract this to a separate function without running benchmarks 15445 if (!checkNoChangesMode) { 15446 if (hooksInitPhaseCompleted) { 15447 const viewCheckHooks = tView.viewCheckHooks; 15448 if (viewCheckHooks !== null) { 15449 executeCheckHooks(lView, viewCheckHooks); 15450 } 15451 } 15452 else { 15453 const viewHooks = tView.viewHooks; 15454 if (viewHooks !== null) { 15455 executeInitAndCheckHooks(lView, viewHooks, 2 /* AfterViewInitHooksToBeRun */); 15456 } 15457 incrementInitPhaseFlags(lView, 2 /* AfterViewInitHooksToBeRun */); 15458 } 15459 } 15460 if (tView.firstUpdatePass === true) { 15461 // We need to make sure that we only flip the flag on successful `refreshView` only 15462 // Don't do this in `finally` block. 15463 // If we did this in `finally` block then an exception could block the execution of styling 15464 // instructions which in turn would be unable to insert themselves into the styling linked 15465 // list. The result of this would be that if the exception would not be throw on subsequent CD 15466 // the styling would be unable to process it data and reflect to the DOM. 15467 tView.firstUpdatePass = false; 15468 } 15469 // Do not reset the dirty state when running in check no changes mode. We don't want components 15470 // to behave differently depending on whether check no changes is enabled or not. For example: 15471 // Marking an OnPush component as dirty from within the `ngAfterViewInit` hook in order to 15472 // refresh a `NgClass` binding should work. If we would reset the dirty state in the check 15473 // no changes cycle, the component would be not be dirty for the next update pass. This would 15474 // be different in production mode where the component dirty state is not reset. 15475 if (!checkNoChangesMode) { 15476 lView[FLAGS] &= ~(64 /* Dirty */ | 8 /* FirstLViewPass */); 15477 } 15478 if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) { 15479 lView[FLAGS] &= ~1024 /* RefreshTransplantedView */; 15480 updateTransplantedViewCount(lView[PARENT], -1); 15481 } 15482 } 15483 finally { 15484 leaveView(); 15485 } 15486} 15487function renderComponentOrTemplate(tView, lView, templateFn, context) { 15488 const rendererFactory = lView[RENDERER_FACTORY]; 15489 const normalExecutionPath = !getCheckNoChangesMode(); 15490 const creationModeIsActive = isCreationMode(lView); 15491 try { 15492 if (normalExecutionPath && !creationModeIsActive && rendererFactory.begin) { 15493 rendererFactory.begin(); 15494 } 15495 if (creationModeIsActive) { 15496 renderView(tView, lView, context); 15497 } 15498 refreshView(tView, lView, templateFn, context); 15499 } 15500 finally { 15501 if (normalExecutionPath && !creationModeIsActive && rendererFactory.end) { 15502 rendererFactory.end(); 15503 } 15504 } 15505} 15506function executeTemplate(tView, lView, templateFn, rf, context) { 15507 const prevSelectedIndex = getSelectedIndex(); 15508 try { 15509 setSelectedIndex(-1); 15510 if (rf & 2 /* Update */ && lView.length > HEADER_OFFSET) { 15511 // When we're updating, inherently select 0 so we don't 15512 // have to generate that instruction for most update blocks. 15513 selectIndexInternal(tView, lView, 0, getCheckNoChangesMode()); 15514 } 15515 templateFn(rf, context); 15516 } 15517 finally { 15518 setSelectedIndex(prevSelectedIndex); 15519 } 15520} 15521////////////////////////// 15522//// Element 15523////////////////////////// 15524function executeContentQueries(tView, tNode, lView) { 15525 if (isContentQueryHost(tNode)) { 15526 const start = tNode.directiveStart; 15527 const end = tNode.directiveEnd; 15528 for (let directiveIndex = start; directiveIndex < end; directiveIndex++) { 15529 const def = tView.data[directiveIndex]; 15530 if (def.contentQueries) { 15531 def.contentQueries(1 /* Create */, lView[directiveIndex], directiveIndex); 15532 } 15533 } 15534 } 15535} 15536/** 15537 * Creates directive instances. 15538 */ 15539function createDirectivesInstances(tView, lView, tNode) { 15540 if (!getBindingsEnabled()) 15541 return; 15542 instantiateAllDirectives(tView, lView, tNode, getNativeByTNode(tNode, lView)); 15543 if ((tNode.flags & 128 /* hasHostBindings */) === 128 /* hasHostBindings */) { 15544 invokeDirectivesHostBindings(tView, lView, tNode); 15545 } 15546} 15547/** 15548 * Takes a list of local names and indices and pushes the resolved local variable values 15549 * to LView in the same order as they are loaded in the template with load(). 15550 */ 15551function saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) { 15552 const localNames = tNode.localNames; 15553 if (localNames !== null) { 15554 let localIndex = tNode.index + 1; 15555 for (let i = 0; i < localNames.length; i += 2) { 15556 const index = localNames[i + 1]; 15557 const value = index === -1 ? 15558 localRefExtractor(tNode, viewData) : 15559 viewData[index]; 15560 viewData[localIndex++] = value; 15561 } 15562 } 15563} 15564/** 15565 * Gets TView from a template function or creates a new TView 15566 * if it doesn't already exist. 15567 * 15568 * @param def ComponentDef 15569 * @returns TView 15570 */ 15571function getOrCreateTComponentView(def) { 15572 const tView = def.tView; 15573 // Create a TView if there isn't one, or recreate it if the first create pass didn't 15574 // complete successfuly since we can't know for sure whether it's in a usable shape. 15575 if (tView === null || tView.incompleteFirstPass) { 15576 return def.tView = createTView(1 /* Component */, -1, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts); 15577 } 15578 return tView; 15579} 15580/** 15581 * Creates a TView instance 15582 * 15583 * @param viewIndex The viewBlockId for inline views, or -1 if it's a component/dynamic 15584 * @param templateFn Template function 15585 * @param decls The number of nodes, local refs, and pipes in this template 15586 * @param directives Registry of directives for this view 15587 * @param pipes Registry of pipes for this view 15588 * @param viewQuery View queries for this view 15589 * @param schemas Schemas for this view 15590 * @param consts Constants for this view 15591 */ 15592function createTView(type, viewIndex, templateFn, decls, vars, directives, pipes, viewQuery, schemas, consts) { 15593 ngDevMode && ngDevMode.tView++; 15594 const bindingStartIndex = HEADER_OFFSET + decls; 15595 // This length does not yet contain host bindings from child directives because at this point, 15596 // we don't know which directives are active on this template. As soon as a directive is matched 15597 // that has a host binding, we will update the blueprint with that def's hostVars count. 15598 const initialViewLength = bindingStartIndex + vars; 15599 const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength); 15600 const tView = blueprint[TVIEW] = ngDevMode ? 15601 new TViewConstructor(type, viewIndex, // id: number, 15602 blueprint, // blueprint: LView, 15603 templateFn, // template: ComponentTemplate<{}>|null, 15604 null, // queries: TQueries|null 15605 viewQuery, // viewQuery: ViewQueriesFunction<{}>|null, 15606 null, // node: TViewNode|TElementNode|null, 15607 cloneToTViewData(blueprint).fill(null, bindingStartIndex), // data: TData, 15608 bindingStartIndex, // bindingStartIndex: number, 15609 initialViewLength, // expandoStartIndex: number, 15610 null, // expandoInstructions: ExpandoInstructions|null, 15611 true, // firstCreatePass: boolean, 15612 true, // firstUpdatePass: boolean, 15613 false, // staticViewQueries: boolean, 15614 false, // staticContentQueries: boolean, 15615 null, // preOrderHooks: HookData|null, 15616 null, // preOrderCheckHooks: HookData|null, 15617 null, // contentHooks: HookData|null, 15618 null, // contentCheckHooks: HookData|null, 15619 null, // viewHooks: HookData|null, 15620 null, // viewCheckHooks: HookData|null, 15621 null, // destroyHooks: DestroyHookData|null, 15622 null, // cleanup: any[]|null, 15623 null, // contentQueries: number[]|null, 15624 null, // components: number[]|null, 15625 typeof directives === 'function' ? 15626 directives() : 15627 directives, // directiveRegistry: DirectiveDefList|null, 15628 typeof pipes === 'function' ? pipes() : pipes, // pipeRegistry: PipeDefList|null, 15629 null, // firstChild: TNode|null, 15630 schemas, // schemas: SchemaMetadata[]|null, 15631 consts, // consts: TConstants|null 15632 false, // incompleteFirstPass: boolean 15633 decls, // ngDevMode only: decls 15634 vars) : 15635 { 15636 type: type, 15637 id: viewIndex, 15638 blueprint: blueprint, 15639 template: templateFn, 15640 queries: null, 15641 viewQuery: viewQuery, 15642 node: null, 15643 data: blueprint.slice().fill(null, bindingStartIndex), 15644 bindingStartIndex: bindingStartIndex, 15645 expandoStartIndex: initialViewLength, 15646 expandoInstructions: null, 15647 firstCreatePass: true, 15648 firstUpdatePass: true, 15649 staticViewQueries: false, 15650 staticContentQueries: false, 15651 preOrderHooks: null, 15652 preOrderCheckHooks: null, 15653 contentHooks: null, 15654 contentCheckHooks: null, 15655 viewHooks: null, 15656 viewCheckHooks: null, 15657 destroyHooks: null, 15658 cleanup: null, 15659 contentQueries: null, 15660 components: null, 15661 directiveRegistry: typeof directives === 'function' ? directives() : directives, 15662 pipeRegistry: typeof pipes === 'function' ? pipes() : pipes, 15663 firstChild: null, 15664 schemas: schemas, 15665 consts: consts, 15666 incompleteFirstPass: false 15667 }; 15668 if (ngDevMode) { 15669 // For performance reasons it is important that the tView retains the same shape during runtime. 15670 // (To make sure that all of the code is monomorphic.) For this reason we seal the object to 15671 // prevent class transitions. 15672 Object.seal(tView); 15673 } 15674 return tView; 15675} 15676function createViewBlueprint(bindingStartIndex, initialViewLength) { 15677 const blueprint = ngDevMode ? new LViewBlueprint() : []; 15678 for (let i = 0; i < initialViewLength; i++) { 15679 blueprint.push(i < bindingStartIndex ? null : NO_CHANGE); 15680 } 15681 return blueprint; 15682} 15683function createError(text, token) { 15684 return new Error(`Renderer: ${text} [${stringifyForError(token)}]`); 15685} 15686function assertHostNodeExists(rElement, elementOrSelector) { 15687 if (!rElement) { 15688 if (typeof elementOrSelector === 'string') { 15689 throw createError('Host node with selector not found:', elementOrSelector); 15690 } 15691 else { 15692 throw createError('Host node is required:', elementOrSelector); 15693 } 15694 } 15695} 15696/** 15697 * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline. 15698 * 15699 * @param rendererFactory Factory function to create renderer instance. 15700 * @param elementOrSelector Render element or CSS selector to locate the element. 15701 * @param encapsulation View Encapsulation defined for component that requests host element. 15702 */ 15703function locateHostElement(renderer, elementOrSelector, encapsulation) { 15704 if (isProceduralRenderer(renderer)) { 15705 // When using native Shadow DOM, do not clear host element to allow native slot projection 15706 const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom; 15707 return renderer.selectRootElement(elementOrSelector, preserveContent); 15708 } 15709 let rElement = typeof elementOrSelector === 'string' ? 15710 renderer.querySelector(elementOrSelector) : 15711 elementOrSelector; 15712 ngDevMode && assertHostNodeExists(rElement, elementOrSelector); 15713 // Always clear host element's content when Renderer3 is in use. For procedural renderer case we 15714 // make it depend on whether ShadowDom encapsulation is used (in which case the content should be 15715 // preserved to allow native slot projection). ShadowDom encapsulation requires procedural 15716 // renderer, and procedural renderer case is handled above. 15717 rElement.textContent = ''; 15718 return rElement; 15719} 15720/** 15721 * Saves context for this cleanup function in LView.cleanupInstances. 15722 * 15723 * On the first template pass, saves in TView: 15724 * - Cleanup function 15725 * - Index of context we just saved in LView.cleanupInstances 15726 */ 15727function storeCleanupWithContext(tView, lView, context, cleanupFn) { 15728 const lCleanup = getLCleanup(lView); 15729 lCleanup.push(context); 15730 if (tView.firstCreatePass) { 15731 getTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1); 15732 } 15733} 15734/** 15735 * Constructs a TNode object from the arguments. 15736 * 15737 * @param tView `TView` to which this `TNode` belongs (used only in `ngDevMode`) 15738 * @param type The type of the node 15739 * @param adjustedIndex The index of the TNode in TView.data, adjusted for HEADER_OFFSET 15740 * @param tagName The tag name of the node 15741 * @param attrs The attributes defined on this node 15742 * @param tViews Any TViews attached to this node 15743 * @returns the TNode object 15744 */ 15745function createTNode(tView, tParent, type, adjustedIndex, tagName, attrs) { 15746 ngDevMode && ngDevMode.tNode++; 15747 let injectorIndex = tParent ? tParent.injectorIndex : -1; 15748 const tNode = ngDevMode ? 15749 new TNodeDebug(tView, // tView_: TView 15750 type, // type: TNodeType 15751 adjustedIndex, // index: number 15752 injectorIndex, // injectorIndex: number 15753 -1, // directiveStart: number 15754 -1, // directiveEnd: number 15755 -1, // directiveStylingLast: number 15756 null, // propertyBindings: number[]|null 15757 0, // flags: TNodeFlags 15758 0, // providerIndexes: TNodeProviderIndexes 15759 tagName, // tagName: string|null 15760 attrs, // attrs: (string|AttributeMarker|(string|SelectorFlags)[])[]|null 15761 null, // mergedAttrs 15762 null, // localNames: (string|number)[]|null 15763 undefined, // initialInputs: (string[]|null)[]|null|undefined 15764 null, // inputs: PropertyAliases|null 15765 null, // outputs: PropertyAliases|null 15766 null, // tViews: ITView|ITView[]|null 15767 null, // next: ITNode|null 15768 null, // projectionNext: ITNode|null 15769 null, // child: ITNode|null 15770 tParent, // parent: TElementNode|TContainerNode|null 15771 null, // projection: number|(ITNode|RNode[])[]|null 15772 null, // styles: string|null 15773 null, // stylesWithoutHost: string|null 15774 undefined, // residualStyles: string|null 15775 null, // classes: string|null 15776 null, // classesWithoutHost: string|null 15777 undefined, // residualClasses: string|null 15778 0, // classBindings: TStylingRange; 15779 0) : 15780 { 15781 type: type, 15782 index: adjustedIndex, 15783 injectorIndex: injectorIndex, 15784 directiveStart: -1, 15785 directiveEnd: -1, 15786 directiveStylingLast: -1, 15787 propertyBindings: null, 15788 flags: 0, 15789 providerIndexes: 0, 15790 tagName: tagName, 15791 attrs: attrs, 15792 mergedAttrs: null, 15793 localNames: null, 15794 initialInputs: undefined, 15795 inputs: null, 15796 outputs: null, 15797 tViews: null, 15798 next: null, 15799 projectionNext: null, 15800 child: null, 15801 parent: tParent, 15802 projection: null, 15803 styles: null, 15804 stylesWithoutHost: null, 15805 residualStyles: undefined, 15806 classes: null, 15807 classesWithoutHost: null, 15808 residualClasses: undefined, 15809 classBindings: 0, 15810 styleBindings: 0, 15811 }; 15812 if (ngDevMode) { 15813 // For performance reasons it is important that the tNode retains the same shape during runtime. 15814 // (To make sure that all of the code is monomorphic.) For this reason we seal the object to 15815 // prevent class transitions. 15816 Object.seal(tNode); 15817 } 15818 return tNode; 15819} 15820function generatePropertyAliases(inputAliasMap, directiveDefIdx, propStore) { 15821 for (let publicName in inputAliasMap) { 15822 if (inputAliasMap.hasOwnProperty(publicName)) { 15823 propStore = propStore === null ? {} : propStore; 15824 const internalName = inputAliasMap[publicName]; 15825 if (propStore.hasOwnProperty(publicName)) { 15826 propStore[publicName].push(directiveDefIdx, internalName); 15827 } 15828 else { 15829 (propStore[publicName] = [directiveDefIdx, internalName]); 15830 } 15831 } 15832 } 15833 return propStore; 15834} 15835/** 15836 * Initializes data structures required to work with directive outputs and outputs. 15837 * Initialization is done for all directives matched on a given TNode. 15838 */ 15839function initializeInputAndOutputAliases(tView, tNode) { 15840 ngDevMode && assertFirstCreatePass(tView); 15841 const start = tNode.directiveStart; 15842 const end = tNode.directiveEnd; 15843 const defs = tView.data; 15844 const tNodeAttrs = tNode.attrs; 15845 const inputsFromAttrs = ngDevMode ? new TNodeInitialInputs() : []; 15846 let inputsStore = null; 15847 let outputsStore = null; 15848 for (let i = start; i < end; i++) { 15849 const directiveDef = defs[i]; 15850 const directiveInputs = directiveDef.inputs; 15851 // Do not use unbound attributes as inputs to structural directives, since structural 15852 // directive inputs can only be set using microsyntax (e.g. `<div *dir="exp">`). 15853 // TODO(FW-1930): microsyntax expressions may also contain unbound/static attributes, which 15854 // should be set for inline templates. 15855 const initialInputs = (tNodeAttrs !== null && !isInlineTemplate(tNode)) ? 15856 generateInitialInputs(directiveInputs, tNodeAttrs) : 15857 null; 15858 inputsFromAttrs.push(initialInputs); 15859 inputsStore = generatePropertyAliases(directiveInputs, i, inputsStore); 15860 outputsStore = generatePropertyAliases(directiveDef.outputs, i, outputsStore); 15861 } 15862 if (inputsStore !== null) { 15863 if (inputsStore.hasOwnProperty('class')) { 15864 tNode.flags |= 16 /* hasClassInput */; 15865 } 15866 if (inputsStore.hasOwnProperty('style')) { 15867 tNode.flags |= 32 /* hasStyleInput */; 15868 } 15869 } 15870 tNode.initialInputs = inputsFromAttrs; 15871 tNode.inputs = inputsStore; 15872 tNode.outputs = outputsStore; 15873} 15874/** 15875 * Mapping between attributes names that don't correspond to their element property names. 15876 * 15877 * Performance note: this function is written as a series of if checks (instead of, say, a property 15878 * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of 15879 * mapping property names. Do NOT change without benchmarking. 15880 * 15881 * Note: this mapping has to be kept in sync with the equally named mapping in the template 15882 * type-checking machinery of ngtsc. 15883 */ 15884function mapPropName(name) { 15885 if (name === 'class') 15886 return 'className'; 15887 if (name === 'for') 15888 return 'htmlFor'; 15889 if (name === 'formaction') 15890 return 'formAction'; 15891 if (name === 'innerHtml') 15892 return 'innerHTML'; 15893 if (name === 'readonly') 15894 return 'readOnly'; 15895 if (name === 'tabindex') 15896 return 'tabIndex'; 15897 return name; 15898} 15899function elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, nativeOnly) { 15900 ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.'); 15901 const element = getNativeByTNode(tNode, lView); 15902 let inputData = tNode.inputs; 15903 let dataValue; 15904 if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) { 15905 setInputsForProperty(tView, lView, dataValue, propName, value); 15906 if (isComponentHost(tNode)) 15907 markDirtyIfOnPush(lView, tNode.index); 15908 if (ngDevMode) { 15909 setNgReflectProperties(lView, element, tNode.type, dataValue, value); 15910 } 15911 } 15912 else if (tNode.type === 3 /* Element */) { 15913 propName = mapPropName(propName); 15914 if (ngDevMode) { 15915 validateAgainstEventProperties(propName); 15916 if (!validateProperty(tView, element, propName, tNode)) { 15917 // Return here since we only log warnings for unknown properties. 15918 logUnknownPropertyError(propName, tNode); 15919 return; 15920 } 15921 ngDevMode.rendererSetProperty++; 15922 } 15923 // It is assumed that the sanitizer is only added when the compiler determines that the 15924 // property is risky, so sanitization can be done without further checks. 15925 value = sanitizer != null ? sanitizer(value, tNode.tagName || '', propName) : value; 15926 if (isProceduralRenderer(renderer)) { 15927 renderer.setProperty(element, propName, value); 15928 } 15929 else if (!isAnimationProp(propName)) { 15930 element.setProperty ? element.setProperty(propName, value) : 15931 element[propName] = value; 15932 } 15933 } 15934 else if (tNode.type === 0 /* Container */ || tNode.type === 4 /* ElementContainer */) { 15935 // If the node is a container and the property didn't 15936 // match any of the inputs or schemas we should throw. 15937 if (ngDevMode && !matchingSchemas(tView, tNode.tagName)) { 15938 logUnknownPropertyError(propName, tNode); 15939 } 15940 } 15941} 15942/** If node is an OnPush component, marks its LView dirty. */ 15943function markDirtyIfOnPush(lView, viewIndex) { 15944 ngDevMode && assertLView(lView); 15945 const childComponentLView = getComponentLViewByIndex(viewIndex, lView); 15946 if (!(childComponentLView[FLAGS] & 16 /* CheckAlways */)) { 15947 childComponentLView[FLAGS] |= 64 /* Dirty */; 15948 } 15949} 15950function setNgReflectProperty(lView, element, type, attrName, value) { 15951 const renderer = lView[RENDERER]; 15952 attrName = normalizeDebugBindingName(attrName); 15953 const debugValue = normalizeDebugBindingValue(value); 15954 if (type === 3 /* Element */) { 15955 if (value == null) { 15956 isProceduralRenderer(renderer) ? renderer.removeAttribute(element, attrName) : 15957 element.removeAttribute(attrName); 15958 } 15959 else { 15960 isProceduralRenderer(renderer) ? 15961 renderer.setAttribute(element, attrName, debugValue) : 15962 element.setAttribute(attrName, debugValue); 15963 } 15964 } 15965 else { 15966 const textContent = `bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`; 15967 if (isProceduralRenderer(renderer)) { 15968 renderer.setValue(element, textContent); 15969 } 15970 else { 15971 element.textContent = textContent; 15972 } 15973 } 15974} 15975function setNgReflectProperties(lView, element, type, dataValue, value) { 15976 if (type === 3 /* Element */ || type === 0 /* Container */) { 15977 /** 15978 * dataValue is an array containing runtime input or output names for the directives: 15979 * i+0: directive instance index 15980 * i+1: privateName 15981 * 15982 * e.g. [0, 'change', 'change-minified'] 15983 * we want to set the reflected property with the privateName: dataValue[i+1] 15984 */ 15985 for (let i = 0; i < dataValue.length; i += 2) { 15986 setNgReflectProperty(lView, element, type, dataValue[i + 1], value); 15987 } 15988 } 15989} 15990function validateProperty(tView, element, propName, tNode) { 15991 // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT 15992 // mode where this check happens at compile time. In JIT mode, `schemas` is always present and 15993 // defined as an array (as an empty array in case `schemas` field is not defined) and we should 15994 // execute the check below. 15995 if (tView.schemas === null) 15996 return true; 15997 // The property is considered valid if the element matches the schema, it exists on the element 15998 // or it is synthetic, and we are in a browser context (web worker nodes should be skipped). 15999 if (matchingSchemas(tView, tNode.tagName) || propName in element || isAnimationProp(propName)) { 16000 return true; 16001 } 16002 // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we 16003 // need to account for both here, while being careful for `typeof null` also returning 'object'. 16004 return typeof Node === 'undefined' || Node === null || !(element instanceof Node); 16005} 16006function matchingSchemas(tView, tagName) { 16007 const schemas = tView.schemas; 16008 if (schemas !== null) { 16009 for (let i = 0; i < schemas.length; i++) { 16010 const schema = schemas[i]; 16011 if (schema === NO_ERRORS_SCHEMA || 16012 schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) { 16013 return true; 16014 } 16015 } 16016 } 16017 return false; 16018} 16019/** 16020 * Logs an error that a property is not supported on an element. 16021 * @param propName Name of the invalid property. 16022 * @param tNode Node on which we encountered the property. 16023 */ 16024function logUnknownPropertyError(propName, tNode) { 16025 console.error(`Can't bind to '${propName}' since it isn't a known property of '${tNode.tagName}'.`); 16026} 16027/** 16028 * Instantiate a root component. 16029 */ 16030function instantiateRootComponent(tView, lView, def) { 16031 const rootTNode = getPreviousOrParentTNode(); 16032 if (tView.firstCreatePass) { 16033 if (def.providersResolver) 16034 def.providersResolver(def); 16035 generateExpandoInstructionBlock(tView, rootTNode, 1); 16036 baseResolveDirective(tView, lView, def); 16037 } 16038 const directive = getNodeInjectable(lView, tView, lView.length - 1, rootTNode); 16039 attachPatchData(directive, lView); 16040 const native = getNativeByTNode(rootTNode, lView); 16041 if (native) { 16042 attachPatchData(native, lView); 16043 } 16044 return directive; 16045} 16046/** 16047 * Resolve the matched directives on a node. 16048 */ 16049function resolveDirectives(tView, lView, tNode, localRefs) { 16050 // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in 16051 // tsickle. 16052 ngDevMode && assertFirstCreatePass(tView); 16053 let hasDirectives = false; 16054 if (getBindingsEnabled()) { 16055 const directiveDefs = findDirectiveDefMatches(tView, lView, tNode); 16056 const exportsMap = localRefs === null ? null : { '': -1 }; 16057 if (directiveDefs !== null) { 16058 let totalDirectiveHostVars = 0; 16059 hasDirectives = true; 16060 initTNodeFlags(tNode, tView.data.length, directiveDefs.length); 16061 // When the same token is provided by several directives on the same node, some rules apply in 16062 // the viewEngine: 16063 // - viewProviders have priority over providers 16064 // - the last directive in NgModule.declarations has priority over the previous one 16065 // So to match these rules, the order in which providers are added in the arrays is very 16066 // important. 16067 for (let i = 0; i < directiveDefs.length; i++) { 16068 const def = directiveDefs[i]; 16069 if (def.providersResolver) 16070 def.providersResolver(def); 16071 } 16072 generateExpandoInstructionBlock(tView, tNode, directiveDefs.length); 16073 let preOrderHooksFound = false; 16074 let preOrderCheckHooksFound = false; 16075 for (let i = 0; i < directiveDefs.length; i++) { 16076 const def = directiveDefs[i]; 16077 // Merge the attrs in the order of matches. This assumes that the first directive is the 16078 // component itself, so that the component has the least priority. 16079 tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs); 16080 baseResolveDirective(tView, lView, def); 16081 saveNameToExportMap(tView.data.length - 1, def, exportsMap); 16082 if (def.contentQueries !== null) 16083 tNode.flags |= 8 /* hasContentQuery */; 16084 if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0) 16085 tNode.flags |= 128 /* hasHostBindings */; 16086 const lifeCycleHooks = def.type.prototype; 16087 // Only push a node index into the preOrderHooks array if this is the first 16088 // pre-order hook found on this node. 16089 if (!preOrderHooksFound && 16090 (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) { 16091 // We will push the actual hook function into this array later during dir instantiation. 16092 // We cannot do it now because we must ensure hooks are registered in the same 16093 // order that directives are created (i.e. injection order). 16094 (tView.preOrderHooks || (tView.preOrderHooks = [])).push(tNode.index - HEADER_OFFSET); 16095 preOrderHooksFound = true; 16096 } 16097 if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) { 16098 (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])) 16099 .push(tNode.index - HEADER_OFFSET); 16100 preOrderCheckHooksFound = true; 16101 } 16102 addHostBindingsToExpandoInstructions(tView, def); 16103 totalDirectiveHostVars += def.hostVars; 16104 } 16105 initializeInputAndOutputAliases(tView, tNode); 16106 growHostVarsSpace(tView, lView, totalDirectiveHostVars); 16107 } 16108 if (exportsMap) 16109 cacheMatchingLocalNames(tNode, localRefs, exportsMap); 16110 } 16111 // Merge the template attrs last so that they have the highest priority. 16112 tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs); 16113 return hasDirectives; 16114} 16115/** 16116 * Add `hostBindings` to the `TView.expandoInstructions`. 16117 * 16118 * @param tView `TView` to which the `hostBindings` should be added. 16119 * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add. 16120 */ 16121function addHostBindingsToExpandoInstructions(tView, def) { 16122 ngDevMode && assertFirstCreatePass(tView); 16123 const expando = tView.expandoInstructions; 16124 // TODO(misko): PERF we are adding `hostBindings` even if there is nothing to add! This is 16125 // suboptimal for performance. `def.hostBindings` may be null, 16126 // but we still need to push null to the array as a placeholder 16127 // to ensure the directive counter is incremented (so host 16128 // binding functions always line up with the corrective directive). 16129 // This is suboptimal for performance. See `currentDirectiveIndex` 16130 // comment in `setHostBindingsByExecutingExpandoInstructions` for more 16131 // details. expando.push(def.hostBindings); 16132 expando.push(def.hostBindings); 16133 const hostVars = def.hostVars; 16134 if (hostVars !== 0) { 16135 expando.push(def.hostVars); 16136 } 16137} 16138/** 16139 * Grow the `LView`, blueprint and `TView.data` to accommodate the `hostBindings`. 16140 * 16141 * To support locality we don't know ahead of time how many `hostVars` of the containing directives 16142 * we need to allocate. For this reason we allow growing these data structures as we discover more 16143 * directives to accommodate them. 16144 * 16145 * @param tView `TView` which needs to be grown. 16146 * @param lView `LView` which needs to be grown. 16147 * @param count Size by which we need to grow the data structures. 16148 */ 16149function growHostVarsSpace(tView, lView, count) { 16150 ngDevMode && assertFirstCreatePass(tView); 16151 ngDevMode && assertSame(tView, lView[TVIEW], '`LView` must be associated with `TView`!'); 16152 for (let i = 0; i < count; i++) { 16153 lView.push(NO_CHANGE); 16154 tView.blueprint.push(NO_CHANGE); 16155 tView.data.push(null); 16156 } 16157} 16158/** 16159 * Instantiate all the directives that were previously resolved on the current node. 16160 */ 16161function instantiateAllDirectives(tView, lView, tNode, native) { 16162 const start = tNode.directiveStart; 16163 const end = tNode.directiveEnd; 16164 if (!tView.firstCreatePass) { 16165 getOrCreateNodeInjectorForNode(tNode, lView); 16166 } 16167 attachPatchData(native, lView); 16168 const initialInputs = tNode.initialInputs; 16169 for (let i = start; i < end; i++) { 16170 const def = tView.data[i]; 16171 const isComponent = isComponentDef(def); 16172 if (isComponent) { 16173 ngDevMode && assertNodeOfPossibleTypes(tNode, [3 /* Element */]); 16174 addComponentLogic(lView, tNode, def); 16175 } 16176 const directive = getNodeInjectable(lView, tView, i, tNode); 16177 attachPatchData(directive, lView); 16178 if (initialInputs !== null) { 16179 setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs); 16180 } 16181 if (isComponent) { 16182 const componentView = getComponentLViewByIndex(tNode.index, lView); 16183 componentView[CONTEXT] = directive; 16184 } 16185 } 16186} 16187function invokeDirectivesHostBindings(tView, lView, tNode) { 16188 const start = tNode.directiveStart; 16189 const end = tNode.directiveEnd; 16190 const expando = tView.expandoInstructions; 16191 const firstCreatePass = tView.firstCreatePass; 16192 const elementIndex = tNode.index - HEADER_OFFSET; 16193 const currentDirectiveIndex = getCurrentDirectiveIndex(); 16194 try { 16195 setSelectedIndex(elementIndex); 16196 for (let dirIndex = start; dirIndex < end; dirIndex++) { 16197 const def = tView.data[dirIndex]; 16198 const directive = lView[dirIndex]; 16199 setCurrentDirectiveIndex(dirIndex); 16200 if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) { 16201 invokeHostBindingsInCreationMode(def, directive); 16202 } 16203 else if (firstCreatePass) { 16204 expando.push(null); 16205 } 16206 } 16207 } 16208 finally { 16209 setSelectedIndex(-1); 16210 setCurrentDirectiveIndex(currentDirectiveIndex); 16211 } 16212} 16213/** 16214 * Invoke the host bindings in creation mode. 16215 * 16216 * @param def `DirectiveDef` which may contain the `hostBindings` function. 16217 * @param directive Instance of directive. 16218 */ 16219function invokeHostBindingsInCreationMode(def, directive) { 16220 if (def.hostBindings !== null) { 16221 def.hostBindings(1 /* Create */, directive); 16222 } 16223} 16224/** 16225 * Generates a new block in TView.expandoInstructions for this node. 16226 * 16227 * Each expando block starts with the element index (turned negative so we can distinguish 16228 * it from the hostVar count) and the directive count. See more in VIEW_DATA.md. 16229 */ 16230function generateExpandoInstructionBlock(tView, tNode, directiveCount) { 16231 ngDevMode && 16232 assertEqual(tView.firstCreatePass, true, 'Expando block should only be generated on first create pass.'); 16233 // Important: In JS `-x` and `0-x` is not the same! If `x===0` then `-x` will produce `-0` which 16234 // requires non standard math arithmetic and it can prevent VM optimizations. 16235 // `0-0` will always produce `0` and will not cause a potential deoptimization in VM. 16236 const elementIndex = HEADER_OFFSET - tNode.index; 16237 const providerStartIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */; 16238 const providerCount = tView.data.length - providerStartIndex; 16239 (tView.expandoInstructions || (tView.expandoInstructions = [])) 16240 .push(elementIndex, providerCount, directiveCount); 16241} 16242/** 16243 * Matches the current node against all available selectors. 16244 * If a component is matched (at most one), it is returned in first position in the array. 16245 */ 16246function findDirectiveDefMatches(tView, viewData, tNode) { 16247 ngDevMode && assertFirstCreatePass(tView); 16248 ngDevMode && 16249 assertNodeOfPossibleTypes(tNode, [3 /* Element */, 4 /* ElementContainer */, 0 /* Container */]); 16250 const registry = tView.directiveRegistry; 16251 let matches = null; 16252 if (registry) { 16253 for (let i = 0; i < registry.length; i++) { 16254 const def = registry[i]; 16255 if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) { 16256 matches || (matches = ngDevMode ? new MatchesArray() : []); 16257 diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type); 16258 if (isComponentDef(def)) { 16259 ngDevMode && 16260 assertNodeOfPossibleTypes(tNode, [3 /* Element */], `"${tNode.tagName}" tags cannot be used as component hosts. ` + 16261 `Please use a different tag to activate the ${stringify(def.type)} component.`); 16262 if (tNode.flags & 2 /* isComponentHost */) 16263 throwMultipleComponentError(tNode); 16264 markAsComponentHost(tView, tNode); 16265 // The component is always stored first with directives after. 16266 matches.unshift(def); 16267 } 16268 else { 16269 matches.push(def); 16270 } 16271 } 16272 } 16273 } 16274 return matches; 16275} 16276/** 16277 * Marks a given TNode as a component's host. This consists of: 16278 * - setting appropriate TNode flags; 16279 * - storing index of component's host element so it will be queued for view refresh during CD. 16280 */ 16281function markAsComponentHost(tView, hostTNode) { 16282 ngDevMode && assertFirstCreatePass(tView); 16283 hostTNode.flags |= 2 /* isComponentHost */; 16284 (tView.components || (tView.components = ngDevMode ? new TViewComponents() : [])) 16285 .push(hostTNode.index); 16286} 16287/** Caches local names and their matching directive indices for query and template lookups. */ 16288function cacheMatchingLocalNames(tNode, localRefs, exportsMap) { 16289 if (localRefs) { 16290 const localNames = tNode.localNames = ngDevMode ? new TNodeLocalNames() : []; 16291 // Local names must be stored in tNode in the same order that localRefs are defined 16292 // in the template to ensure the data is loaded in the same slots as their refs 16293 // in the template (for template queries). 16294 for (let i = 0; i < localRefs.length; i += 2) { 16295 const index = exportsMap[localRefs[i + 1]]; 16296 if (index == null) 16297 throw new Error(`Export of name '${localRefs[i + 1]}' not found!`); 16298 localNames.push(localRefs[i], index); 16299 } 16300 } 16301} 16302/** 16303 * Builds up an export map as directives are created, so local refs can be quickly mapped 16304 * to their directive instances. 16305 */ 16306function saveNameToExportMap(index, def, exportsMap) { 16307 if (exportsMap) { 16308 if (def.exportAs) { 16309 for (let i = 0; i < def.exportAs.length; i++) { 16310 exportsMap[def.exportAs[i]] = index; 16311 } 16312 } 16313 if (isComponentDef(def)) 16314 exportsMap[''] = index; 16315 } 16316} 16317/** 16318 * Initializes the flags on the current node, setting all indices to the initial index, 16319 * the directive count to 0, and adding the isComponent flag. 16320 * @param index the initial index 16321 */ 16322function initTNodeFlags(tNode, index, numberOfDirectives) { 16323 ngDevMode && 16324 assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives'); 16325 tNode.flags |= 1 /* isDirectiveHost */; 16326 // When the first directive is created on a node, save the index 16327 tNode.directiveStart = index; 16328 tNode.directiveEnd = index + numberOfDirectives; 16329 tNode.providerIndexes = index; 16330} 16331function baseResolveDirective(tView, viewData, def) { 16332 tView.data.push(def); 16333 const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true)); 16334 const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), null); 16335 tView.blueprint.push(nodeInjectorFactory); 16336 viewData.push(nodeInjectorFactory); 16337} 16338function addComponentLogic(lView, hostTNode, def) { 16339 const native = getNativeByTNode(hostTNode, lView); 16340 const tView = getOrCreateTComponentView(def); 16341 // Only component views should be added to the view tree directly. Embedded views are 16342 // accessed through their containers because they may be removed / re-added later. 16343 const rendererFactory = lView[RENDERER_FACTORY]; 16344 const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def))); 16345 // Component view will always be created before any injected LContainers, 16346 // so this is a regular element, wrap it with the component view 16347 lView[hostTNode.index] = componentView; 16348} 16349function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) { 16350 if (ngDevMode) { 16351 assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.'); 16352 validateAgainstEventAttributes(name); 16353 assertNodeNotOfTypes(tNode, [0 /* Container */, 4 /* ElementContainer */], `Attempted to set attribute \`${name}\` on a container node. ` + 16354 `Host bindings are not valid on ng-container or ng-template.`); 16355 } 16356 const element = getNativeByTNode(tNode, lView); 16357 const renderer = lView[RENDERER]; 16358 if (value == null) { 16359 ngDevMode && ngDevMode.rendererRemoveAttribute++; 16360 isProceduralRenderer(renderer) ? renderer.removeAttribute(element, name, namespace) : 16361 element.removeAttribute(name); 16362 } 16363 else { 16364 ngDevMode && ngDevMode.rendererSetAttribute++; 16365 const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tNode.tagName || '', name); 16366 if (isProceduralRenderer(renderer)) { 16367 renderer.setAttribute(element, name, strValue, namespace); 16368 } 16369 else { 16370 namespace ? element.setAttributeNS(namespace, name, strValue) : 16371 element.setAttribute(name, strValue); 16372 } 16373 } 16374} 16375/** 16376 * Sets initial input properties on directive instances from attribute data 16377 * 16378 * @param lView Current LView that is being processed. 16379 * @param directiveIndex Index of the directive in directives array 16380 * @param instance Instance of the directive on which to set the initial inputs 16381 * @param def The directive def that contains the list of inputs 16382 * @param tNode The static data for this node 16383 */ 16384function setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) { 16385 const initialInputs = initialInputData[directiveIndex]; 16386 if (initialInputs !== null) { 16387 const setInput = def.setInput; 16388 for (let i = 0; i < initialInputs.length;) { 16389 const publicName = initialInputs[i++]; 16390 const privateName = initialInputs[i++]; 16391 const value = initialInputs[i++]; 16392 if (setInput !== null) { 16393 def.setInput(instance, value, publicName, privateName); 16394 } 16395 else { 16396 instance[privateName] = value; 16397 } 16398 if (ngDevMode) { 16399 const nativeElement = getNativeByTNode(tNode, lView); 16400 setNgReflectProperty(lView, nativeElement, tNode.type, privateName, value); 16401 } 16402 } 16403 } 16404} 16405/** 16406 * Generates initialInputData for a node and stores it in the template's static storage 16407 * so subsequent template invocations don't have to recalculate it. 16408 * 16409 * initialInputData is an array containing values that need to be set as input properties 16410 * for directives on this node, but only once on creation. We need this array to support 16411 * the case where you set an @Input property of a directive using attribute-like syntax. 16412 * e.g. if you have a `name` @Input, you can set it once like this: 16413 * 16414 * <my-component name="Bess"></my-component> 16415 * 16416 * @param inputs The list of inputs from the directive def 16417 * @param attrs The static attrs on this node 16418 */ 16419function generateInitialInputs(inputs, attrs) { 16420 let inputsToStore = null; 16421 let i = 0; 16422 while (i < attrs.length) { 16423 const attrName = attrs[i]; 16424 if (attrName === 0 /* NamespaceURI */) { 16425 // We do not allow inputs on namespaced attributes. 16426 i += 4; 16427 continue; 16428 } 16429 else if (attrName === 5 /* ProjectAs */) { 16430 // Skip over the `ngProjectAs` value. 16431 i += 2; 16432 continue; 16433 } 16434 // If we hit any other attribute markers, we're done anyway. None of those are valid inputs. 16435 if (typeof attrName === 'number') 16436 break; 16437 if (inputs.hasOwnProperty(attrName)) { 16438 if (inputsToStore === null) 16439 inputsToStore = []; 16440 inputsToStore.push(attrName, inputs[attrName], attrs[i + 1]); 16441 } 16442 i += 2; 16443 } 16444 return inputsToStore; 16445} 16446////////////////////////// 16447//// ViewContainer & View 16448////////////////////////// 16449// Not sure why I need to do `any` here but TS complains later. 16450const LContainerArray = ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) && 16451 createNamedArrayType('LContainer'); 16452/** 16453 * Creates a LContainer, either from a container instruction, or for a ViewContainerRef. 16454 * 16455 * @param hostNative The host element for the LContainer 16456 * @param hostTNode The host TNode for the LContainer 16457 * @param currentView The parent view of the LContainer 16458 * @param native The native comment element 16459 * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case 16460 * @returns LContainer 16461 */ 16462function createLContainer(hostNative, currentView, native, tNode) { 16463 ngDevMode && assertLView(currentView); 16464 ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native); 16465 // https://jsperf.com/array-literal-vs-new-array-really 16466 const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native 16467 true, // Boolean `true` in this position signifies that this is an `LContainer` 16468 false, // has transplanted views 16469 currentView, // parent 16470 null, // next 16471 0, // transplanted views to refresh count 16472 tNode, // t_host 16473 native, // native, 16474 null, // view refs 16475 null); 16476 ngDevMode && 16477 assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.'); 16478 ngDevMode && attachLContainerDebug(lContainer); 16479 return lContainer; 16480} 16481/** 16482 * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes 16483 * them by executing an associated template function. 16484 */ 16485function refreshEmbeddedViews(lView) { 16486 for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) { 16487 for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) { 16488 const embeddedLView = lContainer[i]; 16489 const embeddedTView = embeddedLView[TVIEW]; 16490 ngDevMode && assertDefined(embeddedTView, 'TView must be allocated'); 16491 if (viewAttachedToChangeDetector(embeddedLView)) { 16492 refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]); 16493 } 16494 } 16495 } 16496} 16497/** 16498 * Mark transplanted views as needing to be refreshed at their insertion points. 16499 * 16500 * @param lView The `LView` that may have transplanted views. 16501 */ 16502function markTransplantedViewsForRefresh(lView) { 16503 for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) { 16504 if (!lContainer[HAS_TRANSPLANTED_VIEWS]) 16505 continue; 16506 const movedViews = lContainer[MOVED_VIEWS]; 16507 ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS'); 16508 for (let i = 0; i < movedViews.length; i++) { 16509 const movedLView = movedViews[i]; 16510 const insertionLContainer = movedLView[PARENT]; 16511 ngDevMode && assertLContainer(insertionLContainer); 16512 // We don't want to increment the counter if the moved LView was already marked for 16513 // refresh. 16514 if ((movedLView[FLAGS] & 1024 /* RefreshTransplantedView */) === 0) { 16515 updateTransplantedViewCount(insertionLContainer, 1); 16516 } 16517 // Note, it is possible that the `movedViews` is tracking views that are transplanted *and* 16518 // those that aren't (declaration component === insertion component). In the latter case, 16519 // it's fine to add the flag, as we will clear it immediately in 16520 // `refreshEmbeddedViews` for the view currently being refreshed. 16521 movedLView[FLAGS] |= 1024 /* RefreshTransplantedView */; 16522 } 16523 } 16524} 16525///////////// 16526/** 16527 * Refreshes components by entering the component view and processing its bindings, queries, etc. 16528 * 16529 * @param componentHostIdx Element index in LView[] (adjusted for HEADER_OFFSET) 16530 */ 16531function refreshComponent(hostLView, componentHostIdx) { 16532 ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode'); 16533 const componentView = getComponentLViewByIndex(componentHostIdx, hostLView); 16534 // Only attached components that are CheckAlways or OnPush and dirty should be refreshed 16535 if (viewAttachedToChangeDetector(componentView)) { 16536 const tView = componentView[TVIEW]; 16537 if (componentView[FLAGS] & (16 /* CheckAlways */ | 64 /* Dirty */)) { 16538 refreshView(tView, componentView, tView.template, componentView[CONTEXT]); 16539 } 16540 else if (componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) { 16541 // Only attached components that are CheckAlways or OnPush and dirty should be refreshed 16542 refreshContainsDirtyView(componentView); 16543 } 16544 } 16545} 16546/** 16547 * Refreshes all transplanted views marked with `LViewFlags.RefreshTransplantedView` that are 16548 * children or descendants of the given lView. 16549 * 16550 * @param lView The lView which contains descendant transplanted views that need to be refreshed. 16551 */ 16552function refreshContainsDirtyView(lView) { 16553 for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) { 16554 for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) { 16555 const embeddedLView = lContainer[i]; 16556 if (embeddedLView[FLAGS] & 1024 /* RefreshTransplantedView */) { 16557 const embeddedTView = embeddedLView[TVIEW]; 16558 ngDevMode && assertDefined(embeddedTView, 'TView must be allocated'); 16559 refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]); 16560 } 16561 else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) { 16562 refreshContainsDirtyView(embeddedLView); 16563 } 16564 } 16565 } 16566 const tView = lView[TVIEW]; 16567 // Refresh child component views. 16568 const components = tView.components; 16569 if (components !== null) { 16570 for (let i = 0; i < components.length; i++) { 16571 const componentView = getComponentLViewByIndex(components[i], lView); 16572 // Only attached components that are CheckAlways or OnPush and dirty should be refreshed 16573 if (viewAttachedToChangeDetector(componentView) && 16574 componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) { 16575 refreshContainsDirtyView(componentView); 16576 } 16577 } 16578 } 16579} 16580function renderComponent(hostLView, componentHostIdx) { 16581 ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode'); 16582 const componentView = getComponentLViewByIndex(componentHostIdx, hostLView); 16583 const componentTView = componentView[TVIEW]; 16584 syncViewWithBlueprint(componentTView, componentView); 16585 renderView(componentTView, componentView, componentView[CONTEXT]); 16586} 16587/** 16588 * Syncs an LView instance with its blueprint if they have gotten out of sync. 16589 * 16590 * Typically, blueprints and their view instances should always be in sync, so the loop here 16591 * will be skipped. However, consider this case of two components side-by-side: 16592 * 16593 * App template: 16594 * ``` 16595 * <comp></comp> 16596 * <comp></comp> 16597 * ``` 16598 * 16599 * The following will happen: 16600 * 1. App template begins processing. 16601 * 2. First <comp> is matched as a component and its LView is created. 16602 * 3. Second <comp> is matched as a component and its LView is created. 16603 * 4. App template completes processing, so it's time to check child templates. 16604 * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint. 16605 * 6. Second <comp> template is checked. Its blueprint has been updated by the first 16606 * <comp> template, but its LView was created before this update, so it is out of sync. 16607 * 16608 * Note that embedded views inside ngFor loops will never be out of sync because these views 16609 * are processed as soon as they are created. 16610 * 16611 * @param tView The `TView` that contains the blueprint for syncing 16612 * @param lView The view to sync 16613 */ 16614function syncViewWithBlueprint(tView, lView) { 16615 for (let i = lView.length; i < tView.blueprint.length; i++) { 16616 lView.push(tView.blueprint[i]); 16617 } 16618} 16619/** 16620 * Adds LView or LContainer to the end of the current view tree. 16621 * 16622 * This structure will be used to traverse through nested views to remove listeners 16623 * and call onDestroy callbacks. 16624 * 16625 * @param lView The view where LView or LContainer should be added 16626 * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header 16627 * @param lViewOrLContainer The LView or LContainer to add to the view tree 16628 * @returns The state passed in 16629 */ 16630function addToViewTree(lView, lViewOrLContainer) { 16631 // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer 16632 // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out 16633 // of order, the change detection will run out of order, as the act of retrieving the the 16634 // LContainer from the RNode is what adds it to the queue. 16635 if (lView[CHILD_HEAD]) { 16636 lView[CHILD_TAIL][NEXT] = lViewOrLContainer; 16637 } 16638 else { 16639 lView[CHILD_HEAD] = lViewOrLContainer; 16640 } 16641 lView[CHILD_TAIL] = lViewOrLContainer; 16642 return lViewOrLContainer; 16643} 16644/////////////////////////////// 16645//// Change detection 16646/////////////////////////////// 16647/** 16648 * Marks current view and all ancestors dirty. 16649 * 16650 * Returns the root view because it is found as a byproduct of marking the view tree 16651 * dirty, and can be used by methods that consume markViewDirty() to easily schedule 16652 * change detection. Otherwise, such methods would need to traverse up the view tree 16653 * an additional time to get the root view and schedule a tick on it. 16654 * 16655 * @param lView The starting LView to mark dirty 16656 * @returns the root LView 16657 */ 16658function markViewDirty(lView) { 16659 while (lView) { 16660 lView[FLAGS] |= 64 /* Dirty */; 16661 const parent = getLViewParent(lView); 16662 // Stop traversing up as soon as you find a root view that wasn't attached to any container 16663 if (isRootView(lView) && !parent) { 16664 return lView; 16665 } 16666 // continue otherwise 16667 lView = parent; 16668 } 16669 return null; 16670} 16671/** 16672 * Used to schedule change detection on the whole application. 16673 * 16674 * Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run. 16675 * It is usually called indirectly by calling `markDirty` when the view needs to be 16676 * re-rendered. 16677 * 16678 * Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple 16679 * `scheduleTick` requests. The scheduling function can be overridden in 16680 * `renderComponent`'s `scheduler` option. 16681 */ 16682function scheduleTick(rootContext, flags) { 16683 const nothingScheduled = rootContext.flags === 0 /* Empty */; 16684 rootContext.flags |= flags; 16685 if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) { 16686 let res; 16687 rootContext.clean = new Promise((r) => res = r); 16688 rootContext.scheduler(() => { 16689 if (rootContext.flags & 1 /* DetectChanges */) { 16690 rootContext.flags &= ~1 /* DetectChanges */; 16691 tickRootContext(rootContext); 16692 } 16693 if (rootContext.flags & 2 /* FlushPlayers */) { 16694 rootContext.flags &= ~2 /* FlushPlayers */; 16695 const playerHandler = rootContext.playerHandler; 16696 if (playerHandler) { 16697 playerHandler.flushPlayers(); 16698 } 16699 } 16700 rootContext.clean = _CLEAN_PROMISE; 16701 res(null); 16702 }); 16703 } 16704} 16705function tickRootContext(rootContext) { 16706 for (let i = 0; i < rootContext.components.length; i++) { 16707 const rootComponent = rootContext.components[i]; 16708 const lView = readPatchedLView(rootComponent); 16709 const tView = lView[TVIEW]; 16710 renderComponentOrTemplate(tView, lView, tView.template, rootComponent); 16711 } 16712} 16713function detectChangesInternal(tView, lView, context) { 16714 const rendererFactory = lView[RENDERER_FACTORY]; 16715 if (rendererFactory.begin) 16716 rendererFactory.begin(); 16717 try { 16718 refreshView(tView, lView, tView.template, context); 16719 } 16720 catch (error) { 16721 handleError(lView, error); 16722 throw error; 16723 } 16724 finally { 16725 if (rendererFactory.end) 16726 rendererFactory.end(); 16727 } 16728} 16729/** 16730 * Synchronously perform change detection on a root view and its components. 16731 * 16732 * @param lView The view which the change detection should be performed on. 16733 */ 16734function detectChangesInRootView(lView) { 16735 tickRootContext(lView[CONTEXT]); 16736} 16737function checkNoChangesInternal(tView, view, context) { 16738 setCheckNoChangesMode(true); 16739 try { 16740 detectChangesInternal(tView, view, context); 16741 } 16742 finally { 16743 setCheckNoChangesMode(false); 16744 } 16745} 16746/** 16747 * Checks the change detector on a root view and its components, and throws if any changes are 16748 * detected. 16749 * 16750 * This is used in development mode to verify that running change detection doesn't 16751 * introduce other changes. 16752 * 16753 * @param lView The view which the change detection should be checked on. 16754 */ 16755function checkNoChangesInRootView(lView) { 16756 setCheckNoChangesMode(true); 16757 try { 16758 detectChangesInRootView(lView); 16759 } 16760 finally { 16761 setCheckNoChangesMode(false); 16762 } 16763} 16764function executeViewQueryFn(flags, viewQueryFn, component) { 16765 ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.'); 16766 setCurrentQueryIndex(0); 16767 viewQueryFn(flags, component); 16768} 16769/////////////////////////////// 16770//// Bindings & interpolations 16771/////////////////////////////// 16772/** 16773 * Stores meta-data for a property binding to be used by TestBed's `DebugElement.properties`. 16774 * 16775 * In order to support TestBed's `DebugElement.properties` we need to save, for each binding: 16776 * - a bound property name; 16777 * - a static parts of interpolated strings; 16778 * 16779 * A given property metadata is saved at the binding's index in the `TView.data` (in other words, a 16780 * property binding metadata will be stored in `TView.data` at the same index as a bound value in 16781 * `LView`). Metadata are represented as `INTERPOLATION_DELIMITER`-delimited string with the 16782 * following format: 16783 * - `propertyName` for bound properties; 16784 * - `propertyName�prefix�interpolation_static_part1�..interpolation_static_partN�suffix` for 16785 * interpolated properties. 16786 * 16787 * @param tData `TData` where meta-data will be saved; 16788 * @param tNode `TNode` that is a target of the binding; 16789 * @param propertyName bound property name; 16790 * @param bindingIndex binding index in `LView` 16791 * @param interpolationParts static interpolation parts (for property interpolations) 16792 */ 16793function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) { 16794 // Binding meta-data are stored only the first time a given property instruction is processed. 16795 // Since we don't have a concept of the "first update pass" we need to check for presence of the 16796 // binding meta-data to decide if one should be stored (or if was stored already). 16797 if (tData[bindingIndex] === null) { 16798 if (tNode.inputs == null || !tNode.inputs[propertyName]) { 16799 const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []); 16800 propBindingIdxs.push(bindingIndex); 16801 let bindingMetadata = propertyName; 16802 if (interpolationParts.length > 0) { 16803 bindingMetadata += 16804 INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER); 16805 } 16806 tData[bindingIndex] = bindingMetadata; 16807 } 16808 } 16809} 16810const CLEAN_PROMISE = _CLEAN_PROMISE; 16811function getLCleanup(view) { 16812 // top level variables should not be exported for performance reasons (PERF_NOTES.md) 16813 return view[CLEANUP] || (view[CLEANUP] = ngDevMode ? new LCleanup() : []); 16814} 16815function getTViewCleanup(tView) { 16816 return tView.cleanup || (tView.cleanup = ngDevMode ? new TCleanup() : []); 16817} 16818/** 16819 * There are cases where the sub component's renderer needs to be included 16820 * instead of the current renderer (see the componentSyntheticHost* instructions). 16821 */ 16822function loadComponentRenderer(currentDef, tNode, lView) { 16823 // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root 16824 // component (see packages/core/src/render3/component.ts). This is not consistent with the process 16825 // of creating inner components, when current directive index is available in the state. In order 16826 // to avoid relying on current def being `null` (thus special-casing root component creation), the 16827 // process of creating root component should be unified with the process of creating inner 16828 // components. 16829 if (currentDef === null || isComponentDef(currentDef)) { 16830 lView = unwrapLView(lView[tNode.index]); 16831 } 16832 return lView[RENDERER]; 16833} 16834/** Handles an error thrown in an LView. */ 16835function handleError(lView, error) { 16836 const injector = lView[INJECTOR$1]; 16837 const errorHandler = injector ? injector.get(ErrorHandler, null) : null; 16838 errorHandler && errorHandler.handleError(error); 16839} 16840/** 16841 * Set the inputs of directives at the current node to corresponding value. 16842 * 16843 * @param tView The current TView 16844 * @param lView the `LView` which contains the directives. 16845 * @param inputs mapping between the public "input" name and privately-known, 16846 * possibly minified, property names to write to. 16847 * @param value Value to set. 16848 */ 16849function setInputsForProperty(tView, lView, inputs, publicName, value) { 16850 for (let i = 0; i < inputs.length;) { 16851 const index = inputs[i++]; 16852 const privateName = inputs[i++]; 16853 const instance = lView[index]; 16854 ngDevMode && assertIndexInRange(lView, index); 16855 const def = tView.data[index]; 16856 if (def.setInput !== null) { 16857 def.setInput(instance, value, publicName, privateName); 16858 } 16859 else { 16860 instance[privateName] = value; 16861 } 16862 } 16863} 16864/** 16865 * Updates a text binding at a given index in a given LView. 16866 */ 16867function textBindingInternal(lView, index, value) { 16868 ngDevMode && assertNotSame(value, NO_CHANGE, 'value should not be NO_CHANGE'); 16869 ngDevMode && assertIndexInRange(lView, index + HEADER_OFFSET); 16870 const element = getNativeByIndex(index, lView); 16871 ngDevMode && assertDefined(element, 'native element should exist'); 16872 ngDevMode && ngDevMode.rendererSetText++; 16873 const renderer = lView[RENDERER]; 16874 isProceduralRenderer(renderer) ? renderer.setValue(element, value) : element.textContent = value; 16875} 16876 16877/** 16878 * @license 16879 * Copyright Google LLC All Rights Reserved. 16880 * 16881 * Use of this source code is governed by an MIT-style license that can be 16882 * found in the LICENSE file at https://angular.io/license 16883 */ 16884const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$2 + unusedValueExportToPlacateAjd; 16885function getLContainer(tNode, embeddedView) { 16886 ngDevMode && assertLView(embeddedView); 16887 const container = embeddedView[PARENT]; 16888 if (tNode.index === -1) { 16889 // This is a dynamically created view inside a dynamic container. 16890 // The parent isn't an LContainer if the embedded view hasn't been attached yet. 16891 return isLContainer(container) ? container : null; 16892 } 16893 else { 16894 ngDevMode && assertLContainer(container); 16895 // This is a inline view node (e.g. embeddedViewStart) 16896 return container; 16897 } 16898} 16899/** 16900 * Retrieves render parent for a given view. 16901 * Might be null if a view is not yet attached to any container. 16902 */ 16903function getContainerRenderParent(tViewNode, view) { 16904 const container = getLContainer(tViewNode, view); 16905 return container ? nativeParentNode(view[RENDERER], container[NATIVE]) : null; 16906} 16907/** 16908 * NOTE: for performance reasons, the possible actions are inlined within the function instead of 16909 * being passed as an argument. 16910 */ 16911function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) { 16912 // If this slot was allocated for a text node dynamically created by i18n, the text node itself 16913 // won't be created until i18nApply() in the update block, so this node should be skipped. 16914 // For more info, see "ICU expressions should work inside an ngTemplateOutlet inside an ngFor" 16915 // in `i18n_spec.ts`. 16916 if (lNodeToHandle != null) { 16917 let lContainer; 16918 let isComponent = false; 16919 // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is 16920 // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if 16921 // it has LContainer so that we can process all of those cases appropriately. 16922 if (isLContainer(lNodeToHandle)) { 16923 lContainer = lNodeToHandle; 16924 } 16925 else if (isLView(lNodeToHandle)) { 16926 isComponent = true; 16927 ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView'); 16928 lNodeToHandle = lNodeToHandle[HOST]; 16929 } 16930 const rNode = unwrapRNode(lNodeToHandle); 16931 ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode); 16932 if (action === 0 /* Create */ && parent !== null) { 16933 if (beforeNode == null) { 16934 nativeAppendChild(renderer, parent, rNode); 16935 } 16936 else { 16937 nativeInsertBefore(renderer, parent, rNode, beforeNode || null); 16938 } 16939 } 16940 else if (action === 1 /* Insert */ && parent !== null) { 16941 nativeInsertBefore(renderer, parent, rNode, beforeNode || null); 16942 } 16943 else if (action === 2 /* Detach */) { 16944 nativeRemoveNode(renderer, rNode, isComponent); 16945 } 16946 else if (action === 3 /* Destroy */) { 16947 ngDevMode && ngDevMode.rendererDestroyNode++; 16948 renderer.destroyNode(rNode); 16949 } 16950 if (lContainer != null) { 16951 applyContainer(renderer, action, lContainer, parent, beforeNode); 16952 } 16953 } 16954} 16955function createTextNode(value, renderer) { 16956 ngDevMode && ngDevMode.rendererCreateTextNode++; 16957 ngDevMode && ngDevMode.rendererSetText++; 16958 return isProceduralRenderer(renderer) ? renderer.createText(value) : 16959 renderer.createTextNode(value); 16960} 16961function addRemoveViewFromContainer(tView, lView, insertMode, beforeNode) { 16962 const renderParent = getContainerRenderParent(tView.node, lView); 16963 ngDevMode && assertNodeType(tView.node, 2 /* View */); 16964 if (renderParent) { 16965 const renderer = lView[RENDERER]; 16966 const action = insertMode ? 1 /* Insert */ : 2 /* Detach */; 16967 applyView(tView, lView, renderer, action, renderParent, beforeNode); 16968 } 16969} 16970/** 16971 * Detach a `LView` from the DOM by detaching its nodes. 16972 * 16973 * @param tView The `TView' of the `LView` to be detached 16974 * @param lView the `LView` to be detached. 16975 */ 16976function renderDetachView(tView, lView) { 16977 applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null); 16978} 16979/** 16980 * Traverses down and up the tree of views and containers to remove listeners and 16981 * call onDestroy callbacks. 16982 * 16983 * Notes: 16984 * - Because it's used for onDestroy calls, it needs to be bottom-up. 16985 * - Must process containers instead of their views to avoid splicing 16986 * when views are destroyed and re-added. 16987 * - Using a while loop because it's faster than recursion 16988 * - Destroy only called on movement to sibling or movement to parent (laterally or up) 16989 * 16990 * @param rootView The view to destroy 16991 */ 16992function destroyViewTree(rootView) { 16993 // If the view has no children, we can clean it up and return early. 16994 let lViewOrLContainer = rootView[CHILD_HEAD]; 16995 if (!lViewOrLContainer) { 16996 return cleanUpView(rootView[TVIEW], rootView); 16997 } 16998 while (lViewOrLContainer) { 16999 let next = null; 17000 if (isLView(lViewOrLContainer)) { 17001 // If LView, traverse down to child. 17002 next = lViewOrLContainer[CHILD_HEAD]; 17003 } 17004 else { 17005 ngDevMode && assertLContainer(lViewOrLContainer); 17006 // If container, traverse down to its first LView. 17007 const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET]; 17008 if (firstView) 17009 next = firstView; 17010 } 17011 if (!next) { 17012 // Only clean up view when moving to the side or up, as destroy hooks 17013 // should be called in order from the bottom up. 17014 while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) { 17015 isLView(lViewOrLContainer) && cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer); 17016 lViewOrLContainer = getParentState(lViewOrLContainer, rootView); 17017 } 17018 if (lViewOrLContainer === null) 17019 lViewOrLContainer = rootView; 17020 isLView(lViewOrLContainer) && cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer); 17021 next = lViewOrLContainer && lViewOrLContainer[NEXT]; 17022 } 17023 lViewOrLContainer = next; 17024 } 17025} 17026/** 17027 * Inserts a view into a container. 17028 * 17029 * This adds the view to the container's array of active views in the correct 17030 * position. It also adds the view's elements to the DOM if the container isn't a 17031 * root node of another view (in that case, the view's elements will be added when 17032 * the container's parent view is added later). 17033 * 17034 * @param tView The `TView' of the `LView` to insert 17035 * @param lView The view to insert 17036 * @param lContainer The container into which the view should be inserted 17037 * @param index Which index in the container to insert the child view into 17038 */ 17039function insertView(tView, lView, lContainer, index) { 17040 ngDevMode && assertLView(lView); 17041 ngDevMode && assertLContainer(lContainer); 17042 const indexInContainer = CONTAINER_HEADER_OFFSET + index; 17043 const containerLength = lContainer.length; 17044 if (index > 0) { 17045 // This is a new view, we need to add it to the children. 17046 lContainer[indexInContainer - 1][NEXT] = lView; 17047 } 17048 if (index < containerLength - CONTAINER_HEADER_OFFSET) { 17049 lView[NEXT] = lContainer[indexInContainer]; 17050 addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView); 17051 } 17052 else { 17053 lContainer.push(lView); 17054 lView[NEXT] = null; 17055 } 17056 lView[PARENT] = lContainer; 17057 // track views where declaration and insertion points are different 17058 const declarationLContainer = lView[DECLARATION_LCONTAINER]; 17059 if (declarationLContainer !== null && lContainer !== declarationLContainer) { 17060 trackMovedView(declarationLContainer, lView); 17061 } 17062 // notify query that a new view has been added 17063 const lQueries = lView[QUERIES]; 17064 if (lQueries !== null) { 17065 lQueries.insertView(tView); 17066 } 17067 // Sets the attached flag 17068 lView[FLAGS] |= 128 /* Attached */; 17069} 17070/** 17071 * Track views created from the declaration container (TemplateRef) and inserted into a 17072 * different LContainer. 17073 */ 17074function trackMovedView(declarationContainer, lView) { 17075 ngDevMode && assertDefined(lView, 'LView required'); 17076 ngDevMode && assertLContainer(declarationContainer); 17077 const movedViews = declarationContainer[MOVED_VIEWS]; 17078 const insertedLContainer = lView[PARENT]; 17079 ngDevMode && assertLContainer(insertedLContainer); 17080 const insertedComponentLView = insertedLContainer[PARENT][DECLARATION_COMPONENT_VIEW]; 17081 ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView'); 17082 const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW]; 17083 ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView'); 17084 if (declaredComponentLView !== insertedComponentLView) { 17085 // At this point the declaration-component is not same as insertion-component; this means that 17086 // this is a transplanted view. Mark the declared lView as having transplanted views so that 17087 // those views can participate in CD. 17088 declarationContainer[HAS_TRANSPLANTED_VIEWS] = true; 17089 } 17090 if (movedViews === null) { 17091 declarationContainer[MOVED_VIEWS] = [lView]; 17092 } 17093 else { 17094 movedViews.push(lView); 17095 } 17096} 17097function detachMovedView(declarationContainer, lView) { 17098 ngDevMode && assertLContainer(declarationContainer); 17099 ngDevMode && 17100 assertDefined(declarationContainer[MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection'); 17101 const movedViews = declarationContainer[MOVED_VIEWS]; 17102 const declarationViewIndex = movedViews.indexOf(lView); 17103 const insertionLContainer = lView[PARENT]; 17104 ngDevMode && assertLContainer(insertionLContainer); 17105 // If the view was marked for refresh but then detached before it was checked (where the flag 17106 // would be cleared and the counter decremented), we need to decrement the view counter here 17107 // instead. 17108 if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) { 17109 updateTransplantedViewCount(insertionLContainer, -1); 17110 } 17111 movedViews.splice(declarationViewIndex, 1); 17112} 17113/** 17114 * Detaches a view from a container. 17115 * 17116 * This method removes the view from the container's array of active views. It also 17117 * removes the view's elements from the DOM. 17118 * 17119 * @param lContainer The container from which to detach a view 17120 * @param removeIndex The index of the view to detach 17121 * @returns Detached LView instance. 17122 */ 17123function detachView(lContainer, removeIndex) { 17124 if (lContainer.length <= CONTAINER_HEADER_OFFSET) 17125 return; 17126 const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex; 17127 const viewToDetach = lContainer[indexInContainer]; 17128 if (viewToDetach) { 17129 const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER]; 17130 if (declarationLContainer !== null && declarationLContainer !== lContainer) { 17131 detachMovedView(declarationLContainer, viewToDetach); 17132 } 17133 if (removeIndex > 0) { 17134 lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT]; 17135 } 17136 const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex); 17137 addRemoveViewFromContainer(viewToDetach[TVIEW], viewToDetach, false, null); 17138 // notify query that a view has been removed 17139 const lQueries = removedLView[QUERIES]; 17140 if (lQueries !== null) { 17141 lQueries.detachView(removedLView[TVIEW]); 17142 } 17143 viewToDetach[PARENT] = null; 17144 viewToDetach[NEXT] = null; 17145 // Unsets the attached flag 17146 viewToDetach[FLAGS] &= ~128 /* Attached */; 17147 } 17148 return viewToDetach; 17149} 17150/** 17151 * A standalone function which destroys an LView, 17152 * conducting clean up (e.g. removing listeners, calling onDestroys). 17153 * 17154 * @param tView The `TView' of the `LView` to be destroyed 17155 * @param lView The view to be destroyed. 17156 */ 17157function destroyLView(tView, lView) { 17158 if (!(lView[FLAGS] & 256 /* Destroyed */)) { 17159 const renderer = lView[RENDERER]; 17160 if (isProceduralRenderer(renderer) && renderer.destroyNode) { 17161 applyView(tView, lView, renderer, 3 /* Destroy */, null, null); 17162 } 17163 destroyViewTree(lView); 17164 } 17165} 17166/** 17167 * Determines which LViewOrLContainer to jump to when traversing back up the 17168 * tree in destroyViewTree. 17169 * 17170 * Normally, the view's parent LView should be checked, but in the case of 17171 * embedded views, the container (which is the view node's parent, but not the 17172 * LView's parent) needs to be checked for a possible next property. 17173 * 17174 * @param lViewOrLContainer The LViewOrLContainer for which we need a parent state 17175 * @param rootView The rootView, so we don't propagate too far up the view tree 17176 * @returns The correct parent LViewOrLContainer 17177 */ 17178function getParentState(lViewOrLContainer, rootView) { 17179 let tNode; 17180 if (isLView(lViewOrLContainer) && (tNode = lViewOrLContainer[T_HOST]) && 17181 tNode.type === 2 /* View */) { 17182 // if it's an embedded view, the state needs to go up to the container, in case the 17183 // container has a next 17184 return getLContainer(tNode, lViewOrLContainer); 17185 } 17186 else { 17187 // otherwise, use parent view for containers or component views 17188 return lViewOrLContainer[PARENT] === rootView ? null : lViewOrLContainer[PARENT]; 17189 } 17190} 17191/** 17192 * Calls onDestroys hooks for all directives and pipes in a given view and then removes all 17193 * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks 17194 * can be propagated to @Output listeners. 17195 * 17196 * @param tView `TView` for the `LView` to clean up. 17197 * @param lView The LView to clean up 17198 */ 17199function cleanUpView(tView, lView) { 17200 if (!(lView[FLAGS] & 256 /* Destroyed */)) { 17201 // Usually the Attached flag is removed when the view is detached from its parent, however 17202 // if it's a root view, the flag won't be unset hence why we're also removing on destroy. 17203 lView[FLAGS] &= ~128 /* Attached */; 17204 // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook 17205 // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If 17206 // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop. 17207 // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is 17208 // really more of an "afterDestroy" hook if you think about it. 17209 lView[FLAGS] |= 256 /* Destroyed */; 17210 executeOnDestroys(tView, lView); 17211 removeListeners(tView, lView); 17212 const hostTNode = lView[T_HOST]; 17213 // For component views only, the local renderer is destroyed as clean up time. 17214 if (hostTNode && hostTNode.type === 3 /* Element */ && 17215 isProceduralRenderer(lView[RENDERER])) { 17216 ngDevMode && ngDevMode.rendererDestroy++; 17217 lView[RENDERER].destroy(); 17218 } 17219 const declarationContainer = lView[DECLARATION_LCONTAINER]; 17220 // we are dealing with an embedded view that is still inserted into a container 17221 if (declarationContainer !== null && isLContainer(lView[PARENT])) { 17222 // and this is a projected view 17223 if (declarationContainer !== lView[PARENT]) { 17224 detachMovedView(declarationContainer, lView); 17225 } 17226 // For embedded views still attached to a container: remove query result from this view. 17227 const lQueries = lView[QUERIES]; 17228 if (lQueries !== null) { 17229 lQueries.detachView(tView); 17230 } 17231 } 17232 } 17233} 17234/** Removes listeners and unsubscribes from output subscriptions */ 17235function removeListeners(tView, lView) { 17236 const tCleanup = tView.cleanup; 17237 if (tCleanup !== null) { 17238 const lCleanup = lView[CLEANUP]; 17239 for (let i = 0; i < tCleanup.length - 1; i += 2) { 17240 if (typeof tCleanup[i] === 'string') { 17241 // This is a native DOM listener 17242 const idxOrTargetGetter = tCleanup[i + 1]; 17243 const target = typeof idxOrTargetGetter === 'function' ? 17244 idxOrTargetGetter(lView) : 17245 unwrapRNode(lView[idxOrTargetGetter]); 17246 const listener = lCleanup[tCleanup[i + 2]]; 17247 const useCaptureOrSubIdx = tCleanup[i + 3]; 17248 if (typeof useCaptureOrSubIdx === 'boolean') { 17249 // native DOM listener registered with Renderer3 17250 target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx); 17251 } 17252 else { 17253 if (useCaptureOrSubIdx >= 0) { 17254 // unregister 17255 lCleanup[useCaptureOrSubIdx](); 17256 } 17257 else { 17258 // Subscription 17259 lCleanup[-useCaptureOrSubIdx].unsubscribe(); 17260 } 17261 } 17262 i += 2; 17263 } 17264 else { 17265 // This is a cleanup function that is grouped with the index of its context 17266 const context = lCleanup[tCleanup[i + 1]]; 17267 tCleanup[i].call(context); 17268 } 17269 } 17270 lView[CLEANUP] = null; 17271 } 17272} 17273/** Calls onDestroy hooks for this view */ 17274function executeOnDestroys(tView, lView) { 17275 let destroyHooks; 17276 if (tView != null && (destroyHooks = tView.destroyHooks) != null) { 17277 for (let i = 0; i < destroyHooks.length; i += 2) { 17278 const context = lView[destroyHooks[i]]; 17279 // Only call the destroy hook if the context has been requested. 17280 if (!(context instanceof NodeInjectorFactory)) { 17281 const toCall = destroyHooks[i + 1]; 17282 if (Array.isArray(toCall)) { 17283 for (let j = 0; j < toCall.length; j += 2) { 17284 toCall[j + 1].call(context[toCall[j]]); 17285 } 17286 } 17287 else { 17288 toCall.call(context); 17289 } 17290 } 17291 } 17292 } 17293} 17294/** 17295 * Returns a native element if a node can be inserted into the given parent. 17296 * 17297 * There are two reasons why we may not be able to insert a element immediately. 17298 * - Projection: When creating a child content element of a component, we have to skip the 17299 * insertion because the content of a component will be projected. 17300 * `<component><content>delayed due to projection</content></component>` 17301 * - Parent container is disconnected: This can happen when we are inserting a view into 17302 * parent container, which itself is disconnected. For example the parent container is part 17303 * of a View which has not be inserted or is made for projection but has not been inserted 17304 * into destination. 17305 */ 17306function getRenderParent(tView, tNode, currentView) { 17307 // Skip over element and ICU containers as those are represented by a comment node and 17308 // can't be used as a render parent. 17309 let parentTNode = tNode.parent; 17310 while (parentTNode != null && 17311 (parentTNode.type === 4 /* ElementContainer */ || 17312 parentTNode.type === 5 /* IcuContainer */)) { 17313 tNode = parentTNode; 17314 parentTNode = tNode.parent; 17315 } 17316 // If the parent tNode is null, then we are inserting across views: either into an embedded view 17317 // or a component view. 17318 if (parentTNode == null) { 17319 const hostTNode = currentView[T_HOST]; 17320 if (hostTNode.type === 2 /* View */) { 17321 // We are inserting a root element of an embedded view We might delay insertion of children 17322 // for a given view if it is disconnected. This might happen for 2 main reasons: 17323 // - view is not inserted into any container(view was created but not inserted yet) 17324 // - view is inserted into a container but the container itself is not inserted into the DOM 17325 // (container might be part of projection or child of a view that is not inserted yet). 17326 // In other words we can insert children of a given view if this view was inserted into a 17327 // container and the container itself has its render parent determined. 17328 return getContainerRenderParent(hostTNode, currentView); 17329 } 17330 else { 17331 // We are inserting a root element of the component view into the component host element and 17332 // it should always be eager. 17333 ngDevMode && assertNodeOfPossibleTypes(hostTNode, [3 /* Element */]); 17334 return currentView[HOST]; 17335 } 17336 } 17337 else { 17338 const isIcuCase = tNode && tNode.type === 5 /* IcuContainer */; 17339 // If the parent of this node is an ICU container, then it is represented by comment node and we 17340 // need to use it as an anchor. If it is projected then it's direct parent node is the renderer. 17341 if (isIcuCase && tNode.flags & 4 /* isProjected */) { 17342 return getNativeByTNode(tNode, currentView).parentNode; 17343 } 17344 ngDevMode && assertNodeType(parentTNode, 3 /* Element */); 17345 if (parentTNode.flags & 2 /* isComponentHost */) { 17346 const tData = tView.data; 17347 const tNode = tData[parentTNode.index]; 17348 const encapsulation = tData[tNode.directiveStart].encapsulation; 17349 // We've got a parent which is an element in the current view. We just need to verify if the 17350 // parent element is not a component. Component's content nodes are not inserted immediately 17351 // because they will be projected, and so doing insert at this point would be wasteful. 17352 // Since the projection would then move it to its final destination. Note that we can't 17353 // make this assumption when using the Shadow DOM, because the native projection placeholders 17354 // (<content> or <slot>) have to be in place as elements are being inserted. 17355 if (encapsulation !== ViewEncapsulation$1.ShadowDom && 17356 encapsulation !== ViewEncapsulation$1.Native) { 17357 return null; 17358 } 17359 } 17360 return getNativeByTNode(parentTNode, currentView); 17361 } 17362} 17363/** 17364 * Inserts a native node before another native node for a given parent using {@link Renderer3}. 17365 * This is a utility function that can be used when native nodes were determined - it abstracts an 17366 * actual renderer being used. 17367 */ 17368function nativeInsertBefore(renderer, parent, child, beforeNode) { 17369 ngDevMode && ngDevMode.rendererInsertBefore++; 17370 if (isProceduralRenderer(renderer)) { 17371 renderer.insertBefore(parent, child, beforeNode); 17372 } 17373 else { 17374 parent.insertBefore(child, beforeNode, true); 17375 } 17376} 17377function nativeAppendChild(renderer, parent, child) { 17378 ngDevMode && ngDevMode.rendererAppendChild++; 17379 ngDevMode && assertDefined(parent, 'parent node must be defined'); 17380 if (isProceduralRenderer(renderer)) { 17381 renderer.appendChild(parent, child); 17382 } 17383 else { 17384 parent.appendChild(child); 17385 } 17386} 17387function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode) { 17388 if (beforeNode !== null) { 17389 nativeInsertBefore(renderer, parent, child, beforeNode); 17390 } 17391 else { 17392 nativeAppendChild(renderer, parent, child); 17393 } 17394} 17395/** Removes a node from the DOM given its native parent. */ 17396function nativeRemoveChild(renderer, parent, child, isHostElement) { 17397 if (isProceduralRenderer(renderer)) { 17398 renderer.removeChild(parent, child, isHostElement); 17399 } 17400 else { 17401 parent.removeChild(child); 17402 } 17403} 17404/** 17405 * Returns a native parent of a given native node. 17406 */ 17407function nativeParentNode(renderer, node) { 17408 return (isProceduralRenderer(renderer) ? renderer.parentNode(node) : node.parentNode); 17409} 17410/** 17411 * Returns a native sibling of a given native node. 17412 */ 17413function nativeNextSibling(renderer, node) { 17414 return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling; 17415} 17416/** 17417 * Finds a native "anchor" node for cases where we can't append a native child directly 17418 * (`appendChild`) and need to use a reference (anchor) node for the `insertBefore` operation. 17419 * @param parentTNode 17420 * @param lView 17421 */ 17422function getNativeAnchorNode(parentTNode, lView) { 17423 if (parentTNode.type === 2 /* View */) { 17424 const lContainer = getLContainer(parentTNode, lView); 17425 if (lContainer === null) 17426 return null; 17427 const index = lContainer.indexOf(lView, CONTAINER_HEADER_OFFSET) - CONTAINER_HEADER_OFFSET; 17428 return getBeforeNodeForView(index, lContainer); 17429 } 17430 else if (parentTNode.type === 4 /* ElementContainer */ || 17431 parentTNode.type === 5 /* IcuContainer */) { 17432 return getNativeByTNode(parentTNode, lView); 17433 } 17434 return null; 17435} 17436/** 17437 * Appends the `child` native node (or a collection of nodes) to the `parent`. 17438 * 17439 * The element insertion might be delayed {@link canInsertNativeNode}. 17440 * 17441 * @param tView The `TView' to be appended 17442 * @param lView The current LView 17443 * @param childEl The native child (or children) that should be appended 17444 * @param childTNode The TNode of the child element 17445 * @returns Whether or not the child was appended 17446 */ 17447function appendChild(tView, lView, childEl, childTNode) { 17448 const renderParent = getRenderParent(tView, childTNode, lView); 17449 if (renderParent != null) { 17450 const renderer = lView[RENDERER]; 17451 const parentTNode = childTNode.parent || lView[T_HOST]; 17452 const anchorNode = getNativeAnchorNode(parentTNode, lView); 17453 if (Array.isArray(childEl)) { 17454 for (let i = 0; i < childEl.length; i++) { 17455 nativeAppendOrInsertBefore(renderer, renderParent, childEl[i], anchorNode); 17456 } 17457 } 17458 else { 17459 nativeAppendOrInsertBefore(renderer, renderParent, childEl, anchorNode); 17460 } 17461 } 17462} 17463/** 17464 * Returns the first native node for a given LView, starting from the provided TNode. 17465 * 17466 * Native nodes are returned in the order in which those appear in the native tree (DOM). 17467 */ 17468function getFirstNativeNode(lView, tNode) { 17469 if (tNode !== null) { 17470 ngDevMode && assertNodeOfPossibleTypes(tNode, [ 17471 3 /* Element */, 0 /* Container */, 4 /* ElementContainer */, 5 /* IcuContainer */, 17472 1 /* Projection */ 17473 ]); 17474 const tNodeType = tNode.type; 17475 if (tNodeType === 3 /* Element */) { 17476 return getNativeByTNode(tNode, lView); 17477 } 17478 else if (tNodeType === 0 /* Container */) { 17479 return getBeforeNodeForView(-1, lView[tNode.index]); 17480 } 17481 else if (tNodeType === 4 /* ElementContainer */ || tNodeType === 5 /* IcuContainer */) { 17482 const elIcuContainerChild = tNode.child; 17483 if (elIcuContainerChild !== null) { 17484 return getFirstNativeNode(lView, elIcuContainerChild); 17485 } 17486 else { 17487 const rNodeOrLContainer = lView[tNode.index]; 17488 if (isLContainer(rNodeOrLContainer)) { 17489 return getBeforeNodeForView(-1, rNodeOrLContainer); 17490 } 17491 else { 17492 return unwrapRNode(rNodeOrLContainer); 17493 } 17494 } 17495 } 17496 else { 17497 const componentView = lView[DECLARATION_COMPONENT_VIEW]; 17498 const componentHost = componentView[T_HOST]; 17499 const parentView = getLViewParent(componentView); 17500 const firstProjectedTNode = componentHost.projection[tNode.projection]; 17501 if (firstProjectedTNode != null) { 17502 return getFirstNativeNode(parentView, firstProjectedTNode); 17503 } 17504 else { 17505 return getFirstNativeNode(lView, tNode.next); 17506 } 17507 } 17508 } 17509 return null; 17510} 17511function getBeforeNodeForView(viewIndexInContainer, lContainer) { 17512 const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1; 17513 if (nextViewIndex < lContainer.length) { 17514 const lView = lContainer[nextViewIndex]; 17515 const firstTNodeOfView = lView[TVIEW].firstChild; 17516 if (firstTNodeOfView !== null) { 17517 return getFirstNativeNode(lView, firstTNodeOfView); 17518 } 17519 } 17520 return lContainer[NATIVE]; 17521} 17522/** 17523 * Removes a native node itself using a given renderer. To remove the node we are looking up its 17524 * parent from the native tree as not all platforms / browsers support the equivalent of 17525 * node.remove(). 17526 * 17527 * @param renderer A renderer to be used 17528 * @param rNode The native node that should be removed 17529 * @param isHostElement A flag indicating if a node to be removed is a host of a component. 17530 */ 17531function nativeRemoveNode(renderer, rNode, isHostElement) { 17532 const nativeParent = nativeParentNode(renderer, rNode); 17533 if (nativeParent) { 17534 nativeRemoveChild(renderer, nativeParent, rNode, isHostElement); 17535 } 17536} 17537/** 17538 * Performs the operation of `action` on the node. Typically this involves inserting or removing 17539 * nodes on the LView or projection boundary. 17540 */ 17541function applyNodes(renderer, action, tNode, lView, renderParent, beforeNode, isProjection) { 17542 while (tNode != null) { 17543 ngDevMode && assertTNodeForLView(tNode, lView); 17544 ngDevMode && assertNodeOfPossibleTypes(tNode, [ 17545 0 /* Container */, 3 /* Element */, 4 /* ElementContainer */, 1 /* Projection */, 17546 5 /* IcuContainer */ 17547 ]); 17548 const rawSlotValue = lView[tNode.index]; 17549 const tNodeType = tNode.type; 17550 if (isProjection) { 17551 if (action === 0 /* Create */) { 17552 rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView); 17553 tNode.flags |= 4 /* isProjected */; 17554 } 17555 } 17556 if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) { 17557 if (tNodeType === 4 /* ElementContainer */ || tNodeType === 5 /* IcuContainer */) { 17558 applyNodes(renderer, action, tNode.child, lView, renderParent, beforeNode, false); 17559 applyToElementOrContainer(action, renderer, renderParent, rawSlotValue, beforeNode); 17560 } 17561 else if (tNodeType === 1 /* Projection */) { 17562 applyProjectionRecursive(renderer, action, lView, tNode, renderParent, beforeNode); 17563 } 17564 else { 17565 ngDevMode && assertNodeOfPossibleTypes(tNode, [3 /* Element */, 0 /* Container */]); 17566 applyToElementOrContainer(action, renderer, renderParent, rawSlotValue, beforeNode); 17567 } 17568 } 17569 tNode = isProjection ? tNode.projectionNext : tNode.next; 17570 } 17571} 17572/** 17573 * `applyView` performs operation on the view as specified in `action` (insert, detach, destroy) 17574 * 17575 * Inserting a view without projection or containers at top level is simple. Just iterate over the 17576 * root nodes of the View, and for each node perform the `action`. 17577 * 17578 * Things get more complicated with containers and projections. That is because coming across: 17579 * - Container: implies that we have to insert/remove/destroy the views of that container as well 17580 * which in turn can have their own Containers at the View roots. 17581 * - Projection: implies that we have to insert/remove/destroy the nodes of the projection. The 17582 * complication is that the nodes we are projecting can themselves have Containers 17583 * or other Projections. 17584 * 17585 * As you can see this is a very recursive problem. Yes recursion is not most efficient but the 17586 * code is complicated enough that trying to implemented with recursion becomes unmaintainable. 17587 * 17588 * @param tView The `TView' which needs to be inserted, detached, destroyed 17589 * @param lView The LView which needs to be inserted, detached, destroyed. 17590 * @param renderer Renderer to use 17591 * @param action action to perform (insert, detach, destroy) 17592 * @param renderParent parent DOM element for insertion/removal. 17593 * @param beforeNode Before which node the insertions should happen. 17594 */ 17595function applyView(tView, lView, renderer, action, renderParent, beforeNode) { 17596 ngDevMode && assertNodeType(tView.node, 2 /* View */); 17597 const viewRootTNode = tView.node.child; 17598 applyNodes(renderer, action, viewRootTNode, lView, renderParent, beforeNode, false); 17599} 17600/** 17601 * `applyProjection` performs operation on the projection. 17602 * 17603 * Inserting a projection requires us to locate the projected nodes from the parent component. The 17604 * complication is that those nodes themselves could be re-projected from their parent component. 17605 * 17606 * @param tView The `TView` of `LView` which needs to be inserted, detached, destroyed 17607 * @param lView The `LView` which needs to be inserted, detached, destroyed. 17608 * @param tProjectionNode node to project 17609 */ 17610function applyProjection(tView, lView, tProjectionNode) { 17611 const renderer = lView[RENDERER]; 17612 const renderParent = getRenderParent(tView, tProjectionNode, lView); 17613 const parentTNode = tProjectionNode.parent || lView[T_HOST]; 17614 let beforeNode = getNativeAnchorNode(parentTNode, lView); 17615 applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, renderParent, beforeNode); 17616} 17617/** 17618 * `applyProjectionRecursive` performs operation on the projection specified by `action` (insert, 17619 * detach, destroy) 17620 * 17621 * Inserting a projection requires us to locate the projected nodes from the parent component. The 17622 * complication is that those nodes themselves could be re-projected from their parent component. 17623 * 17624 * @param renderer Render to use 17625 * @param action action to perform (insert, detach, destroy) 17626 * @param lView The LView which needs to be inserted, detached, destroyed. 17627 * @param tProjectionNode node to project 17628 * @param renderParent parent DOM element for insertion/removal. 17629 * @param beforeNode Before which node the insertions should happen. 17630 */ 17631function applyProjectionRecursive(renderer, action, lView, tProjectionNode, renderParent, beforeNode) { 17632 const componentLView = lView[DECLARATION_COMPONENT_VIEW]; 17633 const componentNode = componentLView[T_HOST]; 17634 ngDevMode && 17635 assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index'); 17636 const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection]; 17637 if (Array.isArray(nodeToProjectOrRNodes)) { 17638 // This should not exist, it is a bit of a hack. When we bootstrap a top level node and we 17639 // need to support passing projectable nodes, so we cheat and put them in the TNode 17640 // of the Host TView. (Yes we put instance info at the T Level). We can get away with it 17641 // because we know that that TView is not shared and therefore it will not be a problem. 17642 // This should be refactored and cleaned up. 17643 for (let i = 0; i < nodeToProjectOrRNodes.length; i++) { 17644 const rNode = nodeToProjectOrRNodes[i]; 17645 applyToElementOrContainer(action, renderer, renderParent, rNode, beforeNode); 17646 } 17647 } 17648 else { 17649 let nodeToProject = nodeToProjectOrRNodes; 17650 const projectedComponentLView = componentLView[PARENT]; 17651 applyNodes(renderer, action, nodeToProject, projectedComponentLView, renderParent, beforeNode, true); 17652 } 17653} 17654/** 17655 * `applyContainer` performs an operation on the container and its views as specified by 17656 * `action` (insert, detach, destroy) 17657 * 17658 * Inserting a Container is complicated by the fact that the container may have Views which 17659 * themselves have containers or projections. 17660 * 17661 * @param renderer Renderer to use 17662 * @param action action to perform (insert, detach, destroy) 17663 * @param lContainer The LContainer which needs to be inserted, detached, destroyed. 17664 * @param renderParent parent DOM element for insertion/removal. 17665 * @param beforeNode Before which node the insertions should happen. 17666 */ 17667function applyContainer(renderer, action, lContainer, renderParent, beforeNode) { 17668 ngDevMode && assertLContainer(lContainer); 17669 const anchor = lContainer[NATIVE]; // LContainer has its own before node. 17670 const native = unwrapRNode(lContainer); 17671 // An LContainer can be created dynamically on any node by injecting ViewContainerRef. 17672 // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor node 17673 // (comment in the DOM) that will be different from the LContainer's host node. In this particular 17674 // case we need to execute action on 2 nodes: 17675 // - container's host node (this is done in the executeActionOnElementOrContainer) 17676 // - container's host node (this is done here) 17677 if (anchor !== native) { 17678 // This is very strange to me (Misko). I would expect that the native is same as anchor. I don't 17679 // see a reason why they should be different, but they are. 17680 // 17681 // If they are we need to process the second anchor as well. 17682 applyToElementOrContainer(action, renderer, renderParent, anchor, beforeNode); 17683 } 17684 for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) { 17685 const lView = lContainer[i]; 17686 applyView(lView[TVIEW], lView, renderer, action, renderParent, anchor); 17687 } 17688} 17689/** 17690 * Writes class/style to element. 17691 * 17692 * @param renderer Renderer to use. 17693 * @param isClassBased `true` if it should be written to `class` (`false` to write to `style`) 17694 * @param rNode The Node to write to. 17695 * @param prop Property to write to. This would be the class/style name. 17696 * @param value Value to write. If `null`/`undefined`/`false` this is considered a remove (set/add 17697 * otherwise). 17698 */ 17699function applyStyling(renderer, isClassBased, rNode, prop, value) { 17700 const isProcedural = isProceduralRenderer(renderer); 17701 if (isClassBased) { 17702 // We actually want JS true/false here because any truthy value should add the class 17703 if (!value) { 17704 ngDevMode && ngDevMode.rendererRemoveClass++; 17705 if (isProcedural) { 17706 renderer.removeClass(rNode, prop); 17707 } 17708 else { 17709 rNode.classList.remove(prop); 17710 } 17711 } 17712 else { 17713 ngDevMode && ngDevMode.rendererAddClass++; 17714 if (isProcedural) { 17715 renderer.addClass(rNode, prop); 17716 } 17717 else { 17718 ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected'); 17719 rNode.classList.add(prop); 17720 } 17721 } 17722 } 17723 else { 17724 // TODO(misko): Can't import RendererStyleFlags2.DashCase as it causes imports to be resolved in 17725 // different order which causes failures. Using direct constant as workaround for now. 17726 const flags = prop.indexOf('-') == -1 ? undefined : 2 /* RendererStyleFlags2.DashCase */; 17727 if (value == null /** || value === undefined */) { 17728 ngDevMode && ngDevMode.rendererRemoveStyle++; 17729 if (isProcedural) { 17730 renderer.removeStyle(rNode, prop, flags); 17731 } 17732 else { 17733 rNode.style.removeProperty(prop); 17734 } 17735 } 17736 else { 17737 ngDevMode && ngDevMode.rendererSetStyle++; 17738 if (isProcedural) { 17739 renderer.setStyle(rNode, prop, value, flags); 17740 } 17741 else { 17742 ngDevMode && assertDefined(rNode.style, 'HTMLElement expected'); 17743 rNode.style.setProperty(prop, value); 17744 } 17745 } 17746 } 17747} 17748/** 17749 * Write `cssText` to `RElement`. 17750 * 17751 * This function does direct write without any reconciliation. Used for writing initial values, so 17752 * that static styling values do not pull in the style parser. 17753 * 17754 * @param renderer Renderer to use 17755 * @param element The element which needs to be updated. 17756 * @param newValue The new class list to write. 17757 */ 17758function writeDirectStyle(renderer, element, newValue) { 17759 ngDevMode && assertString(newValue, '\'newValue\' should be a string'); 17760 if (isProceduralRenderer(renderer)) { 17761 renderer.setAttribute(element, 'style', newValue); 17762 } 17763 else { 17764 element.style.cssText = newValue; 17765 } 17766 ngDevMode && ngDevMode.rendererSetStyle++; 17767} 17768/** 17769 * Write `className` to `RElement`. 17770 * 17771 * This function does direct write without any reconciliation. Used for writing initial values, so 17772 * that static styling values do not pull in the style parser. 17773 * 17774 * @param renderer Renderer to use 17775 * @param element The element which needs to be updated. 17776 * @param newValue The new class list to write. 17777 */ 17778function writeDirectClass(renderer, element, newValue) { 17779 ngDevMode && assertString(newValue, '\'newValue\' should be a string'); 17780 if (isProceduralRenderer(renderer)) { 17781 if (newValue === '') { 17782 // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`. 17783 renderer.removeAttribute(element, 'class'); 17784 } 17785 else { 17786 renderer.setAttribute(element, 'class', newValue); 17787 } 17788 } 17789 else { 17790 element.className = newValue; 17791 } 17792 ngDevMode && ngDevMode.rendererSetClassName++; 17793} 17794 17795/** 17796 * @license 17797 * Copyright Google LLC All Rights Reserved. 17798 * 17799 * Use of this source code is governed by an MIT-style license that can be 17800 * found in the LICENSE file at https://angular.io/license 17801 */ 17802/** 17803 * If `startTNode.parent` exists and has an injector, returns TNode for that injector. 17804 * Otherwise, unwraps a parent injector location number to find the view offset from the current 17805 * injector, then walks up the declaration view tree until the TNode of the parent injector is 17806 * found. 17807 * 17808 * @param location The location of the parent injector, which contains the view offset 17809 * @param startView The LView instance from which to start walking up the view tree 17810 * @param startTNode The TNode instance of the starting element 17811 * @returns The TNode of the parent injector 17812 */ 17813function getParentInjectorTNode(location, startView, startTNode) { 17814 // If there is an injector on the parent TNode, retrieve the TNode for that injector. 17815 if (startTNode.parent && startTNode.parent.injectorIndex !== -1) { 17816 // view offset is 0 17817 const injectorIndex = startTNode.parent.injectorIndex; 17818 let tNode = startTNode.parent; 17819 // If tNode.injectorIndex === tNode.parent.injectorIndex, then the index belongs to a parent 17820 // injector. 17821 while (tNode.parent != null && injectorIndex == tNode.parent.injectorIndex) { 17822 tNode = tNode.parent; 17823 } 17824 return tNode; 17825 } 17826 let viewOffset = getParentInjectorViewOffset(location); 17827 // view offset is 1 17828 let parentView = startView; 17829 let parentTNode = startView[T_HOST]; 17830 // view offset is superior to 1 17831 while (viewOffset > 1) { 17832 parentView = parentView[DECLARATION_VIEW]; 17833 parentTNode = parentView[T_HOST]; 17834 viewOffset--; 17835 } 17836 return parentTNode; 17837} 17838 17839/** 17840 * @license 17841 * Copyright Google LLC All Rights Reserved. 17842 * 17843 * Use of this source code is governed by an MIT-style license that can be 17844 * found in the LICENSE file at https://angular.io/license 17845 */ 17846class ViewRef { 17847 constructor( 17848 /** 17849 * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef. 17850 * 17851 * When ViewRef is created for a dynamic component, this also represents the `LView` for the 17852 * component. 17853 * 17854 * For a "regular" ViewRef created for an embedded view, this is the `LView` for the embedded 17855 * view. 17856 * 17857 * @internal 17858 */ 17859 _lView, 17860 /** 17861 * This represents the `LView` associated with the point where `ChangeDetectorRef` was 17862 * requested. 17863 * 17864 * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view. 17865 */ 17866 _cdRefInjectingView) { 17867 this._lView = _lView; 17868 this._cdRefInjectingView = _cdRefInjectingView; 17869 this._appRef = null; 17870 this._viewContainerRef = null; 17871 } 17872 get rootNodes() { 17873 const lView = this._lView; 17874 if (lView[HOST] == null) { 17875 const hostTView = lView[T_HOST]; 17876 return collectNativeNodes(lView[TVIEW], lView, hostTView.child, []); 17877 } 17878 return []; 17879 } 17880 get context() { 17881 return this._lView[CONTEXT]; 17882 } 17883 get destroyed() { 17884 return (this._lView[FLAGS] & 256 /* Destroyed */) === 256 /* Destroyed */; 17885 } 17886 destroy() { 17887 if (this._appRef) { 17888 this._appRef.detachView(this); 17889 } 17890 else if (this._viewContainerRef) { 17891 const index = this._viewContainerRef.indexOf(this); 17892 if (index > -1) { 17893 this._viewContainerRef.detach(index); 17894 } 17895 this._viewContainerRef = null; 17896 } 17897 destroyLView(this._lView[TVIEW], this._lView); 17898 } 17899 onDestroy(callback) { 17900 storeCleanupWithContext(this._lView[TVIEW], this._lView, null, callback); 17901 } 17902 /** 17903 * Marks a view and all of its ancestors dirty. 17904 * 17905 * It also triggers change detection by calling `scheduleTick` internally, which coalesces 17906 * multiple `markForCheck` calls to into one change detection run. 17907 * 17908 * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is 17909 * checked when it needs to be re-rendered but the two normal triggers haven't marked it 17910 * dirty (i.e. inputs haven't changed and events haven't fired in the view). 17911 * 17912 * <!-- TODO: Add a link to a chapter on OnPush components --> 17913 * 17914 * @usageNotes 17915 * ### Example 17916 * 17917 * ```typescript 17918 * @Component({ 17919 * selector: 'my-app', 17920 * template: `Number of ticks: {{numberOfTicks}}` 17921 * changeDetection: ChangeDetectionStrategy.OnPush, 17922 * }) 17923 * class AppComponent { 17924 * numberOfTicks = 0; 17925 * 17926 * constructor(private ref: ChangeDetectorRef) { 17927 * setInterval(() => { 17928 * this.numberOfTicks++; 17929 * // the following is required, otherwise the view will not be updated 17930 * this.ref.markForCheck(); 17931 * }, 1000); 17932 * } 17933 * } 17934 * ``` 17935 */ 17936 markForCheck() { 17937 markViewDirty(this._cdRefInjectingView || this._lView); 17938 } 17939 /** 17940 * Detaches the view from the change detection tree. 17941 * 17942 * Detached views will not be checked during change detection runs until they are 17943 * re-attached, even if they are dirty. `detach` can be used in combination with 17944 * {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change 17945 * detection checks. 17946 * 17947 * <!-- TODO: Add a link to a chapter on detach/reattach/local digest --> 17948 * <!-- TODO: Add a live demo once ref.detectChanges is merged into master --> 17949 * 17950 * @usageNotes 17951 * ### Example 17952 * 17953 * The following example defines a component with a large list of readonly data. 17954 * Imagine the data changes constantly, many times per second. For performance reasons, 17955 * we want to check and update the list every five seconds. We can do that by detaching 17956 * the component's change detector and doing a local check every five seconds. 17957 * 17958 * ```typescript 17959 * class DataProvider { 17960 * // in a real application the returned data will be different every time 17961 * get data() { 17962 * return [1,2,3,4,5]; 17963 * } 17964 * } 17965 * 17966 * @Component({ 17967 * selector: 'giant-list', 17968 * template: ` 17969 * <li *ngFor="let d of dataProvider.data">Data {{d}}</li> 17970 * `, 17971 * }) 17972 * class GiantList { 17973 * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) { 17974 * ref.detach(); 17975 * setInterval(() => { 17976 * this.ref.detectChanges(); 17977 * }, 5000); 17978 * } 17979 * } 17980 * 17981 * @Component({ 17982 * selector: 'app', 17983 * providers: [DataProvider], 17984 * template: ` 17985 * <giant-list><giant-list> 17986 * `, 17987 * }) 17988 * class App { 17989 * } 17990 * ``` 17991 */ 17992 detach() { 17993 this._lView[FLAGS] &= ~128 /* Attached */; 17994 } 17995 /** 17996 * Re-attaches a view to the change detection tree. 17997 * 17998 * This can be used to re-attach views that were previously detached from the tree 17999 * using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default. 18000 * 18001 * <!-- TODO: Add a link to a chapter on detach/reattach/local digest --> 18002 * 18003 * @usageNotes 18004 * ### Example 18005 * 18006 * The following example creates a component displaying `live` data. The component will detach 18007 * its change detector from the main change detector tree when the component's live property 18008 * is set to false. 18009 * 18010 * ```typescript 18011 * class DataProvider { 18012 * data = 1; 18013 * 18014 * constructor() { 18015 * setInterval(() => { 18016 * this.data = this.data * 2; 18017 * }, 500); 18018 * } 18019 * } 18020 * 18021 * @Component({ 18022 * selector: 'live-data', 18023 * inputs: ['live'], 18024 * template: 'Data: {{dataProvider.data}}' 18025 * }) 18026 * class LiveData { 18027 * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {} 18028 * 18029 * set live(value) { 18030 * if (value) { 18031 * this.ref.reattach(); 18032 * } else { 18033 * this.ref.detach(); 18034 * } 18035 * } 18036 * } 18037 * 18038 * @Component({ 18039 * selector: 'my-app', 18040 * providers: [DataProvider], 18041 * template: ` 18042 * Live Update: <input type="checkbox" [(ngModel)]="live"> 18043 * <live-data [live]="live"><live-data> 18044 * `, 18045 * }) 18046 * class AppComponent { 18047 * live = true; 18048 * } 18049 * ``` 18050 */ 18051 reattach() { 18052 this._lView[FLAGS] |= 128 /* Attached */; 18053 } 18054 /** 18055 * Checks the view and its children. 18056 * 18057 * This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement 18058 * local change detection checks. 18059 * 18060 * <!-- TODO: Add a link to a chapter on detach/reattach/local digest --> 18061 * <!-- TODO: Add a live demo once ref.detectChanges is merged into master --> 18062 * 18063 * @usageNotes 18064 * ### Example 18065 * 18066 * The following example defines a component with a large list of readonly data. 18067 * Imagine, the data changes constantly, many times per second. For performance reasons, 18068 * we want to check and update the list every five seconds. 18069 * 18070 * We can do that by detaching the component's change detector and doing a local change detection 18071 * check every five seconds. 18072 * 18073 * See {@link ChangeDetectorRef#detach detach} for more information. 18074 */ 18075 detectChanges() { 18076 detectChangesInternal(this._lView[TVIEW], this._lView, this.context); 18077 } 18078 /** 18079 * Checks the change detector and its children, and throws if any changes are detected. 18080 * 18081 * This is used in development mode to verify that running change detection doesn't 18082 * introduce other changes. 18083 */ 18084 checkNoChanges() { 18085 checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context); 18086 } 18087 attachToViewContainerRef(vcRef) { 18088 if (this._appRef) { 18089 throw new Error('This view is already attached directly to the ApplicationRef!'); 18090 } 18091 this._viewContainerRef = vcRef; 18092 } 18093 detachFromAppRef() { 18094 this._appRef = null; 18095 renderDetachView(this._lView[TVIEW], this._lView); 18096 } 18097 attachToAppRef(appRef) { 18098 if (this._viewContainerRef) { 18099 throw new Error('This view is already attached to a ViewContainer!'); 18100 } 18101 this._appRef = appRef; 18102 } 18103} 18104/** @internal */ 18105class RootViewRef extends ViewRef { 18106 constructor(_view) { 18107 super(_view); 18108 this._view = _view; 18109 } 18110 detectChanges() { 18111 detectChangesInRootView(this._view); 18112 } 18113 checkNoChanges() { 18114 checkNoChangesInRootView(this._view); 18115 } 18116 get context() { 18117 return null; 18118 } 18119} 18120function collectNativeNodes(tView, lView, tNode, result, isProjection = false) { 18121 while (tNode !== null) { 18122 ngDevMode && assertNodeOfPossibleTypes(tNode, [ 18123 3 /* Element */, 0 /* Container */, 1 /* Projection */, 4 /* ElementContainer */, 18124 5 /* IcuContainer */ 18125 ]); 18126 const lNode = lView[tNode.index]; 18127 if (lNode !== null) { 18128 result.push(unwrapRNode(lNode)); 18129 } 18130 // A given lNode can represent either a native node or a LContainer (when it is a host of a 18131 // ViewContainerRef). When we find a LContainer we need to descend into it to collect root nodes 18132 // from the views in this container. 18133 if (isLContainer(lNode)) { 18134 for (let i = CONTAINER_HEADER_OFFSET; i < lNode.length; i++) { 18135 const lViewInAContainer = lNode[i]; 18136 const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild; 18137 if (lViewFirstChildTNode !== null) { 18138 collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result); 18139 } 18140 } 18141 } 18142 const tNodeType = tNode.type; 18143 if (tNodeType === 4 /* ElementContainer */ || tNodeType === 5 /* IcuContainer */) { 18144 collectNativeNodes(tView, lView, tNode.child, result); 18145 } 18146 else if (tNodeType === 1 /* Projection */) { 18147 const componentView = lView[DECLARATION_COMPONENT_VIEW]; 18148 const componentHost = componentView[T_HOST]; 18149 const slotIdx = tNode.projection; 18150 ngDevMode && 18151 assertDefined(componentHost.projection, 'Components with projection nodes (<ng-content>) must have projection slots defined.'); 18152 const nodesInSlot = componentHost.projection[slotIdx]; 18153 if (Array.isArray(nodesInSlot)) { 18154 result.push(...nodesInSlot); 18155 } 18156 else { 18157 const parentView = getLViewParent(componentView); 18158 ngDevMode && 18159 assertDefined(parentView, 'Component views should always have a parent view (component\'s host view)'); 18160 collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true); 18161 } 18162 } 18163 tNode = isProjection ? tNode.projectionNext : tNode.next; 18164 } 18165 return result; 18166} 18167 18168/** 18169 * @license 18170 * Copyright Google LLC All Rights Reserved. 18171 * 18172 * Use of this source code is governed by an MIT-style license that can be 18173 * found in the LICENSE file at https://angular.io/license 18174 */ 18175/** 18176 * Creates an ElementRef from the most recent node. 18177 * 18178 * @returns The ElementRef instance to use 18179 */ 18180function injectElementRef(ElementRefToken) { 18181 return createElementRef(ElementRefToken, getPreviousOrParentTNode(), getLView()); 18182} 18183let R3ElementRef; 18184/** 18185 * Creates an ElementRef given a node. 18186 * 18187 * @param ElementRefToken The ElementRef type 18188 * @param tNode The node for which you'd like an ElementRef 18189 * @param view The view to which the node belongs 18190 * @returns The ElementRef instance to use 18191 */ 18192function createElementRef(ElementRefToken, tNode, view) { 18193 if (!R3ElementRef) { 18194 R3ElementRef = class ElementRef extends ElementRefToken { 18195 }; 18196 } 18197 return new R3ElementRef(getNativeByTNode(tNode, view)); 18198} 18199let R3TemplateRef; 18200/** 18201 * Creates a TemplateRef given a node. 18202 * 18203 * @returns The TemplateRef instance to use 18204 */ 18205function injectTemplateRef(TemplateRefToken, ElementRefToken) { 18206 return createTemplateRef(TemplateRefToken, ElementRefToken, getPreviousOrParentTNode(), getLView()); 18207} 18208/** 18209 * Creates a TemplateRef and stores it on the injector. 18210 * 18211 * @param TemplateRefToken The TemplateRef type 18212 * @param ElementRefToken The ElementRef type 18213 * @param hostTNode The node on which a TemplateRef is requested 18214 * @param hostView The view to which the node belongs 18215 * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type 18216 */ 18217function createTemplateRef(TemplateRefToken, ElementRefToken, hostTNode, hostView) { 18218 if (!R3TemplateRef) { 18219 R3TemplateRef = class TemplateRef extends TemplateRefToken { 18220 constructor(_declarationView, _declarationTContainer, elementRef) { 18221 super(); 18222 this._declarationView = _declarationView; 18223 this._declarationTContainer = _declarationTContainer; 18224 this.elementRef = elementRef; 18225 } 18226 createEmbeddedView(context) { 18227 const embeddedTView = this._declarationTContainer.tViews; 18228 const embeddedLView = createLView(this._declarationView, embeddedTView, context, 16 /* CheckAlways */, null, embeddedTView.node); 18229 const declarationLContainer = this._declarationView[this._declarationTContainer.index]; 18230 ngDevMode && assertLContainer(declarationLContainer); 18231 embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer; 18232 const declarationViewLQueries = this._declarationView[QUERIES]; 18233 if (declarationViewLQueries !== null) { 18234 embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView); 18235 } 18236 renderView(embeddedTView, embeddedLView, context); 18237 return new ViewRef(embeddedLView); 18238 } 18239 }; 18240 } 18241 if (hostTNode.type === 0 /* Container */) { 18242 ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated'); 18243 return new R3TemplateRef(hostView, hostTNode, createElementRef(ElementRefToken, hostTNode, hostView)); 18244 } 18245 else { 18246 return null; 18247 } 18248} 18249let R3ViewContainerRef; 18250/** 18251 * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef 18252 * already exists, retrieves the existing ViewContainerRef. 18253 * 18254 * @returns The ViewContainerRef instance to use 18255 */ 18256function injectViewContainerRef(ViewContainerRefToken, ElementRefToken) { 18257 const previousTNode = getPreviousOrParentTNode(); 18258 return createContainerRef(ViewContainerRefToken, ElementRefToken, previousTNode, getLView()); 18259} 18260/** 18261 * Creates a ViewContainerRef and stores it on the injector. 18262 * 18263 * @param ViewContainerRefToken The ViewContainerRef type 18264 * @param ElementRefToken The ElementRef type 18265 * @param hostTNode The node that is requesting a ViewContainerRef 18266 * @param hostView The view to which the node belongs 18267 * @returns The ViewContainerRef instance to use 18268 */ 18269function createContainerRef(ViewContainerRefToken, ElementRefToken, hostTNode, hostView) { 18270 if (!R3ViewContainerRef) { 18271 R3ViewContainerRef = class ViewContainerRef extends ViewContainerRefToken { 18272 constructor(_lContainer, _hostTNode, _hostView) { 18273 super(); 18274 this._lContainer = _lContainer; 18275 this._hostTNode = _hostTNode; 18276 this._hostView = _hostView; 18277 } 18278 get element() { 18279 return createElementRef(ElementRefToken, this._hostTNode, this._hostView); 18280 } 18281 get injector() { 18282 return new NodeInjector(this._hostTNode, this._hostView); 18283 } 18284 /** @deprecated No replacement */ 18285 get parentInjector() { 18286 const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostView); 18287 const parentView = getParentInjectorView(parentLocation, this._hostView); 18288 const parentTNode = getParentInjectorTNode(parentLocation, this._hostView, this._hostTNode); 18289 return !hasParentInjector(parentLocation) || parentTNode == null ? 18290 new NodeInjector(null, this._hostView) : 18291 new NodeInjector(parentTNode, parentView); 18292 } 18293 clear() { 18294 while (this.length > 0) { 18295 this.remove(this.length - 1); 18296 } 18297 } 18298 get(index) { 18299 return this._lContainer[VIEW_REFS] !== null && this._lContainer[VIEW_REFS][index] || null; 18300 } 18301 get length() { 18302 return this._lContainer.length - CONTAINER_HEADER_OFFSET; 18303 } 18304 createEmbeddedView(templateRef, context, index) { 18305 const viewRef = templateRef.createEmbeddedView(context || {}); 18306 this.insert(viewRef, index); 18307 return viewRef; 18308 } 18309 createComponent(componentFactory, index, injector, projectableNodes, ngModuleRef) { 18310 const contextInjector = injector || this.parentInjector; 18311 if (!ngModuleRef && componentFactory.ngModule == null && contextInjector) { 18312 // DO NOT REFACTOR. The code here used to have a `value || undefined` expression 18313 // which seems to cause internal google apps to fail. This is documented in the 18314 // following internal bug issue: go/b/142967802 18315 const result = contextInjector.get(NgModuleRef, null); 18316 if (result) { 18317 ngModuleRef = result; 18318 } 18319 } 18320 const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef); 18321 this.insert(componentRef.hostView, index); 18322 return componentRef; 18323 } 18324 insert(viewRef, index) { 18325 const lView = viewRef._lView; 18326 const tView = lView[TVIEW]; 18327 if (viewRef.destroyed) { 18328 throw new Error('Cannot insert a destroyed View in a ViewContainer!'); 18329 } 18330 this.allocateContainerIfNeeded(); 18331 if (viewAttachedToContainer(lView)) { 18332 // If view is already attached, detach it first so we clean up references appropriately. 18333 const prevIdx = this.indexOf(viewRef); 18334 // A view might be attached either to this or a different container. The `prevIdx` for 18335 // those cases will be: 18336 // equal to -1 for views attached to this ViewContainerRef 18337 // >= 0 for views attached to a different ViewContainerRef 18338 if (prevIdx !== -1) { 18339 this.detach(prevIdx); 18340 } 18341 else { 18342 const prevLContainer = lView[PARENT]; 18343 ngDevMode && 18344 assertEqual(isLContainer(prevLContainer), true, 'An attached view should have its PARENT point to a container.'); 18345 // We need to re-create a R3ViewContainerRef instance since those are not stored on 18346 // LView (nor anywhere else). 18347 const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]); 18348 prevVCRef.detach(prevVCRef.indexOf(viewRef)); 18349 } 18350 } 18351 const adjustedIdx = this._adjustIndex(index); 18352 insertView(tView, lView, this._lContainer, adjustedIdx); 18353 const beforeNode = getBeforeNodeForView(adjustedIdx, this._lContainer); 18354 addRemoveViewFromContainer(tView, lView, true, beforeNode); 18355 viewRef.attachToViewContainerRef(this); 18356 addToArray(this._lContainer[VIEW_REFS], adjustedIdx, viewRef); 18357 return viewRef; 18358 } 18359 move(viewRef, newIndex) { 18360 if (viewRef.destroyed) { 18361 throw new Error('Cannot move a destroyed View in a ViewContainer!'); 18362 } 18363 return this.insert(viewRef, newIndex); 18364 } 18365 indexOf(viewRef) { 18366 const viewRefsArr = this._lContainer[VIEW_REFS]; 18367 return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1; 18368 } 18369 remove(index) { 18370 this.allocateContainerIfNeeded(); 18371 const adjustedIdx = this._adjustIndex(index, -1); 18372 const detachedView = detachView(this._lContainer, adjustedIdx); 18373 if (detachedView) { 18374 // Before destroying the view, remove it from the container's array of `ViewRef`s. 18375 // This ensures the view container length is updated before calling 18376 // `destroyLView`, which could recursively call view container methods that 18377 // rely on an accurate container length. 18378 // (e.g. a method on this view container being called by a child directive's OnDestroy 18379 // lifecycle hook) 18380 removeFromArray(this._lContainer[VIEW_REFS], adjustedIdx); 18381 destroyLView(detachedView[TVIEW], detachedView); 18382 } 18383 } 18384 detach(index) { 18385 this.allocateContainerIfNeeded(); 18386 const adjustedIdx = this._adjustIndex(index, -1); 18387 const view = detachView(this._lContainer, adjustedIdx); 18388 const wasDetached = view && removeFromArray(this._lContainer[VIEW_REFS], adjustedIdx) != null; 18389 return wasDetached ? new ViewRef(view) : null; 18390 } 18391 _adjustIndex(index, shift = 0) { 18392 if (index == null) { 18393 return this.length + shift; 18394 } 18395 if (ngDevMode) { 18396 assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`); 18397 // +1 because it's legal to insert at the end. 18398 assertLessThan(index, this.length + 1 + shift, 'index'); 18399 } 18400 return index; 18401 } 18402 allocateContainerIfNeeded() { 18403 if (this._lContainer[VIEW_REFS] === null) { 18404 this._lContainer[VIEW_REFS] = []; 18405 } 18406 } 18407 }; 18408 } 18409 ngDevMode && 18410 assertNodeOfPossibleTypes(hostTNode, [0 /* Container */, 3 /* Element */, 4 /* ElementContainer */]); 18411 let lContainer; 18412 const slotValue = hostView[hostTNode.index]; 18413 if (isLContainer(slotValue)) { 18414 // If the host is a container, we don't need to create a new LContainer 18415 lContainer = slotValue; 18416 } 18417 else { 18418 let commentNode; 18419 // If the host is an element container, the native host element is guaranteed to be a 18420 // comment and we can reuse that comment as anchor element for the new LContainer. 18421 // The comment node in question is already part of the DOM structure so we don't need to append 18422 // it again. 18423 if (hostTNode.type === 4 /* ElementContainer */) { 18424 commentNode = unwrapRNode(slotValue); 18425 } 18426 else { 18427 ngDevMode && ngDevMode.rendererCreateComment++; 18428 commentNode = hostView[RENDERER].createComment(ngDevMode ? 'container' : ''); 18429 // A `ViewContainerRef` can be injected by the root (topmost / bootstrapped) component. In 18430 // this case we can't use TView / TNode data structures to insert container's marker node 18431 // (both a parent of a comment node and the comment node itself are not part of any view). In 18432 // this specific case we use low-level DOM manipulation to insert container's marker (comment) 18433 // node. 18434 if (isRootView(hostView)) { 18435 const renderer = hostView[RENDERER]; 18436 const hostNative = getNativeByTNode(hostTNode, hostView); 18437 const parentOfHostNative = nativeParentNode(renderer, hostNative); 18438 nativeInsertBefore(renderer, parentOfHostNative, commentNode, nativeNextSibling(renderer, hostNative)); 18439 } 18440 else { 18441 appendChild(hostView[TVIEW], hostView, commentNode, hostTNode); 18442 } 18443 } 18444 hostView[hostTNode.index] = lContainer = 18445 createLContainer(slotValue, hostView, commentNode, hostTNode); 18446 addToViewTree(hostView, lContainer); 18447 } 18448 return new R3ViewContainerRef(lContainer, hostTNode, hostView); 18449} 18450/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */ 18451function injectChangeDetectorRef(isPipe = false) { 18452 return createViewRef(getPreviousOrParentTNode(), getLView(), isPipe); 18453} 18454/** 18455 * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias). 18456 * 18457 * @param tNode The node that is requesting a ChangeDetectorRef 18458 * @param lView The view to which the node belongs 18459 * @param isPipe Whether the view is being injected into a pipe. 18460 * @returns The ChangeDetectorRef to use 18461 */ 18462function createViewRef(tNode, lView, isPipe) { 18463 // `isComponentView` will be true for Component and Directives (but not for Pipes). 18464 // See https://github.com/angular/angular/pull/33072 for proper fix 18465 const isComponentView = !isPipe && isComponentHost(tNode); 18466 if (isComponentView) { 18467 // The LView represents the location where the component is declared. 18468 // Instead we want the LView for the component View and so we need to look it up. 18469 const componentView = getComponentLViewByIndex(tNode.index, lView); // look down 18470 return new ViewRef(componentView, componentView); 18471 } 18472 else if (tNode.type === 3 /* Element */ || tNode.type === 0 /* Container */ || 18473 tNode.type === 4 /* ElementContainer */ || tNode.type === 5 /* IcuContainer */) { 18474 // The LView represents the location where the injection is requested from. 18475 // We need to locate the containing LView (in case where the `lView` is an embedded view) 18476 const hostComponentView = lView[DECLARATION_COMPONENT_VIEW]; // look up 18477 return new ViewRef(hostComponentView, lView); 18478 } 18479 return null; 18480} 18481/** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */ 18482function getOrCreateRenderer2(view) { 18483 const renderer = view[RENDERER]; 18484 if (isProceduralRenderer(renderer)) { 18485 return renderer; 18486 } 18487 else { 18488 throw new Error('Cannot inject Renderer2 when the application uses Renderer3!'); 18489 } 18490} 18491/** Injects a Renderer2 for the current component. */ 18492function injectRenderer2() { 18493 // We need the Renderer to be based on the component that it's being injected into, however since 18494 // DI happens before we've entered its view, `getLView` will return the parent view instead. 18495 const lView = getLView(); 18496 const tNode = getPreviousOrParentTNode(); 18497 const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView); 18498 return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView); 18499} 18500 18501/** 18502 * @license 18503 * Copyright Google LLC All Rights Reserved. 18504 * 18505 * Use of this source code is governed by an MIT-style license that can be 18506 * found in the LICENSE file at https://angular.io/license 18507 */ 18508/** 18509 * Base class that provides change detection functionality. 18510 * A change-detection tree collects all views that are to be checked for changes. 18511 * Use the methods to add and remove views from the tree, initiate change-detection, 18512 * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered. 18513 * 18514 * @see [Using change detection hooks](guide/lifecycle-hooks#using-change-detection-hooks) 18515 * @see [Defining custom change detection](guide/lifecycle-hooks#defining-custom-change-detection) 18516 * 18517 * @usageNotes 18518 * 18519 * The following examples demonstrate how to modify default change-detection behavior 18520 * to perform explicit detection when needed. 18521 * 18522 * ### Use `markForCheck()` with `CheckOnce` strategy 18523 * 18524 * The following example sets the `OnPush` change-detection strategy for a component 18525 * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check 18526 * after an interval. See [live demo](http://plnkr.co/edit/GC512b?p=preview). 18527 * 18528 * <code-example path="core/ts/change_detect/change-detection.ts" 18529 * region="mark-for-check"></code-example> 18530 * 18531 * ### Detach change detector to limit how often check occurs 18532 * 18533 * The following example defines a component with a large list of read-only data 18534 * that is expected to change constantly, many times per second. 18535 * To improve performance, we want to check and update the list 18536 * less often than the changes actually occur. To do that, we detach 18537 * the component's change detector and perform an explicit local check every five seconds. 18538 * 18539 * <code-example path="core/ts/change_detect/change-detection.ts" region="detach"></code-example> 18540 * 18541 * 18542 * ### Reattaching a detached component 18543 * 18544 * The following example creates a component displaying live data. 18545 * The component detaches its change detector from the main change detector tree 18546 * when the `live` property is set to false, and reattaches it when the property 18547 * becomes true. 18548 * 18549 * <code-example path="core/ts/change_detect/change-detection.ts" region="reattach"></code-example> 18550 * 18551 * @publicApi 18552 */ 18553class ChangeDetectorRef { 18554} 18555/** 18556 * @internal 18557 * @nocollapse 18558 */ 18559ChangeDetectorRef.__NG_ELEMENT_ID__ = () => SWITCH_CHANGE_DETECTOR_REF_FACTORY(); 18560const SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ = injectChangeDetectorRef; 18561const SWITCH_CHANGE_DETECTOR_REF_FACTORY__PRE_R3__ = (...args) => { }; 18562const ɵ0$5 = SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__; 18563const SWITCH_CHANGE_DETECTOR_REF_FACTORY = SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__; 18564 18565/** 18566 * @license 18567 * Copyright Google LLC All Rights Reserved. 18568 * 18569 * Use of this source code is governed by an MIT-style license that can be 18570 * found in the LICENSE file at https://angular.io/license 18571 */ 18572/** 18573 * @description 18574 * 18575 * Represents a type that a Component or other object is instances of. 18576 * 18577 * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by 18578 * the `MyCustomComponent` constructor function. 18579 * 18580 * @publicApi 18581 */ 18582const Type = Function; 18583function isType(v) { 18584 return typeof v === 'function'; 18585} 18586 18587/** 18588 * @license 18589 * Copyright Google LLC All Rights Reserved. 18590 * 18591 * Use of this source code is governed by an MIT-style license that can be 18592 * found in the LICENSE file at https://angular.io/license 18593 */ 18594/* 18595 * ######################### 18596 * Attention: These Regular expressions have to hold even if the code is minified! 18597 * ########################## 18598 */ 18599/** 18600 * Regular expression that detects pass-through constructors for ES5 output. This Regex 18601 * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also 18602 * it intends to capture the pattern where existing constructors have been downleveled from 18603 * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g. 18604 * 18605 * ``` 18606 * function MyClass() { 18607 * var _this = _super.apply(this, arguments) || this; 18608 * ``` 18609 * 18610 * ``` 18611 * function MyClass() { 18612 * var _this = _super.apply(this, __spread(arguments)) || this; 18613 * ``` 18614 * 18615 * More details can be found in: https://github.com/angular/angular/issues/38453. 18616 */ 18617const ES5_DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|[^()]+\(arguments\))\)/; 18618/** Regular expression that detects ES2015 classes which extend from other classes. */ 18619const ES2015_INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/; 18620/** 18621 * Regular expression that detects ES2015 classes which extend from other classes and 18622 * have an explicit constructor defined. 18623 */ 18624const ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/; 18625/** 18626 * Regular expression that detects ES2015 classes which extend from other classes 18627 * and inherit a constructor. 18628 */ 18629const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{\s*super\(\.\.\.arguments\)/; 18630/** 18631 * Determine whether a stringified type is a class which delegates its constructor 18632 * to its parent. 18633 * 18634 * This is not trivial since compiled code can actually contain a constructor function 18635 * even if the original source code did not. For instance, when the child class contains 18636 * an initialized instance property. 18637 */ 18638function isDelegateCtor(typeStr) { 18639 return ES5_DELEGATE_CTOR.test(typeStr) || 18640 ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || 18641 (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr)); 18642} 18643class ReflectionCapabilities { 18644 constructor(reflect) { 18645 this._reflect = reflect || _global['Reflect']; 18646 } 18647 isReflectionEnabled() { 18648 return true; 18649 } 18650 factory(t) { 18651 return (...args) => new t(...args); 18652 } 18653 /** @internal */ 18654 _zipTypesAndAnnotations(paramTypes, paramAnnotations) { 18655 let result; 18656 if (typeof paramTypes === 'undefined') { 18657 result = newArray(paramAnnotations.length); 18658 } 18659 else { 18660 result = newArray(paramTypes.length); 18661 } 18662 for (let i = 0; i < result.length; i++) { 18663 // TS outputs Object for parameters without types, while Traceur omits 18664 // the annotations. For now we preserve the Traceur behavior to aid 18665 // migration, but this can be revisited. 18666 if (typeof paramTypes === 'undefined') { 18667 result[i] = []; 18668 } 18669 else if (paramTypes[i] && paramTypes[i] != Object) { 18670 result[i] = [paramTypes[i]]; 18671 } 18672 else { 18673 result[i] = []; 18674 } 18675 if (paramAnnotations && paramAnnotations[i] != null) { 18676 result[i] = result[i].concat(paramAnnotations[i]); 18677 } 18678 } 18679 return result; 18680 } 18681 _ownParameters(type, parentCtor) { 18682 const typeStr = type.toString(); 18683 // If we have no decorators, we only have function.length as metadata. 18684 // In that case, to detect whether a child class declared an own constructor or not, 18685 // we need to look inside of that constructor to check whether it is 18686 // just calling the parent. 18687 // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439 18688 // that sets 'design:paramtypes' to [] 18689 // if a class inherits from another class but has no ctor declared itself. 18690 if (isDelegateCtor(typeStr)) { 18691 return null; 18692 } 18693 // Prefer the direct API. 18694 if (type.parameters && type.parameters !== parentCtor.parameters) { 18695 return type.parameters; 18696 } 18697 // API of tsickle for lowering decorators to properties on the class. 18698 const tsickleCtorParams = type.ctorParameters; 18699 if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) { 18700 // Newer tsickle uses a function closure 18701 // Retain the non-function case for compatibility with older tsickle 18702 const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams; 18703 const paramTypes = ctorParameters.map((ctorParam) => ctorParam && ctorParam.type); 18704 const paramAnnotations = ctorParameters.map((ctorParam) => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators)); 18705 return this._zipTypesAndAnnotations(paramTypes, paramAnnotations); 18706 } 18707 // API for metadata created by invoking the decorators. 18708 const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS]; 18709 const paramTypes = this._reflect && this._reflect.getOwnMetadata && 18710 this._reflect.getOwnMetadata('design:paramtypes', type); 18711 if (paramTypes || paramAnnotations) { 18712 return this._zipTypesAndAnnotations(paramTypes, paramAnnotations); 18713 } 18714 // If a class has no decorators, at least create metadata 18715 // based on function.length. 18716 // Note: We know that this is a real constructor as we checked 18717 // the content of the constructor above. 18718 return newArray(type.length); 18719 } 18720 parameters(type) { 18721 // Note: only report metadata if we have at least one class decorator 18722 // to stay in sync with the static reflector. 18723 if (!isType(type)) { 18724 return []; 18725 } 18726 const parentCtor = getParentCtor(type); 18727 let parameters = this._ownParameters(type, parentCtor); 18728 if (!parameters && parentCtor !== Object) { 18729 parameters = this.parameters(parentCtor); 18730 } 18731 return parameters || []; 18732 } 18733 _ownAnnotations(typeOrFunc, parentCtor) { 18734 // Prefer the direct API. 18735 if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) { 18736 let annotations = typeOrFunc.annotations; 18737 if (typeof annotations === 'function' && annotations.annotations) { 18738 annotations = annotations.annotations; 18739 } 18740 return annotations; 18741 } 18742 // API of tsickle for lowering decorators to properties on the class. 18743 if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) { 18744 return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators); 18745 } 18746 // API for metadata created by invoking the decorators. 18747 if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) { 18748 return typeOrFunc[ANNOTATIONS]; 18749 } 18750 return null; 18751 } 18752 annotations(typeOrFunc) { 18753 if (!isType(typeOrFunc)) { 18754 return []; 18755 } 18756 const parentCtor = getParentCtor(typeOrFunc); 18757 const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || []; 18758 const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : []; 18759 return parentAnnotations.concat(ownAnnotations); 18760 } 18761 _ownPropMetadata(typeOrFunc, parentCtor) { 18762 // Prefer the direct API. 18763 if (typeOrFunc.propMetadata && 18764 typeOrFunc.propMetadata !== parentCtor.propMetadata) { 18765 let propMetadata = typeOrFunc.propMetadata; 18766 if (typeof propMetadata === 'function' && propMetadata.propMetadata) { 18767 propMetadata = propMetadata.propMetadata; 18768 } 18769 return propMetadata; 18770 } 18771 // API of tsickle for lowering decorators to properties on the class. 18772 if (typeOrFunc.propDecorators && 18773 typeOrFunc.propDecorators !== parentCtor.propDecorators) { 18774 const propDecorators = typeOrFunc.propDecorators; 18775 const propMetadata = {}; 18776 Object.keys(propDecorators).forEach(prop => { 18777 propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]); 18778 }); 18779 return propMetadata; 18780 } 18781 // API for metadata created by invoking the decorators. 18782 if (typeOrFunc.hasOwnProperty(PROP_METADATA)) { 18783 return typeOrFunc[PROP_METADATA]; 18784 } 18785 return null; 18786 } 18787 propMetadata(typeOrFunc) { 18788 if (!isType(typeOrFunc)) { 18789 return {}; 18790 } 18791 const parentCtor = getParentCtor(typeOrFunc); 18792 const propMetadata = {}; 18793 if (parentCtor !== Object) { 18794 const parentPropMetadata = this.propMetadata(parentCtor); 18795 Object.keys(parentPropMetadata).forEach((propName) => { 18796 propMetadata[propName] = parentPropMetadata[propName]; 18797 }); 18798 } 18799 const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor); 18800 if (ownPropMetadata) { 18801 Object.keys(ownPropMetadata).forEach((propName) => { 18802 const decorators = []; 18803 if (propMetadata.hasOwnProperty(propName)) { 18804 decorators.push(...propMetadata[propName]); 18805 } 18806 decorators.push(...ownPropMetadata[propName]); 18807 propMetadata[propName] = decorators; 18808 }); 18809 } 18810 return propMetadata; 18811 } 18812 ownPropMetadata(typeOrFunc) { 18813 if (!isType(typeOrFunc)) { 18814 return {}; 18815 } 18816 return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {}; 18817 } 18818 hasLifecycleHook(type, lcProperty) { 18819 return type instanceof Type && lcProperty in type.prototype; 18820 } 18821 guards(type) { 18822 return {}; 18823 } 18824 getter(name) { 18825 return new Function('o', 'return o.' + name + ';'); 18826 } 18827 setter(name) { 18828 return new Function('o', 'v', 'return o.' + name + ' = v;'); 18829 } 18830 method(name) { 18831 const functionBody = `if (!o.${name}) throw new Error('"${name}" is undefined'); 18832 return o.${name}.apply(o, args);`; 18833 return new Function('o', 'args', functionBody); 18834 } 18835 // There is not a concept of import uri in Js, but this is useful in developing Dart applications. 18836 importUri(type) { 18837 // StaticSymbol 18838 if (typeof type === 'object' && type['filePath']) { 18839 return type['filePath']; 18840 } 18841 // Runtime type 18842 return `./${stringify(type)}`; 18843 } 18844 resourceUri(type) { 18845 return `./${stringify(type)}`; 18846 } 18847 resolveIdentifier(name, moduleUrl, members, runtime) { 18848 return runtime; 18849 } 18850 resolveEnum(enumIdentifier, name) { 18851 return enumIdentifier[name]; 18852 } 18853} 18854function convertTsickleDecoratorIntoMetadata(decoratorInvocations) { 18855 if (!decoratorInvocations) { 18856 return []; 18857 } 18858 return decoratorInvocations.map(decoratorInvocation => { 18859 const decoratorType = decoratorInvocation.type; 18860 const annotationCls = decoratorType.annotationCls; 18861 const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : []; 18862 return new annotationCls(...annotationArgs); 18863 }); 18864} 18865function getParentCtor(ctor) { 18866 const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null; 18867 const parentCtor = parentProto ? parentProto.constructor : null; 18868 // Note: We always use `Object` as the null value 18869 // to simplify checking later on. 18870 return parentCtor || Object; 18871} 18872 18873/** 18874 * @license 18875 * Copyright Google LLC All Rights Reserved. 18876 * 18877 * Use of this source code is governed by an MIT-style license that can be 18878 * found in the LICENSE file at https://angular.io/license 18879 */ 18880let _reflect = null; 18881function getReflect() { 18882 return (_reflect = _reflect || new ReflectionCapabilities()); 18883} 18884function reflectDependencies(type) { 18885 return convertDependencies(getReflect().parameters(type)); 18886} 18887function convertDependencies(deps) { 18888 const compiler = getCompilerFacade(); 18889 return deps.map(dep => reflectDependency(compiler, dep)); 18890} 18891function reflectDependency(compiler, dep) { 18892 const meta = { 18893 token: null, 18894 host: false, 18895 optional: false, 18896 resolved: compiler.R3ResolvedDependencyType.Token, 18897 self: false, 18898 skipSelf: false, 18899 }; 18900 function setTokenAndResolvedType(token) { 18901 meta.resolved = compiler.R3ResolvedDependencyType.Token; 18902 meta.token = token; 18903 } 18904 if (Array.isArray(dep) && dep.length > 0) { 18905 for (let j = 0; j < dep.length; j++) { 18906 const param = dep[j]; 18907 if (param === undefined) { 18908 // param may be undefined if type of dep is not set by ngtsc 18909 continue; 18910 } 18911 const proto = Object.getPrototypeOf(param); 18912 if (param instanceof Optional || proto.ngMetadataName === 'Optional') { 18913 meta.optional = true; 18914 } 18915 else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') { 18916 meta.skipSelf = true; 18917 } 18918 else if (param instanceof Self || proto.ngMetadataName === 'Self') { 18919 meta.self = true; 18920 } 18921 else if (param instanceof Host || proto.ngMetadataName === 'Host') { 18922 meta.host = true; 18923 } 18924 else if (param instanceof Inject) { 18925 meta.token = param.token; 18926 } 18927 else if (param instanceof Attribute) { 18928 if (param.attributeName === undefined) { 18929 throw new Error(`Attribute name must be defined.`); 18930 } 18931 meta.token = param.attributeName; 18932 meta.resolved = compiler.R3ResolvedDependencyType.Attribute; 18933 } 18934 else if (param === ChangeDetectorRef) { 18935 meta.token = param; 18936 meta.resolved = compiler.R3ResolvedDependencyType.ChangeDetectorRef; 18937 } 18938 else { 18939 setTokenAndResolvedType(param); 18940 } 18941 } 18942 } 18943 else if (dep === undefined || (Array.isArray(dep) && dep.length === 0)) { 18944 meta.token = undefined; 18945 meta.resolved = R3ResolvedDependencyType.Invalid; 18946 } 18947 else { 18948 setTokenAndResolvedType(dep); 18949 } 18950 return meta; 18951} 18952 18953/** 18954 * @license 18955 * Copyright Google LLC All Rights Reserved. 18956 * 18957 * Use of this source code is governed by an MIT-style license that can be 18958 * found in the LICENSE file at https://angular.io/license 18959 */ 18960/** 18961 * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting 18962 * injectable def (`ɵprov`) onto the injectable type. 18963 */ 18964function compileInjectable(type, srcMeta) { 18965 let ngInjectableDef = null; 18966 let ngFactoryDef = null; 18967 // if NG_PROV_DEF is already defined on this class then don't overwrite it 18968 if (!type.hasOwnProperty(NG_PROV_DEF)) { 18969 Object.defineProperty(type, NG_PROV_DEF, { 18970 get: () => { 18971 if (ngInjectableDef === null) { 18972 ngInjectableDef = getCompilerFacade().compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, srcMeta)); 18973 } 18974 return ngInjectableDef; 18975 }, 18976 }); 18977 // On IE10 properties defined via `defineProperty` won't be inherited by child classes, 18978 // which will break inheriting the injectable definition from a grandparent through an 18979 // undecorated parent class. We work around it by defining a method which should be used 18980 // as a fallback. This should only be a problem in JIT mode, because in AOT TypeScript 18981 // seems to have a workaround for static properties. When inheriting from an undecorated 18982 // parent is no longer supported (v11 or later), this can safely be removed. 18983 if (!type.hasOwnProperty(NG_PROV_DEF_FALLBACK)) { 18984 type[NG_PROV_DEF_FALLBACK] = () => type[NG_PROV_DEF]; 18985 } 18986 } 18987 // if NG_FACTORY_DEF is already defined on this class then don't overwrite it 18988 if (!type.hasOwnProperty(NG_FACTORY_DEF)) { 18989 Object.defineProperty(type, NG_FACTORY_DEF, { 18990 get: () => { 18991 if (ngFactoryDef === null) { 18992 const metadata = getInjectableMetadata(type, srcMeta); 18993 const compiler = getCompilerFacade(); 18994 ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, { 18995 name: metadata.name, 18996 type: metadata.type, 18997 typeArgumentCount: metadata.typeArgumentCount, 18998 deps: reflectDependencies(type), 18999 injectFn: 'inject', 19000 target: compiler.R3FactoryTarget.Injectable 19001 }); 19002 } 19003 return ngFactoryDef; 19004 }, 19005 // Leave this configurable so that the factories from directives or pipes can take precedence. 19006 configurable: true 19007 }); 19008 } 19009} 19010const ɵ0$6 = getClosureSafeProperty; 19011const USE_VALUE$1 = getClosureSafeProperty({ provide: String, useValue: ɵ0$6 }); 19012function isUseClassProvider(meta) { 19013 return meta.useClass !== undefined; 19014} 19015function isUseValueProvider(meta) { 19016 return USE_VALUE$1 in meta; 19017} 19018function isUseFactoryProvider(meta) { 19019 return meta.useFactory !== undefined; 19020} 19021function isUseExistingProvider(meta) { 19022 return meta.useExisting !== undefined; 19023} 19024function getInjectableMetadata(type, srcMeta) { 19025 // Allow the compilation of a class with a `@Injectable()` decorator without parameters 19026 const meta = srcMeta || { providedIn: null }; 19027 const compilerMeta = { 19028 name: type.name, 19029 type: type, 19030 typeArgumentCount: 0, 19031 providedIn: meta.providedIn, 19032 userDeps: undefined, 19033 }; 19034 if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) { 19035 compilerMeta.userDeps = convertDependencies(meta.deps); 19036 } 19037 if (isUseClassProvider(meta)) { 19038 // The user explicitly specified useClass, and may or may not have provided deps. 19039 compilerMeta.useClass = resolveForwardRef(meta.useClass); 19040 } 19041 else if (isUseValueProvider(meta)) { 19042 // The user explicitly specified useValue. 19043 compilerMeta.useValue = resolveForwardRef(meta.useValue); 19044 } 19045 else if (isUseFactoryProvider(meta)) { 19046 // The user explicitly specified useFactory. 19047 compilerMeta.useFactory = meta.useFactory; 19048 } 19049 else if (isUseExistingProvider(meta)) { 19050 // The user explicitly specified useExisting. 19051 compilerMeta.useExisting = resolveForwardRef(meta.useExisting); 19052 } 19053 return compilerMeta; 19054} 19055 19056/** 19057 * @license 19058 * Copyright Google LLC All Rights Reserved. 19059 * 19060 * Use of this source code is governed by an MIT-style license that can be 19061 * found in the LICENSE file at https://angular.io/license 19062 */ 19063const ɵ0$7 = getClosureSafeProperty; 19064const USE_VALUE$2 = getClosureSafeProperty({ provide: String, useValue: ɵ0$7 }); 19065const EMPTY_ARRAY$1 = []; 19066function convertInjectableProviderToFactory(type, provider) { 19067 if (!provider) { 19068 const reflectionCapabilities = new ReflectionCapabilities(); 19069 const deps = reflectionCapabilities.parameters(type); 19070 // TODO - convert to flags. 19071 return () => new type(...injectArgs(deps)); 19072 } 19073 if (USE_VALUE$2 in provider) { 19074 const valueProvider = provider; 19075 return () => valueProvider.useValue; 19076 } 19077 else if (provider.useExisting) { 19078 const existingProvider = provider; 19079 return () => ɵɵinject(resolveForwardRef(existingProvider.useExisting)); 19080 } 19081 else if (provider.useFactory) { 19082 const factoryProvider = provider; 19083 return () => factoryProvider.useFactory(...injectArgs(factoryProvider.deps || EMPTY_ARRAY$1)); 19084 } 19085 else if (provider.useClass) { 19086 const classProvider = provider; 19087 let deps = provider.deps; 19088 if (!deps) { 19089 const reflectionCapabilities = new ReflectionCapabilities(); 19090 deps = reflectionCapabilities.parameters(type); 19091 } 19092 return () => new (resolveForwardRef(classProvider.useClass))(...injectArgs(deps)); 19093 } 19094 else { 19095 let deps = provider.deps; 19096 if (!deps) { 19097 const reflectionCapabilities = new ReflectionCapabilities(); 19098 deps = reflectionCapabilities.parameters(type); 19099 } 19100 return () => new type(...injectArgs(deps)); 19101 } 19102} 19103 19104/** 19105 * @license 19106 * Copyright Google LLC All Rights Reserved. 19107 * 19108 * Use of this source code is governed by an MIT-style license that can be 19109 * found in the LICENSE file at https://angular.io/license 19110 */ 19111const ɵ0$8 = (type, meta) => SWITCH_COMPILE_INJECTABLE(type, meta); 19112/** 19113 * Injectable decorator and metadata. 19114 * 19115 * @Annotation 19116 * @publicApi 19117 */ 19118const Injectable = makeDecorator('Injectable', undefined, undefined, undefined, ɵ0$8); 19119/** 19120 * Supports @Injectable() in JIT mode for Render2. 19121 */ 19122function render2CompileInjectable(injectableType, options) { 19123 if (options && options.providedIn !== undefined && !getInjectableDef(injectableType)) { 19124 injectableType.ɵprov = ɵɵdefineInjectable({ 19125 token: injectableType, 19126 providedIn: options.providedIn, 19127 factory: convertInjectableProviderToFactory(injectableType, options), 19128 }); 19129 } 19130} 19131const SWITCH_COMPILE_INJECTABLE__POST_R3__ = compileInjectable; 19132const SWITCH_COMPILE_INJECTABLE__PRE_R3__ = render2CompileInjectable; 19133const SWITCH_COMPILE_INJECTABLE = SWITCH_COMPILE_INJECTABLE__POST_R3__; 19134 19135/** 19136 * @license 19137 * Copyright Google LLC All Rights Reserved. 19138 * 19139 * Use of this source code is governed by an MIT-style license that can be 19140 * found in the LICENSE file at https://angular.io/license 19141 */ 19142/** 19143 * An internal token whose presence in an injector indicates that the injector should treat itself 19144 * as a root scoped injector when processing requests for unknown tokens which may indicate 19145 * they are provided in the root scope. 19146 */ 19147const INJECTOR_SCOPE = new InjectionToken('Set Injector scope.'); 19148 19149/** 19150 * @license 19151 * Copyright Google LLC All Rights Reserved. 19152 * 19153 * Use of this source code is governed by an MIT-style license that can be 19154 * found in the LICENSE file at https://angular.io/license 19155 */ 19156/** 19157 * Marker which indicates that a value has not yet been created from the factory function. 19158 */ 19159const NOT_YET = {}; 19160/** 19161 * Marker which indicates that the factory function for a token is in the process of being called. 19162 * 19163 * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates 19164 * injection of a dependency has recursively attempted to inject the original token, and there is 19165 * a circular dependency among the providers. 19166 */ 19167const CIRCULAR = {}; 19168const EMPTY_ARRAY$2 = []; 19169/** 19170 * A lazily initialized NullInjector. 19171 */ 19172let NULL_INJECTOR = undefined; 19173function getNullInjector() { 19174 if (NULL_INJECTOR === undefined) { 19175 NULL_INJECTOR = new NullInjector(); 19176 } 19177 return NULL_INJECTOR; 19178} 19179/** 19180 * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s. 19181 * 19182 * @publicApi 19183 */ 19184function createInjector(defType, parent = null, additionalProviders = null, name) { 19185 const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name); 19186 injector._resolveInjectorDefTypes(); 19187 return injector; 19188} 19189/** 19190 * Creates a new injector without eagerly resolving its injector types. Can be used in places 19191 * where resolving the injector types immediately can lead to an infinite loop. The injector types 19192 * should be resolved at a later point by calling `_resolveInjectorDefTypes`. 19193 */ 19194function createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name) { 19195 return new R3Injector(defType, additionalProviders, parent || getNullInjector(), name); 19196} 19197class R3Injector { 19198 constructor(def, additionalProviders, parent, source = null) { 19199 this.parent = parent; 19200 /** 19201 * Map of tokens to records which contain the instances of those tokens. 19202 * - `null` value implies that we don't have the record. Used by tree-shakable injectors 19203 * to prevent further searches. 19204 */ 19205 this.records = new Map(); 19206 /** 19207 * The transitive set of `InjectorType`s which define this injector. 19208 */ 19209 this.injectorDefTypes = new Set(); 19210 /** 19211 * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks. 19212 */ 19213 this.onDestroy = new Set(); 19214 this._destroyed = false; 19215 const dedupStack = []; 19216 // Start off by creating Records for every provider declared in every InjectorType 19217 // included transitively in additional providers then do the same for `def`. This order is 19218 // important because `def` may include providers that override ones in additionalProviders. 19219 additionalProviders && 19220 deepForEach(additionalProviders, provider => this.processProvider(provider, def, additionalProviders)); 19221 deepForEach([def], injectorDef => this.processInjectorType(injectorDef, [], dedupStack)); 19222 // Make sure the INJECTOR token provides this injector. 19223 this.records.set(INJECTOR, makeRecord(undefined, this)); 19224 // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide 19225 // any injectable scoped to APP_ROOT_SCOPE. 19226 const record = this.records.get(INJECTOR_SCOPE); 19227 this.scope = record != null ? record.value : null; 19228 // Source name, used for debugging 19229 this.source = source || (typeof def === 'object' ? null : stringify(def)); 19230 } 19231 /** 19232 * Flag indicating that this injector was previously destroyed. 19233 */ 19234 get destroyed() { 19235 return this._destroyed; 19236 } 19237 /** 19238 * Destroy the injector and release references to every instance or provider associated with it. 19239 * 19240 * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a 19241 * hook was found. 19242 */ 19243 destroy() { 19244 this.assertNotDestroyed(); 19245 // Set destroyed = true first, in case lifecycle hooks re-enter destroy(). 19246 this._destroyed = true; 19247 try { 19248 // Call all the lifecycle hooks. 19249 this.onDestroy.forEach(service => service.ngOnDestroy()); 19250 } 19251 finally { 19252 // Release all references. 19253 this.records.clear(); 19254 this.onDestroy.clear(); 19255 this.injectorDefTypes.clear(); 19256 } 19257 } 19258 get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) { 19259 this.assertNotDestroyed(); 19260 // Set the injection context. 19261 const previousInjector = setCurrentInjector(this); 19262 try { 19263 // Check for the SkipSelf flag. 19264 if (!(flags & InjectFlags.SkipSelf)) { 19265 // SkipSelf isn't set, check if the record belongs to this injector. 19266 let record = this.records.get(token); 19267 if (record === undefined) { 19268 // No record, but maybe the token is scoped to this injector. Look for an injectable 19269 // def with a scope matching this injector. 19270 const def = couldBeInjectableType(token) && getInjectableDef(token); 19271 if (def && this.injectableDefInScope(def)) { 19272 // Found an injectable def and it's scoped to this injector. Pretend as if it was here 19273 // all along. 19274 record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET); 19275 } 19276 else { 19277 record = null; 19278 } 19279 this.records.set(token, record); 19280 } 19281 // If a record was found, get the instance for it and return it. 19282 if (record != null /* NOT null || undefined */) { 19283 return this.hydrate(token, record); 19284 } 19285 } 19286 // Select the next injector based on the Self flag - if self is set, the next injector is 19287 // the NullInjector, otherwise it's the parent. 19288 const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector(); 19289 // Set the notFoundValue based on the Optional flag - if optional is set and notFoundValue 19290 // is undefined, the value is null, otherwise it's the notFoundValue. 19291 notFoundValue = (flags & InjectFlags.Optional) && notFoundValue === THROW_IF_NOT_FOUND ? 19292 null : 19293 notFoundValue; 19294 return nextInjector.get(token, notFoundValue); 19295 } 19296 catch (e) { 19297 if (e.name === 'NullInjectorError') { 19298 const path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || []; 19299 path.unshift(stringify(token)); 19300 if (previousInjector) { 19301 // We still have a parent injector, keep throwing 19302 throw e; 19303 } 19304 else { 19305 // Format & throw the final error message when we don't have any previous injector 19306 return catchInjectorError(e, token, 'R3InjectorError', this.source); 19307 } 19308 } 19309 else { 19310 throw e; 19311 } 19312 } 19313 finally { 19314 // Lastly, clean up the state by restoring the previous injector. 19315 setCurrentInjector(previousInjector); 19316 } 19317 } 19318 /** @internal */ 19319 _resolveInjectorDefTypes() { 19320 this.injectorDefTypes.forEach(defType => this.get(defType)); 19321 } 19322 toString() { 19323 const tokens = [], records = this.records; 19324 records.forEach((v, token) => tokens.push(stringify(token))); 19325 return `R3Injector[${tokens.join(', ')}]`; 19326 } 19327 assertNotDestroyed() { 19328 if (this._destroyed) { 19329 throw new Error('Injector has already been destroyed.'); 19330 } 19331 } 19332 /** 19333 * Add an `InjectorType` or `InjectorTypeWithProviders` and all of its transitive providers 19334 * to this injector. 19335 * 19336 * If an `InjectorTypeWithProviders` that declares providers besides the type is specified, 19337 * the function will return "true" to indicate that the providers of the type definition need 19338 * to be processed. This allows us to process providers of injector types after all imports of 19339 * an injector definition are processed. (following View Engine semantics: see FW-1349) 19340 */ 19341 processInjectorType(defOrWrappedDef, parents, dedupStack) { 19342 defOrWrappedDef = resolveForwardRef(defOrWrappedDef); 19343 if (!defOrWrappedDef) 19344 return false; 19345 // Either the defOrWrappedDef is an InjectorType (with injector def) or an 19346 // InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic 19347 // read, so care is taken to only do the read once. 19348 // First attempt to read the injector def (`ɵinj`). 19349 let def = getInjectorDef(defOrWrappedDef); 19350 // If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders. 19351 const ngModule = (def == null) && defOrWrappedDef.ngModule || undefined; 19352 // Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`, 19353 // then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type 19354 // is the `ngModule`. 19355 const defType = (ngModule === undefined) ? defOrWrappedDef : ngModule; 19356 // Check for circular dependencies. 19357 if (ngDevMode && parents.indexOf(defType) !== -1) { 19358 const defName = stringify(defType); 19359 throw new Error(`Circular dependency in DI detected for type ${defName}. Dependency path: ${parents.map(defType => stringify(defType)).join(' > ')} > ${defName}.`); 19360 } 19361 // Check for multiple imports of the same module 19362 const isDuplicate = dedupStack.indexOf(defType) !== -1; 19363 // Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual 19364 // `InjectorDef` is on its `ngModule`. 19365 if (ngModule !== undefined) { 19366 def = getInjectorDef(ngModule); 19367 } 19368 // If no definition was found, it might be from exports. Remove it. 19369 if (def == null) { 19370 return false; 19371 } 19372 // Add providers in the same way that @NgModule resolution did: 19373 // First, include providers from any imports. 19374 if (def.imports != null && !isDuplicate) { 19375 // Before processing defType's imports, add it to the set of parents. This way, if it ends 19376 // up deeply importing itself, this can be detected. 19377 ngDevMode && parents.push(defType); 19378 // Add it to the set of dedups. This way we can detect multiple imports of the same module 19379 dedupStack.push(defType); 19380 let importTypesWithProviders; 19381 try { 19382 deepForEach(def.imports, imported => { 19383 if (this.processInjectorType(imported, parents, dedupStack)) { 19384 if (importTypesWithProviders === undefined) 19385 importTypesWithProviders = []; 19386 // If the processed import is an injector type with providers, we store it in the 19387 // list of import types with providers, so that we can process those afterwards. 19388 importTypesWithProviders.push(imported); 19389 } 19390 }); 19391 } 19392 finally { 19393 // Remove it from the parents set when finished. 19394 ngDevMode && parents.pop(); 19395 } 19396 // Imports which are declared with providers (TypeWithProviders) need to be processed 19397 // after all imported modules are processed. This is similar to how View Engine 19398 // processes/merges module imports in the metadata resolver. See: FW-1349. 19399 if (importTypesWithProviders !== undefined) { 19400 for (let i = 0; i < importTypesWithProviders.length; i++) { 19401 const { ngModule, providers } = importTypesWithProviders[i]; 19402 deepForEach(providers, provider => this.processProvider(provider, ngModule, providers || EMPTY_ARRAY$2)); 19403 } 19404 } 19405 } 19406 // Track the InjectorType and add a provider for it. It's important that this is done after the 19407 // def's imports. 19408 this.injectorDefTypes.add(defType); 19409 this.records.set(defType, makeRecord(def.factory, NOT_YET)); 19410 // Next, include providers listed on the definition itself. 19411 const defProviders = def.providers; 19412 if (defProviders != null && !isDuplicate) { 19413 const injectorType = defOrWrappedDef; 19414 deepForEach(defProviders, provider => this.processProvider(provider, injectorType, defProviders)); 19415 } 19416 return (ngModule !== undefined && 19417 defOrWrappedDef.providers !== undefined); 19418 } 19419 /** 19420 * Process a `SingleProvider` and add it. 19421 */ 19422 processProvider(provider, ngModuleType, providers) { 19423 // Determine the token from the provider. Either it's its own token, or has a {provide: ...} 19424 // property. 19425 provider = resolveForwardRef(provider); 19426 let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide); 19427 // Construct a `Record` for the provider. 19428 const record = providerToRecord(provider, ngModuleType, providers); 19429 if (!isTypeProvider(provider) && provider.multi === true) { 19430 // If the provider indicates that it's a multi-provider, process it specially. 19431 // First check whether it's been defined already. 19432 let multiRecord = this.records.get(token); 19433 if (multiRecord) { 19434 // It has. Throw a nice error if 19435 if (multiRecord.multi === undefined) { 19436 throwMixedMultiProviderError(); 19437 } 19438 } 19439 else { 19440 multiRecord = makeRecord(undefined, NOT_YET, true); 19441 multiRecord.factory = () => injectArgs(multiRecord.multi); 19442 this.records.set(token, multiRecord); 19443 } 19444 token = provider; 19445 multiRecord.multi.push(provider); 19446 } 19447 else { 19448 const existing = this.records.get(token); 19449 if (existing && existing.multi !== undefined) { 19450 throwMixedMultiProviderError(); 19451 } 19452 } 19453 this.records.set(token, record); 19454 } 19455 hydrate(token, record) { 19456 if (record.value === CIRCULAR) { 19457 throwCyclicDependencyError(stringify(token)); 19458 } 19459 else if (record.value === NOT_YET) { 19460 record.value = CIRCULAR; 19461 record.value = record.factory(); 19462 } 19463 if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) { 19464 this.onDestroy.add(record.value); 19465 } 19466 return record.value; 19467 } 19468 injectableDefInScope(def) { 19469 if (!def.providedIn) { 19470 return false; 19471 } 19472 else if (typeof def.providedIn === 'string') { 19473 return def.providedIn === 'any' || (def.providedIn === this.scope); 19474 } 19475 else { 19476 return this.injectorDefTypes.has(def.providedIn); 19477 } 19478 } 19479} 19480function injectableDefOrInjectorDefFactory(token) { 19481 // Most tokens will have an injectable def directly on them, which specifies a factory directly. 19482 const injectableDef = getInjectableDef(token); 19483 const factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token); 19484 if (factory !== null) { 19485 return factory; 19486 } 19487 // If the token is an NgModule, it's also injectable but the factory is on its injector def 19488 // (`ɵinj`) 19489 const injectorDef = getInjectorDef(token); 19490 if (injectorDef !== null) { 19491 return injectorDef.factory; 19492 } 19493 // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above. 19494 // If it's missing that, it's an error. 19495 if (token instanceof InjectionToken) { 19496 throw new Error(`Token ${stringify(token)} is missing a ɵprov definition.`); 19497 } 19498 // Undecorated types can sometimes be created if they have no constructor arguments. 19499 if (token instanceof Function) { 19500 return getUndecoratedInjectableFactory(token); 19501 } 19502 // There was no way to resolve a factory for this token. 19503 throw new Error('unreachable'); 19504} 19505function getUndecoratedInjectableFactory(token) { 19506 // If the token has parameters then it has dependencies that we cannot resolve implicitly. 19507 const paramLength = token.length; 19508 if (paramLength > 0) { 19509 const args = newArray(paramLength, '?'); 19510 throw new Error(`Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`); 19511 } 19512 // The constructor function appears to have no parameters. 19513 // This might be because it inherits from a super-class. In which case, use an injectable 19514 // def from an ancestor if there is one. 19515 // Otherwise this really is a simple class with no dependencies, so return a factory that 19516 // just instantiates the zero-arg constructor. 19517 const inheritedInjectableDef = getInheritedInjectableDef(token); 19518 if (inheritedInjectableDef !== null) { 19519 return () => inheritedInjectableDef.factory(token); 19520 } 19521 else { 19522 return () => new token(); 19523 } 19524} 19525function providerToRecord(provider, ngModuleType, providers) { 19526 if (isValueProvider(provider)) { 19527 return makeRecord(undefined, provider.useValue); 19528 } 19529 else { 19530 const factory = providerToFactory(provider, ngModuleType, providers); 19531 return makeRecord(factory, NOT_YET); 19532 } 19533} 19534/** 19535 * Converts a `SingleProvider` into a factory function. 19536 * 19537 * @param provider provider to convert to factory 19538 */ 19539function providerToFactory(provider, ngModuleType, providers) { 19540 let factory = undefined; 19541 if (isTypeProvider(provider)) { 19542 const unwrappedProvider = resolveForwardRef(provider); 19543 return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider); 19544 } 19545 else { 19546 if (isValueProvider(provider)) { 19547 factory = () => resolveForwardRef(provider.useValue); 19548 } 19549 else if (isFactoryProvider(provider)) { 19550 factory = () => provider.useFactory(...injectArgs(provider.deps || [])); 19551 } 19552 else if (isExistingProvider(provider)) { 19553 factory = () => ɵɵinject(resolveForwardRef(provider.useExisting)); 19554 } 19555 else { 19556 const classRef = resolveForwardRef(provider && 19557 (provider.useClass || provider.provide)); 19558 if (!classRef) { 19559 throwInvalidProviderError(ngModuleType, providers, provider); 19560 } 19561 if (hasDeps(provider)) { 19562 factory = () => new (classRef)(...injectArgs(provider.deps)); 19563 } 19564 else { 19565 return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef); 19566 } 19567 } 19568 } 19569 return factory; 19570} 19571function makeRecord(factory, value, multi = false) { 19572 return { 19573 factory: factory, 19574 value: value, 19575 multi: multi ? [] : undefined, 19576 }; 19577} 19578function isValueProvider(value) { 19579 return value !== null && typeof value == 'object' && USE_VALUE in value; 19580} 19581function isExistingProvider(value) { 19582 return !!(value && value.useExisting); 19583} 19584function isFactoryProvider(value) { 19585 return !!(value && value.useFactory); 19586} 19587function isTypeProvider(value) { 19588 return typeof value === 'function'; 19589} 19590function isClassProvider(value) { 19591 return !!value.useClass; 19592} 19593function hasDeps(value) { 19594 return !!value.deps; 19595} 19596function hasOnDestroy(value) { 19597 return value !== null && typeof value === 'object' && 19598 typeof value.ngOnDestroy === 'function'; 19599} 19600function couldBeInjectableType(value) { 19601 return (typeof value === 'function') || 19602 (typeof value === 'object' && value instanceof InjectionToken); 19603} 19604 19605/** 19606 * @license 19607 * Copyright Google LLC All Rights Reserved. 19608 * 19609 * Use of this source code is governed by an MIT-style license that can be 19610 * found in the LICENSE file at https://angular.io/license 19611 */ 19612function INJECTOR_IMPL__PRE_R3__(providers, parent, name) { 19613 return new StaticInjector(providers, parent, name); 19614} 19615function INJECTOR_IMPL__POST_R3__(providers, parent, name) { 19616 return createInjector({ name: name }, parent, providers, name); 19617} 19618const INJECTOR_IMPL = INJECTOR_IMPL__POST_R3__; 19619/** 19620 * Concrete injectors implement this interface. Injectors are configured 19621 * with [providers](guide/glossary#provider) that associate 19622 * dependencies of various types with [injection tokens](guide/glossary#di-token). 19623 * 19624 * @see ["DI Providers"](guide/dependency-injection-providers). 19625 * @see `StaticProvider` 19626 * 19627 * @usageNotes 19628 * 19629 * The following example creates a service injector instance. 19630 * 19631 * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'} 19632 * 19633 * ### Usage example 19634 * 19635 * {@example core/di/ts/injector_spec.ts region='Injector'} 19636 * 19637 * `Injector` returns itself when given `Injector` as a token: 19638 * 19639 * {@example core/di/ts/injector_spec.ts region='injectInjector'} 19640 * 19641 * @publicApi 19642 */ 19643class Injector { 19644 static create(options, parent) { 19645 if (Array.isArray(options)) { 19646 return INJECTOR_IMPL(options, parent, ''); 19647 } 19648 else { 19649 return INJECTOR_IMPL(options.providers, options.parent, options.name || ''); 19650 } 19651 } 19652} 19653Injector.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND; 19654Injector.NULL = new NullInjector(); 19655/** @nocollapse */ 19656Injector.ɵprov = ɵɵdefineInjectable({ 19657 token: Injector, 19658 providedIn: 'any', 19659 factory: () => ɵɵinject(INJECTOR), 19660}); 19661/** 19662 * @internal 19663 * @nocollapse 19664 */ 19665Injector.__NG_ELEMENT_ID__ = -1; 19666const IDENT = function (value) { 19667 return value; 19668}; 19669const ɵ0$9 = IDENT; 19670const EMPTY = []; 19671const CIRCULAR$1 = IDENT; 19672const MULTI_PROVIDER_FN = function () { 19673 return Array.prototype.slice.call(arguments); 19674}; 19675const ɵ1$1 = MULTI_PROVIDER_FN; 19676const NO_NEW_LINE$1 = 'ɵ'; 19677class StaticInjector { 19678 constructor(providers, parent = Injector.NULL, source = null) { 19679 this.parent = parent; 19680 this.source = source; 19681 const records = this._records = new Map(); 19682 records.set(Injector, { token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false }); 19683 records.set(INJECTOR, { token: INJECTOR, fn: IDENT, deps: EMPTY, value: this, useNew: false }); 19684 this.scope = recursivelyProcessProviders(records, providers); 19685 } 19686 get(token, notFoundValue, flags = InjectFlags.Default) { 19687 const records = this._records; 19688 let record = records.get(token); 19689 if (record === undefined) { 19690 // This means we have never seen this record, see if it is tree shakable provider. 19691 const injectableDef = getInjectableDef(token); 19692 if (injectableDef) { 19693 const providedIn = injectableDef && injectableDef.providedIn; 19694 if (providedIn === 'any' || providedIn != null && providedIn === this.scope) { 19695 records.set(token, record = resolveProvider({ provide: token, useFactory: injectableDef.factory, deps: EMPTY })); 19696 } 19697 } 19698 if (record === undefined) { 19699 // Set record to null to make sure that we don't go through expensive lookup above again. 19700 records.set(token, null); 19701 } 19702 } 19703 let lastInjector = setCurrentInjector(this); 19704 try { 19705 return tryResolveToken(token, record, records, this.parent, notFoundValue, flags); 19706 } 19707 catch (e) { 19708 return catchInjectorError(e, token, 'StaticInjectorError', this.source); 19709 } 19710 finally { 19711 setCurrentInjector(lastInjector); 19712 } 19713 } 19714 toString() { 19715 const tokens = [], records = this._records; 19716 records.forEach((v, token) => tokens.push(stringify(token))); 19717 return `StaticInjector[${tokens.join(', ')}]`; 19718 } 19719} 19720function resolveProvider(provider) { 19721 const deps = computeDeps(provider); 19722 let fn = IDENT; 19723 let value = EMPTY; 19724 let useNew = false; 19725 let provide = resolveForwardRef(provider.provide); 19726 if (USE_VALUE in provider) { 19727 // We need to use USE_VALUE in provider since provider.useValue could be defined as undefined. 19728 value = provider.useValue; 19729 } 19730 else if (provider.useFactory) { 19731 fn = provider.useFactory; 19732 } 19733 else if (provider.useExisting) { 19734 // Just use IDENT 19735 } 19736 else if (provider.useClass) { 19737 useNew = true; 19738 fn = resolveForwardRef(provider.useClass); 19739 } 19740 else if (typeof provide == 'function') { 19741 useNew = true; 19742 fn = provide; 19743 } 19744 else { 19745 throw staticError('StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable', provider); 19746 } 19747 return { deps, fn, useNew, value }; 19748} 19749function multiProviderMixError(token) { 19750 return staticError('Cannot mix multi providers and regular providers', token); 19751} 19752function recursivelyProcessProviders(records, provider) { 19753 let scope = null; 19754 if (provider) { 19755 provider = resolveForwardRef(provider); 19756 if (Array.isArray(provider)) { 19757 // if we have an array recurse into the array 19758 for (let i = 0; i < provider.length; i++) { 19759 scope = recursivelyProcessProviders(records, provider[i]) || scope; 19760 } 19761 } 19762 else if (typeof provider === 'function') { 19763 // Functions were supported in ReflectiveInjector, but are not here. For safety give useful 19764 // error messages 19765 throw staticError('Function/Class not supported', provider); 19766 } 19767 else if (provider && typeof provider === 'object' && provider.provide) { 19768 // At this point we have what looks like a provider: {provide: ?, ....} 19769 let token = resolveForwardRef(provider.provide); 19770 const resolvedProvider = resolveProvider(provider); 19771 if (provider.multi === true) { 19772 // This is a multi provider. 19773 let multiProvider = records.get(token); 19774 if (multiProvider) { 19775 if (multiProvider.fn !== MULTI_PROVIDER_FN) { 19776 throw multiProviderMixError(token); 19777 } 19778 } 19779 else { 19780 // Create a placeholder factory which will look up the constituents of the multi provider. 19781 records.set(token, multiProvider = { 19782 token: provider.provide, 19783 deps: [], 19784 useNew: false, 19785 fn: MULTI_PROVIDER_FN, 19786 value: EMPTY 19787 }); 19788 } 19789 // Treat the provider as the token. 19790 token = provider; 19791 multiProvider.deps.push({ token, options: 6 /* Default */ }); 19792 } 19793 const record = records.get(token); 19794 if (record && record.fn == MULTI_PROVIDER_FN) { 19795 throw multiProviderMixError(token); 19796 } 19797 if (token === INJECTOR_SCOPE) { 19798 scope = resolvedProvider.value; 19799 } 19800 records.set(token, resolvedProvider); 19801 } 19802 else { 19803 throw staticError('Unexpected provider', provider); 19804 } 19805 } 19806 return scope; 19807} 19808function tryResolveToken(token, record, records, parent, notFoundValue, flags) { 19809 try { 19810 return resolveToken(token, record, records, parent, notFoundValue, flags); 19811 } 19812 catch (e) { 19813 // ensure that 'e' is of type Error. 19814 if (!(e instanceof Error)) { 19815 e = new Error(e); 19816 } 19817 const path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || []; 19818 path.unshift(token); 19819 if (record && record.value == CIRCULAR$1) { 19820 // Reset the Circular flag. 19821 record.value = EMPTY; 19822 } 19823 throw e; 19824 } 19825} 19826function resolveToken(token, record, records, parent, notFoundValue, flags) { 19827 let value; 19828 if (record && !(flags & InjectFlags.SkipSelf)) { 19829 // If we don't have a record, this implies that we don't own the provider hence don't know how 19830 // to resolve it. 19831 value = record.value; 19832 if (value == CIRCULAR$1) { 19833 throw Error(NO_NEW_LINE$1 + 'Circular dependency'); 19834 } 19835 else if (value === EMPTY) { 19836 record.value = CIRCULAR$1; 19837 let obj = undefined; 19838 let useNew = record.useNew; 19839 let fn = record.fn; 19840 let depRecords = record.deps; 19841 let deps = EMPTY; 19842 if (depRecords.length) { 19843 deps = []; 19844 for (let i = 0; i < depRecords.length; i++) { 19845 const depRecord = depRecords[i]; 19846 const options = depRecord.options; 19847 const childRecord = options & 2 /* CheckSelf */ ? records.get(depRecord.token) : undefined; 19848 deps.push(tryResolveToken( 19849 // Current Token to resolve 19850 depRecord.token, 19851 // A record which describes how to resolve the token. 19852 // If undefined, this means we don't have such a record 19853 childRecord, 19854 // Other records we know about. 19855 records, 19856 // If we don't know how to resolve dependency and we should not check parent for it, 19857 // than pass in Null injector. 19858 !childRecord && !(options & 4 /* CheckParent */) ? Injector.NULL : parent, options & 1 /* Optional */ ? null : Injector.THROW_IF_NOT_FOUND, InjectFlags.Default)); 19859 } 19860 } 19861 record.value = value = useNew ? new fn(...deps) : fn.apply(obj, deps); 19862 } 19863 } 19864 else if (!(flags & InjectFlags.Self)) { 19865 value = parent.get(token, notFoundValue, InjectFlags.Default); 19866 } 19867 else if (!(flags & InjectFlags.Optional)) { 19868 value = Injector.NULL.get(token, notFoundValue); 19869 } 19870 else { 19871 value = Injector.NULL.get(token, typeof notFoundValue !== 'undefined' ? notFoundValue : null); 19872 } 19873 return value; 19874} 19875function computeDeps(provider) { 19876 let deps = EMPTY; 19877 const providerDeps = provider.deps; 19878 if (providerDeps && providerDeps.length) { 19879 deps = []; 19880 for (let i = 0; i < providerDeps.length; i++) { 19881 let options = 6 /* Default */; 19882 let token = resolveForwardRef(providerDeps[i]); 19883 if (Array.isArray(token)) { 19884 for (let j = 0, annotations = token; j < annotations.length; j++) { 19885 const annotation = annotations[j]; 19886 if (annotation instanceof Optional || annotation == Optional) { 19887 options = options | 1 /* Optional */; 19888 } 19889 else if (annotation instanceof SkipSelf || annotation == SkipSelf) { 19890 options = options & ~2 /* CheckSelf */; 19891 } 19892 else if (annotation instanceof Self || annotation == Self) { 19893 options = options & ~4 /* CheckParent */; 19894 } 19895 else if (annotation instanceof Inject) { 19896 token = annotation.token; 19897 } 19898 else { 19899 token = resolveForwardRef(annotation); 19900 } 19901 } 19902 } 19903 deps.push({ token, options }); 19904 } 19905 } 19906 else if (provider.useExisting) { 19907 const token = resolveForwardRef(provider.useExisting); 19908 deps = [{ token, options: 6 /* Default */ }]; 19909 } 19910 else if (!providerDeps && !(USE_VALUE in provider)) { 19911 // useValue & useExisting are the only ones which are exempt from deps all others need it. 19912 throw staticError('\'deps\' required', provider); 19913 } 19914 return deps; 19915} 19916function staticError(text, obj) { 19917 return new Error(formatError(text, obj, 'StaticInjectorError')); 19918} 19919 19920/** 19921 * @license 19922 * Copyright Google LLC All Rights Reserved. 19923 * 19924 * Use of this source code is governed by an MIT-style license that can be 19925 * found in the LICENSE file at https://angular.io/license 19926 */ 19927function findFirstClosedCycle(keys) { 19928 const res = []; 19929 for (let i = 0; i < keys.length; ++i) { 19930 if (res.indexOf(keys[i]) > -1) { 19931 res.push(keys[i]); 19932 return res; 19933 } 19934 res.push(keys[i]); 19935 } 19936 return res; 19937} 19938function constructResolvingPath(keys) { 19939 if (keys.length > 1) { 19940 const reversed = findFirstClosedCycle(keys.slice().reverse()); 19941 const tokenStrs = reversed.map(k => stringify(k.token)); 19942 return ' (' + tokenStrs.join(' -> ') + ')'; 19943 } 19944 return ''; 19945} 19946function injectionError(injector, key, constructResolvingMessage, originalError) { 19947 const keys = [key]; 19948 const errMsg = constructResolvingMessage(keys); 19949 const error = (originalError ? wrappedError(errMsg, originalError) : Error(errMsg)); 19950 error.addKey = addKey; 19951 error.keys = keys; 19952 error.injectors = [injector]; 19953 error.constructResolvingMessage = constructResolvingMessage; 19954 error[ERROR_ORIGINAL_ERROR] = originalError; 19955 return error; 19956} 19957function addKey(injector, key) { 19958 this.injectors.push(injector); 19959 this.keys.push(key); 19960 // Note: This updated message won't be reflected in the `.stack` property 19961 this.message = this.constructResolvingMessage(this.keys); 19962} 19963/** 19964 * Thrown when trying to retrieve a dependency by key from {@link Injector}, but the 19965 * {@link Injector} does not have a {@link Provider} for the given key. 19966 * 19967 * @usageNotes 19968 * ### Example 19969 * 19970 * ```typescript 19971 * class A { 19972 * constructor(b:B) {} 19973 * } 19974 * 19975 * expect(() => Injector.resolveAndCreate([A])).toThrowError(); 19976 * ``` 19977 */ 19978function noProviderError(injector, key) { 19979 return injectionError(injector, key, function (keys) { 19980 const first = stringify(keys[0].token); 19981 return `No provider for ${first}!${constructResolvingPath(keys)}`; 19982 }); 19983} 19984/** 19985 * Thrown when dependencies form a cycle. 19986 * 19987 * @usageNotes 19988 * ### Example 19989 * 19990 * ```typescript 19991 * var injector = Injector.resolveAndCreate([ 19992 * {provide: "one", useFactory: (two) => "two", deps: [[new Inject("two")]]}, 19993 * {provide: "two", useFactory: (one) => "one", deps: [[new Inject("one")]]} 19994 * ]); 19995 * 19996 * expect(() => injector.get("one")).toThrowError(); 19997 * ``` 19998 * 19999 * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed. 20000 */ 20001function cyclicDependencyError(injector, key) { 20002 return injectionError(injector, key, function (keys) { 20003 return `Cannot instantiate cyclic dependency!${constructResolvingPath(keys)}`; 20004 }); 20005} 20006/** 20007 * Thrown when a constructing type returns with an Error. 20008 * 20009 * The `InstantiationError` class contains the original error plus the dependency graph which caused 20010 * this object to be instantiated. 20011 * 20012 * @usageNotes 20013 * ### Example 20014 * 20015 * ```typescript 20016 * class A { 20017 * constructor() { 20018 * throw new Error('message'); 20019 * } 20020 * } 20021 * 20022 * var injector = Injector.resolveAndCreate([A]); 20023 20024 * try { 20025 * injector.get(A); 20026 * } catch (e) { 20027 * expect(e instanceof InstantiationError).toBe(true); 20028 * expect(e.originalException.message).toEqual("message"); 20029 * expect(e.originalStack).toBeDefined(); 20030 * } 20031 * ``` 20032 */ 20033function instantiationError(injector, originalException, originalStack, key) { 20034 return injectionError(injector, key, function (keys) { 20035 const first = stringify(keys[0].token); 20036 return `${originalException.message}: Error during instantiation of ${first}!${constructResolvingPath(keys)}.`; 20037 }, originalException); 20038} 20039/** 20040 * Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector} 20041 * creation. 20042 * 20043 * @usageNotes 20044 * ### Example 20045 * 20046 * ```typescript 20047 * expect(() => Injector.resolveAndCreate(["not a type"])).toThrowError(); 20048 * ``` 20049 */ 20050function invalidProviderError(provider) { 20051 return Error(`Invalid provider - only instances of Provider and Type are allowed, got: ${provider}`); 20052} 20053/** 20054 * Thrown when the class has no annotation information. 20055 * 20056 * Lack of annotation information prevents the {@link Injector} from determining which dependencies 20057 * need to be injected into the constructor. 20058 * 20059 * @usageNotes 20060 * ### Example 20061 * 20062 * ```typescript 20063 * class A { 20064 * constructor(b) {} 20065 * } 20066 * 20067 * expect(() => Injector.resolveAndCreate([A])).toThrowError(); 20068 * ``` 20069 * 20070 * This error is also thrown when the class not marked with {@link Injectable} has parameter types. 20071 * 20072 * ```typescript 20073 * class B {} 20074 * 20075 * class A { 20076 * constructor(b:B) {} // no information about the parameter types of A is available at runtime. 20077 * } 20078 * 20079 * expect(() => Injector.resolveAndCreate([A,B])).toThrowError(); 20080 * ``` 20081 * 20082 */ 20083function noAnnotationError(typeOrFunc, params) { 20084 const signature = []; 20085 for (let i = 0, ii = params.length; i < ii; i++) { 20086 const parameter = params[i]; 20087 if (!parameter || parameter.length == 0) { 20088 signature.push('?'); 20089 } 20090 else { 20091 signature.push(parameter.map(stringify).join(' ')); 20092 } 20093 } 20094 return Error('Cannot resolve all parameters for \'' + stringify(typeOrFunc) + '\'(' + 20095 signature.join(', ') + '). ' + 20096 'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \'' + 20097 stringify(typeOrFunc) + '\' is decorated with Injectable.'); 20098} 20099/** 20100 * Thrown when getting an object by index. 20101 * 20102 * @usageNotes 20103 * ### Example 20104 * 20105 * ```typescript 20106 * class A {} 20107 * 20108 * var injector = Injector.resolveAndCreate([A]); 20109 * 20110 * expect(() => injector.getAt(100)).toThrowError(); 20111 * ``` 20112 * 20113 */ 20114function outOfBoundsError(index) { 20115 return Error(`Index ${index} is out-of-bounds.`); 20116} 20117// TODO: add a working example after alpha38 is released 20118/** 20119 * Thrown when a multi provider and a regular provider are bound to the same token. 20120 * 20121 * @usageNotes 20122 * ### Example 20123 * 20124 * ```typescript 20125 * expect(() => Injector.resolveAndCreate([ 20126 * { provide: "Strings", useValue: "string1", multi: true}, 20127 * { provide: "Strings", useValue: "string2", multi: false} 20128 * ])).toThrowError(); 20129 * ``` 20130 */ 20131function mixingMultiProvidersWithRegularProvidersError(provider1, provider2) { 20132 return Error(`Cannot mix multi providers and regular providers, got: ${provider1} ${provider2}`); 20133} 20134 20135/** 20136 * @license 20137 * Copyright Google LLC All Rights Reserved. 20138 * 20139 * Use of this source code is governed by an MIT-style license that can be 20140 * found in the LICENSE file at https://angular.io/license 20141 */ 20142/** 20143 * A unique object used for retrieving items from the {@link ReflectiveInjector}. 20144 * 20145 * Keys have: 20146 * - a system-wide unique `id`. 20147 * - a `token`. 20148 * 20149 * `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows 20150 * the 20151 * injector to store created objects in a more efficient way. 20152 * 20153 * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when 20154 * resolving 20155 * providers. 20156 * 20157 * @deprecated No replacement 20158 * @publicApi 20159 */ 20160class ReflectiveKey { 20161 /** 20162 * Private 20163 */ 20164 constructor(token, id) { 20165 this.token = token; 20166 this.id = id; 20167 if (!token) { 20168 throw new Error('Token must be defined!'); 20169 } 20170 this.displayName = stringify(this.token); 20171 } 20172 /** 20173 * Retrieves a `Key` for a token. 20174 */ 20175 static get(token) { 20176 return _globalKeyRegistry.get(resolveForwardRef(token)); 20177 } 20178 /** 20179 * @returns the number of keys registered in the system. 20180 */ 20181 static get numberOfKeys() { 20182 return _globalKeyRegistry.numberOfKeys; 20183 } 20184} 20185class KeyRegistry { 20186 constructor() { 20187 this._allKeys = new Map(); 20188 } 20189 get(token) { 20190 if (token instanceof ReflectiveKey) 20191 return token; 20192 if (this._allKeys.has(token)) { 20193 return this._allKeys.get(token); 20194 } 20195 const newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys); 20196 this._allKeys.set(token, newKey); 20197 return newKey; 20198 } 20199 get numberOfKeys() { 20200 return this._allKeys.size; 20201 } 20202} 20203const _globalKeyRegistry = new KeyRegistry(); 20204 20205/** 20206 * @license 20207 * Copyright Google LLC All Rights Reserved. 20208 * 20209 * Use of this source code is governed by an MIT-style license that can be 20210 * found in the LICENSE file at https://angular.io/license 20211 */ 20212/** 20213 * Provides access to reflection data about symbols. Used internally by Angular 20214 * to power dependency injection and compilation. 20215 */ 20216class Reflector { 20217 constructor(reflectionCapabilities) { 20218 this.reflectionCapabilities = reflectionCapabilities; 20219 } 20220 updateCapabilities(caps) { 20221 this.reflectionCapabilities = caps; 20222 } 20223 factory(type) { 20224 return this.reflectionCapabilities.factory(type); 20225 } 20226 parameters(typeOrFunc) { 20227 return this.reflectionCapabilities.parameters(typeOrFunc); 20228 } 20229 annotations(typeOrFunc) { 20230 return this.reflectionCapabilities.annotations(typeOrFunc); 20231 } 20232 propMetadata(typeOrFunc) { 20233 return this.reflectionCapabilities.propMetadata(typeOrFunc); 20234 } 20235 hasLifecycleHook(type, lcProperty) { 20236 return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty); 20237 } 20238 getter(name) { 20239 return this.reflectionCapabilities.getter(name); 20240 } 20241 setter(name) { 20242 return this.reflectionCapabilities.setter(name); 20243 } 20244 method(name) { 20245 return this.reflectionCapabilities.method(name); 20246 } 20247 importUri(type) { 20248 return this.reflectionCapabilities.importUri(type); 20249 } 20250 resourceUri(type) { 20251 return this.reflectionCapabilities.resourceUri(type); 20252 } 20253 resolveIdentifier(name, moduleUrl, members, runtime) { 20254 return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime); 20255 } 20256 resolveEnum(identifier, name) { 20257 return this.reflectionCapabilities.resolveEnum(identifier, name); 20258 } 20259} 20260 20261/** 20262 * @license 20263 * Copyright Google LLC All Rights Reserved. 20264 * 20265 * Use of this source code is governed by an MIT-style license that can be 20266 * found in the LICENSE file at https://angular.io/license 20267 */ 20268/** 20269 * The {@link Reflector} used internally in Angular to access metadata 20270 * about symbols. 20271 */ 20272const reflector = new Reflector(new ReflectionCapabilities()); 20273 20274/** 20275 * @license 20276 * Copyright Google LLC All Rights Reserved. 20277 * 20278 * Use of this source code is governed by an MIT-style license that can be 20279 * found in the LICENSE file at https://angular.io/license 20280 */ 20281/** 20282 * `Dependency` is used by the framework to extend DI. 20283 * This is internal to Angular and should not be used directly. 20284 */ 20285class ReflectiveDependency { 20286 constructor(key, optional, visibility) { 20287 this.key = key; 20288 this.optional = optional; 20289 this.visibility = visibility; 20290 } 20291 static fromKey(key) { 20292 return new ReflectiveDependency(key, false, null); 20293 } 20294} 20295const _EMPTY_LIST = []; 20296class ResolvedReflectiveProvider_ { 20297 constructor(key, resolvedFactories, multiProvider) { 20298 this.key = key; 20299 this.resolvedFactories = resolvedFactories; 20300 this.multiProvider = multiProvider; 20301 this.resolvedFactory = this.resolvedFactories[0]; 20302 } 20303} 20304/** 20305 * An internal resolved representation of a factory function created by resolving `Provider`. 20306 * @publicApi 20307 */ 20308class ResolvedReflectiveFactory { 20309 constructor( 20310 /** 20311 * Factory function which can return an instance of an object represented by a key. 20312 */ 20313 factory, 20314 /** 20315 * Arguments (dependencies) to the `factory` function. 20316 */ 20317 dependencies) { 20318 this.factory = factory; 20319 this.dependencies = dependencies; 20320 } 20321} 20322/** 20323 * Resolve a single provider. 20324 */ 20325function resolveReflectiveFactory(provider) { 20326 let factoryFn; 20327 let resolvedDeps; 20328 if (provider.useClass) { 20329 const useClass = resolveForwardRef(provider.useClass); 20330 factoryFn = reflector.factory(useClass); 20331 resolvedDeps = _dependenciesFor(useClass); 20332 } 20333 else if (provider.useExisting) { 20334 factoryFn = (aliasInstance) => aliasInstance; 20335 resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))]; 20336 } 20337 else if (provider.useFactory) { 20338 factoryFn = provider.useFactory; 20339 resolvedDeps = constructDependencies(provider.useFactory, provider.deps); 20340 } 20341 else { 20342 factoryFn = () => provider.useValue; 20343 resolvedDeps = _EMPTY_LIST; 20344 } 20345 return new ResolvedReflectiveFactory(factoryFn, resolvedDeps); 20346} 20347/** 20348 * Converts the `Provider` into `ResolvedProvider`. 20349 * 20350 * `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider 20351 * syntax. 20352 */ 20353function resolveReflectiveProvider(provider) { 20354 return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false); 20355} 20356/** 20357 * Resolve a list of Providers. 20358 */ 20359function resolveReflectiveProviders(providers) { 20360 const normalized = _normalizeProviders(providers, []); 20361 const resolved = normalized.map(resolveReflectiveProvider); 20362 const resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map()); 20363 return Array.from(resolvedProviderMap.values()); 20364} 20365/** 20366 * Merges a list of ResolvedProviders into a list where each key is contained exactly once and 20367 * multi providers have been merged. 20368 */ 20369function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) { 20370 for (let i = 0; i < providers.length; i++) { 20371 const provider = providers[i]; 20372 const existing = normalizedProvidersMap.get(provider.key.id); 20373 if (existing) { 20374 if (provider.multiProvider !== existing.multiProvider) { 20375 throw mixingMultiProvidersWithRegularProvidersError(existing, provider); 20376 } 20377 if (provider.multiProvider) { 20378 for (let j = 0; j < provider.resolvedFactories.length; j++) { 20379 existing.resolvedFactories.push(provider.resolvedFactories[j]); 20380 } 20381 } 20382 else { 20383 normalizedProvidersMap.set(provider.key.id, provider); 20384 } 20385 } 20386 else { 20387 let resolvedProvider; 20388 if (provider.multiProvider) { 20389 resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider); 20390 } 20391 else { 20392 resolvedProvider = provider; 20393 } 20394 normalizedProvidersMap.set(provider.key.id, resolvedProvider); 20395 } 20396 } 20397 return normalizedProvidersMap; 20398} 20399function _normalizeProviders(providers, res) { 20400 providers.forEach(b => { 20401 if (b instanceof Type) { 20402 res.push({ provide: b, useClass: b }); 20403 } 20404 else if (b && typeof b == 'object' && b.provide !== undefined) { 20405 res.push(b); 20406 } 20407 else if (Array.isArray(b)) { 20408 _normalizeProviders(b, res); 20409 } 20410 else { 20411 throw invalidProviderError(b); 20412 } 20413 }); 20414 return res; 20415} 20416function constructDependencies(typeOrFunc, dependencies) { 20417 if (!dependencies) { 20418 return _dependenciesFor(typeOrFunc); 20419 } 20420 else { 20421 const params = dependencies.map(t => [t]); 20422 return dependencies.map(t => _extractToken(typeOrFunc, t, params)); 20423 } 20424} 20425function _dependenciesFor(typeOrFunc) { 20426 const params = reflector.parameters(typeOrFunc); 20427 if (!params) 20428 return []; 20429 if (params.some(p => p == null)) { 20430 throw noAnnotationError(typeOrFunc, params); 20431 } 20432 return params.map(p => _extractToken(typeOrFunc, p, params)); 20433} 20434function _extractToken(typeOrFunc, metadata, params) { 20435 let token = null; 20436 let optional = false; 20437 if (!Array.isArray(metadata)) { 20438 if (metadata instanceof Inject) { 20439 return _createDependency(metadata.token, optional, null); 20440 } 20441 else { 20442 return _createDependency(metadata, optional, null); 20443 } 20444 } 20445 let visibility = null; 20446 for (let i = 0; i < metadata.length; ++i) { 20447 const paramMetadata = metadata[i]; 20448 if (paramMetadata instanceof Type) { 20449 token = paramMetadata; 20450 } 20451 else if (paramMetadata instanceof Inject) { 20452 token = paramMetadata.token; 20453 } 20454 else if (paramMetadata instanceof Optional) { 20455 optional = true; 20456 } 20457 else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) { 20458 visibility = paramMetadata; 20459 } 20460 else if (paramMetadata instanceof InjectionToken) { 20461 token = paramMetadata; 20462 } 20463 } 20464 token = resolveForwardRef(token); 20465 if (token != null) { 20466 return _createDependency(token, optional, visibility); 20467 } 20468 else { 20469 throw noAnnotationError(typeOrFunc, params); 20470 } 20471} 20472function _createDependency(token, optional, visibility) { 20473 return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility); 20474} 20475 20476/** 20477 * @license 20478 * Copyright Google LLC All Rights Reserved. 20479 * 20480 * Use of this source code is governed by an MIT-style license that can be 20481 * found in the LICENSE file at https://angular.io/license 20482 */ 20483// Threshold for the dynamic version 20484const UNDEFINED = {}; 20485/** 20486 * A ReflectiveDependency injection container used for instantiating objects and resolving 20487 * dependencies. 20488 * 20489 * An `Injector` is a replacement for a `new` operator, which can automatically resolve the 20490 * constructor dependencies. 20491 * 20492 * In typical use, application code asks for the dependencies in the constructor and they are 20493 * resolved by the `Injector`. 20494 * 20495 * @usageNotes 20496 * ### Example 20497 * 20498 * The following example creates an `Injector` configured to create `Engine` and `Car`. 20499 * 20500 * ```typescript 20501 * @Injectable() 20502 * class Engine { 20503 * } 20504 * 20505 * @Injectable() 20506 * class Car { 20507 * constructor(public engine:Engine) {} 20508 * } 20509 * 20510 * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]); 20511 * var car = injector.get(Car); 20512 * expect(car instanceof Car).toBe(true); 20513 * expect(car.engine instanceof Engine).toBe(true); 20514 * ``` 20515 * 20516 * Notice, we don't use the `new` operator because we explicitly want to have the `Injector` 20517 * resolve all of the object's dependencies automatically. 20518 * 20519 * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead. 20520 * @publicApi 20521 */ 20522class ReflectiveInjector { 20523 /** 20524 * Turns an array of provider definitions into an array of resolved providers. 20525 * 20526 * A resolution is a process of flattening multiple nested arrays and converting individual 20527 * providers into an array of `ResolvedReflectiveProvider`s. 20528 * 20529 * @usageNotes 20530 * ### Example 20531 * 20532 * ```typescript 20533 * @Injectable() 20534 * class Engine { 20535 * } 20536 * 20537 * @Injectable() 20538 * class Car { 20539 * constructor(public engine:Engine) {} 20540 * } 20541 * 20542 * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]); 20543 * 20544 * expect(providers.length).toEqual(2); 20545 * 20546 * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true); 20547 * expect(providers[0].key.displayName).toBe("Car"); 20548 * expect(providers[0].dependencies.length).toEqual(1); 20549 * expect(providers[0].factory).toBeDefined(); 20550 * 20551 * expect(providers[1].key.displayName).toBe("Engine"); 20552 * }); 20553 * ``` 20554 * 20555 */ 20556 static resolve(providers) { 20557 return resolveReflectiveProviders(providers); 20558 } 20559 /** 20560 * Resolves an array of providers and creates an injector from those providers. 20561 * 20562 * The passed-in providers can be an array of `Type`, `Provider`, 20563 * or a recursive array of more providers. 20564 * 20565 * @usageNotes 20566 * ### Example 20567 * 20568 * ```typescript 20569 * @Injectable() 20570 * class Engine { 20571 * } 20572 * 20573 * @Injectable() 20574 * class Car { 20575 * constructor(public engine:Engine) {} 20576 * } 20577 * 20578 * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]); 20579 * expect(injector.get(Car) instanceof Car).toBe(true); 20580 * ``` 20581 */ 20582 static resolveAndCreate(providers, parent) { 20583 const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers); 20584 return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent); 20585 } 20586 /** 20587 * Creates an injector from previously resolved providers. 20588 * 20589 * This API is the recommended way to construct injectors in performance-sensitive parts. 20590 * 20591 * @usageNotes 20592 * ### Example 20593 * 20594 * ```typescript 20595 * @Injectable() 20596 * class Engine { 20597 * } 20598 * 20599 * @Injectable() 20600 * class Car { 20601 * constructor(public engine:Engine) {} 20602 * } 20603 * 20604 * var providers = ReflectiveInjector.resolve([Car, Engine]); 20605 * var injector = ReflectiveInjector.fromResolvedProviders(providers); 20606 * expect(injector.get(Car) instanceof Car).toBe(true); 20607 * ``` 20608 */ 20609 static fromResolvedProviders(providers, parent) { 20610 return new ReflectiveInjector_(providers, parent); 20611 } 20612} 20613class ReflectiveInjector_ { 20614 /** 20615 * Private 20616 */ 20617 constructor(_providers, _parent) { 20618 /** @internal */ 20619 this._constructionCounter = 0; 20620 this._providers = _providers; 20621 this.parent = _parent || null; 20622 const len = _providers.length; 20623 this.keyIds = []; 20624 this.objs = []; 20625 for (let i = 0; i < len; i++) { 20626 this.keyIds[i] = _providers[i].key.id; 20627 this.objs[i] = UNDEFINED; 20628 } 20629 } 20630 get(token, notFoundValue = THROW_IF_NOT_FOUND) { 20631 return this._getByKey(ReflectiveKey.get(token), null, notFoundValue); 20632 } 20633 resolveAndCreateChild(providers) { 20634 const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers); 20635 return this.createChildFromResolved(ResolvedReflectiveProviders); 20636 } 20637 createChildFromResolved(providers) { 20638 const inj = new ReflectiveInjector_(providers); 20639 inj.parent = this; 20640 return inj; 20641 } 20642 resolveAndInstantiate(provider) { 20643 return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]); 20644 } 20645 instantiateResolved(provider) { 20646 return this._instantiateProvider(provider); 20647 } 20648 getProviderAtIndex(index) { 20649 if (index < 0 || index >= this._providers.length) { 20650 throw outOfBoundsError(index); 20651 } 20652 return this._providers[index]; 20653 } 20654 /** @internal */ 20655 _new(provider) { 20656 if (this._constructionCounter++ > this._getMaxNumberOfObjects()) { 20657 throw cyclicDependencyError(this, provider.key); 20658 } 20659 return this._instantiateProvider(provider); 20660 } 20661 _getMaxNumberOfObjects() { 20662 return this.objs.length; 20663 } 20664 _instantiateProvider(provider) { 20665 if (provider.multiProvider) { 20666 const res = []; 20667 for (let i = 0; i < provider.resolvedFactories.length; ++i) { 20668 res[i] = this._instantiate(provider, provider.resolvedFactories[i]); 20669 } 20670 return res; 20671 } 20672 else { 20673 return this._instantiate(provider, provider.resolvedFactories[0]); 20674 } 20675 } 20676 _instantiate(provider, ResolvedReflectiveFactory) { 20677 const factory = ResolvedReflectiveFactory.factory; 20678 let deps; 20679 try { 20680 deps = 20681 ResolvedReflectiveFactory.dependencies.map(dep => this._getByReflectiveDependency(dep)); 20682 } 20683 catch (e) { 20684 if (e.addKey) { 20685 e.addKey(this, provider.key); 20686 } 20687 throw e; 20688 } 20689 let obj; 20690 try { 20691 obj = factory(...deps); 20692 } 20693 catch (e) { 20694 throw instantiationError(this, e, e.stack, provider.key); 20695 } 20696 return obj; 20697 } 20698 _getByReflectiveDependency(dep) { 20699 return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND); 20700 } 20701 _getByKey(key, visibility, notFoundValue) { 20702 if (key === ReflectiveInjector_.INJECTOR_KEY) { 20703 return this; 20704 } 20705 if (visibility instanceof Self) { 20706 return this._getByKeySelf(key, notFoundValue); 20707 } 20708 else { 20709 return this._getByKeyDefault(key, notFoundValue, visibility); 20710 } 20711 } 20712 _getObjByKeyId(keyId) { 20713 for (let i = 0; i < this.keyIds.length; i++) { 20714 if (this.keyIds[i] === keyId) { 20715 if (this.objs[i] === UNDEFINED) { 20716 this.objs[i] = this._new(this._providers[i]); 20717 } 20718 return this.objs[i]; 20719 } 20720 } 20721 return UNDEFINED; 20722 } 20723 /** @internal */ 20724 _throwOrNull(key, notFoundValue) { 20725 if (notFoundValue !== THROW_IF_NOT_FOUND) { 20726 return notFoundValue; 20727 } 20728 else { 20729 throw noProviderError(this, key); 20730 } 20731 } 20732 /** @internal */ 20733 _getByKeySelf(key, notFoundValue) { 20734 const obj = this._getObjByKeyId(key.id); 20735 return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue); 20736 } 20737 /** @internal */ 20738 _getByKeyDefault(key, notFoundValue, visibility) { 20739 let inj; 20740 if (visibility instanceof SkipSelf) { 20741 inj = this.parent; 20742 } 20743 else { 20744 inj = this; 20745 } 20746 while (inj instanceof ReflectiveInjector_) { 20747 const inj_ = inj; 20748 const obj = inj_._getObjByKeyId(key.id); 20749 if (obj !== UNDEFINED) 20750 return obj; 20751 inj = inj_.parent; 20752 } 20753 if (inj !== null) { 20754 return inj.get(key.token, notFoundValue); 20755 } 20756 else { 20757 return this._throwOrNull(key, notFoundValue); 20758 } 20759 } 20760 get displayName() { 20761 const providers = _mapProviders(this, (b) => ' "' + b.key.displayName + '" ') 20762 .join(', '); 20763 return `ReflectiveInjector(providers: [${providers}])`; 20764 } 20765 toString() { 20766 return this.displayName; 20767 } 20768} 20769ReflectiveInjector_.INJECTOR_KEY = ReflectiveKey.get(Injector); 20770function _mapProviders(injector, fn) { 20771 const res = []; 20772 for (let i = 0; i < injector._providers.length; ++i) { 20773 res[i] = fn(injector.getProviderAtIndex(i)); 20774 } 20775 return res; 20776} 20777 20778/** 20779 * @license 20780 * Copyright Google LLC All Rights Reserved. 20781 * 20782 * Use of this source code is governed by an MIT-style license that can be 20783 * found in the LICENSE file at https://angular.io/license 20784 */ 20785 20786/** 20787 * @license 20788 * Copyright Google LLC All Rights Reserved. 20789 * 20790 * Use of this source code is governed by an MIT-style license that can be 20791 * found in the LICENSE file at https://angular.io/license 20792 */ 20793 20794/** 20795 * @license 20796 * Copyright Google LLC All Rights Reserved. 20797 * 20798 * Use of this source code is governed by an MIT-style license that can be 20799 * found in the LICENSE file at https://angular.io/license 20800 */ 20801/** 20802 * A DI token that you can use to create a virtual [provider](guide/glossary#provider) 20803 * that will populate the `entryComponents` field of components and NgModules 20804 * based on its `useValue` property value. 20805 * All components that are referenced in the `useValue` value (either directly 20806 * or in a nested array or map) are added to the `entryComponents` property. 20807 * 20808 * @usageNotes 20809 * 20810 * The following example shows how the router can populate the `entryComponents` 20811 * field of an NgModule based on a router configuration that refers 20812 * to components. 20813 * 20814 * ```typescript 20815 * // helper function inside the router 20816 * function provideRoutes(routes) { 20817 * return [ 20818 * {provide: ROUTES, useValue: routes}, 20819 * {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true} 20820 * ]; 20821 * } 20822 * 20823 * // user code 20824 * let routes = [ 20825 * {path: '/root', component: RootComp}, 20826 * {path: '/teams', component: TeamsComp} 20827 * ]; 20828 * 20829 * @NgModule({ 20830 * providers: [provideRoutes(routes)] 20831 * }) 20832 * class ModuleWithRoutes {} 20833 * ``` 20834 * 20835 * @publicApi 20836 * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary. 20837 */ 20838const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents'); 20839/** 20840 * Base class for query metadata. 20841 * 20842 * @see `ContentChildren`. 20843 * @see `ContentChild`. 20844 * @see `ViewChildren`. 20845 * @see `ViewChild`. 20846 * 20847 * @publicApi 20848 */ 20849class Query { 20850} 20851const ɵ0$a = (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: false, descendants: false }, data)); 20852/** 20853 * ContentChildren decorator and metadata. 20854 * 20855 * 20856 * @Annotation 20857 * @publicApi 20858 */ 20859const ContentChildren = makePropDecorator('ContentChildren', ɵ0$a, Query); 20860const ɵ1$2 = (selector, data = {}) => (Object.assign({ selector, first: true, isViewQuery: false, descendants: true }, data)); 20861/** 20862 * ContentChild decorator and metadata. 20863 * 20864 * 20865 * @Annotation 20866 * 20867 * @publicApi 20868 */ 20869const ContentChild = makePropDecorator('ContentChild', ɵ1$2, Query); 20870const ɵ2 = (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: true, descendants: true }, data)); 20871/** 20872 * ViewChildren decorator and metadata. 20873 * 20874 * @Annotation 20875 * @publicApi 20876 */ 20877const ViewChildren = makePropDecorator('ViewChildren', ɵ2, Query); 20878const ɵ3 = (selector, data) => (Object.assign({ selector, first: true, isViewQuery: true, descendants: true }, data)); 20879/** 20880 * ViewChild decorator and metadata. 20881 * 20882 * @Annotation 20883 * @publicApi 20884 */ 20885const ViewChild = makePropDecorator('ViewChild', ɵ3, Query); 20886 20887/** 20888 * @license 20889 * Copyright Google LLC All Rights Reserved. 20890 * 20891 * Use of this source code is governed by an MIT-style license that can be 20892 * found in the LICENSE file at https://angular.io/license 20893 */ 20894/** 20895 * Used to resolve resource URLs on `@Component` when used with JIT compilation. 20896 * 20897 * Example: 20898 * ``` 20899 * @Component({ 20900 * selector: 'my-comp', 20901 * templateUrl: 'my-comp.html', // This requires asynchronous resolution 20902 * }) 20903 * class MyComponent{ 20904 * } 20905 * 20906 * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process 20907 * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously. 20908 * 20909 * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into 20910 * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner. 20911 * 20912 * // Use browser's `fetch()` function as the default resource resolution strategy. 20913 * resolveComponentResources(fetch).then(() => { 20914 * // After resolution all URLs have been converted into `template` strings. 20915 * renderComponent(MyComponent); 20916 * }); 20917 * 20918 * ``` 20919 * 20920 * NOTE: In AOT the resolution happens during compilation, and so there should be no need 20921 * to call this method outside JIT mode. 20922 * 20923 * @param resourceResolver a function which is responsible for returning a `Promise` to the 20924 * contents of the resolved URL. Browser's `fetch()` method is a good default implementation. 20925 */ 20926function resolveComponentResources(resourceResolver) { 20927 // Store all promises which are fetching the resources. 20928 const componentResolved = []; 20929 // Cache so that we don't fetch the same resource more than once. 20930 const urlMap = new Map(); 20931 function cachedResourceResolve(url) { 20932 let promise = urlMap.get(url); 20933 if (!promise) { 20934 const resp = resourceResolver(url); 20935 urlMap.set(url, promise = resp.then(unwrapResponse)); 20936 } 20937 return promise; 20938 } 20939 componentResourceResolutionQueue.forEach((component, type) => { 20940 const promises = []; 20941 if (component.templateUrl) { 20942 promises.push(cachedResourceResolve(component.templateUrl).then((template) => { 20943 component.template = template; 20944 })); 20945 } 20946 const styleUrls = component.styleUrls; 20947 const styles = component.styles || (component.styles = []); 20948 const styleOffset = component.styles.length; 20949 styleUrls && styleUrls.forEach((styleUrl, index) => { 20950 styles.push(''); // pre-allocate array. 20951 promises.push(cachedResourceResolve(styleUrl).then((style) => { 20952 styles[styleOffset + index] = style; 20953 styleUrls.splice(styleUrls.indexOf(styleUrl), 1); 20954 if (styleUrls.length == 0) { 20955 component.styleUrls = undefined; 20956 } 20957 })); 20958 }); 20959 const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type)); 20960 componentResolved.push(fullyResolved); 20961 }); 20962 clearResolutionOfComponentResourcesQueue(); 20963 return Promise.all(componentResolved).then(() => undefined); 20964} 20965let componentResourceResolutionQueue = new Map(); 20966// Track when existing ɵcmp for a Type is waiting on resources. 20967const componentDefPendingResolution = new Set(); 20968function maybeQueueResolutionOfComponentResources(type, metadata) { 20969 if (componentNeedsResolution(metadata)) { 20970 componentResourceResolutionQueue.set(type, metadata); 20971 componentDefPendingResolution.add(type); 20972 } 20973} 20974function isComponentDefPendingResolution(type) { 20975 return componentDefPendingResolution.has(type); 20976} 20977function componentNeedsResolution(component) { 20978 return !!((component.templateUrl && !component.hasOwnProperty('template')) || 20979 component.styleUrls && component.styleUrls.length); 20980} 20981function clearResolutionOfComponentResourcesQueue() { 20982 const old = componentResourceResolutionQueue; 20983 componentResourceResolutionQueue = new Map(); 20984 return old; 20985} 20986function restoreComponentResolutionQueue(queue) { 20987 componentDefPendingResolution.clear(); 20988 queue.forEach((_, type) => componentDefPendingResolution.add(type)); 20989 componentResourceResolutionQueue = queue; 20990} 20991function isComponentResourceResolutionQueueEmpty() { 20992 return componentResourceResolutionQueue.size === 0; 20993} 20994function unwrapResponse(response) { 20995 return typeof response == 'string' ? response : response.text(); 20996} 20997function componentDefResolved(type) { 20998 componentDefPendingResolution.delete(type); 20999} 21000 21001/** 21002 * @license 21003 * Copyright Google LLC All Rights Reserved. 21004 * 21005 * Use of this source code is governed by an MIT-style license that can be 21006 * found in the LICENSE file at https://angular.io/license 21007 */ 21008/** 21009 * Compute the static styling (class/style) from `TAttributes`. 21010 * 21011 * This function should be called during `firstCreatePass` only. 21012 * 21013 * @param tNode The `TNode` into which the styling information should be loaded. 21014 * @param attrs `TAttributes` containing the styling information. 21015 * @param writeToHost Where should the resulting static styles be written? 21016 * - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost` 21017 * - `true` Write to `TNode.styles` / `TNode.classes` 21018 */ 21019function computeStaticStyling(tNode, attrs, writeToHost) { 21020 ngDevMode && 21021 assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only'); 21022 let styles = writeToHost ? tNode.styles : null; 21023 let classes = writeToHost ? tNode.classes : null; 21024 let mode = 0; 21025 if (attrs !== null) { 21026 for (let i = 0; i < attrs.length; i++) { 21027 const value = attrs[i]; 21028 if (typeof value === 'number') { 21029 mode = value; 21030 } 21031 else if (mode == 1 /* Classes */) { 21032 classes = concatStringsWithSpace(classes, value); 21033 } 21034 else if (mode == 2 /* Styles */) { 21035 const style = value; 21036 const styleValue = attrs[++i]; 21037 styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';'); 21038 } 21039 } 21040 } 21041 writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles; 21042 writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes; 21043} 21044 21045/** 21046 * @license 21047 * Copyright Google LLC All Rights Reserved. 21048 * 21049 * Use of this source code is governed by an MIT-style license that can be 21050 * found in the LICENSE file at https://angular.io/license 21051 */ 21052let _symbolIterator = null; 21053function getSymbolIterator() { 21054 if (!_symbolIterator) { 21055 const Symbol = _global['Symbol']; 21056 if (Symbol && Symbol.iterator) { 21057 _symbolIterator = Symbol.iterator; 21058 } 21059 else { 21060 // es6-shim specific logic 21061 const keys = Object.getOwnPropertyNames(Map.prototype); 21062 for (let i = 0; i < keys.length; ++i) { 21063 const key = keys[i]; 21064 if (key !== 'entries' && key !== 'size' && 21065 Map.prototype[key] === Map.prototype['entries']) { 21066 _symbolIterator = key; 21067 } 21068 } 21069 } 21070 } 21071 return _symbolIterator; 21072} 21073 21074/** 21075 * @license 21076 * Copyright Google LLC All Rights Reserved. 21077 * 21078 * Use of this source code is governed by an MIT-style license that can be 21079 * found in the LICENSE file at https://angular.io/license 21080 */ 21081function devModeEqual(a, b) { 21082 const isListLikeIterableA = isListLikeIterable(a); 21083 const isListLikeIterableB = isListLikeIterable(b); 21084 if (isListLikeIterableA && isListLikeIterableB) { 21085 return areIterablesEqual(a, b, devModeEqual); 21086 } 21087 else { 21088 const isAObject = a && (typeof a === 'object' || typeof a === 'function'); 21089 const isBObject = b && (typeof b === 'object' || typeof b === 'function'); 21090 if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) { 21091 return true; 21092 } 21093 else { 21094 return Object.is(a, b); 21095 } 21096 } 21097} 21098/** 21099 * Indicates that the result of a {@link Pipe} transformation has changed even though the 21100 * reference has not changed. 21101 * 21102 * Wrapped values are unwrapped automatically during the change detection, and the unwrapped value 21103 * is stored. 21104 * 21105 * Example: 21106 * 21107 * ``` 21108 * if (this._latestValue === this._latestReturnedValue) { 21109 * return this._latestReturnedValue; 21110 * } else { 21111 * this._latestReturnedValue = this._latestValue; 21112 * return WrappedValue.wrap(this._latestValue); // this will force update 21113 * } 21114 * ``` 21115 * 21116 * @publicApi 21117 * @deprecated from v10 stop using. (No replacement, deemed unnecessary.) 21118 */ 21119class WrappedValue { 21120 constructor(value) { 21121 this.wrapped = value; 21122 } 21123 /** Creates a wrapped value. */ 21124 static wrap(value) { 21125 return new WrappedValue(value); 21126 } 21127 /** 21128 * Returns the underlying value of a wrapped value. 21129 * Returns the given `value` when it is not wrapped. 21130 **/ 21131 static unwrap(value) { 21132 return WrappedValue.isWrapped(value) ? value.wrapped : value; 21133 } 21134 /** Returns true if `value` is a wrapped value. */ 21135 static isWrapped(value) { 21136 return value instanceof WrappedValue; 21137 } 21138} 21139function isListLikeIterable(obj) { 21140 if (!isJsObject(obj)) 21141 return false; 21142 return Array.isArray(obj) || 21143 (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v] 21144 getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop 21145} 21146function areIterablesEqual(a, b, comparator) { 21147 const iterator1 = a[getSymbolIterator()](); 21148 const iterator2 = b[getSymbolIterator()](); 21149 while (true) { 21150 const item1 = iterator1.next(); 21151 const item2 = iterator2.next(); 21152 if (item1.done && item2.done) 21153 return true; 21154 if (item1.done || item2.done) 21155 return false; 21156 if (!comparator(item1.value, item2.value)) 21157 return false; 21158 } 21159} 21160function iterateListLike(obj, fn) { 21161 if (Array.isArray(obj)) { 21162 for (let i = 0; i < obj.length; i++) { 21163 fn(obj[i]); 21164 } 21165 } 21166 else { 21167 const iterator = obj[getSymbolIterator()](); 21168 let item; 21169 while (!((item = iterator.next()).done)) { 21170 fn(item.value); 21171 } 21172 } 21173} 21174function isJsObject(o) { 21175 return o !== null && (typeof o === 'function' || typeof o === 'object'); 21176} 21177 21178/** 21179 * @license 21180 * Copyright Google LLC All Rights Reserved. 21181 * 21182 * Use of this source code is governed by an MIT-style license that can be 21183 * found in the LICENSE file at https://angular.io/license 21184 */ 21185// TODO(misko): consider inlining 21186/** Updates binding and returns the value. */ 21187function updateBinding(lView, bindingIndex, value) { 21188 return lView[bindingIndex] = value; 21189} 21190/** Gets the current binding value. */ 21191function getBinding(lView, bindingIndex) { 21192 ngDevMode && assertIndexInRange(lView, bindingIndex); 21193 ngDevMode && 21194 assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.'); 21195 return lView[bindingIndex]; 21196} 21197/** 21198 * Updates binding if changed, then returns whether it was updated. 21199 * 21200 * This function also checks the `CheckNoChangesMode` and throws if changes are made. 21201 * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE 21202 * behavior. 21203 * 21204 * @param lView current `LView` 21205 * @param bindingIndex The binding in the `LView` to check 21206 * @param value New value to check against `lView[bindingIndex]` 21207 * @returns `true` if the bindings has changed. (Throws if binding has changed during 21208 * `CheckNoChangesMode`) 21209 */ 21210function bindingUpdated(lView, bindingIndex, value) { 21211 ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.'); 21212 ngDevMode && 21213 assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`); 21214 const oldValue = lView[bindingIndex]; 21215 if (Object.is(oldValue, value)) { 21216 return false; 21217 } 21218 else { 21219 if (ngDevMode && getCheckNoChangesMode()) { 21220 // View engine didn't report undefined values as changed on the first checkNoChanges pass 21221 // (before the change detection was run). 21222 const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined; 21223 if (!devModeEqual(oldValueToCompare, value)) { 21224 const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value); 21225 throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName); 21226 } 21227 // There was a change, but the `devModeEqual` decided that the change is exempt from an error. 21228 // For this reason we exit as if no change. The early exit is needed to prevent the changed 21229 // value to be written into `LView` (If we would write the new value that we would not see it 21230 // as change on next CD.) 21231 return false; 21232 } 21233 lView[bindingIndex] = value; 21234 return true; 21235 } 21236} 21237/** Updates 2 bindings if changed, then returns whether either was updated. */ 21238function bindingUpdated2(lView, bindingIndex, exp1, exp2) { 21239 const different = bindingUpdated(lView, bindingIndex, exp1); 21240 return bindingUpdated(lView, bindingIndex + 1, exp2) || different; 21241} 21242/** Updates 3 bindings if changed, then returns whether any was updated. */ 21243function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) { 21244 const different = bindingUpdated2(lView, bindingIndex, exp1, exp2); 21245 return bindingUpdated(lView, bindingIndex + 2, exp3) || different; 21246} 21247/** Updates 4 bindings if changed, then returns whether any was updated. */ 21248function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) { 21249 const different = bindingUpdated2(lView, bindingIndex, exp1, exp2); 21250 return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different; 21251} 21252 21253/** 21254 * @license 21255 * Copyright Google LLC All Rights Reserved. 21256 * 21257 * Use of this source code is governed by an MIT-style license that can be 21258 * found in the LICENSE file at https://angular.io/license 21259 */ 21260/** 21261 * Updates the value of or removes a bound attribute on an Element. 21262 * 21263 * Used in the case of `[attr.title]="value"` 21264 * 21265 * @param name name The name of the attribute. 21266 * @param value value The attribute is removed when value is `null` or `undefined`. 21267 * Otherwise the attribute value is set to the stringified value. 21268 * @param sanitizer An optional function used to sanitize the value. 21269 * @param namespace Optional namespace to use when setting the attribute. 21270 * 21271 * @codeGenApi 21272 */ 21273function ɵɵattribute(name, value, sanitizer, namespace) { 21274 const lView = getLView(); 21275 const bindingIndex = nextBindingIndex(); 21276 if (bindingUpdated(lView, bindingIndex, value)) { 21277 const tView = getTView(); 21278 const tNode = getSelectedTNode(); 21279 elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace); 21280 ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex); 21281 } 21282 return ɵɵattribute; 21283} 21284 21285/** 21286 * @license 21287 * Copyright Google LLC All Rights Reserved. 21288 * 21289 * Use of this source code is governed by an MIT-style license that can be 21290 * found in the LICENSE file at https://angular.io/license 21291 */ 21292/** 21293 * Create interpolation bindings with a variable number of expressions. 21294 * 21295 * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead. 21296 * Those are faster because there is no need to create an array of expressions and iterate over it. 21297 * 21298 * `values`: 21299 * - has static text at even indexes, 21300 * - has evaluated expressions at odd indexes. 21301 * 21302 * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise. 21303 */ 21304function interpolationV(lView, values) { 21305 ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values'); 21306 ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values'); 21307 let isBindingUpdated = false; 21308 let bindingIndex = getBindingIndex(); 21309 for (let i = 1; i < values.length; i += 2) { 21310 // Check if bindings (odd indexes) have changed 21311 isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated; 21312 } 21313 setBindingIndex(bindingIndex); 21314 if (!isBindingUpdated) { 21315 return NO_CHANGE; 21316 } 21317 // Build the updated content 21318 let content = values[0]; 21319 for (let i = 1; i < values.length; i += 2) { 21320 content += renderStringify(values[i]) + values[i + 1]; 21321 } 21322 return content; 21323} 21324/** 21325 * Creates an interpolation binding with 1 expression. 21326 * 21327 * @param prefix static value used for concatenation only. 21328 * @param v0 value checked for change. 21329 * @param suffix static value used for concatenation only. 21330 */ 21331function interpolation1(lView, prefix, v0, suffix) { 21332 const different = bindingUpdated(lView, nextBindingIndex(), v0); 21333 return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE; 21334} 21335/** 21336 * Creates an interpolation binding with 2 expressions. 21337 */ 21338function interpolation2(lView, prefix, v0, i0, v1, suffix) { 21339 const bindingIndex = getBindingIndex(); 21340 const different = bindingUpdated2(lView, bindingIndex, v0, v1); 21341 incrementBindingIndex(2); 21342 return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE; 21343} 21344/** 21345 * Creates an interpolation binding with 3 expressions. 21346 */ 21347function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) { 21348 const bindingIndex = getBindingIndex(); 21349 const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2); 21350 incrementBindingIndex(3); 21351 return different ? 21352 prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix : 21353 NO_CHANGE; 21354} 21355/** 21356 * Create an interpolation binding with 4 expressions. 21357 */ 21358function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) { 21359 const bindingIndex = getBindingIndex(); 21360 const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3); 21361 incrementBindingIndex(4); 21362 return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + 21363 renderStringify(v2) + i2 + renderStringify(v3) + suffix : 21364 NO_CHANGE; 21365} 21366/** 21367 * Creates an interpolation binding with 5 expressions. 21368 */ 21369function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) { 21370 const bindingIndex = getBindingIndex(); 21371 let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3); 21372 different = bindingUpdated(lView, bindingIndex + 4, v4) || different; 21373 incrementBindingIndex(5); 21374 return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + 21375 renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix : 21376 NO_CHANGE; 21377} 21378/** 21379 * Creates an interpolation binding with 6 expressions. 21380 */ 21381function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) { 21382 const bindingIndex = getBindingIndex(); 21383 let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3); 21384 different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different; 21385 incrementBindingIndex(6); 21386 return different ? 21387 prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + 21388 renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix : 21389 NO_CHANGE; 21390} 21391/** 21392 * Creates an interpolation binding with 7 expressions. 21393 */ 21394function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) { 21395 const bindingIndex = getBindingIndex(); 21396 let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3); 21397 different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different; 21398 incrementBindingIndex(7); 21399 return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + 21400 renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + 21401 renderStringify(v5) + i5 + renderStringify(v6) + suffix : 21402 NO_CHANGE; 21403} 21404/** 21405 * Creates an interpolation binding with 8 expressions. 21406 */ 21407function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) { 21408 const bindingIndex = getBindingIndex(); 21409 let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3); 21410 different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different; 21411 incrementBindingIndex(8); 21412 return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + 21413 renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + 21414 renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix : 21415 NO_CHANGE; 21416} 21417 21418/** 21419 * 21420 * Update an interpolated attribute on an element with single bound value surrounded by text. 21421 * 21422 * Used when the value passed to a property has 1 interpolated value in it: 21423 * 21424 * ```html 21425 * <div attr.title="prefix{{v0}}suffix"></div> 21426 * ``` 21427 * 21428 * Its compiled representation is:: 21429 * 21430 * ```ts 21431 * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix'); 21432 * ``` 21433 * 21434 * @param attrName The name of the attribute to update 21435 * @param prefix Static value used for concatenation only. 21436 * @param v0 Value checked for change. 21437 * @param suffix Static value used for concatenation only. 21438 * @param sanitizer An optional sanitizer function 21439 * @returns itself, so that it may be chained. 21440 * @codeGenApi 21441 */ 21442function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) { 21443 const lView = getLView(); 21444 const interpolatedValue = interpolation1(lView, prefix, v0, suffix); 21445 if (interpolatedValue !== NO_CHANGE) { 21446 const tNode = getSelectedTNode(); 21447 elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace); 21448 ngDevMode && 21449 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix); 21450 } 21451 return ɵɵattributeInterpolate1; 21452} 21453/** 21454 * 21455 * Update an interpolated attribute on an element with 2 bound values surrounded by text. 21456 * 21457 * Used when the value passed to a property has 2 interpolated values in it: 21458 * 21459 * ```html 21460 * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div> 21461 * ``` 21462 * 21463 * Its compiled representation is:: 21464 * 21465 * ```ts 21466 * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix'); 21467 * ``` 21468 * 21469 * @param attrName The name of the attribute to update 21470 * @param prefix Static value used for concatenation only. 21471 * @param v0 Value checked for change. 21472 * @param i0 Static value used for concatenation only. 21473 * @param v1 Value checked for change. 21474 * @param suffix Static value used for concatenation only. 21475 * @param sanitizer An optional sanitizer function 21476 * @returns itself, so that it may be chained. 21477 * @codeGenApi 21478 */ 21479function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) { 21480 const lView = getLView(); 21481 const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix); 21482 if (interpolatedValue !== NO_CHANGE) { 21483 const tNode = getSelectedTNode(); 21484 elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace); 21485 ngDevMode && 21486 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix); 21487 } 21488 return ɵɵattributeInterpolate2; 21489} 21490/** 21491 * 21492 * Update an interpolated attribute on an element with 3 bound values surrounded by text. 21493 * 21494 * Used when the value passed to a property has 3 interpolated values in it: 21495 * 21496 * ```html 21497 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div> 21498 * ``` 21499 * 21500 * Its compiled representation is:: 21501 * 21502 * ```ts 21503 * ɵɵattributeInterpolate3( 21504 * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix'); 21505 * ``` 21506 * 21507 * @param attrName The name of the attribute to update 21508 * @param prefix Static value used for concatenation only. 21509 * @param v0 Value checked for change. 21510 * @param i0 Static value used for concatenation only. 21511 * @param v1 Value checked for change. 21512 * @param i1 Static value used for concatenation only. 21513 * @param v2 Value checked for change. 21514 * @param suffix Static value used for concatenation only. 21515 * @param sanitizer An optional sanitizer function 21516 * @returns itself, so that it may be chained. 21517 * @codeGenApi 21518 */ 21519function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) { 21520 const lView = getLView(); 21521 const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix); 21522 if (interpolatedValue !== NO_CHANGE) { 21523 const tNode = getSelectedTNode(); 21524 elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace); 21525 ngDevMode && 21526 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix); 21527 } 21528 return ɵɵattributeInterpolate3; 21529} 21530/** 21531 * 21532 * Update an interpolated attribute on an element with 4 bound values surrounded by text. 21533 * 21534 * Used when the value passed to a property has 4 interpolated values in it: 21535 * 21536 * ```html 21537 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div> 21538 * ``` 21539 * 21540 * Its compiled representation is:: 21541 * 21542 * ```ts 21543 * ɵɵattributeInterpolate4( 21544 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix'); 21545 * ``` 21546 * 21547 * @param attrName The name of the attribute to update 21548 * @param prefix Static value used for concatenation only. 21549 * @param v0 Value checked for change. 21550 * @param i0 Static value used for concatenation only. 21551 * @param v1 Value checked for change. 21552 * @param i1 Static value used for concatenation only. 21553 * @param v2 Value checked for change. 21554 * @param i2 Static value used for concatenation only. 21555 * @param v3 Value checked for change. 21556 * @param suffix Static value used for concatenation only. 21557 * @param sanitizer An optional sanitizer function 21558 * @returns itself, so that it may be chained. 21559 * @codeGenApi 21560 */ 21561function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) { 21562 const lView = getLView(); 21563 const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix); 21564 if (interpolatedValue !== NO_CHANGE) { 21565 const tNode = getSelectedTNode(); 21566 elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace); 21567 ngDevMode && 21568 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix); 21569 } 21570 return ɵɵattributeInterpolate4; 21571} 21572/** 21573 * 21574 * Update an interpolated attribute on an element with 5 bound values surrounded by text. 21575 * 21576 * Used when the value passed to a property has 5 interpolated values in it: 21577 * 21578 * ```html 21579 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div> 21580 * ``` 21581 * 21582 * Its compiled representation is:: 21583 * 21584 * ```ts 21585 * ɵɵattributeInterpolate5( 21586 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix'); 21587 * ``` 21588 * 21589 * @param attrName The name of the attribute to update 21590 * @param prefix Static value used for concatenation only. 21591 * @param v0 Value checked for change. 21592 * @param i0 Static value used for concatenation only. 21593 * @param v1 Value checked for change. 21594 * @param i1 Static value used for concatenation only. 21595 * @param v2 Value checked for change. 21596 * @param i2 Static value used for concatenation only. 21597 * @param v3 Value checked for change. 21598 * @param i3 Static value used for concatenation only. 21599 * @param v4 Value checked for change. 21600 * @param suffix Static value used for concatenation only. 21601 * @param sanitizer An optional sanitizer function 21602 * @returns itself, so that it may be chained. 21603 * @codeGenApi 21604 */ 21605function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) { 21606 const lView = getLView(); 21607 const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix); 21608 if (interpolatedValue !== NO_CHANGE) { 21609 const tNode = getSelectedTNode(); 21610 elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace); 21611 ngDevMode && 21612 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix); 21613 } 21614 return ɵɵattributeInterpolate5; 21615} 21616/** 21617 * 21618 * Update an interpolated attribute on an element with 6 bound values surrounded by text. 21619 * 21620 * Used when the value passed to a property has 6 interpolated values in it: 21621 * 21622 * ```html 21623 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div> 21624 * ``` 21625 * 21626 * Its compiled representation is:: 21627 * 21628 * ```ts 21629 * ɵɵattributeInterpolate6( 21630 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix'); 21631 * ``` 21632 * 21633 * @param attrName The name of the attribute to update 21634 * @param prefix Static value used for concatenation only. 21635 * @param v0 Value checked for change. 21636 * @param i0 Static value used for concatenation only. 21637 * @param v1 Value checked for change. 21638 * @param i1 Static value used for concatenation only. 21639 * @param v2 Value checked for change. 21640 * @param i2 Static value used for concatenation only. 21641 * @param v3 Value checked for change. 21642 * @param i3 Static value used for concatenation only. 21643 * @param v4 Value checked for change. 21644 * @param i4 Static value used for concatenation only. 21645 * @param v5 Value checked for change. 21646 * @param suffix Static value used for concatenation only. 21647 * @param sanitizer An optional sanitizer function 21648 * @returns itself, so that it may be chained. 21649 * @codeGenApi 21650 */ 21651function ɵɵattributeInterpolate6(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer, namespace) { 21652 const lView = getLView(); 21653 const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix); 21654 if (interpolatedValue !== NO_CHANGE) { 21655 const tNode = getSelectedTNode(); 21656 elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace); 21657 ngDevMode && 21658 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix); 21659 } 21660 return ɵɵattributeInterpolate6; 21661} 21662/** 21663 * 21664 * Update an interpolated attribute on an element with 7 bound values surrounded by text. 21665 * 21666 * Used when the value passed to a property has 7 interpolated values in it: 21667 * 21668 * ```html 21669 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div> 21670 * ``` 21671 * 21672 * Its compiled representation is:: 21673 * 21674 * ```ts 21675 * ɵɵattributeInterpolate7( 21676 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix'); 21677 * ``` 21678 * 21679 * @param attrName The name of the attribute to update 21680 * @param prefix Static value used for concatenation only. 21681 * @param v0 Value checked for change. 21682 * @param i0 Static value used for concatenation only. 21683 * @param v1 Value checked for change. 21684 * @param i1 Static value used for concatenation only. 21685 * @param v2 Value checked for change. 21686 * @param i2 Static value used for concatenation only. 21687 * @param v3 Value checked for change. 21688 * @param i3 Static value used for concatenation only. 21689 * @param v4 Value checked for change. 21690 * @param i4 Static value used for concatenation only. 21691 * @param v5 Value checked for change. 21692 * @param i5 Static value used for concatenation only. 21693 * @param v6 Value checked for change. 21694 * @param suffix Static value used for concatenation only. 21695 * @param sanitizer An optional sanitizer function 21696 * @returns itself, so that it may be chained. 21697 * @codeGenApi 21698 */ 21699function ɵɵattributeInterpolate7(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer, namespace) { 21700 const lView = getLView(); 21701 const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix); 21702 if (interpolatedValue !== NO_CHANGE) { 21703 const tNode = getSelectedTNode(); 21704 elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace); 21705 ngDevMode && 21706 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix); 21707 } 21708 return ɵɵattributeInterpolate7; 21709} 21710/** 21711 * 21712 * Update an interpolated attribute on an element with 8 bound values surrounded by text. 21713 * 21714 * Used when the value passed to a property has 8 interpolated values in it: 21715 * 21716 * ```html 21717 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div> 21718 * ``` 21719 * 21720 * Its compiled representation is:: 21721 * 21722 * ```ts 21723 * ɵɵattributeInterpolate8( 21724 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix'); 21725 * ``` 21726 * 21727 * @param attrName The name of the attribute to update 21728 * @param prefix Static value used for concatenation only. 21729 * @param v0 Value checked for change. 21730 * @param i0 Static value used for concatenation only. 21731 * @param v1 Value checked for change. 21732 * @param i1 Static value used for concatenation only. 21733 * @param v2 Value checked for change. 21734 * @param i2 Static value used for concatenation only. 21735 * @param v3 Value checked for change. 21736 * @param i3 Static value used for concatenation only. 21737 * @param v4 Value checked for change. 21738 * @param i4 Static value used for concatenation only. 21739 * @param v5 Value checked for change. 21740 * @param i5 Static value used for concatenation only. 21741 * @param v6 Value checked for change. 21742 * @param i6 Static value used for concatenation only. 21743 * @param v7 Value checked for change. 21744 * @param suffix Static value used for concatenation only. 21745 * @param sanitizer An optional sanitizer function 21746 * @returns itself, so that it may be chained. 21747 * @codeGenApi 21748 */ 21749function ɵɵattributeInterpolate8(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer, namespace) { 21750 const lView = getLView(); 21751 const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix); 21752 if (interpolatedValue !== NO_CHANGE) { 21753 const tNode = getSelectedTNode(); 21754 elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace); 21755 ngDevMode && 21756 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix); 21757 } 21758 return ɵɵattributeInterpolate8; 21759} 21760/** 21761 * Update an interpolated attribute on an element with 9 or more bound values surrounded by text. 21762 * 21763 * Used when the number of interpolated values exceeds 8. 21764 * 21765 * ```html 21766 * <div 21767 * title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div> 21768 * ``` 21769 * 21770 * Its compiled representation is:: 21771 * 21772 * ```ts 21773 * ɵɵattributeInterpolateV( 21774 * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9, 21775 * 'suffix']); 21776 * ``` 21777 * 21778 * @param attrName The name of the attribute to update. 21779 * @param values The collection of values and the strings in-between those values, beginning with 21780 * a string prefix and ending with a string suffix. 21781 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`) 21782 * @param sanitizer An optional sanitizer function 21783 * @returns itself, so that it may be chained. 21784 * @codeGenApi 21785 */ 21786function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) { 21787 const lView = getLView(); 21788 const interpolated = interpolationV(lView, values); 21789 if (interpolated !== NO_CHANGE) { 21790 const tNode = getSelectedTNode(); 21791 elementAttributeInternal(tNode, lView, attrName, interpolated, sanitizer, namespace); 21792 if (ngDevMode) { 21793 const interpolationInBetween = [values[0]]; // prefix 21794 for (let i = 2; i < values.length; i += 2) { 21795 interpolationInBetween.push(values[i]); 21796 } 21797 storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween); 21798 } 21799 } 21800 return ɵɵattributeInterpolateV; 21801} 21802 21803/** 21804 * @license 21805 * Copyright Google LLC All Rights Reserved. 21806 * 21807 * Use of this source code is governed by an MIT-style license that can be 21808 * found in the LICENSE file at https://angular.io/license 21809 */ 21810/** 21811 * Synchronously perform change detection on a component (and possibly its sub-components). 21812 * 21813 * This function triggers change detection in a synchronous way on a component. 21814 * 21815 * @param component The component which the change detection should be performed on. 21816 */ 21817function detectChanges(component) { 21818 const view = getComponentViewByInstance(component); 21819 detectChangesInternal(view[TVIEW], view, component); 21820} 21821/** 21822 * Marks the component as dirty (needing change detection). Marking a component dirty will 21823 * schedule a change detection on it at some point in the future. 21824 * 21825 * Marking an already dirty component as dirty won't do anything. Only one outstanding change 21826 * detection can be scheduled per component tree. 21827 * 21828 * @param component Component to mark as dirty. 21829 */ 21830function markDirty(component) { 21831 ngDevMode && assertDefined(component, 'component'); 21832 const rootView = markViewDirty(getComponentViewByInstance(component)); 21833 ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined'); 21834 scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */); 21835} 21836/** 21837 * Used to perform change detection on the whole application. 21838 * 21839 * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick` 21840 * executes lifecycle hooks and conditionally checks components based on their 21841 * `ChangeDetectionStrategy` and dirtiness. 21842 * 21843 * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally 21844 * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a 21845 * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can 21846 * be changed when calling `renderComponent` and providing the `scheduler` option. 21847 */ 21848function tick(component) { 21849 const rootView = getRootView(component); 21850 const rootContext = rootView[CONTEXT]; 21851 tickRootContext(rootContext); 21852} 21853 21854/** 21855 * @license 21856 * Copyright Google LLC All Rights Reserved. 21857 * 21858 * Use of this source code is governed by an MIT-style license that can be 21859 * found in the LICENSE file at https://angular.io/license 21860 */ 21861function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) { 21862 ngDevMode && assertFirstCreatePass(tView); 21863 ngDevMode && ngDevMode.firstCreatePass++; 21864 const tViewConsts = tView.consts; 21865 // TODO(pk): refactor getOrCreateTNode to have the "create" only version 21866 const tNode = getOrCreateTNode(tView, lView[T_HOST], index, 0 /* Container */, tagName || null, getConstant(tViewConsts, attrsIndex)); 21867 resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex)); 21868 registerPostOrderHooks(tView, tNode); 21869 const embeddedTView = tNode.tViews = createTView(2 /* Embedded */, -1, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts); 21870 const embeddedTViewNode = createTNode(tView, null, 2 /* View */, -1, null, null); 21871 embeddedTViewNode.injectorIndex = tNode.injectorIndex; 21872 embeddedTView.node = embeddedTViewNode; 21873 if (tView.queries !== null) { 21874 tView.queries.template(tView, tNode); 21875 embeddedTView.queries = tView.queries.embeddedTView(tNode); 21876 } 21877 return tNode; 21878} 21879/** 21880 * Creates an LContainer for an ng-template (dynamically-inserted view), e.g. 21881 * 21882 * <ng-template #foo> 21883 * <div></div> 21884 * </ng-template> 21885 * 21886 * @param index The index of the container in the data array 21887 * @param templateFn Inline template 21888 * @param decls The number of nodes, local refs, and pipes for this template 21889 * @param vars The number of bindings for this template 21890 * @param tagName The name of the container element, if applicable 21891 * @param attrsIndex Index of template attributes in the `consts` array. 21892 * @param localRefs Index of the local references in the `consts` array. 21893 * @param localRefExtractor A function which extracts local-refs values from the template. 21894 * Defaults to the current element associated with the local-ref. 21895 * 21896 * @codeGenApi 21897 */ 21898function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) { 21899 const lView = getLView(); 21900 const tView = getTView(); 21901 const adjustedIndex = index + HEADER_OFFSET; 21902 const tNode = tView.firstCreatePass ? 21903 templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) : 21904 tView.data[adjustedIndex]; 21905 setPreviousOrParentTNode(tNode, false); 21906 const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : ''); 21907 appendChild(tView, lView, comment, tNode); 21908 attachPatchData(comment, lView); 21909 addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode)); 21910 if (isDirectiveHost(tNode)) { 21911 createDirectivesInstances(tView, lView, tNode); 21912 } 21913 if (localRefsIndex != null) { 21914 saveResolvedLocalsInData(lView, tNode, localRefExtractor); 21915 } 21916} 21917 21918/** 21919 * @license 21920 * Copyright Google LLC All Rights Reserved. 21921 * 21922 * Use of this source code is governed by an MIT-style license that can be 21923 * found in the LICENSE file at https://angular.io/license 21924 */ 21925/** Store a value in the `data` at a given `index`. */ 21926function store(tView, lView, index, value) { 21927 // We don't store any static data for local variables, so the first time 21928 // we see the template, we should store as null to avoid a sparse array 21929 const adjustedIndex = index + HEADER_OFFSET; 21930 if (adjustedIndex >= tView.data.length) { 21931 tView.data[adjustedIndex] = null; 21932 tView.blueprint[adjustedIndex] = null; 21933 } 21934 lView[adjustedIndex] = value; 21935} 21936/** 21937 * Retrieves a local reference from the current contextViewData. 21938 * 21939 * If the reference to retrieve is in a parent view, this instruction is used in conjunction 21940 * with a nextContext() call, which walks up the tree and updates the contextViewData instance. 21941 * 21942 * @param index The index of the local ref in contextViewData. 21943 * 21944 * @codeGenApi 21945 */ 21946function ɵɵreference(index) { 21947 const contextLView = getContextLView(); 21948 return load(contextLView, index); 21949} 21950 21951/** 21952 * @license 21953 * Copyright Google LLC All Rights Reserved. 21954 * 21955 * Use of this source code is governed by an MIT-style license that can be 21956 * found in the LICENSE file at https://angular.io/license 21957 */ 21958function ɵɵdirectiveInject(token, flags = InjectFlags.Default) { 21959 const lView = getLView(); 21960 // Fall back to inject() if view hasn't been created. This situation can happen in tests 21961 // if inject utilities are used before bootstrapping. 21962 if (lView == null) 21963 return ɵɵinject(token, flags); 21964 const tNode = getPreviousOrParentTNode(); 21965 return getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags); 21966} 21967/** 21968 * Facade for the attribute injection from DI. 21969 * 21970 * @codeGenApi 21971 */ 21972function ɵɵinjectAttribute(attrNameToInject) { 21973 return injectAttributeImpl(getPreviousOrParentTNode(), attrNameToInject); 21974} 21975/** 21976 * Throws an error indicating that a factory function could not be generated by the compiler for a 21977 * particular class. 21978 * 21979 * This instruction allows the actual error message to be optimized away when ngDevMode is turned 21980 * off, saving bytes of generated code while still providing a good experience in dev mode. 21981 * 21982 * The name of the class is not mentioned here, but will be in the generated factory function name 21983 * and thus in the stack trace. 21984 * 21985 * @codeGenApi 21986 */ 21987function ɵɵinvalidFactory() { 21988 const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid'; 21989 throw new Error(msg); 21990} 21991 21992/** 21993 * @license 21994 * Copyright Google LLC All Rights Reserved. 21995 * 21996 * Use of this source code is governed by an MIT-style license that can be 21997 * found in the LICENSE file at https://angular.io/license 21998 */ 21999/** 22000 * Update a property on a selected element. 22001 * 22002 * Operates on the element selected by index via the {@link select} instruction. 22003 * 22004 * If the property name also exists as an input property on one of the element's directives, 22005 * the component property will be set instead of the element property. This check must 22006 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled 22007 * 22008 * @param propName Name of property. Because it is going to DOM, this is not subject to 22009 * renaming as part of minification. 22010 * @param value New value to write. 22011 * @param sanitizer An optional function used to sanitize the value. 22012 * @returns This function returns itself so that it may be chained 22013 * (e.g. `property('name', ctx.name)('title', ctx.title)`) 22014 * 22015 * @codeGenApi 22016 */ 22017function ɵɵproperty(propName, value, sanitizer) { 22018 const lView = getLView(); 22019 const bindingIndex = nextBindingIndex(); 22020 if (bindingUpdated(lView, bindingIndex, value)) { 22021 const tView = getTView(); 22022 const tNode = getSelectedTNode(); 22023 elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false); 22024 ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex); 22025 } 22026 return ɵɵproperty; 22027} 22028/** 22029 * Given `<div style="..." my-dir>` and `MyDir` with `@Input('style')` we need to write to 22030 * directive input. 22031 */ 22032function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) { 22033 const inputs = tNode.inputs; 22034 const property = isClassBased ? 'class' : 'style'; 22035 // We support both 'class' and `className` hence the fallback. 22036 setInputsForProperty(tView, lView, inputs[property], property, value); 22037} 22038 22039/** 22040 * @license 22041 * Copyright Google LLC All Rights Reserved. 22042 * 22043 * Use of this source code is governed by an MIT-style license that can be 22044 * found in the LICENSE file at https://angular.io/license 22045 */ 22046function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) { 22047 ngDevMode && assertFirstCreatePass(tView); 22048 ngDevMode && ngDevMode.firstCreatePass++; 22049 const tViewConsts = tView.consts; 22050 const attrs = getConstant(tViewConsts, attrsIndex); 22051 const tNode = getOrCreateTNode(tView, lView[T_HOST], index, 3 /* Element */, name, attrs); 22052 const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex)); 22053 ngDevMode && logUnknownElementError(tView, native, tNode, hasDirectives); 22054 if (tNode.attrs !== null) { 22055 computeStaticStyling(tNode, tNode.attrs, false); 22056 } 22057 if (tNode.mergedAttrs !== null) { 22058 computeStaticStyling(tNode, tNode.mergedAttrs, true); 22059 } 22060 if (tView.queries !== null) { 22061 tView.queries.elementStart(tView, tNode); 22062 } 22063 return tNode; 22064} 22065/** 22066 * Create DOM element. The instruction must later be followed by `elementEnd()` call. 22067 * 22068 * @param index Index of the element in the LView array 22069 * @param name Name of the DOM Node 22070 * @param attrsIndex Index of the element's attributes in the `consts` array. 22071 * @param localRefsIndex Index of the element's local references in the `consts` array. 22072 * 22073 * Attributes and localRefs are passed as an array of strings where elements with an even index 22074 * hold an attribute name and elements with an odd index hold an attribute value, ex.: 22075 * ['id', 'warning5', 'class', 'alert'] 22076 * 22077 * @codeGenApi 22078 */ 22079function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) { 22080 const lView = getLView(); 22081 const tView = getTView(); 22082 const adjustedIndex = HEADER_OFFSET + index; 22083 ngDevMode && 22084 assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings'); 22085 ngDevMode && ngDevMode.rendererCreateElement++; 22086 ngDevMode && assertIndexInRange(lView, adjustedIndex); 22087 const renderer = lView[RENDERER]; 22088 const native = lView[adjustedIndex] = elementCreate(name, renderer, getNamespace()); 22089 const tNode = tView.firstCreatePass ? 22090 elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) : 22091 tView.data[adjustedIndex]; 22092 setPreviousOrParentTNode(tNode, true); 22093 const mergedAttrs = tNode.mergedAttrs; 22094 if (mergedAttrs !== null) { 22095 setUpAttributes(renderer, native, mergedAttrs); 22096 } 22097 const classes = tNode.classes; 22098 if (classes !== null) { 22099 writeDirectClass(renderer, native, classes); 22100 } 22101 const styles = tNode.styles; 22102 if (styles !== null) { 22103 writeDirectStyle(renderer, native, styles); 22104 } 22105 appendChild(tView, lView, native, tNode); 22106 // any immediate children of a component or template container must be pre-emptively 22107 // monkey-patched with the component view data so that the element can be inspected 22108 // later on using any element discovery utility methods (see `element_discovery.ts`) 22109 if (getElementDepthCount() === 0) { 22110 attachPatchData(native, lView); 22111 } 22112 increaseElementDepthCount(); 22113 if (isDirectiveHost(tNode)) { 22114 createDirectivesInstances(tView, lView, tNode); 22115 executeContentQueries(tView, tNode, lView); 22116 } 22117 if (localRefsIndex !== null) { 22118 saveResolvedLocalsInData(lView, tNode); 22119 } 22120} 22121/** 22122 * Mark the end of the element. 22123 * 22124 * @codeGenApi 22125 */ 22126function ɵɵelementEnd() { 22127 let previousOrParentTNode = getPreviousOrParentTNode(); 22128 ngDevMode && assertDefined(previousOrParentTNode, 'No parent node to close.'); 22129 if (getIsParent()) { 22130 setIsNotParent(); 22131 } 22132 else { 22133 ngDevMode && assertHasParent(getPreviousOrParentTNode()); 22134 previousOrParentTNode = previousOrParentTNode.parent; 22135 setPreviousOrParentTNode(previousOrParentTNode, false); 22136 } 22137 const tNode = previousOrParentTNode; 22138 ngDevMode && assertNodeType(tNode, 3 /* Element */); 22139 decreaseElementDepthCount(); 22140 const tView = getTView(); 22141 if (tView.firstCreatePass) { 22142 registerPostOrderHooks(tView, previousOrParentTNode); 22143 if (isContentQueryHost(previousOrParentTNode)) { 22144 tView.queries.elementEnd(previousOrParentTNode); 22145 } 22146 } 22147 if (tNode.classesWithoutHost != null && hasClassInput(tNode)) { 22148 setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true); 22149 } 22150 if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) { 22151 setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false); 22152 } 22153} 22154/** 22155 * Creates an empty element using {@link elementStart} and {@link elementEnd} 22156 * 22157 * @param index Index of the element in the data array 22158 * @param name Name of the DOM Node 22159 * @param attrsIndex Index of the element's attributes in the `consts` array. 22160 * @param localRefsIndex Index of the element's local references in the `consts` array. 22161 * 22162 * @codeGenApi 22163 */ 22164function ɵɵelement(index, name, attrsIndex, localRefsIndex) { 22165 ɵɵelementStart(index, name, attrsIndex, localRefsIndex); 22166 ɵɵelementEnd(); 22167} 22168function logUnknownElementError(tView, element, tNode, hasDirectives) { 22169 const schemas = tView.schemas; 22170 // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT 22171 // mode where this check happens at compile time. In JIT mode, `schemas` is always present and 22172 // defined as an array (as an empty array in case `schemas` field is not defined) and we should 22173 // execute the check below. 22174 if (schemas === null) 22175 return; 22176 const tagName = tNode.tagName; 22177 // If the element matches any directive, it's considered as valid. 22178 if (!hasDirectives && tagName !== null) { 22179 // The element is unknown if it's an instance of HTMLUnknownElement or it isn't registered 22180 // as a custom element. Note that unknown elements with a dash in their name won't be instances 22181 // of HTMLUnknownElement in browsers that support web components. 22182 const isUnknown = 22183 // Note that we can't check for `typeof HTMLUnknownElement === 'function'`, 22184 // because while most browsers return 'function', IE returns 'object'. 22185 (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement && 22186 element instanceof HTMLUnknownElement) || 22187 (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 && 22188 !customElements.get(tagName)); 22189 if (isUnknown && !matchingSchemas(tView, tagName)) { 22190 let message = `'${tagName}' is not a known element:\n`; 22191 message += `1. If '${tagName}' is an Angular component, then verify that it is part of this module.\n`; 22192 if (tagName && tagName.indexOf('-') > -1) { 22193 message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.`; 22194 } 22195 else { 22196 message += 22197 `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`; 22198 } 22199 console.error(message); 22200 } 22201 } 22202} 22203 22204/** 22205 * @license 22206 * Copyright Google LLC All Rights Reserved. 22207 * 22208 * Use of this source code is governed by an MIT-style license that can be 22209 * found in the LICENSE file at https://angular.io/license 22210 */ 22211function elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) { 22212 ngDevMode && ngDevMode.firstCreatePass++; 22213 const tViewConsts = tView.consts; 22214 const attrs = getConstant(tViewConsts, attrsIndex); 22215 const tNode = getOrCreateTNode(tView, lView[T_HOST], index, 4 /* ElementContainer */, 'ng-container', attrs); 22216 // While ng-container doesn't necessarily support styling, we use the style context to identify 22217 // and execute directives on the ng-container. 22218 if (attrs !== null) { 22219 computeStaticStyling(tNode, attrs, true); 22220 } 22221 const localRefs = getConstant(tViewConsts, localRefsIndex); 22222 resolveDirectives(tView, lView, tNode, localRefs); 22223 if (tView.queries !== null) { 22224 tView.queries.elementStart(tView, tNode); 22225 } 22226 return tNode; 22227} 22228/** 22229 * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM. 22230 * The instruction must later be followed by `elementContainerEnd()` call. 22231 * 22232 * @param index Index of the element in the LView array 22233 * @param attrsIndex Index of the container attributes in the `consts` array. 22234 * @param localRefsIndex Index of the container's local references in the `consts` array. 22235 * 22236 * Even if this instruction accepts a set of attributes no actual attribute values are propagated to 22237 * the DOM (as a comment node can't have attributes). Attributes are here only for directive 22238 * matching purposes and setting initial inputs of directives. 22239 * 22240 * @codeGenApi 22241 */ 22242function ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) { 22243 const lView = getLView(); 22244 const tView = getTView(); 22245 const adjustedIndex = index + HEADER_OFFSET; 22246 ngDevMode && assertIndexInRange(lView, adjustedIndex); 22247 ngDevMode && 22248 assertEqual(getBindingIndex(), tView.bindingStartIndex, 'element containers should be created before any bindings'); 22249 const tNode = tView.firstCreatePass ? 22250 elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) : 22251 tView.data[adjustedIndex]; 22252 setPreviousOrParentTNode(tNode, true); 22253 ngDevMode && ngDevMode.rendererCreateComment++; 22254 const native = lView[adjustedIndex] = 22255 lView[RENDERER].createComment(ngDevMode ? 'ng-container' : ''); 22256 appendChild(tView, lView, native, tNode); 22257 attachPatchData(native, lView); 22258 if (isDirectiveHost(tNode)) { 22259 createDirectivesInstances(tView, lView, tNode); 22260 executeContentQueries(tView, tNode, lView); 22261 } 22262 if (localRefsIndex != null) { 22263 saveResolvedLocalsInData(lView, tNode); 22264 } 22265} 22266/** 22267 * Mark the end of the <ng-container>. 22268 * 22269 * @codeGenApi 22270 */ 22271function ɵɵelementContainerEnd() { 22272 let previousOrParentTNode = getPreviousOrParentTNode(); 22273 const tView = getTView(); 22274 if (getIsParent()) { 22275 setIsNotParent(); 22276 } 22277 else { 22278 ngDevMode && assertHasParent(previousOrParentTNode); 22279 previousOrParentTNode = previousOrParentTNode.parent; 22280 setPreviousOrParentTNode(previousOrParentTNode, false); 22281 } 22282 ngDevMode && assertNodeType(previousOrParentTNode, 4 /* ElementContainer */); 22283 if (tView.firstCreatePass) { 22284 registerPostOrderHooks(tView, previousOrParentTNode); 22285 if (isContentQueryHost(previousOrParentTNode)) { 22286 tView.queries.elementEnd(previousOrParentTNode); 22287 } 22288 } 22289} 22290/** 22291 * Creates an empty logical container using {@link elementContainerStart} 22292 * and {@link elementContainerEnd} 22293 * 22294 * @param index Index of the element in the LView array 22295 * @param attrsIndex Index of the container attributes in the `consts` array. 22296 * @param localRefsIndex Index of the container's local references in the `consts` array. 22297 * 22298 * @codeGenApi 22299 */ 22300function ɵɵelementContainer(index, attrsIndex, localRefsIndex) { 22301 ɵɵelementContainerStart(index, attrsIndex, localRefsIndex); 22302 ɵɵelementContainerEnd(); 22303} 22304 22305/** 22306 * Returns the current OpaqueViewState instance. 22307 * 22308 * Used in conjunction with the restoreView() instruction to save a snapshot 22309 * of the current view and restore it when listeners are invoked. This allows 22310 * walking the declaration view tree in listeners to get vars from parent views. 22311 * 22312 * @codeGenApi 22313 */ 22314function ɵɵgetCurrentView() { 22315 return getLView(); 22316} 22317 22318/** 22319 * @license 22320 * Copyright Google LLC All Rights Reserved. 22321 * 22322 * Use of this source code is governed by an MIT-style license that can be 22323 * found in the LICENSE file at https://angular.io/license 22324 */ 22325/** 22326 * Determine if the argument is shaped like a Promise 22327 */ 22328function isPromise(obj) { 22329 // allow any Promise/A+ compliant thenable. 22330 // It's up to the caller to ensure that obj.then conforms to the spec 22331 return !!obj && typeof obj.then === 'function'; 22332} 22333/** 22334 * Determine if the argument is an Observable 22335 */ 22336function isObservable(obj) { 22337 // TODO: use isObservable once we update pass rxjs 6.1 22338 // https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03 22339 return !!obj && typeof obj.subscribe === 'function'; 22340} 22341 22342/** 22343 * @license 22344 * Copyright Google LLC All Rights Reserved. 22345 * 22346 * Use of this source code is governed by an MIT-style license that can be 22347 * found in the LICENSE file at https://angular.io/license 22348 */ 22349/** 22350 * Adds an event listener to the current node. 22351 * 22352 * If an output exists on one of the node's directives, it also subscribes to the output 22353 * and saves the subscription for later cleanup. 22354 * 22355 * @param eventName Name of the event 22356 * @param listenerFn The function to be called when event emits 22357 * @param useCapture Whether or not to use capture in event listener 22358 * @param eventTargetResolver Function that returns global target information in case this listener 22359 * should be attached to a global object like window, document or body 22360 * 22361 * @codeGenApi 22362 */ 22363function ɵɵlistener(eventName, listenerFn, useCapture = false, eventTargetResolver) { 22364 const lView = getLView(); 22365 const tView = getTView(); 22366 const tNode = getPreviousOrParentTNode(); 22367 listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, useCapture, eventTargetResolver); 22368 return ɵɵlistener; 22369} 22370/** 22371 * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive. 22372 * 22373 * This instruction is for compatibility purposes and is designed to ensure that a 22374 * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered 22375 * in the component's renderer. Normally all host listeners are evaluated with the 22376 * parent component's renderer, but, in the case of animation @triggers, they need 22377 * to be evaluated with the sub component's renderer (because that's where the 22378 * animation triggers are defined). 22379 * 22380 * Do not use this instruction as a replacement for `listener`. This instruction 22381 * only exists to ensure compatibility with the ViewEngine's host binding behavior. 22382 * 22383 * @param eventName Name of the event 22384 * @param listenerFn The function to be called when event emits 22385 * @param useCapture Whether or not to use capture in event listener 22386 * @param eventTargetResolver Function that returns global target information in case this listener 22387 * should be attached to a global object like window, document or body 22388 * 22389 * @codeGenApi 22390 */ 22391function ɵɵsyntheticHostListener(eventName, listenerFn, useCapture = false, eventTargetResolver) { 22392 const tNode = getPreviousOrParentTNode(); 22393 const lView = getLView(); 22394 const tView = getTView(); 22395 const currentDef = getCurrentDirectiveDef(tView.data); 22396 const renderer = loadComponentRenderer(currentDef, tNode, lView); 22397 listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, useCapture, eventTargetResolver); 22398 return ɵɵsyntheticHostListener; 22399} 22400/** 22401 * A utility function that checks if a given element has already an event handler registered for an 22402 * event with a specified name. The TView.cleanup data structure is used to find out which events 22403 * are registered for a given element. 22404 */ 22405function findExistingListener(tView, lView, eventName, tNodeIdx) { 22406 const tCleanup = tView.cleanup; 22407 if (tCleanup != null) { 22408 for (let i = 0; i < tCleanup.length - 1; i += 2) { 22409 const cleanupEventName = tCleanup[i]; 22410 if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIdx) { 22411 // We have found a matching event name on the same node but it might not have been 22412 // registered yet, so we must explicitly verify entries in the LView cleanup data 22413 // structures. 22414 const lCleanup = lView[CLEANUP]; 22415 const listenerIdxInLCleanup = tCleanup[i + 2]; 22416 return lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null; 22417 } 22418 // TView.cleanup can have a mix of 4-elements entries (for event handler cleanups) or 22419 // 2-element entries (for directive and queries destroy hooks). As such we can encounter 22420 // blocks of 4 or 2 items in the tView.cleanup and this is why we iterate over 2 elements 22421 // first and jump another 2 elements if we detect listeners cleanup (4 elements). Also check 22422 // documentation of TView.cleanup for more details of this data structure layout. 22423 if (typeof cleanupEventName === 'string') { 22424 i += 2; 22425 } 22426 } 22427 } 22428 return null; 22429} 22430function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, useCapture = false, eventTargetResolver) { 22431 const isTNodeDirectiveHost = isDirectiveHost(tNode); 22432 const firstCreatePass = tView.firstCreatePass; 22433 const tCleanup = firstCreatePass && (tView.cleanup || (tView.cleanup = [])); 22434 // When the ɵɵlistener instruction was generated and is executed we know that there is either a 22435 // native listener or a directive output on this element. As such we we know that we will have to 22436 // register a listener and store its cleanup function on LView. 22437 const lCleanup = getLCleanup(lView); 22438 ngDevMode && 22439 assertNodeOfPossibleTypes(tNode, [3 /* Element */, 0 /* Container */, 4 /* ElementContainer */]); 22440 let processOutputs = true; 22441 // add native event listener - applicable to elements only 22442 if (tNode.type === 3 /* Element */) { 22443 const native = getNativeByTNode(tNode, lView); 22444 const resolved = eventTargetResolver ? eventTargetResolver(native) : EMPTY_OBJ; 22445 const target = resolved.target || native; 22446 const lCleanupIndex = lCleanup.length; 22447 const idxOrTargetGetter = eventTargetResolver ? 22448 (_lView) => eventTargetResolver(unwrapRNode(_lView[tNode.index])).target : 22449 tNode.index; 22450 // In order to match current behavior, native DOM event listeners must be added for all 22451 // events (including outputs). 22452 if (isProceduralRenderer(renderer)) { 22453 // There might be cases where multiple directives on the same element try to register an event 22454 // handler function for the same event. In this situation we want to avoid registration of 22455 // several native listeners as each registration would be intercepted by NgZone and 22456 // trigger change detection. This would mean that a single user action would result in several 22457 // change detections being invoked. To avoid this situation we want to have only one call to 22458 // native handler registration (for the same element and same type of event). 22459 // 22460 // In order to have just one native event handler in presence of multiple handler functions, 22461 // we just register a first handler function as a native event listener and then chain 22462 // (coalesce) other handler functions on top of the first native handler function. 22463 let existingListener = null; 22464 // Please note that the coalescing described here doesn't happen for events specifying an 22465 // alternative target (ex. (document:click)) - this is to keep backward compatibility with the 22466 // view engine. 22467 // Also, we don't have to search for existing listeners is there are no directives 22468 // matching on a given node as we can't register multiple event handlers for the same event in 22469 // a template (this would mean having duplicate attributes). 22470 if (!eventTargetResolver && isTNodeDirectiveHost) { 22471 existingListener = findExistingListener(tView, lView, eventName, tNode.index); 22472 } 22473 if (existingListener !== null) { 22474 // Attach a new listener to coalesced listeners list, maintaining the order in which 22475 // listeners are registered. For performance reasons, we keep a reference to the last 22476 // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through 22477 // the entire set each time we need to add a new listener. 22478 const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener; 22479 lastListenerFn.__ngNextListenerFn__ = listenerFn; 22480 existingListener.__ngLastListenerFn__ = listenerFn; 22481 processOutputs = false; 22482 } 22483 else { 22484 // The first argument of `listen` function in Procedural Renderer is: 22485 // - either a target name (as a string) in case of global target (window, document, body) 22486 // - or element reference (in all other cases) 22487 listenerFn = wrapListener(tNode, lView, listenerFn, false /** preventDefault */); 22488 const cleanupFn = renderer.listen(resolved.name || target, eventName, listenerFn); 22489 ngDevMode && ngDevMode.rendererAddEventListener++; 22490 lCleanup.push(listenerFn, cleanupFn); 22491 tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1); 22492 } 22493 } 22494 else { 22495 listenerFn = wrapListener(tNode, lView, listenerFn, true /** preventDefault */); 22496 target.addEventListener(eventName, listenerFn, useCapture); 22497 ngDevMode && ngDevMode.rendererAddEventListener++; 22498 lCleanup.push(listenerFn); 22499 tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, useCapture); 22500 } 22501 } 22502 // subscribe to directive outputs 22503 const outputs = tNode.outputs; 22504 let props; 22505 if (processOutputs && outputs !== null && (props = outputs[eventName])) { 22506 const propsLength = props.length; 22507 if (propsLength) { 22508 for (let i = 0; i < propsLength; i += 2) { 22509 const index = props[i]; 22510 ngDevMode && assertIndexInRange(lView, index); 22511 const minifiedName = props[i + 1]; 22512 const directiveInstance = lView[index]; 22513 const output = directiveInstance[minifiedName]; 22514 if (ngDevMode && !isObservable(output)) { 22515 throw new Error(`@Output ${minifiedName} not initialized in '${directiveInstance.constructor.name}'.`); 22516 } 22517 const subscription = output.subscribe(listenerFn); 22518 const idx = lCleanup.length; 22519 lCleanup.push(listenerFn, subscription); 22520 tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1)); 22521 } 22522 } 22523 } 22524} 22525function executeListenerWithErrorHandling(lView, listenerFn, e) { 22526 try { 22527 // Only explicitly returning false from a listener should preventDefault 22528 return listenerFn(e) !== false; 22529 } 22530 catch (error) { 22531 handleError(lView, error); 22532 return false; 22533 } 22534} 22535/** 22536 * Wraps an event listener with a function that marks ancestors dirty and prevents default behavior, 22537 * if applicable. 22538 * 22539 * @param tNode The TNode associated with this listener 22540 * @param lView The LView that contains this listener 22541 * @param listenerFn The listener function to call 22542 * @param wrapWithPreventDefault Whether or not to prevent default behavior 22543 * (the procedural renderer does this already, so in those cases, we should skip) 22544 */ 22545function wrapListener(tNode, lView, listenerFn, wrapWithPreventDefault) { 22546 // Note: we are performing most of the work in the listener function itself 22547 // to optimize listener registration. 22548 return function wrapListenerIn_markDirtyAndPreventDefault(e) { 22549 // Ivy uses `Function` as a special token that allows us to unwrap the function 22550 // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. 22551 if (e === Function) { 22552 return listenerFn; 22553 } 22554 // In order to be backwards compatible with View Engine, events on component host nodes 22555 // must also mark the component view itself dirty (i.e. the view that it owns). 22556 const startView = tNode.flags & 2 /* isComponentHost */ ? 22557 getComponentLViewByIndex(tNode.index, lView) : 22558 lView; 22559 // See interfaces/view.ts for more on LViewFlags.ManualOnPush 22560 if ((lView[FLAGS] & 32 /* ManualOnPush */) === 0) { 22561 markViewDirty(startView); 22562 } 22563 let result = executeListenerWithErrorHandling(lView, listenerFn, e); 22564 // A just-invoked listener function might have coalesced listeners so we need to check for 22565 // their presence and invoke as needed. 22566 let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__; 22567 while (nextListenerFn) { 22568 // We should prevent default if any of the listeners explicitly return false 22569 result = executeListenerWithErrorHandling(lView, nextListenerFn, e) && result; 22570 nextListenerFn = nextListenerFn.__ngNextListenerFn__; 22571 } 22572 if (wrapWithPreventDefault && result === false) { 22573 e.preventDefault(); 22574 // Necessary for legacy browsers that don't support preventDefault (e.g. IE) 22575 e.returnValue = false; 22576 } 22577 return result; 22578 }; 22579} 22580 22581/** 22582 * @license 22583 * Copyright Google LLC All Rights Reserved. 22584 * 22585 * Use of this source code is governed by an MIT-style license that can be 22586 * found in the LICENSE file at https://angular.io/license 22587 */ 22588 22589/** 22590 * @license 22591 * Copyright Google LLC All Rights Reserved. 22592 * 22593 * Use of this source code is governed by an MIT-style license that can be 22594 * found in the LICENSE file at https://angular.io/license 22595 */ 22596/** 22597 * Retrieves a context at the level specified and saves it as the global, contextViewData. 22598 * Will get the next level up if level is not specified. 22599 * 22600 * This is used to save contexts of parent views so they can be bound in embedded views, or 22601 * in conjunction with reference() to bind a ref from a parent view. 22602 * 22603 * @param level The relative level of the view from which to grab context compared to contextVewData 22604 * @returns context 22605 * 22606 * @codeGenApi 22607 */ 22608function ɵɵnextContext(level = 1) { 22609 return nextContextImpl(level); 22610} 22611 22612/** 22613 * @license 22614 * Copyright Google LLC All Rights Reserved. 22615 * 22616 * Use of this source code is governed by an MIT-style license that can be 22617 * found in the LICENSE file at https://angular.io/license 22618 */ 22619/** 22620 * Checks a given node against matching projection slots and returns the 22621 * determined slot index. Returns "null" if no slot matched the given node. 22622 * 22623 * This function takes into account the parsed ngProjectAs selector from the 22624 * node's attributes. If present, it will check whether the ngProjectAs selector 22625 * matches any of the projection slot selectors. 22626 */ 22627function matchingProjectionSlotIndex(tNode, projectionSlots) { 22628 let wildcardNgContentIndex = null; 22629 const ngProjectAsAttrVal = getProjectAsAttrValue(tNode); 22630 for (let i = 0; i < projectionSlots.length; i++) { 22631 const slotValue = projectionSlots[i]; 22632 // The last wildcard projection slot should match all nodes which aren't matching 22633 // any selector. This is necessary to be backwards compatible with view engine. 22634 if (slotValue === '*') { 22635 wildcardNgContentIndex = i; 22636 continue; 22637 } 22638 // If we ran into an `ngProjectAs` attribute, we should match its parsed selector 22639 // to the list of selectors, otherwise we fall back to matching against the node. 22640 if (ngProjectAsAttrVal === null ? 22641 isNodeMatchingSelectorList(tNode, slotValue, /* isProjectionMode */ true) : 22642 isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) { 22643 return i; // first matching selector "captures" a given node 22644 } 22645 } 22646 return wildcardNgContentIndex; 22647} 22648/** 22649 * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template. 22650 * It takes all the selectors from the entire component's template and decides where 22651 * each projected node belongs (it re-distributes nodes among "buckets" where each "bucket" is 22652 * backed by a selector). 22653 * 22654 * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text, 22655 * un-parsed form. 22656 * 22657 * The parsed form is needed for efficient matching of a node against a given CSS selector. 22658 * The un-parsed, textual form is needed for support of the ngProjectAs attribute. 22659 * 22660 * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more 22661 * drawbacks: 22662 * - having only a textual form would require runtime parsing of CSS selectors; 22663 * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a 22664 * template author). 22665 * 22666 * @param projectionSlots? A collection of projection slots. A projection slot can be based 22667 * on a parsed CSS selectors or set to the wildcard selector ("*") in order to match 22668 * all nodes which do not match any selector. If not specified, a single wildcard 22669 * selector projection slot will be defined. 22670 * 22671 * @codeGenApi 22672 */ 22673function ɵɵprojectionDef(projectionSlots) { 22674 const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST]; 22675 if (!componentNode.projection) { 22676 // If no explicit projection slots are defined, fall back to a single 22677 // projection slot with the wildcard selector. 22678 const numProjectionSlots = projectionSlots ? projectionSlots.length : 1; 22679 const projectionHeads = componentNode.projection = 22680 newArray(numProjectionSlots, null); 22681 const tails = projectionHeads.slice(); 22682 let componentChild = componentNode.child; 22683 while (componentChild !== null) { 22684 const slotIndex = projectionSlots ? matchingProjectionSlotIndex(componentChild, projectionSlots) : 0; 22685 if (slotIndex !== null) { 22686 if (tails[slotIndex]) { 22687 tails[slotIndex].projectionNext = componentChild; 22688 } 22689 else { 22690 projectionHeads[slotIndex] = componentChild; 22691 } 22692 tails[slotIndex] = componentChild; 22693 } 22694 componentChild = componentChild.next; 22695 } 22696 } 22697} 22698let delayProjection = false; 22699function setDelayProjection(value) { 22700 delayProjection = value; 22701} 22702/** 22703 * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call 22704 * to the projectionDef instruction. 22705 * 22706 * @param nodeIndex 22707 * @param selectorIndex: 22708 * - 0 when the selector is `*` (or unspecified as this is the default value), 22709 * - 1 based index of the selector from the {@link projectionDef} 22710 * 22711 * @codeGenApi 22712 */ 22713function ɵɵprojection(nodeIndex, selectorIndex = 0, attrs) { 22714 const lView = getLView(); 22715 const tView = getTView(); 22716 const tProjectionNode = getOrCreateTNode(tView, lView[T_HOST], nodeIndex, 1 /* Projection */, null, attrs || null); 22717 // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views. 22718 if (tProjectionNode.projection === null) 22719 tProjectionNode.projection = selectorIndex; 22720 // `<ng-content>` has no content 22721 setIsNotParent(); 22722 // We might need to delay the projection of nodes if they are in the middle of an i18n block 22723 if (!delayProjection) { 22724 // re-distribution of projectable nodes is stored on a component's view level 22725 applyProjection(tView, lView, tProjectionNode); 22726 } 22727} 22728 22729/** 22730 * 22731 * Update an interpolated property on an element with a lone bound value 22732 * 22733 * Used when the value passed to a property has 1 interpolated value in it, an no additional text 22734 * surrounds that interpolated value: 22735 * 22736 * ```html 22737 * <div title="{{v0}}"></div> 22738 * ``` 22739 * 22740 * Its compiled representation is:: 22741 * 22742 * ```ts 22743 * ɵɵpropertyInterpolate('title', v0); 22744 * ``` 22745 * 22746 * If the property name also exists as an input property on one of the element's directives, 22747 * the component property will be set instead of the element property. This check must 22748 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 22749 * 22750 * @param propName The name of the property to update 22751 * @param prefix Static value used for concatenation only. 22752 * @param v0 Value checked for change. 22753 * @param suffix Static value used for concatenation only. 22754 * @param sanitizer An optional sanitizer function 22755 * @returns itself, so that it may be chained. 22756 * @codeGenApi 22757 */ 22758function ɵɵpropertyInterpolate(propName, v0, sanitizer) { 22759 ɵɵpropertyInterpolate1(propName, '', v0, '', sanitizer); 22760 return ɵɵpropertyInterpolate; 22761} 22762/** 22763 * 22764 * Update an interpolated property on an element with single bound value surrounded by text. 22765 * 22766 * Used when the value passed to a property has 1 interpolated value in it: 22767 * 22768 * ```html 22769 * <div title="prefix{{v0}}suffix"></div> 22770 * ``` 22771 * 22772 * Its compiled representation is:: 22773 * 22774 * ```ts 22775 * ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix'); 22776 * ``` 22777 * 22778 * If the property name also exists as an input property on one of the element's directives, 22779 * the component property will be set instead of the element property. This check must 22780 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 22781 * 22782 * @param propName The name of the property to update 22783 * @param prefix Static value used for concatenation only. 22784 * @param v0 Value checked for change. 22785 * @param suffix Static value used for concatenation only. 22786 * @param sanitizer An optional sanitizer function 22787 * @returns itself, so that it may be chained. 22788 * @codeGenApi 22789 */ 22790function ɵɵpropertyInterpolate1(propName, prefix, v0, suffix, sanitizer) { 22791 const lView = getLView(); 22792 const interpolatedValue = interpolation1(lView, prefix, v0, suffix); 22793 if (interpolatedValue !== NO_CHANGE) { 22794 const tView = getTView(); 22795 const tNode = getSelectedTNode(); 22796 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 22797 ngDevMode && 22798 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix); 22799 } 22800 return ɵɵpropertyInterpolate1; 22801} 22802/** 22803 * 22804 * Update an interpolated property on an element with 2 bound values surrounded by text. 22805 * 22806 * Used when the value passed to a property has 2 interpolated values in it: 22807 * 22808 * ```html 22809 * <div title="prefix{{v0}}-{{v1}}suffix"></div> 22810 * ``` 22811 * 22812 * Its compiled representation is:: 22813 * 22814 * ```ts 22815 * ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix'); 22816 * ``` 22817 * 22818 * If the property name also exists as an input property on one of the element's directives, 22819 * the component property will be set instead of the element property. This check must 22820 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 22821 * 22822 * @param propName The name of the property to update 22823 * @param prefix Static value used for concatenation only. 22824 * @param v0 Value checked for change. 22825 * @param i0 Static value used for concatenation only. 22826 * @param v1 Value checked for change. 22827 * @param suffix Static value used for concatenation only. 22828 * @param sanitizer An optional sanitizer function 22829 * @returns itself, so that it may be chained. 22830 * @codeGenApi 22831 */ 22832function ɵɵpropertyInterpolate2(propName, prefix, v0, i0, v1, suffix, sanitizer) { 22833 const lView = getLView(); 22834 const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix); 22835 if (interpolatedValue !== NO_CHANGE) { 22836 const tView = getTView(); 22837 const tNode = getSelectedTNode(); 22838 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 22839 ngDevMode && 22840 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix); 22841 } 22842 return ɵɵpropertyInterpolate2; 22843} 22844/** 22845 * 22846 * Update an interpolated property on an element with 3 bound values surrounded by text. 22847 * 22848 * Used when the value passed to a property has 3 interpolated values in it: 22849 * 22850 * ```html 22851 * <div title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div> 22852 * ``` 22853 * 22854 * Its compiled representation is:: 22855 * 22856 * ```ts 22857 * ɵɵpropertyInterpolate3( 22858 * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix'); 22859 * ``` 22860 * 22861 * If the property name also exists as an input property on one of the element's directives, 22862 * the component property will be set instead of the element property. This check must 22863 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 22864 * 22865 * @param propName The name of the property to update 22866 * @param prefix Static value used for concatenation only. 22867 * @param v0 Value checked for change. 22868 * @param i0 Static value used for concatenation only. 22869 * @param v1 Value checked for change. 22870 * @param i1 Static value used for concatenation only. 22871 * @param v2 Value checked for change. 22872 * @param suffix Static value used for concatenation only. 22873 * @param sanitizer An optional sanitizer function 22874 * @returns itself, so that it may be chained. 22875 * @codeGenApi 22876 */ 22877function ɵɵpropertyInterpolate3(propName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer) { 22878 const lView = getLView(); 22879 const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix); 22880 if (interpolatedValue !== NO_CHANGE) { 22881 const tView = getTView(); 22882 const tNode = getSelectedTNode(); 22883 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 22884 ngDevMode && 22885 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix); 22886 } 22887 return ɵɵpropertyInterpolate3; 22888} 22889/** 22890 * 22891 * Update an interpolated property on an element with 4 bound values surrounded by text. 22892 * 22893 * Used when the value passed to a property has 4 interpolated values in it: 22894 * 22895 * ```html 22896 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div> 22897 * ``` 22898 * 22899 * Its compiled representation is:: 22900 * 22901 * ```ts 22902 * ɵɵpropertyInterpolate4( 22903 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix'); 22904 * ``` 22905 * 22906 * If the property name also exists as an input property on one of the element's directives, 22907 * the component property will be set instead of the element property. This check must 22908 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 22909 * 22910 * @param propName The name of the property to update 22911 * @param prefix Static value used for concatenation only. 22912 * @param v0 Value checked for change. 22913 * @param i0 Static value used for concatenation only. 22914 * @param v1 Value checked for change. 22915 * @param i1 Static value used for concatenation only. 22916 * @param v2 Value checked for change. 22917 * @param i2 Static value used for concatenation only. 22918 * @param v3 Value checked for change. 22919 * @param suffix Static value used for concatenation only. 22920 * @param sanitizer An optional sanitizer function 22921 * @returns itself, so that it may be chained. 22922 * @codeGenApi 22923 */ 22924function ɵɵpropertyInterpolate4(propName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer) { 22925 const lView = getLView(); 22926 const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix); 22927 if (interpolatedValue !== NO_CHANGE) { 22928 const tView = getTView(); 22929 const tNode = getSelectedTNode(); 22930 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 22931 ngDevMode && 22932 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix); 22933 } 22934 return ɵɵpropertyInterpolate4; 22935} 22936/** 22937 * 22938 * Update an interpolated property on an element with 5 bound values surrounded by text. 22939 * 22940 * Used when the value passed to a property has 5 interpolated values in it: 22941 * 22942 * ```html 22943 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div> 22944 * ``` 22945 * 22946 * Its compiled representation is:: 22947 * 22948 * ```ts 22949 * ɵɵpropertyInterpolate5( 22950 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix'); 22951 * ``` 22952 * 22953 * If the property name also exists as an input property on one of the element's directives, 22954 * the component property will be set instead of the element property. This check must 22955 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 22956 * 22957 * @param propName The name of the property to update 22958 * @param prefix Static value used for concatenation only. 22959 * @param v0 Value checked for change. 22960 * @param i0 Static value used for concatenation only. 22961 * @param v1 Value checked for change. 22962 * @param i1 Static value used for concatenation only. 22963 * @param v2 Value checked for change. 22964 * @param i2 Static value used for concatenation only. 22965 * @param v3 Value checked for change. 22966 * @param i3 Static value used for concatenation only. 22967 * @param v4 Value checked for change. 22968 * @param suffix Static value used for concatenation only. 22969 * @param sanitizer An optional sanitizer function 22970 * @returns itself, so that it may be chained. 22971 * @codeGenApi 22972 */ 22973function ɵɵpropertyInterpolate5(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer) { 22974 const lView = getLView(); 22975 const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix); 22976 if (interpolatedValue !== NO_CHANGE) { 22977 const tView = getTView(); 22978 const tNode = getSelectedTNode(); 22979 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 22980 ngDevMode && 22981 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix); 22982 } 22983 return ɵɵpropertyInterpolate5; 22984} 22985/** 22986 * 22987 * Update an interpolated property on an element with 6 bound values surrounded by text. 22988 * 22989 * Used when the value passed to a property has 6 interpolated values in it: 22990 * 22991 * ```html 22992 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div> 22993 * ``` 22994 * 22995 * Its compiled representation is:: 22996 * 22997 * ```ts 22998 * ɵɵpropertyInterpolate6( 22999 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix'); 23000 * ``` 23001 * 23002 * If the property name also exists as an input property on one of the element's directives, 23003 * the component property will be set instead of the element property. This check must 23004 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 23005 * 23006 * @param propName The name of the property to update 23007 * @param prefix Static value used for concatenation only. 23008 * @param v0 Value checked for change. 23009 * @param i0 Static value used for concatenation only. 23010 * @param v1 Value checked for change. 23011 * @param i1 Static value used for concatenation only. 23012 * @param v2 Value checked for change. 23013 * @param i2 Static value used for concatenation only. 23014 * @param v3 Value checked for change. 23015 * @param i3 Static value used for concatenation only. 23016 * @param v4 Value checked for change. 23017 * @param i4 Static value used for concatenation only. 23018 * @param v5 Value checked for change. 23019 * @param suffix Static value used for concatenation only. 23020 * @param sanitizer An optional sanitizer function 23021 * @returns itself, so that it may be chained. 23022 * @codeGenApi 23023 */ 23024function ɵɵpropertyInterpolate6(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer) { 23025 const lView = getLView(); 23026 const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix); 23027 if (interpolatedValue !== NO_CHANGE) { 23028 const tView = getTView(); 23029 const tNode = getSelectedTNode(); 23030 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 23031 ngDevMode && 23032 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix); 23033 } 23034 return ɵɵpropertyInterpolate6; 23035} 23036/** 23037 * 23038 * Update an interpolated property on an element with 7 bound values surrounded by text. 23039 * 23040 * Used when the value passed to a property has 7 interpolated values in it: 23041 * 23042 * ```html 23043 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div> 23044 * ``` 23045 * 23046 * Its compiled representation is:: 23047 * 23048 * ```ts 23049 * ɵɵpropertyInterpolate7( 23050 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix'); 23051 * ``` 23052 * 23053 * If the property name also exists as an input property on one of the element's directives, 23054 * the component property will be set instead of the element property. This check must 23055 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 23056 * 23057 * @param propName The name of the property to update 23058 * @param prefix Static value used for concatenation only. 23059 * @param v0 Value checked for change. 23060 * @param i0 Static value used for concatenation only. 23061 * @param v1 Value checked for change. 23062 * @param i1 Static value used for concatenation only. 23063 * @param v2 Value checked for change. 23064 * @param i2 Static value used for concatenation only. 23065 * @param v3 Value checked for change. 23066 * @param i3 Static value used for concatenation only. 23067 * @param v4 Value checked for change. 23068 * @param i4 Static value used for concatenation only. 23069 * @param v5 Value checked for change. 23070 * @param i5 Static value used for concatenation only. 23071 * @param v6 Value checked for change. 23072 * @param suffix Static value used for concatenation only. 23073 * @param sanitizer An optional sanitizer function 23074 * @returns itself, so that it may be chained. 23075 * @codeGenApi 23076 */ 23077function ɵɵpropertyInterpolate7(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer) { 23078 const lView = getLView(); 23079 const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix); 23080 if (interpolatedValue !== NO_CHANGE) { 23081 const tView = getTView(); 23082 const tNode = getSelectedTNode(); 23083 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 23084 ngDevMode && 23085 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix); 23086 } 23087 return ɵɵpropertyInterpolate7; 23088} 23089/** 23090 * 23091 * Update an interpolated property on an element with 8 bound values surrounded by text. 23092 * 23093 * Used when the value passed to a property has 8 interpolated values in it: 23094 * 23095 * ```html 23096 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div> 23097 * ``` 23098 * 23099 * Its compiled representation is:: 23100 * 23101 * ```ts 23102 * ɵɵpropertyInterpolate8( 23103 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix'); 23104 * ``` 23105 * 23106 * If the property name also exists as an input property on one of the element's directives, 23107 * the component property will be set instead of the element property. This check must 23108 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 23109 * 23110 * @param propName The name of the property to update 23111 * @param prefix Static value used for concatenation only. 23112 * @param v0 Value checked for change. 23113 * @param i0 Static value used for concatenation only. 23114 * @param v1 Value checked for change. 23115 * @param i1 Static value used for concatenation only. 23116 * @param v2 Value checked for change. 23117 * @param i2 Static value used for concatenation only. 23118 * @param v3 Value checked for change. 23119 * @param i3 Static value used for concatenation only. 23120 * @param v4 Value checked for change. 23121 * @param i4 Static value used for concatenation only. 23122 * @param v5 Value checked for change. 23123 * @param i5 Static value used for concatenation only. 23124 * @param v6 Value checked for change. 23125 * @param i6 Static value used for concatenation only. 23126 * @param v7 Value checked for change. 23127 * @param suffix Static value used for concatenation only. 23128 * @param sanitizer An optional sanitizer function 23129 * @returns itself, so that it may be chained. 23130 * @codeGenApi 23131 */ 23132function ɵɵpropertyInterpolate8(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer) { 23133 const lView = getLView(); 23134 const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix); 23135 if (interpolatedValue !== NO_CHANGE) { 23136 const tView = getTView(); 23137 const tNode = getSelectedTNode(); 23138 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 23139 ngDevMode && 23140 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix); 23141 } 23142 return ɵɵpropertyInterpolate8; 23143} 23144/** 23145 * Update an interpolated property on an element with 9 or more bound values surrounded by text. 23146 * 23147 * Used when the number of interpolated values exceeds 8. 23148 * 23149 * ```html 23150 * <div 23151 * title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div> 23152 * ``` 23153 * 23154 * Its compiled representation is:: 23155 * 23156 * ```ts 23157 * ɵɵpropertyInterpolateV( 23158 * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9, 23159 * 'suffix']); 23160 * ``` 23161 * 23162 * If the property name also exists as an input property on one of the element's directives, 23163 * the component property will be set instead of the element property. This check must 23164 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled. 23165 * 23166 * @param propName The name of the property to update. 23167 * @param values The collection of values and the strings inbetween those values, beginning with a 23168 * string prefix and ending with a string suffix. 23169 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`) 23170 * @param sanitizer An optional sanitizer function 23171 * @returns itself, so that it may be chained. 23172 * @codeGenApi 23173 */ 23174function ɵɵpropertyInterpolateV(propName, values, sanitizer) { 23175 const lView = getLView(); 23176 const interpolatedValue = interpolationV(lView, values); 23177 if (interpolatedValue !== NO_CHANGE) { 23178 const tView = getTView(); 23179 const tNode = getSelectedTNode(); 23180 elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false); 23181 if (ngDevMode) { 23182 const interpolationInBetween = [values[0]]; // prefix 23183 for (let i = 2; i < values.length; i += 2) { 23184 interpolationInBetween.push(values[i]); 23185 } 23186 storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween); 23187 } 23188 } 23189 return ɵɵpropertyInterpolateV; 23190} 23191 23192/** 23193 * @license 23194 * Copyright Google LLC All Rights Reserved. 23195 * 23196 * Use of this source code is governed by an MIT-style license that can be 23197 * found in the LICENSE file at https://angular.io/license 23198 */ 23199/** 23200 * This file contains reuseable "empty" symbols that can be used as default return values 23201 * in different parts of the rendering code. Because the same symbols are returned, this 23202 * allows for identity checks against these values to be consistently used by the framework 23203 * code. 23204 */ 23205const EMPTY_OBJ$1 = {}; 23206const EMPTY_ARRAY$3 = []; 23207// freezing the values prevents any code from accidentally inserting new values in 23208if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) { 23209 // These property accesses can be ignored because ngDevMode will be set to false 23210 // when optimizing code and the whole if statement will be dropped. 23211 // tslint:disable-next-line:no-toplevel-property-access 23212 Object.freeze(EMPTY_OBJ$1); 23213 // tslint:disable-next-line:no-toplevel-property-access 23214 Object.freeze(EMPTY_ARRAY$3); 23215} 23216 23217/** 23218 * @license 23219 * Copyright Google LLC All Rights Reserved. 23220 * 23221 * Use of this source code is governed by an MIT-style license that can be 23222 * found in the LICENSE file at https://angular.io/license 23223 */ 23224/** 23225 * NOTE: The word `styling` is used interchangeably as style or class styling. 23226 * 23227 * This file contains code to link styling instructions together so that they can be replayed in 23228 * priority order. The file exists because Ivy styling instruction execution order does not match 23229 * that of the priority order. The purpose of this code is to create a linked list so that the 23230 * instructions can be traversed in priority order when computing the styles. 23231 * 23232 * Assume we are dealing with the following code: 23233 * ``` 23234 * @Component({ 23235 * template: ` 23236 * <my-cmp [style]=" {color: '#001'} " 23237 * [style.color]=" #002 " 23238 * dir-style-color-1 23239 * dir-style-color-2> ` 23240 * }) 23241 * class ExampleComponent { 23242 * static ngComp = ... { 23243 * ... 23244 * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap` 23245 * ɵɵstyleMap({color: '#001'}); 23246 * ɵɵstyleProp('color', '#002'); 23247 * ... 23248 * } 23249 * } 23250 * 23251 * @Directive({ 23252 * selector: `[dir-style-color-1]', 23253 * }) 23254 * class Style1Directive { 23255 * @HostBinding('style') style = {color: '#005'}; 23256 * @HostBinding('style.color') color = '#006'; 23257 * 23258 * static ngDir = ... { 23259 * ... 23260 * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap` 23261 * ɵɵstyleMap({color: '#005'}); 23262 * ɵɵstyleProp('color', '#006'); 23263 * ... 23264 * } 23265 * } 23266 * 23267 * @Directive({ 23268 * selector: `[dir-style-color-2]', 23269 * }) 23270 * class Style2Directive { 23271 * @HostBinding('style') style = {color: '#007'}; 23272 * @HostBinding('style.color') color = '#008'; 23273 * 23274 * static ngDir = ... { 23275 * ... 23276 * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap` 23277 * ɵɵstyleMap({color: '#007'}); 23278 * ɵɵstyleProp('color', '#008'); 23279 * ... 23280 * } 23281 * } 23282 * 23283 * @Directive({ 23284 * selector: `my-cmp', 23285 * }) 23286 * class MyComponent { 23287 * @HostBinding('style') style = {color: '#003'}; 23288 * @HostBinding('style.color') color = '#004'; 23289 * 23290 * static ngComp = ... { 23291 * ... 23292 * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap` 23293 * ɵɵstyleMap({color: '#003'}); 23294 * ɵɵstyleProp('color', '#004'); 23295 * ... 23296 * } 23297 * } 23298 * ``` 23299 * 23300 * The Order of instruction execution is: 23301 * 23302 * NOTE: the comment binding location is for illustrative purposes only. 23303 * 23304 * ``` 23305 * // Template: (ExampleComponent) 23306 * ɵɵstyleMap({color: '#001'}); // Binding index: 10 23307 * ɵɵstyleProp('color', '#002'); // Binding index: 12 23308 * // MyComponent 23309 * ɵɵstyleMap({color: '#003'}); // Binding index: 20 23310 * ɵɵstyleProp('color', '#004'); // Binding index: 22 23311 * // Style1Directive 23312 * ɵɵstyleMap({color: '#005'}); // Binding index: 24 23313 * ɵɵstyleProp('color', '#006'); // Binding index: 26 23314 * // Style2Directive 23315 * ɵɵstyleMap({color: '#007'}); // Binding index: 28 23316 * ɵɵstyleProp('color', '#008'); // Binding index: 30 23317 * ``` 23318 * 23319 * The correct priority order of concatenation is: 23320 * 23321 * ``` 23322 * // MyComponent 23323 * ɵɵstyleMap({color: '#003'}); // Binding index: 20 23324 * ɵɵstyleProp('color', '#004'); // Binding index: 22 23325 * // Style1Directive 23326 * ɵɵstyleMap({color: '#005'}); // Binding index: 24 23327 * ɵɵstyleProp('color', '#006'); // Binding index: 26 23328 * // Style2Directive 23329 * ɵɵstyleMap({color: '#007'}); // Binding index: 28 23330 * ɵɵstyleProp('color', '#008'); // Binding index: 30 23331 * // Template: (ExampleComponent) 23332 * ɵɵstyleMap({color: '#001'}); // Binding index: 10 23333 * ɵɵstyleProp('color', '#002'); // Binding index: 12 23334 * ``` 23335 * 23336 * What color should be rendered? 23337 * 23338 * Once the items are correctly sorted in the list, the answer is simply the last item in the 23339 * concatenation list which is `#002`. 23340 * 23341 * To do so we keep a linked list of all of the bindings which pertain to this element. 23342 * Notice that the bindings are inserted in the order of execution, but the `TView.data` allows 23343 * us to traverse them in the order of priority. 23344 * 23345 * |Idx|`TView.data`|`LView` | Notes 23346 * |---|------------|-----------------|-------------- 23347 * |...| | | 23348 * |10 |`null` |`{color: '#001'}`| `ɵɵstyleMap('color', {color: '#001'})` 23349 * |11 |`30 | 12` | ... | 23350 * |12 |`color` |`'#002'` | `ɵɵstyleProp('color', '#002')` 23351 * |13 |`10 | 0` | ... | 23352 * |...| | | 23353 * |20 |`null` |`{color: '#003'}`| `ɵɵstyleMap('color', {color: '#003'})` 23354 * |21 |`0 | 22` | ... | 23355 * |22 |`color` |`'#004'` | `ɵɵstyleProp('color', '#004')` 23356 * |23 |`20 | 24` | ... | 23357 * |24 |`null` |`{color: '#005'}`| `ɵɵstyleMap('color', {color: '#005'})` 23358 * |25 |`22 | 26` | ... | 23359 * |26 |`color` |`'#006'` | `ɵɵstyleProp('color', '#006')` 23360 * |27 |`24 | 28` | ... | 23361 * |28 |`null` |`{color: '#007'}`| `ɵɵstyleMap('color', {color: '#007'})` 23362 * |29 |`26 | 30` | ... | 23363 * |30 |`color` |`'#008'` | `ɵɵstyleProp('color', '#008')` 23364 * |31 |`28 | 10` | ... | 23365 * 23366 * The above data structure allows us to re-concatenate the styling no matter which data binding 23367 * changes. 23368 * 23369 * NOTE: in addition to keeping track of next/previous index the `TView.data` also stores prev/next 23370 * duplicate bit. The duplicate bit if true says there either is a binding with the same name or 23371 * there is a map (which may contain the name). This information is useful in knowing if other 23372 * styles with higher priority need to be searched for overwrites. 23373 * 23374 * NOTE: See `should support example in 'tnode_linked_list.ts' documentation` in 23375 * `tnode_linked_list_spec.ts` for working example. 23376 */ 23377let __unused_const_as_closure_does_not_like_standalone_comment_blocks__; 23378/** 23379 * Insert new `tStyleValue` at `TData` and link existing style bindings such that we maintain linked 23380 * list of styles and compute the duplicate flag. 23381 * 23382 * Note: this function is executed during `firstUpdatePass` only to populate the `TView.data`. 23383 * 23384 * The function works by keeping track of `tStylingRange` which contains two pointers pointing to 23385 * the head/tail of the template portion of the styles. 23386 * - if `isHost === false` (we are template) then insertion is at tail of `TStylingRange` 23387 * - if `isHost === true` (we are host binding) then insertion is at head of `TStylingRange` 23388 * 23389 * @param tData The `TData` to insert into. 23390 * @param tNode `TNode` associated with the styling element. 23391 * @param tStylingKey See `TStylingKey`. 23392 * @param index location of where `tStyleValue` should be stored (and linked into list.) 23393 * @param isHostBinding `true` if the insertion is for a `hostBinding`. (insertion is in front of 23394 * template.) 23395 * @param isClassBinding True if the associated `tStylingKey` as a `class` styling. 23396 * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.) 23397 */ 23398function insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) { 23399 ngDevMode && assertFirstUpdatePass(getTView()); 23400 let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings; 23401 let tmplHead = getTStylingRangePrev(tBindings); 23402 let tmplTail = getTStylingRangeNext(tBindings); 23403 tData[index] = tStylingKeyWithStatic; 23404 let isKeyDuplicateOfStatic = false; 23405 let tStylingKey; 23406 if (Array.isArray(tStylingKeyWithStatic)) { 23407 // We are case when the `TStylingKey` contains static fields as well. 23408 const staticKeyValueArray = tStylingKeyWithStatic; 23409 tStylingKey = staticKeyValueArray[1]; // unwrap. 23410 // We need to check if our key is present in the static so that we can mark it as duplicate. 23411 if (tStylingKey === null || 23412 keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) { 23413 // tStylingKey is present in the statics, need to mark it as duplicate. 23414 isKeyDuplicateOfStatic = true; 23415 } 23416 } 23417 else { 23418 tStylingKey = tStylingKeyWithStatic; 23419 } 23420 if (isHostBinding) { 23421 // We are inserting host bindings 23422 // If we don't have template bindings then `tail` is 0. 23423 const hasTemplateBindings = tmplTail !== 0; 23424 // This is important to know because that means that the `head` can't point to the first 23425 // template bindings (there are none.) Instead the head points to the tail of the template. 23426 if (hasTemplateBindings) { 23427 // template head's "prev" will point to last host binding or to 0 if no host bindings yet 23428 const previousNode = getTStylingRangePrev(tData[tmplHead + 1]); 23429 tData[index + 1] = toTStylingRange(previousNode, tmplHead); 23430 // if a host binding has already been registered, we need to update the next of that host 23431 // binding to point to this one 23432 if (previousNode !== 0) { 23433 // We need to update the template-tail value to point to us. 23434 tData[previousNode + 1] = 23435 setTStylingRangeNext(tData[previousNode + 1], index); 23436 } 23437 // The "previous" of the template binding head should point to this host binding 23438 tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index); 23439 } 23440 else { 23441 tData[index + 1] = toTStylingRange(tmplHead, 0); 23442 // if a host binding has already been registered, we need to update the next of that host 23443 // binding to point to this one 23444 if (tmplHead !== 0) { 23445 // We need to update the template-tail value to point to us. 23446 tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index); 23447 } 23448 // if we don't have template, the head points to template-tail, and needs to be advanced. 23449 tmplHead = index; 23450 } 23451 } 23452 else { 23453 // We are inserting in template section. 23454 // We need to set this binding's "previous" to the current template tail 23455 tData[index + 1] = toTStylingRange(tmplTail, 0); 23456 ngDevMode && 23457 assertEqual(tmplHead !== 0 && tmplTail === 0, false, 'Adding template bindings after hostBindings is not allowed.'); 23458 if (tmplHead === 0) { 23459 tmplHead = index; 23460 } 23461 else { 23462 // We need to update the previous value "next" to point to this binding 23463 tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index); 23464 } 23465 tmplTail = index; 23466 } 23467 // Now we need to update / compute the duplicates. 23468 // Starting with our location search towards head (least priority) 23469 if (isKeyDuplicateOfStatic) { 23470 tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]); 23471 } 23472 markDuplicates(tData, tStylingKey, index, true, isClassBinding); 23473 markDuplicates(tData, tStylingKey, index, false, isClassBinding); 23474 markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding); 23475 tBindings = toTStylingRange(tmplHead, tmplTail); 23476 if (isClassBinding) { 23477 tNode.classBindings = tBindings; 23478 } 23479 else { 23480 tNode.styleBindings = tBindings; 23481 } 23482} 23483/** 23484 * Look into the residual styling to see if the current `tStylingKey` is duplicate of residual. 23485 * 23486 * @param tNode `TNode` where the residual is stored. 23487 * @param tStylingKey `TStylingKey` to store. 23488 * @param tData `TData` associated with the current `LView`. 23489 * @param index location of where `tStyleValue` should be stored (and linked into list.) 23490 * @param isClassBinding True if the associated `tStylingKey` as a `class` styling. 23491 * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.) 23492 */ 23493function markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) { 23494 const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles; 23495 if (residual != null /* or undefined */ && typeof tStylingKey == 'string' && 23496 keyValueArrayIndexOf(residual, tStylingKey) >= 0) { 23497 // We have duplicate in the residual so mark ourselves as duplicate. 23498 tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]); 23499 } 23500} 23501/** 23502 * Marks `TStyleValue`s as duplicates if another style binding in the list has the same 23503 * `TStyleValue`. 23504 * 23505 * NOTE: this function is intended to be called twice once with `isPrevDir` set to `true` and once 23506 * with it set to `false` to search both the previous as well as next items in the list. 23507 * 23508 * No duplicate case 23509 * ``` 23510 * [style.color] 23511 * [style.width.px] <<- index 23512 * [style.height.px] 23513 * ``` 23514 * 23515 * In the above case adding `[style.width.px]` to the existing `[style.color]` produces no 23516 * duplicates because `width` is not found in any other part of the linked list. 23517 * 23518 * Duplicate case 23519 * ``` 23520 * [style.color] 23521 * [style.width.em] 23522 * [style.width.px] <<- index 23523 * ``` 23524 * In the above case adding `[style.width.px]` will produce a duplicate with `[style.width.em]` 23525 * because `width` is found in the chain. 23526 * 23527 * Map case 1 23528 * ``` 23529 * [style.width.px] 23530 * [style.color] 23531 * [style] <<- index 23532 * ``` 23533 * In the above case adding `[style]` will produce a duplicate with any other bindings because 23534 * `[style]` is a Map and as such is fully dynamic and could produce `color` or `width`. 23535 * 23536 * Map case 2 23537 * ``` 23538 * [style] 23539 * [style.width.px] 23540 * [style.color] <<- index 23541 * ``` 23542 * In the above case adding `[style.color]` will produce a duplicate because there is already a 23543 * `[style]` binding which is a Map and as such is fully dynamic and could produce `color` or 23544 * `width`. 23545 * 23546 * NOTE: Once `[style]` (Map) is added into the system all things are mapped as duplicates. 23547 * NOTE: We use `style` as example, but same logic is applied to `class`es as well. 23548 * 23549 * @param tData `TData` where the linked list is stored. 23550 * @param tStylingKey `TStylingKeyPrimitive` which contains the value to compare to other keys in 23551 * the linked list. 23552 * @param index Starting location in the linked list to search from 23553 * @param isPrevDir Direction. 23554 * - `true` for previous (lower priority); 23555 * - `false` for next (higher priority). 23556 */ 23557function markDuplicates(tData, tStylingKey, index, isPrevDir, isClassBinding) { 23558 const tStylingAtIndex = tData[index + 1]; 23559 const isMap = tStylingKey === null; 23560 let cursor = isPrevDir ? getTStylingRangePrev(tStylingAtIndex) : getTStylingRangeNext(tStylingAtIndex); 23561 let foundDuplicate = false; 23562 // We keep iterating as long as we have a cursor 23563 // AND either: 23564 // - we found what we are looking for, OR 23565 // - we are a map in which case we have to continue searching even after we find what we were 23566 // looking for since we are a wild card and everything needs to be flipped to duplicate. 23567 while (cursor !== 0 && (foundDuplicate === false || isMap)) { 23568 ngDevMode && assertIndexInRange(tData, cursor); 23569 const tStylingValueAtCursor = tData[cursor]; 23570 const tStyleRangeAtCursor = tData[cursor + 1]; 23571 if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) { 23572 foundDuplicate = true; 23573 tData[cursor + 1] = isPrevDir ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor) : 23574 setTStylingRangePrevDuplicate(tStyleRangeAtCursor); 23575 } 23576 cursor = isPrevDir ? getTStylingRangePrev(tStyleRangeAtCursor) : 23577 getTStylingRangeNext(tStyleRangeAtCursor); 23578 } 23579 if (foundDuplicate) { 23580 // if we found a duplicate, than mark ourselves. 23581 tData[index + 1] = isPrevDir ? setTStylingRangePrevDuplicate(tStylingAtIndex) : 23582 setTStylingRangeNextDuplicate(tStylingAtIndex); 23583 } 23584} 23585/** 23586 * Determines if two `TStylingKey`s are a match. 23587 * 23588 * When computing weather a binding contains a duplicate, we need to compare if the instruction 23589 * `TStylingKey` has a match. 23590 * 23591 * Here are examples of `TStylingKey`s which match given `tStylingKeyCursor` is: 23592 * - `color` 23593 * - `color` // Match another color 23594 * - `null` // That means that `tStylingKey` is a `classMap`/`styleMap` instruction 23595 * - `['', 'color', 'other', true]` // wrapped `color` so match 23596 * - `['', null, 'other', true]` // wrapped `null` so match 23597 * - `['', 'width', 'color', 'value']` // wrapped static value contains a match on `'color'` 23598 * - `null` // `tStylingKeyCursor` always match as it is `classMap`/`styleMap` instruction 23599 * 23600 * @param tStylingKeyCursor 23601 * @param tStylingKey 23602 */ 23603function isStylingMatch(tStylingKeyCursor, tStylingKey) { 23604 ngDevMode && 23605 assertNotEqual(Array.isArray(tStylingKey), true, 'Expected that \'tStylingKey\' has been unwrapped'); 23606 if (tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that 23607 // location so we must assume that we have a match. 23608 tStylingKey == null || // If `tStylingKey` is `null` then it is a map therefor assume that it 23609 // contains a match. 23610 (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) === 23611 tStylingKey // If the keys match explicitly than we are a match. 23612 ) { 23613 return true; 23614 } 23615 else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === 'string') { 23616 // if we did not find a match, but `tStylingKeyCursor` is `KeyValueArray` that means cursor has 23617 // statics and we need to check those as well. 23618 return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >= 23619 0; // see if we are matching the key 23620 } 23621 return false; 23622} 23623 23624/** 23625 * @license 23626 * Copyright Google LLC All Rights Reserved. 23627 * 23628 * Use of this source code is governed by an MIT-style license that can be 23629 * found in the LICENSE file at https://angular.io/license 23630 */ 23631// Global state of the parser. (This makes parser non-reentrant, but that is not an issue) 23632const parserState = { 23633 textEnd: 0, 23634 key: 0, 23635 keyEnd: 0, 23636 value: 0, 23637 valueEnd: 0, 23638}; 23639/** 23640 * Retrieves the last parsed `key` of style. 23641 * @param text the text to substring the key from. 23642 */ 23643function getLastParsedKey(text) { 23644 return text.substring(parserState.key, parserState.keyEnd); 23645} 23646/** 23647 * Retrieves the last parsed `value` of style. 23648 * @param text the text to substring the key from. 23649 */ 23650function getLastParsedValue(text) { 23651 return text.substring(parserState.value, parserState.valueEnd); 23652} 23653/** 23654 * Initializes `className` string for parsing and parses the first token. 23655 * 23656 * This function is intended to be used in this format: 23657 * ``` 23658 * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) { 23659 * const key = getLastParsedKey(); 23660 * ... 23661 * } 23662 * ``` 23663 * @param text `className` to parse 23664 * @returns index where the next invocation of `parseClassNameNext` should resume. 23665 */ 23666function parseClassName(text) { 23667 resetParserState(text); 23668 return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd)); 23669} 23670/** 23671 * Parses next `className` token. 23672 * 23673 * This function is intended to be used in this format: 23674 * ``` 23675 * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) { 23676 * const key = getLastParsedKey(); 23677 * ... 23678 * } 23679 * ``` 23680 * 23681 * @param text `className` to parse 23682 * @param index where the parsing should resume. 23683 * @returns index where the next invocation of `parseClassNameNext` should resume. 23684 */ 23685function parseClassNameNext(text, index) { 23686 const end = parserState.textEnd; 23687 if (end === index) { 23688 return -1; 23689 } 23690 index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end); 23691 return consumeWhitespace(text, index, end); 23692} 23693/** 23694 * Initializes `cssText` string for parsing and parses the first key/values. 23695 * 23696 * This function is intended to be used in this format: 23697 * ``` 23698 * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) { 23699 * const key = getLastParsedKey(); 23700 * const value = getLastParsedValue(); 23701 * ... 23702 * } 23703 * ``` 23704 * @param text `cssText` to parse 23705 * @returns index where the next invocation of `parseStyleNext` should resume. 23706 */ 23707function parseStyle(text) { 23708 resetParserState(text); 23709 return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd)); 23710} 23711/** 23712 * Parses the next `cssText` key/values. 23713 * 23714 * This function is intended to be used in this format: 23715 * ``` 23716 * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) { 23717 * const key = getLastParsedKey(); 23718 * const value = getLastParsedValue(); 23719 * ... 23720 * } 23721 * 23722 * @param text `cssText` to parse 23723 * @param index where the parsing should resume. 23724 * @returns index where the next invocation of `parseStyleNext` should resume. 23725 */ 23726function parseStyleNext(text, startIndex) { 23727 const end = parserState.textEnd; 23728 let index = parserState.key = consumeWhitespace(text, startIndex, end); 23729 if (end === index) { 23730 // we reached an end so just quit 23731 return -1; 23732 } 23733 index = parserState.keyEnd = consumeStyleKey(text, index, end); 23734 index = consumeSeparator(text, index, end, 58 /* COLON */); 23735 index = parserState.value = consumeWhitespace(text, index, end); 23736 index = parserState.valueEnd = consumeStyleValue(text, index, end); 23737 return consumeSeparator(text, index, end, 59 /* SEMI_COLON */); 23738} 23739/** 23740 * Reset the global state of the styling parser. 23741 * @param text The styling text to parse. 23742 */ 23743function resetParserState(text) { 23744 parserState.key = 0; 23745 parserState.keyEnd = 0; 23746 parserState.value = 0; 23747 parserState.valueEnd = 0; 23748 parserState.textEnd = text.length; 23749} 23750/** 23751 * Returns index of next non-whitespace character. 23752 * 23753 * @param text Text to scan 23754 * @param startIndex Starting index of character where the scan should start. 23755 * @param endIndex Ending index of character where the scan should end. 23756 * @returns Index of next non-whitespace character (May be the same as `start` if no whitespace at 23757 * that location.) 23758 */ 23759function consumeWhitespace(text, startIndex, endIndex) { 23760 while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* SPACE */) { 23761 startIndex++; 23762 } 23763 return startIndex; 23764} 23765/** 23766 * Returns index of last char in class token. 23767 * 23768 * @param text Text to scan 23769 * @param startIndex Starting index of character where the scan should start. 23770 * @param endIndex Ending index of character where the scan should end. 23771 * @returns Index after last char in class token. 23772 */ 23773function consumeClassToken(text, startIndex, endIndex) { 23774 while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* SPACE */) { 23775 startIndex++; 23776 } 23777 return startIndex; 23778} 23779/** 23780 * Consumes all of the characters belonging to style key and token. 23781 * 23782 * @param text Text to scan 23783 * @param startIndex Starting index of character where the scan should start. 23784 * @param endIndex Ending index of character where the scan should end. 23785 * @returns Index after last style key character. 23786 */ 23787function consumeStyleKey(text, startIndex, endIndex) { 23788 let ch; 23789 while (startIndex < endIndex && 23790 ((ch = text.charCodeAt(startIndex)) === 45 /* DASH */ || ch === 95 /* UNDERSCORE */ || 23791 ((ch & -33 /* UPPER_CASE */) >= 65 /* A */ && (ch & -33 /* UPPER_CASE */) <= 90 /* Z */) || 23792 (ch >= 48 /* ZERO */ && ch <= 57 /* NINE */))) { 23793 startIndex++; 23794 } 23795 return startIndex; 23796} 23797/** 23798 * Consumes all whitespace and the separator `:` after the style key. 23799 * 23800 * @param text Text to scan 23801 * @param startIndex Starting index of character where the scan should start. 23802 * @param endIndex Ending index of character where the scan should end. 23803 * @returns Index after separator and surrounding whitespace. 23804 */ 23805function consumeSeparator(text, startIndex, endIndex, separator) { 23806 startIndex = consumeWhitespace(text, startIndex, endIndex); 23807 if (startIndex < endIndex) { 23808 if (ngDevMode && text.charCodeAt(startIndex) !== separator) { 23809 malformedStyleError(text, String.fromCharCode(separator), startIndex); 23810 } 23811 startIndex++; 23812 } 23813 return startIndex; 23814} 23815/** 23816 * Consumes style value honoring `url()` and `""` text. 23817 * 23818 * @param text Text to scan 23819 * @param startIndex Starting index of character where the scan should start. 23820 * @param endIndex Ending index of character where the scan should end. 23821 * @returns Index after last style value character. 23822 */ 23823function consumeStyleValue(text, startIndex, endIndex) { 23824 let ch1 = -1; // 1st previous character 23825 let ch2 = -1; // 2nd previous character 23826 let ch3 = -1; // 3rd previous character 23827 let i = startIndex; 23828 let lastChIndex = i; 23829 while (i < endIndex) { 23830 const ch = text.charCodeAt(i++); 23831 if (ch === 59 /* SEMI_COLON */) { 23832 return lastChIndex; 23833 } 23834 else if (ch === 34 /* DOUBLE_QUOTE */ || ch === 39 /* SINGLE_QUOTE */) { 23835 lastChIndex = i = consumeQuotedText(text, ch, i, endIndex); 23836 } 23837 else if (startIndex === 23838 i - 4 && // We have seen only 4 characters so far "URL(" (Ignore "foo_URL()") 23839 ch3 === 85 /* U */ && 23840 ch2 === 82 /* R */ && ch1 === 76 /* L */ && ch === 40 /* OPEN_PAREN */) { 23841 lastChIndex = i = consumeQuotedText(text, 41 /* CLOSE_PAREN */, i, endIndex); 23842 } 23843 else if (ch > 32 /* SPACE */) { 23844 // if we have a non-whitespace character then capture its location 23845 lastChIndex = i; 23846 } 23847 ch3 = ch2; 23848 ch2 = ch1; 23849 ch1 = ch & -33 /* UPPER_CASE */; 23850 } 23851 return lastChIndex; 23852} 23853/** 23854 * Consumes all of the quoted characters. 23855 * 23856 * @param text Text to scan 23857 * @param quoteCharCode CharCode of either `"` or `'` quote or `)` for `url(...)`. 23858 * @param startIndex Starting index of character where the scan should start. 23859 * @param endIndex Ending index of character where the scan should end. 23860 * @returns Index after quoted characters. 23861 */ 23862function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) { 23863 let ch1 = -1; // 1st previous character 23864 let index = startIndex; 23865 while (index < endIndex) { 23866 const ch = text.charCodeAt(index++); 23867 if (ch == quoteCharCode && ch1 !== 92 /* BACK_SLASH */) { 23868 return index; 23869 } 23870 if (ch == 92 /* BACK_SLASH */ && ch1 === 92 /* BACK_SLASH */) { 23871 // two back slashes cancel each other out. For example `"\\"` should properly end the 23872 // quotation. (It should not assume that the last `"` is escaped.) 23873 ch1 = 0; 23874 } 23875 else { 23876 ch1 = ch; 23877 } 23878 } 23879 throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) : 23880 new Error(); 23881} 23882function malformedStyleError(text, expecting, index) { 23883 ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here'); 23884 throw throwError(`Malformed style at location ${index} in string '` + text.substring(0, index) + '[>>' + 23885 text.substring(index, index + 1) + '<<]' + text.substr(index + 1) + 23886 `'. Expecting '${expecting}'.`); 23887} 23888 23889/** 23890 * @license 23891 * Copyright Google LLC All Rights Reserved. 23892 * 23893 * Use of this source code is governed by an MIT-style license that can be 23894 * found in the LICENSE file at https://angular.io/license 23895 */ 23896/** 23897 * Update a style binding on an element with the provided value. 23898 * 23899 * If the style value is falsy then it will be removed from the element 23900 * (or assigned a different value depending if there are any styles placed 23901 * on the element with `styleMap` or any static styles that are 23902 * present from when the element was created with `styling`). 23903 * 23904 * Note that the styling element is updated as part of `stylingApply`. 23905 * 23906 * @param prop A valid CSS property. 23907 * @param value New value to write (`null` or an empty string to remove). 23908 * @param suffix Optional suffix. Used with scalar values to add unit such as `px`. 23909 * 23910 * Note that this will apply the provided style value to the host element if this function is called 23911 * within a host binding function. 23912 * 23913 * @codeGenApi 23914 */ 23915function ɵɵstyleProp(prop, value, suffix) { 23916 checkStylingProperty(prop, value, suffix, false); 23917 return ɵɵstyleProp; 23918} 23919/** 23920 * Update a class binding on an element with the provided value. 23921 * 23922 * This instruction is meant to handle the `[class.foo]="exp"` case and, 23923 * therefore, the class binding itself must already be allocated using 23924 * `styling` within the creation block. 23925 * 23926 * @param prop A valid CSS class (only one). 23927 * @param value A true/false value which will turn the class on or off. 23928 * 23929 * Note that this will apply the provided class value to the host element if this function 23930 * is called within a host binding function. 23931 * 23932 * @codeGenApi 23933 */ 23934function ɵɵclassProp(className, value) { 23935 checkStylingProperty(className, value, null, true); 23936 return ɵɵclassProp; 23937} 23938/** 23939 * Update style bindings using an object literal on an element. 23940 * 23941 * This instruction is meant to apply styling via the `[style]="exp"` template bindings. 23942 * When styles are applied to the element they will then be updated with respect to 23943 * any styles/classes set via `styleProp`. If any styles are set to falsy 23944 * then they will be removed from the element. 23945 * 23946 * Note that the styling instruction will not be applied until `stylingApply` is called. 23947 * 23948 * @param styles A key/value style map of the styles that will be applied to the given element. 23949 * Any missing styles (that have already been applied to the element beforehand) will be 23950 * removed (unset) from the element's styling. 23951 * 23952 * Note that this will apply the provided styleMap value to the host element if this function 23953 * is called within a host binding. 23954 * 23955 * @codeGenApi 23956 */ 23957function ɵɵstyleMap(styles) { 23958 checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false); 23959} 23960/** 23961 * Parse text as style and add values to KeyValueArray. 23962 * 23963 * This code is pulled out to a separate function so that it can be tree shaken away if it is not 23964 * needed. It is only referenced from `ɵɵstyleMap`. 23965 * 23966 * @param keyValueArray KeyValueArray to add parsed values to. 23967 * @param text text to parse. 23968 */ 23969function styleStringParser(keyValueArray, text) { 23970 for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) { 23971 styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text)); 23972 } 23973} 23974/** 23975 * Update class bindings using an object literal or class-string on an element. 23976 * 23977 * This instruction is meant to apply styling via the `[class]="exp"` template bindings. 23978 * When classes are applied to the element they will then be updated with 23979 * respect to any styles/classes set via `classProp`. If any 23980 * classes are set to falsy then they will be removed from the element. 23981 * 23982 * Note that the styling instruction will not be applied until `stylingApply` is called. 23983 * Note that this will the provided classMap value to the host element if this function is called 23984 * within a host binding. 23985 * 23986 * @param classes A key/value map or string of CSS classes that will be added to the 23987 * given element. Any missing classes (that have already been applied to the element 23988 * beforehand) will be removed (unset) from the element's list of CSS classes. 23989 * 23990 * @codeGenApi 23991 */ 23992function ɵɵclassMap(classes) { 23993 checkStylingMap(keyValueArraySet, classStringParser, classes, true); 23994} 23995/** 23996 * Parse text as class and add values to KeyValueArray. 23997 * 23998 * This code is pulled out to a separate function so that it can be tree shaken away if it is not 23999 * needed. It is only referenced from `ɵɵclassMap`. 24000 * 24001 * @param keyValueArray KeyValueArray to add parsed values to. 24002 * @param text text to parse. 24003 */ 24004function classStringParser(keyValueArray, text) { 24005 for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) { 24006 keyValueArraySet(keyValueArray, getLastParsedKey(text), true); 24007 } 24008} 24009/** 24010 * Common code between `ɵɵclassProp` and `ɵɵstyleProp`. 24011 * 24012 * @param prop property name. 24013 * @param value binding value. 24014 * @param suffix suffix for the property (e.g. `em` or `px`) 24015 * @param isClassBased `true` if `class` change (`false` if `style`) 24016 */ 24017function checkStylingProperty(prop, value, suffix, isClassBased) { 24018 const lView = getLView(); 24019 const tView = getTView(); 24020 // Styling instructions use 2 slots per binding. 24021 // 1. one for the value / TStylingKey 24022 // 2. one for the intermittent-value / TStylingRange 24023 const bindingIndex = incrementBindingIndex(2); 24024 if (tView.firstUpdatePass) { 24025 stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased); 24026 } 24027 if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) { 24028 const tNode = tView.data[getSelectedIndex() + HEADER_OFFSET]; 24029 updateStyling(tView, tNode, lView, lView[RENDERER], prop, lView[bindingIndex + 1] = normalizeSuffix(value, suffix), isClassBased, bindingIndex); 24030 } 24031} 24032/** 24033 * Common code between `ɵɵclassMap` and `ɵɵstyleMap`. 24034 * 24035 * @param keyValueArraySet (See `keyValueArraySet` in "util/array_utils") Gets passed in as a 24036 * function so that `style` can be processed. This is done for tree shaking purposes. 24037 * @param stringParser Parser used to parse `value` if `string`. (Passed in as `style` and `class` 24038 * have different parsers.) 24039 * @param value bound value from application 24040 * @param isClassBased `true` if `class` change (`false` if `style`) 24041 */ 24042function checkStylingMap(keyValueArraySet, stringParser, value, isClassBased) { 24043 const tView = getTView(); 24044 const bindingIndex = incrementBindingIndex(2); 24045 if (tView.firstUpdatePass) { 24046 stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased); 24047 } 24048 const lView = getLView(); 24049 if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) { 24050 // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the 24051 // if so as not to read unnecessarily. 24052 const tNode = tView.data[getSelectedIndex() + HEADER_OFFSET]; 24053 if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) { 24054 if (ngDevMode) { 24055 // verify that if we are shadowing then `TData` is appropriately marked so that we skip 24056 // processing this binding in styling resolution. 24057 const tStylingKey = tView.data[bindingIndex]; 24058 assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, 'Styling linked list shadow input should be marked as \'false\''); 24059 } 24060 // VE does not concatenate the static portion like we are doing here. 24061 // Instead VE just ignores the static completely if dynamic binding is present. 24062 // Because of locality we have already set the static portion because we don't know if there 24063 // is a dynamic portion until later. If we would ignore the static portion it would look like 24064 // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong 24065 // thing as it would think that the static portion was removed. For this reason we 24066 // concatenate it so that `[ngStyle]`/`[ngClass]` can continue to work on changed. 24067 let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost; 24068 ngDevMode && isClassBased === false && staticPrefix !== null && 24069 assertEqual(staticPrefix.endsWith(';'), true, 'Expecting static portion to end with \';\''); 24070 if (staticPrefix !== null) { 24071 // We want to make sure that falsy values of `value` become empty strings. 24072 value = concatStringsWithSpace(staticPrefix, value ? value : ''); 24073 } 24074 // Given `<div [style] my-dir>` such that `my-dir` has `@Input('style')`. 24075 // This takes over the `[style]` binding. (Same for `[class]`) 24076 setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased); 24077 } 24078 else { 24079 updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet, stringParser, value), isClassBased, bindingIndex); 24080 } 24081 } 24082} 24083/** 24084 * Determines when the binding is in `hostBindings` section 24085 * 24086 * @param tView Current `TView` 24087 * @param bindingIndex index of binding which we would like if it is in `hostBindings` 24088 */ 24089function isInHostBindings(tView, bindingIndex) { 24090 // All host bindings are placed after the expando section. 24091 return bindingIndex >= tView.expandoStartIndex; 24092} 24093/** 24094 * Collects the necessary information to insert the binding into a linked list of style bindings 24095 * using `insertTStylingBinding`. 24096 * 24097 * @param tView `TView` where the binding linked list will be stored. 24098 * @param tStylingKey Property/key of the binding. 24099 * @param bindingIndex Index of binding associated with the `prop` 24100 * @param isClassBased `true` if `class` change (`false` if `style`) 24101 */ 24102function stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) { 24103 ngDevMode && assertFirstUpdatePass(tView); 24104 const tData = tView.data; 24105 if (tData[bindingIndex + 1] === null) { 24106 // The above check is necessary because we don't clear first update pass until first successful 24107 // (no exception) template execution. This prevents the styling instruction from double adding 24108 // itself to the list. 24109 // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the 24110 // if so as not to read unnecessarily. 24111 const tNode = tData[getSelectedIndex() + HEADER_OFFSET]; 24112 const isHostBindings = isInHostBindings(tView, bindingIndex); 24113 if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) { 24114 // `tStylingKey === null` implies that we are either `[style]` or `[class]` binding. 24115 // If there is a directive which uses `@Input('style')` or `@Input('class')` than 24116 // we need to neutralize this binding since that directive is shadowing it. 24117 // We turn this into a noop by setting the key to `false` 24118 tStylingKey = false; 24119 } 24120 tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased); 24121 insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased); 24122 } 24123} 24124/** 24125 * Adds static styling information to the binding if applicable. 24126 * 24127 * The linked list of styles not only stores the list and keys, but also stores static styling 24128 * information on some of the keys. This function determines if the key should contain the styling 24129 * information and computes it. 24130 * 24131 * See `TStylingStatic` for more details. 24132 * 24133 * @param tData `TData` where the linked list is stored. 24134 * @param tNode `TNode` for which the styling is being computed. 24135 * @param stylingKey `TStylingKeyPrimitive` which may need to be wrapped into `TStylingKey` 24136 * @param isClassBased `true` if `class` (`false` if `style`) 24137 */ 24138function wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) { 24139 const hostDirectiveDef = getCurrentDirectiveDef(tData); 24140 let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles; 24141 if (hostDirectiveDef === null) { 24142 // We are in template node. 24143 // If template node already had styling instruction then it has already collected the static 24144 // styling and there is no need to collect them again. We know that we are the first styling 24145 // instruction because the `TNode.*Bindings` points to 0 (nothing has been inserted yet). 24146 const isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0; 24147 if (isFirstStylingInstructionInTemplate) { 24148 // It would be nice to be able to get the statics from `mergeAttrs`, however, at this point 24149 // they are already merged and it would not be possible to figure which property belongs where 24150 // in the priority. 24151 stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased); 24152 stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased); 24153 // We know that if we have styling binding in template we can't have residual. 24154 residual = null; 24155 } 24156 } 24157 else { 24158 // We are in host binding node and there was no binding instruction in template node. 24159 // This means that we need to compute the residual. 24160 const directiveStylingLast = tNode.directiveStylingLast; 24161 const isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef; 24162 if (isFirstStylingInstructionInHostBinding) { 24163 stylingKey = 24164 collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased); 24165 if (residual === null) { 24166 // - If `null` than either: 24167 // - Template styling instruction already ran and it has consumed the static 24168 // styling into its `TStylingKey` and so there is no need to update residual. Instead 24169 // we need to update the `TStylingKey` associated with the first template node 24170 // instruction. OR 24171 // - Some other styling instruction ran and determined that there are no residuals 24172 let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased); 24173 if (templateStylingKey !== undefined && Array.isArray(templateStylingKey)) { 24174 // Only recompute if `templateStylingKey` had static values. (If no static value found 24175 // then there is nothing to do since this operation can only produce less static keys, not 24176 // more.) 24177 templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1] /* unwrap previous statics */, isClassBased); 24178 templateStylingKey = 24179 collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased); 24180 setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey); 24181 } 24182 } 24183 else { 24184 // We only need to recompute residual if it is not `null`. 24185 // - If existing residual (implies there was no template styling). This means that some of 24186 // the statics may have moved from the residual to the `stylingKey` and so we have to 24187 // recompute. 24188 // - If `undefined` this is the first time we are running. 24189 residual = collectResidual(tData, tNode, isClassBased); 24190 } 24191 } 24192 } 24193 if (residual !== undefined) { 24194 isClassBased ? (tNode.residualClasses = residual) : (tNode.residualStyles = residual); 24195 } 24196 return stylingKey; 24197} 24198/** 24199 * Retrieve the `TStylingKey` for the template styling instruction. 24200 * 24201 * This is needed since `hostBinding` styling instructions are inserted after the template 24202 * instruction. While the template instruction needs to update the residual in `TNode` the 24203 * `hostBinding` instructions need to update the `TStylingKey` of the template instruction because 24204 * the template instruction is downstream from the `hostBindings` instructions. 24205 * 24206 * @param tData `TData` where the linked list is stored. 24207 * @param tNode `TNode` for which the styling is being computed. 24208 * @param isClassBased `true` if `class` (`false` if `style`) 24209 * @return `TStylingKey` if found or `undefined` if not found. 24210 */ 24211function getTemplateHeadTStylingKey(tData, tNode, isClassBased) { 24212 const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings; 24213 if (getTStylingRangeNext(bindings) === 0) { 24214 // There does not seem to be a styling instruction in the `template`. 24215 return undefined; 24216 } 24217 return tData[getTStylingRangePrev(bindings)]; 24218} 24219/** 24220 * Update the `TStylingKey` of the first template instruction in `TNode`. 24221 * 24222 * Logically `hostBindings` styling instructions are of lower priority than that of the template. 24223 * However, they execute after the template styling instructions. This means that they get inserted 24224 * in front of the template styling instructions. 24225 * 24226 * If we have a template styling instruction and a new `hostBindings` styling instruction is 24227 * executed it means that it may need to steal static fields from the template instruction. This 24228 * method allows us to update the first template instruction `TStylingKey` with a new value. 24229 * 24230 * Assume: 24231 * ``` 24232 * <div my-dir style="color: red" [style.color]="tmplExp"></div> 24233 * 24234 * @Directive({ 24235 * host: { 24236 * 'style': 'width: 100px', 24237 * '[style.color]': 'dirExp', 24238 * } 24239 * }) 24240 * class MyDir {} 24241 * ``` 24242 * 24243 * when `[style.color]="tmplExp"` executes it creates this data structure. 24244 * ``` 24245 * ['', 'color', 'color', 'red', 'width', '100px'], 24246 * ``` 24247 * 24248 * The reason for this is that the template instruction does not know if there are styling 24249 * instructions and must assume that there are none and must collect all of the static styling. 24250 * (both 24251 * `color' and 'width`) 24252 * 24253 * When `'[style.color]': 'dirExp',` executes we need to insert a new data into the linked list. 24254 * ``` 24255 * ['', 'color', 'width', '100px'], // newly inserted 24256 * ['', 'color', 'color', 'red', 'width', '100px'], // this is wrong 24257 * ``` 24258 * 24259 * Notice that the template statics is now wrong as it incorrectly contains `width` so we need to 24260 * update it like so: 24261 * ``` 24262 * ['', 'color', 'width', '100px'], 24263 * ['', 'color', 'color', 'red'], // UPDATE 24264 * ``` 24265 * 24266 * @param tData `TData` where the linked list is stored. 24267 * @param tNode `TNode` for which the styling is being computed. 24268 * @param isClassBased `true` if `class` (`false` if `style`) 24269 * @param tStylingKey New `TStylingKey` which is replacing the old one. 24270 */ 24271function setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) { 24272 const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings; 24273 ngDevMode && 24274 assertNotEqual(getTStylingRangeNext(bindings), 0, 'Expecting to have at least one template styling binding.'); 24275 tData[getTStylingRangePrev(bindings)] = tStylingKey; 24276} 24277/** 24278 * Collect all static values after the current `TNode.directiveStylingLast` index. 24279 * 24280 * Collect the remaining styling information which has not yet been collected by an existing 24281 * styling instruction. 24282 * 24283 * @param tData `TData` where the `DirectiveDefs` are stored. 24284 * @param tNode `TNode` which contains the directive range. 24285 * @param isClassBased `true` if `class` (`false` if `style`) 24286 */ 24287function collectResidual(tData, tNode, isClassBased) { 24288 let residual = undefined; 24289 const directiveEnd = tNode.directiveEnd; 24290 ngDevMode && 24291 assertNotEqual(tNode.directiveStylingLast, -1, 'By the time this function gets called at least one hostBindings-node styling instruction must have executed.'); 24292 // We add `1 + tNode.directiveStart` because we need to skip the current directive (as we are 24293 // collecting things after the last `hostBindings` directive which had a styling instruction.) 24294 for (let i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) { 24295 const attrs = tData[i].hostAttrs; 24296 residual = collectStylingFromTAttrs(residual, attrs, isClassBased); 24297 } 24298 return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased); 24299} 24300/** 24301 * Collect the static styling information with lower priority than `hostDirectiveDef`. 24302 * 24303 * (This is opposite of residual styling.) 24304 * 24305 * @param hostDirectiveDef `DirectiveDef` for which we want to collect lower priority static 24306 * styling. (Or `null` if template styling) 24307 * @param tData `TData` where the linked list is stored. 24308 * @param tNode `TNode` for which the styling is being computed. 24309 * @param stylingKey Existing `TStylingKey` to update or wrap. 24310 * @param isClassBased `true` if `class` (`false` if `style`) 24311 */ 24312function collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) { 24313 // We need to loop because there can be directives which have `hostAttrs` but don't have 24314 // `hostBindings` so this loop catches up to the current directive.. 24315 let currentDirective = null; 24316 const directiveEnd = tNode.directiveEnd; 24317 let directiveStylingLast = tNode.directiveStylingLast; 24318 if (directiveStylingLast === -1) { 24319 directiveStylingLast = tNode.directiveStart; 24320 } 24321 else { 24322 directiveStylingLast++; 24323 } 24324 while (directiveStylingLast < directiveEnd) { 24325 currentDirective = tData[directiveStylingLast]; 24326 ngDevMode && assertDefined(currentDirective, 'expected to be defined'); 24327 stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased); 24328 if (currentDirective === hostDirectiveDef) 24329 break; 24330 directiveStylingLast++; 24331 } 24332 if (hostDirectiveDef !== null) { 24333 // we only advance the styling cursor if we are collecting data from host bindings. 24334 // Template executes before host bindings and so if we would update the index, 24335 // host bindings would not get their statics. 24336 tNode.directiveStylingLast = directiveStylingLast; 24337 } 24338 return stylingKey; 24339} 24340/** 24341 * Convert `TAttrs` into `TStylingStatic`. 24342 * 24343 * @param stylingKey existing `TStylingKey` to update or wrap. 24344 * @param attrs `TAttributes` to process. 24345 * @param isClassBased `true` if `class` (`false` if `style`) 24346 */ 24347function collectStylingFromTAttrs(stylingKey, attrs, isClassBased) { 24348 const desiredMarker = isClassBased ? 1 /* Classes */ : 2 /* Styles */; 24349 let currentMarker = -1 /* ImplicitAttributes */; 24350 if (attrs !== null) { 24351 for (let i = 0; i < attrs.length; i++) { 24352 const item = attrs[i]; 24353 if (typeof item === 'number') { 24354 currentMarker = item; 24355 } 24356 else { 24357 if (currentMarker === desiredMarker) { 24358 if (!Array.isArray(stylingKey)) { 24359 stylingKey = stylingKey === undefined ? [] : ['', stylingKey]; 24360 } 24361 keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i]); 24362 } 24363 } 24364 } 24365 } 24366 return stylingKey === undefined ? null : stylingKey; 24367} 24368/** 24369 * Convert user input to `KeyValueArray`. 24370 * 24371 * This function takes user input which could be `string`, Object literal, or iterable and converts 24372 * it into a consistent representation. The output of this is `KeyValueArray` (which is an array 24373 * where 24374 * even indexes contain keys and odd indexes contain values for those keys). 24375 * 24376 * The advantage of converting to `KeyValueArray` is that we can perform diff in an input 24377 * independent 24378 * way. 24379 * (ie we can compare `foo bar` to `['bar', 'baz'] and determine a set of changes which need to be 24380 * applied) 24381 * 24382 * The fact that `KeyValueArray` is sorted is very important because it allows us to compute the 24383 * difference in linear fashion without the need to allocate any additional data. 24384 * 24385 * For example if we kept this as a `Map` we would have to iterate over previous `Map` to determine 24386 * which values need to be deleted, over the new `Map` to determine additions, and we would have to 24387 * keep additional `Map` to keep track of duplicates or items which have not yet been visited. 24388 * 24389 * @param keyValueArraySet (See `keyValueArraySet` in "util/array_utils") Gets passed in as a 24390 * function so that `style` can be processed. This is done 24391 * for tree shaking purposes. 24392 * @param stringParser The parser is passed in so that it will be tree shakable. See 24393 * `styleStringParser` and `classStringParser` 24394 * @param value The value to parse/convert to `KeyValueArray` 24395 */ 24396function toStylingKeyValueArray(keyValueArraySet, stringParser, value) { 24397 if (value == null /*|| value === undefined */ || value === '') 24398 return EMPTY_ARRAY$3; 24399 const styleKeyValueArray = []; 24400 const unwrappedValue = unwrapSafeValue(value); 24401 if (Array.isArray(unwrappedValue)) { 24402 for (let i = 0; i < unwrappedValue.length; i++) { 24403 keyValueArraySet(styleKeyValueArray, unwrappedValue[i], true); 24404 } 24405 } 24406 else if (typeof unwrappedValue === 'object') { 24407 for (const key in unwrappedValue) { 24408 if (unwrappedValue.hasOwnProperty(key)) { 24409 keyValueArraySet(styleKeyValueArray, key, unwrappedValue[key]); 24410 } 24411 } 24412 } 24413 else if (typeof unwrappedValue === 'string') { 24414 stringParser(styleKeyValueArray, unwrappedValue); 24415 } 24416 else { 24417 ngDevMode && 24418 throwError('Unsupported styling type ' + typeof unwrappedValue + ': ' + unwrappedValue); 24419 } 24420 return styleKeyValueArray; 24421} 24422/** 24423 * Set a `value` for a `key`. 24424 * 24425 * See: `keyValueArraySet` for details 24426 * 24427 * @param keyValueArray KeyValueArray to add to. 24428 * @param key Style key to add. 24429 * @param value The value to set. 24430 */ 24431function styleKeyValueArraySet(keyValueArray, key, value) { 24432 keyValueArraySet(keyValueArray, key, unwrapSafeValue(value)); 24433} 24434/** 24435 * Update map based styling. 24436 * 24437 * Map based styling could be anything which contains more than one binding. For example `string`, 24438 * or object literal. Dealing with all of these types would complicate the logic so 24439 * instead this function expects that the complex input is first converted into normalized 24440 * `KeyValueArray`. The advantage of normalization is that we get the values sorted, which makes it 24441 * very cheap to compute deltas between the previous and current value. 24442 * 24443 * @param tView Associated `TView.data` contains the linked list of binding priorities. 24444 * @param tNode `TNode` where the binding is located. 24445 * @param lView `LView` contains the values associated with other styling binding at this `TNode`. 24446 * @param renderer Renderer to use if any updates. 24447 * @param oldKeyValueArray Previous value represented as `KeyValueArray` 24448 * @param newKeyValueArray Current value represented as `KeyValueArray` 24449 * @param isClassBased `true` if `class` (`false` if `style`) 24450 * @param bindingIndex Binding index of the binding. 24451 */ 24452function updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) { 24453 if (oldKeyValueArray === NO_CHANGE) { 24454 // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray. 24455 oldKeyValueArray = EMPTY_ARRAY$3; 24456 } 24457 let oldIndex = 0; 24458 let newIndex = 0; 24459 let oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null; 24460 let newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null; 24461 while (oldKey !== null || newKey !== null) { 24462 ngDevMode && assertLessThan(oldIndex, 999, 'Are we stuck in infinite loop?'); 24463 ngDevMode && assertLessThan(newIndex, 999, 'Are we stuck in infinite loop?'); 24464 const oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : undefined; 24465 const newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : undefined; 24466 let setKey = null; 24467 let setValue = undefined; 24468 if (oldKey === newKey) { 24469 // UPDATE: Keys are equal => new value is overwriting old value. 24470 oldIndex += 2; 24471 newIndex += 2; 24472 if (oldValue !== newValue) { 24473 setKey = newKey; 24474 setValue = newValue; 24475 } 24476 } 24477 else if (newKey === null || oldKey !== null && oldKey < newKey) { 24478 // DELETE: oldKey key is missing or we did not find the oldKey in the newValue 24479 // (because the keyValueArray is sorted and `newKey` is found later alphabetically). 24480 // `"background" < "color"` so we need to delete `"background"` because it is not found in the 24481 // new array. 24482 oldIndex += 2; 24483 setKey = oldKey; 24484 } 24485 else { 24486 // CREATE: newKey's is earlier alphabetically than oldKey's (or no oldKey) => we have new key. 24487 // `"color" > "background"` so we need to add `color` because it is in new array but not in 24488 // old array. 24489 ngDevMode && assertDefined(newKey, 'Expecting to have a valid key'); 24490 newIndex += 2; 24491 setKey = newKey; 24492 setValue = newValue; 24493 } 24494 if (setKey !== null) { 24495 updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex); 24496 } 24497 oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null; 24498 newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null; 24499 } 24500} 24501/** 24502 * Update a simple (property name) styling. 24503 * 24504 * This function takes `prop` and updates the DOM to that value. The function takes the binding 24505 * value as well as binding priority into consideration to determine which value should be written 24506 * to DOM. (For example it may be determined that there is a higher priority overwrite which blocks 24507 * the DOM write, or if the value goes to `undefined` a lower priority overwrite may be consulted.) 24508 * 24509 * @param tView Associated `TView.data` contains the linked list of binding priorities. 24510 * @param tNode `TNode` where the binding is located. 24511 * @param lView `LView` contains the values associated with other styling binding at this `TNode`. 24512 * @param renderer Renderer to use if any updates. 24513 * @param prop Either style property name or a class name. 24514 * @param value Either style value for `prop` or `true`/`false` if `prop` is class. 24515 * @param isClassBased `true` if `class` (`false` if `style`) 24516 * @param bindingIndex Binding index of the binding. 24517 */ 24518function updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) { 24519 if (tNode.type !== 3 /* Element */) { 24520 // It is possible to have styling on non-elements (such as ng-container). 24521 // This is rare, but it does happen. In such a case, just ignore the binding. 24522 return; 24523 } 24524 const tData = tView.data; 24525 const tRange = tData[bindingIndex + 1]; 24526 const higherPriorityValue = getTStylingRangeNextDuplicate(tRange) ? 24527 findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased) : 24528 undefined; 24529 if (!isStylingValuePresent(higherPriorityValue)) { 24530 // We don't have a next duplicate, or we did not find a duplicate value. 24531 if (!isStylingValuePresent(value)) { 24532 // We should delete current value or restore to lower priority value. 24533 if (getTStylingRangePrevDuplicate(tRange)) { 24534 // We have a possible prev duplicate, let's retrieve it. 24535 value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased); 24536 } 24537 } 24538 const rNode = getNativeByIndex(getSelectedIndex(), lView); 24539 applyStyling(renderer, isClassBased, rNode, prop, value); 24540 } 24541} 24542/** 24543 * Search for styling value with higher priority which is overwriting current value, or a 24544 * value of lower priority to which we should fall back if the value is `undefined`. 24545 * 24546 * When value is being applied at a location, related values need to be consulted. 24547 * - If there is a higher priority binding, we should be using that one instead. 24548 * For example `<div [style]="{color:exp1}" [style.color]="exp2">` change to `exp1` 24549 * requires that we check `exp2` to see if it is set to value other than `undefined`. 24550 * - If there is a lower priority binding and we are changing to `undefined` 24551 * For example `<div [style]="{color:exp1}" [style.color]="exp2">` change to `exp2` to 24552 * `undefined` requires that we check `exp1` (and static values) and use that as new value. 24553 * 24554 * NOTE: The styling stores two values. 24555 * 1. The raw value which came from the application is stored at `index + 0` location. (This value 24556 * is used for dirty checking). 24557 * 2. The normalized value is stored at `index + 1`. 24558 * 24559 * @param tData `TData` used for traversing the priority. 24560 * @param tNode `TNode` to use for resolving static styling. Also controls search direction. 24561 * - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true. 24562 * If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value. 24563 * - `null` search prev and go all the way to end. Return last value where 24564 * `isStylingValuePresent(value)` is true. 24565 * @param lView `LView` used for retrieving the actual values. 24566 * @param prop Property which we are interested in. 24567 * @param index Starting index in the linked list of styling bindings where the search should start. 24568 * @param isClassBased `true` if `class` (`false` if `style`) 24569 */ 24570function findStylingValue(tData, tNode, lView, prop, index, isClassBased) { 24571 // `TNode` to use for resolving static styling. Also controls search direction. 24572 // - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true. 24573 // If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value. 24574 // - `null` search prev and go all the way to end. Return last value where 24575 // `isStylingValuePresent(value)` is true. 24576 const isPrevDirection = tNode === null; 24577 let value = undefined; 24578 while (index > 0) { 24579 const rawKey = tData[index]; 24580 const containsStatics = Array.isArray(rawKey); 24581 // Unwrap the key if we contain static values. 24582 const key = containsStatics ? rawKey[1] : rawKey; 24583 const isStylingMap = key === null; 24584 let valueAtLViewIndex = lView[index + 1]; 24585 if (valueAtLViewIndex === NO_CHANGE) { 24586 // In firstUpdatePass the styling instructions create a linked list of styling. 24587 // On subsequent passes it is possible for a styling instruction to try to read a binding 24588 // which 24589 // has not yet executed. In that case we will find `NO_CHANGE` and we should assume that 24590 // we have `undefined` (or empty array in case of styling-map instruction) instead. This 24591 // allows the resolution to apply the value (which may later be overwritten when the 24592 // binding actually executes.) 24593 valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY$3 : undefined; 24594 } 24595 let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) : 24596 key === prop ? valueAtLViewIndex : undefined; 24597 if (containsStatics && !isStylingValuePresent(currentValue)) { 24598 currentValue = keyValueArrayGet(rawKey, prop); 24599 } 24600 if (isStylingValuePresent(currentValue)) { 24601 value = currentValue; 24602 if (isPrevDirection) { 24603 return value; 24604 } 24605 } 24606 const tRange = tData[index + 1]; 24607 index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange); 24608 } 24609 if (tNode !== null) { 24610 // in case where we are going in next direction AND we did not find anything, we need to 24611 // consult residual styling 24612 let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles; 24613 if (residual != null /** OR residual !=== undefined */) { 24614 value = keyValueArrayGet(residual, prop); 24615 } 24616 } 24617 return value; 24618} 24619/** 24620 * Determines if the binding value should be used (or if the value is 'undefined' and hence priority 24621 * resolution should be used.) 24622 * 24623 * @param value Binding style value. 24624 */ 24625function isStylingValuePresent(value) { 24626 // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't 24627 // have an opinion as to what this binding should be and you should consult other bindings by 24628 // priority to determine the valid value. 24629 // This is extracted into a single function so that we have a single place to control this. 24630 return value !== undefined; 24631} 24632/** 24633 * Normalizes and/or adds a suffix to the value. 24634 * 24635 * If value is `null`/`undefined` no suffix is added 24636 * @param value 24637 * @param suffix 24638 */ 24639function normalizeSuffix(value, suffix) { 24640 if (value == null /** || value === undefined */) { 24641 // do nothing 24642 } 24643 else if (typeof suffix === 'string') { 24644 value = value + suffix; 24645 } 24646 else if (typeof value === 'object') { 24647 value = stringify(unwrapSafeValue(value)); 24648 } 24649 return value; 24650} 24651/** 24652 * Tests if the `TNode` has input shadow. 24653 * 24654 * An input shadow is when a directive steals (shadows) the input by using `@Input('style')` or 24655 * `@Input('class')` as input. 24656 * 24657 * @param tNode `TNode` which we would like to see if it has shadow. 24658 * @param isClassBased `true` if `class` (`false` if `style`) 24659 */ 24660function hasStylingInputShadow(tNode, isClassBased) { 24661 return (tNode.flags & (isClassBased ? 16 /* hasClassInput */ : 32 /* hasStyleInput */)) !== 0; 24662} 24663 24664/** 24665 * @license 24666 * Copyright Google LLC All Rights Reserved. 24667 * 24668 * Use of this source code is governed by an MIT-style license that can be 24669 * found in the LICENSE file at https://angular.io/license 24670 */ 24671/** 24672 * Create static text node 24673 * 24674 * @param index Index of the node in the data array 24675 * @param value Static string value to write. 24676 * 24677 * @codeGenApi 24678 */ 24679function ɵɵtext(index, value = '') { 24680 const lView = getLView(); 24681 const tView = getTView(); 24682 const adjustedIndex = index + HEADER_OFFSET; 24683 ngDevMode && 24684 assertEqual(getBindingIndex(), tView.bindingStartIndex, 'text nodes should be created before any bindings'); 24685 ngDevMode && assertIndexInRange(lView, adjustedIndex); 24686 const tNode = tView.firstCreatePass ? 24687 getOrCreateTNode(tView, lView[T_HOST], index, 3 /* Element */, null, null) : 24688 tView.data[adjustedIndex]; 24689 const textNative = lView[adjustedIndex] = createTextNode(value, lView[RENDERER]); 24690 appendChild(tView, lView, textNative, tNode); 24691 // Text nodes are self closing. 24692 setPreviousOrParentTNode(tNode, false); 24693} 24694 24695/** 24696 * @license 24697 * Copyright Google LLC All Rights Reserved. 24698 * 24699 * Use of this source code is governed by an MIT-style license that can be 24700 * found in the LICENSE file at https://angular.io/license 24701 */ 24702/** 24703 * 24704 * Update text content with a lone bound value 24705 * 24706 * Used when a text node has 1 interpolated value in it, an no additional text 24707 * surrounds that interpolated value: 24708 * 24709 * ```html 24710 * <div>{{v0}}</div> 24711 * ``` 24712 * 24713 * Its compiled representation is: 24714 * 24715 * ```ts 24716 * ɵɵtextInterpolate(v0); 24717 * ``` 24718 * @returns itself, so that it may be chained. 24719 * @see textInterpolateV 24720 * @codeGenApi 24721 */ 24722function ɵɵtextInterpolate(v0) { 24723 ɵɵtextInterpolate1('', v0, ''); 24724 return ɵɵtextInterpolate; 24725} 24726/** 24727 * 24728 * Update text content with single bound value surrounded by other text. 24729 * 24730 * Used when a text node has 1 interpolated value in it: 24731 * 24732 * ```html 24733 * <div>prefix{{v0}}suffix</div> 24734 * ``` 24735 * 24736 * Its compiled representation is: 24737 * 24738 * ```ts 24739 * ɵɵtextInterpolate1('prefix', v0, 'suffix'); 24740 * ``` 24741 * @returns itself, so that it may be chained. 24742 * @see textInterpolateV 24743 * @codeGenApi 24744 */ 24745function ɵɵtextInterpolate1(prefix, v0, suffix) { 24746 const lView = getLView(); 24747 const interpolated = interpolation1(lView, prefix, v0, suffix); 24748 if (interpolated !== NO_CHANGE) { 24749 textBindingInternal(lView, getSelectedIndex(), interpolated); 24750 } 24751 return ɵɵtextInterpolate1; 24752} 24753/** 24754 * 24755 * Update text content with 2 bound values surrounded by other text. 24756 * 24757 * Used when a text node has 2 interpolated values in it: 24758 * 24759 * ```html 24760 * <div>prefix{{v0}}-{{v1}}suffix</div> 24761 * ``` 24762 * 24763 * Its compiled representation is: 24764 * 24765 * ```ts 24766 * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix'); 24767 * ``` 24768 * @returns itself, so that it may be chained. 24769 * @see textInterpolateV 24770 * @codeGenApi 24771 */ 24772function ɵɵtextInterpolate2(prefix, v0, i0, v1, suffix) { 24773 const lView = getLView(); 24774 const interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix); 24775 if (interpolated !== NO_CHANGE) { 24776 textBindingInternal(lView, getSelectedIndex(), interpolated); 24777 } 24778 return ɵɵtextInterpolate2; 24779} 24780/** 24781 * 24782 * Update text content with 3 bound values surrounded by other text. 24783 * 24784 * Used when a text node has 3 interpolated values in it: 24785 * 24786 * ```html 24787 * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div> 24788 * ``` 24789 * 24790 * Its compiled representation is: 24791 * 24792 * ```ts 24793 * ɵɵtextInterpolate3( 24794 * 'prefix', v0, '-', v1, '-', v2, 'suffix'); 24795 * ``` 24796 * @returns itself, so that it may be chained. 24797 * @see textInterpolateV 24798 * @codeGenApi 24799 */ 24800function ɵɵtextInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) { 24801 const lView = getLView(); 24802 const interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix); 24803 if (interpolated !== NO_CHANGE) { 24804 textBindingInternal(lView, getSelectedIndex(), interpolated); 24805 } 24806 return ɵɵtextInterpolate3; 24807} 24808/** 24809 * 24810 * Update text content with 4 bound values surrounded by other text. 24811 * 24812 * Used when a text node has 4 interpolated values in it: 24813 * 24814 * ```html 24815 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div> 24816 * ``` 24817 * 24818 * Its compiled representation is: 24819 * 24820 * ```ts 24821 * ɵɵtextInterpolate4( 24822 * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix'); 24823 * ``` 24824 * @returns itself, so that it may be chained. 24825 * @see ɵɵtextInterpolateV 24826 * @codeGenApi 24827 */ 24828function ɵɵtextInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) { 24829 const lView = getLView(); 24830 const interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix); 24831 if (interpolated !== NO_CHANGE) { 24832 textBindingInternal(lView, getSelectedIndex(), interpolated); 24833 } 24834 return ɵɵtextInterpolate4; 24835} 24836/** 24837 * 24838 * Update text content with 5 bound values surrounded by other text. 24839 * 24840 * Used when a text node has 5 interpolated values in it: 24841 * 24842 * ```html 24843 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div> 24844 * ``` 24845 * 24846 * Its compiled representation is: 24847 * 24848 * ```ts 24849 * ɵɵtextInterpolate5( 24850 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix'); 24851 * ``` 24852 * @returns itself, so that it may be chained. 24853 * @see textInterpolateV 24854 * @codeGenApi 24855 */ 24856function ɵɵtextInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) { 24857 const lView = getLView(); 24858 const interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix); 24859 if (interpolated !== NO_CHANGE) { 24860 textBindingInternal(lView, getSelectedIndex(), interpolated); 24861 } 24862 return ɵɵtextInterpolate5; 24863} 24864/** 24865 * 24866 * Update text content with 6 bound values surrounded by other text. 24867 * 24868 * Used when a text node has 6 interpolated values in it: 24869 * 24870 * ```html 24871 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div> 24872 * ``` 24873 * 24874 * Its compiled representation is: 24875 * 24876 * ```ts 24877 * ɵɵtextInterpolate6( 24878 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix'); 24879 * ``` 24880 * 24881 * @param i4 Static value used for concatenation only. 24882 * @param v5 Value checked for change. @returns itself, so that it may be chained. 24883 * @see textInterpolateV 24884 * @codeGenApi 24885 */ 24886function ɵɵtextInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) { 24887 const lView = getLView(); 24888 const interpolated = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix); 24889 if (interpolated !== NO_CHANGE) { 24890 textBindingInternal(lView, getSelectedIndex(), interpolated); 24891 } 24892 return ɵɵtextInterpolate6; 24893} 24894/** 24895 * 24896 * Update text content with 7 bound values surrounded by other text. 24897 * 24898 * Used when a text node has 7 interpolated values in it: 24899 * 24900 * ```html 24901 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div> 24902 * ``` 24903 * 24904 * Its compiled representation is: 24905 * 24906 * ```ts 24907 * ɵɵtextInterpolate7( 24908 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix'); 24909 * ``` 24910 * @returns itself, so that it may be chained. 24911 * @see textInterpolateV 24912 * @codeGenApi 24913 */ 24914function ɵɵtextInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) { 24915 const lView = getLView(); 24916 const interpolated = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix); 24917 if (interpolated !== NO_CHANGE) { 24918 textBindingInternal(lView, getSelectedIndex(), interpolated); 24919 } 24920 return ɵɵtextInterpolate7; 24921} 24922/** 24923 * 24924 * Update text content with 8 bound values surrounded by other text. 24925 * 24926 * Used when a text node has 8 interpolated values in it: 24927 * 24928 * ```html 24929 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div> 24930 * ``` 24931 * 24932 * Its compiled representation is: 24933 * 24934 * ```ts 24935 * ɵɵtextInterpolate8( 24936 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix'); 24937 * ``` 24938 * @returns itself, so that it may be chained. 24939 * @see textInterpolateV 24940 * @codeGenApi 24941 */ 24942function ɵɵtextInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) { 24943 const lView = getLView(); 24944 const interpolated = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix); 24945 if (interpolated !== NO_CHANGE) { 24946 textBindingInternal(lView, getSelectedIndex(), interpolated); 24947 } 24948 return ɵɵtextInterpolate8; 24949} 24950/** 24951 * Update text content with 9 or more bound values other surrounded by text. 24952 * 24953 * Used when the number of interpolated values exceeds 8. 24954 * 24955 * ```html 24956 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div> 24957 * ``` 24958 * 24959 * Its compiled representation is: 24960 * 24961 * ```ts 24962 * ɵɵtextInterpolateV( 24963 * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9, 24964 * 'suffix']); 24965 * ``` 24966 *. 24967 * @param values The collection of values and the strings in between those values, beginning with 24968 * a string prefix and ending with a string suffix. 24969 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`) 24970 * 24971 * @returns itself, so that it may be chained. 24972 * @codeGenApi 24973 */ 24974function ɵɵtextInterpolateV(values) { 24975 const lView = getLView(); 24976 const interpolated = interpolationV(lView, values); 24977 if (interpolated !== NO_CHANGE) { 24978 textBindingInternal(lView, getSelectedIndex(), interpolated); 24979 } 24980 return ɵɵtextInterpolateV; 24981} 24982 24983/** 24984 * @license 24985 * Copyright Google LLC All Rights Reserved. 24986 * 24987 * Use of this source code is governed by an MIT-style license that can be 24988 * found in the LICENSE file at https://angular.io/license 24989 */ 24990/** 24991 * 24992 * Update an interpolated class on an element with single bound value surrounded by text. 24993 * 24994 * Used when the value passed to a property has 1 interpolated value in it: 24995 * 24996 * ```html 24997 * <div class="prefix{{v0}}suffix"></div> 24998 * ``` 24999 * 25000 * Its compiled representation is: 25001 * 25002 * ```ts 25003 * ɵɵclassMapInterpolate1('prefix', v0, 'suffix'); 25004 * ``` 25005 * 25006 * @param prefix Static value used for concatenation only. 25007 * @param v0 Value checked for change. 25008 * @param suffix Static value used for concatenation only. 25009 * @codeGenApi 25010 */ 25011function ɵɵclassMapInterpolate1(prefix, v0, suffix) { 25012 const lView = getLView(); 25013 const interpolatedValue = interpolation1(lView, prefix, v0, suffix); 25014 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25015} 25016/** 25017 * 25018 * Update an interpolated class on an element with 2 bound values surrounded by text. 25019 * 25020 * Used when the value passed to a property has 2 interpolated values in it: 25021 * 25022 * ```html 25023 * <div class="prefix{{v0}}-{{v1}}suffix"></div> 25024 * ``` 25025 * 25026 * Its compiled representation is: 25027 * 25028 * ```ts 25029 * ɵɵclassMapInterpolate2('prefix', v0, '-', v1, 'suffix'); 25030 * ``` 25031 * 25032 * @param prefix Static value used for concatenation only. 25033 * @param v0 Value checked for change. 25034 * @param i0 Static value used for concatenation only. 25035 * @param v1 Value checked for change. 25036 * @param suffix Static value used for concatenation only. 25037 * @codeGenApi 25038 */ 25039function ɵɵclassMapInterpolate2(prefix, v0, i0, v1, suffix) { 25040 const lView = getLView(); 25041 const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix); 25042 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25043} 25044/** 25045 * 25046 * Update an interpolated class on an element with 3 bound values surrounded by text. 25047 * 25048 * Used when the value passed to a property has 3 interpolated values in it: 25049 * 25050 * ```html 25051 * <div class="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div> 25052 * ``` 25053 * 25054 * Its compiled representation is: 25055 * 25056 * ```ts 25057 * ɵɵclassMapInterpolate3( 25058 * 'prefix', v0, '-', v1, '-', v2, 'suffix'); 25059 * ``` 25060 * 25061 * @param prefix Static value used for concatenation only. 25062 * @param v0 Value checked for change. 25063 * @param i0 Static value used for concatenation only. 25064 * @param v1 Value checked for change. 25065 * @param i1 Static value used for concatenation only. 25066 * @param v2 Value checked for change. 25067 * @param suffix Static value used for concatenation only. 25068 * @codeGenApi 25069 */ 25070function ɵɵclassMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) { 25071 const lView = getLView(); 25072 const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix); 25073 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25074} 25075/** 25076 * 25077 * Update an interpolated class on an element with 4 bound values surrounded by text. 25078 * 25079 * Used when the value passed to a property has 4 interpolated values in it: 25080 * 25081 * ```html 25082 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div> 25083 * ``` 25084 * 25085 * Its compiled representation is: 25086 * 25087 * ```ts 25088 * ɵɵclassMapInterpolate4( 25089 * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix'); 25090 * ``` 25091 * 25092 * @param prefix Static value used for concatenation only. 25093 * @param v0 Value checked for change. 25094 * @param i0 Static value used for concatenation only. 25095 * @param v1 Value checked for change. 25096 * @param i1 Static value used for concatenation only. 25097 * @param v2 Value checked for change. 25098 * @param i2 Static value used for concatenation only. 25099 * @param v3 Value checked for change. 25100 * @param suffix Static value used for concatenation only. 25101 * @codeGenApi 25102 */ 25103function ɵɵclassMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) { 25104 const lView = getLView(); 25105 const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix); 25106 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25107} 25108/** 25109 * 25110 * Update an interpolated class on an element with 5 bound values surrounded by text. 25111 * 25112 * Used when the value passed to a property has 5 interpolated values in it: 25113 * 25114 * ```html 25115 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div> 25116 * ``` 25117 * 25118 * Its compiled representation is: 25119 * 25120 * ```ts 25121 * ɵɵclassMapInterpolate5( 25122 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix'); 25123 * ``` 25124 * 25125 * @param prefix Static value used for concatenation only. 25126 * @param v0 Value checked for change. 25127 * @param i0 Static value used for concatenation only. 25128 * @param v1 Value checked for change. 25129 * @param i1 Static value used for concatenation only. 25130 * @param v2 Value checked for change. 25131 * @param i2 Static value used for concatenation only. 25132 * @param v3 Value checked for change. 25133 * @param i3 Static value used for concatenation only. 25134 * @param v4 Value checked for change. 25135 * @param suffix Static value used for concatenation only. 25136 * @codeGenApi 25137 */ 25138function ɵɵclassMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) { 25139 const lView = getLView(); 25140 const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix); 25141 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25142} 25143/** 25144 * 25145 * Update an interpolated class on an element with 6 bound values surrounded by text. 25146 * 25147 * Used when the value passed to a property has 6 interpolated values in it: 25148 * 25149 * ```html 25150 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div> 25151 * ``` 25152 * 25153 * Its compiled representation is: 25154 * 25155 * ```ts 25156 * ɵɵclassMapInterpolate6( 25157 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix'); 25158 * ``` 25159 * 25160 * @param prefix Static value used for concatenation only. 25161 * @param v0 Value checked for change. 25162 * @param i0 Static value used for concatenation only. 25163 * @param v1 Value checked for change. 25164 * @param i1 Static value used for concatenation only. 25165 * @param v2 Value checked for change. 25166 * @param i2 Static value used for concatenation only. 25167 * @param v3 Value checked for change. 25168 * @param i3 Static value used for concatenation only. 25169 * @param v4 Value checked for change. 25170 * @param i4 Static value used for concatenation only. 25171 * @param v5 Value checked for change. 25172 * @param suffix Static value used for concatenation only. 25173 * @codeGenApi 25174 */ 25175function ɵɵclassMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) { 25176 const lView = getLView(); 25177 const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix); 25178 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25179} 25180/** 25181 * 25182 * Update an interpolated class on an element with 7 bound values surrounded by text. 25183 * 25184 * Used when the value passed to a property has 7 interpolated values in it: 25185 * 25186 * ```html 25187 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div> 25188 * ``` 25189 * 25190 * Its compiled representation is: 25191 * 25192 * ```ts 25193 * ɵɵclassMapInterpolate7( 25194 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix'); 25195 * ``` 25196 * 25197 * @param prefix Static value used for concatenation only. 25198 * @param v0 Value checked for change. 25199 * @param i0 Static value used for concatenation only. 25200 * @param v1 Value checked for change. 25201 * @param i1 Static value used for concatenation only. 25202 * @param v2 Value checked for change. 25203 * @param i2 Static value used for concatenation only. 25204 * @param v3 Value checked for change. 25205 * @param i3 Static value used for concatenation only. 25206 * @param v4 Value checked for change. 25207 * @param i4 Static value used for concatenation only. 25208 * @param v5 Value checked for change. 25209 * @param i5 Static value used for concatenation only. 25210 * @param v6 Value checked for change. 25211 * @param suffix Static value used for concatenation only. 25212 * @codeGenApi 25213 */ 25214function ɵɵclassMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) { 25215 const lView = getLView(); 25216 const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix); 25217 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25218} 25219/** 25220 * 25221 * Update an interpolated class on an element with 8 bound values surrounded by text. 25222 * 25223 * Used when the value passed to a property has 8 interpolated values in it: 25224 * 25225 * ```html 25226 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div> 25227 * ``` 25228 * 25229 * Its compiled representation is: 25230 * 25231 * ```ts 25232 * ɵɵclassMapInterpolate8( 25233 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix'); 25234 * ``` 25235 * 25236 * @param prefix Static value used for concatenation only. 25237 * @param v0 Value checked for change. 25238 * @param i0 Static value used for concatenation only. 25239 * @param v1 Value checked for change. 25240 * @param i1 Static value used for concatenation only. 25241 * @param v2 Value checked for change. 25242 * @param i2 Static value used for concatenation only. 25243 * @param v3 Value checked for change. 25244 * @param i3 Static value used for concatenation only. 25245 * @param v4 Value checked for change. 25246 * @param i4 Static value used for concatenation only. 25247 * @param v5 Value checked for change. 25248 * @param i5 Static value used for concatenation only. 25249 * @param v6 Value checked for change. 25250 * @param i6 Static value used for concatenation only. 25251 * @param v7 Value checked for change. 25252 * @param suffix Static value used for concatenation only. 25253 * @codeGenApi 25254 */ 25255function ɵɵclassMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) { 25256 const lView = getLView(); 25257 const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix); 25258 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25259} 25260/** 25261 * Update an interpolated class on an element with 9 or more bound values surrounded by text. 25262 * 25263 * Used when the number of interpolated values exceeds 8. 25264 * 25265 * ```html 25266 * <div 25267 * class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div> 25268 * ``` 25269 * 25270 * Its compiled representation is: 25271 * 25272 * ```ts 25273 * ɵɵclassMapInterpolateV( 25274 * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9, 25275 * 'suffix']); 25276 * ``` 25277 *. 25278 * @param values The collection of values and the strings in-between those values, beginning with 25279 * a string prefix and ending with a string suffix. 25280 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`) 25281 * @codeGenApi 25282 */ 25283function ɵɵclassMapInterpolateV(values) { 25284 const lView = getLView(); 25285 const interpolatedValue = interpolationV(lView, values); 25286 checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true); 25287} 25288 25289/** 25290 * @license 25291 * Copyright Google LLC All Rights Reserved. 25292 * 25293 * Use of this source code is governed by an MIT-style license that can be 25294 * found in the LICENSE file at https://angular.io/license 25295 */ 25296/** 25297 * 25298 * Update an interpolated style on an element with single bound value surrounded by text. 25299 * 25300 * Used when the value passed to a property has 1 interpolated value in it: 25301 * 25302 * ```html 25303 * <div style="key: {{v0}}suffix"></div> 25304 * ``` 25305 * 25306 * Its compiled representation is: 25307 * 25308 * ```ts 25309 * ɵɵstyleMapInterpolate1('key: ', v0, 'suffix'); 25310 * ``` 25311 * 25312 * @param prefix Static value used for concatenation only. 25313 * @param v0 Value checked for change. 25314 * @param suffix Static value used for concatenation only. 25315 * @codeGenApi 25316 */ 25317function ɵɵstyleMapInterpolate1(prefix, v0, suffix) { 25318 const lView = getLView(); 25319 const interpolatedValue = interpolation1(lView, prefix, v0, suffix); 25320 ɵɵstyleMap(interpolatedValue); 25321} 25322/** 25323 * 25324 * Update an interpolated style on an element with 2 bound values surrounded by text. 25325 * 25326 * Used when the value passed to a property has 2 interpolated values in it: 25327 * 25328 * ```html 25329 * <div style="key: {{v0}}; key1: {{v1}}suffix"></div> 25330 * ``` 25331 * 25332 * Its compiled representation is: 25333 * 25334 * ```ts 25335 * ɵɵstyleMapInterpolate2('key: ', v0, '; key1: ', v1, 'suffix'); 25336 * ``` 25337 * 25338 * @param prefix Static value used for concatenation only. 25339 * @param v0 Value checked for change. 25340 * @param i0 Static value used for concatenation only. 25341 * @param v1 Value checked for change. 25342 * @param suffix Static value used for concatenation only. 25343 * @codeGenApi 25344 */ 25345function ɵɵstyleMapInterpolate2(prefix, v0, i0, v1, suffix) { 25346 const lView = getLView(); 25347 const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix); 25348 ɵɵstyleMap(interpolatedValue); 25349} 25350/** 25351 * 25352 * Update an interpolated style on an element with 3 bound values surrounded by text. 25353 * 25354 * Used when the value passed to a property has 3 interpolated values in it: 25355 * 25356 * ```html 25357 * <div style="key: {{v0}}; key2: {{v1}}; key2: {{v2}}suffix"></div> 25358 * ``` 25359 * 25360 * Its compiled representation is: 25361 * 25362 * ```ts 25363 * ɵɵstyleMapInterpolate3( 25364 * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, 'suffix'); 25365 * ``` 25366 * 25367 * @param prefix Static value used for concatenation only. 25368 * @param v0 Value checked for change. 25369 * @param i0 Static value used for concatenation only. 25370 * @param v1 Value checked for change. 25371 * @param i1 Static value used for concatenation only. 25372 * @param v2 Value checked for change. 25373 * @param suffix Static value used for concatenation only. 25374 * @codeGenApi 25375 */ 25376function ɵɵstyleMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) { 25377 const lView = getLView(); 25378 const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix); 25379 ɵɵstyleMap(interpolatedValue); 25380} 25381/** 25382 * 25383 * Update an interpolated style on an element with 4 bound values surrounded by text. 25384 * 25385 * Used when the value passed to a property has 4 interpolated values in it: 25386 * 25387 * ```html 25388 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}suffix"></div> 25389 * ``` 25390 * 25391 * Its compiled representation is: 25392 * 25393 * ```ts 25394 * ɵɵstyleMapInterpolate4( 25395 * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, 'suffix'); 25396 * ``` 25397 * 25398 * @param prefix Static value used for concatenation only. 25399 * @param v0 Value checked for change. 25400 * @param i0 Static value used for concatenation only. 25401 * @param v1 Value checked for change. 25402 * @param i1 Static value used for concatenation only. 25403 * @param v2 Value checked for change. 25404 * @param i2 Static value used for concatenation only. 25405 * @param v3 Value checked for change. 25406 * @param suffix Static value used for concatenation only. 25407 * @codeGenApi 25408 */ 25409function ɵɵstyleMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) { 25410 const lView = getLView(); 25411 const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix); 25412 ɵɵstyleMap(interpolatedValue); 25413} 25414/** 25415 * 25416 * Update an interpolated style on an element with 5 bound values surrounded by text. 25417 * 25418 * Used when the value passed to a property has 5 interpolated values in it: 25419 * 25420 * ```html 25421 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}suffix"></div> 25422 * ``` 25423 * 25424 * Its compiled representation is: 25425 * 25426 * ```ts 25427 * ɵɵstyleMapInterpolate5( 25428 * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, 'suffix'); 25429 * ``` 25430 * 25431 * @param prefix Static value used for concatenation only. 25432 * @param v0 Value checked for change. 25433 * @param i0 Static value used for concatenation only. 25434 * @param v1 Value checked for change. 25435 * @param i1 Static value used for concatenation only. 25436 * @param v2 Value checked for change. 25437 * @param i2 Static value used for concatenation only. 25438 * @param v3 Value checked for change. 25439 * @param i3 Static value used for concatenation only. 25440 * @param v4 Value checked for change. 25441 * @param suffix Static value used for concatenation only. 25442 * @codeGenApi 25443 */ 25444function ɵɵstyleMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) { 25445 const lView = getLView(); 25446 const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix); 25447 ɵɵstyleMap(interpolatedValue); 25448} 25449/** 25450 * 25451 * Update an interpolated style on an element with 6 bound values surrounded by text. 25452 * 25453 * Used when the value passed to a property has 6 interpolated values in it: 25454 * 25455 * ```html 25456 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; 25457 * key5: {{v5}}suffix"></div> 25458 * ``` 25459 * 25460 * Its compiled representation is: 25461 * 25462 * ```ts 25463 * ɵɵstyleMapInterpolate6( 25464 * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5, 25465 * 'suffix'); 25466 * ``` 25467 * 25468 * @param prefix Static value used for concatenation only. 25469 * @param v0 Value checked for change. 25470 * @param i0 Static value used for concatenation only. 25471 * @param v1 Value checked for change. 25472 * @param i1 Static value used for concatenation only. 25473 * @param v2 Value checked for change. 25474 * @param i2 Static value used for concatenation only. 25475 * @param v3 Value checked for change. 25476 * @param i3 Static value used for concatenation only. 25477 * @param v4 Value checked for change. 25478 * @param i4 Static value used for concatenation only. 25479 * @param v5 Value checked for change. 25480 * @param suffix Static value used for concatenation only. 25481 * @codeGenApi 25482 */ 25483function ɵɵstyleMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) { 25484 const lView = getLView(); 25485 const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix); 25486 ɵɵstyleMap(interpolatedValue); 25487} 25488/** 25489 * 25490 * Update an interpolated style on an element with 7 bound values surrounded by text. 25491 * 25492 * Used when the value passed to a property has 7 interpolated values in it: 25493 * 25494 * ```html 25495 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}}; 25496 * key6: {{v6}}suffix"></div> 25497 * ``` 25498 * 25499 * Its compiled representation is: 25500 * 25501 * ```ts 25502 * ɵɵstyleMapInterpolate7( 25503 * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5, 25504 * '; key6: ', v6, 'suffix'); 25505 * ``` 25506 * 25507 * @param prefix Static value used for concatenation only. 25508 * @param v0 Value checked for change. 25509 * @param i0 Static value used for concatenation only. 25510 * @param v1 Value checked for change. 25511 * @param i1 Static value used for concatenation only. 25512 * @param v2 Value checked for change. 25513 * @param i2 Static value used for concatenation only. 25514 * @param v3 Value checked for change. 25515 * @param i3 Static value used for concatenation only. 25516 * @param v4 Value checked for change. 25517 * @param i4 Static value used for concatenation only. 25518 * @param v5 Value checked for change. 25519 * @param i5 Static value used for concatenation only. 25520 * @param v6 Value checked for change. 25521 * @param suffix Static value used for concatenation only. 25522 * @codeGenApi 25523 */ 25524function ɵɵstyleMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) { 25525 const lView = getLView(); 25526 const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix); 25527 ɵɵstyleMap(interpolatedValue); 25528} 25529/** 25530 * 25531 * Update an interpolated style on an element with 8 bound values surrounded by text. 25532 * 25533 * Used when the value passed to a property has 8 interpolated values in it: 25534 * 25535 * ```html 25536 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}}; 25537 * key6: {{v6}}; key7: {{v7}}suffix"></div> 25538 * ``` 25539 * 25540 * Its compiled representation is: 25541 * 25542 * ```ts 25543 * ɵɵstyleMapInterpolate8( 25544 * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5, 25545 * '; key6: ', v6, '; key7: ', v7, 'suffix'); 25546 * ``` 25547 * 25548 * @param prefix Static value used for concatenation only. 25549 * @param v0 Value checked for change. 25550 * @param i0 Static value used for concatenation only. 25551 * @param v1 Value checked for change. 25552 * @param i1 Static value used for concatenation only. 25553 * @param v2 Value checked for change. 25554 * @param i2 Static value used for concatenation only. 25555 * @param v3 Value checked for change. 25556 * @param i3 Static value used for concatenation only. 25557 * @param v4 Value checked for change. 25558 * @param i4 Static value used for concatenation only. 25559 * @param v5 Value checked for change. 25560 * @param i5 Static value used for concatenation only. 25561 * @param v6 Value checked for change. 25562 * @param i6 Static value used for concatenation only. 25563 * @param v7 Value checked for change. 25564 * @param suffix Static value used for concatenation only. 25565 * @codeGenApi 25566 */ 25567function ɵɵstyleMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) { 25568 const lView = getLView(); 25569 const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix); 25570 ɵɵstyleMap(interpolatedValue); 25571} 25572/** 25573 * Update an interpolated style on an element with 9 or more bound values surrounded by text. 25574 * 25575 * Used when the number of interpolated values exceeds 8. 25576 * 25577 * ```html 25578 * <div 25579 * class="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}}; 25580 * key6: {{v6}}; key7: {{v7}}; key8: {{v8}}; key9: {{v9}}suffix"></div> 25581 * ``` 25582 * 25583 * Its compiled representation is: 25584 * 25585 * ```ts 25586 * ɵɵstyleMapInterpolateV( 25587 * ['key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5, 25588 * '; key6: ', v6, '; key7: ', v7, '; key8: ', v8, '; key9: ', v9, 'suffix']); 25589 * ``` 25590 *. 25591 * @param values The collection of values and the strings in-between those values, beginning with 25592 * a string prefix and ending with a string suffix. 25593 * (e.g. `['prefix', value0, '; key2: ', value1, '; key2: ', value2, ..., value99, 'suffix']`) 25594 * @codeGenApi 25595 */ 25596function ɵɵstyleMapInterpolateV(values) { 25597 const lView = getLView(); 25598 const interpolatedValue = interpolationV(lView, values); 25599 ɵɵstyleMap(interpolatedValue); 25600} 25601 25602/** 25603 * @license 25604 * Copyright Google LLC All Rights Reserved. 25605 * 25606 * Use of this source code is governed by an MIT-style license that can be 25607 * found in the LICENSE file at https://angular.io/license 25608 */ 25609/** 25610 * 25611 * Update an interpolated style property on an element with single bound value surrounded by text. 25612 * 25613 * Used when the value passed to a property has 1 interpolated value in it: 25614 * 25615 * ```html 25616 * <div style.color="prefix{{v0}}suffix"></div> 25617 * ``` 25618 * 25619 * Its compiled representation is: 25620 * 25621 * ```ts 25622 * ɵɵstylePropInterpolate1(0, 'prefix', v0, 'suffix'); 25623 * ``` 25624 * 25625 * @param styleIndex Index of style to update. This index value refers to the 25626 * index of the style in the style bindings array that was passed into 25627 * `styling`. 25628 * @param prefix Static value used for concatenation only. 25629 * @param v0 Value checked for change. 25630 * @param suffix Static value used for concatenation only. 25631 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25632 * @returns itself, so that it may be chained. 25633 * @codeGenApi 25634 */ 25635function ɵɵstylePropInterpolate1(prop, prefix, v0, suffix, valueSuffix) { 25636 const lView = getLView(); 25637 const interpolatedValue = interpolation1(lView, prefix, v0, suffix); 25638 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25639 return ɵɵstylePropInterpolate1; 25640} 25641/** 25642 * 25643 * Update an interpolated style property on an element with 2 bound values surrounded by text. 25644 * 25645 * Used when the value passed to a property has 2 interpolated values in it: 25646 * 25647 * ```html 25648 * <div style.color="prefix{{v0}}-{{v1}}suffix"></div> 25649 * ``` 25650 * 25651 * Its compiled representation is: 25652 * 25653 * ```ts 25654 * ɵɵstylePropInterpolate2(0, 'prefix', v0, '-', v1, 'suffix'); 25655 * ``` 25656 * 25657 * @param styleIndex Index of style to update. This index value refers to the 25658 * index of the style in the style bindings array that was passed into 25659 * `styling`. 25660 * @param prefix Static value used for concatenation only. 25661 * @param v0 Value checked for change. 25662 * @param i0 Static value used for concatenation only. 25663 * @param v1 Value checked for change. 25664 * @param suffix Static value used for concatenation only. 25665 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25666 * @returns itself, so that it may be chained. 25667 * @codeGenApi 25668 */ 25669function ɵɵstylePropInterpolate2(prop, prefix, v0, i0, v1, suffix, valueSuffix) { 25670 const lView = getLView(); 25671 const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix); 25672 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25673 return ɵɵstylePropInterpolate2; 25674} 25675/** 25676 * 25677 * Update an interpolated style property on an element with 3 bound values surrounded by text. 25678 * 25679 * Used when the value passed to a property has 3 interpolated values in it: 25680 * 25681 * ```html 25682 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div> 25683 * ``` 25684 * 25685 * Its compiled representation is: 25686 * 25687 * ```ts 25688 * ɵɵstylePropInterpolate3(0, 'prefix', v0, '-', v1, '-', v2, 'suffix'); 25689 * ``` 25690 * 25691 * @param styleIndex Index of style to update. This index value refers to the 25692 * index of the style in the style bindings array that was passed into 25693 * `styling`. 25694 * @param prefix Static value used for concatenation only. 25695 * @param v0 Value checked for change. 25696 * @param i0 Static value used for concatenation only. 25697 * @param v1 Value checked for change. 25698 * @param i1 Static value used for concatenation only. 25699 * @param v2 Value checked for change. 25700 * @param suffix Static value used for concatenation only. 25701 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25702 * @returns itself, so that it may be chained. 25703 * @codeGenApi 25704 */ 25705function ɵɵstylePropInterpolate3(prop, prefix, v0, i0, v1, i1, v2, suffix, valueSuffix) { 25706 const lView = getLView(); 25707 const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix); 25708 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25709 return ɵɵstylePropInterpolate3; 25710} 25711/** 25712 * 25713 * Update an interpolated style property on an element with 4 bound values surrounded by text. 25714 * 25715 * Used when the value passed to a property has 4 interpolated values in it: 25716 * 25717 * ```html 25718 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div> 25719 * ``` 25720 * 25721 * Its compiled representation is: 25722 * 25723 * ```ts 25724 * ɵɵstylePropInterpolate4(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix'); 25725 * ``` 25726 * 25727 * @param styleIndex Index of style to update. This index value refers to the 25728 * index of the style in the style bindings array that was passed into 25729 * `styling`. 25730 * @param prefix Static value used for concatenation only. 25731 * @param v0 Value checked for change. 25732 * @param i0 Static value used for concatenation only. 25733 * @param v1 Value checked for change. 25734 * @param i1 Static value used for concatenation only. 25735 * @param v2 Value checked for change. 25736 * @param i2 Static value used for concatenation only. 25737 * @param v3 Value checked for change. 25738 * @param suffix Static value used for concatenation only. 25739 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25740 * @returns itself, so that it may be chained. 25741 * @codeGenApi 25742 */ 25743function ɵɵstylePropInterpolate4(prop, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, valueSuffix) { 25744 const lView = getLView(); 25745 const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix); 25746 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25747 return ɵɵstylePropInterpolate4; 25748} 25749/** 25750 * 25751 * Update an interpolated style property on an element with 5 bound values surrounded by text. 25752 * 25753 * Used when the value passed to a property has 5 interpolated values in it: 25754 * 25755 * ```html 25756 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div> 25757 * ``` 25758 * 25759 * Its compiled representation is: 25760 * 25761 * ```ts 25762 * ɵɵstylePropInterpolate5(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix'); 25763 * ``` 25764 * 25765 * @param styleIndex Index of style to update. This index value refers to the 25766 * index of the style in the style bindings array that was passed into 25767 * `styling`. 25768 * @param prefix Static value used for concatenation only. 25769 * @param v0 Value checked for change. 25770 * @param i0 Static value used for concatenation only. 25771 * @param v1 Value checked for change. 25772 * @param i1 Static value used for concatenation only. 25773 * @param v2 Value checked for change. 25774 * @param i2 Static value used for concatenation only. 25775 * @param v3 Value checked for change. 25776 * @param i3 Static value used for concatenation only. 25777 * @param v4 Value checked for change. 25778 * @param suffix Static value used for concatenation only. 25779 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25780 * @returns itself, so that it may be chained. 25781 * @codeGenApi 25782 */ 25783function ɵɵstylePropInterpolate5(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, valueSuffix) { 25784 const lView = getLView(); 25785 const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix); 25786 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25787 return ɵɵstylePropInterpolate5; 25788} 25789/** 25790 * 25791 * Update an interpolated style property on an element with 6 bound values surrounded by text. 25792 * 25793 * Used when the value passed to a property has 6 interpolated values in it: 25794 * 25795 * ```html 25796 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div> 25797 * ``` 25798 * 25799 * Its compiled representation is: 25800 * 25801 * ```ts 25802 * ɵɵstylePropInterpolate6(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix'); 25803 * ``` 25804 * 25805 * @param styleIndex Index of style to update. This index value refers to the 25806 * index of the style in the style bindings array that was passed into 25807 * `styling`. 25808 * @param prefix Static value used for concatenation only. 25809 * @param v0 Value checked for change. 25810 * @param i0 Static value used for concatenation only. 25811 * @param v1 Value checked for change. 25812 * @param i1 Static value used for concatenation only. 25813 * @param v2 Value checked for change. 25814 * @param i2 Static value used for concatenation only. 25815 * @param v3 Value checked for change. 25816 * @param i3 Static value used for concatenation only. 25817 * @param v4 Value checked for change. 25818 * @param i4 Static value used for concatenation only. 25819 * @param v5 Value checked for change. 25820 * @param suffix Static value used for concatenation only. 25821 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25822 * @returns itself, so that it may be chained. 25823 * @codeGenApi 25824 */ 25825function ɵɵstylePropInterpolate6(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, valueSuffix) { 25826 const lView = getLView(); 25827 const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix); 25828 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25829 return ɵɵstylePropInterpolate6; 25830} 25831/** 25832 * 25833 * Update an interpolated style property on an element with 7 bound values surrounded by text. 25834 * 25835 * Used when the value passed to a property has 7 interpolated values in it: 25836 * 25837 * ```html 25838 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div> 25839 * ``` 25840 * 25841 * Its compiled representation is: 25842 * 25843 * ```ts 25844 * ɵɵstylePropInterpolate7( 25845 * 0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix'); 25846 * ``` 25847 * 25848 * @param styleIndex Index of style to update. This index value refers to the 25849 * index of the style in the style bindings array that was passed into 25850 * `styling`. 25851 * @param prefix Static value used for concatenation only. 25852 * @param v0 Value checked for change. 25853 * @param i0 Static value used for concatenation only. 25854 * @param v1 Value checked for change. 25855 * @param i1 Static value used for concatenation only. 25856 * @param v2 Value checked for change. 25857 * @param i2 Static value used for concatenation only. 25858 * @param v3 Value checked for change. 25859 * @param i3 Static value used for concatenation only. 25860 * @param v4 Value checked for change. 25861 * @param i4 Static value used for concatenation only. 25862 * @param v5 Value checked for change. 25863 * @param i5 Static value used for concatenation only. 25864 * @param v6 Value checked for change. 25865 * @param suffix Static value used for concatenation only. 25866 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25867 * @returns itself, so that it may be chained. 25868 * @codeGenApi 25869 */ 25870function ɵɵstylePropInterpolate7(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, valueSuffix) { 25871 const lView = getLView(); 25872 const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix); 25873 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25874 return ɵɵstylePropInterpolate7; 25875} 25876/** 25877 * 25878 * Update an interpolated style property on an element with 8 bound values surrounded by text. 25879 * 25880 * Used when the value passed to a property has 8 interpolated values in it: 25881 * 25882 * ```html 25883 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div> 25884 * ``` 25885 * 25886 * Its compiled representation is: 25887 * 25888 * ```ts 25889 * ɵɵstylePropInterpolate8(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 25890 * '-', v7, 'suffix'); 25891 * ``` 25892 * 25893 * @param styleIndex Index of style to update. This index value refers to the 25894 * index of the style in the style bindings array that was passed into 25895 * `styling`. 25896 * @param prefix Static value used for concatenation only. 25897 * @param v0 Value checked for change. 25898 * @param i0 Static value used for concatenation only. 25899 * @param v1 Value checked for change. 25900 * @param i1 Static value used for concatenation only. 25901 * @param v2 Value checked for change. 25902 * @param i2 Static value used for concatenation only. 25903 * @param v3 Value checked for change. 25904 * @param i3 Static value used for concatenation only. 25905 * @param v4 Value checked for change. 25906 * @param i4 Static value used for concatenation only. 25907 * @param v5 Value checked for change. 25908 * @param i5 Static value used for concatenation only. 25909 * @param v6 Value checked for change. 25910 * @param i6 Static value used for concatenation only. 25911 * @param v7 Value checked for change. 25912 * @param suffix Static value used for concatenation only. 25913 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25914 * @returns itself, so that it may be chained. 25915 * @codeGenApi 25916 */ 25917function ɵɵstylePropInterpolate8(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, valueSuffix) { 25918 const lView = getLView(); 25919 const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix); 25920 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25921 return ɵɵstylePropInterpolate8; 25922} 25923/** 25924 * Update an interpolated style property on an element with 9 or more bound values surrounded by 25925 * text. 25926 * 25927 * Used when the number of interpolated values exceeds 8. 25928 * 25929 * ```html 25930 * <div 25931 * style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"> 25932 * </div> 25933 * ``` 25934 * 25935 * Its compiled representation is: 25936 * 25937 * ```ts 25938 * ɵɵstylePropInterpolateV( 25939 * 0, ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9, 25940 * 'suffix']); 25941 * ``` 25942 * 25943 * @param styleIndex Index of style to update. This index value refers to the 25944 * index of the style in the style bindings array that was passed into 25945 * `styling`.. 25946 * @param values The collection of values and the strings in-between those values, beginning with 25947 * a string prefix and ending with a string suffix. 25948 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`) 25949 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`. 25950 * @returns itself, so that it may be chained. 25951 * @codeGenApi 25952 */ 25953function ɵɵstylePropInterpolateV(prop, values, valueSuffix) { 25954 const lView = getLView(); 25955 const interpolatedValue = interpolationV(lView, values); 25956 checkStylingProperty(prop, interpolatedValue, valueSuffix, false); 25957 return ɵɵstylePropInterpolateV; 25958} 25959 25960/** 25961 * @license 25962 * Copyright Google LLC All Rights Reserved. 25963 * 25964 * Use of this source code is governed by an MIT-style license that can be 25965 * found in the LICENSE file at https://angular.io/license 25966 */ 25967/** 25968 * Update a property on a host element. Only applies to native node properties, not inputs. 25969 * 25970 * Operates on the element selected by index via the {@link select} instruction. 25971 * 25972 * @param propName Name of property. Because it is going to DOM, this is not subject to 25973 * renaming as part of minification. 25974 * @param value New value to write. 25975 * @param sanitizer An optional function used to sanitize the value. 25976 * @returns This function returns itself so that it may be chained 25977 * (e.g. `property('name', ctx.name)('title', ctx.title)`) 25978 * 25979 * @codeGenApi 25980 */ 25981function ɵɵhostProperty(propName, value, sanitizer) { 25982 const lView = getLView(); 25983 const bindingIndex = nextBindingIndex(); 25984 if (bindingUpdated(lView, bindingIndex, value)) { 25985 const tView = getTView(); 25986 const tNode = getSelectedTNode(); 25987 elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, true); 25988 ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex); 25989 } 25990 return ɵɵhostProperty; 25991} 25992/** 25993 * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive. 25994 * 25995 * This instruction is for compatibility purposes and is designed to ensure that a 25996 * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in 25997 * the component's renderer. Normally all host bindings are evaluated with the parent 25998 * component's renderer, but, in the case of animation @triggers, they need to be 25999 * evaluated with the sub component's renderer (because that's where the animation 26000 * triggers are defined). 26001 * 26002 * Do not use this instruction as a replacement for `elementProperty`. This instruction 26003 * only exists to ensure compatibility with the ViewEngine's host binding behavior. 26004 * 26005 * @param index The index of the element to update in the data array 26006 * @param propName Name of property. Because it is going to DOM, this is not subject to 26007 * renaming as part of minification. 26008 * @param value New value to write. 26009 * @param sanitizer An optional function used to sanitize the value. 26010 * 26011 * @codeGenApi 26012 */ 26013function ɵɵsyntheticHostProperty(propName, value, sanitizer) { 26014 const lView = getLView(); 26015 const bindingIndex = nextBindingIndex(); 26016 if (bindingUpdated(lView, bindingIndex, value)) { 26017 const tView = getTView(); 26018 const tNode = getSelectedTNode(); 26019 const currentDef = getCurrentDirectiveDef(tView.data); 26020 const renderer = loadComponentRenderer(currentDef, tNode, lView); 26021 elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, true); 26022 ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex); 26023 } 26024 return ɵɵsyntheticHostProperty; 26025} 26026 26027/** 26028 * @license 26029 * Copyright Google LLC All Rights Reserved. 26030 * 26031 * Use of this source code is governed by an MIT-style license that can be 26032 * found in the LICENSE file at https://angular.io/license 26033 */ 26034 26035/** 26036 * @license 26037 * Copyright Google LLC All Rights Reserved. 26038 * 26039 * Use of this source code is governed by an MIT-style license that can be 26040 * found in the LICENSE file at https://angular.io/license 26041 */ 26042/** 26043 * Retrieves the component instance associated with a given DOM element. 26044 * 26045 * @usageNotes 26046 * Given the following DOM structure: 26047 * ```html 26048 * <my-app> 26049 * <div> 26050 * <child-comp></child-comp> 26051 * </div> 26052 * </my-app> 26053 * ``` 26054 * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent` 26055 * associated with this DOM element. 26056 * 26057 * Calling the function on `<my-app>` will return the `MyApp` instance. 26058 * 26059 * 26060 * @param element DOM element from which the component should be retrieved. 26061 * @returns Component instance associated with the element or `null` if there 26062 * is no component associated with it. 26063 * 26064 * @publicApi 26065 * @globalApi ng 26066 */ 26067function getComponent(element) { 26068 assertDomElement(element); 26069 const context = loadLContext(element, false); 26070 if (context === null) 26071 return null; 26072 if (context.component === undefined) { 26073 context.component = getComponentAtNodeIndex(context.nodeIndex, context.lView); 26074 } 26075 return context.component; 26076} 26077/** 26078 * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded 26079 * view that the element is part of. Otherwise retrieves the instance of the component whose view 26080 * owns the element (in this case, the result is the same as calling `getOwningComponent`). 26081 * 26082 * @param element Element for which to get the surrounding component instance. 26083 * @returns Instance of the component that is around the element or null if the element isn't 26084 * inside any component. 26085 * 26086 * @publicApi 26087 * @globalApi ng 26088 */ 26089function getContext(element) { 26090 assertDomElement(element); 26091 const context = loadLContext(element, false); 26092 return context === null ? null : context.lView[CONTEXT]; 26093} 26094/** 26095 * Retrieves the component instance whose view contains the DOM element. 26096 * 26097 * For example, if `<child-comp>` is used in the template of `<app-comp>` 26098 * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>` 26099 * would return `<app-comp>`. 26100 * 26101 * @param elementOrDir DOM element, component or directive instance 26102 * for which to retrieve the root components. 26103 * @returns Component instance whose view owns the DOM element or null if the element is not 26104 * part of a component view. 26105 * 26106 * @publicApi 26107 * @globalApi ng 26108 */ 26109function getOwningComponent(elementOrDir) { 26110 const context = loadLContext(elementOrDir, false); 26111 if (context === null) 26112 return null; 26113 let lView = context.lView; 26114 let parent; 26115 ngDevMode && assertLView(lView); 26116 while (lView[HOST] === null && (parent = getLViewParent(lView))) { 26117 // As long as lView[HOST] is null we know we are part of sub-template such as `*ngIf` 26118 lView = parent; 26119 } 26120 return lView[FLAGS] & 512 /* IsRoot */ ? null : lView[CONTEXT]; 26121} 26122/** 26123 * Retrieves all root components associated with a DOM element, directive or component instance. 26124 * Root components are those which have been bootstrapped by Angular. 26125 * 26126 * @param elementOrDir DOM element, component or directive instance 26127 * for which to retrieve the root components. 26128 * @returns Root components associated with the target object. 26129 * 26130 * @publicApi 26131 * @globalApi ng 26132 */ 26133function getRootComponents(elementOrDir) { 26134 return [...getRootContext(elementOrDir).components]; 26135} 26136/** 26137 * Retrieves an `Injector` associated with an element, component or directive instance. 26138 * 26139 * @param elementOrDir DOM element, component or directive instance for which to 26140 * retrieve the injector. 26141 * @returns Injector associated with the element, component or directive instance. 26142 * 26143 * @publicApi 26144 * @globalApi ng 26145 */ 26146function getInjector(elementOrDir) { 26147 const context = loadLContext(elementOrDir, false); 26148 if (context === null) 26149 return Injector.NULL; 26150 const tNode = context.lView[TVIEW].data[context.nodeIndex]; 26151 return new NodeInjector(tNode, context.lView); 26152} 26153/** 26154 * Retrieve a set of injection tokens at a given DOM node. 26155 * 26156 * @param element Element for which the injection tokens should be retrieved. 26157 */ 26158function getInjectionTokens(element) { 26159 const context = loadLContext(element, false); 26160 if (context === null) 26161 return []; 26162 const lView = context.lView; 26163 const tView = lView[TVIEW]; 26164 const tNode = tView.data[context.nodeIndex]; 26165 const providerTokens = []; 26166 const startIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */; 26167 const endIndex = tNode.directiveEnd; 26168 for (let i = startIndex; i < endIndex; i++) { 26169 let value = tView.data[i]; 26170 if (isDirectiveDefHack(value)) { 26171 // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a 26172 // design flaw. We should always store same type so that we can be monomorphic. The issue 26173 // is that for Components/Directives we store the def instead the type. The correct behavior 26174 // is that we should always be storing injectable type in this location. 26175 value = value.type; 26176 } 26177 providerTokens.push(value); 26178 } 26179 return providerTokens; 26180} 26181/** 26182 * Retrieves directive instances associated with a given DOM element. Does not include 26183 * component instances. 26184 * 26185 * @usageNotes 26186 * Given the following DOM structure: 26187 * ``` 26188 * <my-app> 26189 * <button my-button></button> 26190 * <my-comp></my-comp> 26191 * </my-app> 26192 * ``` 26193 * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton` 26194 * directive that is associated with the DOM element. 26195 * 26196 * Calling `getDirectives` on `<my-comp>` will return an empty array. 26197 * 26198 * @param element DOM element for which to get the directives. 26199 * @returns Array of directives associated with the element. 26200 * 26201 * @publicApi 26202 * @globalApi ng 26203 */ 26204function getDirectives(element) { 26205 const context = loadLContext(element); 26206 if (context.directives === undefined) { 26207 context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false); 26208 } 26209 // The `directives` in this case are a named array called `LComponentView`. Clone the 26210 // result so we don't expose an internal data structure in the user's console. 26211 return context.directives === null ? [] : [...context.directives]; 26212} 26213function loadLContext(target, throwOnNotFound = true) { 26214 const context = getLContext(target); 26215 if (!context && throwOnNotFound) { 26216 throw new Error(ngDevMode ? `Unable to find context associated with ${stringifyForError(target)}` : 26217 'Invalid ng target'); 26218 } 26219 return context; 26220} 26221/** 26222 * Retrieve map of local references. 26223 * 26224 * The references are retrieved as a map of local reference name to element or directive instance. 26225 * 26226 * @param target DOM element, component or directive instance for which to retrieve 26227 * the local references. 26228 */ 26229function getLocalRefs(target) { 26230 const context = loadLContext(target, false); 26231 if (context === null) 26232 return {}; 26233 if (context.localRefs === undefined) { 26234 context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex); 26235 } 26236 return context.localRefs || {}; 26237} 26238/** 26239 * Retrieves the host element of a component or directive instance. 26240 * The host element is the DOM element that matched the selector of the directive. 26241 * 26242 * @param componentOrDirective Component or directive instance for which the host 26243 * element should be retrieved. 26244 * @returns Host element of the target. 26245 * 26246 * @publicApi 26247 * @globalApi ng 26248 */ 26249function getHostElement(componentOrDirective) { 26250 return getLContext(componentOrDirective).native; 26251} 26252/** 26253 * Retrieves the rendered text for a given component. 26254 * 26255 * This function retrieves the host element of a component and 26256 * and then returns the `textContent` for that element. This implies 26257 * that the text returned will include re-projected content of 26258 * the component as well. 26259 * 26260 * @param component The component to return the content text for. 26261 */ 26262function getRenderedText(component) { 26263 const hostElement = getHostElement(component); 26264 return hostElement.textContent || ''; 26265} 26266function loadLContextFromNode(node) { 26267 if (!(node instanceof Node)) 26268 throw new Error('Expecting instance of DOM Element'); 26269 return loadLContext(node); 26270} 26271/** 26272 * Retrieves a list of event listeners associated with a DOM element. The list does include host 26273 * listeners, but it does not include event listeners defined outside of the Angular context 26274 * (e.g. through `addEventListener`). 26275 * 26276 * @usageNotes 26277 * Given the following DOM structure: 26278 * ``` 26279 * <my-app> 26280 * <div (click)="doSomething()"></div> 26281 * </my-app> 26282 * 26283 * ``` 26284 * Calling `getListeners` on `<div>` will return an object that looks as follows: 26285 * ``` 26286 * { 26287 * name: 'click', 26288 * element: <div>, 26289 * callback: () => doSomething(), 26290 * useCapture: false 26291 * } 26292 * ``` 26293 * 26294 * @param element Element for which the DOM listeners should be retrieved. 26295 * @returns Array of event listeners on the DOM element. 26296 * 26297 * @publicApi 26298 * @globalApi ng 26299 */ 26300function getListeners(element) { 26301 assertDomElement(element); 26302 const lContext = loadLContext(element, false); 26303 if (lContext === null) 26304 return []; 26305 const lView = lContext.lView; 26306 const tView = lView[TVIEW]; 26307 const lCleanup = lView[CLEANUP]; 26308 const tCleanup = tView.cleanup; 26309 const listeners = []; 26310 if (tCleanup && lCleanup) { 26311 for (let i = 0; i < tCleanup.length;) { 26312 const firstParam = tCleanup[i++]; 26313 const secondParam = tCleanup[i++]; 26314 if (typeof firstParam === 'string') { 26315 const name = firstParam; 26316 const listenerElement = unwrapRNode(lView[secondParam]); 26317 const callback = lCleanup[tCleanup[i++]]; 26318 const useCaptureOrIndx = tCleanup[i++]; 26319 // if useCaptureOrIndx is boolean then report it as is. 26320 // if useCaptureOrIndx is positive number then it in unsubscribe method 26321 // if useCaptureOrIndx is negative number then it is a Subscription 26322 const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output'; 26323 const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false; 26324 if (element == listenerElement) { 26325 listeners.push({ element, name, callback, useCapture, type }); 26326 } 26327 } 26328 } 26329 } 26330 listeners.sort(sortListeners); 26331 return listeners; 26332} 26333function sortListeners(a, b) { 26334 if (a.name == b.name) 26335 return 0; 26336 return a.name < b.name ? -1 : 1; 26337} 26338/** 26339 * This function should not exist because it is megamorphic and only mostly correct. 26340 * 26341 * See call site for more info. 26342 */ 26343function isDirectiveDefHack(obj) { 26344 return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined; 26345} 26346/** 26347 * Returns the attached `DebugNode` instance for an element in the DOM. 26348 * 26349 * @param element DOM element which is owned by an existing component's view. 26350 */ 26351function getDebugNode(element) { 26352 let debugNode = null; 26353 const lContext = loadLContextFromNode(element); 26354 const lView = lContext.lView; 26355 const nodeIndex = lContext.nodeIndex; 26356 if (nodeIndex !== -1) { 26357 const valueInLView = lView[nodeIndex]; 26358 // this means that value in the lView is a component with its own 26359 // data. In this situation the TNode is not accessed at the same spot. 26360 const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : 26361 getTNode(lView[TVIEW], nodeIndex - HEADER_OFFSET); 26362 debugNode = buildDebugNode(tNode, lView, nodeIndex); 26363 } 26364 return debugNode; 26365} 26366/** 26367 * Retrieve the component `LView` from component/element. 26368 * 26369 * NOTE: `LView` is a private and should not be leaked outside. 26370 * Don't export this method to `ng.*` on window. 26371 * 26372 * @param target DOM element or component instance for which to retrieve the LView. 26373 */ 26374function getComponentLView(target) { 26375 const lContext = loadLContext(target); 26376 const nodeIndx = lContext.nodeIndex; 26377 const lView = lContext.lView; 26378 const componentLView = lView[nodeIndx]; 26379 ngDevMode && assertLView(componentLView); 26380 return componentLView; 26381} 26382/** Asserts that a value is a DOM Element. */ 26383function assertDomElement(value) { 26384 if (typeof Element !== 'undefined' && !(value instanceof Element)) { 26385 throw new Error('Expecting instance of DOM Element'); 26386 } 26387} 26388 26389/** 26390 * @license 26391 * Copyright Google LLC All Rights Reserved. 26392 * 26393 * Use of this source code is governed by an MIT-style license that can be 26394 * found in the LICENSE file at https://angular.io/license 26395 */ 26396/** 26397 * Marks a component for check (in case of OnPush components) and synchronously 26398 * performs change detection on the application this component belongs to. 26399 * 26400 * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}. 26401 * 26402 * @publicApi 26403 * @globalApi ng 26404 */ 26405function applyChanges(component) { 26406 markDirty(component); 26407 getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent)); 26408} 26409 26410/** 26411 * @license 26412 * Copyright Google LLC All Rights Reserved. 26413 * 26414 * Use of this source code is governed by an MIT-style license that can be 26415 * found in the LICENSE file at https://angular.io/license 26416 */ 26417/** 26418 * This file introduces series of globally accessible debug tools 26419 * to allow for the Angular debugging story to function. 26420 * 26421 * To see this in action run the following command: 26422 * 26423 * bazel run --config=ivy 26424 * //packages/core/test/bundling/todo:devserver 26425 * 26426 * Then load `localhost:5432` and start using the console tools. 26427 */ 26428/** 26429 * This value reflects the property on the window where the dev 26430 * tools are patched (window.ng). 26431 * */ 26432const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng'; 26433let _published = false; 26434/** 26435 * Publishes a collection of default debug tools onto`window.ng`. 26436 * 26437 * These functions are available globally when Angular is in development 26438 * mode and are automatically stripped away from prod mode is on. 26439 */ 26440function publishDefaultGlobalUtils() { 26441 if (!_published) { 26442 _published = true; 26443 publishGlobalUtil('getComponent', getComponent); 26444 publishGlobalUtil('getContext', getContext); 26445 publishGlobalUtil('getListeners', getListeners); 26446 publishGlobalUtil('getOwningComponent', getOwningComponent); 26447 publishGlobalUtil('getHostElement', getHostElement); 26448 publishGlobalUtil('getInjector', getInjector); 26449 publishGlobalUtil('getRootComponents', getRootComponents); 26450 publishGlobalUtil('getDirectives', getDirectives); 26451 publishGlobalUtil('applyChanges', applyChanges); 26452 } 26453} 26454/** 26455 * Publishes the given function to `window.ng` so that it can be 26456 * used from the browser console when an application is not in production. 26457 */ 26458function publishGlobalUtil(name, fn) { 26459 if (typeof COMPILED === 'undefined' || !COMPILED) { 26460 // Note: we can't export `ng` when using closure enhanced optimization as: 26461 // - closure declares globals itself for minified names, which sometimes clobber our `ng` global 26462 // - we can't declare a closure extern as the namespace `ng` is already used within Google 26463 // for typings for AngularJS (via `goog.provide('ng....')`). 26464 const w = _global; 26465 ngDevMode && assertDefined(fn, 'function not defined'); 26466 if (w) { 26467 let container = w[GLOBAL_PUBLISH_EXPANDO_KEY]; 26468 if (!container) { 26469 container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {}; 26470 } 26471 container[name] = fn; 26472 } 26473 } 26474} 26475 26476/** 26477 * @license 26478 * Copyright Google LLC All Rights Reserved. 26479 * 26480 * Use of this source code is governed by an MIT-style license that can be 26481 * found in the LICENSE file at https://angular.io/license 26482 */ 26483const ɵ0$b = (token, notFoundValue) => { 26484 throw new Error('NullInjector: Not found: ' + stringifyForError(token)); 26485}; 26486// TODO: A hack to not pull in the NullInjector from @angular/core. 26487const NULL_INJECTOR$1 = { 26488 get: ɵ0$b 26489}; 26490/** 26491 * Bootstraps a Component into an existing host element and returns an instance 26492 * of the component. 26493 * 26494 * Use this function to bootstrap a component into the DOM tree. Each invocation 26495 * of this function will create a separate tree of components, injectors and 26496 * change detection cycles and lifetimes. To dynamically insert a new component 26497 * into an existing tree such that it shares the same injection, change detection 26498 * and object lifetime, use {@link ViewContainer#createComponent}. 26499 * 26500 * @param componentType Component to bootstrap 26501 * @param options Optional parameters which control bootstrapping 26502 */ 26503function renderComponent$1(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts = {}) { 26504 ngDevMode && publishDefaultGlobalUtils(); 26505 ngDevMode && assertComponentType(componentType); 26506 const rendererFactory = opts.rendererFactory || domRendererFactory3; 26507 const sanitizer = opts.sanitizer || null; 26508 const componentDef = getComponentDef(componentType); 26509 if (componentDef.type != componentType) 26510 componentDef.type = componentType; 26511 // The first index of the first selector is the tag name. 26512 const componentTag = componentDef.selectors[0][0]; 26513 const hostRenderer = rendererFactory.createRenderer(null, null); 26514 const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation); 26515 const rootFlags = componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ : 26516 16 /* CheckAlways */ | 512 /* IsRoot */; 26517 const rootContext = createRootContext(opts.scheduler, opts.playerHandler); 26518 const renderer = rendererFactory.createRenderer(hostRNode, componentDef); 26519 const rootTView = createTView(0 /* Root */, -1, null, 1, 0, null, null, null, null, null); 26520 const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, undefined, opts.injector || null); 26521 enterView(rootView, null); 26522 let component; 26523 try { 26524 if (rendererFactory.begin) 26525 rendererFactory.begin(); 26526 const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer); 26527 component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null); 26528 // create mode pass 26529 renderView(rootTView, rootView, null); 26530 // update mode pass 26531 refreshView(rootTView, rootView, null, null); 26532 } 26533 finally { 26534 leaveView(); 26535 if (rendererFactory.end) 26536 rendererFactory.end(); 26537 } 26538 return component; 26539} 26540/** 26541 * Creates the root component view and the root component node. 26542 * 26543 * @param rNode Render host element. 26544 * @param def ComponentDef 26545 * @param rootView The parent view where the host node is stored 26546 * @param hostRenderer The current renderer 26547 * @param sanitizer The sanitizer, if provided 26548 * 26549 * @returns Component view created 26550 */ 26551function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) { 26552 const tView = rootView[TVIEW]; 26553 ngDevMode && assertIndexInRange(rootView, 0 + HEADER_OFFSET); 26554 rootView[0 + HEADER_OFFSET] = rNode; 26555 const tNode = getOrCreateTNode(tView, null, 0, 3 /* Element */, null, null); 26556 const mergedAttrs = tNode.mergedAttrs = def.hostAttrs; 26557 if (mergedAttrs !== null) { 26558 computeStaticStyling(tNode, mergedAttrs, true); 26559 if (rNode !== null) { 26560 setUpAttributes(hostRenderer, rNode, mergedAttrs); 26561 if (tNode.classes !== null) { 26562 writeDirectClass(hostRenderer, rNode, tNode.classes); 26563 } 26564 if (tNode.styles !== null) { 26565 writeDirectStyle(hostRenderer, rNode, tNode.styles); 26566 } 26567 } 26568 } 26569 const viewRenderer = rendererFactory.createRenderer(rNode, def); 26570 const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, rootView[HEADER_OFFSET], tNode, rendererFactory, viewRenderer, sanitizer); 26571 if (tView.firstCreatePass) { 26572 diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type); 26573 markAsComponentHost(tView, tNode); 26574 initTNodeFlags(tNode, rootView.length, 1); 26575 } 26576 addToViewTree(rootView, componentView); 26577 // Store component view at node index, with node as the HOST 26578 return rootView[HEADER_OFFSET] = componentView; 26579} 26580/** 26581 * Creates a root component and sets it up with features and host bindings. Shared by 26582 * renderComponent() and ViewContainerRef.createComponent(). 26583 */ 26584function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) { 26585 const tView = rootLView[TVIEW]; 26586 // Create directive instance with factory() and store at next index in viewData 26587 const component = instantiateRootComponent(tView, rootLView, componentDef); 26588 rootContext.components.push(component); 26589 componentView[CONTEXT] = component; 26590 hostFeatures && hostFeatures.forEach((feature) => feature(component, componentDef)); 26591 // We want to generate an empty QueryList for root content queries for backwards 26592 // compatibility with ViewEngine. 26593 if (componentDef.contentQueries) { 26594 componentDef.contentQueries(1 /* Create */, component, rootLView.length - 1); 26595 } 26596 const rootTNode = getPreviousOrParentTNode(); 26597 if (tView.firstCreatePass && 26598 (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) { 26599 const elementIndex = rootTNode.index - HEADER_OFFSET; 26600 setSelectedIndex(elementIndex); 26601 const rootTView = rootLView[TVIEW]; 26602 addHostBindingsToExpandoInstructions(rootTView, componentDef); 26603 growHostVarsSpace(rootTView, rootLView, componentDef.hostVars); 26604 invokeHostBindingsInCreationMode(componentDef, component); 26605 } 26606 return component; 26607} 26608function createRootContext(scheduler, playerHandler) { 26609 return { 26610 components: [], 26611 scheduler: scheduler || defaultScheduler, 26612 clean: CLEAN_PROMISE, 26613 playerHandler: playerHandler || null, 26614 flags: 0 /* Empty */ 26615 }; 26616} 26617/** 26618 * Used to enable lifecycle hooks on the root component. 26619 * 26620 * Include this feature when calling `renderComponent` if the root component 26621 * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't 26622 * be called properly. 26623 * 26624 * Example: 26625 * 26626 * ``` 26627 * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]}); 26628 * ``` 26629 */ 26630function LifecycleHooksFeature(component, def) { 26631 const rootTView = readPatchedLView(component)[TVIEW]; 26632 const dirIndex = rootTView.data.length - 1; 26633 // TODO(misko): replace `as TNode` with createTNode call. (needs refactoring to lose dep on 26634 // LNode). 26635 registerPostOrderHooks(rootTView, { directiveStart: dirIndex, directiveEnd: dirIndex + 1 }); 26636} 26637/** 26638 * Wait on component until it is rendered. 26639 * 26640 * This function returns a `Promise` which is resolved when the component's 26641 * change detection is executed. This is determined by finding the scheduler 26642 * associated with the `component`'s render tree and waiting until the scheduler 26643 * flushes. If nothing is scheduled, the function returns a resolved promise. 26644 * 26645 * Example: 26646 * ``` 26647 * await whenRendered(myComponent); 26648 * ``` 26649 * 26650 * @param component Component to wait upon 26651 * @returns Promise which resolves when the component is rendered. 26652 */ 26653function whenRendered(component) { 26654 return getRootContext(component).clean; 26655} 26656 26657/** 26658 * @license 26659 * Copyright Google LLC All Rights Reserved. 26660 * 26661 * Use of this source code is governed by an MIT-style license that can be 26662 * found in the LICENSE file at https://angular.io/license 26663 */ 26664function getSuperType(type) { 26665 return Object.getPrototypeOf(type.prototype).constructor; 26666} 26667/** 26668 * Merges the definition from a super class to a sub class. 26669 * @param definition The definition that is a SubClass of another directive of component 26670 * 26671 * @codeGenApi 26672 */ 26673function ɵɵInheritDefinitionFeature(definition) { 26674 let superType = getSuperType(definition.type); 26675 let shouldInheritFields = true; 26676 const inheritanceChain = [definition]; 26677 while (superType) { 26678 let superDef = undefined; 26679 if (isComponentDef(definition)) { 26680 // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance. 26681 superDef = superType.ɵcmp || superType.ɵdir; 26682 } 26683 else { 26684 if (superType.ɵcmp) { 26685 throw new Error('Directives cannot inherit Components'); 26686 } 26687 // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance. 26688 superDef = superType.ɵdir; 26689 } 26690 if (superDef) { 26691 if (shouldInheritFields) { 26692 inheritanceChain.push(superDef); 26693 // Some fields in the definition may be empty, if there were no values to put in them that 26694 // would've justified object creation. Unwrap them if necessary. 26695 const writeableDef = definition; 26696 writeableDef.inputs = maybeUnwrapEmpty(definition.inputs); 26697 writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs); 26698 writeableDef.outputs = maybeUnwrapEmpty(definition.outputs); 26699 // Merge hostBindings 26700 const superHostBindings = superDef.hostBindings; 26701 superHostBindings && inheritHostBindings(definition, superHostBindings); 26702 // Merge queries 26703 const superViewQuery = superDef.viewQuery; 26704 const superContentQueries = superDef.contentQueries; 26705 superViewQuery && inheritViewQuery(definition, superViewQuery); 26706 superContentQueries && inheritContentQueries(definition, superContentQueries); 26707 // Merge inputs and outputs 26708 fillProperties(definition.inputs, superDef.inputs); 26709 fillProperties(definition.declaredInputs, superDef.declaredInputs); 26710 fillProperties(definition.outputs, superDef.outputs); 26711 // Merge animations metadata. 26712 // If `superDef` is a Component, the `data` field is present (defaults to an empty object). 26713 if (isComponentDef(superDef) && superDef.data.animation) { 26714 // If super def is a Component, the `definition` is also a Component, since Directives can 26715 // not inherit Components (we throw an error above and cannot reach this code). 26716 const defData = definition.data; 26717 defData.animation = (defData.animation || []).concat(superDef.data.animation); 26718 } 26719 } 26720 // Run parent features 26721 const features = superDef.features; 26722 if (features) { 26723 for (let i = 0; i < features.length; i++) { 26724 const feature = features[i]; 26725 if (feature && feature.ngInherit) { 26726 feature(definition); 26727 } 26728 // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this 26729 // def already has all the necessary information inherited from its super class(es), so we 26730 // can stop merging fields from super classes. However we need to iterate through the 26731 // prototype chain to look for classes that might contain other "features" (like 26732 // NgOnChanges), which we should invoke for the original `definition`. We set the 26733 // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance 26734 // logic and only invoking functions from the "features" list. 26735 if (feature === ɵɵInheritDefinitionFeature) { 26736 shouldInheritFields = false; 26737 } 26738 } 26739 } 26740 } 26741 superType = Object.getPrototypeOf(superType); 26742 } 26743 mergeHostAttrsAcrossInheritance(inheritanceChain); 26744} 26745/** 26746 * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class. 26747 * 26748 * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing 26749 * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child 26750 * type. 26751 */ 26752function mergeHostAttrsAcrossInheritance(inheritanceChain) { 26753 let hostVars = 0; 26754 let hostAttrs = null; 26755 // We process the inheritance order from the base to the leaves here. 26756 for (let i = inheritanceChain.length - 1; i >= 0; i--) { 26757 const def = inheritanceChain[i]; 26758 // For each `hostVars`, we need to add the superclass amount. 26759 def.hostVars = (hostVars += def.hostVars); 26760 // for each `hostAttrs` we need to merge it with superclass. 26761 def.hostAttrs = 26762 mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs)); 26763 } 26764} 26765function maybeUnwrapEmpty(value) { 26766 if (value === EMPTY_OBJ) { 26767 return {}; 26768 } 26769 else if (value === EMPTY_ARRAY) { 26770 return []; 26771 } 26772 else { 26773 return value; 26774 } 26775} 26776function inheritViewQuery(definition, superViewQuery) { 26777 const prevViewQuery = definition.viewQuery; 26778 if (prevViewQuery) { 26779 definition.viewQuery = (rf, ctx) => { 26780 superViewQuery(rf, ctx); 26781 prevViewQuery(rf, ctx); 26782 }; 26783 } 26784 else { 26785 definition.viewQuery = superViewQuery; 26786 } 26787} 26788function inheritContentQueries(definition, superContentQueries) { 26789 const prevContentQueries = definition.contentQueries; 26790 if (prevContentQueries) { 26791 definition.contentQueries = (rf, ctx, directiveIndex) => { 26792 superContentQueries(rf, ctx, directiveIndex); 26793 prevContentQueries(rf, ctx, directiveIndex); 26794 }; 26795 } 26796 else { 26797 definition.contentQueries = superContentQueries; 26798 } 26799} 26800function inheritHostBindings(definition, superHostBindings) { 26801 const prevHostBindings = definition.hostBindings; 26802 if (prevHostBindings) { 26803 definition.hostBindings = (rf, ctx) => { 26804 superHostBindings(rf, ctx); 26805 prevHostBindings(rf, ctx); 26806 }; 26807 } 26808 else { 26809 definition.hostBindings = superHostBindings; 26810 } 26811} 26812 26813/** 26814 * @license 26815 * Copyright Google LLC All Rights Reserved. 26816 * 26817 * Use of this source code is governed by an MIT-style license that can be 26818 * found in the LICENSE file at https://angular.io/license 26819 */ 26820/** 26821 * Fields which exist on either directive or component definitions, and need to be copied from 26822 * parent to child classes by the `ɵɵCopyDefinitionFeature`. 26823 */ 26824const COPY_DIRECTIVE_FIELDS = [ 26825 // The child class should use the providers of its parent. 26826 'providersResolver', 26827]; 26828/** 26829 * Fields which exist only on component definitions, and need to be copied from parent to child 26830 * classes by the `ɵɵCopyDefinitionFeature`. 26831 * 26832 * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`, 26833 * since those should go in `COPY_DIRECTIVE_FIELDS` above. 26834 */ 26835const COPY_COMPONENT_FIELDS = [ 26836 // The child class should use the template function of its parent, including all template 26837 // semantics. 26838 'template', 26839 'decls', 26840 'consts', 26841 'vars', 26842 'onPush', 26843 'ngContentSelectors', 26844 // The child class should use the CSS styles of its parent, including all styling semantics. 26845 'styles', 26846 'encapsulation', 26847 // The child class should be checked by the runtime in the same way as its parent. 26848 'schemas', 26849]; 26850/** 26851 * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a 26852 * definition. 26853 * 26854 * This exists primarily to support ngcc migration of an existing View Engine pattern, where an 26855 * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it 26856 * generates a skeleton definition on the child class, and applies this feature. 26857 * 26858 * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition, 26859 * including things like the component template function. 26860 * 26861 * @param definition The definition of a child class which inherits from a parent class with its 26862 * own definition. 26863 * 26864 * @codeGenApi 26865 */ 26866function ɵɵCopyDefinitionFeature(definition) { 26867 let superType = getSuperType(definition.type); 26868 let superDef = undefined; 26869 if (isComponentDef(definition)) { 26870 // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance. 26871 superDef = superType.ɵcmp; 26872 } 26873 else { 26874 // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance. 26875 superDef = superType.ɵdir; 26876 } 26877 // Needed because `definition` fields are readonly. 26878 const defAny = definition; 26879 // Copy over any fields that apply to either directives or components. 26880 for (const field of COPY_DIRECTIVE_FIELDS) { 26881 defAny[field] = superDef[field]; 26882 } 26883 if (isComponentDef(superDef)) { 26884 // Copy over any component-specific fields. 26885 for (const field of COPY_COMPONENT_FIELDS) { 26886 defAny[field] = superDef[field]; 26887 } 26888 } 26889} 26890 26891/** 26892 * @license 26893 * Copyright Google LLC All Rights Reserved. 26894 * 26895 * Use of this source code is governed by an MIT-style license that can be 26896 * found in the LICENSE file at https://angular.io/license 26897 */ 26898/** 26899 * Resolves the providers which are defined in the DirectiveDef. 26900 * 26901 * When inserting the tokens and the factories in their respective arrays, we can assume that 26902 * this method is called first for the component (if any), and then for other directives on the same 26903 * node. 26904 * As a consequence,the providers are always processed in that order: 26905 * 1) The view providers of the component 26906 * 2) The providers of the component 26907 * 3) The providers of the other directives 26908 * This matches the structure of the injectables arrays of a view (for each node). 26909 * So the tokens and the factories can be pushed at the end of the arrays, except 26910 * in one case for multi providers. 26911 * 26912 * @param def the directive definition 26913 * @param providers: Array of `providers`. 26914 * @param viewProviders: Array of `viewProviders`. 26915 */ 26916function providersResolver(def, providers, viewProviders) { 26917 const tView = getTView(); 26918 if (tView.firstCreatePass) { 26919 const isComponent = isComponentDef(def); 26920 // The list of view providers is processed first, and the flags are updated 26921 resolveProvider$1(viewProviders, tView.data, tView.blueprint, isComponent, true); 26922 // Then, the list of providers is processed, and the flags are updated 26923 resolveProvider$1(providers, tView.data, tView.blueprint, isComponent, false); 26924 } 26925} 26926/** 26927 * Resolves a provider and publishes it to the DI system. 26928 */ 26929function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) { 26930 provider = resolveForwardRef(provider); 26931 if (Array.isArray(provider)) { 26932 // Recursively call `resolveProvider` 26933 // Recursion is OK in this case because this code will not be in hot-path once we implement 26934 // cloning of the initial state. 26935 for (let i = 0; i < provider.length; i++) { 26936 resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider); 26937 } 26938 } 26939 else { 26940 const tView = getTView(); 26941 const lView = getLView(); 26942 let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide); 26943 let providerFactory = providerToFactory(provider); 26944 const tNode = getPreviousOrParentTNode(); 26945 const beginIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */; 26946 const endIndex = tNode.directiveStart; 26947 const cptViewProvidersCount = tNode.providerIndexes >> 20 /* CptViewProvidersCountShift */; 26948 if (isTypeProvider(provider) || !provider.multi) { 26949 // Single provider case: the factory is created and pushed immediately 26950 const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject); 26951 const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex); 26952 if (existingFactoryIndex === -1) { 26953 diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token); 26954 registerDestroyHooksIfSupported(tView, provider, tInjectables.length); 26955 tInjectables.push(token); 26956 tNode.directiveStart++; 26957 tNode.directiveEnd++; 26958 if (isViewProvider) { 26959 tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */; 26960 } 26961 lInjectablesBlueprint.push(factory); 26962 lView.push(factory); 26963 } 26964 else { 26965 lInjectablesBlueprint[existingFactoryIndex] = factory; 26966 lView[existingFactoryIndex] = factory; 26967 } 26968 } 26969 else { 26970 // Multi provider case: 26971 // We create a multi factory which is going to aggregate all the values. 26972 // Since the output of such a factory depends on content or view injection, 26973 // we create two of them, which are linked together. 26974 // 26975 // The first one (for view providers) is always in the first block of the injectables array, 26976 // and the second one (for providers) is always in the second block. 26977 // This is important because view providers have higher priority. When a multi token 26978 // is being looked up, the view providers should be found first. 26979 // Note that it is not possible to have a multi factory in the third block (directive block). 26980 // 26981 // The algorithm to process multi providers is as follows: 26982 // 1) If the multi provider comes from the `viewProviders` of the component: 26983 // a) If the special view providers factory doesn't exist, it is created and pushed. 26984 // b) Else, the multi provider is added to the existing multi factory. 26985 // 2) If the multi provider comes from the `providers` of the component or of another 26986 // directive: 26987 // a) If the multi factory doesn't exist, it is created and provider pushed into it. 26988 // It is also linked to the multi factory for view providers, if it exists. 26989 // b) Else, the multi provider is added to the existing multi factory. 26990 const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex); 26991 const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount); 26992 const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 && 26993 lInjectablesBlueprint[existingProvidersFactoryIndex]; 26994 const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 && 26995 lInjectablesBlueprint[existingViewProvidersFactoryIndex]; 26996 if (isViewProvider && !doesViewProvidersFactoryExist || 26997 !isViewProvider && !doesProvidersFactoryExist) { 26998 // Cases 1.a and 2.a 26999 diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token); 27000 const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory); 27001 if (!isViewProvider && doesViewProvidersFactoryExist) { 27002 lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory; 27003 } 27004 registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0); 27005 tInjectables.push(token); 27006 tNode.directiveStart++; 27007 tNode.directiveEnd++; 27008 if (isViewProvider) { 27009 tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */; 27010 } 27011 lInjectablesBlueprint.push(factory); 27012 lView.push(factory); 27013 } 27014 else { 27015 // Cases 1.b and 2.b 27016 const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : 27017 existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent); 27018 registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex : 27019 existingViewProvidersFactoryIndex, indexInFactory); 27020 } 27021 if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) { 27022 lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++; 27023 } 27024 } 27025 } 27026} 27027/** 27028 * Registers the `ngOnDestroy` hook of a provider, if the provider supports destroy hooks. 27029 * @param tView `TView` in which to register the hook. 27030 * @param provider Provider whose hook should be registered. 27031 * @param contextIndex Index under which to find the context for the hook when it's being invoked. 27032 * @param indexInFactory Only required for `multi` providers. Index of the provider in the multi 27033 * provider factory. 27034 */ 27035function registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) { 27036 const providerIsTypeProvider = isTypeProvider(provider); 27037 if (providerIsTypeProvider || isClassProvider(provider)) { 27038 const prototype = (provider.useClass || provider).prototype; 27039 const ngOnDestroy = prototype.ngOnDestroy; 27040 if (ngOnDestroy) { 27041 const hooks = tView.destroyHooks || (tView.destroyHooks = []); 27042 if (!providerIsTypeProvider && provider.multi) { 27043 ngDevMode && 27044 assertDefined(indexInFactory, 'indexInFactory when registering multi factory destroy hook'); 27045 const existingCallbacksIndex = hooks.indexOf(contextIndex); 27046 if (existingCallbacksIndex === -1) { 27047 hooks.push(contextIndex, [indexInFactory, ngOnDestroy]); 27048 } 27049 else { 27050 hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy); 27051 } 27052 } 27053 else { 27054 hooks.push(contextIndex, ngOnDestroy); 27055 } 27056 } 27057 } 27058} 27059/** 27060 * Add a factory in a multi factory. 27061 * @returns Index at which the factory was inserted. 27062 */ 27063function multiFactoryAdd(multiFactory, factory, isComponentProvider) { 27064 if (isComponentProvider) { 27065 multiFactory.componentProviders++; 27066 } 27067 return multiFactory.multi.push(factory) - 1; 27068} 27069/** 27070 * Returns the index of item in the array, but only in the begin to end range. 27071 */ 27072function indexOf(item, arr, begin, end) { 27073 for (let i = begin; i < end; i++) { 27074 if (arr[i] === item) 27075 return i; 27076 } 27077 return -1; 27078} 27079/** 27080 * Use this with `multi` `providers`. 27081 */ 27082function multiProvidersFactoryResolver(_, tData, lData, tNode) { 27083 return multiResolve(this.multi, []); 27084} 27085/** 27086 * Use this with `multi` `viewProviders`. 27087 * 27088 * This factory knows how to concatenate itself with the existing `multi` `providers`. 27089 */ 27090function multiViewProvidersFactoryResolver(_, tData, lView, tNode) { 27091 const factories = this.multi; 27092 let result; 27093 if (this.providerFactory) { 27094 const componentCount = this.providerFactory.componentProviders; 27095 const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode); 27096 // Copy the section of the array which contains `multi` `providers` from the component 27097 result = multiProviders.slice(0, componentCount); 27098 // Insert the `viewProvider` instances. 27099 multiResolve(factories, result); 27100 // Copy the section of the array which contains `multi` `providers` from other directives 27101 for (let i = componentCount; i < multiProviders.length; i++) { 27102 result.push(multiProviders[i]); 27103 } 27104 } 27105 else { 27106 result = []; 27107 // Insert the `viewProvider` instances. 27108 multiResolve(factories, result); 27109 } 27110 return result; 27111} 27112/** 27113 * Maps an array of factories into an array of values. 27114 */ 27115function multiResolve(factories, result) { 27116 for (let i = 0; i < factories.length; i++) { 27117 const factory = factories[i]; 27118 result.push(factory()); 27119 } 27120 return result; 27121} 27122/** 27123 * Creates a multi factory. 27124 */ 27125function multiFactory(factoryFn, index, isViewProvider, isComponent, f) { 27126 const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject); 27127 factory.multi = []; 27128 factory.index = index; 27129 factory.componentProviders = 0; 27130 multiFactoryAdd(factory, f, isComponent && !isViewProvider); 27131 return factory; 27132} 27133 27134/** 27135 * This feature resolves the providers of a directive (or component), 27136 * and publish them into the DI system, making it visible to others for injection. 27137 * 27138 * For example: 27139 * ```ts 27140 * class ComponentWithProviders { 27141 * constructor(private greeter: GreeterDE) {} 27142 * 27143 * static ɵcmp = defineComponent({ 27144 * type: ComponentWithProviders, 27145 * selectors: [['component-with-providers']], 27146 * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)), 27147 * decls: 1, 27148 * vars: 1, 27149 * template: function(fs: RenderFlags, ctx: ComponentWithProviders) { 27150 * if (fs & RenderFlags.Create) { 27151 * ɵɵtext(0); 27152 * } 27153 * if (fs & RenderFlags.Update) { 27154 * ɵɵtextInterpolate(ctx.greeter.greet()); 27155 * } 27156 * }, 27157 * features: [ProvidersFeature([GreeterDE])] 27158 * }); 27159 * } 27160 * ``` 27161 * 27162 * @param definition 27163 * 27164 * @codeGenApi 27165 */ 27166function ɵɵProvidersFeature(providers, viewProviders = []) { 27167 return (definition) => { 27168 definition.providersResolver = 27169 (def, processProvidersFn) => { 27170 return providersResolver(def, // 27171 processProvidersFn ? processProvidersFn(providers) : providers, // 27172 viewProviders); 27173 }; 27174 }; 27175} 27176 27177/** 27178 * @license 27179 * Copyright Google LLC All Rights Reserved. 27180 * 27181 * Use of this source code is governed by an MIT-style license that can be 27182 * found in the LICENSE file at https://angular.io/license 27183 */ 27184/** 27185 * Represents a component created by a `ComponentFactory`. 27186 * Provides access to the component instance and related objects, 27187 * and provides the means of destroying the instance. 27188 * 27189 * @publicApi 27190 */ 27191class ComponentRef { 27192} 27193/** 27194 * Base class for a factory that can create a component dynamically. 27195 * Instantiate a factory for a given type of component with `resolveComponentFactory()`. 27196 * Use the resulting `ComponentFactory.create()` method to create a component of that type. 27197 * 27198 * @see [Dynamic Components](guide/dynamic-component-loader) 27199 * 27200 * @publicApi 27201 */ 27202class ComponentFactory { 27203} 27204 27205/** 27206 * @license 27207 * Copyright Google LLC All Rights Reserved. 27208 * 27209 * Use of this source code is governed by an MIT-style license that can be 27210 * found in the LICENSE file at https://angular.io/license 27211 */ 27212function noComponentFactoryError(component) { 27213 const error = Error(`No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`); 27214 error[ERROR_COMPONENT] = component; 27215 return error; 27216} 27217const ERROR_COMPONENT = 'ngComponent'; 27218function getComponent$1(error) { 27219 return error[ERROR_COMPONENT]; 27220} 27221class _NullComponentFactoryResolver { 27222 resolveComponentFactory(component) { 27223 throw noComponentFactoryError(component); 27224 } 27225} 27226/** 27227 * A simple registry that maps `Components` to generated `ComponentFactory` classes 27228 * that can be used to create instances of components. 27229 * Use to obtain the factory for a given component type, 27230 * then use the factory's `create()` method to create a component of that type. 27231 * 27232 * @see [Dynamic Components](guide/dynamic-component-loader) 27233 * @publicApi 27234 */ 27235class ComponentFactoryResolver { 27236} 27237ComponentFactoryResolver.NULL = new _NullComponentFactoryResolver(); 27238class CodegenComponentFactoryResolver { 27239 constructor(factories, _parent, _ngModule) { 27240 this._parent = _parent; 27241 this._ngModule = _ngModule; 27242 this._factories = new Map(); 27243 for (let i = 0; i < factories.length; i++) { 27244 const factory = factories[i]; 27245 this._factories.set(factory.componentType, factory); 27246 } 27247 } 27248 resolveComponentFactory(component) { 27249 let factory = this._factories.get(component); 27250 if (!factory && this._parent) { 27251 factory = this._parent.resolveComponentFactory(component); 27252 } 27253 if (!factory) { 27254 throw noComponentFactoryError(component); 27255 } 27256 return new ComponentFactoryBoundToModule(factory, this._ngModule); 27257 } 27258} 27259class ComponentFactoryBoundToModule extends ComponentFactory { 27260 constructor(factory, ngModule) { 27261 super(); 27262 this.factory = factory; 27263 this.ngModule = ngModule; 27264 this.selector = factory.selector; 27265 this.componentType = factory.componentType; 27266 this.ngContentSelectors = factory.ngContentSelectors; 27267 this.inputs = factory.inputs; 27268 this.outputs = factory.outputs; 27269 } 27270 create(injector, projectableNodes, rootSelectorOrNode, ngModule) { 27271 return this.factory.create(injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule); 27272 } 27273} 27274 27275/** 27276 * @license 27277 * Copyright Google LLC All Rights Reserved. 27278 * 27279 * Use of this source code is governed by an MIT-style license that can be 27280 * found in the LICENSE file at https://angular.io/license 27281 */ 27282function noop(...args) { 27283 // Do nothing. 27284} 27285 27286/** 27287 * @license 27288 * Copyright Google LLC All Rights Reserved. 27289 * 27290 * Use of this source code is governed by an MIT-style license that can be 27291 * found in the LICENSE file at https://angular.io/license 27292 */ 27293/** 27294 * A wrapper around a native element inside of a View. 27295 * 27296 * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM 27297 * element. 27298 * 27299 * @security Permitting direct access to the DOM can make your application more vulnerable to 27300 * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the 27301 * [Security Guide](http://g.co/ng/security). 27302 * 27303 * @publicApi 27304 */ 27305// Note: We don't expose things like `Injector`, `ViewContainer`, ... here, 27306// i.e. users have to ask for what they need. With that, we can build better analysis tools 27307// and could do better codegen in the future. 27308class ElementRef { 27309 constructor(nativeElement) { 27310 this.nativeElement = nativeElement; 27311 } 27312} 27313/** 27314 * @internal 27315 * @nocollapse 27316 */ 27317ElementRef.__NG_ELEMENT_ID__ = () => SWITCH_ELEMENT_REF_FACTORY(ElementRef); 27318const SWITCH_ELEMENT_REF_FACTORY__POST_R3__ = injectElementRef; 27319const SWITCH_ELEMENT_REF_FACTORY__PRE_R3__ = noop; 27320const SWITCH_ELEMENT_REF_FACTORY = SWITCH_ELEMENT_REF_FACTORY__POST_R3__; 27321 27322/** 27323 * @license 27324 * Copyright Google LLC All Rights Reserved. 27325 * 27326 * Use of this source code is governed by an MIT-style license that can be 27327 * found in the LICENSE file at https://angular.io/license 27328 */ 27329const Renderer2Interceptor = new InjectionToken('Renderer2Interceptor'); 27330/** 27331 * Creates and initializes a custom renderer that implements the `Renderer2` base class. 27332 * 27333 * @publicApi 27334 */ 27335class RendererFactory2 { 27336} 27337/** 27338 * Flags for renderer-specific style modifiers. 27339 * @publicApi 27340 */ 27341var RendererStyleFlags2; 27342(function (RendererStyleFlags2) { 27343 // TODO(misko): This needs to be refactored into a separate file so that it can be imported from 27344 // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails 27345 // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now. 27346 /** 27347 * Marks a style as important. 27348 */ 27349 RendererStyleFlags2[RendererStyleFlags2["Important"] = 1] = "Important"; 27350 /** 27351 * Marks a style as using dash case naming (this-is-dash-case). 27352 */ 27353 RendererStyleFlags2[RendererStyleFlags2["DashCase"] = 2] = "DashCase"; 27354})(RendererStyleFlags2 || (RendererStyleFlags2 = {})); 27355/** 27356 * Extend this base class to implement custom rendering. By default, Angular 27357 * renders a template into DOM. You can use custom rendering to intercept 27358 * rendering calls, or to render to something other than DOM. 27359 * 27360 * Create your custom renderer using `RendererFactory2`. 27361 * 27362 * Use a custom renderer to bypass Angular's templating and 27363 * make custom UI changes that can't be expressed declaratively. 27364 * For example if you need to set a property or an attribute whose name is 27365 * not statically known, use the `setProperty()` or 27366 * `setAttribute()` method. 27367 * 27368 * @publicApi 27369 */ 27370class Renderer2 { 27371} 27372/** 27373 * @internal 27374 * @nocollapse 27375 */ 27376Renderer2.__NG_ELEMENT_ID__ = () => SWITCH_RENDERER2_FACTORY(); 27377const SWITCH_RENDERER2_FACTORY__POST_R3__ = injectRenderer2; 27378const SWITCH_RENDERER2_FACTORY__PRE_R3__ = noop; 27379const SWITCH_RENDERER2_FACTORY = SWITCH_RENDERER2_FACTORY__POST_R3__; 27380 27381/** 27382 * @license 27383 * Copyright Google LLC All Rights Reserved. 27384 * 27385 * Use of this source code is governed by an MIT-style license that can be 27386 * found in the LICENSE file at https://angular.io/license 27387 */ 27388/** 27389 * Sanitizer is used by the views to sanitize potentially dangerous values. 27390 * 27391 * @publicApi 27392 */ 27393class Sanitizer { 27394} 27395/** @nocollapse */ 27396Sanitizer.ɵprov = ɵɵdefineInjectable({ 27397 token: Sanitizer, 27398 providedIn: 'root', 27399 factory: () => null, 27400}); 27401 27402/** 27403 * @license 27404 * Copyright Google LLC All Rights Reserved. 27405 * 27406 * Use of this source code is governed by an MIT-style license that can be 27407 * found in the LICENSE file at https://angular.io/license 27408 */ 27409/** 27410 * @description Represents the version of Angular 27411 * 27412 * @publicApi 27413 */ 27414class Version { 27415 constructor(full) { 27416 this.full = full; 27417 this.major = full.split('.')[0]; 27418 this.minor = full.split('.')[1]; 27419 this.patch = full.split('.').slice(2).join('.'); 27420 } 27421} 27422/** 27423 * @publicApi 27424 */ 27425const VERSION = new Version('10.0.14'); 27426 27427/** 27428 * @license 27429 * Copyright Google LLC All Rights Reserved. 27430 * 27431 * Use of this source code is governed by an MIT-style license that can be 27432 * found in the LICENSE file at https://angular.io/license 27433 */ 27434class DefaultIterableDifferFactory { 27435 constructor() { } 27436 supports(obj) { 27437 return isListLikeIterable(obj); 27438 } 27439 create(trackByFn) { 27440 return new DefaultIterableDiffer(trackByFn); 27441 } 27442} 27443const trackByIdentity = (index, item) => item; 27444const ɵ0$c = trackByIdentity; 27445/** 27446 * @deprecated v4.0.0 - Should not be part of public API. 27447 * @publicApi 27448 */ 27449class DefaultIterableDiffer { 27450 constructor(trackByFn) { 27451 this.length = 0; 27452 // Keeps track of the used records at any point in time (during & across `_check()` calls) 27453 this._linkedRecords = null; 27454 // Keeps track of the removed records at any point in time during `_check()` calls. 27455 this._unlinkedRecords = null; 27456 this._previousItHead = null; 27457 this._itHead = null; 27458 this._itTail = null; 27459 this._additionsHead = null; 27460 this._additionsTail = null; 27461 this._movesHead = null; 27462 this._movesTail = null; 27463 this._removalsHead = null; 27464 this._removalsTail = null; 27465 // Keeps track of records where custom track by is the same, but item identity has changed 27466 this._identityChangesHead = null; 27467 this._identityChangesTail = null; 27468 this._trackByFn = trackByFn || trackByIdentity; 27469 } 27470 forEachItem(fn) { 27471 let record; 27472 for (record = this._itHead; record !== null; record = record._next) { 27473 fn(record); 27474 } 27475 } 27476 forEachOperation(fn) { 27477 let nextIt = this._itHead; 27478 let nextRemove = this._removalsHead; 27479 let addRemoveOffset = 0; 27480 let moveOffsets = null; 27481 while (nextIt || nextRemove) { 27482 // Figure out which is the next record to process 27483 // Order: remove, add, move 27484 const record = !nextRemove || 27485 nextIt && 27486 nextIt.currentIndex < 27487 getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ? 27488 nextIt : 27489 nextRemove; 27490 const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets); 27491 const currentIndex = record.currentIndex; 27492 // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary 27493 if (record === nextRemove) { 27494 addRemoveOffset--; 27495 nextRemove = nextRemove._nextRemoved; 27496 } 27497 else { 27498 nextIt = nextIt._next; 27499 if (record.previousIndex == null) { 27500 addRemoveOffset++; 27501 } 27502 else { 27503 // INVARIANT: currentIndex < previousIndex 27504 if (!moveOffsets) 27505 moveOffsets = []; 27506 const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset; 27507 const localCurrentIndex = currentIndex - addRemoveOffset; 27508 if (localMovePreviousIndex != localCurrentIndex) { 27509 for (let i = 0; i < localMovePreviousIndex; i++) { 27510 const offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0); 27511 const index = offset + i; 27512 if (localCurrentIndex <= index && index < localMovePreviousIndex) { 27513 moveOffsets[i] = offset + 1; 27514 } 27515 } 27516 const previousIndex = record.previousIndex; 27517 moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex; 27518 } 27519 } 27520 } 27521 if (adjPreviousIndex !== currentIndex) { 27522 fn(record, adjPreviousIndex, currentIndex); 27523 } 27524 } 27525 } 27526 forEachPreviousItem(fn) { 27527 let record; 27528 for (record = this._previousItHead; record !== null; record = record._nextPrevious) { 27529 fn(record); 27530 } 27531 } 27532 forEachAddedItem(fn) { 27533 let record; 27534 for (record = this._additionsHead; record !== null; record = record._nextAdded) { 27535 fn(record); 27536 } 27537 } 27538 forEachMovedItem(fn) { 27539 let record; 27540 for (record = this._movesHead; record !== null; record = record._nextMoved) { 27541 fn(record); 27542 } 27543 } 27544 forEachRemovedItem(fn) { 27545 let record; 27546 for (record = this._removalsHead; record !== null; record = record._nextRemoved) { 27547 fn(record); 27548 } 27549 } 27550 forEachIdentityChange(fn) { 27551 let record; 27552 for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) { 27553 fn(record); 27554 } 27555 } 27556 diff(collection) { 27557 if (collection == null) 27558 collection = []; 27559 if (!isListLikeIterable(collection)) { 27560 throw new Error(`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`); 27561 } 27562 if (this.check(collection)) { 27563 return this; 27564 } 27565 else { 27566 return null; 27567 } 27568 } 27569 onDestroy() { } 27570 check(collection) { 27571 this._reset(); 27572 let record = this._itHead; 27573 let mayBeDirty = false; 27574 let index; 27575 let item; 27576 let itemTrackBy; 27577 if (Array.isArray(collection)) { 27578 this.length = collection.length; 27579 for (let index = 0; index < this.length; index++) { 27580 item = collection[index]; 27581 itemTrackBy = this._trackByFn(index, item); 27582 if (record === null || !Object.is(record.trackById, itemTrackBy)) { 27583 record = this._mismatch(record, item, itemTrackBy, index); 27584 mayBeDirty = true; 27585 } 27586 else { 27587 if (mayBeDirty) { 27588 // TODO(misko): can we limit this to duplicates only? 27589 record = this._verifyReinsertion(record, item, itemTrackBy, index); 27590 } 27591 if (!Object.is(record.item, item)) 27592 this._addIdentityChange(record, item); 27593 } 27594 record = record._next; 27595 } 27596 } 27597 else { 27598 index = 0; 27599 iterateListLike(collection, (item) => { 27600 itemTrackBy = this._trackByFn(index, item); 27601 if (record === null || !Object.is(record.trackById, itemTrackBy)) { 27602 record = this._mismatch(record, item, itemTrackBy, index); 27603 mayBeDirty = true; 27604 } 27605 else { 27606 if (mayBeDirty) { 27607 // TODO(misko): can we limit this to duplicates only? 27608 record = this._verifyReinsertion(record, item, itemTrackBy, index); 27609 } 27610 if (!Object.is(record.item, item)) 27611 this._addIdentityChange(record, item); 27612 } 27613 record = record._next; 27614 index++; 27615 }); 27616 this.length = index; 27617 } 27618 this._truncate(record); 27619 this.collection = collection; 27620 return this.isDirty; 27621 } 27622 /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity 27623 * changes. 27624 */ 27625 get isDirty() { 27626 return this._additionsHead !== null || this._movesHead !== null || 27627 this._removalsHead !== null || this._identityChangesHead !== null; 27628 } 27629 /** 27630 * Reset the state of the change objects to show no changes. This means set previousKey to 27631 * currentKey, and clear all of the queues (additions, moves, removals). 27632 * Set the previousIndexes of moved and added items to their currentIndexes 27633 * Reset the list of additions, moves and removals 27634 * 27635 * @internal 27636 */ 27637 _reset() { 27638 if (this.isDirty) { 27639 let record; 27640 let nextRecord; 27641 for (record = this._previousItHead = this._itHead; record !== null; record = record._next) { 27642 record._nextPrevious = record._next; 27643 } 27644 for (record = this._additionsHead; record !== null; record = record._nextAdded) { 27645 record.previousIndex = record.currentIndex; 27646 } 27647 this._additionsHead = this._additionsTail = null; 27648 for (record = this._movesHead; record !== null; record = nextRecord) { 27649 record.previousIndex = record.currentIndex; 27650 nextRecord = record._nextMoved; 27651 } 27652 this._movesHead = this._movesTail = null; 27653 this._removalsHead = this._removalsTail = null; 27654 this._identityChangesHead = this._identityChangesTail = null; 27655 // TODO(vicb): when assert gets supported 27656 // assert(!this.isDirty); 27657 } 27658 } 27659 /** 27660 * This is the core function which handles differences between collections. 27661 * 27662 * - `record` is the record which we saw at this position last time. If null then it is a new 27663 * item. 27664 * - `item` is the current item in the collection 27665 * - `index` is the position of the item in the collection 27666 * 27667 * @internal 27668 */ 27669 _mismatch(record, item, itemTrackBy, index) { 27670 // The previous record after which we will append the current one. 27671 let previousRecord; 27672 if (record === null) { 27673 previousRecord = this._itTail; 27674 } 27675 else { 27676 previousRecord = record._prev; 27677 // Remove the record from the collection since we know it does not match the item. 27678 this._remove(record); 27679 } 27680 // Attempt to see if we have seen the item before. 27681 record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index); 27682 if (record !== null) { 27683 // We have seen this before, we need to move it forward in the collection. 27684 // But first we need to check if identity changed, so we can update in view if necessary 27685 if (!Object.is(record.item, item)) 27686 this._addIdentityChange(record, item); 27687 this._moveAfter(record, previousRecord, index); 27688 } 27689 else { 27690 // Never seen it, check evicted list. 27691 record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null); 27692 if (record !== null) { 27693 // It is an item which we have evicted earlier: reinsert it back into the list. 27694 // But first we need to check if identity changed, so we can update in view if necessary 27695 if (!Object.is(record.item, item)) 27696 this._addIdentityChange(record, item); 27697 this._reinsertAfter(record, previousRecord, index); 27698 } 27699 else { 27700 // It is a new item: add it. 27701 record = 27702 this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index); 27703 } 27704 } 27705 return record; 27706 } 27707 /** 27708 * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty) 27709 * 27710 * Use case: `[a, a]` => `[b, a, a]` 27711 * 27712 * If we did not have this check then the insertion of `b` would: 27713 * 1) evict first `a` 27714 * 2) insert `b` at `0` index. 27715 * 3) leave `a` at index `1` as is. <-- this is wrong! 27716 * 3) reinsert `a` at index 2. <-- this is wrong! 27717 * 27718 * The correct behavior is: 27719 * 1) evict first `a` 27720 * 2) insert `b` at `0` index. 27721 * 3) reinsert `a` at index 1. 27722 * 3) move `a` at from `1` to `2`. 27723 * 27724 * 27725 * Double check that we have not evicted a duplicate item. We need to check if the item type may 27726 * have already been removed: 27727 * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted 27728 * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a 27729 * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a' 27730 * at the end. 27731 * 27732 * @internal 27733 */ 27734 _verifyReinsertion(record, item, itemTrackBy, index) { 27735 let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null); 27736 if (reinsertRecord !== null) { 27737 record = this._reinsertAfter(reinsertRecord, record._prev, index); 27738 } 27739 else if (record.currentIndex != index) { 27740 record.currentIndex = index; 27741 this._addToMoves(record, index); 27742 } 27743 return record; 27744 } 27745 /** 27746 * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection 27747 * 27748 * - `record` The first excess {@link IterableChangeRecord_}. 27749 * 27750 * @internal 27751 */ 27752 _truncate(record) { 27753 // Anything after that needs to be removed; 27754 while (record !== null) { 27755 const nextRecord = record._next; 27756 this._addToRemovals(this._unlink(record)); 27757 record = nextRecord; 27758 } 27759 if (this._unlinkedRecords !== null) { 27760 this._unlinkedRecords.clear(); 27761 } 27762 if (this._additionsTail !== null) { 27763 this._additionsTail._nextAdded = null; 27764 } 27765 if (this._movesTail !== null) { 27766 this._movesTail._nextMoved = null; 27767 } 27768 if (this._itTail !== null) { 27769 this._itTail._next = null; 27770 } 27771 if (this._removalsTail !== null) { 27772 this._removalsTail._nextRemoved = null; 27773 } 27774 if (this._identityChangesTail !== null) { 27775 this._identityChangesTail._nextIdentityChange = null; 27776 } 27777 } 27778 /** @internal */ 27779 _reinsertAfter(record, prevRecord, index) { 27780 if (this._unlinkedRecords !== null) { 27781 this._unlinkedRecords.remove(record); 27782 } 27783 const prev = record._prevRemoved; 27784 const next = record._nextRemoved; 27785 if (prev === null) { 27786 this._removalsHead = next; 27787 } 27788 else { 27789 prev._nextRemoved = next; 27790 } 27791 if (next === null) { 27792 this._removalsTail = prev; 27793 } 27794 else { 27795 next._prevRemoved = prev; 27796 } 27797 this._insertAfter(record, prevRecord, index); 27798 this._addToMoves(record, index); 27799 return record; 27800 } 27801 /** @internal */ 27802 _moveAfter(record, prevRecord, index) { 27803 this._unlink(record); 27804 this._insertAfter(record, prevRecord, index); 27805 this._addToMoves(record, index); 27806 return record; 27807 } 27808 /** @internal */ 27809 _addAfter(record, prevRecord, index) { 27810 this._insertAfter(record, prevRecord, index); 27811 if (this._additionsTail === null) { 27812 // TODO(vicb): 27813 // assert(this._additionsHead === null); 27814 this._additionsTail = this._additionsHead = record; 27815 } 27816 else { 27817 // TODO(vicb): 27818 // assert(_additionsTail._nextAdded === null); 27819 // assert(record._nextAdded === null); 27820 this._additionsTail = this._additionsTail._nextAdded = record; 27821 } 27822 return record; 27823 } 27824 /** @internal */ 27825 _insertAfter(record, prevRecord, index) { 27826 // TODO(vicb): 27827 // assert(record != prevRecord); 27828 // assert(record._next === null); 27829 // assert(record._prev === null); 27830 const next = prevRecord === null ? this._itHead : prevRecord._next; 27831 // TODO(vicb): 27832 // assert(next != record); 27833 // assert(prevRecord != record); 27834 record._next = next; 27835 record._prev = prevRecord; 27836 if (next === null) { 27837 this._itTail = record; 27838 } 27839 else { 27840 next._prev = record; 27841 } 27842 if (prevRecord === null) { 27843 this._itHead = record; 27844 } 27845 else { 27846 prevRecord._next = record; 27847 } 27848 if (this._linkedRecords === null) { 27849 this._linkedRecords = new _DuplicateMap(); 27850 } 27851 this._linkedRecords.put(record); 27852 record.currentIndex = index; 27853 return record; 27854 } 27855 /** @internal */ 27856 _remove(record) { 27857 return this._addToRemovals(this._unlink(record)); 27858 } 27859 /** @internal */ 27860 _unlink(record) { 27861 if (this._linkedRecords !== null) { 27862 this._linkedRecords.remove(record); 27863 } 27864 const prev = record._prev; 27865 const next = record._next; 27866 // TODO(vicb): 27867 // assert((record._prev = null) === null); 27868 // assert((record._next = null) === null); 27869 if (prev === null) { 27870 this._itHead = next; 27871 } 27872 else { 27873 prev._next = next; 27874 } 27875 if (next === null) { 27876 this._itTail = prev; 27877 } 27878 else { 27879 next._prev = prev; 27880 } 27881 return record; 27882 } 27883 /** @internal */ 27884 _addToMoves(record, toIndex) { 27885 // TODO(vicb): 27886 // assert(record._nextMoved === null); 27887 if (record.previousIndex === toIndex) { 27888 return record; 27889 } 27890 if (this._movesTail === null) { 27891 // TODO(vicb): 27892 // assert(_movesHead === null); 27893 this._movesTail = this._movesHead = record; 27894 } 27895 else { 27896 // TODO(vicb): 27897 // assert(_movesTail._nextMoved === null); 27898 this._movesTail = this._movesTail._nextMoved = record; 27899 } 27900 return record; 27901 } 27902 _addToRemovals(record) { 27903 if (this._unlinkedRecords === null) { 27904 this._unlinkedRecords = new _DuplicateMap(); 27905 } 27906 this._unlinkedRecords.put(record); 27907 record.currentIndex = null; 27908 record._nextRemoved = null; 27909 if (this._removalsTail === null) { 27910 // TODO(vicb): 27911 // assert(_removalsHead === null); 27912 this._removalsTail = this._removalsHead = record; 27913 record._prevRemoved = null; 27914 } 27915 else { 27916 // TODO(vicb): 27917 // assert(_removalsTail._nextRemoved === null); 27918 // assert(record._nextRemoved === null); 27919 record._prevRemoved = this._removalsTail; 27920 this._removalsTail = this._removalsTail._nextRemoved = record; 27921 } 27922 return record; 27923 } 27924 /** @internal */ 27925 _addIdentityChange(record, item) { 27926 record.item = item; 27927 if (this._identityChangesTail === null) { 27928 this._identityChangesTail = this._identityChangesHead = record; 27929 } 27930 else { 27931 this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record; 27932 } 27933 return record; 27934 } 27935} 27936class IterableChangeRecord_ { 27937 constructor(item, trackById) { 27938 this.item = item; 27939 this.trackById = trackById; 27940 this.currentIndex = null; 27941 this.previousIndex = null; 27942 /** @internal */ 27943 this._nextPrevious = null; 27944 /** @internal */ 27945 this._prev = null; 27946 /** @internal */ 27947 this._next = null; 27948 /** @internal */ 27949 this._prevDup = null; 27950 /** @internal */ 27951 this._nextDup = null; 27952 /** @internal */ 27953 this._prevRemoved = null; 27954 /** @internal */ 27955 this._nextRemoved = null; 27956 /** @internal */ 27957 this._nextAdded = null; 27958 /** @internal */ 27959 this._nextMoved = null; 27960 /** @internal */ 27961 this._nextIdentityChange = null; 27962 } 27963} 27964// A linked list of CollectionChangeRecords with the same IterableChangeRecord_.item 27965class _DuplicateItemRecordList { 27966 constructor() { 27967 /** @internal */ 27968 this._head = null; 27969 /** @internal */ 27970 this._tail = null; 27971 } 27972 /** 27973 * Append the record to the list of duplicates. 27974 * 27975 * Note: by design all records in the list of duplicates hold the same value in record.item. 27976 */ 27977 add(record) { 27978 if (this._head === null) { 27979 this._head = this._tail = record; 27980 record._nextDup = null; 27981 record._prevDup = null; 27982 } 27983 else { 27984 // TODO(vicb): 27985 // assert(record.item == _head.item || 27986 // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN); 27987 this._tail._nextDup = record; 27988 record._prevDup = this._tail; 27989 record._nextDup = null; 27990 this._tail = record; 27991 } 27992 } 27993 // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and 27994 // IterableChangeRecord_.currentIndex >= atOrAfterIndex 27995 get(trackById, atOrAfterIndex) { 27996 let record; 27997 for (record = this._head; record !== null; record = record._nextDup) { 27998 if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) && 27999 Object.is(record.trackById, trackById)) { 28000 return record; 28001 } 28002 } 28003 return null; 28004 } 28005 /** 28006 * Remove one {@link IterableChangeRecord_} from the list of duplicates. 28007 * 28008 * Returns whether the list of duplicates is empty. 28009 */ 28010 remove(record) { 28011 // TODO(vicb): 28012 // assert(() { 28013 // // verify that the record being removed is in the list. 28014 // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) { 28015 // if (identical(cursor, record)) return true; 28016 // } 28017 // return false; 28018 //}); 28019 const prev = record._prevDup; 28020 const next = record._nextDup; 28021 if (prev === null) { 28022 this._head = next; 28023 } 28024 else { 28025 prev._nextDup = next; 28026 } 28027 if (next === null) { 28028 this._tail = prev; 28029 } 28030 else { 28031 next._prevDup = prev; 28032 } 28033 return this._head === null; 28034 } 28035} 28036class _DuplicateMap { 28037 constructor() { 28038 this.map = new Map(); 28039 } 28040 put(record) { 28041 const key = record.trackById; 28042 let duplicates = this.map.get(key); 28043 if (!duplicates) { 28044 duplicates = new _DuplicateItemRecordList(); 28045 this.map.set(key, duplicates); 28046 } 28047 duplicates.add(record); 28048 } 28049 /** 28050 * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we 28051 * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there. 28052 * 28053 * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we 28054 * have any more `a`s needs to return the second `a`. 28055 */ 28056 get(trackById, atOrAfterIndex) { 28057 const key = trackById; 28058 const recordList = this.map.get(key); 28059 return recordList ? recordList.get(trackById, atOrAfterIndex) : null; 28060 } 28061 /** 28062 * Removes a {@link IterableChangeRecord_} from the list of duplicates. 28063 * 28064 * The list of duplicates also is removed from the map if it gets empty. 28065 */ 28066 remove(record) { 28067 const key = record.trackById; 28068 const recordList = this.map.get(key); 28069 // Remove the list of duplicates when it gets empty 28070 if (recordList.remove(record)) { 28071 this.map.delete(key); 28072 } 28073 return record; 28074 } 28075 get isEmpty() { 28076 return this.map.size === 0; 28077 } 28078 clear() { 28079 this.map.clear(); 28080 } 28081} 28082function getPreviousIndex(item, addRemoveOffset, moveOffsets) { 28083 const previousIndex = item.previousIndex; 28084 if (previousIndex === null) 28085 return previousIndex; 28086 let moveOffset = 0; 28087 if (moveOffsets && previousIndex < moveOffsets.length) { 28088 moveOffset = moveOffsets[previousIndex]; 28089 } 28090 return previousIndex + addRemoveOffset + moveOffset; 28091} 28092 28093/** 28094 * @license 28095 * Copyright Google LLC All Rights Reserved. 28096 * 28097 * Use of this source code is governed by an MIT-style license that can be 28098 * found in the LICENSE file at https://angular.io/license 28099 */ 28100class DefaultKeyValueDifferFactory { 28101 constructor() { } 28102 supports(obj) { 28103 return obj instanceof Map || isJsObject(obj); 28104 } 28105 create() { 28106 return new DefaultKeyValueDiffer(); 28107 } 28108} 28109class DefaultKeyValueDiffer { 28110 constructor() { 28111 this._records = new Map(); 28112 this._mapHead = null; 28113 // _appendAfter is used in the check loop 28114 this._appendAfter = null; 28115 this._previousMapHead = null; 28116 this._changesHead = null; 28117 this._changesTail = null; 28118 this._additionsHead = null; 28119 this._additionsTail = null; 28120 this._removalsHead = null; 28121 this._removalsTail = null; 28122 } 28123 get isDirty() { 28124 return this._additionsHead !== null || this._changesHead !== null || 28125 this._removalsHead !== null; 28126 } 28127 forEachItem(fn) { 28128 let record; 28129 for (record = this._mapHead; record !== null; record = record._next) { 28130 fn(record); 28131 } 28132 } 28133 forEachPreviousItem(fn) { 28134 let record; 28135 for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { 28136 fn(record); 28137 } 28138 } 28139 forEachChangedItem(fn) { 28140 let record; 28141 for (record = this._changesHead; record !== null; record = record._nextChanged) { 28142 fn(record); 28143 } 28144 } 28145 forEachAddedItem(fn) { 28146 let record; 28147 for (record = this._additionsHead; record !== null; record = record._nextAdded) { 28148 fn(record); 28149 } 28150 } 28151 forEachRemovedItem(fn) { 28152 let record; 28153 for (record = this._removalsHead; record !== null; record = record._nextRemoved) { 28154 fn(record); 28155 } 28156 } 28157 diff(map) { 28158 if (!map) { 28159 map = new Map(); 28160 } 28161 else if (!(map instanceof Map || isJsObject(map))) { 28162 throw new Error(`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`); 28163 } 28164 return this.check(map) ? this : null; 28165 } 28166 onDestroy() { } 28167 /** 28168 * Check the current state of the map vs the previous. 28169 * The algorithm is optimised for when the keys do no change. 28170 */ 28171 check(map) { 28172 this._reset(); 28173 let insertBefore = this._mapHead; 28174 this._appendAfter = null; 28175 this._forEach(map, (value, key) => { 28176 if (insertBefore && insertBefore.key === key) { 28177 this._maybeAddToChanges(insertBefore, value); 28178 this._appendAfter = insertBefore; 28179 insertBefore = insertBefore._next; 28180 } 28181 else { 28182 const record = this._getOrCreateRecordForKey(key, value); 28183 insertBefore = this._insertBeforeOrAppend(insertBefore, record); 28184 } 28185 }); 28186 // Items remaining at the end of the list have been deleted 28187 if (insertBefore) { 28188 if (insertBefore._prev) { 28189 insertBefore._prev._next = null; 28190 } 28191 this._removalsHead = insertBefore; 28192 for (let record = insertBefore; record !== null; record = record._nextRemoved) { 28193 if (record === this._mapHead) { 28194 this._mapHead = null; 28195 } 28196 this._records.delete(record.key); 28197 record._nextRemoved = record._next; 28198 record.previousValue = record.currentValue; 28199 record.currentValue = null; 28200 record._prev = null; 28201 record._next = null; 28202 } 28203 } 28204 // Make sure tails have no next records from previous runs 28205 if (this._changesTail) 28206 this._changesTail._nextChanged = null; 28207 if (this._additionsTail) 28208 this._additionsTail._nextAdded = null; 28209 return this.isDirty; 28210 } 28211 /** 28212 * Inserts a record before `before` or append at the end of the list when `before` is null. 28213 * 28214 * Notes: 28215 * - This method appends at `this._appendAfter`, 28216 * - This method updates `this._appendAfter`, 28217 * - The return value is the new value for the insertion pointer. 28218 */ 28219 _insertBeforeOrAppend(before, record) { 28220 if (before) { 28221 const prev = before._prev; 28222 record._next = before; 28223 record._prev = prev; 28224 before._prev = record; 28225 if (prev) { 28226 prev._next = record; 28227 } 28228 if (before === this._mapHead) { 28229 this._mapHead = record; 28230 } 28231 this._appendAfter = before; 28232 return before; 28233 } 28234 if (this._appendAfter) { 28235 this._appendAfter._next = record; 28236 record._prev = this._appendAfter; 28237 } 28238 else { 28239 this._mapHead = record; 28240 } 28241 this._appendAfter = record; 28242 return null; 28243 } 28244 _getOrCreateRecordForKey(key, value) { 28245 if (this._records.has(key)) { 28246 const record = this._records.get(key); 28247 this._maybeAddToChanges(record, value); 28248 const prev = record._prev; 28249 const next = record._next; 28250 if (prev) { 28251 prev._next = next; 28252 } 28253 if (next) { 28254 next._prev = prev; 28255 } 28256 record._next = null; 28257 record._prev = null; 28258 return record; 28259 } 28260 const record = new KeyValueChangeRecord_(key); 28261 this._records.set(key, record); 28262 record.currentValue = value; 28263 this._addToAdditions(record); 28264 return record; 28265 } 28266 /** @internal */ 28267 _reset() { 28268 if (this.isDirty) { 28269 let record; 28270 // let `_previousMapHead` contain the state of the map before the changes 28271 this._previousMapHead = this._mapHead; 28272 for (record = this._previousMapHead; record !== null; record = record._next) { 28273 record._nextPrevious = record._next; 28274 } 28275 // Update `record.previousValue` with the value of the item before the changes 28276 // We need to update all changed items (that's those which have been added and changed) 28277 for (record = this._changesHead; record !== null; record = record._nextChanged) { 28278 record.previousValue = record.currentValue; 28279 } 28280 for (record = this._additionsHead; record != null; record = record._nextAdded) { 28281 record.previousValue = record.currentValue; 28282 } 28283 this._changesHead = this._changesTail = null; 28284 this._additionsHead = this._additionsTail = null; 28285 this._removalsHead = null; 28286 } 28287 } 28288 // Add the record or a given key to the list of changes only when the value has actually changed 28289 _maybeAddToChanges(record, newValue) { 28290 if (!Object.is(newValue, record.currentValue)) { 28291 record.previousValue = record.currentValue; 28292 record.currentValue = newValue; 28293 this._addToChanges(record); 28294 } 28295 } 28296 _addToAdditions(record) { 28297 if (this._additionsHead === null) { 28298 this._additionsHead = this._additionsTail = record; 28299 } 28300 else { 28301 this._additionsTail._nextAdded = record; 28302 this._additionsTail = record; 28303 } 28304 } 28305 _addToChanges(record) { 28306 if (this._changesHead === null) { 28307 this._changesHead = this._changesTail = record; 28308 } 28309 else { 28310 this._changesTail._nextChanged = record; 28311 this._changesTail = record; 28312 } 28313 } 28314 /** @internal */ 28315 _forEach(obj, fn) { 28316 if (obj instanceof Map) { 28317 obj.forEach(fn); 28318 } 28319 else { 28320 Object.keys(obj).forEach(k => fn(obj[k], k)); 28321 } 28322 } 28323} 28324class KeyValueChangeRecord_ { 28325 constructor(key) { 28326 this.key = key; 28327 this.previousValue = null; 28328 this.currentValue = null; 28329 /** @internal */ 28330 this._nextPrevious = null; 28331 /** @internal */ 28332 this._next = null; 28333 /** @internal */ 28334 this._prev = null; 28335 /** @internal */ 28336 this._nextAdded = null; 28337 /** @internal */ 28338 this._nextRemoved = null; 28339 /** @internal */ 28340 this._nextChanged = null; 28341 } 28342} 28343 28344/** 28345 * @license 28346 * Copyright Google LLC All Rights Reserved. 28347 * 28348 * Use of this source code is governed by an MIT-style license that can be 28349 * found in the LICENSE file at https://angular.io/license 28350 */ 28351/** 28352 * A repository of different iterable diffing strategies used by NgFor, NgClass, and others. 28353 * 28354 * @publicApi 28355 */ 28356class IterableDiffers { 28357 constructor(factories) { 28358 this.factories = factories; 28359 } 28360 static create(factories, parent) { 28361 if (parent != null) { 28362 const copied = parent.factories.slice(); 28363 factories = factories.concat(copied); 28364 } 28365 return new IterableDiffers(factories); 28366 } 28367 /** 28368 * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the 28369 * inherited {@link IterableDiffers} instance with the provided factories and return a new 28370 * {@link IterableDiffers} instance. 28371 * 28372 * @usageNotes 28373 * ### Example 28374 * 28375 * The following example shows how to extend an existing list of factories, 28376 * which will only be applied to the injector for this component and its children. 28377 * This step is all that's required to make a new {@link IterableDiffer} available. 28378 * 28379 * ``` 28380 * @Component({ 28381 * viewProviders: [ 28382 * IterableDiffers.extend([new ImmutableListDiffer()]) 28383 * ] 28384 * }) 28385 * ``` 28386 */ 28387 static extend(factories) { 28388 return { 28389 provide: IterableDiffers, 28390 useFactory: (parent) => { 28391 if (!parent) { 28392 // Typically would occur when calling IterableDiffers.extend inside of dependencies passed 28393 // to 28394 // bootstrap(), which would override default pipes instead of extending them. 28395 throw new Error('Cannot extend IterableDiffers without a parent injector'); 28396 } 28397 return IterableDiffers.create(factories, parent); 28398 }, 28399 // Dependency technically isn't optional, but we can provide a better error message this way. 28400 deps: [[IterableDiffers, new SkipSelf(), new Optional()]] 28401 }; 28402 } 28403 find(iterable) { 28404 const factory = this.factories.find(f => f.supports(iterable)); 28405 if (factory != null) { 28406 return factory; 28407 } 28408 else { 28409 throw new Error(`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`); 28410 } 28411 } 28412} 28413/** @nocollapse */ 28414IterableDiffers.ɵprov = ɵɵdefineInjectable({ 28415 token: IterableDiffers, 28416 providedIn: 'root', 28417 factory: () => new IterableDiffers([new DefaultIterableDifferFactory()]) 28418}); 28419function getTypeNameForDebugging(type) { 28420 return type['name'] || typeof type; 28421} 28422 28423/** 28424 * @license 28425 * Copyright Google LLC All Rights Reserved. 28426 * 28427 * Use of this source code is governed by an MIT-style license that can be 28428 * found in the LICENSE file at https://angular.io/license 28429 */ 28430/** 28431 * A repository of different Map diffing strategies used by NgClass, NgStyle, and others. 28432 * 28433 * @publicApi 28434 */ 28435class KeyValueDiffers { 28436 constructor(factories) { 28437 this.factories = factories; 28438 } 28439 static create(factories, parent) { 28440 if (parent) { 28441 const copied = parent.factories.slice(); 28442 factories = factories.concat(copied); 28443 } 28444 return new KeyValueDiffers(factories); 28445 } 28446 /** 28447 * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the 28448 * inherited {@link KeyValueDiffers} instance with the provided factories and return a new 28449 * {@link KeyValueDiffers} instance. 28450 * 28451 * @usageNotes 28452 * ### Example 28453 * 28454 * The following example shows how to extend an existing list of factories, 28455 * which will only be applied to the injector for this component and its children. 28456 * This step is all that's required to make a new {@link KeyValueDiffer} available. 28457 * 28458 * ``` 28459 * @Component({ 28460 * viewProviders: [ 28461 * KeyValueDiffers.extend([new ImmutableMapDiffer()]) 28462 * ] 28463 * }) 28464 * ``` 28465 */ 28466 static extend(factories) { 28467 return { 28468 provide: KeyValueDiffers, 28469 useFactory: (parent) => { 28470 if (!parent) { 28471 // Typically would occur when calling KeyValueDiffers.extend inside of dependencies passed 28472 // to bootstrap(), which would override default pipes instead of extending them. 28473 throw new Error('Cannot extend KeyValueDiffers without a parent injector'); 28474 } 28475 return KeyValueDiffers.create(factories, parent); 28476 }, 28477 // Dependency technically isn't optional, but we can provide a better error message this way. 28478 deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]] 28479 }; 28480 } 28481 find(kv) { 28482 const factory = this.factories.find(f => f.supports(kv)); 28483 if (factory) { 28484 return factory; 28485 } 28486 throw new Error(`Cannot find a differ supporting object '${kv}'`); 28487 } 28488} 28489/** @nocollapse */ 28490KeyValueDiffers.ɵprov = ɵɵdefineInjectable({ 28491 token: KeyValueDiffers, 28492 providedIn: 'root', 28493 factory: () => new KeyValueDiffers([new DefaultKeyValueDifferFactory()]) 28494}); 28495 28496/** 28497 * @license 28498 * Copyright Google LLC All Rights Reserved. 28499 * 28500 * Use of this source code is governed by an MIT-style license that can be 28501 * found in the LICENSE file at https://angular.io/license 28502 */ 28503/** 28504 * Structural diffing for `Object`s and `Map`s. 28505 */ 28506const keyValDiff = [new DefaultKeyValueDifferFactory()]; 28507/** 28508 * Structural diffing for `Iterable` types such as `Array`s. 28509 */ 28510const iterableDiff = [new DefaultIterableDifferFactory()]; 28511const defaultIterableDiffers = new IterableDiffers(iterableDiff); 28512const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff); 28513 28514/** 28515 * @license 28516 * Copyright Google LLC All Rights Reserved. 28517 * 28518 * Use of this source code is governed by an MIT-style license that can be 28519 * found in the LICENSE file at https://angular.io/license 28520 */ 28521/** 28522 * Represents an embedded template that can be used to instantiate embedded views. 28523 * To instantiate embedded views based on a template, use the `ViewContainerRef` 28524 * method `createEmbeddedView()`. 28525 * 28526 * Access a `TemplateRef` instance by placing a directive on an `<ng-template>` 28527 * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view 28528 * is injected into the constructor of the directive, 28529 * using the `TemplateRef` token. 28530 * 28531 * You can also use a `Query` to find a `TemplateRef` associated with 28532 * a component or a directive. 28533 * 28534 * @see `ViewContainerRef` 28535 * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree) 28536 * 28537 * @publicApi 28538 */ 28539class TemplateRef { 28540} 28541/** 28542 * @internal 28543 * @nocollapse 28544 */ 28545TemplateRef.__NG_ELEMENT_ID__ = () => SWITCH_TEMPLATE_REF_FACTORY(TemplateRef, ElementRef); 28546const SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ = injectTemplateRef; 28547const SWITCH_TEMPLATE_REF_FACTORY__PRE_R3__ = noop; 28548const SWITCH_TEMPLATE_REF_FACTORY = SWITCH_TEMPLATE_REF_FACTORY__POST_R3__; 28549 28550/** 28551 * @license 28552 * Copyright Google LLC All Rights Reserved. 28553 * 28554 * Use of this source code is governed by an MIT-style license that can be 28555 * found in the LICENSE file at https://angular.io/license 28556 */ 28557/** 28558 * Represents a container where one or more views can be attached to a component. 28559 * 28560 * Can contain *host views* (created by instantiating a 28561 * component with the `createComponent()` method), and *embedded views* 28562 * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method). 28563 * 28564 * A view container instance can contain other view containers, 28565 * creating a [view hierarchy](guide/glossary#view-tree). 28566 * 28567 * @see `ComponentRef` 28568 * @see `EmbeddedViewRef` 28569 * 28570 * @publicApi 28571 */ 28572class ViewContainerRef { 28573} 28574/** 28575 * @internal 28576 * @nocollapse 28577 */ 28578ViewContainerRef.__NG_ELEMENT_ID__ = () => SWITCH_VIEW_CONTAINER_REF_FACTORY(ViewContainerRef, ElementRef); 28579const SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ = injectViewContainerRef; 28580const SWITCH_VIEW_CONTAINER_REF_FACTORY__PRE_R3__ = noop; 28581const SWITCH_VIEW_CONTAINER_REF_FACTORY = SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__; 28582 28583/** 28584 * @license 28585 * Copyright Google LLC All Rights Reserved. 28586 * 28587 * Use of this source code is governed by an MIT-style license that can be 28588 * found in the LICENSE file at https://angular.io/license 28589 */ 28590function expressionChangedAfterItHasBeenCheckedError(context, oldValue, currValue, isFirstCheck) { 28591 let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${oldValue}'. Current value: '${currValue}'.`; 28592 if (isFirstCheck) { 28593 msg += 28594 ` It seems like the view has been created after its parent and its children have been dirty checked.` + 28595 ` Has it been created in a change detection hook ?`; 28596 } 28597 return viewDebugError(msg, context); 28598} 28599function viewWrappedDebugError(err, context) { 28600 if (!(err instanceof Error)) { 28601 // errors that are not Error instances don't have a stack, 28602 // so it is ok to wrap them into a new Error object... 28603 err = new Error(err.toString()); 28604 } 28605 _addDebugContext(err, context); 28606 return err; 28607} 28608function viewDebugError(msg, context) { 28609 const err = new Error(msg); 28610 _addDebugContext(err, context); 28611 return err; 28612} 28613function _addDebugContext(err, context) { 28614 err[ERROR_DEBUG_CONTEXT] = context; 28615 err[ERROR_LOGGER] = context.logError.bind(context); 28616} 28617function isViewDebugError(err) { 28618 return !!getDebugContext(err); 28619} 28620function viewDestroyedError(action) { 28621 return new Error(`ViewDestroyedError: Attempt to use a destroyed view: ${action}`); 28622} 28623 28624/** 28625 * @license 28626 * Copyright Google LLC All Rights Reserved. 28627 * 28628 * Use of this source code is governed by an MIT-style license that can be 28629 * found in the LICENSE file at https://angular.io/license 28630 */ 28631// Called before each cycle of a view's check to detect whether this is in the 28632// initState for which we need to call ngOnInit, ngAfterContentInit or ngAfterViewInit 28633// lifecycle methods. Returns true if this check cycle should call lifecycle 28634// methods. 28635function shiftInitState(view, priorInitState, newInitState) { 28636 // Only update the InitState if we are currently in the prior state. 28637 // For example, only move into CallingInit if we are in BeforeInit. Only 28638 // move into CallingContentInit if we are in CallingInit. Normally this will 28639 // always be true because of how checkCycle is called in checkAndUpdateView. 28640 // However, if checkAndUpdateView is called recursively or if an exception is 28641 // thrown while checkAndUpdateView is running, checkAndUpdateView starts over 28642 // from the beginning. This ensures the state is monotonically increasing, 28643 // terminating in the AfterInit state, which ensures the Init methods are called 28644 // at least once and only once. 28645 const state = view.state; 28646 const initState = state & 1792 /* InitState_Mask */; 28647 if (initState === priorInitState) { 28648 view.state = (state & ~1792 /* InitState_Mask */) | newInitState; 28649 view.initIndex = -1; 28650 return true; 28651 } 28652 return initState === newInitState; 28653} 28654// Returns true if the lifecycle init method should be called for the node with 28655// the given init index. 28656function shouldCallLifecycleInitHook(view, initState, index) { 28657 if ((view.state & 1792 /* InitState_Mask */) === initState && view.initIndex <= index) { 28658 view.initIndex = index + 1; 28659 return true; 28660 } 28661 return false; 28662} 28663/** 28664 * Node instance data. 28665 * 28666 * We have a separate type per NodeType to save memory 28667 * (TextData | ElementData | ProviderData | PureExpressionData | QueryList<any>) 28668 * 28669 * To keep our code monomorphic, 28670 * we prohibit using `NodeData` directly but enforce the use of accessors (`asElementData`, ...). 28671 * This way, no usage site can get a `NodeData` from view.nodes and then use it for different 28672 * purposes. 28673 */ 28674class NodeData { 28675} 28676/** 28677 * Accessor for view.nodes, enforcing that every usage site stays monomorphic. 28678 */ 28679function asTextData(view, index) { 28680 return view.nodes[index]; 28681} 28682/** 28683 * Accessor for view.nodes, enforcing that every usage site stays monomorphic. 28684 */ 28685function asElementData(view, index) { 28686 return view.nodes[index]; 28687} 28688/** 28689 * Accessor for view.nodes, enforcing that every usage site stays monomorphic. 28690 */ 28691function asProviderData(view, index) { 28692 return view.nodes[index]; 28693} 28694/** 28695 * Accessor for view.nodes, enforcing that every usage site stays monomorphic. 28696 */ 28697function asPureExpressionData(view, index) { 28698 return view.nodes[index]; 28699} 28700/** 28701 * Accessor for view.nodes, enforcing that every usage site stays monomorphic. 28702 */ 28703function asQueryList(view, index) { 28704 return view.nodes[index]; 28705} 28706class DebugContext { 28707} 28708/** 28709 * This object is used to prevent cycles in the source files and to have a place where 28710 * debug mode can hook it. It is lazily filled when `isDevMode` is known. 28711 */ 28712const Services = { 28713 setCurrentNode: undefined, 28714 createRootView: undefined, 28715 createEmbeddedView: undefined, 28716 createComponentView: undefined, 28717 createNgModuleRef: undefined, 28718 overrideProvider: undefined, 28719 overrideComponentView: undefined, 28720 clearOverrides: undefined, 28721 checkAndUpdateView: undefined, 28722 checkNoChangesView: undefined, 28723 destroyView: undefined, 28724 resolveDep: undefined, 28725 createDebugContext: undefined, 28726 handleEvent: undefined, 28727 updateDirectives: undefined, 28728 updateRenderer: undefined, 28729 dirtyParentQueries: undefined, 28730}; 28731 28732/** 28733 * @license 28734 * Copyright Google LLC All Rights Reserved. 28735 * 28736 * Use of this source code is governed by an MIT-style license that can be 28737 * found in the LICENSE file at https://angular.io/license 28738 */ 28739const NOOP = () => { }; 28740const _tokenKeyCache = new Map(); 28741function tokenKey(token) { 28742 let key = _tokenKeyCache.get(token); 28743 if (!key) { 28744 key = stringify(token) + '_' + _tokenKeyCache.size; 28745 _tokenKeyCache.set(token, key); 28746 } 28747 return key; 28748} 28749function unwrapValue(view, nodeIdx, bindingIdx, value) { 28750 if (WrappedValue.isWrapped(value)) { 28751 value = WrappedValue.unwrap(value); 28752 const globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx; 28753 const oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]); 28754 view.oldValues[globalBindingIdx] = new WrappedValue(oldValue); 28755 } 28756 return value; 28757} 28758const UNDEFINED_RENDERER_TYPE_ID = '$$undefined'; 28759const EMPTY_RENDERER_TYPE_ID = '$$empty'; 28760// Attention: this function is called as top level function. 28761// Putting any logic in here will destroy closure tree shaking! 28762function createRendererType2(values) { 28763 return { 28764 id: UNDEFINED_RENDERER_TYPE_ID, 28765 styles: values.styles, 28766 encapsulation: values.encapsulation, 28767 data: values.data 28768 }; 28769} 28770let _renderCompCount$1 = 0; 28771function resolveRendererType2(type) { 28772 if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) { 28773 // first time we see this RendererType2. Initialize it... 28774 const isFilled = ((type.encapsulation != null && type.encapsulation !== ViewEncapsulation$1.None) || 28775 type.styles.length || Object.keys(type.data).length); 28776 if (isFilled) { 28777 type.id = `c${_renderCompCount$1++}`; 28778 } 28779 else { 28780 type.id = EMPTY_RENDERER_TYPE_ID; 28781 } 28782 } 28783 if (type && type.id === EMPTY_RENDERER_TYPE_ID) { 28784 type = null; 28785 } 28786 return type || null; 28787} 28788function checkBinding(view, def, bindingIdx, value) { 28789 const oldValues = view.oldValues; 28790 if ((view.state & 2 /* FirstCheck */) || 28791 !Object.is(oldValues[def.bindingIndex + bindingIdx], value)) { 28792 return true; 28793 } 28794 return false; 28795} 28796function checkAndUpdateBinding(view, def, bindingIdx, value) { 28797 if (checkBinding(view, def, bindingIdx, value)) { 28798 view.oldValues[def.bindingIndex + bindingIdx] = value; 28799 return true; 28800 } 28801 return false; 28802} 28803function checkBindingNoChanges(view, def, bindingIdx, value) { 28804 const oldValue = view.oldValues[def.bindingIndex + bindingIdx]; 28805 if ((view.state & 1 /* BeforeFirstCheck */) || !devModeEqual(oldValue, value)) { 28806 const bindingName = def.bindings[bindingIdx].name; 28807 throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, def.nodeIndex), `${bindingName}: ${oldValue}`, `${bindingName}: ${value}`, (view.state & 1 /* BeforeFirstCheck */) !== 0); 28808 } 28809} 28810function markParentViewsForCheck(view) { 28811 let currView = view; 28812 while (currView) { 28813 if (currView.def.flags & 2 /* OnPush */) { 28814 currView.state |= 8 /* ChecksEnabled */; 28815 } 28816 currView = currView.viewContainerParent || currView.parent; 28817 } 28818} 28819function markParentViewsForCheckProjectedViews(view, endView) { 28820 let currView = view; 28821 while (currView && currView !== endView) { 28822 currView.state |= 64 /* CheckProjectedViews */; 28823 currView = currView.viewContainerParent || currView.parent; 28824 } 28825} 28826function dispatchEvent(view, nodeIndex, eventName, event) { 28827 try { 28828 const nodeDef = view.def.nodes[nodeIndex]; 28829 const startView = nodeDef.flags & 33554432 /* ComponentView */ ? 28830 asElementData(view, nodeIndex).componentView : 28831 view; 28832 markParentViewsForCheck(startView); 28833 return Services.handleEvent(view, nodeIndex, eventName, event); 28834 } 28835 catch (e) { 28836 // Attention: Don't rethrow, as it would cancel Observable subscriptions! 28837 view.root.errorHandler.handleError(e); 28838 } 28839} 28840function declaredViewContainer(view) { 28841 if (view.parent) { 28842 const parentView = view.parent; 28843 return asElementData(parentView, view.parentNodeDef.nodeIndex); 28844 } 28845 return null; 28846} 28847/** 28848 * for component views, this is the host element. 28849 * for embedded views, this is the index of the parent node 28850 * that contains the view container. 28851 */ 28852function viewParentEl(view) { 28853 const parentView = view.parent; 28854 if (parentView) { 28855 return view.parentNodeDef.parent; 28856 } 28857 else { 28858 return null; 28859 } 28860} 28861function renderNode(view, def) { 28862 switch (def.flags & 201347067 /* Types */) { 28863 case 1 /* TypeElement */: 28864 return asElementData(view, def.nodeIndex).renderElement; 28865 case 2 /* TypeText */: 28866 return asTextData(view, def.nodeIndex).renderText; 28867 } 28868} 28869function elementEventFullName(target, name) { 28870 return target ? `${target}:${name}` : name; 28871} 28872function isComponentView(view) { 28873 return !!view.parent && !!(view.parentNodeDef.flags & 32768 /* Component */); 28874} 28875function isEmbeddedView(view) { 28876 return !!view.parent && !(view.parentNodeDef.flags & 32768 /* Component */); 28877} 28878function filterQueryId(queryId) { 28879 return 1 << (queryId % 32); 28880} 28881function splitMatchedQueriesDsl(matchedQueriesDsl) { 28882 const matchedQueries = {}; 28883 let matchedQueryIds = 0; 28884 const references = {}; 28885 if (matchedQueriesDsl) { 28886 matchedQueriesDsl.forEach(([queryId, valueType]) => { 28887 if (typeof queryId === 'number') { 28888 matchedQueries[queryId] = valueType; 28889 matchedQueryIds |= filterQueryId(queryId); 28890 } 28891 else { 28892 references[queryId] = valueType; 28893 } 28894 }); 28895 } 28896 return { matchedQueries, references, matchedQueryIds }; 28897} 28898function splitDepsDsl(deps, sourceName) { 28899 return deps.map(value => { 28900 let token; 28901 let flags; 28902 if (Array.isArray(value)) { 28903 [flags, token] = value; 28904 } 28905 else { 28906 flags = 0 /* None */; 28907 token = value; 28908 } 28909 if (token && (typeof token === 'function' || typeof token === 'object') && sourceName) { 28910 Object.defineProperty(token, SOURCE, { value: sourceName, configurable: true }); 28911 } 28912 return { flags, token, tokenKey: tokenKey(token) }; 28913 }); 28914} 28915function getParentRenderElement(view, renderHost, def) { 28916 let renderParent = def.renderParent; 28917 if (renderParent) { 28918 if ((renderParent.flags & 1 /* TypeElement */) === 0 || 28919 (renderParent.flags & 33554432 /* ComponentView */) === 0 || 28920 (renderParent.element.componentRendererType && 28921 renderParent.element.componentRendererType.encapsulation === ViewEncapsulation$1.Native)) { 28922 // only children of non components, or children of components with native encapsulation should 28923 // be attached. 28924 return asElementData(view, def.renderParent.nodeIndex).renderElement; 28925 } 28926 } 28927 else { 28928 return renderHost; 28929 } 28930} 28931const DEFINITION_CACHE = new WeakMap(); 28932function resolveDefinition(factory) { 28933 let value = DEFINITION_CACHE.get(factory); 28934 if (!value) { 28935 value = factory(() => NOOP); 28936 value.factory = factory; 28937 DEFINITION_CACHE.set(factory, value); 28938 } 28939 return value; 28940} 28941function rootRenderNodes(view) { 28942 const renderNodes = []; 28943 visitRootRenderNodes(view, 0 /* Collect */, undefined, undefined, renderNodes); 28944 return renderNodes; 28945} 28946function visitRootRenderNodes(view, action, parentNode, nextSibling, target) { 28947 // We need to re-compute the parent node in case the nodes have been moved around manually 28948 if (action === 3 /* RemoveChild */) { 28949 parentNode = view.renderer.parentNode(renderNode(view, view.def.lastRenderRootNode)); 28950 } 28951 visitSiblingRenderNodes(view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target); 28952} 28953function visitSiblingRenderNodes(view, action, startIndex, endIndex, parentNode, nextSibling, target) { 28954 for (let i = startIndex; i <= endIndex; i++) { 28955 const nodeDef = view.def.nodes[i]; 28956 if (nodeDef.flags & (1 /* TypeElement */ | 2 /* TypeText */ | 8 /* TypeNgContent */)) { 28957 visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target); 28958 } 28959 // jump to next sibling 28960 i += nodeDef.childCount; 28961 } 28962} 28963function visitProjectedRenderNodes(view, ngContentIndex, action, parentNode, nextSibling, target) { 28964 let compView = view; 28965 while (compView && !isComponentView(compView)) { 28966 compView = compView.parent; 28967 } 28968 const hostView = compView.parent; 28969 const hostElDef = viewParentEl(compView); 28970 const startIndex = hostElDef.nodeIndex + 1; 28971 const endIndex = hostElDef.nodeIndex + hostElDef.childCount; 28972 for (let i = startIndex; i <= endIndex; i++) { 28973 const nodeDef = hostView.def.nodes[i]; 28974 if (nodeDef.ngContentIndex === ngContentIndex) { 28975 visitRenderNode(hostView, nodeDef, action, parentNode, nextSibling, target); 28976 } 28977 // jump to next sibling 28978 i += nodeDef.childCount; 28979 } 28980 if (!hostView.parent) { 28981 // a root view 28982 const projectedNodes = view.root.projectableNodes[ngContentIndex]; 28983 if (projectedNodes) { 28984 for (let i = 0; i < projectedNodes.length; i++) { 28985 execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target); 28986 } 28987 } 28988 } 28989} 28990function visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target) { 28991 if (nodeDef.flags & 8 /* TypeNgContent */) { 28992 visitProjectedRenderNodes(view, nodeDef.ngContent.index, action, parentNode, nextSibling, target); 28993 } 28994 else { 28995 const rn = renderNode(view, nodeDef); 28996 if (action === 3 /* RemoveChild */ && (nodeDef.flags & 33554432 /* ComponentView */) && 28997 (nodeDef.bindingFlags & 48 /* CatSyntheticProperty */)) { 28998 // Note: we might need to do both actions. 28999 if (nodeDef.bindingFlags & (16 /* SyntheticProperty */)) { 29000 execRenderNodeAction(view, rn, action, parentNode, nextSibling, target); 29001 } 29002 if (nodeDef.bindingFlags & (32 /* SyntheticHostProperty */)) { 29003 const compView = asElementData(view, nodeDef.nodeIndex).componentView; 29004 execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target); 29005 } 29006 } 29007 else { 29008 execRenderNodeAction(view, rn, action, parentNode, nextSibling, target); 29009 } 29010 if (nodeDef.flags & 16777216 /* EmbeddedViews */) { 29011 const embeddedViews = asElementData(view, nodeDef.nodeIndex).viewContainer._embeddedViews; 29012 for (let k = 0; k < embeddedViews.length; k++) { 29013 visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target); 29014 } 29015 } 29016 if (nodeDef.flags & 1 /* TypeElement */ && !nodeDef.element.name) { 29017 visitSiblingRenderNodes(view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode, nextSibling, target); 29018 } 29019 } 29020} 29021function execRenderNodeAction(view, renderNode, action, parentNode, nextSibling, target) { 29022 const renderer = view.renderer; 29023 switch (action) { 29024 case 1 /* AppendChild */: 29025 renderer.appendChild(parentNode, renderNode); 29026 break; 29027 case 2 /* InsertBefore */: 29028 renderer.insertBefore(parentNode, renderNode, nextSibling); 29029 break; 29030 case 3 /* RemoveChild */: 29031 renderer.removeChild(parentNode, renderNode); 29032 break; 29033 case 0 /* Collect */: 29034 target.push(renderNode); 29035 break; 29036 } 29037} 29038const NS_PREFIX_RE = /^:([^:]+):(.+)$/; 29039function splitNamespace(name) { 29040 if (name[0] === ':') { 29041 const match = name.match(NS_PREFIX_RE); 29042 return [match[1], match[2]]; 29043 } 29044 return ['', name]; 29045} 29046function calcBindingFlags(bindings) { 29047 let flags = 0; 29048 for (let i = 0; i < bindings.length; i++) { 29049 flags |= bindings[i].flags; 29050 } 29051 return flags; 29052} 29053function interpolate(valueCount, constAndInterp) { 29054 let result = ''; 29055 for (let i = 0; i < valueCount * 2; i = i + 2) { 29056 result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]); 29057 } 29058 return result + constAndInterp[valueCount * 2]; 29059} 29060function inlineInterpolate(valueCount, c0, a1, c1, a2, c2, a3, c3, a4, c4, a5, c5, a6, c6, a7, c7, a8, c8, a9, c9) { 29061 switch (valueCount) { 29062 case 1: 29063 return c0 + _toStringWithNull(a1) + c1; 29064 case 2: 29065 return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2; 29066 case 3: 29067 return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) + 29068 c3; 29069 case 4: 29070 return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) + 29071 c3 + _toStringWithNull(a4) + c4; 29072 case 5: 29073 return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) + 29074 c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5; 29075 case 6: 29076 return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) + 29077 c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6; 29078 case 7: 29079 return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) + 29080 c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + 29081 c6 + _toStringWithNull(a7) + c7; 29082 case 8: 29083 return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) + 29084 c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + 29085 c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8; 29086 case 9: 29087 return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) + 29088 c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + 29089 c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9; 29090 default: 29091 throw new Error(`Does not support more than 9 expressions`); 29092 } 29093} 29094function _toStringWithNull(v) { 29095 return v != null ? v.toString() : ''; 29096} 29097const EMPTY_ARRAY$4 = []; 29098const EMPTY_MAP = {}; 29099 29100/** 29101 * @license 29102 * Copyright Google LLC All Rights Reserved. 29103 * 29104 * Use of this source code is governed by an MIT-style license that can be 29105 * found in the LICENSE file at https://angular.io/license 29106 */ 29107const UNDEFINED_VALUE = {}; 29108const InjectorRefTokenKey = tokenKey(Injector); 29109const INJECTORRefTokenKey = tokenKey(INJECTOR); 29110const NgModuleRefTokenKey = tokenKey(NgModuleRef); 29111function moduleProvideDef(flags, token, value, deps) { 29112 // Need to resolve forwardRefs as e.g. for `useValue` we 29113 // lowered the expression and then stopped evaluating it, 29114 // i.e. also didn't unwrap it. 29115 value = resolveForwardRef(value); 29116 const depDefs = splitDepsDsl(deps, stringify(token)); 29117 return { 29118 // will bet set by the module definition 29119 index: -1, 29120 deps: depDefs, 29121 flags, 29122 token, 29123 value 29124 }; 29125} 29126function moduleDef(providers) { 29127 const providersByKey = {}; 29128 const modules = []; 29129 let scope = null; 29130 for (let i = 0; i < providers.length; i++) { 29131 const provider = providers[i]; 29132 if (provider.token === INJECTOR_SCOPE) { 29133 scope = provider.value; 29134 } 29135 if (provider.flags & 1073741824 /* TypeNgModule */) { 29136 modules.push(provider.token); 29137 } 29138 provider.index = i; 29139 providersByKey[tokenKey(provider.token)] = provider; 29140 } 29141 return { 29142 // Will be filled later... 29143 factory: null, 29144 providersByKey, 29145 providers, 29146 modules, 29147 scope: scope, 29148 }; 29149} 29150function initNgModule(data) { 29151 const def = data._def; 29152 const providers = data._providers = newArray(def.providers.length); 29153 for (let i = 0; i < def.providers.length; i++) { 29154 const provDef = def.providers[i]; 29155 if (!(provDef.flags & 4096 /* LazyProvider */)) { 29156 // Make sure the provider has not been already initialized outside this loop. 29157 if (providers[i] === undefined) { 29158 providers[i] = _createProviderInstance(data, provDef); 29159 } 29160 } 29161 } 29162} 29163function resolveNgModuleDep(data, depDef, notFoundValue = Injector.THROW_IF_NOT_FOUND) { 29164 const former = setCurrentInjector(data); 29165 try { 29166 if (depDef.flags & 8 /* Value */) { 29167 return depDef.token; 29168 } 29169 if (depDef.flags & 2 /* Optional */) { 29170 notFoundValue = null; 29171 } 29172 if (depDef.flags & 1 /* SkipSelf */) { 29173 return data._parent.get(depDef.token, notFoundValue); 29174 } 29175 const tokenKey = depDef.tokenKey; 29176 switch (tokenKey) { 29177 case InjectorRefTokenKey: 29178 case INJECTORRefTokenKey: 29179 case NgModuleRefTokenKey: 29180 return data; 29181 } 29182 const providerDef = data._def.providersByKey[tokenKey]; 29183 let injectableDef; 29184 if (providerDef) { 29185 let providerInstance = data._providers[providerDef.index]; 29186 if (providerInstance === undefined) { 29187 providerInstance = data._providers[providerDef.index] = 29188 _createProviderInstance(data, providerDef); 29189 } 29190 return providerInstance === UNDEFINED_VALUE ? undefined : providerInstance; 29191 } 29192 else if ((injectableDef = getInjectableDef(depDef.token)) && targetsModule(data, injectableDef)) { 29193 const index = data._providers.length; 29194 data._def.providers[index] = data._def.providersByKey[depDef.tokenKey] = { 29195 flags: 1024 /* TypeFactoryProvider */ | 4096 /* LazyProvider */, 29196 value: injectableDef.factory, 29197 deps: [], 29198 index, 29199 token: depDef.token, 29200 }; 29201 data._providers[index] = UNDEFINED_VALUE; 29202 return (data._providers[index] = 29203 _createProviderInstance(data, data._def.providersByKey[depDef.tokenKey])); 29204 } 29205 else if (depDef.flags & 4 /* Self */) { 29206 return notFoundValue; 29207 } 29208 return data._parent.get(depDef.token, notFoundValue); 29209 } 29210 finally { 29211 setCurrentInjector(former); 29212 } 29213} 29214function moduleTransitivelyPresent(ngModule, scope) { 29215 return ngModule._def.modules.indexOf(scope) > -1; 29216} 29217function targetsModule(ngModule, def) { 29218 const providedIn = def.providedIn; 29219 return providedIn != null && 29220 (providedIn === 'any' || providedIn === ngModule._def.scope || 29221 moduleTransitivelyPresent(ngModule, providedIn)); 29222} 29223function _createProviderInstance(ngModule, providerDef) { 29224 let injectable; 29225 switch (providerDef.flags & 201347067 /* Types */) { 29226 case 512 /* TypeClassProvider */: 29227 injectable = _createClass(ngModule, providerDef.value, providerDef.deps); 29228 break; 29229 case 1024 /* TypeFactoryProvider */: 29230 injectable = _callFactory(ngModule, providerDef.value, providerDef.deps); 29231 break; 29232 case 2048 /* TypeUseExistingProvider */: 29233 injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]); 29234 break; 29235 case 256 /* TypeValueProvider */: 29236 injectable = providerDef.value; 29237 break; 29238 } 29239 // The read of `ngOnDestroy` here is slightly expensive as it's megamorphic, so it should be 29240 // avoided if possible. The sequence of checks here determines whether ngOnDestroy needs to be 29241 // checked. It might not if the `injectable` isn't an object or if NodeFlags.OnDestroy is already 29242 // set (ngOnDestroy was detected statically). 29243 if (injectable !== UNDEFINED_VALUE && injectable !== null && typeof injectable === 'object' && 29244 !(providerDef.flags & 131072 /* OnDestroy */) && typeof injectable.ngOnDestroy === 'function') { 29245 providerDef.flags |= 131072 /* OnDestroy */; 29246 } 29247 return injectable === undefined ? UNDEFINED_VALUE : injectable; 29248} 29249function _createClass(ngModule, ctor, deps) { 29250 const len = deps.length; 29251 switch (len) { 29252 case 0: 29253 return new ctor(); 29254 case 1: 29255 return new ctor(resolveNgModuleDep(ngModule, deps[0])); 29256 case 2: 29257 return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1])); 29258 case 3: 29259 return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2])); 29260 default: 29261 const depValues = []; 29262 for (let i = 0; i < len; i++) { 29263 depValues[i] = resolveNgModuleDep(ngModule, deps[i]); 29264 } 29265 return new ctor(...depValues); 29266 } 29267} 29268function _callFactory(ngModule, factory, deps) { 29269 const len = deps.length; 29270 switch (len) { 29271 case 0: 29272 return factory(); 29273 case 1: 29274 return factory(resolveNgModuleDep(ngModule, deps[0])); 29275 case 2: 29276 return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1])); 29277 case 3: 29278 return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2])); 29279 default: 29280 const depValues = []; 29281 for (let i = 0; i < len; i++) { 29282 depValues[i] = resolveNgModuleDep(ngModule, deps[i]); 29283 } 29284 return factory(...depValues); 29285 } 29286} 29287function callNgModuleLifecycle(ngModule, lifecycles) { 29288 const def = ngModule._def; 29289 const destroyed = new Set(); 29290 for (let i = 0; i < def.providers.length; i++) { 29291 const provDef = def.providers[i]; 29292 if (provDef.flags & 131072 /* OnDestroy */) { 29293 const instance = ngModule._providers[i]; 29294 if (instance && instance !== UNDEFINED_VALUE) { 29295 const onDestroy = instance.ngOnDestroy; 29296 if (typeof onDestroy === 'function' && !destroyed.has(instance)) { 29297 onDestroy.apply(instance); 29298 destroyed.add(instance); 29299 } 29300 } 29301 } 29302 } 29303} 29304 29305/** 29306 * @license 29307 * Copyright Google LLC All Rights Reserved. 29308 * 29309 * Use of this source code is governed by an MIT-style license that can be 29310 * found in the LICENSE file at https://angular.io/license 29311 */ 29312function attachEmbeddedView(parentView, elementData, viewIndex, view) { 29313 let embeddedViews = elementData.viewContainer._embeddedViews; 29314 if (viewIndex === null || viewIndex === undefined) { 29315 viewIndex = embeddedViews.length; 29316 } 29317 view.viewContainerParent = parentView; 29318 addToArray(embeddedViews, viewIndex, view); 29319 attachProjectedView(elementData, view); 29320 Services.dirtyParentQueries(view); 29321 const prevView = viewIndex > 0 ? embeddedViews[viewIndex - 1] : null; 29322 renderAttachEmbeddedView(elementData, prevView, view); 29323} 29324function attachProjectedView(vcElementData, view) { 29325 const dvcElementData = declaredViewContainer(view); 29326 if (!dvcElementData || dvcElementData === vcElementData || 29327 view.state & 16 /* IsProjectedView */) { 29328 return; 29329 } 29330 // Note: For performance reasons, we 29331 // - add a view to template._projectedViews only 1x throughout its lifetime, 29332 // and remove it not until the view is destroyed. 29333 // (hard, as when a parent view is attached/detached we would need to attach/detach all 29334 // nested projected views as well, even across component boundaries). 29335 // - don't track the insertion order of views in the projected views array 29336 // (hard, as when the views of the same template are inserted different view containers) 29337 view.state |= 16 /* IsProjectedView */; 29338 let projectedViews = dvcElementData.template._projectedViews; 29339 if (!projectedViews) { 29340 projectedViews = dvcElementData.template._projectedViews = []; 29341 } 29342 projectedViews.push(view); 29343 // Note: we are changing the NodeDef here as we cannot calculate 29344 // the fact whether a template is used for projection during compilation. 29345 markNodeAsProjectedTemplate(view.parent.def, view.parentNodeDef); 29346} 29347function markNodeAsProjectedTemplate(viewDef, nodeDef) { 29348 if (nodeDef.flags & 4 /* ProjectedTemplate */) { 29349 return; 29350 } 29351 viewDef.nodeFlags |= 4 /* ProjectedTemplate */; 29352 nodeDef.flags |= 4 /* ProjectedTemplate */; 29353 let parentNodeDef = nodeDef.parent; 29354 while (parentNodeDef) { 29355 parentNodeDef.childFlags |= 4 /* ProjectedTemplate */; 29356 parentNodeDef = parentNodeDef.parent; 29357 } 29358} 29359function detachEmbeddedView(elementData, viewIndex) { 29360 const embeddedViews = elementData.viewContainer._embeddedViews; 29361 if (viewIndex == null || viewIndex >= embeddedViews.length) { 29362 viewIndex = embeddedViews.length - 1; 29363 } 29364 if (viewIndex < 0) { 29365 return null; 29366 } 29367 const view = embeddedViews[viewIndex]; 29368 view.viewContainerParent = null; 29369 removeFromArray(embeddedViews, viewIndex); 29370 // See attachProjectedView for why we don't update projectedViews here. 29371 Services.dirtyParentQueries(view); 29372 renderDetachView$1(view); 29373 return view; 29374} 29375function detachProjectedView(view) { 29376 if (!(view.state & 16 /* IsProjectedView */)) { 29377 return; 29378 } 29379 const dvcElementData = declaredViewContainer(view); 29380 if (dvcElementData) { 29381 const projectedViews = dvcElementData.template._projectedViews; 29382 if (projectedViews) { 29383 removeFromArray(projectedViews, projectedViews.indexOf(view)); 29384 Services.dirtyParentQueries(view); 29385 } 29386 } 29387} 29388function moveEmbeddedView(elementData, oldViewIndex, newViewIndex) { 29389 const embeddedViews = elementData.viewContainer._embeddedViews; 29390 const view = embeddedViews[oldViewIndex]; 29391 removeFromArray(embeddedViews, oldViewIndex); 29392 if (newViewIndex == null) { 29393 newViewIndex = embeddedViews.length; 29394 } 29395 addToArray(embeddedViews, newViewIndex, view); 29396 // Note: Don't need to change projectedViews as the order in there 29397 // as always invalid... 29398 Services.dirtyParentQueries(view); 29399 renderDetachView$1(view); 29400 const prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null; 29401 renderAttachEmbeddedView(elementData, prevView, view); 29402 return view; 29403} 29404function renderAttachEmbeddedView(elementData, prevView, view) { 29405 const prevRenderNode = prevView ? renderNode(prevView, prevView.def.lastRenderRootNode) : elementData.renderElement; 29406 const parentNode = view.renderer.parentNode(prevRenderNode); 29407 const nextSibling = view.renderer.nextSibling(prevRenderNode); 29408 // Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be! 29409 // However, browsers automatically do `appendChild` when there is no `nextSibling`. 29410 visitRootRenderNodes(view, 2 /* InsertBefore */, parentNode, nextSibling, undefined); 29411} 29412function renderDetachView$1(view) { 29413 visitRootRenderNodes(view, 3 /* RemoveChild */, null, null, undefined); 29414} 29415 29416/** 29417 * @license 29418 * Copyright Google LLC All Rights Reserved. 29419 * 29420 * Use of this source code is governed by an MIT-style license that can be 29421 * found in the LICENSE file at https://angular.io/license 29422 */ 29423const EMPTY_CONTEXT = {}; 29424// Attention: this function is called as top level function. 29425// Putting any logic in here will destroy closure tree shaking! 29426function createComponentFactory(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors) { 29427 return new ComponentFactory_(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors); 29428} 29429function getComponentViewDefinitionFactory(componentFactory) { 29430 return componentFactory.viewDefFactory; 29431} 29432class ComponentFactory_ extends ComponentFactory { 29433 constructor(selector, componentType, viewDefFactory, _inputs, _outputs, ngContentSelectors) { 29434 // Attention: this ctor is called as top level function. 29435 // Putting any logic in here will destroy closure tree shaking! 29436 super(); 29437 this.selector = selector; 29438 this.componentType = componentType; 29439 this._inputs = _inputs; 29440 this._outputs = _outputs; 29441 this.ngContentSelectors = ngContentSelectors; 29442 this.viewDefFactory = viewDefFactory; 29443 } 29444 get inputs() { 29445 const inputsArr = []; 29446 const inputs = this._inputs; 29447 for (let propName in inputs) { 29448 const templateName = inputs[propName]; 29449 inputsArr.push({ propName, templateName }); 29450 } 29451 return inputsArr; 29452 } 29453 get outputs() { 29454 const outputsArr = []; 29455 for (let propName in this._outputs) { 29456 const templateName = this._outputs[propName]; 29457 outputsArr.push({ propName, templateName }); 29458 } 29459 return outputsArr; 29460 } 29461 /** 29462 * Creates a new component. 29463 */ 29464 create(injector, projectableNodes, rootSelectorOrNode, ngModule) { 29465 if (!ngModule) { 29466 throw new Error('ngModule should be provided'); 29467 } 29468 const viewDef = resolveDefinition(this.viewDefFactory); 29469 const componentNodeIndex = viewDef.nodes[0].element.componentProvider.nodeIndex; 29470 const view = Services.createRootView(injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT); 29471 const component = asProviderData(view, componentNodeIndex).instance; 29472 if (rootSelectorOrNode) { 29473 view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full); 29474 } 29475 return new ComponentRef_(view, new ViewRef_(view), component); 29476 } 29477} 29478class ComponentRef_ extends ComponentRef { 29479 constructor(_view, _viewRef, _component) { 29480 super(); 29481 this._view = _view; 29482 this._viewRef = _viewRef; 29483 this._component = _component; 29484 this._elDef = this._view.def.nodes[0]; 29485 this.hostView = _viewRef; 29486 this.changeDetectorRef = _viewRef; 29487 this.instance = _component; 29488 } 29489 get location() { 29490 return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement); 29491 } 29492 get injector() { 29493 return new Injector_(this._view, this._elDef); 29494 } 29495 get componentType() { 29496 return this._component.constructor; 29497 } 29498 destroy() { 29499 this._viewRef.destroy(); 29500 } 29501 onDestroy(callback) { 29502 this._viewRef.onDestroy(callback); 29503 } 29504} 29505function createViewContainerData(view, elDef, elData) { 29506 return new ViewContainerRef_(view, elDef, elData); 29507} 29508class ViewContainerRef_ { 29509 constructor(_view, _elDef, _data) { 29510 this._view = _view; 29511 this._elDef = _elDef; 29512 this._data = _data; 29513 /** 29514 * @internal 29515 */ 29516 this._embeddedViews = []; 29517 } 29518 get element() { 29519 return new ElementRef(this._data.renderElement); 29520 } 29521 get injector() { 29522 return new Injector_(this._view, this._elDef); 29523 } 29524 /** @deprecated No replacement */ 29525 get parentInjector() { 29526 let view = this._view; 29527 let elDef = this._elDef.parent; 29528 while (!elDef && view) { 29529 elDef = viewParentEl(view); 29530 view = view.parent; 29531 } 29532 return view ? new Injector_(view, elDef) : new Injector_(this._view, null); 29533 } 29534 clear() { 29535 const len = this._embeddedViews.length; 29536 for (let i = len - 1; i >= 0; i--) { 29537 const view = detachEmbeddedView(this._data, i); 29538 Services.destroyView(view); 29539 } 29540 } 29541 get(index) { 29542 const view = this._embeddedViews[index]; 29543 if (view) { 29544 const ref = new ViewRef_(view); 29545 ref.attachToViewContainerRef(this); 29546 return ref; 29547 } 29548 return null; 29549 } 29550 get length() { 29551 return this._embeddedViews.length; 29552 } 29553 createEmbeddedView(templateRef, context, index) { 29554 const viewRef = templateRef.createEmbeddedView(context || {}); 29555 this.insert(viewRef, index); 29556 return viewRef; 29557 } 29558 createComponent(componentFactory, index, injector, projectableNodes, ngModuleRef) { 29559 const contextInjector = injector || this.parentInjector; 29560 if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) { 29561 ngModuleRef = contextInjector.get(NgModuleRef); 29562 } 29563 const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef); 29564 this.insert(componentRef.hostView, index); 29565 return componentRef; 29566 } 29567 insert(viewRef, index) { 29568 if (viewRef.destroyed) { 29569 throw new Error('Cannot insert a destroyed View in a ViewContainer!'); 29570 } 29571 const viewRef_ = viewRef; 29572 const viewData = viewRef_._view; 29573 attachEmbeddedView(this._view, this._data, index, viewData); 29574 viewRef_.attachToViewContainerRef(this); 29575 return viewRef; 29576 } 29577 move(viewRef, currentIndex) { 29578 if (viewRef.destroyed) { 29579 throw new Error('Cannot move a destroyed View in a ViewContainer!'); 29580 } 29581 const previousIndex = this._embeddedViews.indexOf(viewRef._view); 29582 moveEmbeddedView(this._data, previousIndex, currentIndex); 29583 return viewRef; 29584 } 29585 indexOf(viewRef) { 29586 return this._embeddedViews.indexOf(viewRef._view); 29587 } 29588 remove(index) { 29589 const viewData = detachEmbeddedView(this._data, index); 29590 if (viewData) { 29591 Services.destroyView(viewData); 29592 } 29593 } 29594 detach(index) { 29595 const view = detachEmbeddedView(this._data, index); 29596 return view ? new ViewRef_(view) : null; 29597 } 29598} 29599function createChangeDetectorRef(view) { 29600 return new ViewRef_(view); 29601} 29602class ViewRef_ { 29603 constructor(_view) { 29604 this._view = _view; 29605 this._viewContainerRef = null; 29606 this._appRef = null; 29607 } 29608 get rootNodes() { 29609 return rootRenderNodes(this._view); 29610 } 29611 get context() { 29612 return this._view.context; 29613 } 29614 get destroyed() { 29615 return (this._view.state & 128 /* Destroyed */) !== 0; 29616 } 29617 markForCheck() { 29618 markParentViewsForCheck(this._view); 29619 } 29620 detach() { 29621 this._view.state &= ~4 /* Attached */; 29622 } 29623 detectChanges() { 29624 const fs = this._view.root.rendererFactory; 29625 if (fs.begin) { 29626 fs.begin(); 29627 } 29628 try { 29629 Services.checkAndUpdateView(this._view); 29630 } 29631 finally { 29632 if (fs.end) { 29633 fs.end(); 29634 } 29635 } 29636 } 29637 checkNoChanges() { 29638 Services.checkNoChangesView(this._view); 29639 } 29640 reattach() { 29641 this._view.state |= 4 /* Attached */; 29642 } 29643 onDestroy(callback) { 29644 if (!this._view.disposables) { 29645 this._view.disposables = []; 29646 } 29647 this._view.disposables.push(callback); 29648 } 29649 destroy() { 29650 if (this._appRef) { 29651 this._appRef.detachView(this); 29652 } 29653 else if (this._viewContainerRef) { 29654 this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)); 29655 } 29656 Services.destroyView(this._view); 29657 } 29658 detachFromAppRef() { 29659 this._appRef = null; 29660 renderDetachView$1(this._view); 29661 Services.dirtyParentQueries(this._view); 29662 } 29663 attachToAppRef(appRef) { 29664 if (this._viewContainerRef) { 29665 throw new Error('This view is already attached to a ViewContainer!'); 29666 } 29667 this._appRef = appRef; 29668 } 29669 attachToViewContainerRef(vcRef) { 29670 if (this._appRef) { 29671 throw new Error('This view is already attached directly to the ApplicationRef!'); 29672 } 29673 this._viewContainerRef = vcRef; 29674 } 29675} 29676function createTemplateData(view, def) { 29677 return new TemplateRef_(view, def); 29678} 29679class TemplateRef_ extends TemplateRef { 29680 constructor(_parentView, _def) { 29681 super(); 29682 this._parentView = _parentView; 29683 this._def = _def; 29684 } 29685 createEmbeddedView(context) { 29686 return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def, this._def.element.template, context)); 29687 } 29688 get elementRef() { 29689 return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement); 29690 } 29691} 29692function createInjector$1(view, elDef) { 29693 return new Injector_(view, elDef); 29694} 29695class Injector_ { 29696 constructor(view, elDef) { 29697 this.view = view; 29698 this.elDef = elDef; 29699 } 29700 get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND) { 29701 const allowPrivateServices = this.elDef ? (this.elDef.flags & 33554432 /* ComponentView */) !== 0 : false; 29702 return Services.resolveDep(this.view, this.elDef, allowPrivateServices, { flags: 0 /* None */, token, tokenKey: tokenKey(token) }, notFoundValue); 29703 } 29704} 29705function nodeValue(view, index) { 29706 const def = view.def.nodes[index]; 29707 if (def.flags & 1 /* TypeElement */) { 29708 const elData = asElementData(view, def.nodeIndex); 29709 return def.element.template ? elData.template : elData.renderElement; 29710 } 29711 else if (def.flags & 2 /* TypeText */) { 29712 return asTextData(view, def.nodeIndex).renderText; 29713 } 29714 else if (def.flags & (20224 /* CatProvider */ | 16 /* TypePipe */)) { 29715 return asProviderData(view, def.nodeIndex).instance; 29716 } 29717 throw new Error(`Illegal state: read nodeValue for node index ${index}`); 29718} 29719function createNgModuleRef(moduleType, parent, bootstrapComponents, def) { 29720 return new NgModuleRef_(moduleType, parent, bootstrapComponents, def); 29721} 29722class NgModuleRef_ { 29723 constructor(_moduleType, _parent, _bootstrapComponents, _def) { 29724 this._moduleType = _moduleType; 29725 this._parent = _parent; 29726 this._bootstrapComponents = _bootstrapComponents; 29727 this._def = _def; 29728 this._destroyListeners = []; 29729 this._destroyed = false; 29730 this.injector = this; 29731 initNgModule(this); 29732 } 29733 get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) { 29734 let flags = 0 /* None */; 29735 if (injectFlags & InjectFlags.SkipSelf) { 29736 flags |= 1 /* SkipSelf */; 29737 } 29738 else if (injectFlags & InjectFlags.Self) { 29739 flags |= 4 /* Self */; 29740 } 29741 return resolveNgModuleDep(this, { token: token, tokenKey: tokenKey(token), flags: flags }, notFoundValue); 29742 } 29743 get instance() { 29744 return this.get(this._moduleType); 29745 } 29746 get componentFactoryResolver() { 29747 return this.get(ComponentFactoryResolver); 29748 } 29749 destroy() { 29750 if (this._destroyed) { 29751 throw new Error(`The ng module ${stringify(this.instance.constructor)} has already been destroyed.`); 29752 } 29753 this._destroyed = true; 29754 callNgModuleLifecycle(this, 131072 /* OnDestroy */); 29755 this._destroyListeners.forEach((listener) => listener()); 29756 } 29757 onDestroy(callback) { 29758 this._destroyListeners.push(callback); 29759 } 29760} 29761 29762/** 29763 * @license 29764 * Copyright Google LLC All Rights Reserved. 29765 * 29766 * Use of this source code is governed by an MIT-style license that can be 29767 * found in the LICENSE file at https://angular.io/license 29768 */ 29769const Renderer2TokenKey = tokenKey(Renderer2); 29770const ElementRefTokenKey = tokenKey(ElementRef); 29771const ViewContainerRefTokenKey = tokenKey(ViewContainerRef); 29772const TemplateRefTokenKey = tokenKey(TemplateRef); 29773const ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef); 29774const InjectorRefTokenKey$1 = tokenKey(Injector); 29775const INJECTORRefTokenKey$1 = tokenKey(INJECTOR); 29776function directiveDef(checkIndex, flags, matchedQueries, childCount, ctor, deps, props, outputs) { 29777 const bindings = []; 29778 if (props) { 29779 for (let prop in props) { 29780 const [bindingIndex, nonMinifiedName] = props[prop]; 29781 bindings[bindingIndex] = { 29782 flags: 8 /* TypeProperty */, 29783 name: prop, 29784 nonMinifiedName, 29785 ns: null, 29786 securityContext: null, 29787 suffix: null 29788 }; 29789 } 29790 } 29791 const outputDefs = []; 29792 if (outputs) { 29793 for (let propName in outputs) { 29794 outputDefs.push({ type: 1 /* DirectiveOutput */, propName, target: null, eventName: outputs[propName] }); 29795 } 29796 } 29797 flags |= 16384 /* TypeDirective */; 29798 return _def(checkIndex, flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs); 29799} 29800function pipeDef(flags, ctor, deps) { 29801 flags |= 16 /* TypePipe */; 29802 return _def(-1, flags, null, 0, ctor, ctor, deps); 29803} 29804function providerDef(flags, matchedQueries, token, value, deps) { 29805 return _def(-1, flags, matchedQueries, 0, token, value, deps); 29806} 29807function _def(checkIndex, flags, matchedQueriesDsl, childCount, token, value, deps, bindings, outputs) { 29808 const { matchedQueries, references, matchedQueryIds } = splitMatchedQueriesDsl(matchedQueriesDsl); 29809 if (!outputs) { 29810 outputs = []; 29811 } 29812 if (!bindings) { 29813 bindings = []; 29814 } 29815 // Need to resolve forwardRefs as e.g. for `useValue` we 29816 // lowered the expression and then stopped evaluating it, 29817 // i.e. also didn't unwrap it. 29818 value = resolveForwardRef(value); 29819 const depDefs = splitDepsDsl(deps, stringify(token)); 29820 return { 29821 // will bet set by the view definition 29822 nodeIndex: -1, 29823 parent: null, 29824 renderParent: null, 29825 bindingIndex: -1, 29826 outputIndex: -1, 29827 // regular values 29828 checkIndex, 29829 flags, 29830 childFlags: 0, 29831 directChildFlags: 0, 29832 childMatchedQueries: 0, 29833 matchedQueries, 29834 matchedQueryIds, 29835 references, 29836 ngContentIndex: -1, 29837 childCount, 29838 bindings, 29839 bindingFlags: calcBindingFlags(bindings), 29840 outputs, 29841 element: null, 29842 provider: { token, value, deps: depDefs }, 29843 text: null, 29844 query: null, 29845 ngContent: null 29846 }; 29847} 29848function createProviderInstance(view, def) { 29849 return _createProviderInstance$1(view, def); 29850} 29851function createPipeInstance(view, def) { 29852 // deps are looked up from component. 29853 let compView = view; 29854 while (compView.parent && !isComponentView(compView)) { 29855 compView = compView.parent; 29856 } 29857 // pipes can see the private services of the component 29858 const allowPrivateServices = true; 29859 // pipes are always eager and classes! 29860 return createClass(compView.parent, viewParentEl(compView), allowPrivateServices, def.provider.value, def.provider.deps); 29861} 29862function createDirectiveInstance(view, def) { 29863 // components can see other private services, other directives can't. 29864 const allowPrivateServices = (def.flags & 32768 /* Component */) > 0; 29865 // directives are always eager and classes! 29866 const instance = createClass(view, def.parent, allowPrivateServices, def.provider.value, def.provider.deps); 29867 if (def.outputs.length) { 29868 for (let i = 0; i < def.outputs.length; i++) { 29869 const output = def.outputs[i]; 29870 const outputObservable = instance[output.propName]; 29871 if (isObservable(outputObservable)) { 29872 const subscription = outputObservable.subscribe(eventHandlerClosure(view, def.parent.nodeIndex, output.eventName)); 29873 view.disposables[def.outputIndex + i] = subscription.unsubscribe.bind(subscription); 29874 } 29875 else { 29876 throw new Error(`@Output ${output.propName} not initialized in '${instance.constructor.name}'.`); 29877 } 29878 } 29879 } 29880 return instance; 29881} 29882function eventHandlerClosure(view, index, eventName) { 29883 return (event) => dispatchEvent(view, index, eventName, event); 29884} 29885function checkAndUpdateDirectiveInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 29886 const providerData = asProviderData(view, def.nodeIndex); 29887 const directive = providerData.instance; 29888 let changed = false; 29889 let changes = undefined; 29890 const bindLen = def.bindings.length; 29891 if (bindLen > 0 && checkBinding(view, def, 0, v0)) { 29892 changed = true; 29893 changes = updateProp(view, providerData, def, 0, v0, changes); 29894 } 29895 if (bindLen > 1 && checkBinding(view, def, 1, v1)) { 29896 changed = true; 29897 changes = updateProp(view, providerData, def, 1, v1, changes); 29898 } 29899 if (bindLen > 2 && checkBinding(view, def, 2, v2)) { 29900 changed = true; 29901 changes = updateProp(view, providerData, def, 2, v2, changes); 29902 } 29903 if (bindLen > 3 && checkBinding(view, def, 3, v3)) { 29904 changed = true; 29905 changes = updateProp(view, providerData, def, 3, v3, changes); 29906 } 29907 if (bindLen > 4 && checkBinding(view, def, 4, v4)) { 29908 changed = true; 29909 changes = updateProp(view, providerData, def, 4, v4, changes); 29910 } 29911 if (bindLen > 5 && checkBinding(view, def, 5, v5)) { 29912 changed = true; 29913 changes = updateProp(view, providerData, def, 5, v5, changes); 29914 } 29915 if (bindLen > 6 && checkBinding(view, def, 6, v6)) { 29916 changed = true; 29917 changes = updateProp(view, providerData, def, 6, v6, changes); 29918 } 29919 if (bindLen > 7 && checkBinding(view, def, 7, v7)) { 29920 changed = true; 29921 changes = updateProp(view, providerData, def, 7, v7, changes); 29922 } 29923 if (bindLen > 8 && checkBinding(view, def, 8, v8)) { 29924 changed = true; 29925 changes = updateProp(view, providerData, def, 8, v8, changes); 29926 } 29927 if (bindLen > 9 && checkBinding(view, def, 9, v9)) { 29928 changed = true; 29929 changes = updateProp(view, providerData, def, 9, v9, changes); 29930 } 29931 if (changes) { 29932 directive.ngOnChanges(changes); 29933 } 29934 if ((def.flags & 65536 /* OnInit */) && 29935 shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) { 29936 directive.ngOnInit(); 29937 } 29938 if (def.flags & 262144 /* DoCheck */) { 29939 directive.ngDoCheck(); 29940 } 29941 return changed; 29942} 29943function checkAndUpdateDirectiveDynamic(view, def, values) { 29944 const providerData = asProviderData(view, def.nodeIndex); 29945 const directive = providerData.instance; 29946 let changed = false; 29947 let changes = undefined; 29948 for (let i = 0; i < values.length; i++) { 29949 if (checkBinding(view, def, i, values[i])) { 29950 changed = true; 29951 changes = updateProp(view, providerData, def, i, values[i], changes); 29952 } 29953 } 29954 if (changes) { 29955 directive.ngOnChanges(changes); 29956 } 29957 if ((def.flags & 65536 /* OnInit */) && 29958 shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) { 29959 directive.ngOnInit(); 29960 } 29961 if (def.flags & 262144 /* DoCheck */) { 29962 directive.ngDoCheck(); 29963 } 29964 return changed; 29965} 29966function _createProviderInstance$1(view, def) { 29967 // private services can see other private services 29968 const allowPrivateServices = (def.flags & 8192 /* PrivateProvider */) > 0; 29969 const providerDef = def.provider; 29970 switch (def.flags & 201347067 /* Types */) { 29971 case 512 /* TypeClassProvider */: 29972 return createClass(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps); 29973 case 1024 /* TypeFactoryProvider */: 29974 return callFactory(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps); 29975 case 2048 /* TypeUseExistingProvider */: 29976 return resolveDep(view, def.parent, allowPrivateServices, providerDef.deps[0]); 29977 case 256 /* TypeValueProvider */: 29978 return providerDef.value; 29979 } 29980} 29981function createClass(view, elDef, allowPrivateServices, ctor, deps) { 29982 const len = deps.length; 29983 switch (len) { 29984 case 0: 29985 return new ctor(); 29986 case 1: 29987 return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0])); 29988 case 2: 29989 return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1])); 29990 case 3: 29991 return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2])); 29992 default: 29993 const depValues = []; 29994 for (let i = 0; i < len; i++) { 29995 depValues.push(resolveDep(view, elDef, allowPrivateServices, deps[i])); 29996 } 29997 return new ctor(...depValues); 29998 } 29999} 30000function callFactory(view, elDef, allowPrivateServices, factory, deps) { 30001 const len = deps.length; 30002 switch (len) { 30003 case 0: 30004 return factory(); 30005 case 1: 30006 return factory(resolveDep(view, elDef, allowPrivateServices, deps[0])); 30007 case 2: 30008 return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1])); 30009 case 3: 30010 return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2])); 30011 default: 30012 const depValues = []; 30013 for (let i = 0; i < len; i++) { 30014 depValues.push(resolveDep(view, elDef, allowPrivateServices, deps[i])); 30015 } 30016 return factory(...depValues); 30017 } 30018} 30019// This default value is when checking the hierarchy for a token. 30020// 30021// It means both: 30022// - the token is not provided by the current injector, 30023// - only the element injectors should be checked (ie do not check module injectors 30024// 30025// mod1 30026// / 30027// el1 mod2 30028// \ / 30029// el2 30030// 30031// When requesting el2.injector.get(token), we should check in the following order and return the 30032// first found value: 30033// - el2.injector.get(token, default) 30034// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module 30035// - mod2.injector.get(token, default) 30036const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {}; 30037function resolveDep(view, elDef, allowPrivateServices, depDef, notFoundValue = Injector.THROW_IF_NOT_FOUND) { 30038 if (depDef.flags & 8 /* Value */) { 30039 return depDef.token; 30040 } 30041 const startView = view; 30042 if (depDef.flags & 2 /* Optional */) { 30043 notFoundValue = null; 30044 } 30045 const tokenKey = depDef.tokenKey; 30046 if (tokenKey === ChangeDetectorRefTokenKey) { 30047 // directives on the same element as a component should be able to control the change detector 30048 // of that component as well. 30049 allowPrivateServices = !!(elDef && elDef.element.componentView); 30050 } 30051 if (elDef && (depDef.flags & 1 /* SkipSelf */)) { 30052 allowPrivateServices = false; 30053 elDef = elDef.parent; 30054 } 30055 let searchView = view; 30056 while (searchView) { 30057 if (elDef) { 30058 switch (tokenKey) { 30059 case Renderer2TokenKey: { 30060 const compView = findCompView(searchView, elDef, allowPrivateServices); 30061 return compView.renderer; 30062 } 30063 case ElementRefTokenKey: 30064 return new ElementRef(asElementData(searchView, elDef.nodeIndex).renderElement); 30065 case ViewContainerRefTokenKey: 30066 return asElementData(searchView, elDef.nodeIndex).viewContainer; 30067 case TemplateRefTokenKey: { 30068 if (elDef.element.template) { 30069 return asElementData(searchView, elDef.nodeIndex).template; 30070 } 30071 break; 30072 } 30073 case ChangeDetectorRefTokenKey: { 30074 let cdView = findCompView(searchView, elDef, allowPrivateServices); 30075 return createChangeDetectorRef(cdView); 30076 } 30077 case InjectorRefTokenKey$1: 30078 case INJECTORRefTokenKey$1: 30079 return createInjector$1(searchView, elDef); 30080 default: 30081 const providerDef = (allowPrivateServices ? elDef.element.allProviders : 30082 elDef.element.publicProviders)[tokenKey]; 30083 if (providerDef) { 30084 let providerData = asProviderData(searchView, providerDef.nodeIndex); 30085 if (!providerData) { 30086 providerData = { instance: _createProviderInstance$1(searchView, providerDef) }; 30087 searchView.nodes[providerDef.nodeIndex] = providerData; 30088 } 30089 return providerData.instance; 30090 } 30091 } 30092 } 30093 allowPrivateServices = isComponentView(searchView); 30094 elDef = viewParentEl(searchView); 30095 searchView = searchView.parent; 30096 if (depDef.flags & 4 /* Self */) { 30097 searchView = null; 30098 } 30099 } 30100 const value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR); 30101 if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || 30102 notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) { 30103 // Return the value from the root element injector when 30104 // - it provides it 30105 // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) 30106 // - the module injector should not be checked 30107 // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) 30108 return value; 30109 } 30110 return startView.root.ngModule.injector.get(depDef.token, notFoundValue); 30111} 30112function findCompView(view, elDef, allowPrivateServices) { 30113 let compView; 30114 if (allowPrivateServices) { 30115 compView = asElementData(view, elDef.nodeIndex).componentView; 30116 } 30117 else { 30118 compView = view; 30119 while (compView.parent && !isComponentView(compView)) { 30120 compView = compView.parent; 30121 } 30122 } 30123 return compView; 30124} 30125function updateProp(view, providerData, def, bindingIdx, value, changes) { 30126 if (def.flags & 32768 /* Component */) { 30127 const compView = asElementData(view, def.parent.nodeIndex).componentView; 30128 if (compView.def.flags & 2 /* OnPush */) { 30129 compView.state |= 8 /* ChecksEnabled */; 30130 } 30131 } 30132 const binding = def.bindings[bindingIdx]; 30133 const propName = binding.name; 30134 // Note: This is still safe with Closure Compiler as 30135 // the user passed in the property name as an object has to `providerDef`, 30136 // so Closure Compiler will have renamed the property correctly already. 30137 providerData.instance[propName] = value; 30138 if (def.flags & 524288 /* OnChanges */) { 30139 changes = changes || {}; 30140 const oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]); 30141 const binding = def.bindings[bindingIdx]; 30142 changes[binding.nonMinifiedName] = 30143 new SimpleChange(oldValue, value, (view.state & 2 /* FirstCheck */) !== 0); 30144 } 30145 view.oldValues[def.bindingIndex + bindingIdx] = value; 30146 return changes; 30147} 30148// This function calls the ngAfterContentCheck, ngAfterContentInit, 30149// ngAfterViewCheck, and ngAfterViewInit lifecycle hooks (depending on the node 30150// flags in lifecycle). Unlike ngDoCheck, ngOnChanges and ngOnInit, which are 30151// called during a pre-order traversal of the view tree (that is calling the 30152// parent hooks before the child hooks) these events are sent in using a 30153// post-order traversal of the tree (children before parents). This changes the 30154// meaning of initIndex in the view state. For ngOnInit, initIndex tracks the 30155// expected nodeIndex which a ngOnInit should be called. When sending 30156// ngAfterContentInit and ngAfterViewInit it is the expected count of 30157// ngAfterContentInit or ngAfterViewInit methods that have been called. This 30158// ensure that despite being called recursively or after picking up after an 30159// exception, the ngAfterContentInit or ngAfterViewInit will be called on the 30160// correct nodes. Consider for example, the following (where E is an element 30161// and D is a directive) 30162// Tree: pre-order index post-order index 30163// E1 0 6 30164// E2 1 1 30165// D3 2 0 30166// E4 3 5 30167// E5 4 4 30168// E6 5 2 30169// E7 6 3 30170// As can be seen, the post-order index has an unclear relationship to the 30171// pre-order index (postOrderIndex === preOrderIndex - parentCount + 30172// childCount). Since number of calls to ngAfterContentInit and ngAfterViewInit 30173// are stable (will be the same for the same view regardless of exceptions or 30174// recursion) we just need to count them which will roughly correspond to the 30175// post-order index (it skips elements and directives that do not have 30176// lifecycle hooks). 30177// 30178// For example, if an exception is raised in the E6.onAfterViewInit() the 30179// initIndex is left at 3 (by shouldCallLifecycleInitHook() which set it to 30180// initIndex + 1). When checkAndUpdateView() is called again D3, E2 and E6 will 30181// not have their ngAfterViewInit() called but, starting with E7, the rest of 30182// the view will begin getting ngAfterViewInit() called until a check and 30183// pass is complete. 30184// 30185// This algorthim also handles recursion. Consider if E4's ngAfterViewInit() 30186// indirectly calls E1's ChangeDetectorRef.detectChanges(). The expected 30187// initIndex is set to 6, the recusive checkAndUpdateView() starts walk again. 30188// D3, E2, E6, E7, E5 and E4 are skipped, ngAfterViewInit() is called on E1. 30189// When the recursion returns the initIndex will be 7 so E1 is skipped as it 30190// has already been called in the recursively called checkAnUpdateView(). 30191function callLifecycleHooksChildrenFirst(view, lifecycles) { 30192 if (!(view.def.nodeFlags & lifecycles)) { 30193 return; 30194 } 30195 const nodes = view.def.nodes; 30196 let initIndex = 0; 30197 for (let i = 0; i < nodes.length; i++) { 30198 const nodeDef = nodes[i]; 30199 let parent = nodeDef.parent; 30200 if (!parent && nodeDef.flags & lifecycles) { 30201 // matching root node (e.g. a pipe) 30202 callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++); 30203 } 30204 if ((nodeDef.childFlags & lifecycles) === 0) { 30205 // no child matches one of the lifecycles 30206 i += nodeDef.childCount; 30207 } 30208 while (parent && (parent.flags & 1 /* TypeElement */) && 30209 i === parent.nodeIndex + parent.childCount) { 30210 // last child of an element 30211 if (parent.directChildFlags & lifecycles) { 30212 initIndex = callElementProvidersLifecycles(view, parent, lifecycles, initIndex); 30213 } 30214 parent = parent.parent; 30215 } 30216 } 30217} 30218function callElementProvidersLifecycles(view, elDef, lifecycles, initIndex) { 30219 for (let i = elDef.nodeIndex + 1; i <= elDef.nodeIndex + elDef.childCount; i++) { 30220 const nodeDef = view.def.nodes[i]; 30221 if (nodeDef.flags & lifecycles) { 30222 callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++); 30223 } 30224 // only visit direct children 30225 i += nodeDef.childCount; 30226 } 30227 return initIndex; 30228} 30229function callProviderLifecycles(view, index, lifecycles, initIndex) { 30230 const providerData = asProviderData(view, index); 30231 if (!providerData) { 30232 return; 30233 } 30234 const provider = providerData.instance; 30235 if (!provider) { 30236 return; 30237 } 30238 Services.setCurrentNode(view, index); 30239 if (lifecycles & 1048576 /* AfterContentInit */ && 30240 shouldCallLifecycleInitHook(view, 512 /* InitState_CallingAfterContentInit */, initIndex)) { 30241 provider.ngAfterContentInit(); 30242 } 30243 if (lifecycles & 2097152 /* AfterContentChecked */) { 30244 provider.ngAfterContentChecked(); 30245 } 30246 if (lifecycles & 4194304 /* AfterViewInit */ && 30247 shouldCallLifecycleInitHook(view, 768 /* InitState_CallingAfterViewInit */, initIndex)) { 30248 provider.ngAfterViewInit(); 30249 } 30250 if (lifecycles & 8388608 /* AfterViewChecked */) { 30251 provider.ngAfterViewChecked(); 30252 } 30253 if (lifecycles & 131072 /* OnDestroy */) { 30254 provider.ngOnDestroy(); 30255 } 30256} 30257 30258/** 30259 * @license 30260 * Copyright Google LLC All Rights Reserved. 30261 * 30262 * Use of this source code is governed by an MIT-style license that can be 30263 * found in the LICENSE file at https://angular.io/license 30264 */ 30265class ComponentFactoryResolver$1 extends ComponentFactoryResolver { 30266 /** 30267 * @param ngModule The NgModuleRef to which all resolved factories are bound. 30268 */ 30269 constructor(ngModule) { 30270 super(); 30271 this.ngModule = ngModule; 30272 } 30273 resolveComponentFactory(component) { 30274 ngDevMode && assertComponentType(component); 30275 const componentDef = getComponentDef(component); 30276 return new ComponentFactory$1(componentDef, this.ngModule); 30277 } 30278} 30279function toRefArray(map) { 30280 const array = []; 30281 for (let nonMinified in map) { 30282 if (map.hasOwnProperty(nonMinified)) { 30283 const minified = map[nonMinified]; 30284 array.push({ propName: minified, templateName: nonMinified }); 30285 } 30286 } 30287 return array; 30288} 30289function getNamespace$1(elementName) { 30290 const name = elementName.toLowerCase(); 30291 return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null); 30292} 30293/** 30294 * A change detection scheduler token for {@link RootContext}. This token is the default value used 30295 * for the default `RootContext` found in the {@link ROOT_CONTEXT} token. 30296 */ 30297const SCHEDULER = new InjectionToken('SCHEDULER_TOKEN', { 30298 providedIn: 'root', 30299 factory: () => defaultScheduler, 30300}); 30301function createChainedInjector(rootViewInjector, moduleInjector) { 30302 return { 30303 get: (token, notFoundValue, flags) => { 30304 const value = rootViewInjector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags); 30305 if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || 30306 notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) { 30307 // Return the value from the root element injector when 30308 // - it provides it 30309 // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) 30310 // - the module injector should not be checked 30311 // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) 30312 return value; 30313 } 30314 return moduleInjector.get(token, notFoundValue, flags); 30315 } 30316 }; 30317} 30318/** 30319 * Render3 implementation of {@link viewEngine_ComponentFactory}. 30320 */ 30321class ComponentFactory$1 extends ComponentFactory { 30322 /** 30323 * @param componentDef The component definition. 30324 * @param ngModule The NgModuleRef to which the factory is bound. 30325 */ 30326 constructor(componentDef, ngModule) { 30327 super(); 30328 this.componentDef = componentDef; 30329 this.ngModule = ngModule; 30330 this.componentType = componentDef.type; 30331 this.selector = stringifyCSSSelectorList(componentDef.selectors); 30332 this.ngContentSelectors = 30333 componentDef.ngContentSelectors ? componentDef.ngContentSelectors : []; 30334 this.isBoundToModule = !!ngModule; 30335 } 30336 get inputs() { 30337 return toRefArray(this.componentDef.inputs); 30338 } 30339 get outputs() { 30340 return toRefArray(this.componentDef.outputs); 30341 } 30342 create(injector, projectableNodes, rootSelectorOrNode, ngModule) { 30343 ngModule = ngModule || this.ngModule; 30344 const rootViewInjector = ngModule ? createChainedInjector(injector, ngModule.injector) : injector; 30345 const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3); 30346 const sanitizer = rootViewInjector.get(Sanitizer, null); 30347 const hostRenderer = rendererFactory.createRenderer(null, this.componentDef); 30348 // Determine a tag name used for creating host elements when this component is created 30349 // dynamically. Default to 'div' if this component did not specify any tag name in its selector. 30350 const elementName = this.componentDef.selectors[0][0] || 'div'; 30351 const hostRNode = rootSelectorOrNode ? 30352 locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) : 30353 elementCreate(elementName, rendererFactory.createRenderer(null, this.componentDef), getNamespace$1(elementName)); 30354 const rootFlags = this.componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ : 30355 16 /* CheckAlways */ | 512 /* IsRoot */; 30356 const rootContext = createRootContext(); 30357 // Create the root view. Uses empty TView and ContentTemplate. 30358 const rootTView = createTView(0 /* Root */, -1, null, 1, 0, null, null, null, null, null); 30359 const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector); 30360 // rootView is the parent when bootstrapping 30361 // TODO(misko): it looks like we are entering view here but we don't really need to as 30362 // `renderView` does that. However as the code is written it is needed because 30363 // `createRootComponentView` and `createRootComponent` both read global state. Fixing those 30364 // issues would allow us to drop this. 30365 enterView(rootLView, null); 30366 let component; 30367 let tElementNode; 30368 try { 30369 const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer); 30370 if (hostRNode) { 30371 if (rootSelectorOrNode) { 30372 setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]); 30373 } 30374 else { 30375 // If host element is created as a part of this function call (i.e. `rootSelectorOrNode` 30376 // is not defined), also apply attributes and classes extracted from component selector. 30377 // Extract attributes and classes from the first selector only to match VE behavior. 30378 const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]); 30379 if (attrs) { 30380 setUpAttributes(hostRenderer, hostRNode, attrs); 30381 } 30382 if (classes && classes.length > 0) { 30383 writeDirectClass(hostRenderer, hostRNode, classes.join(' ')); 30384 } 30385 } 30386 } 30387 tElementNode = getTNode(rootTView, 0); 30388 if (projectableNodes !== undefined) { 30389 const projection = tElementNode.projection = []; 30390 for (let i = 0; i < this.ngContentSelectors.length; i++) { 30391 const nodesforSlot = projectableNodes[i]; 30392 // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade 30393 // case). Here we do normalize passed data structure to be an array of arrays to avoid 30394 // complex checks down the line. 30395 // We also normalize the length of the passed in projectable nodes (to match the number of 30396 // <ng-container> slots defined by a component). 30397 projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null); 30398 } 30399 } 30400 // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and 30401 // executed here? 30402 // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref 30403 component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]); 30404 renderView(rootTView, rootLView, null); 30405 } 30406 finally { 30407 leaveView(); 30408 } 30409 const componentRef = new ComponentRef$1(this.componentType, component, createElementRef(ElementRef, tElementNode, rootLView), rootLView, tElementNode); 30410 // The host element of the internal root view is attached to the component's host view node. 30411 ngDevMode && assertNodeOfPossibleTypes(rootTView.node, [2 /* View */]); 30412 rootTView.node.child = tElementNode; 30413 return componentRef; 30414 } 30415} 30416const componentFactoryResolver = new ComponentFactoryResolver$1(); 30417/** 30418 * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the 30419 * ComponentFactoryResolver 30420 * already exists, retrieves the existing ComponentFactoryResolver. 30421 * 30422 * @returns The ComponentFactoryResolver instance to use 30423 */ 30424function injectComponentFactoryResolver() { 30425 return componentFactoryResolver; 30426} 30427/** 30428 * Represents an instance of a Component created via a {@link ComponentFactory}. 30429 * 30430 * `ComponentRef` provides access to the Component Instance as well other objects related to this 30431 * Component Instance and allows you to destroy the Component Instance via the {@link #destroy} 30432 * method. 30433 * 30434 */ 30435class ComponentRef$1 extends ComponentRef { 30436 constructor(componentType, instance, location, _rootLView, _tNode) { 30437 super(); 30438 this.location = location; 30439 this._rootLView = _rootLView; 30440 this._tNode = _tNode; 30441 this.destroyCbs = []; 30442 this.instance = instance; 30443 this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView); 30444 assignTViewNodeToLView(_rootLView[TVIEW], null, -1, _rootLView); 30445 this.componentType = componentType; 30446 } 30447 get injector() { 30448 return new NodeInjector(this._tNode, this._rootLView); 30449 } 30450 destroy() { 30451 if (this.destroyCbs) { 30452 this.destroyCbs.forEach(fn => fn()); 30453 this.destroyCbs = null; 30454 !this.hostView.destroyed && this.hostView.destroy(); 30455 } 30456 } 30457 onDestroy(callback) { 30458 if (this.destroyCbs) { 30459 this.destroyCbs.push(callback); 30460 } 30461 } 30462} 30463 30464/** 30465 * @license 30466 * Copyright Google LLC All Rights Reserved. 30467 * 30468 * Use of this source code is governed by an MIT-style license that can be 30469 * found in the LICENSE file at https://angular.io/license 30470 */ 30471// THIS CODE IS GENERATED - DO NOT MODIFY 30472// See angular/tools/gulp-tasks/cldr/extract.js 30473const u = undefined; 30474function plural(n) { 30475 let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length; 30476 if (i === 1 && v === 0) 30477 return 1; 30478 return 5; 30479} 30480var localeEn = [ 30481 'en', 30482 [['a', 'p'], ['AM', 'PM'], u], 30483 [['AM', 'PM'], u, u], 30484 [ 30485 ['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 30486 ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 30487 ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] 30488 ], 30489 u, 30490 [ 30491 ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'], 30492 ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 30493 [ 30494 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 30495 'October', 'November', 'December' 30496 ] 30497 ], 30498 u, 30499 [['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']], 30500 0, 30501 [6, 0], 30502 ['M/d/yy', 'MMM d, y', 'MMMM d, y', 'EEEE, MMMM d, y'], 30503 ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'], 30504 ['{1}, {0}', u, '{1} \'at\' {0}', u], 30505 ['.', ',', ';', '%', '+', '-', 'E', 'Ã', 'â°', 'â', 'NaN', ':'], 30506 ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], 30507 'USD', 30508 '$', 30509 'US Dollar', 30510 {}, 30511 'ltr', 30512 plural 30513]; 30514 30515/** 30516 * @license 30517 * Copyright Google LLC All Rights Reserved. 30518 * 30519 * Use of this source code is governed by an MIT-style license that can be 30520 * found in the LICENSE file at https://angular.io/license 30521 */ 30522/** 30523 * This const is used to store the locale data registered with `registerLocaleData` 30524 */ 30525let LOCALE_DATA = {}; 30526/** 30527 * Register locale data to be used internally by Angular. See the 30528 * ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale data. 30529 * 30530 * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1 30531 */ 30532function registerLocaleData(data, localeId, extraData) { 30533 if (typeof localeId !== 'string') { 30534 extraData = localeId; 30535 localeId = data[LocaleDataIndex.LocaleId]; 30536 } 30537 localeId = localeId.toLowerCase().replace(/_/g, '-'); 30538 LOCALE_DATA[localeId] = data; 30539 if (extraData) { 30540 LOCALE_DATA[localeId][LocaleDataIndex.ExtraData] = extraData; 30541 } 30542} 30543/** 30544 * Finds the locale data for a given locale. 30545 * 30546 * @param locale The locale code. 30547 * @returns The locale data. 30548 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 30549 */ 30550function findLocaleData(locale) { 30551 const normalizedLocale = normalizeLocale(locale); 30552 let match = getLocaleData(normalizedLocale); 30553 if (match) { 30554 return match; 30555 } 30556 // let's try to find a parent locale 30557 const parentLocale = normalizedLocale.split('-')[0]; 30558 match = getLocaleData(parentLocale); 30559 if (match) { 30560 return match; 30561 } 30562 if (parentLocale === 'en') { 30563 return localeEn; 30564 } 30565 throw new Error(`Missing locale data for the locale "${locale}".`); 30566} 30567/** 30568 * Retrieves the default currency code for the given locale. 30569 * 30570 * The default is defined as the first currency which is still in use. 30571 * 30572 * @param locale The code of the locale whose currency code we want. 30573 * @returns The code of the default currency for the given locale. 30574 * 30575 */ 30576function getLocaleCurrencyCode(locale) { 30577 const data = findLocaleData(locale); 30578 return data[LocaleDataIndex.CurrencyCode] || null; 30579} 30580/** 30581 * Retrieves the plural function used by ICU expressions to determine the plural case to use 30582 * for a given locale. 30583 * @param locale A locale code for the locale format rules to use. 30584 * @returns The plural function for the locale. 30585 * @see `NgPlural` 30586 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n) 30587 */ 30588function getLocalePluralCase(locale) { 30589 const data = findLocaleData(locale); 30590 return data[LocaleDataIndex.PluralCase]; 30591} 30592/** 30593 * Helper function to get the given `normalizedLocale` from `LOCALE_DATA` 30594 * or from the global `ng.common.locale`. 30595 */ 30596function getLocaleData(normalizedLocale) { 30597 if (!(normalizedLocale in LOCALE_DATA)) { 30598 LOCALE_DATA[normalizedLocale] = _global.ng && _global.ng.common && _global.ng.common.locales && 30599 _global.ng.common.locales[normalizedLocale]; 30600 } 30601 return LOCALE_DATA[normalizedLocale]; 30602} 30603/** 30604 * Helper function to remove all the locale data from `LOCALE_DATA`. 30605 */ 30606function unregisterAllLocaleData() { 30607 LOCALE_DATA = {}; 30608} 30609/** 30610 * Index of each type of locale data from the locale data array 30611 */ 30612var LocaleDataIndex; 30613(function (LocaleDataIndex) { 30614 LocaleDataIndex[LocaleDataIndex["LocaleId"] = 0] = "LocaleId"; 30615 LocaleDataIndex[LocaleDataIndex["DayPeriodsFormat"] = 1] = "DayPeriodsFormat"; 30616 LocaleDataIndex[LocaleDataIndex["DayPeriodsStandalone"] = 2] = "DayPeriodsStandalone"; 30617 LocaleDataIndex[LocaleDataIndex["DaysFormat"] = 3] = "DaysFormat"; 30618 LocaleDataIndex[LocaleDataIndex["DaysStandalone"] = 4] = "DaysStandalone"; 30619 LocaleDataIndex[LocaleDataIndex["MonthsFormat"] = 5] = "MonthsFormat"; 30620 LocaleDataIndex[LocaleDataIndex["MonthsStandalone"] = 6] = "MonthsStandalone"; 30621 LocaleDataIndex[LocaleDataIndex["Eras"] = 7] = "Eras"; 30622 LocaleDataIndex[LocaleDataIndex["FirstDayOfWeek"] = 8] = "FirstDayOfWeek"; 30623 LocaleDataIndex[LocaleDataIndex["WeekendRange"] = 9] = "WeekendRange"; 30624 LocaleDataIndex[LocaleDataIndex["DateFormat"] = 10] = "DateFormat"; 30625 LocaleDataIndex[LocaleDataIndex["TimeFormat"] = 11] = "TimeFormat"; 30626 LocaleDataIndex[LocaleDataIndex["DateTimeFormat"] = 12] = "DateTimeFormat"; 30627 LocaleDataIndex[LocaleDataIndex["NumberSymbols"] = 13] = "NumberSymbols"; 30628 LocaleDataIndex[LocaleDataIndex["NumberFormats"] = 14] = "NumberFormats"; 30629 LocaleDataIndex[LocaleDataIndex["CurrencyCode"] = 15] = "CurrencyCode"; 30630 LocaleDataIndex[LocaleDataIndex["CurrencySymbol"] = 16] = "CurrencySymbol"; 30631 LocaleDataIndex[LocaleDataIndex["CurrencyName"] = 17] = "CurrencyName"; 30632 LocaleDataIndex[LocaleDataIndex["Currencies"] = 18] = "Currencies"; 30633 LocaleDataIndex[LocaleDataIndex["Directionality"] = 19] = "Directionality"; 30634 LocaleDataIndex[LocaleDataIndex["PluralCase"] = 20] = "PluralCase"; 30635 LocaleDataIndex[LocaleDataIndex["ExtraData"] = 21] = "ExtraData"; 30636})(LocaleDataIndex || (LocaleDataIndex = {})); 30637/** 30638 * Returns the canonical form of a locale name - lowercase with `_` replaced with `-`. 30639 */ 30640function normalizeLocale(locale) { 30641 return locale.toLowerCase().replace(/_/g, '-'); 30642} 30643 30644/** 30645 * @license 30646 * Copyright Google LLC All Rights Reserved. 30647 * 30648 * Use of this source code is governed by an MIT-style license that can be 30649 * found in the LICENSE file at https://angular.io/license 30650 */ 30651const pluralMapping = ['zero', 'one', 'two', 'few', 'many']; 30652/** 30653 * Returns the plural case based on the locale 30654 */ 30655function getPluralCase(value, locale) { 30656 const plural = getLocalePluralCase(locale)(parseInt(value, 10)); 30657 const result = pluralMapping[plural]; 30658 return (result !== undefined) ? result : 'other'; 30659} 30660/** 30661 * The locale id that the application is using by default (for translations and ICU expressions). 30662 */ 30663const DEFAULT_LOCALE_ID = 'en-US'; 30664/** 30665 * USD currency code that the application uses by default for CurrencyPipe when no 30666 * DEFAULT_CURRENCY_CODE is provided. 30667 */ 30668const USD_CURRENCY_CODE = 'USD'; 30669 30670/** 30671 * @license 30672 * Copyright Google LLC All Rights Reserved. 30673 * 30674 * Use of this source code is governed by an MIT-style license that can be 30675 * found in the LICENSE file at https://angular.io/license 30676 */ 30677/** 30678 * The locale id that the application is currently using (for translations and ICU expressions). 30679 * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine 30680 * but is now defined as a global value. 30681 */ 30682let LOCALE_ID = DEFAULT_LOCALE_ID; 30683/** 30684 * Sets the locale id that will be used for translations and ICU expressions. 30685 * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine 30686 * but is now defined as a global value. 30687 * 30688 * @param localeId 30689 */ 30690function setLocaleId(localeId) { 30691 assertDefined(localeId, `Expected localeId to be defined`); 30692 if (typeof localeId === 'string') { 30693 LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-'); 30694 } 30695} 30696/** 30697 * Gets the locale id that will be used for translations and ICU expressions. 30698 * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine 30699 * but is now defined as a global value. 30700 */ 30701function getLocaleId() { 30702 return LOCALE_ID; 30703} 30704 30705/** 30706 * @license 30707 * Copyright Google LLC All Rights Reserved. 30708 * 30709 * Use of this source code is governed by an MIT-style license that can be 30710 * found in the LICENSE file at https://angular.io/license 30711 */ 30712/** 30713 * NOTE: changes to the `ngI18nClosureMode` name must be synced with `compiler-cli/src/tooling.ts`. 30714 */ 30715if (typeof ngI18nClosureMode === 'undefined') { 30716 // These property accesses can be ignored because ngI18nClosureMode will be set to false 30717 // when optimizing code and the whole if statement will be dropped. 30718 // Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure. 30719 // NOTE: we need to have it in IIFE so that the tree-shaker is happy. 30720 (function () { 30721 // tslint:disable-next-line:no-toplevel-property-access 30722 _global['ngI18nClosureMode'] = 30723 // TODO(FW-1250): validate that this actually, you know, works. 30724 // tslint:disable-next-line:no-toplevel-property-access 30725 typeof goog !== 'undefined' && typeof goog.getMsg === 'function'; 30726 })(); 30727} 30728 30729/** 30730 * @license 30731 * Copyright Google LLC All Rights Reserved. 30732 * 30733 * Use of this source code is governed by an MIT-style license that can be 30734 * found in the LICENSE file at https://angular.io/license 30735 */ 30736function getParentFromI18nMutateOpCode(mergedCode) { 30737 return mergedCode >>> 17 /* SHIFT_PARENT */; 30738} 30739function getRefFromI18nMutateOpCode(mergedCode) { 30740 return (mergedCode & 131064 /* MASK_REF */) >>> 3 /* SHIFT_REF */; 30741} 30742function getInstructionFromI18nMutateOpCode(mergedCode) { 30743 return mergedCode & 7 /* MASK_INSTRUCTION */; 30744} 30745/** 30746 * Marks that the next string is an element name. 30747 * 30748 * See `I18nMutateOpCodes` documentation. 30749 */ 30750const ELEMENT_MARKER = { 30751 marker: 'element' 30752}; 30753/** 30754 * Marks that the next string is comment text. 30755 * 30756 * See `I18nMutateOpCodes` documentation. 30757 */ 30758const COMMENT_MARKER = { 30759 marker: 'comment' 30760}; 30761// Note: This hack is necessary so we don't erroneously get a circular dependency 30762// failure based on types. 30763const unusedValueExportToPlacateAjd$6 = 1; 30764 30765/** 30766 * @license 30767 * Copyright Google LLC All Rights Reserved. 30768 * 30769 * Use of this source code is governed by an MIT-style license that can be 30770 * found in the LICENSE file at https://angular.io/license 30771 */ 30772const i18nIndexStack = []; 30773let i18nIndexStackPointer = -1; 30774function popI18nIndex() { 30775 return i18nIndexStack[i18nIndexStackPointer--]; 30776} 30777function pushI18nIndex(index) { 30778 i18nIndexStack[++i18nIndexStackPointer] = index; 30779} 30780let changeMask = 0b0; 30781let shiftsCounter = 0; 30782function setMaskBit(bit) { 30783 if (bit) { 30784 changeMask = changeMask | (1 << shiftsCounter); 30785 } 30786 shiftsCounter++; 30787} 30788function applyI18n(tView, lView, index) { 30789 if (shiftsCounter > 0) { 30790 ngDevMode && assertDefined(tView, `tView should be defined`); 30791 const tI18n = tView.data[index + HEADER_OFFSET]; 30792 let updateOpCodes; 30793 let tIcus = null; 30794 if (Array.isArray(tI18n)) { 30795 updateOpCodes = tI18n; 30796 } 30797 else { 30798 updateOpCodes = tI18n.update; 30799 tIcus = tI18n.icus; 30800 } 30801 const bindingsStartIndex = getBindingIndex() - shiftsCounter - 1; 30802 applyUpdateOpCodes(tView, tIcus, lView, updateOpCodes, bindingsStartIndex, changeMask); 30803 // Reset changeMask & maskBit to default for the next update cycle 30804 changeMask = 0b0; 30805 shiftsCounter = 0; 30806 } 30807} 30808/** 30809 * Apply `I18nMutateOpCodes` OpCodes. 30810 * 30811 * @param tView Current `TView` 30812 * @param rootIndex Pointer to the root (parent) tNode for the i18n. 30813 * @param createOpCodes OpCodes to process 30814 * @param lView Current `LView` 30815 */ 30816function applyCreateOpCodes(tView, rootindex, createOpCodes, lView) { 30817 const renderer = lView[RENDERER]; 30818 let currentTNode = null; 30819 let previousTNode = null; 30820 const visitedNodes = []; 30821 for (let i = 0; i < createOpCodes.length; i++) { 30822 const opCode = createOpCodes[i]; 30823 if (typeof opCode == 'string') { 30824 const textRNode = createTextNode(opCode, renderer); 30825 const textNodeIndex = createOpCodes[++i]; 30826 ngDevMode && ngDevMode.rendererCreateTextNode++; 30827 previousTNode = currentTNode; 30828 currentTNode = 30829 createDynamicNodeAtIndex(tView, lView, textNodeIndex, 3 /* Element */, textRNode, null); 30830 visitedNodes.push(textNodeIndex); 30831 setIsNotParent(); 30832 } 30833 else if (typeof opCode == 'number') { 30834 switch (opCode & 7 /* MASK_INSTRUCTION */) { 30835 case 1 /* AppendChild */: 30836 const destinationNodeIndex = opCode >>> 17 /* SHIFT_PARENT */; 30837 let destinationTNode; 30838 if (destinationNodeIndex === rootindex) { 30839 // If the destination node is `i18nStart`, we don't have a 30840 // top-level node and we should use the host node instead 30841 destinationTNode = lView[T_HOST]; 30842 } 30843 else { 30844 destinationTNode = getTNode(tView, destinationNodeIndex); 30845 } 30846 ngDevMode && 30847 assertDefined(currentTNode, `You need to create or select a node before you can insert it into the DOM`); 30848 previousTNode = 30849 appendI18nNode(tView, currentTNode, destinationTNode, previousTNode, lView); 30850 break; 30851 case 0 /* Select */: 30852 // Negative indices indicate that a given TNode is a sibling node, not a parent node 30853 // (see `i18nStartFirstPass` for additional information). 30854 const isParent = opCode >= 0; 30855 // FIXME(misko): This SHIFT_REF looks suspect as it does not have mask. 30856 const nodeIndex = (isParent ? opCode : ~opCode) >>> 3 /* SHIFT_REF */; 30857 visitedNodes.push(nodeIndex); 30858 previousTNode = currentTNode; 30859 currentTNode = getTNode(tView, nodeIndex); 30860 if (currentTNode) { 30861 setPreviousOrParentTNode(currentTNode, isParent); 30862 } 30863 break; 30864 case 5 /* ElementEnd */: 30865 const elementIndex = opCode >>> 3 /* SHIFT_REF */; 30866 previousTNode = currentTNode = getTNode(tView, elementIndex); 30867 setPreviousOrParentTNode(currentTNode, false); 30868 break; 30869 case 4 /* Attr */: 30870 const elementNodeIndex = opCode >>> 3 /* SHIFT_REF */; 30871 const attrName = createOpCodes[++i]; 30872 const attrValue = createOpCodes[++i]; 30873 // This code is used for ICU expressions only, since we don't support 30874 // directives/components in ICUs, we don't need to worry about inputs here 30875 elementAttributeInternal(getTNode(tView, elementNodeIndex), lView, attrName, attrValue, null, null); 30876 break; 30877 default: 30878 throw new Error(`Unable to determine the type of mutate operation for "${opCode}"`); 30879 } 30880 } 30881 else { 30882 switch (opCode) { 30883 case COMMENT_MARKER: 30884 const commentValue = createOpCodes[++i]; 30885 const commentNodeIndex = createOpCodes[++i]; 30886 ngDevMode && 30887 assertEqual(typeof commentValue, 'string', `Expected "${commentValue}" to be a comment node value`); 30888 const commentRNode = renderer.createComment(commentValue); 30889 ngDevMode && ngDevMode.rendererCreateComment++; 30890 previousTNode = currentTNode; 30891 currentTNode = createDynamicNodeAtIndex(tView, lView, commentNodeIndex, 5 /* IcuContainer */, commentRNode, null); 30892 visitedNodes.push(commentNodeIndex); 30893 attachPatchData(commentRNode, lView); 30894 // We will add the case nodes later, during the update phase 30895 setIsNotParent(); 30896 break; 30897 case ELEMENT_MARKER: 30898 const tagNameValue = createOpCodes[++i]; 30899 const elementNodeIndex = createOpCodes[++i]; 30900 ngDevMode && 30901 assertEqual(typeof tagNameValue, 'string', `Expected "${tagNameValue}" to be an element node tag name`); 30902 const elementRNode = renderer.createElement(tagNameValue); 30903 ngDevMode && ngDevMode.rendererCreateElement++; 30904 previousTNode = currentTNode; 30905 currentTNode = createDynamicNodeAtIndex(tView, lView, elementNodeIndex, 3 /* Element */, elementRNode, tagNameValue); 30906 visitedNodes.push(elementNodeIndex); 30907 break; 30908 default: 30909 throw new Error(`Unable to determine the type of mutate operation for "${opCode}"`); 30910 } 30911 } 30912 } 30913 setIsNotParent(); 30914 return visitedNodes; 30915} 30916/** 30917 * Apply `I18nUpdateOpCodes` OpCodes 30918 * 30919 * @param tView Current `TView` 30920 * @param tIcus If ICUs present than this contains them. 30921 * @param lView Current `LView` 30922 * @param updateOpCodes OpCodes to process 30923 * @param bindingsStartIndex Location of the first `ɵɵi18nApply` 30924 * @param changeMask Each bit corresponds to a `ɵɵi18nExp` (Counting backwards from 30925 * `bindingsStartIndex`) 30926 */ 30927function applyUpdateOpCodes(tView, tIcus, lView, updateOpCodes, bindingsStartIndex, changeMask) { 30928 let caseCreated = false; 30929 for (let i = 0; i < updateOpCodes.length; i++) { 30930 // bit code to check if we should apply the next update 30931 const checkBit = updateOpCodes[i]; 30932 // Number of opCodes to skip until next set of update codes 30933 const skipCodes = updateOpCodes[++i]; 30934 if (checkBit & changeMask) { 30935 // The value has been updated since last checked 30936 let value = ''; 30937 for (let j = i + 1; j <= (i + skipCodes); j++) { 30938 const opCode = updateOpCodes[j]; 30939 if (typeof opCode == 'string') { 30940 value += opCode; 30941 } 30942 else if (typeof opCode == 'number') { 30943 if (opCode < 0) { 30944 // Negative opCode represent `i18nExp` values offset. 30945 value += renderStringify(lView[bindingsStartIndex - opCode]); 30946 } 30947 else { 30948 const nodeIndex = opCode >>> 2 /* SHIFT_REF */; 30949 switch (opCode & 3 /* MASK_OPCODE */) { 30950 case 1 /* Attr */: 30951 const propName = updateOpCodes[++j]; 30952 const sanitizeFn = updateOpCodes[++j]; 30953 elementPropertyInternal(tView, getTNode(tView, nodeIndex), lView, propName, value, lView[RENDERER], sanitizeFn, false); 30954 break; 30955 case 0 /* Text */: 30956 textBindingInternal(lView, nodeIndex, value); 30957 break; 30958 case 2 /* IcuSwitch */: 30959 caseCreated = 30960 applyIcuSwitchCase(tView, tIcus, updateOpCodes[++j], lView, value); 30961 break; 30962 case 3 /* IcuUpdate */: 30963 applyIcuUpdateCase(tView, tIcus, updateOpCodes[++j], bindingsStartIndex, lView, caseCreated); 30964 break; 30965 } 30966 } 30967 } 30968 } 30969 } 30970 i += skipCodes; 30971 } 30972} 30973/** 30974 * Apply OpCodes associated with updating an existing ICU. 30975 * 30976 * @param tView Current `TView` 30977 * @param tIcus ICUs active at this location. 30978 * @param tIcuIndex Index into `tIcus` to process. 30979 * @param bindingsStartIndex Location of the first `ɵɵi18nApply` 30980 * @param lView Current `LView` 30981 * @param changeMask Each bit corresponds to a `ɵɵi18nExp` (Counting backwards from 30982 * `bindingsStartIndex`) 30983 */ 30984function applyIcuUpdateCase(tView, tIcus, tIcuIndex, bindingsStartIndex, lView, caseCreated) { 30985 ngDevMode && assertIndexInRange(tIcus, tIcuIndex); 30986 const tIcu = tIcus[tIcuIndex]; 30987 ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex); 30988 const activeCaseIndex = lView[tIcu.currentCaseLViewIndex]; 30989 if (activeCaseIndex !== null) { 30990 const mask = caseCreated ? 30991 -1 : // -1 is same as all bits on, which simulates creation since it marks all bits dirty 30992 changeMask; 30993 applyUpdateOpCodes(tView, tIcus, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask); 30994 } 30995} 30996/** 30997 * Apply OpCodes associated with switching a case on ICU. 30998 * 30999 * This involves tearing down existing case and than building up a new case. 31000 * 31001 * @param tView Current `TView` 31002 * @param tIcus ICUs active at this location. 31003 * @param tICuIndex Index into `tIcus` to process. 31004 * @param lView Current `LView` 31005 * @param value Value of the case to update to. 31006 * @returns true if a new case was created (needed so that the update executes regardless of the 31007 * bitmask) 31008 */ 31009function applyIcuSwitchCase(tView, tIcus, tICuIndex, lView, value) { 31010 applyIcuSwitchCaseRemove(tView, tIcus, tICuIndex, lView); 31011 // Rebuild a new case for this ICU 31012 let caseCreated = false; 31013 const tIcu = tIcus[tICuIndex]; 31014 const caseIndex = getCaseIndex(tIcu, value); 31015 lView[tIcu.currentCaseLViewIndex] = caseIndex !== -1 ? caseIndex : null; 31016 if (caseIndex > -1) { 31017 // Add the nodes for the new case 31018 applyCreateOpCodes(tView, -1, // -1 means we don't have parent node 31019 tIcu.create[caseIndex], lView); 31020 caseCreated = true; 31021 } 31022 return caseCreated; 31023} 31024/** 31025 * Apply OpCodes associated with tearing down of DOM. 31026 * 31027 * This involves tearing down existing case and than building up a new case. 31028 * 31029 * @param tView Current `TView` 31030 * @param tIcus ICUs active at this location. 31031 * @param tIcuIndex Index into `tIcus` to process. 31032 * @param lView Current `LView` 31033 * @returns true if a new case was created (needed so that the update executes regardless of the 31034 * bitmask) 31035 */ 31036function applyIcuSwitchCaseRemove(tView, tIcus, tIcuIndex, lView) { 31037 ngDevMode && assertIndexInRange(tIcus, tIcuIndex); 31038 const tIcu = tIcus[tIcuIndex]; 31039 const activeCaseIndex = lView[tIcu.currentCaseLViewIndex]; 31040 if (activeCaseIndex !== null) { 31041 const removeCodes = tIcu.remove[activeCaseIndex]; 31042 for (let k = 0; k < removeCodes.length; k++) { 31043 const removeOpCode = removeCodes[k]; 31044 const nodeOrIcuIndex = removeOpCode >>> 3 /* SHIFT_REF */; 31045 switch (removeOpCode & 7 /* MASK_INSTRUCTION */) { 31046 case 3 /* Remove */: 31047 // FIXME(misko): this comment is wrong! 31048 // Remove DOM element, but do *not* mark TNode as detached, since we are 31049 // just switching ICU cases (while keeping the same TNode), so a DOM element 31050 // representing a new ICU case will be re-created. 31051 removeNode(tView, lView, nodeOrIcuIndex, /* markAsDetached */ false); 31052 break; 31053 case 6 /* RemoveNestedIcu */: 31054 applyIcuSwitchCaseRemove(tView, tIcus, nodeOrIcuIndex, lView); 31055 break; 31056 } 31057 } 31058 } 31059} 31060function appendI18nNode(tView, tNode, parentTNode, previousTNode, lView) { 31061 ngDevMode && ngDevMode.rendererMoveNode++; 31062 const nextNode = tNode.next; 31063 if (!previousTNode) { 31064 previousTNode = parentTNode; 31065 } 31066 // Re-organize node tree to put this node in the correct position. 31067 if (previousTNode === parentTNode && tNode !== parentTNode.child) { 31068 tNode.next = parentTNode.child; 31069 parentTNode.child = tNode; 31070 } 31071 else if (previousTNode !== parentTNode && tNode !== previousTNode.next) { 31072 tNode.next = previousTNode.next; 31073 previousTNode.next = tNode; 31074 } 31075 else { 31076 tNode.next = null; 31077 } 31078 if (parentTNode !== lView[T_HOST]) { 31079 tNode.parent = parentTNode; 31080 } 31081 // If tNode was moved around, we might need to fix a broken link. 31082 let cursor = tNode.next; 31083 while (cursor) { 31084 if (cursor.next === tNode) { 31085 cursor.next = nextNode; 31086 } 31087 cursor = cursor.next; 31088 } 31089 // If the placeholder to append is a projection, we need to move the projected nodes instead 31090 if (tNode.type === 1 /* Projection */) { 31091 applyProjection(tView, lView, tNode); 31092 return tNode; 31093 } 31094 appendChild(tView, lView, getNativeByTNode(tNode, lView), tNode); 31095 const slotValue = lView[tNode.index]; 31096 if (tNode.type !== 0 /* Container */ && isLContainer(slotValue)) { 31097 // Nodes that inject ViewContainerRef also have a comment node that should be moved 31098 appendChild(tView, lView, slotValue[NATIVE], tNode); 31099 } 31100 return tNode; 31101} 31102/** 31103 * See `i18nEnd` above. 31104 */ 31105function i18nEndFirstPass(tView, lView) { 31106 ngDevMode && 31107 assertEqual(getBindingIndex(), tView.bindingStartIndex, 'i18nEnd should be called before any binding'); 31108 const rootIndex = popI18nIndex(); 31109 const tI18n = tView.data[rootIndex + HEADER_OFFSET]; 31110 ngDevMode && assertDefined(tI18n, `You should call i18nStart before i18nEnd`); 31111 // Find the last node that was added before `i18nEnd` 31112 const lastCreatedNode = getPreviousOrParentTNode(); 31113 // Read the instructions to insert/move/remove DOM elements 31114 const visitedNodes = applyCreateOpCodes(tView, rootIndex, tI18n.create, lView); 31115 // Remove deleted nodes 31116 let index = rootIndex + 1; 31117 while (index <= lastCreatedNode.index - HEADER_OFFSET) { 31118 if (visitedNodes.indexOf(index) === -1) { 31119 removeNode(tView, lView, index, /* markAsDetached */ true); 31120 } 31121 // Check if an element has any local refs and skip them 31122 const tNode = getTNode(tView, index); 31123 if (tNode && 31124 (tNode.type === 0 /* Container */ || tNode.type === 3 /* Element */ || 31125 tNode.type === 4 /* ElementContainer */) && 31126 tNode.localNames !== null) { 31127 // Divide by 2 to get the number of local refs, 31128 // since they are stored as an array that also includes directive indexes, 31129 // i.e. ["localRef", directiveIndex, ...] 31130 index += tNode.localNames.length >> 1; 31131 } 31132 index++; 31133 } 31134} 31135function removeNode(tView, lView, index, markAsDetached) { 31136 const removedPhTNode = getTNode(tView, index); 31137 const removedPhRNode = getNativeByIndex(index, lView); 31138 if (removedPhRNode) { 31139 nativeRemoveNode(lView[RENDERER], removedPhRNode); 31140 } 31141 const slotValue = load(lView, index); 31142 if (isLContainer(slotValue)) { 31143 const lContainer = slotValue; 31144 if (removedPhTNode.type !== 0 /* Container */) { 31145 nativeRemoveNode(lView[RENDERER], lContainer[NATIVE]); 31146 } 31147 } 31148 if (markAsDetached) { 31149 // Define this node as detached to avoid projecting it later 31150 removedPhTNode.flags |= 64 /* isDetached */; 31151 } 31152 ngDevMode && ngDevMode.rendererRemoveNode++; 31153} 31154/** 31155 * Creates and stores the dynamic TNode, and unhooks it from the tree for now. 31156 */ 31157function createDynamicNodeAtIndex(tView, lView, index, type, native, name) { 31158 const previousOrParentTNode = getPreviousOrParentTNode(); 31159 ngDevMode && assertIndexInRange(lView, index + HEADER_OFFSET); 31160 lView[index + HEADER_OFFSET] = native; 31161 // FIXME(misko): Why does this create A TNode??? I would not expect this to be here. 31162 const tNode = getOrCreateTNode(tView, lView[T_HOST], index, type, name, null); 31163 // We are creating a dynamic node, the previous tNode might not be pointing at this node. 31164 // We will link ourselves into the tree later with `appendI18nNode`. 31165 if (previousOrParentTNode && previousOrParentTNode.next === tNode) { 31166 previousOrParentTNode.next = null; 31167 } 31168 return tNode; 31169} 31170/** 31171 * Returns the index of the current case of an ICU expression depending on the main binding value 31172 * 31173 * @param icuExpression 31174 * @param bindingValue The value of the main binding used by this ICU expression 31175 */ 31176function getCaseIndex(icuExpression, bindingValue) { 31177 let index = icuExpression.cases.indexOf(bindingValue); 31178 if (index === -1) { 31179 switch (icuExpression.type) { 31180 case 1 /* plural */: { 31181 const resolvedCase = getPluralCase(bindingValue, getLocaleId()); 31182 index = icuExpression.cases.indexOf(resolvedCase); 31183 if (index === -1 && resolvedCase !== 'other') { 31184 index = icuExpression.cases.indexOf('other'); 31185 } 31186 break; 31187 } 31188 case 0 /* select */: { 31189 index = icuExpression.cases.indexOf('other'); 31190 break; 31191 } 31192 } 31193 } 31194 return index; 31195} 31196 31197/** 31198 * @license 31199 * Copyright Google LLC All Rights Reserved. 31200 * 31201 * Use of this source code is governed by an MIT-style license that can be 31202 * found in the LICENSE file at https://angular.io/license 31203 */ 31204/** 31205 * Converts `I18nUpdateOpCodes` array into a human readable format. 31206 * 31207 * This function is attached to the `I18nUpdateOpCodes.debug` property if `ngDevMode` is enabled. 31208 * This function provides a human readable view of the opcodes. This is useful when debugging the 31209 * application as well as writing more readable tests. 31210 * 31211 * @param this `I18nUpdateOpCodes` if attached as a method. 31212 * @param opcodes `I18nUpdateOpCodes` if invoked as a function. 31213 */ 31214function i18nUpdateOpCodesToString(opcodes) { 31215 const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : [])); 31216 let lines = []; 31217 function consumeOpCode(value) { 31218 const ref = value >>> 2 /* SHIFT_REF */; 31219 const opCode = value & 3 /* MASK_OPCODE */; 31220 switch (opCode) { 31221 case 0 /* Text */: 31222 return `(lView[${ref}] as Text).textContent = $$$`; 31223 case 1 /* Attr */: 31224 const attrName = parser.consumeString(); 31225 const sanitizationFn = parser.consumeFunction(); 31226 const value = sanitizationFn ? `(${sanitizationFn})($$$)` : '$$$'; 31227 return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value})`; 31228 case 2 /* IcuSwitch */: 31229 return `icuSwitchCase(lView[${ref}] as Comment, ${parser.consumeNumber()}, $$$)`; 31230 case 3 /* IcuUpdate */: 31231 return `icuUpdateCase(lView[${ref}] as Comment, ${parser.consumeNumber()})`; 31232 } 31233 throw new Error('unexpected OpCode'); 31234 } 31235 while (parser.hasMore()) { 31236 let mask = parser.consumeNumber(); 31237 let size = parser.consumeNumber(); 31238 const end = parser.i + size; 31239 const statements = []; 31240 let statement = ''; 31241 while (parser.i < end) { 31242 let value = parser.consumeNumberOrString(); 31243 if (typeof value === 'string') { 31244 statement += value; 31245 } 31246 else if (value < 0) { 31247 // Negative numbers are ref indexes 31248 statement += '${lView[' + (0 - value) + ']}'; 31249 } 31250 else { 31251 // Positive numbers are operations. 31252 const opCodeText = consumeOpCode(value); 31253 statements.push(opCodeText.replace('$$$', '`' + statement + '`') + ';'); 31254 statement = ''; 31255 } 31256 } 31257 lines.push(`if (mask & 0b${mask.toString(2)}) { ${statements.join(' ')} }`); 31258 } 31259 return lines; 31260} 31261/** 31262 * Converts `I18nMutableOpCodes` array into a human readable format. 31263 * 31264 * This function is attached to the `I18nMutableOpCodes.debug` if `ngDevMode` is enabled. This 31265 * function provides a human readable view of the opcodes. This is useful when debugging the 31266 * application as well as writing more readable tests. 31267 * 31268 * @param this `I18nMutableOpCodes` if attached as a method. 31269 * @param opcodes `I18nMutableOpCodes` if invoked as a function. 31270 */ 31271function i18nMutateOpCodesToString(opcodes) { 31272 const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : [])); 31273 let lines = []; 31274 function consumeOpCode(opCode) { 31275 const parent = getParentFromI18nMutateOpCode(opCode); 31276 const ref = getRefFromI18nMutateOpCode(opCode); 31277 switch (getInstructionFromI18nMutateOpCode(opCode)) { 31278 case 0 /* Select */: 31279 lastRef = ref; 31280 return ''; 31281 case 1 /* AppendChild */: 31282 return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`; 31283 case 3 /* Remove */: 31284 return `(lView[${parent}] as Element).remove(lView[${ref}])`; 31285 case 4 /* Attr */: 31286 return `(lView[${ref}] as Element).setAttribute("${parser.consumeString()}", "${parser.consumeString()}")`; 31287 case 5 /* ElementEnd */: 31288 return `setPreviousOrParentTNode(tView.data[${ref}] as TNode)`; 31289 case 6 /* RemoveNestedIcu */: 31290 return `removeNestedICU(${ref})`; 31291 } 31292 throw new Error('Unexpected OpCode'); 31293 } 31294 let lastRef = -1; 31295 while (parser.hasMore()) { 31296 let value = parser.consumeNumberStringOrMarker(); 31297 if (value === COMMENT_MARKER) { 31298 const text = parser.consumeString(); 31299 lastRef = parser.consumeNumber(); 31300 lines.push(`lView[${lastRef}] = document.createComment("${text}")`); 31301 } 31302 else if (value === ELEMENT_MARKER) { 31303 const text = parser.consumeString(); 31304 lastRef = parser.consumeNumber(); 31305 lines.push(`lView[${lastRef}] = document.createElement("${text}")`); 31306 } 31307 else if (typeof value === 'string') { 31308 lastRef = parser.consumeNumber(); 31309 lines.push(`lView[${lastRef}] = document.createTextNode("${value}")`); 31310 } 31311 else if (typeof value === 'number') { 31312 const line = consumeOpCode(value); 31313 line && lines.push(line); 31314 } 31315 else { 31316 throw new Error('Unexpected value'); 31317 } 31318 } 31319 return lines; 31320} 31321class OpCodeParser { 31322 constructor(codes) { 31323 this.i = 0; 31324 this.codes = codes; 31325 } 31326 hasMore() { 31327 return this.i < this.codes.length; 31328 } 31329 consumeNumber() { 31330 let value = this.codes[this.i++]; 31331 assertNumber(value, 'expecting number in OpCode'); 31332 return value; 31333 } 31334 consumeString() { 31335 let value = this.codes[this.i++]; 31336 assertString(value, 'expecting string in OpCode'); 31337 return value; 31338 } 31339 consumeFunction() { 31340 let value = this.codes[this.i++]; 31341 if (value === null || typeof value === 'function') { 31342 return value; 31343 } 31344 throw new Error('expecting function in OpCode'); 31345 } 31346 consumeNumberOrString() { 31347 let value = this.codes[this.i++]; 31348 if (typeof value === 'string') { 31349 return value; 31350 } 31351 assertNumber(value, 'expecting number or string in OpCode'); 31352 return value; 31353 } 31354 consumeNumberStringOrMarker() { 31355 let value = this.codes[this.i++]; 31356 if (typeof value === 'string' || typeof value === 'number' || value == COMMENT_MARKER || 31357 value == ELEMENT_MARKER) { 31358 return value; 31359 } 31360 assertNumber(value, 'expecting number, string, COMMENT_MARKER or ELEMENT_MARKER in OpCode'); 31361 return value; 31362 } 31363} 31364 31365/** 31366 * @license 31367 * Copyright Google LLC All Rights Reserved. 31368 * 31369 * Use of this source code is governed by an MIT-style license that can be 31370 * found in the LICENSE file at https://angular.io/license 31371 */ 31372const BINDING_REGEXP = /�(\d+):?\d*�/gi; 31373const ICU_REGEXP = /({\s*�\d+:?\d*�\s*,\s*\S{6}\s*,[\s\S]*})/gi; 31374const NESTED_ICU = /�(\d+)�/; 31375const ICU_BLOCK_REGEXP = /^\s*(�\d+:?\d*�)\s*,\s*(select|plural)\s*,/; 31376// Count for the number of vars that will be allocated for each i18n block. 31377// It is global because this is used in multiple functions that include loops and recursive calls. 31378// This is reset to 0 when `i18nStartFirstPass` is called. 31379let i18nVarsCount; 31380const parentIndexStack = []; 31381const MARKER = `�`; 31382const SUBTEMPLATE_REGEXP = /�\/?\*(\d+:\d+)�/gi; 31383const PH_REGEXP = /�(\/?[#*!]\d+):?\d*�/gi; 31384/** 31385 * Angular Dart introduced &ngsp; as a placeholder for non-removable space, see: 31386 * https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32 31387 * In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character 31388 * and later on replaced by a space. We are re-implementing the same idea here, since translations 31389 * might contain this special character. 31390 */ 31391const NGSP_UNICODE_REGEXP = /\uE500/g; 31392function replaceNgsp(value) { 31393 return value.replace(NGSP_UNICODE_REGEXP, ' '); 31394} 31395/** 31396 * See `i18nStart` above. 31397 */ 31398function i18nStartFirstPass(lView, tView, index, message, subTemplateIndex) { 31399 const startIndex = tView.blueprint.length - HEADER_OFFSET; 31400 i18nVarsCount = 0; 31401 const previousOrParentTNode = getPreviousOrParentTNode(); 31402 const parentTNode = getIsParent() ? previousOrParentTNode : previousOrParentTNode && previousOrParentTNode.parent; 31403 let parentIndex = parentTNode && parentTNode !== lView[T_HOST] ? parentTNode.index - HEADER_OFFSET : index; 31404 let parentIndexPointer = 0; 31405 parentIndexStack[parentIndexPointer] = parentIndex; 31406 const createOpCodes = []; 31407 if (ngDevMode) { 31408 attachDebugGetter(createOpCodes, i18nMutateOpCodesToString); 31409 } 31410 // If the previous node wasn't the direct parent then we have a translation without top level 31411 // element and we need to keep a reference of the previous element if there is one. We should also 31412 // keep track whether an element was a parent node or not, so that the logic that consumes 31413 // the generated `I18nMutateOpCode`s can leverage this information to properly set TNode state 31414 // (whether it's a parent or sibling). 31415 if (index > 0 && previousOrParentTNode !== parentTNode) { 31416 let previousTNodeIndex = previousOrParentTNode.index - HEADER_OFFSET; 31417 // If current TNode is a sibling node, encode it using a negative index. This information is 31418 // required when the `Select` action is processed (see the `readCreateOpCodes` function). 31419 if (!getIsParent()) { 31420 previousTNodeIndex = ~previousTNodeIndex; 31421 } 31422 // Create an OpCode to select the previous TNode 31423 createOpCodes.push(previousTNodeIndex << 3 /* SHIFT_REF */ | 0 /* Select */); 31424 } 31425 const updateOpCodes = []; 31426 if (ngDevMode) { 31427 attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString); 31428 } 31429 const icuExpressions = []; 31430 if (message === '' && isRootTemplateMessage(subTemplateIndex)) { 31431 // If top level translation is an empty string, do not invoke additional processing 31432 // and just create op codes for empty text node instead. 31433 createOpCodes.push(message, allocNodeIndex(startIndex), parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */); 31434 } 31435 else { 31436 const templateTranslation = getTranslationForTemplate(message, subTemplateIndex); 31437 const msgParts = replaceNgsp(templateTranslation).split(PH_REGEXP); 31438 for (let i = 0; i < msgParts.length; i++) { 31439 let value = msgParts[i]; 31440 if (i & 1) { 31441 // Odd indexes are placeholders (elements and sub-templates) 31442 if (value.charAt(0) === '/') { 31443 // It is a closing tag 31444 if (value.charAt(1) === "#" /* ELEMENT */) { 31445 const phIndex = parseInt(value.substr(2), 10); 31446 parentIndex = parentIndexStack[--parentIndexPointer]; 31447 createOpCodes.push(phIndex << 3 /* SHIFT_REF */ | 5 /* ElementEnd */); 31448 } 31449 } 31450 else { 31451 const phIndex = parseInt(value.substr(1), 10); 31452 const isElement = value.charAt(0) === "#" /* ELEMENT */; 31453 // The value represents a placeholder that we move to the designated index. 31454 // Note: positive indicies indicate that a TNode with a given index should also be marked 31455 // as parent while executing `Select` instruction. 31456 createOpCodes.push((isElement ? phIndex : ~phIndex) << 3 /* SHIFT_REF */ | 31457 0 /* Select */, parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */); 31458 if (isElement) { 31459 parentIndexStack[++parentIndexPointer] = parentIndex = phIndex; 31460 } 31461 } 31462 } 31463 else { 31464 // Even indexes are text (including bindings & ICU expressions) 31465 const parts = extractParts(value); 31466 for (let j = 0; j < parts.length; j++) { 31467 if (j & 1) { 31468 // Odd indexes are ICU expressions 31469 const icuExpression = parts[j]; 31470 // Verify that ICU expression has the right shape. Translations might contain invalid 31471 // constructions (while original messages were correct), so ICU parsing at runtime may 31472 // not succeed (thus `icuExpression` remains a string). 31473 if (typeof icuExpression !== 'object') { 31474 throw new Error(`Unable to parse ICU expression in "${templateTranslation}" message.`); 31475 } 31476 // Create the comment node that will anchor the ICU expression 31477 const icuNodeIndex = allocNodeIndex(startIndex); 31478 createOpCodes.push(COMMENT_MARKER, ngDevMode ? `ICU ${icuNodeIndex}` : '', icuNodeIndex, parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */); 31479 // Update codes for the ICU expression 31480 const mask = getBindingMask(icuExpression); 31481 icuStart(icuExpressions, icuExpression, icuNodeIndex, icuNodeIndex); 31482 // Since this is recursive, the last TIcu that was pushed is the one we want 31483 const tIcuIndex = icuExpressions.length - 1; 31484 updateOpCodes.push(toMaskBit(icuExpression.mainBinding), // mask of the main binding 31485 3, // skip 3 opCodes if not changed 31486 -1 - icuExpression.mainBinding, icuNodeIndex << 2 /* SHIFT_REF */ | 2 /* IcuSwitch */, tIcuIndex, mask, // mask of all the bindings of this ICU expression 31487 2, // skip 2 opCodes if not changed 31488 icuNodeIndex << 2 /* SHIFT_REF */ | 3 /* IcuUpdate */, tIcuIndex); 31489 } 31490 else if (parts[j] !== '') { 31491 const text = parts[j]; 31492 // Even indexes are text (including bindings) 31493 const hasBinding = text.match(BINDING_REGEXP); 31494 // Create text nodes 31495 const textNodeIndex = allocNodeIndex(startIndex); 31496 createOpCodes.push( 31497 // If there is a binding, the value will be set during update 31498 hasBinding ? '' : text, textNodeIndex, parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */); 31499 if (hasBinding) { 31500 addAllToArray(generateBindingUpdateOpCodes(text, textNodeIndex), updateOpCodes); 31501 } 31502 } 31503 } 31504 } 31505 } 31506 } 31507 if (i18nVarsCount > 0) { 31508 allocExpando(tView, lView, i18nVarsCount); 31509 } 31510 // NOTE: local var needed to properly assert the type of `TI18n`. 31511 const tI18n = { 31512 vars: i18nVarsCount, 31513 create: createOpCodes, 31514 update: updateOpCodes, 31515 icus: icuExpressions.length ? icuExpressions : null, 31516 }; 31517 tView.data[index + HEADER_OFFSET] = tI18n; 31518} 31519/** 31520 * See `i18nAttributes` above. 31521 */ 31522function i18nAttributesFirstPass(lView, tView, index, values) { 31523 const previousElement = getPreviousOrParentTNode(); 31524 const previousElementIndex = previousElement.index - HEADER_OFFSET; 31525 const updateOpCodes = []; 31526 if (ngDevMode) { 31527 attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString); 31528 } 31529 for (let i = 0; i < values.length; i += 2) { 31530 const attrName = values[i]; 31531 const message = values[i + 1]; 31532 const parts = message.split(ICU_REGEXP); 31533 for (let j = 0; j < parts.length; j++) { 31534 const value = parts[j]; 31535 if (j & 1) { 31536 // Odd indexes are ICU expressions 31537 // TODO(ocombe): support ICU expressions in attributes 31538 throw new Error('ICU expressions are not yet supported in attributes'); 31539 } 31540 else if (value !== '') { 31541 // Even indexes are text (including bindings) 31542 const hasBinding = !!value.match(BINDING_REGEXP); 31543 if (hasBinding) { 31544 if (tView.firstCreatePass && tView.data[index + HEADER_OFFSET] === null) { 31545 addAllToArray(generateBindingUpdateOpCodes(value, previousElementIndex, attrName), updateOpCodes); 31546 } 31547 } 31548 else { 31549 const tNode = getTNode(tView, previousElementIndex); 31550 // Set attributes for Elements only, for other types (like ElementContainer), 31551 // only set inputs below 31552 if (tNode.type === 3 /* Element */) { 31553 elementAttributeInternal(tNode, lView, attrName, value, null, null); 31554 } 31555 // Check if that attribute is a directive input 31556 const dataValue = tNode.inputs !== null && tNode.inputs[attrName]; 31557 if (dataValue) { 31558 setInputsForProperty(tView, lView, dataValue, attrName, value); 31559 if (ngDevMode) { 31560 const element = getNativeByIndex(previousElementIndex, lView); 31561 setNgReflectProperties(lView, element, tNode.type, dataValue, value); 31562 } 31563 } 31564 } 31565 } 31566 } 31567 } 31568 if (tView.firstCreatePass && tView.data[index + HEADER_OFFSET] === null) { 31569 tView.data[index + HEADER_OFFSET] = updateOpCodes; 31570 } 31571} 31572/** 31573 * Generate the OpCodes to update the bindings of a string. 31574 * 31575 * @param str The string containing the bindings. 31576 * @param destinationNode Index of the destination node which will receive the binding. 31577 * @param attrName Name of the attribute, if the string belongs to an attribute. 31578 * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary. 31579 */ 31580function generateBindingUpdateOpCodes(str, destinationNode, attrName, sanitizeFn = null) { 31581 const updateOpCodes = [null, null]; // Alloc space for mask and size 31582 if (ngDevMode) { 31583 attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString); 31584 } 31585 const textParts = str.split(BINDING_REGEXP); 31586 let mask = 0; 31587 for (let j = 0; j < textParts.length; j++) { 31588 const textValue = textParts[j]; 31589 if (j & 1) { 31590 // Odd indexes are bindings 31591 const bindingIndex = parseInt(textValue, 10); 31592 updateOpCodes.push(-1 - bindingIndex); 31593 mask = mask | toMaskBit(bindingIndex); 31594 } 31595 else if (textValue !== '') { 31596 // Even indexes are text 31597 updateOpCodes.push(textValue); 31598 } 31599 } 31600 updateOpCodes.push(destinationNode << 2 /* SHIFT_REF */ | 31601 (attrName ? 1 /* Attr */ : 0 /* Text */)); 31602 if (attrName) { 31603 updateOpCodes.push(attrName, sanitizeFn); 31604 } 31605 updateOpCodes[0] = mask; 31606 updateOpCodes[1] = updateOpCodes.length - 2; 31607 return updateOpCodes; 31608} 31609function getBindingMask(icuExpression, mask = 0) { 31610 mask = mask | toMaskBit(icuExpression.mainBinding); 31611 let match; 31612 for (let i = 0; i < icuExpression.values.length; i++) { 31613 const valueArr = icuExpression.values[i]; 31614 for (let j = 0; j < valueArr.length; j++) { 31615 const value = valueArr[j]; 31616 if (typeof value === 'string') { 31617 while (match = BINDING_REGEXP.exec(value)) { 31618 mask = mask | toMaskBit(parseInt(match[1], 10)); 31619 } 31620 } 31621 else { 31622 mask = getBindingMask(value, mask); 31623 } 31624 } 31625 } 31626 return mask; 31627} 31628function allocNodeIndex(startIndex) { 31629 return startIndex + i18nVarsCount++; 31630} 31631/** 31632 * Convert binding index to mask bit. 31633 * 31634 * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make 31635 * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to have 31636 * more than 32 bindings this will be hit very rarely. The downside of hitting this corner case is 31637 * that we will execute binding code more often than necessary. (penalty of performance) 31638 */ 31639function toMaskBit(bindingIndex) { 31640 return 1 << Math.min(bindingIndex, 31); 31641} 31642function isRootTemplateMessage(subTemplateIndex) { 31643 return subTemplateIndex === undefined; 31644} 31645/** 31646 * Removes everything inside the sub-templates of a message. 31647 */ 31648function removeInnerTemplateTranslation(message) { 31649 let match; 31650 let res = ''; 31651 let index = 0; 31652 let inTemplate = false; 31653 let tagMatched; 31654 while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) { 31655 if (!inTemplate) { 31656 res += message.substring(index, match.index + match[0].length); 31657 tagMatched = match[1]; 31658 inTemplate = true; 31659 } 31660 else { 31661 if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) { 31662 index = match.index; 31663 inTemplate = false; 31664 } 31665 } 31666 } 31667 ngDevMode && 31668 assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation "${message}"`); 31669 res += message.substr(index); 31670 return res; 31671} 31672/** 31673 * Extracts a part of a message and removes the rest. 31674 * 31675 * This method is used for extracting a part of the message associated with a template. A translated 31676 * message can span multiple templates. 31677 * 31678 * Example: 31679 * ``` 31680 * <div i18n>Translate <span *ngIf>me</span>!</div> 31681 * ``` 31682 * 31683 * @param message The message to crop 31684 * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the 31685 * external template and removes all sub-templates. 31686 */ 31687function getTranslationForTemplate(message, subTemplateIndex) { 31688 if (isRootTemplateMessage(subTemplateIndex)) { 31689 // We want the root template message, ignore all sub-templates 31690 return removeInnerTemplateTranslation(message); 31691 } 31692 else { 31693 // We want a specific sub-template 31694 const start = message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length; 31695 const end = message.search(new RegExp(`${MARKER}\\/\\*\\d+:${subTemplateIndex}${MARKER}`)); 31696 return removeInnerTemplateTranslation(message.substring(start, end)); 31697 } 31698} 31699/** 31700 * Generate the OpCodes for ICU expressions. 31701 * 31702 * @param tIcus 31703 * @param icuExpression 31704 * @param startIndex 31705 * @param expandoStartIndex 31706 */ 31707function icuStart(tIcus, icuExpression, startIndex, expandoStartIndex) { 31708 const createCodes = []; 31709 const removeCodes = []; 31710 const updateCodes = []; 31711 const vars = []; 31712 const childIcus = []; 31713 const values = icuExpression.values; 31714 for (let i = 0; i < values.length; i++) { 31715 // Each value is an array of strings & other ICU expressions 31716 const valueArr = values[i]; 31717 const nestedIcus = []; 31718 for (let j = 0; j < valueArr.length; j++) { 31719 const value = valueArr[j]; 31720 if (typeof value !== 'string') { 31721 // It is an nested ICU expression 31722 const icuIndex = nestedIcus.push(value) - 1; 31723 // Replace nested ICU expression by a comment node 31724 valueArr[j] = `<!--�${icuIndex}�-->`; 31725 } 31726 } 31727 const icuCase = parseIcuCase(valueArr.join(''), startIndex, nestedIcus, tIcus, expandoStartIndex); 31728 createCodes.push(icuCase.create); 31729 removeCodes.push(icuCase.remove); 31730 updateCodes.push(icuCase.update); 31731 vars.push(icuCase.vars); 31732 childIcus.push(icuCase.childIcus); 31733 } 31734 const tIcu = { 31735 type: icuExpression.type, 31736 vars, 31737 currentCaseLViewIndex: HEADER_OFFSET + 31738 expandoStartIndex // expandoStartIndex does not include the header so add it. 31739 + 1, 31740 childIcus, 31741 cases: icuExpression.cases, 31742 create: createCodes, 31743 remove: removeCodes, 31744 update: updateCodes 31745 }; 31746 tIcus.push(tIcu); 31747 // Adding the maximum possible of vars needed (based on the cases with the most vars) 31748 i18nVarsCount += Math.max(...vars); 31749} 31750/** 31751 * Parses text containing an ICU expression and produces a JSON object for it. 31752 * Original code from closure library, modified for Angular. 31753 * 31754 * @param pattern Text containing an ICU expression that needs to be parsed. 31755 * 31756 */ 31757function parseICUBlock(pattern) { 31758 const cases = []; 31759 const values = []; 31760 let icuType = 1 /* plural */; 31761 let mainBinding = 0; 31762 pattern = pattern.replace(ICU_BLOCK_REGEXP, function (str, binding, type) { 31763 if (type === 'select') { 31764 icuType = 0 /* select */; 31765 } 31766 else { 31767 icuType = 1 /* plural */; 31768 } 31769 mainBinding = parseInt(binding.substr(1), 10); 31770 return ''; 31771 }); 31772 const parts = extractParts(pattern); 31773 // Looking for (key block)+ sequence. One of the keys has to be "other". 31774 for (let pos = 0; pos < parts.length;) { 31775 let key = parts[pos++].trim(); 31776 if (icuType === 1 /* plural */) { 31777 // Key can be "=x", we just want "x" 31778 key = key.replace(/\s*(?:=)?(\w+)\s*/, '$1'); 31779 } 31780 if (key.length) { 31781 cases.push(key); 31782 } 31783 const blocks = extractParts(parts[pos++]); 31784 if (cases.length > values.length) { 31785 values.push(blocks); 31786 } 31787 } 31788 // TODO(ocombe): support ICU expressions in attributes, see #21615 31789 return { type: icuType, mainBinding: mainBinding, cases, values }; 31790} 31791/** 31792 * Transforms a string template into an HTML template and a list of instructions used to update 31793 * attributes or nodes that contain bindings. 31794 * 31795 * @param unsafeHtml The string to parse 31796 * @param parentIndex 31797 * @param nestedIcus 31798 * @param tIcus 31799 * @param expandoStartIndex 31800 */ 31801function parseIcuCase(unsafeHtml, parentIndex, nestedIcus, tIcus, expandoStartIndex) { 31802 const inertBodyHelper = getInertBodyHelper(getDocument()); 31803 const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml); 31804 if (!inertBodyElement) { 31805 throw new Error('Unable to generate inert body element'); 31806 } 31807 const wrapper = getTemplateContent(inertBodyElement) || inertBodyElement; 31808 const opCodes = { 31809 vars: 1, 31810 childIcus: [], 31811 create: [], 31812 remove: [], 31813 update: [] 31814 }; 31815 if (ngDevMode) { 31816 attachDebugGetter(opCodes.create, i18nMutateOpCodesToString); 31817 attachDebugGetter(opCodes.remove, i18nMutateOpCodesToString); 31818 attachDebugGetter(opCodes.update, i18nUpdateOpCodesToString); 31819 } 31820 parseNodes(wrapper.firstChild, opCodes, parentIndex, nestedIcus, tIcus, expandoStartIndex); 31821 return opCodes; 31822} 31823/** 31824 * Breaks pattern into strings and top level {...} blocks. 31825 * Can be used to break a message into text and ICU expressions, or to break an ICU expression into 31826 * keys and cases. 31827 * Original code from closure library, modified for Angular. 31828 * 31829 * @param pattern (sub)Pattern to be broken. 31830 * 31831 */ 31832function extractParts(pattern) { 31833 if (!pattern) { 31834 return []; 31835 } 31836 let prevPos = 0; 31837 const braceStack = []; 31838 const results = []; 31839 const braces = /[{}]/g; 31840 // lastIndex doesn't get set to 0 so we have to. 31841 braces.lastIndex = 0; 31842 let match; 31843 while (match = braces.exec(pattern)) { 31844 const pos = match.index; 31845 if (match[0] == '}') { 31846 braceStack.pop(); 31847 if (braceStack.length == 0) { 31848 // End of the block. 31849 const block = pattern.substring(prevPos, pos); 31850 if (ICU_BLOCK_REGEXP.test(block)) { 31851 results.push(parseICUBlock(block)); 31852 } 31853 else { 31854 results.push(block); 31855 } 31856 prevPos = pos + 1; 31857 } 31858 } 31859 else { 31860 if (braceStack.length == 0) { 31861 const substring = pattern.substring(prevPos, pos); 31862 results.push(substring); 31863 prevPos = pos + 1; 31864 } 31865 braceStack.push('{'); 31866 } 31867 } 31868 const substring = pattern.substring(prevPos); 31869 results.push(substring); 31870 return results; 31871} 31872/** 31873 * Parses a node, its children and its siblings, and generates the mutate & update OpCodes. 31874 * 31875 * @param currentNode The first node to parse 31876 * @param icuCase The data for the ICU expression case that contains those nodes 31877 * @param parentIndex Index of the current node's parent 31878 * @param nestedIcus Data for the nested ICU expressions that this case contains 31879 * @param tIcus Data for all ICU expressions of the current message 31880 * @param expandoStartIndex Expando start index for the current ICU expression 31881 */ 31882function parseNodes(currentNode, icuCase, parentIndex, nestedIcus, tIcus, expandoStartIndex) { 31883 if (currentNode) { 31884 const nestedIcusToCreate = []; 31885 while (currentNode) { 31886 const nextNode = currentNode.nextSibling; 31887 const newIndex = expandoStartIndex + ++icuCase.vars; 31888 switch (currentNode.nodeType) { 31889 case Node.ELEMENT_NODE: 31890 const element = currentNode; 31891 const tagName = element.tagName.toLowerCase(); 31892 if (!VALID_ELEMENTS.hasOwnProperty(tagName)) { 31893 // This isn't a valid element, we won't create an element for it 31894 icuCase.vars--; 31895 } 31896 else { 31897 icuCase.create.push(ELEMENT_MARKER, tagName, newIndex, parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */); 31898 const elAttrs = element.attributes; 31899 for (let i = 0; i < elAttrs.length; i++) { 31900 const attr = elAttrs.item(i); 31901 const lowerAttrName = attr.name.toLowerCase(); 31902 const hasBinding = !!attr.value.match(BINDING_REGEXP); 31903 // we assume the input string is safe, unless it's using a binding 31904 if (hasBinding) { 31905 if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) { 31906 if (URI_ATTRS[lowerAttrName]) { 31907 addAllToArray(generateBindingUpdateOpCodes(attr.value, newIndex, attr.name, _sanitizeUrl), icuCase.update); 31908 } 31909 else if (SRCSET_ATTRS[lowerAttrName]) { 31910 addAllToArray(generateBindingUpdateOpCodes(attr.value, newIndex, attr.name, sanitizeSrcset), icuCase.update); 31911 } 31912 else { 31913 addAllToArray(generateBindingUpdateOpCodes(attr.value, newIndex, attr.name), icuCase.update); 31914 } 31915 } 31916 else { 31917 ngDevMode && 31918 console.warn(`WARNING: ignoring unsafe attribute value ${lowerAttrName} on element ${tagName} (see http://g.co/ng/security#xss)`); 31919 } 31920 } 31921 else { 31922 icuCase.create.push(newIndex << 3 /* SHIFT_REF */ | 4 /* Attr */, attr.name, attr.value); 31923 } 31924 } 31925 // Parse the children of this node (if any) 31926 parseNodes(currentNode.firstChild, icuCase, newIndex, nestedIcus, tIcus, expandoStartIndex); 31927 // Remove the parent node after the children 31928 icuCase.remove.push(newIndex << 3 /* SHIFT_REF */ | 3 /* Remove */); 31929 } 31930 break; 31931 case Node.TEXT_NODE: 31932 const value = currentNode.textContent || ''; 31933 const hasBinding = value.match(BINDING_REGEXP); 31934 icuCase.create.push(hasBinding ? '' : value, newIndex, parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */); 31935 icuCase.remove.push(newIndex << 3 /* SHIFT_REF */ | 3 /* Remove */); 31936 if (hasBinding) { 31937 addAllToArray(generateBindingUpdateOpCodes(value, newIndex), icuCase.update); 31938 } 31939 break; 31940 case Node.COMMENT_NODE: 31941 // Check if the comment node is a placeholder for a nested ICU 31942 const match = NESTED_ICU.exec(currentNode.textContent || ''); 31943 if (match) { 31944 const nestedIcuIndex = parseInt(match[1], 10); 31945 const newLocal = ngDevMode ? `nested ICU ${nestedIcuIndex}` : ''; 31946 // Create the comment node that will anchor the ICU expression 31947 icuCase.create.push(COMMENT_MARKER, newLocal, newIndex, parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */); 31948 const nestedIcu = nestedIcus[nestedIcuIndex]; 31949 nestedIcusToCreate.push([nestedIcu, newIndex]); 31950 } 31951 else { 31952 // We do not handle any other type of comment 31953 icuCase.vars--; 31954 } 31955 break; 31956 default: 31957 // We do not handle any other type of element 31958 icuCase.vars--; 31959 } 31960 currentNode = nextNode; 31961 } 31962 for (let i = 0; i < nestedIcusToCreate.length; i++) { 31963 const nestedIcu = nestedIcusToCreate[i][0]; 31964 const nestedIcuNodeIndex = nestedIcusToCreate[i][1]; 31965 icuStart(tIcus, nestedIcu, nestedIcuNodeIndex, expandoStartIndex + icuCase.vars); 31966 // Since this is recursive, the last TIcu that was pushed is the one we want 31967 const nestTIcuIndex = tIcus.length - 1; 31968 icuCase.vars += Math.max(...tIcus[nestTIcuIndex].vars); 31969 icuCase.childIcus.push(nestTIcuIndex); 31970 const mask = getBindingMask(nestedIcu); 31971 icuCase.update.push(toMaskBit(nestedIcu.mainBinding), // mask of the main binding 31972 3, // skip 3 opCodes if not changed 31973 -1 - nestedIcu.mainBinding, nestedIcuNodeIndex << 2 /* SHIFT_REF */ | 2 /* IcuSwitch */, 31974 // FIXME(misko): Index should be part of the opcode 31975 nestTIcuIndex, mask, // mask of all the bindings of this ICU expression 31976 2, // skip 2 opCodes if not changed 31977 nestedIcuNodeIndex << 2 /* SHIFT_REF */ | 3 /* IcuUpdate */, nestTIcuIndex); 31978 icuCase.remove.push(nestTIcuIndex << 3 /* SHIFT_REF */ | 6 /* RemoveNestedIcu */, 31979 // FIXME(misko): Index should be part of the opcode 31980 nestedIcuNodeIndex << 3 /* SHIFT_REF */ | 3 /* Remove */); 31981 } 31982 } 31983} 31984 31985/** 31986 * @license 31987 * Copyright Google LLC All Rights Reserved. 31988 * 31989 * Use of this source code is governed by an MIT-style license that can be 31990 * found in the LICENSE file at https://angular.io/license 31991 */ 31992// i18nPostprocess consts 31993const ROOT_TEMPLATE_ID = 0; 31994const PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]/; 31995const PP_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]|(�\/?\*\d+:\d+�)/g; 31996const PP_ICU_VARS_REGEXP = /({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g; 31997const PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g; 31998const PP_ICUS_REGEXP = /�I18N_EXP_(ICU(_\d+)?)�/g; 31999const PP_CLOSE_TEMPLATE_REGEXP = /\/\*/; 32000const PP_TEMPLATE_ID_REGEXP = /\d+\:(\d+)/; 32001/** 32002 * Handles message string post-processing for internationalization. 32003 * 32004 * Handles message string post-processing by transforming it from intermediate 32005 * format (that might contain some markers that we need to replace) to the final 32006 * form, consumable by i18nStart instruction. Post processing steps include: 32007 * 32008 * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�]) 32009 * 2. Replace all ICU vars (like "VAR_PLURAL") 32010 * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER} 32011 * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�) 32012 * in case multiple ICUs have the same placeholder name 32013 * 32014 * @param message Raw translation string for post processing 32015 * @param replacements Set of replacements that should be applied 32016 * 32017 * @returns Transformed string that can be consumed by i18nStart instruction 32018 * 32019 * @codeGenApi 32020 */ 32021function i18nPostprocess(message, replacements = {}) { 32022 /** 32023 * Step 1: resolve all multi-value placeholders like [�#5�|�*1:1��#2:1�|�#4:1�] 32024 * 32025 * Note: due to the way we process nested templates (BFS), multi-value placeholders are typically 32026 * grouped by templates, for example: [�#5�|�#6�|�#1:1�|�#3:2�] where �#5� and �#6� belong to root 32027 * template, �#1:1� belong to nested template with index 1 and �#1:2� - nested template with index 32028 * 3. However in real templates the order might be different: i.e. �#1:1� and/or �#3:2� may go in 32029 * front of �#6�. The post processing step restores the right order by keeping track of the 32030 * template id stack and looks for placeholders that belong to the currently active template. 32031 */ 32032 let result = message; 32033 if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) { 32034 const matches = {}; 32035 const templateIdsStack = [ROOT_TEMPLATE_ID]; 32036 result = result.replace(PP_PLACEHOLDERS_REGEXP, (m, phs, tmpl) => { 32037 const content = phs || tmpl; 32038 const placeholders = matches[content] || []; 32039 if (!placeholders.length) { 32040 content.split('|').forEach((placeholder) => { 32041 const match = placeholder.match(PP_TEMPLATE_ID_REGEXP); 32042 const templateId = match ? parseInt(match[1], 10) : ROOT_TEMPLATE_ID; 32043 const isCloseTemplateTag = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder); 32044 placeholders.push([templateId, isCloseTemplateTag, placeholder]); 32045 }); 32046 matches[content] = placeholders; 32047 } 32048 if (!placeholders.length) { 32049 throw new Error(`i18n postprocess: unmatched placeholder - ${content}`); 32050 } 32051 const currentTemplateId = templateIdsStack[templateIdsStack.length - 1]; 32052 let idx = 0; 32053 // find placeholder index that matches current template id 32054 for (let i = 0; i < placeholders.length; i++) { 32055 if (placeholders[i][0] === currentTemplateId) { 32056 idx = i; 32057 break; 32058 } 32059 } 32060 // update template id stack based on the current tag extracted 32061 const [templateId, isCloseTemplateTag, placeholder] = placeholders[idx]; 32062 if (isCloseTemplateTag) { 32063 templateIdsStack.pop(); 32064 } 32065 else if (currentTemplateId !== templateId) { 32066 templateIdsStack.push(templateId); 32067 } 32068 // remove processed tag from the list 32069 placeholders.splice(idx, 1); 32070 return placeholder; 32071 }); 32072 } 32073 // return current result if no replacements specified 32074 if (!Object.keys(replacements).length) { 32075 return result; 32076 } 32077 /** 32078 * Step 2: replace all ICU vars (like "VAR_PLURAL") 32079 */ 32080 result = result.replace(PP_ICU_VARS_REGEXP, (match, start, key, _type, _idx, end) => { 32081 return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match; 32082 }); 32083 /** 32084 * Step 3: replace all placeholders used inside ICUs in a form of {PLACEHOLDER} 32085 */ 32086 result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, (match, key) => { 32087 return replacements.hasOwnProperty(key) ? replacements[key] : match; 32088 }); 32089 /** 32090 * Step 4: replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�) in case 32091 * multiple ICUs have the same placeholder name 32092 */ 32093 result = result.replace(PP_ICUS_REGEXP, (match, key) => { 32094 if (replacements.hasOwnProperty(key)) { 32095 const list = replacements[key]; 32096 if (!list.length) { 32097 throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`); 32098 } 32099 return list.shift(); 32100 } 32101 return match; 32102 }); 32103 return result; 32104} 32105 32106/** 32107 * @license 32108 * Copyright Google LLC All Rights Reserved. 32109 * 32110 * Use of this source code is governed by an MIT-style license that can be 32111 * found in the LICENSE file at https://angular.io/license 32112 */ 32113/** 32114 * Marks a block of text as translatable. 32115 * 32116 * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template. 32117 * The translation `message` is the value which is locale specific. The translation string may 32118 * contain placeholders which associate inner elements and sub-templates within the translation. 32119 * 32120 * The translation `message` placeholders are: 32121 * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be 32122 * interpolated into. The placeholder `index` points to the expression binding index. An optional 32123 * `block` that matches the sub-template in which it was declared. 32124 * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning 32125 * and end of DOM element that were embedded in the original translation block. The placeholder 32126 * `index` points to the element index in the template instructions set. An optional `block` that 32127 * matches the sub-template in which it was declared. 32128 * - `�!{index}(:{block})�`/`�/!{index}(:{block})�`: *Projection Placeholder*: Marks the 32129 * beginning and end of <ng-content> that was embedded in the original translation block. 32130 * The placeholder `index` points to the element index in the template instructions set. 32131 * An optional `block` that matches the sub-template in which it was declared. 32132 * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be 32133 * split up and translated separately in each angular template function. The `index` points to the 32134 * `template` instruction index. A `block` that matches the sub-template in which it was declared. 32135 * 32136 * @param index A unique index of the translation in the static block. 32137 * @param message The translation message. 32138 * @param subTemplateIndex Optional sub-template index in the `message`. 32139 * 32140 * @codeGenApi 32141 */ 32142function ɵɵi18nStart(index, message, subTemplateIndex) { 32143 const tView = getTView(); 32144 ngDevMode && assertDefined(tView, `tView should be defined`); 32145 pushI18nIndex(index); 32146 // We need to delay projections until `i18nEnd` 32147 setDelayProjection(true); 32148 if (tView.firstCreatePass && tView.data[index + HEADER_OFFSET] === null) { 32149 i18nStartFirstPass(getLView(), tView, index, message, subTemplateIndex); 32150 } 32151} 32152/** 32153 * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes 32154 * into the render tree, moves the placeholder nodes and removes the deleted nodes. 32155 * 32156 * @codeGenApi 32157 */ 32158function ɵɵi18nEnd() { 32159 const lView = getLView(); 32160 const tView = getTView(); 32161 ngDevMode && assertDefined(tView, `tView should be defined`); 32162 i18nEndFirstPass(tView, lView); 32163 // Stop delaying projections 32164 setDelayProjection(false); 32165} 32166/** 32167 * 32168 * Use this instruction to create a translation block that doesn't contain any placeholder. 32169 * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction. 32170 * 32171 * The translation `message` is the value which is locale specific. The translation string may 32172 * contain placeholders which associate inner elements and sub-templates within the translation. 32173 * 32174 * The translation `message` placeholders are: 32175 * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be 32176 * interpolated into. The placeholder `index` points to the expression binding index. An optional 32177 * `block` that matches the sub-template in which it was declared. 32178 * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning 32179 * and end of DOM element that were embedded in the original translation block. The placeholder 32180 * `index` points to the element index in the template instructions set. An optional `block` that 32181 * matches the sub-template in which it was declared. 32182 * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be 32183 * split up and translated separately in each angular template function. The `index` points to the 32184 * `template` instruction index. A `block` that matches the sub-template in which it was declared. 32185 * 32186 * @param index A unique index of the translation in the static block. 32187 * @param message The translation message. 32188 * @param subTemplateIndex Optional sub-template index in the `message`. 32189 * 32190 * @codeGenApi 32191 */ 32192function ɵɵi18n(index, message, subTemplateIndex) { 32193 ɵɵi18nStart(index, message, subTemplateIndex); 32194 ɵɵi18nEnd(); 32195} 32196/** 32197 * Marks a list of attributes as translatable. 32198 * 32199 * @param index A unique index in the static block 32200 * @param values 32201 * 32202 * @codeGenApi 32203 */ 32204function ɵɵi18nAttributes(index, values) { 32205 const lView = getLView(); 32206 const tView = getTView(); 32207 ngDevMode && assertDefined(tView, `tView should be defined`); 32208 i18nAttributesFirstPass(lView, tView, index, values); 32209} 32210/** 32211 * Stores the values of the bindings during each update cycle in order to determine if we need to 32212 * update the translated nodes. 32213 * 32214 * @param value The binding's value 32215 * @returns This function returns itself so that it may be chained 32216 * (e.g. `i18nExp(ctx.name)(ctx.title)`) 32217 * 32218 * @codeGenApi 32219 */ 32220function ɵɵi18nExp(value) { 32221 const lView = getLView(); 32222 setMaskBit(bindingUpdated(lView, nextBindingIndex(), value)); 32223 return ɵɵi18nExp; 32224} 32225/** 32226 * Updates a translation block or an i18n attribute when the bindings have changed. 32227 * 32228 * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes} 32229 * (i18n attribute) on which it should update the content. 32230 * 32231 * @codeGenApi 32232 */ 32233function ɵɵi18nApply(index) { 32234 applyI18n(getTView(), getLView(), index); 32235} 32236/** 32237 * Handles message string post-processing for internationalization. 32238 * 32239 * Handles message string post-processing by transforming it from intermediate 32240 * format (that might contain some markers that we need to replace) to the final 32241 * form, consumable by i18nStart instruction. Post processing steps include: 32242 * 32243 * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�]) 32244 * 2. Replace all ICU vars (like "VAR_PLURAL") 32245 * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER} 32246 * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�) 32247 * in case multiple ICUs have the same placeholder name 32248 * 32249 * @param message Raw translation string for post processing 32250 * @param replacements Set of replacements that should be applied 32251 * 32252 * @returns Transformed string that can be consumed by i18nStart instruction 32253 * 32254 * @codeGenApi 32255 */ 32256function ɵɵi18nPostprocess(message, replacements = {}) { 32257 return i18nPostprocess(message, replacements); 32258} 32259 32260/** 32261 * @license 32262 * Copyright Google LLC All Rights Reserved. 32263 * 32264 * Use of this source code is governed by an MIT-style license that can be 32265 * found in the LICENSE file at https://angular.io/license 32266 */ 32267/** 32268 * Adds decorator, constructor, and property metadata to a given type via static metadata fields 32269 * on the type. 32270 * 32271 * These metadata fields can later be read with Angular's `ReflectionCapabilities` API. 32272 * 32273 * Calls to `setClassMetadata` can be marked as pure, resulting in the metadata assignments being 32274 * tree-shaken away during production builds. 32275 */ 32276function setClassMetadata(type, decorators, ctorParameters, propDecorators) { 32277 return noSideEffects(() => { 32278 const clazz = type; 32279 // We determine whether a class has its own metadata by taking the metadata from the 32280 // parent constructor and checking whether it's the same as the subclass metadata below. 32281 // We can't use `hasOwnProperty` here because it doesn't work correctly in IE10 for 32282 // static fields that are defined by TS. See 32283 // https://github.com/angular/angular/pull/28439#issuecomment-459349218. 32284 const parentPrototype = clazz.prototype ? Object.getPrototypeOf(clazz.prototype) : null; 32285 const parentConstructor = parentPrototype && parentPrototype.constructor; 32286 if (decorators !== null) { 32287 if (clazz.decorators !== undefined && 32288 (!parentConstructor || parentConstructor.decorators !== clazz.decorators)) { 32289 clazz.decorators.push(...decorators); 32290 } 32291 else { 32292 clazz.decorators = decorators; 32293 } 32294 } 32295 if (ctorParameters !== null) { 32296 // Rather than merging, clobber the existing parameters. If other projects exist which 32297 // use tsickle-style annotations and reflect over them in the same way, this could 32298 // cause issues, but that is vanishingly unlikely. 32299 clazz.ctorParameters = ctorParameters; 32300 } 32301 if (propDecorators !== null) { 32302 // The property decorator objects are merged as it is possible different fields have 32303 // different decorator types. Decorators on individual fields are not merged, as it's 32304 // also incredibly unlikely that a field will be decorated both with an Angular 32305 // decorator and a non-Angular decorator that's also been downleveled. 32306 if (clazz.propDecorators !== undefined && 32307 (!parentConstructor || 32308 parentConstructor.propDecorators !== clazz.propDecorators)) { 32309 clazz.propDecorators = Object.assign(Object.assign({}, clazz.propDecorators), propDecorators); 32310 } 32311 else { 32312 clazz.propDecorators = propDecorators; 32313 } 32314 } 32315 }); 32316} 32317 32318/** 32319 * @license 32320 * Copyright Google LLC All Rights Reserved. 32321 * 32322 * Use of this source code is governed by an MIT-style license that can be 32323 * found in the LICENSE file at https://angular.io/license 32324 */ 32325/** 32326 * Map of module-id to the corresponding NgModule. 32327 * - In pre Ivy we track NgModuleFactory, 32328 * - In post Ivy we track the NgModuleType 32329 */ 32330const modules = new Map(); 32331/** 32332 * Registers a loaded module. Should only be called from generated NgModuleFactory code. 32333 * @publicApi 32334 */ 32335function registerModuleFactory(id, factory) { 32336 const existing = modules.get(id); 32337 assertSameOrNotExisting(id, existing && existing.moduleType, factory.moduleType); 32338 modules.set(id, factory); 32339} 32340function assertSameOrNotExisting(id, type, incoming) { 32341 if (type && type !== incoming) { 32342 throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`); 32343 } 32344} 32345function registerNgModuleType(ngModuleType) { 32346 if (ngModuleType.ɵmod.id !== null) { 32347 const id = ngModuleType.ɵmod.id; 32348 const existing = modules.get(id); 32349 assertSameOrNotExisting(id, existing, ngModuleType); 32350 modules.set(id, ngModuleType); 32351 } 32352 let imports = ngModuleType.ɵmod.imports; 32353 if (imports instanceof Function) { 32354 imports = imports(); 32355 } 32356 if (imports) { 32357 imports.forEach(i => registerNgModuleType(i)); 32358 } 32359} 32360function clearModulesForTest() { 32361 modules.clear(); 32362} 32363function getRegisteredNgModuleType(id) { 32364 return modules.get(id) || autoRegisterModuleById[id]; 32365} 32366 32367/** 32368 * @license 32369 * Copyright Google LLC All Rights Reserved. 32370 * 32371 * Use of this source code is governed by an MIT-style license that can be 32372 * found in the LICENSE file at https://angular.io/license 32373 */ 32374class NgModuleRef$1 extends NgModuleRef { 32375 constructor(ngModuleType, _parent) { 32376 super(); 32377 this._parent = _parent; 32378 // tslint:disable-next-line:require-internal-with-underscore 32379 this._bootstrapComponents = []; 32380 this.injector = this; 32381 this.destroyCbs = []; 32382 // When bootstrapping a module we have a dependency graph that looks like this: 32383 // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the 32384 // module being resolved tries to inject the ComponentFactoryResolver, it'll create a 32385 // circular dependency which will result in a runtime error, because the injector doesn't 32386 // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves 32387 // and providing it, rather than letting the injector resolve it. 32388 this.componentFactoryResolver = new ComponentFactoryResolver$1(this); 32389 const ngModuleDef = getNgModuleDef(ngModuleType); 32390 ngDevMode && 32391 assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`); 32392 const ngLocaleIdDef = getNgLocaleIdDef(ngModuleType); 32393 ngLocaleIdDef && setLocaleId(ngLocaleIdDef); 32394 this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap); 32395 this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [ 32396 { provide: NgModuleRef, useValue: this }, { 32397 provide: ComponentFactoryResolver, 32398 useValue: this.componentFactoryResolver 32399 } 32400 ], stringify(ngModuleType)); 32401 // We need to resolve the injector types separately from the injector creation, because 32402 // the module might be trying to use this ref in its contructor for DI which will cause a 32403 // circular error that will eventually error out, because the injector isn't created yet. 32404 this._r3Injector._resolveInjectorDefTypes(); 32405 this.instance = this.get(ngModuleType); 32406 } 32407 get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) { 32408 if (token === Injector || token === NgModuleRef || token === INJECTOR) { 32409 return this; 32410 } 32411 return this._r3Injector.get(token, notFoundValue, injectFlags); 32412 } 32413 destroy() { 32414 ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed'); 32415 const injector = this._r3Injector; 32416 !injector.destroyed && injector.destroy(); 32417 this.destroyCbs.forEach(fn => fn()); 32418 this.destroyCbs = null; 32419 } 32420 onDestroy(callback) { 32421 ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed'); 32422 this.destroyCbs.push(callback); 32423 } 32424} 32425class NgModuleFactory$1 extends NgModuleFactory { 32426 constructor(moduleType) { 32427 super(); 32428 this.moduleType = moduleType; 32429 const ngModuleDef = getNgModuleDef(moduleType); 32430 if (ngModuleDef !== null) { 32431 // Register the NgModule with Angular's module registry. The location (and hence timing) of 32432 // this call is critical to ensure this works correctly (modules get registered when expected) 32433 // without bloating bundles (modules are registered when otherwise not referenced). 32434 // 32435 // In View Engine, registration occurs in the .ngfactory.js file as a side effect. This has 32436 // several practical consequences: 32437 // 32438 // - If an .ngfactory file is not imported from, the module won't be registered (and can be 32439 // tree shaken). 32440 // - If an .ngfactory file is imported from, the module will be registered even if an instance 32441 // is not actually created (via `create` below). 32442 // - Since an .ngfactory file in View Engine references the .ngfactory files of the NgModule's 32443 // imports, 32444 // 32445 // In Ivy, things are a bit different. .ngfactory files still exist for compatibility, but are 32446 // not a required API to use - there are other ways to obtain an NgModuleFactory for a given 32447 // NgModule. Thus, relying on a side effect in the .ngfactory file is not sufficient. Instead, 32448 // the side effect of registration is added here, in the constructor of NgModuleFactory, 32449 // ensuring no matter how a factory is created, the module is registered correctly. 32450 // 32451 // An alternative would be to include the registration side effect inline following the actual 32452 // NgModule definition. This also has the correct timing, but breaks tree-shaking - modules 32453 // will be registered and retained even if they're otherwise never referenced. 32454 registerNgModuleType(moduleType); 32455 } 32456 } 32457 create(parentInjector) { 32458 return new NgModuleRef$1(this.moduleType, parentInjector); 32459 } 32460} 32461 32462/** 32463 * @license 32464 * Copyright Google LLC All Rights Reserved. 32465 * 32466 * Use of this source code is governed by an MIT-style license that can be 32467 * found in the LICENSE file at https://angular.io/license 32468 */ 32469/** 32470 * Bindings for pure functions are stored after regular bindings. 32471 * 32472 * |-------decls------|---------vars---------| |----- hostVars (dir1) ------| 32473 * ------------------------------------------------------------------------------------------ 32474 * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots | 32475 * ------------------------------------------------------------------------------------------ 32476 * ^ ^ 32477 * TView.bindingStartIndex TView.expandoStartIndex 32478 * 32479 * Pure function instructions are given an offset from the binding root. Adding the offset to the 32480 * binding root gives the first index where the bindings are stored. In component views, the binding 32481 * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex + 32482 * any directive instances + any hostVars in directives evaluated before it. 32483 * 32484 * See VIEW_DATA.md for more information about host binding resolution. 32485 */ 32486/** 32487 * If the value hasn't been saved, calls the pure function to store and return the 32488 * value. If it has been saved, returns the saved value. 32489 * 32490 * @param slotOffset the offset from binding root to the reserved slot 32491 * @param pureFn Function that returns a value 32492 * @param thisArg Optional calling context of pureFn 32493 * @returns value 32494 * 32495 * @codeGenApi 32496 */ 32497function ɵɵpureFunction0(slotOffset, pureFn, thisArg) { 32498 const bindingIndex = getBindingRoot() + slotOffset; 32499 const lView = getLView(); 32500 return lView[bindingIndex] === NO_CHANGE ? 32501 updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) : 32502 getBinding(lView, bindingIndex); 32503} 32504/** 32505 * If the value of the provided exp has changed, calls the pure function to return 32506 * an updated value. Or if the value has not changed, returns cached value. 32507 * 32508 * @param slotOffset the offset from binding root to the reserved slot 32509 * @param pureFn Function that returns an updated value 32510 * @param exp Updated expression value 32511 * @param thisArg Optional calling context of pureFn 32512 * @returns Updated or cached value 32513 * 32514 * @codeGenApi 32515 */ 32516function ɵɵpureFunction1(slotOffset, pureFn, exp, thisArg) { 32517 return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg); 32518} 32519/** 32520 * If the value of any provided exp has changed, calls the pure function to return 32521 * an updated value. Or if no values have changed, returns cached value. 32522 * 32523 * @param slotOffset the offset from binding root to the reserved slot 32524 * @param pureFn 32525 * @param exp1 32526 * @param exp2 32527 * @param thisArg Optional calling context of pureFn 32528 * @returns Updated or cached value 32529 * 32530 * @codeGenApi 32531 */ 32532function ɵɵpureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) { 32533 return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg); 32534} 32535/** 32536 * If the value of any provided exp has changed, calls the pure function to return 32537 * an updated value. Or if no values have changed, returns cached value. 32538 * 32539 * @param slotOffset the offset from binding root to the reserved slot 32540 * @param pureFn 32541 * @param exp1 32542 * @param exp2 32543 * @param exp3 32544 * @param thisArg Optional calling context of pureFn 32545 * @returns Updated or cached value 32546 * 32547 * @codeGenApi 32548 */ 32549function ɵɵpureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) { 32550 return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg); 32551} 32552/** 32553 * If the value of any provided exp has changed, calls the pure function to return 32554 * an updated value. Or if no values have changed, returns cached value. 32555 * 32556 * @param slotOffset the offset from binding root to the reserved slot 32557 * @param pureFn 32558 * @param exp1 32559 * @param exp2 32560 * @param exp3 32561 * @param exp4 32562 * @param thisArg Optional calling context of pureFn 32563 * @returns Updated or cached value 32564 * 32565 * @codeGenApi 32566 */ 32567function ɵɵpureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) { 32568 return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg); 32569} 32570/** 32571 * If the value of any provided exp has changed, calls the pure function to return 32572 * an updated value. Or if no values have changed, returns cached value. 32573 * 32574 * @param slotOffset the offset from binding root to the reserved slot 32575 * @param pureFn 32576 * @param exp1 32577 * @param exp2 32578 * @param exp3 32579 * @param exp4 32580 * @param exp5 32581 * @param thisArg Optional calling context of pureFn 32582 * @returns Updated or cached value 32583 * 32584 * @codeGenApi 32585 */ 32586function ɵɵpureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) { 32587 const bindingIndex = getBindingRoot() + slotOffset; 32588 const lView = getLView(); 32589 const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4); 32590 return bindingUpdated(lView, bindingIndex + 4, exp5) || different ? 32591 updateBinding(lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) : 32592 pureFn(exp1, exp2, exp3, exp4, exp5)) : 32593 getBinding(lView, bindingIndex + 5); 32594} 32595/** 32596 * If the value of any provided exp has changed, calls the pure function to return 32597 * an updated value. Or if no values have changed, returns cached value. 32598 * 32599 * @param slotOffset the offset from binding root to the reserved slot 32600 * @param pureFn 32601 * @param exp1 32602 * @param exp2 32603 * @param exp3 32604 * @param exp4 32605 * @param exp5 32606 * @param exp6 32607 * @param thisArg Optional calling context of pureFn 32608 * @returns Updated or cached value 32609 * 32610 * @codeGenApi 32611 */ 32612function ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) { 32613 const bindingIndex = getBindingRoot() + slotOffset; 32614 const lView = getLView(); 32615 const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4); 32616 return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ? 32617 updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) : 32618 pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) : 32619 getBinding(lView, bindingIndex + 6); 32620} 32621/** 32622 * If the value of any provided exp has changed, calls the pure function to return 32623 * an updated value. Or if no values have changed, returns cached value. 32624 * 32625 * @param slotOffset the offset from binding root to the reserved slot 32626 * @param pureFn 32627 * @param exp1 32628 * @param exp2 32629 * @param exp3 32630 * @param exp4 32631 * @param exp5 32632 * @param exp6 32633 * @param exp7 32634 * @param thisArg Optional calling context of pureFn 32635 * @returns Updated or cached value 32636 * 32637 * @codeGenApi 32638 */ 32639function ɵɵpureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) { 32640 const bindingIndex = getBindingRoot() + slotOffset; 32641 const lView = getLView(); 32642 let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4); 32643 return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ? 32644 updateBinding(lView, bindingIndex + 7, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) : 32645 pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) : 32646 getBinding(lView, bindingIndex + 7); 32647} 32648/** 32649 * If the value of any provided exp has changed, calls the pure function to return 32650 * an updated value. Or if no values have changed, returns cached value. 32651 * 32652 * @param slotOffset the offset from binding root to the reserved slot 32653 * @param pureFn 32654 * @param exp1 32655 * @param exp2 32656 * @param exp3 32657 * @param exp4 32658 * @param exp5 32659 * @param exp6 32660 * @param exp7 32661 * @param exp8 32662 * @param thisArg Optional calling context of pureFn 32663 * @returns Updated or cached value 32664 * 32665 * @codeGenApi 32666 */ 32667function ɵɵpureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) { 32668 const bindingIndex = getBindingRoot() + slotOffset; 32669 const lView = getLView(); 32670 const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4); 32671 return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ? 32672 updateBinding(lView, bindingIndex + 8, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) : 32673 pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) : 32674 getBinding(lView, bindingIndex + 8); 32675} 32676/** 32677 * pureFunction instruction that can support any number of bindings. 32678 * 32679 * If the value of any provided exp has changed, calls the pure function to return 32680 * an updated value. Or if no values have changed, returns cached value. 32681 * 32682 * @param slotOffset the offset from binding root to the reserved slot 32683 * @param pureFn A pure function that takes binding values and builds an object or array 32684 * containing those values. 32685 * @param exps An array of binding values 32686 * @param thisArg Optional calling context of pureFn 32687 * @returns Updated or cached value 32688 * 32689 * @codeGenApi 32690 */ 32691function ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) { 32692 return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg); 32693} 32694/** 32695 * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized 32696 * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first 32697 * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE 32698 * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert 32699 * it to `undefined`. 32700 */ 32701function getPureFunctionReturnValue(lView, returnValueIndex) { 32702 ngDevMode && assertIndexInRange(lView, returnValueIndex); 32703 const lastReturnValue = lView[returnValueIndex]; 32704 return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue; 32705} 32706/** 32707 * If the value of the provided exp has changed, calls the pure function to return 32708 * an updated value. Or if the value has not changed, returns cached value. 32709 * 32710 * @param lView LView in which the function is being executed. 32711 * @param bindingRoot Binding root index. 32712 * @param slotOffset the offset from binding root to the reserved slot 32713 * @param pureFn Function that returns an updated value 32714 * @param exp Updated expression value 32715 * @param thisArg Optional calling context of pureFn 32716 * @returns Updated or cached value 32717 */ 32718function pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) { 32719 const bindingIndex = bindingRoot + slotOffset; 32720 return bindingUpdated(lView, bindingIndex, exp) ? 32721 updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) : 32722 getPureFunctionReturnValue(lView, bindingIndex + 1); 32723} 32724/** 32725 * If the value of any provided exp has changed, calls the pure function to return 32726 * an updated value. Or if no values have changed, returns cached value. 32727 * 32728 * @param lView LView in which the function is being executed. 32729 * @param bindingRoot Binding root index. 32730 * @param slotOffset the offset from binding root to the reserved slot 32731 * @param pureFn 32732 * @param exp1 32733 * @param exp2 32734 * @param thisArg Optional calling context of pureFn 32735 * @returns Updated or cached value 32736 */ 32737function pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) { 32738 const bindingIndex = bindingRoot + slotOffset; 32739 return bindingUpdated2(lView, bindingIndex, exp1, exp2) ? 32740 updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) : 32741 getPureFunctionReturnValue(lView, bindingIndex + 2); 32742} 32743/** 32744 * If the value of any provided exp has changed, calls the pure function to return 32745 * an updated value. Or if no values have changed, returns cached value. 32746 * 32747 * @param lView LView in which the function is being executed. 32748 * @param bindingRoot Binding root index. 32749 * @param slotOffset the offset from binding root to the reserved slot 32750 * @param pureFn 32751 * @param exp1 32752 * @param exp2 32753 * @param exp3 32754 * @param thisArg Optional calling context of pureFn 32755 * @returns Updated or cached value 32756 */ 32757function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) { 32758 const bindingIndex = bindingRoot + slotOffset; 32759 return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ? 32760 updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) : 32761 getPureFunctionReturnValue(lView, bindingIndex + 3); 32762} 32763/** 32764 * If the value of any provided exp has changed, calls the pure function to return 32765 * an updated value. Or if no values have changed, returns cached value. 32766 * 32767 * @param lView LView in which the function is being executed. 32768 * @param bindingRoot Binding root index. 32769 * @param slotOffset the offset from binding root to the reserved slot 32770 * @param pureFn 32771 * @param exp1 32772 * @param exp2 32773 * @param exp3 32774 * @param exp4 32775 * @param thisArg Optional calling context of pureFn 32776 * @returns Updated or cached value 32777 * 32778 */ 32779function pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) { 32780 const bindingIndex = bindingRoot + slotOffset; 32781 return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ? 32782 updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) : 32783 getPureFunctionReturnValue(lView, bindingIndex + 4); 32784} 32785/** 32786 * pureFunction instruction that can support any number of bindings. 32787 * 32788 * If the value of any provided exp has changed, calls the pure function to return 32789 * an updated value. Or if no values have changed, returns cached value. 32790 * 32791 * @param lView LView in which the function is being executed. 32792 * @param bindingRoot Binding root index. 32793 * @param slotOffset the offset from binding root to the reserved slot 32794 * @param pureFn A pure function that takes binding values and builds an object or array 32795 * containing those values. 32796 * @param exps An array of binding values 32797 * @param thisArg Optional calling context of pureFn 32798 * @returns Updated or cached value 32799 */ 32800function pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) { 32801 let bindingIndex = bindingRoot + slotOffset; 32802 let different = false; 32803 for (let i = 0; i < exps.length; i++) { 32804 bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true); 32805 } 32806 return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) : 32807 getPureFunctionReturnValue(lView, bindingIndex); 32808} 32809 32810/** 32811 * @license 32812 * Copyright Google LLC All Rights Reserved. 32813 * 32814 * Use of this source code is governed by an MIT-style license that can be 32815 * found in the LICENSE file at https://angular.io/license 32816 */ 32817/** 32818 * Create a pipe. 32819 * 32820 * @param index Pipe index where the pipe will be stored. 32821 * @param pipeName The name of the pipe 32822 * @returns T the instance of the pipe. 32823 * 32824 * @codeGenApi 32825 */ 32826function ɵɵpipe(index, pipeName) { 32827 const tView = getTView(); 32828 let pipeDef; 32829 const adjustedIndex = index + HEADER_OFFSET; 32830 if (tView.firstCreatePass) { 32831 pipeDef = getPipeDef$1(pipeName, tView.pipeRegistry); 32832 tView.data[adjustedIndex] = pipeDef; 32833 if (pipeDef.onDestroy) { 32834 (tView.destroyHooks || (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy); 32835 } 32836 } 32837 else { 32838 pipeDef = tView.data[adjustedIndex]; 32839 } 32840 const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true)); 32841 const previousInjectImplementation = setInjectImplementation(ɵɵdirectiveInject); 32842 // DI for pipes is supposed to behave like directives when placed on a component 32843 // host node, which means that we have to disable access to `viewProviders`. 32844 const previousIncludeViewProviders = setIncludeViewProviders(false); 32845 const pipeInstance = pipeFactory(); 32846 setIncludeViewProviders(previousIncludeViewProviders); 32847 setInjectImplementation(previousInjectImplementation); 32848 store(tView, getLView(), index, pipeInstance); 32849 return pipeInstance; 32850} 32851/** 32852 * Searches the pipe registry for a pipe with the given name. If one is found, 32853 * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved. 32854 * 32855 * @param name Name of pipe to resolve 32856 * @param registry Full list of available pipes 32857 * @returns Matching PipeDef 32858 */ 32859function getPipeDef$1(name, registry) { 32860 if (registry) { 32861 for (let i = registry.length - 1; i >= 0; i--) { 32862 const pipeDef = registry[i]; 32863 if (name === pipeDef.name) { 32864 return pipeDef; 32865 } 32866 } 32867 } 32868 throw new Error(`The pipe '${name}' could not be found!`); 32869} 32870/** 32871 * Invokes a pipe with 1 arguments. 32872 * 32873 * This instruction acts as a guard to {@link PipeTransform#transform} invoking 32874 * the pipe only when an input to the pipe changes. 32875 * 32876 * @param index Pipe index where the pipe was stored on creation. 32877 * @param slotOffset the offset in the reserved slot space 32878 * @param v1 1st argument to {@link PipeTransform#transform}. 32879 * 32880 * @codeGenApi 32881 */ 32882function ɵɵpipeBind1(index, slotOffset, v1) { 32883 const lView = getLView(); 32884 const pipeInstance = load(lView, index); 32885 return unwrapValue$1(lView, isPure(lView, index) ? 32886 pureFunction1Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, pipeInstance) : 32887 pipeInstance.transform(v1)); 32888} 32889/** 32890 * Invokes a pipe with 2 arguments. 32891 * 32892 * This instruction acts as a guard to {@link PipeTransform#transform} invoking 32893 * the pipe only when an input to the pipe changes. 32894 * 32895 * @param index Pipe index where the pipe was stored on creation. 32896 * @param slotOffset the offset in the reserved slot space 32897 * @param v1 1st argument to {@link PipeTransform#transform}. 32898 * @param v2 2nd argument to {@link PipeTransform#transform}. 32899 * 32900 * @codeGenApi 32901 */ 32902function ɵɵpipeBind2(index, slotOffset, v1, v2) { 32903 const lView = getLView(); 32904 const pipeInstance = load(lView, index); 32905 return unwrapValue$1(lView, isPure(lView, index) ? 32906 pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance) : 32907 pipeInstance.transform(v1, v2)); 32908} 32909/** 32910 * Invokes a pipe with 3 arguments. 32911 * 32912 * This instruction acts as a guard to {@link PipeTransform#transform} invoking 32913 * the pipe only when an input to the pipe changes. 32914 * 32915 * @param index Pipe index where the pipe was stored on creation. 32916 * @param slotOffset the offset in the reserved slot space 32917 * @param v1 1st argument to {@link PipeTransform#transform}. 32918 * @param v2 2nd argument to {@link PipeTransform#transform}. 32919 * @param v3 4rd argument to {@link PipeTransform#transform}. 32920 * 32921 * @codeGenApi 32922 */ 32923function ɵɵpipeBind3(index, slotOffset, v1, v2, v3) { 32924 const lView = getLView(); 32925 const pipeInstance = load(lView, index); 32926 return unwrapValue$1(lView, isPure(lView, index) ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) : 32927 pipeInstance.transform(v1, v2, v3)); 32928} 32929/** 32930 * Invokes a pipe with 4 arguments. 32931 * 32932 * This instruction acts as a guard to {@link PipeTransform#transform} invoking 32933 * the pipe only when an input to the pipe changes. 32934 * 32935 * @param index Pipe index where the pipe was stored on creation. 32936 * @param slotOffset the offset in the reserved slot space 32937 * @param v1 1st argument to {@link PipeTransform#transform}. 32938 * @param v2 2nd argument to {@link PipeTransform#transform}. 32939 * @param v3 3rd argument to {@link PipeTransform#transform}. 32940 * @param v4 4th argument to {@link PipeTransform#transform}. 32941 * 32942 * @codeGenApi 32943 */ 32944function ɵɵpipeBind4(index, slotOffset, v1, v2, v3, v4) { 32945 const lView = getLView(); 32946 const pipeInstance = load(lView, index); 32947 return unwrapValue$1(lView, isPure(lView, index) ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) : 32948 pipeInstance.transform(v1, v2, v3, v4)); 32949} 32950/** 32951 * Invokes a pipe with variable number of arguments. 32952 * 32953 * This instruction acts as a guard to {@link PipeTransform#transform} invoking 32954 * the pipe only when an input to the pipe changes. 32955 * 32956 * @param index Pipe index where the pipe was stored on creation. 32957 * @param slotOffset the offset in the reserved slot space 32958 * @param values Array of arguments to pass to {@link PipeTransform#transform} method. 32959 * 32960 * @codeGenApi 32961 */ 32962function ɵɵpipeBindV(index, slotOffset, values) { 32963 const lView = getLView(); 32964 const pipeInstance = load(lView, index); 32965 return unwrapValue$1(lView, isPure(lView, index) ? 32966 pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance) : 32967 pipeInstance.transform.apply(pipeInstance, values)); 32968} 32969function isPure(lView, index) { 32970 return lView[TVIEW].data[index + HEADER_OFFSET].pure; 32971} 32972/** 32973 * Unwrap the output of a pipe transformation. 32974 * In order to trick change detection into considering that the new value is always different from 32975 * the old one, the old value is overwritten by NO_CHANGE. 32976 * 32977 * @param newValue the pipe transformation output. 32978 */ 32979function unwrapValue$1(lView, newValue) { 32980 if (WrappedValue.isWrapped(newValue)) { 32981 newValue = WrappedValue.unwrap(newValue); 32982 // The NO_CHANGE value needs to be written at the index where the impacted binding value is 32983 // stored 32984 const bindingToInvalidateIdx = getBindingIndex(); 32985 lView[bindingToInvalidateIdx] = NO_CHANGE; 32986 } 32987 return newValue; 32988} 32989 32990/** 32991 * @license 32992 * Copyright Google LLC All Rights Reserved. 32993 * 32994 * Use of this source code is governed by an MIT-style license that can be 32995 * found in the LICENSE file at https://angular.io/license 32996 */ 32997class EventEmitter_ extends rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"] { 32998 constructor(isAsync = false) { 32999 super(); 33000 this.__isAsync = isAsync; 33001 } 33002 emit(value) { 33003 super.next(value); 33004 } 33005 subscribe(generatorOrNext, error, complete) { 33006 let schedulerFn; 33007 let errorFn = (err) => null; 33008 let completeFn = () => null; 33009 if (generatorOrNext && typeof generatorOrNext === 'object') { 33010 schedulerFn = this.__isAsync ? (value) => { 33011 setTimeout(() => generatorOrNext.next(value)); 33012 } : (value) => { 33013 generatorOrNext.next(value); 33014 }; 33015 if (generatorOrNext.error) { 33016 errorFn = this.__isAsync ? (err) => { 33017 setTimeout(() => generatorOrNext.error(err)); 33018 } : (err) => { 33019 generatorOrNext.error(err); 33020 }; 33021 } 33022 if (generatorOrNext.complete) { 33023 completeFn = this.__isAsync ? () => { 33024 setTimeout(() => generatorOrNext.complete()); 33025 } : () => { 33026 generatorOrNext.complete(); 33027 }; 33028 } 33029 } 33030 else { 33031 schedulerFn = this.__isAsync ? (value) => { 33032 setTimeout(() => generatorOrNext(value)); 33033 } : (value) => { 33034 generatorOrNext(value); 33035 }; 33036 if (error) { 33037 errorFn = this.__isAsync ? (err) => { 33038 setTimeout(() => error(err)); 33039 } : (err) => { 33040 error(err); 33041 }; 33042 } 33043 if (complete) { 33044 completeFn = this.__isAsync ? () => { 33045 setTimeout(() => complete()); 33046 } : () => { 33047 complete(); 33048 }; 33049 } 33050 } 33051 const sink = super.subscribe(schedulerFn, errorFn, completeFn); 33052 if (generatorOrNext instanceof rxjs__WEBPACK_IMPORTED_MODULE_0__["Subscription"]) { 33053 generatorOrNext.add(sink); 33054 } 33055 return sink; 33056 } 33057} 33058/** 33059 * @publicApi 33060 */ 33061const EventEmitter = EventEmitter_; 33062 33063/** 33064 * @license 33065 * Copyright Google LLC All Rights Reserved. 33066 * 33067 * Use of this source code is governed by an MIT-style license that can be 33068 * found in the LICENSE file at https://angular.io/license 33069 */ 33070function symbolIterator() { 33071 return this._results[getSymbolIterator()](); 33072} 33073/** 33074 * An unmodifiable list of items that Angular keeps up to date when the state 33075 * of the application changes. 33076 * 33077 * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList} 33078 * provide. 33079 * 33080 * Implements an iterable interface, therefore it can be used in both ES6 33081 * javascript `for (var i of items)` loops as well as in Angular templates with 33082 * `*ngFor="let i of myList"`. 33083 * 33084 * Changes can be observed by subscribing to the changes `Observable`. 33085 * 33086 * NOTE: In the future this class will implement an `Observable` interface. 33087 * 33088 * @usageNotes 33089 * ### Example 33090 * ```typescript 33091 * @Component({...}) 33092 * class Container { 33093 * @ViewChildren(Item) items:QueryList<Item>; 33094 * } 33095 * ``` 33096 * 33097 * @publicApi 33098 */ 33099class QueryList { 33100 constructor() { 33101 this.dirty = true; 33102 this._results = []; 33103 this.changes = new EventEmitter(); 33104 this.length = 0; 33105 // This function should be declared on the prototype, but doing so there will cause the class 33106 // declaration to have side-effects and become not tree-shakable. For this reason we do it in 33107 // the constructor. 33108 // [getSymbolIterator()](): Iterator<T> { ... } 33109 const symbol = getSymbolIterator(); 33110 const proto = QueryList.prototype; 33111 if (!proto[symbol]) 33112 proto[symbol] = symbolIterator; 33113 } 33114 /** 33115 * See 33116 * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) 33117 */ 33118 map(fn) { 33119 return this._results.map(fn); 33120 } 33121 /** 33122 * See 33123 * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) 33124 */ 33125 filter(fn) { 33126 return this._results.filter(fn); 33127 } 33128 /** 33129 * See 33130 * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) 33131 */ 33132 find(fn) { 33133 return this._results.find(fn); 33134 } 33135 /** 33136 * See 33137 * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) 33138 */ 33139 reduce(fn, init) { 33140 return this._results.reduce(fn, init); 33141 } 33142 /** 33143 * See 33144 * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) 33145 */ 33146 forEach(fn) { 33147 this._results.forEach(fn); 33148 } 33149 /** 33150 * See 33151 * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) 33152 */ 33153 some(fn) { 33154 return this._results.some(fn); 33155 } 33156 /** 33157 * Returns a copy of the internal results list as an Array. 33158 */ 33159 toArray() { 33160 return this._results.slice(); 33161 } 33162 toString() { 33163 return this._results.toString(); 33164 } 33165 /** 33166 * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that 33167 * on change detection, it will not notify of changes to the queries, unless a new change 33168 * occurs. 33169 * 33170 * @param resultsTree The query results to store 33171 */ 33172 reset(resultsTree) { 33173 this._results = flatten(resultsTree); 33174 this.dirty = false; 33175 this.length = this._results.length; 33176 this.last = this._results[this.length - 1]; 33177 this.first = this._results[0]; 33178 } 33179 /** 33180 * Triggers a change event by emitting on the `changes` {@link EventEmitter}. 33181 */ 33182 notifyOnChanges() { 33183 this.changes.emit(this); 33184 } 33185 /** internal */ 33186 setDirty() { 33187 this.dirty = true; 33188 } 33189 /** internal */ 33190 destroy() { 33191 this.changes.complete(); 33192 this.changes.unsubscribe(); 33193 } 33194} 33195 33196/** 33197 * @license 33198 * Copyright Google LLC All Rights Reserved. 33199 * 33200 * Use of this source code is governed by an MIT-style license that can be 33201 * found in the LICENSE file at https://angular.io/license 33202 */ 33203// Note: This hack is necessary so we don't erroneously get a circular dependency 33204// failure based on types. 33205const unusedValueExportToPlacateAjd$7 = 1; 33206 33207/** 33208 * @license 33209 * Copyright Google LLC All Rights Reserved. 33210 * 33211 * Use of this source code is governed by an MIT-style license that can be 33212 * found in the LICENSE file at https://angular.io/license 33213 */ 33214// Note: This hack is necessary so we don't erroneously get a circular dependency 33215// failure based on types. 33216const unusedValueExportToPlacateAjd$8 = 1; 33217 33218/** 33219 * @license 33220 * Copyright Google LLC All Rights Reserved. 33221 * 33222 * Use of this source code is governed by an MIT-style license that can be 33223 * found in the LICENSE file at https://angular.io/license 33224 */ 33225const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$8; 33226class LQuery_ { 33227 constructor(queryList) { 33228 this.queryList = queryList; 33229 this.matches = null; 33230 } 33231 clone() { 33232 return new LQuery_(this.queryList); 33233 } 33234 setDirty() { 33235 this.queryList.setDirty(); 33236 } 33237} 33238class LQueries_ { 33239 constructor(queries = []) { 33240 this.queries = queries; 33241 } 33242 createEmbeddedView(tView) { 33243 const tQueries = tView.queries; 33244 if (tQueries !== null) { 33245 const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length; 33246 const viewLQueries = []; 33247 // An embedded view has queries propagated from a declaration view at the beginning of the 33248 // TQueries collection and up until a first content query declared in the embedded view. Only 33249 // propagated LQueries are created at this point (LQuery corresponding to declared content 33250 // queries will be instantiated from the content query instructions for each directive). 33251 for (let i = 0; i < noOfInheritedQueries; i++) { 33252 const tQuery = tQueries.getByIndex(i); 33253 const parentLQuery = this.queries[tQuery.indexInDeclarationView]; 33254 viewLQueries.push(parentLQuery.clone()); 33255 } 33256 return new LQueries_(viewLQueries); 33257 } 33258 return null; 33259 } 33260 insertView(tView) { 33261 this.dirtyQueriesWithMatches(tView); 33262 } 33263 detachView(tView) { 33264 this.dirtyQueriesWithMatches(tView); 33265 } 33266 dirtyQueriesWithMatches(tView) { 33267 for (let i = 0; i < this.queries.length; i++) { 33268 if (getTQuery(tView, i).matches !== null) { 33269 this.queries[i].setDirty(); 33270 } 33271 } 33272 } 33273} 33274class TQueryMetadata_ { 33275 constructor(predicate, descendants, isStatic, read = null) { 33276 this.predicate = predicate; 33277 this.descendants = descendants; 33278 this.isStatic = isStatic; 33279 this.read = read; 33280 } 33281} 33282class TQueries_ { 33283 constructor(queries = []) { 33284 this.queries = queries; 33285 } 33286 elementStart(tView, tNode) { 33287 ngDevMode && 33288 assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only'); 33289 for (let i = 0; i < this.queries.length; i++) { 33290 this.queries[i].elementStart(tView, tNode); 33291 } 33292 } 33293 elementEnd(tNode) { 33294 for (let i = 0; i < this.queries.length; i++) { 33295 this.queries[i].elementEnd(tNode); 33296 } 33297 } 33298 embeddedTView(tNode) { 33299 let queriesForTemplateRef = null; 33300 for (let i = 0; i < this.length; i++) { 33301 const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0; 33302 const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex); 33303 if (tqueryClone) { 33304 tqueryClone.indexInDeclarationView = i; 33305 if (queriesForTemplateRef !== null) { 33306 queriesForTemplateRef.push(tqueryClone); 33307 } 33308 else { 33309 queriesForTemplateRef = [tqueryClone]; 33310 } 33311 } 33312 } 33313 return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) : null; 33314 } 33315 template(tView, tNode) { 33316 ngDevMode && 33317 assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only'); 33318 for (let i = 0; i < this.queries.length; i++) { 33319 this.queries[i].template(tView, tNode); 33320 } 33321 } 33322 getByIndex(index) { 33323 ngDevMode && assertIndexInRange(this.queries, index); 33324 return this.queries[index]; 33325 } 33326 get length() { 33327 return this.queries.length; 33328 } 33329 track(tquery) { 33330 this.queries.push(tquery); 33331 } 33332} 33333class TQuery_ { 33334 constructor(metadata, nodeIndex = -1) { 33335 this.metadata = metadata; 33336 this.matches = null; 33337 this.indexInDeclarationView = -1; 33338 this.crossesNgTemplate = false; 33339 /** 33340 * A flag indicating if a given query still applies to nodes it is crossing. We use this flag 33341 * (alongside with _declarationNodeIndex) to know when to stop applying content queries to 33342 * elements in a template. 33343 */ 33344 this._appliesToNextNode = true; 33345 this._declarationNodeIndex = nodeIndex; 33346 } 33347 elementStart(tView, tNode) { 33348 if (this.isApplyingToNode(tNode)) { 33349 this.matchTNode(tView, tNode); 33350 } 33351 } 33352 elementEnd(tNode) { 33353 if (this._declarationNodeIndex === tNode.index) { 33354 this._appliesToNextNode = false; 33355 } 33356 } 33357 template(tView, tNode) { 33358 this.elementStart(tView, tNode); 33359 } 33360 embeddedTView(tNode, childQueryIndex) { 33361 if (this.isApplyingToNode(tNode)) { 33362 this.crossesNgTemplate = true; 33363 // A marker indicating a `<ng-template>` element (a placeholder for query results from 33364 // embedded views created based on this `<ng-template>`). 33365 this.addMatch(-tNode.index, childQueryIndex); 33366 return new TQuery_(this.metadata); 33367 } 33368 return null; 33369 } 33370 isApplyingToNode(tNode) { 33371 if (this._appliesToNextNode && this.metadata.descendants === false) { 33372 const declarationNodeIdx = this._declarationNodeIndex; 33373 let parent = tNode.parent; 33374 // Determine if a given TNode is a "direct" child of a node on which a content query was 33375 // declared (only direct children of query's host node can match with the descendants: false 33376 // option). There are 3 main use-case / conditions to consider here: 33377 // - <needs-target><i #target></i></needs-target>: here <i #target> parent node is a query 33378 // host node; 33379 // - <needs-target><ng-template [ngIf]="true"><i #target></i></ng-template></needs-target>: 33380 // here <i #target> parent node is null; 33381 // - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need 33382 // to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse 33383 // up past the query's host node!). 33384 while (parent !== null && parent.type === 4 /* ElementContainer */ && 33385 parent.index !== declarationNodeIdx) { 33386 parent = parent.parent; 33387 } 33388 return declarationNodeIdx === (parent !== null ? parent.index : -1); 33389 } 33390 return this._appliesToNextNode; 33391 } 33392 matchTNode(tView, tNode) { 33393 const predicate = this.metadata.predicate; 33394 if (Array.isArray(predicate)) { 33395 for (let i = 0; i < predicate.length; i++) { 33396 const name = predicate[i]; 33397 this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name)); 33398 // Also try matching the name to a provider since strings can be used as DI tokens too. 33399 this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false)); 33400 } 33401 } 33402 else { 33403 if (predicate === TemplateRef) { 33404 if (tNode.type === 0 /* Container */) { 33405 this.matchTNodeWithReadOption(tView, tNode, -1); 33406 } 33407 } 33408 else { 33409 this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false)); 33410 } 33411 } 33412 } 33413 matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) { 33414 if (nodeMatchIdx !== null) { 33415 const read = this.metadata.read; 33416 if (read !== null) { 33417 if (read === ElementRef || read === ViewContainerRef || 33418 read === TemplateRef && tNode.type === 0 /* Container */) { 33419 this.addMatch(tNode.index, -2); 33420 } 33421 else { 33422 const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false); 33423 if (directiveOrProviderIdx !== null) { 33424 this.addMatch(tNode.index, directiveOrProviderIdx); 33425 } 33426 } 33427 } 33428 else { 33429 this.addMatch(tNode.index, nodeMatchIdx); 33430 } 33431 } 33432 } 33433 addMatch(tNodeIdx, matchIdx) { 33434 if (this.matches === null) { 33435 this.matches = [tNodeIdx, matchIdx]; 33436 } 33437 else { 33438 this.matches.push(tNodeIdx, matchIdx); 33439 } 33440 } 33441} 33442/** 33443 * Iterates over local names for a given node and returns directive index 33444 * (or -1 if a local name points to an element). 33445 * 33446 * @param tNode static data of a node to check 33447 * @param selector selector to match 33448 * @returns directive index, -1 or null if a selector didn't match any of the local names 33449 */ 33450function getIdxOfMatchingSelector(tNode, selector) { 33451 const localNames = tNode.localNames; 33452 if (localNames !== null) { 33453 for (let i = 0; i < localNames.length; i += 2) { 33454 if (localNames[i] === selector) { 33455 return localNames[i + 1]; 33456 } 33457 } 33458 } 33459 return null; 33460} 33461function createResultByTNodeType(tNode, currentView) { 33462 if (tNode.type === 3 /* Element */ || tNode.type === 4 /* ElementContainer */) { 33463 return createElementRef(ElementRef, tNode, currentView); 33464 } 33465 else if (tNode.type === 0 /* Container */) { 33466 return createTemplateRef(TemplateRef, ElementRef, tNode, currentView); 33467 } 33468 return null; 33469} 33470function createResultForNode(lView, tNode, matchingIdx, read) { 33471 if (matchingIdx === -1) { 33472 // if read token and / or strategy is not specified, detect it using appropriate tNode type 33473 return createResultByTNodeType(tNode, lView); 33474 } 33475 else if (matchingIdx === -2) { 33476 // read a special token from a node injector 33477 return createSpecialToken(lView, tNode, read); 33478 } 33479 else { 33480 // read a token 33481 return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode); 33482 } 33483} 33484function createSpecialToken(lView, tNode, read) { 33485 if (read === ElementRef) { 33486 return createElementRef(ElementRef, tNode, lView); 33487 } 33488 else if (read === TemplateRef) { 33489 return createTemplateRef(TemplateRef, ElementRef, tNode, lView); 33490 } 33491 else if (read === ViewContainerRef) { 33492 ngDevMode && 33493 assertNodeOfPossibleTypes(tNode, [3 /* Element */, 0 /* Container */, 4 /* ElementContainer */]); 33494 return createContainerRef(ViewContainerRef, ElementRef, tNode, lView); 33495 } 33496 else { 33497 ngDevMode && 33498 throwError(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`); 33499 } 33500} 33501/** 33502 * A helper function that creates query results for a given view. This function is meant to do the 33503 * processing once and only once for a given view instance (a set of results for a given view 33504 * doesn't change). 33505 */ 33506function materializeViewResults(tView, lView, tQuery, queryIndex) { 33507 const lQuery = lView[QUERIES].queries[queryIndex]; 33508 if (lQuery.matches === null) { 33509 const tViewData = tView.data; 33510 const tQueryMatches = tQuery.matches; 33511 const result = []; 33512 for (let i = 0; i < tQueryMatches.length; i += 2) { 33513 const matchedNodeIdx = tQueryMatches[i]; 33514 if (matchedNodeIdx < 0) { 33515 // we at the <ng-template> marker which might have results in views created based on this 33516 // <ng-template> - those results will be in separate views though, so here we just leave 33517 // null as a placeholder 33518 result.push(null); 33519 } 33520 else { 33521 ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx); 33522 const tNode = tViewData[matchedNodeIdx]; 33523 result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read)); 33524 } 33525 } 33526 lQuery.matches = result; 33527 } 33528 return lQuery.matches; 33529} 33530/** 33531 * A helper function that collects (already materialized) query results from a tree of views, 33532 * starting with a provided LView. 33533 */ 33534function collectQueryResults(tView, lView, queryIndex, result) { 33535 const tQuery = tView.queries.getByIndex(queryIndex); 33536 const tQueryMatches = tQuery.matches; 33537 if (tQueryMatches !== null) { 33538 const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex); 33539 for (let i = 0; i < tQueryMatches.length; i += 2) { 33540 const tNodeIdx = tQueryMatches[i]; 33541 if (tNodeIdx > 0) { 33542 result.push(lViewResults[i / 2]); 33543 } 33544 else { 33545 const childQueryIndex = tQueryMatches[i + 1]; 33546 const declarationLContainer = lView[-tNodeIdx]; 33547 ngDevMode && assertLContainer(declarationLContainer); 33548 // collect matches for views inserted in this container 33549 for (let i = CONTAINER_HEADER_OFFSET; i < declarationLContainer.length; i++) { 33550 const embeddedLView = declarationLContainer[i]; 33551 if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) { 33552 collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result); 33553 } 33554 } 33555 // collect matches for views created from this declaration container and inserted into 33556 // different containers 33557 if (declarationLContainer[MOVED_VIEWS] !== null) { 33558 const embeddedLViews = declarationLContainer[MOVED_VIEWS]; 33559 for (let i = 0; i < embeddedLViews.length; i++) { 33560 const embeddedLView = embeddedLViews[i]; 33561 collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result); 33562 } 33563 } 33564 } 33565 } 33566 } 33567 return result; 33568} 33569/** 33570 * Refreshes a query by combining matches from all active views and removing matches from deleted 33571 * views. 33572 * 33573 * @returns `true` if a query got dirty during change detection or if this is a static query 33574 * resolving in creation mode, `false` otherwise. 33575 * 33576 * @codeGenApi 33577 */ 33578function ɵɵqueryRefresh(queryList) { 33579 const lView = getLView(); 33580 const tView = getTView(); 33581 const queryIndex = getCurrentQueryIndex(); 33582 setCurrentQueryIndex(queryIndex + 1); 33583 const tQuery = getTQuery(tView, queryIndex); 33584 if (queryList.dirty && (isCreationMode(lView) === tQuery.metadata.isStatic)) { 33585 if (tQuery.matches === null) { 33586 queryList.reset([]); 33587 } 33588 else { 33589 const result = tQuery.crossesNgTemplate ? 33590 collectQueryResults(tView, lView, queryIndex, []) : 33591 materializeViewResults(tView, lView, tQuery, queryIndex); 33592 queryList.reset(result); 33593 queryList.notifyOnChanges(); 33594 } 33595 return true; 33596 } 33597 return false; 33598} 33599/** 33600 * Creates new QueryList for a static view query. 33601 * 33602 * @param predicate The type for which the query will search 33603 * @param descend Whether or not to descend into children 33604 * @param read What to save in the query 33605 * 33606 * @codeGenApi 33607 */ 33608function ɵɵstaticViewQuery(predicate, descend, read) { 33609 viewQueryInternal(getTView(), getLView(), predicate, descend, read, true); 33610} 33611/** 33612 * Creates new QueryList, stores the reference in LView and returns QueryList. 33613 * 33614 * @param predicate The type for which the query will search 33615 * @param descend Whether or not to descend into children 33616 * @param read What to save in the query 33617 * 33618 * @codeGenApi 33619 */ 33620function ɵɵviewQuery(predicate, descend, read) { 33621 viewQueryInternal(getTView(), getLView(), predicate, descend, read, false); 33622} 33623function viewQueryInternal(tView, lView, predicate, descend, read, isStatic) { 33624 if (tView.firstCreatePass) { 33625 createTQuery(tView, new TQueryMetadata_(predicate, descend, isStatic, read), -1); 33626 if (isStatic) { 33627 tView.staticViewQueries = true; 33628 } 33629 } 33630 createLQuery(tView, lView); 33631} 33632/** 33633 * Registers a QueryList, associated with a content query, for later refresh (part of a view 33634 * refresh). 33635 * 33636 * @param directiveIndex Current directive index 33637 * @param predicate The type for which the query will search 33638 * @param descend Whether or not to descend into children 33639 * @param read What to save in the query 33640 * @returns QueryList<T> 33641 * 33642 * @codeGenApi 33643 */ 33644function ɵɵcontentQuery(directiveIndex, predicate, descend, read) { 33645 contentQueryInternal(getTView(), getLView(), predicate, descend, read, false, getPreviousOrParentTNode(), directiveIndex); 33646} 33647/** 33648 * Registers a QueryList, associated with a static content query, for later refresh 33649 * (part of a view refresh). 33650 * 33651 * @param directiveIndex Current directive index 33652 * @param predicate The type for which the query will search 33653 * @param descend Whether or not to descend into children 33654 * @param read What to save in the query 33655 * @returns QueryList<T> 33656 * 33657 * @codeGenApi 33658 */ 33659function ɵɵstaticContentQuery(directiveIndex, predicate, descend, read) { 33660 contentQueryInternal(getTView(), getLView(), predicate, descend, read, true, getPreviousOrParentTNode(), directiveIndex); 33661} 33662function contentQueryInternal(tView, lView, predicate, descend, read, isStatic, tNode, directiveIndex) { 33663 if (tView.firstCreatePass) { 33664 createTQuery(tView, new TQueryMetadata_(predicate, descend, isStatic, read), tNode.index); 33665 saveContentQueryAndDirectiveIndex(tView, directiveIndex); 33666 if (isStatic) { 33667 tView.staticContentQueries = true; 33668 } 33669 } 33670 createLQuery(tView, lView); 33671} 33672/** 33673 * Loads a QueryList corresponding to the current view or content query. 33674 * 33675 * @codeGenApi 33676 */ 33677function ɵɵloadQuery() { 33678 return loadQueryInternal(getLView(), getCurrentQueryIndex()); 33679} 33680function loadQueryInternal(lView, queryIndex) { 33681 ngDevMode && 33682 assertDefined(lView[QUERIES], 'LQueries should be defined when trying to load a query'); 33683 ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex); 33684 return lView[QUERIES].queries[queryIndex].queryList; 33685} 33686function createLQuery(tView, lView) { 33687 const queryList = new QueryList(); 33688 storeCleanupWithContext(tView, lView, queryList, queryList.destroy); 33689 if (lView[QUERIES] === null) 33690 lView[QUERIES] = new LQueries_(); 33691 lView[QUERIES].queries.push(new LQuery_(queryList)); 33692} 33693function createTQuery(tView, metadata, nodeIndex) { 33694 if (tView.queries === null) 33695 tView.queries = new TQueries_(); 33696 tView.queries.track(new TQuery_(metadata, nodeIndex)); 33697} 33698function saveContentQueryAndDirectiveIndex(tView, directiveIndex) { 33699 const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []); 33700 const lastSavedDirectiveIndex = tView.contentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : -1; 33701 if (directiveIndex !== lastSavedDirectiveIndex) { 33702 tViewContentQueries.push(tView.queries.length - 1, directiveIndex); 33703 } 33704} 33705function getTQuery(tView, index) { 33706 ngDevMode && assertDefined(tView.queries, 'TQueries must be defined to retrieve a TQuery'); 33707 return tView.queries.getByIndex(index); 33708} 33709 33710/** 33711 * @license 33712 * Copyright Google LLC All Rights Reserved. 33713 * 33714 * Use of this source code is governed by an MIT-style license that can be 33715 * found in the LICENSE file at https://angular.io/license 33716 */ 33717/** 33718 * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the 33719 * `<ng-template>` element. 33720 * 33721 * @codeGenApi 33722 */ 33723function ɵɵtemplateRefExtractor(tNode, currentView) { 33724 return createTemplateRef(TemplateRef, ElementRef, tNode, currentView); 33725} 33726/** 33727 * Returns the appropriate `ChangeDetectorRef` for a pipe. 33728 * 33729 * @codeGenApi 33730 */ 33731function ɵɵinjectPipeChangeDetectorRef(flags = InjectFlags.Default) { 33732 const value = injectChangeDetectorRef(true); 33733 if (value == null && !(flags & InjectFlags.Optional)) { 33734 throw new Error(`No provider for ChangeDetectorRef!`); 33735 } 33736 else { 33737 return value; 33738 } 33739} 33740 33741/** 33742 * @license 33743 * Copyright Google LLC All Rights Reserved. 33744 * 33745 * Use of this source code is governed by an MIT-style license that can be 33746 * found in the LICENSE file at https://angular.io/license 33747 */ 33748 33749/** 33750 * @license 33751 * Copyright Google LLC All Rights Reserved. 33752 * 33753 * Use of this source code is governed by an MIT-style license that can be 33754 * found in the LICENSE file at https://angular.io/license 33755 */ 33756const ɵ0$d = () => ({ 33757 'ɵɵattribute': ɵɵattribute, 33758 'ɵɵattributeInterpolate1': ɵɵattributeInterpolate1, 33759 'ɵɵattributeInterpolate2': ɵɵattributeInterpolate2, 33760 'ɵɵattributeInterpolate3': ɵɵattributeInterpolate3, 33761 'ɵɵattributeInterpolate4': ɵɵattributeInterpolate4, 33762 'ɵɵattributeInterpolate5': ɵɵattributeInterpolate5, 33763 'ɵɵattributeInterpolate6': ɵɵattributeInterpolate6, 33764 'ɵɵattributeInterpolate7': ɵɵattributeInterpolate7, 33765 'ɵɵattributeInterpolate8': ɵɵattributeInterpolate8, 33766 'ɵɵattributeInterpolateV': ɵɵattributeInterpolateV, 33767 'ɵɵdefineComponent': ɵɵdefineComponent, 33768 'ɵɵdefineDirective': ɵɵdefineDirective, 33769 'ɵɵdefineInjectable': ɵɵdefineInjectable, 33770 'ɵɵdefineInjector': ɵɵdefineInjector, 33771 'ɵɵdefineNgModule': ɵɵdefineNgModule, 33772 'ɵɵdefinePipe': ɵɵdefinePipe, 33773 'ɵɵdirectiveInject': ɵɵdirectiveInject, 33774 'ɵɵgetFactoryOf': ɵɵgetFactoryOf, 33775 'ɵɵgetInheritedFactory': ɵɵgetInheritedFactory, 33776 'ɵɵinject': ɵɵinject, 33777 'ɵɵinjectAttribute': ɵɵinjectAttribute, 33778 'ɵɵinvalidFactory': ɵɵinvalidFactory, 33779 'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep, 33780 'ɵɵinjectPipeChangeDetectorRef': ɵɵinjectPipeChangeDetectorRef, 33781 'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor, 33782 'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature, 33783 'ɵɵProvidersFeature': ɵɵProvidersFeature, 33784 'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature, 33785 'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature, 33786 'ɵɵnextContext': ɵɵnextContext, 33787 'ɵɵnamespaceHTML': ɵɵnamespaceHTML, 33788 'ɵɵnamespaceMathML': ɵɵnamespaceMathML, 33789 'ɵɵnamespaceSVG': ɵɵnamespaceSVG, 33790 'ɵɵenableBindings': ɵɵenableBindings, 33791 'ɵɵdisableBindings': ɵɵdisableBindings, 33792 'ɵɵelementStart': ɵɵelementStart, 33793 'ɵɵelementEnd': ɵɵelementEnd, 33794 'ɵɵelement': ɵɵelement, 33795 'ɵɵelementContainerStart': ɵɵelementContainerStart, 33796 'ɵɵelementContainerEnd': ɵɵelementContainerEnd, 33797 'ɵɵelementContainer': ɵɵelementContainer, 33798 'ɵɵpureFunction0': ɵɵpureFunction0, 33799 'ɵɵpureFunction1': ɵɵpureFunction1, 33800 'ɵɵpureFunction2': ɵɵpureFunction2, 33801 'ɵɵpureFunction3': ɵɵpureFunction3, 33802 'ɵɵpureFunction4': ɵɵpureFunction4, 33803 'ɵɵpureFunction5': ɵɵpureFunction5, 33804 'ɵɵpureFunction6': ɵɵpureFunction6, 33805 'ɵɵpureFunction7': ɵɵpureFunction7, 33806 'ɵɵpureFunction8': ɵɵpureFunction8, 33807 'ɵɵpureFunctionV': ɵɵpureFunctionV, 33808 'ɵɵgetCurrentView': ɵɵgetCurrentView, 33809 'ɵɵrestoreView': ɵɵrestoreView, 33810 'ɵɵlistener': ɵɵlistener, 33811 'ɵɵprojection': ɵɵprojection, 33812 'ɵɵsyntheticHostProperty': ɵɵsyntheticHostProperty, 33813 'ɵɵsyntheticHostListener': ɵɵsyntheticHostListener, 33814 'ɵɵpipeBind1': ɵɵpipeBind1, 33815 'ɵɵpipeBind2': ɵɵpipeBind2, 33816 'ɵɵpipeBind3': ɵɵpipeBind3, 33817 'ɵɵpipeBind4': ɵɵpipeBind4, 33818 'ɵɵpipeBindV': ɵɵpipeBindV, 33819 'ɵɵprojectionDef': ɵɵprojectionDef, 33820 'ɵɵhostProperty': ɵɵhostProperty, 33821 'ɵɵproperty': ɵɵproperty, 33822 'ɵɵpropertyInterpolate': ɵɵpropertyInterpolate, 33823 'ɵɵpropertyInterpolate1': ɵɵpropertyInterpolate1, 33824 'ɵɵpropertyInterpolate2': ɵɵpropertyInterpolate2, 33825 'ɵɵpropertyInterpolate3': ɵɵpropertyInterpolate3, 33826 'ɵɵpropertyInterpolate4': ɵɵpropertyInterpolate4, 33827 'ɵɵpropertyInterpolate5': ɵɵpropertyInterpolate5, 33828 'ɵɵpropertyInterpolate6': ɵɵpropertyInterpolate6, 33829 'ɵɵpropertyInterpolate7': ɵɵpropertyInterpolate7, 33830 'ɵɵpropertyInterpolate8': ɵɵpropertyInterpolate8, 33831 'ɵɵpropertyInterpolateV': ɵɵpropertyInterpolateV, 33832 'ɵɵpipe': ɵɵpipe, 33833 'ɵɵqueryRefresh': ɵɵqueryRefresh, 33834 'ɵɵviewQuery': ɵɵviewQuery, 33835 'ɵɵstaticViewQuery': ɵɵstaticViewQuery, 33836 'ɵɵstaticContentQuery': ɵɵstaticContentQuery, 33837 'ɵɵloadQuery': ɵɵloadQuery, 33838 'ɵɵcontentQuery': ɵɵcontentQuery, 33839 'ɵɵreference': ɵɵreference, 33840 'ɵɵclassMap': ɵɵclassMap, 33841 'ɵɵclassMapInterpolate1': ɵɵclassMapInterpolate1, 33842 'ɵɵclassMapInterpolate2': ɵɵclassMapInterpolate2, 33843 'ɵɵclassMapInterpolate3': ɵɵclassMapInterpolate3, 33844 'ɵɵclassMapInterpolate4': ɵɵclassMapInterpolate4, 33845 'ɵɵclassMapInterpolate5': ɵɵclassMapInterpolate5, 33846 'ɵɵclassMapInterpolate6': ɵɵclassMapInterpolate6, 33847 'ɵɵclassMapInterpolate7': ɵɵclassMapInterpolate7, 33848 'ɵɵclassMapInterpolate8': ɵɵclassMapInterpolate8, 33849 'ɵɵclassMapInterpolateV': ɵɵclassMapInterpolateV, 33850 'ɵɵstyleMap': ɵɵstyleMap, 33851 'ɵɵstyleMapInterpolate1': ɵɵstyleMapInterpolate1, 33852 'ɵɵstyleMapInterpolate2': ɵɵstyleMapInterpolate2, 33853 'ɵɵstyleMapInterpolate3': ɵɵstyleMapInterpolate3, 33854 'ɵɵstyleMapInterpolate4': ɵɵstyleMapInterpolate4, 33855 'ɵɵstyleMapInterpolate5': ɵɵstyleMapInterpolate5, 33856 'ɵɵstyleMapInterpolate6': ɵɵstyleMapInterpolate6, 33857 'ɵɵstyleMapInterpolate7': ɵɵstyleMapInterpolate7, 33858 'ɵɵstyleMapInterpolate8': ɵɵstyleMapInterpolate8, 33859 'ɵɵstyleMapInterpolateV': ɵɵstyleMapInterpolateV, 33860 'ɵɵstyleProp': ɵɵstyleProp, 33861 'ɵɵstylePropInterpolate1': ɵɵstylePropInterpolate1, 33862 'ɵɵstylePropInterpolate2': ɵɵstylePropInterpolate2, 33863 'ɵɵstylePropInterpolate3': ɵɵstylePropInterpolate3, 33864 'ɵɵstylePropInterpolate4': ɵɵstylePropInterpolate4, 33865 'ɵɵstylePropInterpolate5': ɵɵstylePropInterpolate5, 33866 'ɵɵstylePropInterpolate6': ɵɵstylePropInterpolate6, 33867 'ɵɵstylePropInterpolate7': ɵɵstylePropInterpolate7, 33868 'ɵɵstylePropInterpolate8': ɵɵstylePropInterpolate8, 33869 'ɵɵstylePropInterpolateV': ɵɵstylePropInterpolateV, 33870 'ɵɵclassProp': ɵɵclassProp, 33871 'ɵɵselect': ɵɵselect, 33872 'ɵɵadvance': ɵɵadvance, 33873 'ɵɵtemplate': ɵɵtemplate, 33874 'ɵɵtext': ɵɵtext, 33875 'ɵɵtextInterpolate': ɵɵtextInterpolate, 33876 'ɵɵtextInterpolate1': ɵɵtextInterpolate1, 33877 'ɵɵtextInterpolate2': ɵɵtextInterpolate2, 33878 'ɵɵtextInterpolate3': ɵɵtextInterpolate3, 33879 'ɵɵtextInterpolate4': ɵɵtextInterpolate4, 33880 'ɵɵtextInterpolate5': ɵɵtextInterpolate5, 33881 'ɵɵtextInterpolate6': ɵɵtextInterpolate6, 33882 'ɵɵtextInterpolate7': ɵɵtextInterpolate7, 33883 'ɵɵtextInterpolate8': ɵɵtextInterpolate8, 33884 'ɵɵtextInterpolateV': ɵɵtextInterpolateV, 33885 'ɵɵi18n': ɵɵi18n, 33886 'ɵɵi18nAttributes': ɵɵi18nAttributes, 33887 'ɵɵi18nExp': ɵɵi18nExp, 33888 'ɵɵi18nStart': ɵɵi18nStart, 33889 'ɵɵi18nEnd': ɵɵi18nEnd, 33890 'ɵɵi18nApply': ɵɵi18nApply, 33891 'ɵɵi18nPostprocess': ɵɵi18nPostprocess, 33892 'ɵɵresolveWindow': ɵɵresolveWindow, 33893 'ɵɵresolveDocument': ɵɵresolveDocument, 33894 'ɵɵresolveBody': ɵɵresolveBody, 33895 'ɵɵsetComponentScope': ɵɵsetComponentScope, 33896 'ɵɵsetNgModuleScope': ɵɵsetNgModuleScope, 33897 'ɵɵsanitizeHtml': ɵɵsanitizeHtml, 33898 'ɵɵsanitizeStyle': ɵɵsanitizeStyle, 33899 'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl, 33900 'ɵɵsanitizeScript': ɵɵsanitizeScript, 33901 'ɵɵsanitizeUrl': ɵɵsanitizeUrl, 33902 'ɵɵsanitizeUrlOrResourceUrl': ɵɵsanitizeUrlOrResourceUrl, 33903}); 33904/** 33905 * A mapping of the @angular/core API surface used in generated expressions to the actual symbols. 33906 * 33907 * This should be kept up to date with the public exports of @angular/core. 33908 */ 33909const angularCoreEnv = (ɵ0$d)(); 33910 33911let jitOptions = null; 33912function setJitOptions(options) { 33913 if (jitOptions !== null) { 33914 if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) { 33915 ngDevMode && 33916 console.error('Provided value for `defaultEncapsulation` can not be changed once it has been set.'); 33917 return; 33918 } 33919 if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) { 33920 ngDevMode && 33921 console.error('Provided value for `preserveWhitespaces` can not be changed once it has been set.'); 33922 return; 33923 } 33924 } 33925 jitOptions = options; 33926} 33927function getJitOptions() { 33928 return jitOptions; 33929} 33930function resetJitOptions() { 33931 jitOptions = null; 33932} 33933 33934/** 33935 * @license 33936 * Copyright Google LLC All Rights Reserved. 33937 * 33938 * Use of this source code is governed by an MIT-style license that can be 33939 * found in the LICENSE file at https://angular.io/license 33940 */ 33941const EMPTY_ARRAY$5 = []; 33942const moduleQueue = []; 33943/** 33944 * Enqueues moduleDef to be checked later to see if scope can be set on its 33945 * component declarations. 33946 */ 33947function enqueueModuleForDelayedScoping(moduleType, ngModule) { 33948 moduleQueue.push({ moduleType, ngModule }); 33949} 33950let flushingModuleQueue = false; 33951/** 33952 * Loops over queued module definitions, if a given module definition has all of its 33953 * declarations resolved, it dequeues that module definition and sets the scope on 33954 * its declarations. 33955 */ 33956function flushModuleScopingQueueAsMuchAsPossible() { 33957 if (!flushingModuleQueue) { 33958 flushingModuleQueue = true; 33959 try { 33960 for (let i = moduleQueue.length - 1; i >= 0; i--) { 33961 const { moduleType, ngModule } = moduleQueue[i]; 33962 if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) { 33963 // dequeue 33964 moduleQueue.splice(i, 1); 33965 setScopeOnDeclaredComponents(moduleType, ngModule); 33966 } 33967 } 33968 } 33969 finally { 33970 flushingModuleQueue = false; 33971 } 33972 } 33973} 33974/** 33975 * Returns truthy if a declaration has resolved. If the declaration happens to be 33976 * an array of declarations, it will recurse to check each declaration in that array 33977 * (which may also be arrays). 33978 */ 33979function isResolvedDeclaration(declaration) { 33980 if (Array.isArray(declaration)) { 33981 return declaration.every(isResolvedDeclaration); 33982 } 33983 return !!resolveForwardRef(declaration); 33984} 33985/** 33986 * Compiles a module in JIT mode. 33987 * 33988 * This function automatically gets called when a class has a `@NgModule` decorator. 33989 */ 33990function compileNgModule(moduleType, ngModule = {}) { 33991 compileNgModuleDefs(moduleType, ngModule); 33992 // Because we don't know if all declarations have resolved yet at the moment the 33993 // NgModule decorator is executing, we're enqueueing the setting of module scope 33994 // on its declarations to be run at a later time when all declarations for the module, 33995 // including forward refs, have resolved. 33996 enqueueModuleForDelayedScoping(moduleType, ngModule); 33997} 33998/** 33999 * Compiles and adds the `ɵmod` and `ɵinj` properties to the module class. 34000 * 34001 * It's possible to compile a module via this API which will allow duplicate declarations in its 34002 * root. 34003 */ 34004function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot = false) { 34005 ngDevMode && assertDefined(moduleType, 'Required value moduleType'); 34006 ngDevMode && assertDefined(ngModule, 'Required value ngModule'); 34007 const declarations = flatten(ngModule.declarations || EMPTY_ARRAY$5); 34008 let ngModuleDef = null; 34009 Object.defineProperty(moduleType, NG_MOD_DEF, { 34010 configurable: true, 34011 get: () => { 34012 if (ngModuleDef === null) { 34013 if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) { 34014 // We need to assert this immediately, because allowing it to continue will cause it to 34015 // go into an infinite loop before we've reached the point where we throw all the errors. 34016 throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`); 34017 } 34018 ngModuleDef = getCompilerFacade().compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, { 34019 type: moduleType, 34020 bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY$5).map(resolveForwardRef), 34021 declarations: declarations.map(resolveForwardRef), 34022 imports: flatten(ngModule.imports || EMPTY_ARRAY$5) 34023 .map(resolveForwardRef) 34024 .map(expandModuleWithProviders), 34025 exports: flatten(ngModule.exports || EMPTY_ARRAY$5) 34026 .map(resolveForwardRef) 34027 .map(expandModuleWithProviders), 34028 schemas: ngModule.schemas ? flatten(ngModule.schemas) : null, 34029 id: ngModule.id || null, 34030 }); 34031 // Set `schemas` on ngModuleDef to an empty array in JIT mode to indicate that runtime 34032 // should verify that there are no unknown elements in a template. In AOT mode, that check 34033 // happens at compile time and `schemas` information is not present on Component and Module 34034 // defs after compilation (so the check doesn't happen the second time at runtime). 34035 if (!ngModuleDef.schemas) { 34036 ngModuleDef.schemas = []; 34037 } 34038 } 34039 return ngModuleDef; 34040 } 34041 }); 34042 let ngInjectorDef = null; 34043 Object.defineProperty(moduleType, NG_INJ_DEF, { 34044 get: () => { 34045 if (ngInjectorDef === null) { 34046 ngDevMode && 34047 verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot); 34048 const meta = { 34049 name: moduleType.name, 34050 type: moduleType, 34051 deps: reflectDependencies(moduleType), 34052 providers: ngModule.providers || EMPTY_ARRAY$5, 34053 imports: [ 34054 (ngModule.imports || EMPTY_ARRAY$5).map(resolveForwardRef), 34055 (ngModule.exports || EMPTY_ARRAY$5).map(resolveForwardRef), 34056 ], 34057 }; 34058 ngInjectorDef = getCompilerFacade().compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta); 34059 } 34060 return ngInjectorDef; 34061 }, 34062 // Make the property configurable in dev mode to allow overriding in tests 34063 configurable: !!ngDevMode, 34064 }); 34065} 34066function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) { 34067 if (verifiedNgModule.get(moduleType)) 34068 return; 34069 verifiedNgModule.set(moduleType, true); 34070 moduleType = resolveForwardRef(moduleType); 34071 let ngModuleDef; 34072 if (importingModule) { 34073 ngModuleDef = getNgModuleDef(moduleType); 34074 if (!ngModuleDef) { 34075 throw new Error(`Unexpected value '${moduleType.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`); 34076 } 34077 } 34078 else { 34079 ngModuleDef = getNgModuleDef(moduleType, true); 34080 } 34081 const errors = []; 34082 const declarations = maybeUnwrapFn(ngModuleDef.declarations); 34083 const imports = maybeUnwrapFn(ngModuleDef.imports); 34084 flatten(imports).map(unwrapModuleWithProvidersImports).forEach(mod => { 34085 verifySemanticsOfNgModuleImport(mod, moduleType); 34086 verifySemanticsOfNgModuleDef(mod, false, moduleType); 34087 }); 34088 const exports = maybeUnwrapFn(ngModuleDef.exports); 34089 declarations.forEach(verifyDeclarationsHaveDefinitions); 34090 declarations.forEach(verifyDirectivesHaveSelector); 34091 const combinedDeclarations = [ 34092 ...declarations.map(resolveForwardRef), 34093 ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef), 34094 ]; 34095 exports.forEach(verifyExportsAreDeclaredOrReExported); 34096 declarations.forEach(decl => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot)); 34097 declarations.forEach(verifyComponentEntryComponentsIsPartOfNgModule); 34098 const ngModule = getAnnotation(moduleType, 'NgModule'); 34099 if (ngModule) { 34100 ngModule.imports && 34101 flatten(ngModule.imports).map(unwrapModuleWithProvidersImports).forEach(mod => { 34102 verifySemanticsOfNgModuleImport(mod, moduleType); 34103 verifySemanticsOfNgModuleDef(mod, false, moduleType); 34104 }); 34105 ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType); 34106 ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule); 34107 ngModule.entryComponents && 34108 deepForEach(ngModule.entryComponents, verifyComponentIsPartOfNgModule); 34109 } 34110 // Throw Error if any errors were detected. 34111 if (errors.length) { 34112 throw new Error(errors.join('\n')); 34113 } 34114 //////////////////////////////////////////////////////////////////////////////////////////////// 34115 function verifyDeclarationsHaveDefinitions(type) { 34116 type = resolveForwardRef(type); 34117 const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type); 34118 if (!def) { 34119 errors.push(`Unexpected value '${stringifyForError(type)}' declared by the module '${stringifyForError(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`); 34120 } 34121 } 34122 function verifyDirectivesHaveSelector(type) { 34123 type = resolveForwardRef(type); 34124 const def = getDirectiveDef(type); 34125 if (!getComponentDef(type) && def && def.selectors.length == 0) { 34126 errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`); 34127 } 34128 } 34129 function verifyExportsAreDeclaredOrReExported(type) { 34130 type = resolveForwardRef(type); 34131 const kind = getComponentDef(type) && 'component' || getDirectiveDef(type) && 'directive' || 34132 getPipeDef(type) && 'pipe'; 34133 if (kind) { 34134 // only checked if we are declared as Component, Directive, or Pipe 34135 // Modules don't need to be declared or imported. 34136 if (combinedDeclarations.lastIndexOf(type) === -1) { 34137 // We are exporting something which we don't explicitly declare or import. 34138 errors.push(`Can't export ${kind} ${stringifyForError(type)} from ${stringifyForError(moduleType)} as it was neither declared nor imported!`); 34139 } 34140 } 34141 } 34142 function verifyDeclarationIsUnique(type, suppressErrors) { 34143 type = resolveForwardRef(type); 34144 const existingModule = ownerNgModule.get(type); 34145 if (existingModule && existingModule !== moduleType) { 34146 if (!suppressErrors) { 34147 const modules = [existingModule, moduleType].map(stringifyForError).sort(); 34148 errors.push(`Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${modules[0]} and ${modules[1]}! ` + 34149 `Please consider moving ${stringifyForError(type)} to a higher module that imports ${modules[0]} and ${modules[1]}. ` + 34150 `You can also create a new NgModule that exports and includes ${stringifyForError(type)} then import that NgModule in ${modules[0]} and ${modules[1]}.`); 34151 } 34152 } 34153 else { 34154 // Mark type as having owner. 34155 ownerNgModule.set(type, moduleType); 34156 } 34157 } 34158 function verifyComponentIsPartOfNgModule(type) { 34159 type = resolveForwardRef(type); 34160 const existingModule = ownerNgModule.get(type); 34161 if (!existingModule) { 34162 errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`); 34163 } 34164 } 34165 function verifyCorrectBootstrapType(type) { 34166 type = resolveForwardRef(type); 34167 if (!getComponentDef(type)) { 34168 errors.push(`${stringifyForError(type)} cannot be used as an entry component.`); 34169 } 34170 } 34171 function verifyComponentEntryComponentsIsPartOfNgModule(type) { 34172 type = resolveForwardRef(type); 34173 if (getComponentDef(type)) { 34174 // We know we are component 34175 const component = getAnnotation(type, 'Component'); 34176 if (component && component.entryComponents) { 34177 deepForEach(component.entryComponents, verifyComponentIsPartOfNgModule); 34178 } 34179 } 34180 } 34181 function verifySemanticsOfNgModuleImport(type, importingModule) { 34182 type = resolveForwardRef(type); 34183 if (getComponentDef(type) || getDirectiveDef(type)) { 34184 throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`); 34185 } 34186 if (getPipeDef(type)) { 34187 throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`); 34188 } 34189 } 34190} 34191function unwrapModuleWithProvidersImports(typeOrWithProviders) { 34192 typeOrWithProviders = resolveForwardRef(typeOrWithProviders); 34193 return typeOrWithProviders.ngModule || typeOrWithProviders; 34194} 34195function getAnnotation(type, name) { 34196 let annotation = null; 34197 collect(type.__annotations__); 34198 collect(type.decorators); 34199 return annotation; 34200 function collect(annotations) { 34201 if (annotations) { 34202 annotations.forEach(readAnnotation); 34203 } 34204 } 34205 function readAnnotation(decorator) { 34206 if (!annotation) { 34207 const proto = Object.getPrototypeOf(decorator); 34208 if (proto.ngMetadataName == name) { 34209 annotation = decorator; 34210 } 34211 else if (decorator.type) { 34212 const proto = Object.getPrototypeOf(decorator.type); 34213 if (proto.ngMetadataName == name) { 34214 annotation = decorator.args[0]; 34215 } 34216 } 34217 } 34218 } 34219} 34220/** 34221 * Keep track of compiled components. This is needed because in tests we often want to compile the 34222 * same component with more than one NgModule. This would cause an error unless we reset which 34223 * NgModule the component belongs to. We keep the list of compiled components here so that the 34224 * TestBed can reset it later. 34225 */ 34226let ownerNgModule = new Map(); 34227let verifiedNgModule = new Map(); 34228function resetCompiledComponents() { 34229 ownerNgModule = new Map(); 34230 verifiedNgModule = new Map(); 34231 moduleQueue.length = 0; 34232} 34233/** 34234 * Computes the combined declarations of explicit declarations, as well as declarations inherited by 34235 * traversing the exports of imported modules. 34236 * @param type 34237 */ 34238function computeCombinedExports(type) { 34239 type = resolveForwardRef(type); 34240 const ngModuleDef = getNgModuleDef(type, true); 34241 return [...flatten(maybeUnwrapFn(ngModuleDef.exports).map((type) => { 34242 const ngModuleDef = getNgModuleDef(type); 34243 if (ngModuleDef) { 34244 verifySemanticsOfNgModuleDef(type, false); 34245 return computeCombinedExports(type); 34246 } 34247 else { 34248 return type; 34249 } 34250 }))]; 34251} 34252/** 34253 * Some declared components may be compiled asynchronously, and thus may not have their 34254 * ɵcmp set yet. If this is the case, then a reference to the module is written into 34255 * the `ngSelectorScope` property of the declared type. 34256 */ 34257function setScopeOnDeclaredComponents(moduleType, ngModule) { 34258 const declarations = flatten(ngModule.declarations || EMPTY_ARRAY$5); 34259 const transitiveScopes = transitiveScopesFor(moduleType); 34260 declarations.forEach(declaration => { 34261 if (declaration.hasOwnProperty(NG_COMP_DEF)) { 34262 // A `ɵcmp` field exists - go ahead and patch the component directly. 34263 const component = declaration; 34264 const componentDef = getComponentDef(component); 34265 patchComponentDefWithScope(componentDef, transitiveScopes); 34266 } 34267 else if (!declaration.hasOwnProperty(NG_DIR_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) { 34268 // Set `ngSelectorScope` for future reference when the component compilation finishes. 34269 declaration.ngSelectorScope = moduleType; 34270 } 34271 }); 34272} 34273/** 34274 * Patch the definition of a component with directives and pipes from the compilation scope of 34275 * a given module. 34276 */ 34277function patchComponentDefWithScope(componentDef, transitiveScopes) { 34278 componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives) 34279 .map(dir => dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir)) 34280 .filter(def => !!def); 34281 componentDef.pipeDefs = () => Array.from(transitiveScopes.compilation.pipes).map(pipe => getPipeDef(pipe)); 34282 componentDef.schemas = transitiveScopes.schemas; 34283 // Since we avoid Components/Directives/Pipes recompiling in case there are no overrides, we 34284 // may face a problem where previously compiled defs available to a given Component/Directive 34285 // are cached in TView and may become stale (in case any of these defs gets recompiled). In 34286 // order to avoid this problem, we force fresh TView to be created. 34287 componentDef.tView = null; 34288} 34289/** 34290 * Compute the pair of transitive scopes (compilation scope and exported scope) for a given module. 34291 * 34292 * This operation is memoized and the result is cached on the module's definition. This function can 34293 * be called on modules with components that have not fully compiled yet, but the result should not 34294 * be used until they have. 34295 * 34296 * @param moduleType module that transitive scope should be calculated for. 34297 */ 34298function transitiveScopesFor(moduleType) { 34299 if (!isNgModule(moduleType)) { 34300 throw new Error(`${moduleType.name} does not have a module def (ɵmod property)`); 34301 } 34302 const def = getNgModuleDef(moduleType); 34303 if (def.transitiveCompileScopes !== null) { 34304 return def.transitiveCompileScopes; 34305 } 34306 const scopes = { 34307 schemas: def.schemas || null, 34308 compilation: { 34309 directives: new Set(), 34310 pipes: new Set(), 34311 }, 34312 exported: { 34313 directives: new Set(), 34314 pipes: new Set(), 34315 }, 34316 }; 34317 maybeUnwrapFn(def.imports).forEach((imported) => { 34318 const importedType = imported; 34319 if (!isNgModule(importedType)) { 34320 throw new Error(`Importing ${importedType.name} which does not have a ɵmod property`); 34321 } 34322 // When this module imports another, the imported module's exported directives and pipes are 34323 // added to the compilation scope of this module. 34324 const importedScope = transitiveScopesFor(importedType); 34325 importedScope.exported.directives.forEach(entry => scopes.compilation.directives.add(entry)); 34326 importedScope.exported.pipes.forEach(entry => scopes.compilation.pipes.add(entry)); 34327 }); 34328 maybeUnwrapFn(def.declarations).forEach(declared => { 34329 const declaredWithDefs = declared; 34330 if (getPipeDef(declaredWithDefs)) { 34331 scopes.compilation.pipes.add(declared); 34332 } 34333 else { 34334 // Either declared has a ɵcmp or ɵdir, or it's a component which hasn't 34335 // had its template compiled yet. In either case, it gets added to the compilation's 34336 // directives. 34337 scopes.compilation.directives.add(declared); 34338 } 34339 }); 34340 maybeUnwrapFn(def.exports).forEach((exported) => { 34341 const exportedType = exported; 34342 // Either the type is a module, a pipe, or a component/directive (which may not have a 34343 // ɵcmp as it might be compiled asynchronously). 34344 if (isNgModule(exportedType)) { 34345 // When this module exports another, the exported module's exported directives and pipes are 34346 // added to both the compilation and exported scopes of this module. 34347 const exportedScope = transitiveScopesFor(exportedType); 34348 exportedScope.exported.directives.forEach(entry => { 34349 scopes.compilation.directives.add(entry); 34350 scopes.exported.directives.add(entry); 34351 }); 34352 exportedScope.exported.pipes.forEach(entry => { 34353 scopes.compilation.pipes.add(entry); 34354 scopes.exported.pipes.add(entry); 34355 }); 34356 } 34357 else if (getPipeDef(exportedType)) { 34358 scopes.exported.pipes.add(exportedType); 34359 } 34360 else { 34361 scopes.exported.directives.add(exportedType); 34362 } 34363 }); 34364 def.transitiveCompileScopes = scopes; 34365 return scopes; 34366} 34367function expandModuleWithProviders(value) { 34368 if (isModuleWithProviders(value)) { 34369 return value.ngModule; 34370 } 34371 return value; 34372} 34373function isModuleWithProviders(value) { 34374 return value.ngModule !== undefined; 34375} 34376function isNgModule(value) { 34377 return !!getNgModuleDef(value); 34378} 34379 34380/** 34381 * @license 34382 * Copyright Google LLC All Rights Reserved. 34383 * 34384 * Use of this source code is governed by an MIT-style license that can be 34385 * found in the LICENSE file at https://angular.io/license 34386 */ 34387/** 34388 * Keep track of the compilation depth to avoid reentrancy issues during JIT compilation. This 34389 * matters in the following scenario: 34390 * 34391 * Consider a component 'A' that extends component 'B', both declared in module 'M'. During 34392 * the compilation of 'A' the definition of 'B' is requested to capture the inheritance chain, 34393 * potentially triggering compilation of 'B'. If this nested compilation were to trigger 34394 * `flushModuleScopingQueueAsMuchAsPossible` it may happen that module 'M' is still pending in the 34395 * queue, resulting in 'A' and 'B' to be patched with the NgModule scope. As the compilation of 34396 * 'A' is still in progress, this would introduce a circular dependency on its compilation. To avoid 34397 * this issue, the module scope queue is only flushed for compilations at the depth 0, to ensure 34398 * all compilations have finished. 34399 */ 34400let compilationDepth = 0; 34401/** 34402 * Compile an Angular component according to its decorator metadata, and patch the resulting 34403 * component def (ɵcmp) onto the component type. 34404 * 34405 * Compilation may be asynchronous (due to the need to resolve URLs for the component template or 34406 * other resources, for example). In the event that compilation is not immediate, `compileComponent` 34407 * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp` 34408 * until the global queue has been resolved with a call to `resolveComponentResources`. 34409 */ 34410function compileComponent(type, metadata) { 34411 // Initialize ngDevMode. This must be the first statement in compileComponent. 34412 // See the `initNgDevMode` docstring for more information. 34413 (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode(); 34414 let ngComponentDef = null; 34415 // Metadata may have resources which need to be resolved. 34416 maybeQueueResolutionOfComponentResources(type, metadata); 34417 // Note that we're using the same function as `Directive`, because that's only subset of metadata 34418 // that we need to create the ngFactoryDef. We're avoiding using the component metadata 34419 // because we'd have to resolve the asynchronous templates. 34420 addDirectiveFactoryDef(type, metadata); 34421 Object.defineProperty(type, NG_COMP_DEF, { 34422 get: () => { 34423 if (ngComponentDef === null) { 34424 const compiler = getCompilerFacade(); 34425 if (componentNeedsResolution(metadata)) { 34426 const error = [`Component '${type.name}' is not resolved:`]; 34427 if (metadata.templateUrl) { 34428 error.push(` - templateUrl: ${metadata.templateUrl}`); 34429 } 34430 if (metadata.styleUrls && metadata.styleUrls.length) { 34431 error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`); 34432 } 34433 error.push(`Did you run and wait for 'resolveComponentResources()'?`); 34434 throw new Error(error.join('\n')); 34435 } 34436 // This const was called `jitOptions` previously but had to be renamed to `options` because 34437 // of a bug with Terser that caused optimized JIT builds to throw a `ReferenceError`. 34438 // This bug was investigated in https://github.com/angular/angular-cli/issues/17264. 34439 // We should not rename it back until https://github.com/terser/terser/issues/615 is fixed. 34440 const options = getJitOptions(); 34441 let preserveWhitespaces = metadata.preserveWhitespaces; 34442 if (preserveWhitespaces === undefined) { 34443 if (options !== null && options.preserveWhitespaces !== undefined) { 34444 preserveWhitespaces = options.preserveWhitespaces; 34445 } 34446 else { 34447 preserveWhitespaces = false; 34448 } 34449 } 34450 let encapsulation = metadata.encapsulation; 34451 if (encapsulation === undefined) { 34452 if (options !== null && options.defaultEncapsulation !== undefined) { 34453 encapsulation = options.defaultEncapsulation; 34454 } 34455 else { 34456 encapsulation = ViewEncapsulation$1.Emulated; 34457 } 34458 } 34459 const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`; 34460 const meta = Object.assign(Object.assign({}, directiveMetadata(type, metadata)), { typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl), template: metadata.template || '', preserveWhitespaces, styles: metadata.styles || EMPTY_ARRAY, animations: metadata.animations, directives: [], changeDetection: metadata.changeDetection, pipes: new Map(), encapsulation, interpolation: metadata.interpolation, viewProviders: metadata.viewProviders || null }); 34461 compilationDepth++; 34462 try { 34463 if (meta.usesInheritance) { 34464 addDirectiveDefToUndecoratedParents(type); 34465 } 34466 ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta); 34467 } 34468 finally { 34469 // Ensure that the compilation depth is decremented even when the compilation failed. 34470 compilationDepth--; 34471 } 34472 if (compilationDepth === 0) { 34473 // When NgModule decorator executed, we enqueued the module definition such that 34474 // it would only dequeue and add itself as module scope to all of its declarations, 34475 // but only if if all of its declarations had resolved. This call runs the check 34476 // to see if any modules that are in the queue can be dequeued and add scope to 34477 // their declarations. 34478 flushModuleScopingQueueAsMuchAsPossible(); 34479 } 34480 // If component compilation is async, then the @NgModule annotation which declares the 34481 // component may execute and set an ngSelectorScope property on the component type. This 34482 // allows the component to patch itself with directiveDefs from the module after it 34483 // finishes compiling. 34484 if (hasSelectorScope(type)) { 34485 const scopes = transitiveScopesFor(type.ngSelectorScope); 34486 patchComponentDefWithScope(ngComponentDef, scopes); 34487 } 34488 } 34489 return ngComponentDef; 34490 }, 34491 // Make the property configurable in dev mode to allow overriding in tests 34492 configurable: !!ngDevMode, 34493 }); 34494} 34495function hasSelectorScope(component) { 34496 return component.ngSelectorScope !== undefined; 34497} 34498/** 34499 * Compile an Angular directive according to its decorator metadata, and patch the resulting 34500 * directive def onto the component type. 34501 * 34502 * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which 34503 * will resolve when compilation completes and the directive becomes usable. 34504 */ 34505function compileDirective(type, directive) { 34506 let ngDirectiveDef = null; 34507 addDirectiveFactoryDef(type, directive || {}); 34508 Object.defineProperty(type, NG_DIR_DEF, { 34509 get: () => { 34510 if (ngDirectiveDef === null) { 34511 // `directive` can be null in the case of abstract directives as a base class 34512 // that use `@Directive()` with no selector. In that case, pass empty object to the 34513 // `directiveMetadata` function instead of null. 34514 const meta = getDirectiveMetadata(type, directive || {}); 34515 ngDirectiveDef = 34516 getCompilerFacade().compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata); 34517 } 34518 return ngDirectiveDef; 34519 }, 34520 // Make the property configurable in dev mode to allow overriding in tests 34521 configurable: !!ngDevMode, 34522 }); 34523} 34524function getDirectiveMetadata(type, metadata) { 34525 const name = type && type.name; 34526 const sourceMapUrl = `ng:///${name}/ɵdir.js`; 34527 const compiler = getCompilerFacade(); 34528 const facade = directiveMetadata(type, metadata); 34529 facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl); 34530 if (facade.usesInheritance) { 34531 addDirectiveDefToUndecoratedParents(type); 34532 } 34533 return { metadata: facade, sourceMapUrl }; 34534} 34535function addDirectiveFactoryDef(type, metadata) { 34536 let ngFactoryDef = null; 34537 Object.defineProperty(type, NG_FACTORY_DEF, { 34538 get: () => { 34539 if (ngFactoryDef === null) { 34540 const meta = getDirectiveMetadata(type, metadata); 34541 const compiler = getCompilerFacade(); 34542 ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, Object.assign(Object.assign({}, meta.metadata), { injectFn: 'directiveInject', target: compiler.R3FactoryTarget.Directive })); 34543 } 34544 return ngFactoryDef; 34545 }, 34546 // Make the property configurable in dev mode to allow overriding in tests 34547 configurable: !!ngDevMode, 34548 }); 34549} 34550function extendsDirectlyFromObject(type) { 34551 return Object.getPrototypeOf(type.prototype) === Object.prototype; 34552} 34553/** 34554 * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a 34555 * `Component`). 34556 */ 34557function directiveMetadata(type, metadata) { 34558 // Reflect inputs and outputs. 34559 const reflect = getReflect(); 34560 const propMetadata = reflect.ownPropMetadata(type); 34561 return { 34562 name: type.name, 34563 type: type, 34564 typeArgumentCount: 0, 34565 selector: metadata.selector !== undefined ? metadata.selector : null, 34566 deps: reflectDependencies(type), 34567 host: metadata.host || EMPTY_OBJ, 34568 propMetadata: propMetadata, 34569 inputs: metadata.inputs || EMPTY_ARRAY, 34570 outputs: metadata.outputs || EMPTY_ARRAY, 34571 queries: extractQueriesMetadata(type, propMetadata, isContentQuery), 34572 lifecycle: { usesOnChanges: reflect.hasLifecycleHook(type, 'ngOnChanges') }, 34573 typeSourceSpan: null, 34574 usesInheritance: !extendsDirectlyFromObject(type), 34575 exportAs: extractExportAs(metadata.exportAs), 34576 providers: metadata.providers || null, 34577 viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery) 34578 }; 34579} 34580/** 34581 * Adds a directive definition to all parent classes of a type that don't have an Angular decorator. 34582 */ 34583function addDirectiveDefToUndecoratedParents(type) { 34584 const objPrototype = Object.prototype; 34585 let parent = Object.getPrototypeOf(type.prototype).constructor; 34586 // Go up the prototype until we hit `Object`. 34587 while (parent && parent !== objPrototype) { 34588 // Since inheritance works if the class was annotated already, we only need to add 34589 // the def if there are no annotations and the def hasn't been created already. 34590 if (!getDirectiveDef(parent) && !getComponentDef(parent) && 34591 shouldAddAbstractDirective(parent)) { 34592 compileDirective(parent, null); 34593 } 34594 parent = Object.getPrototypeOf(parent); 34595 } 34596} 34597function convertToR3QueryPredicate(selector) { 34598 return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector); 34599} 34600function convertToR3QueryMetadata(propertyName, ann) { 34601 return { 34602 propertyName: propertyName, 34603 predicate: convertToR3QueryPredicate(ann.selector), 34604 descendants: ann.descendants, 34605 first: ann.first, 34606 read: ann.read ? ann.read : null, 34607 static: !!ann.static 34608 }; 34609} 34610function extractQueriesMetadata(type, propMetadata, isQueryAnn) { 34611 const queriesMeta = []; 34612 for (const field in propMetadata) { 34613 if (propMetadata.hasOwnProperty(field)) { 34614 const annotations = propMetadata[field]; 34615 annotations.forEach(ann => { 34616 if (isQueryAnn(ann)) { 34617 if (!ann.selector) { 34618 throw new Error(`Can't construct a query for the property "${field}" of ` + 34619 `"${stringifyForError(type)}" since the query selector wasn't defined.`); 34620 } 34621 if (annotations.some(isInputAnnotation)) { 34622 throw new Error(`Cannot combine @Input decorators with query decorators`); 34623 } 34624 queriesMeta.push(convertToR3QueryMetadata(field, ann)); 34625 } 34626 }); 34627 } 34628 } 34629 return queriesMeta; 34630} 34631function extractExportAs(exportAs) { 34632 return exportAs === undefined ? null : splitByComma(exportAs); 34633} 34634function isContentQuery(value) { 34635 const name = value.ngMetadataName; 34636 return name === 'ContentChild' || name === 'ContentChildren'; 34637} 34638function isViewQuery(value) { 34639 const name = value.ngMetadataName; 34640 return name === 'ViewChild' || name === 'ViewChildren'; 34641} 34642function isInputAnnotation(value) { 34643 return value.ngMetadataName === 'Input'; 34644} 34645function splitByComma(value) { 34646 return value.split(',').map(piece => piece.trim()); 34647} 34648const LIFECYCLE_HOOKS = [ 34649 'ngOnChanges', 'ngOnInit', 'ngOnDestroy', 'ngDoCheck', 'ngAfterViewInit', 'ngAfterViewChecked', 34650 'ngAfterContentInit', 'ngAfterContentChecked' 34651]; 34652function shouldAddAbstractDirective(type) { 34653 const reflect = getReflect(); 34654 if (LIFECYCLE_HOOKS.some(hookName => reflect.hasLifecycleHook(type, hookName))) { 34655 return true; 34656 } 34657 const propMetadata = reflect.propMetadata(type); 34658 for (const field in propMetadata) { 34659 const annotations = propMetadata[field]; 34660 for (let i = 0; i < annotations.length; i++) { 34661 const current = annotations[i]; 34662 const metadataName = current.ngMetadataName; 34663 if (isInputAnnotation(current) || isContentQuery(current) || isViewQuery(current) || 34664 metadataName === 'Output' || metadataName === 'HostBinding' || 34665 metadataName === 'HostListener') { 34666 return true; 34667 } 34668 } 34669 } 34670 return false; 34671} 34672 34673/** 34674 * @license 34675 * Copyright Google LLC All Rights Reserved. 34676 * 34677 * Use of this source code is governed by an MIT-style license that can be 34678 * found in the LICENSE file at https://angular.io/license 34679 */ 34680function compilePipe(type, meta) { 34681 let ngPipeDef = null; 34682 let ngFactoryDef = null; 34683 Object.defineProperty(type, NG_FACTORY_DEF, { 34684 get: () => { 34685 if (ngFactoryDef === null) { 34686 const metadata = getPipeMetadata(type, meta); 34687 const compiler = getCompilerFacade(); 34688 ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, Object.assign(Object.assign({}, metadata), { injectFn: 'directiveInject', target: compiler.R3FactoryTarget.Pipe })); 34689 } 34690 return ngFactoryDef; 34691 }, 34692 // Make the property configurable in dev mode to allow overriding in tests 34693 configurable: !!ngDevMode, 34694 }); 34695 Object.defineProperty(type, NG_PIPE_DEF, { 34696 get: () => { 34697 if (ngPipeDef === null) { 34698 const metadata = getPipeMetadata(type, meta); 34699 ngPipeDef = getCompilerFacade().compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata); 34700 } 34701 return ngPipeDef; 34702 }, 34703 // Make the property configurable in dev mode to allow overriding in tests 34704 configurable: !!ngDevMode, 34705 }); 34706} 34707function getPipeMetadata(type, meta) { 34708 return { 34709 type: type, 34710 typeArgumentCount: 0, 34711 name: type.name, 34712 deps: reflectDependencies(type), 34713 pipeName: meta.name, 34714 pure: meta.pure !== undefined ? meta.pure : true 34715 }; 34716} 34717 34718/** 34719 * @license 34720 * Copyright Google LLC All Rights Reserved. 34721 * 34722 * Use of this source code is governed by an MIT-style license that can be 34723 * found in the LICENSE file at https://angular.io/license 34724 */ 34725const ɵ0$e = (dir = {}) => dir, ɵ1$3 = (type, meta) => SWITCH_COMPILE_DIRECTIVE(type, meta); 34726/** 34727 * Type of the Directive metadata. 34728 * 34729 * @publicApi 34730 */ 34731const Directive = makeDecorator('Directive', ɵ0$e, undefined, undefined, ɵ1$3); 34732const ɵ2$1 = (c = {}) => (Object.assign({ changeDetection: ChangeDetectionStrategy.Default }, c)), ɵ3$1 = (type, meta) => SWITCH_COMPILE_COMPONENT(type, meta); 34733/** 34734 * Component decorator and metadata. 34735 * 34736 * @Annotation 34737 * @publicApi 34738 */ 34739const Component = makeDecorator('Component', ɵ2$1, Directive, undefined, ɵ3$1); 34740const ɵ4 = (p) => (Object.assign({ pure: true }, p)), ɵ5 = (type, meta) => SWITCH_COMPILE_PIPE(type, meta); 34741/** 34742 * @Annotation 34743 * @publicApi 34744 */ 34745const Pipe = makeDecorator('Pipe', ɵ4, undefined, undefined, ɵ5); 34746const ɵ6 = (bindingPropertyName) => ({ bindingPropertyName }); 34747/** 34748 * @Annotation 34749 * @publicApi 34750 */ 34751const Input = makePropDecorator('Input', ɵ6); 34752const ɵ7 = (bindingPropertyName) => ({ bindingPropertyName }); 34753/** 34754 * @Annotation 34755 * @publicApi 34756 */ 34757const Output = makePropDecorator('Output', ɵ7); 34758const ɵ8 = (hostPropertyName) => ({ hostPropertyName }); 34759/** 34760 * @Annotation 34761 * @publicApi 34762 */ 34763const HostBinding = makePropDecorator('HostBinding', ɵ8); 34764const ɵ9 = (eventName, args) => ({ eventName, args }); 34765/** 34766 * Decorator that binds a DOM event to a host listener and supplies configuration metadata. 34767 * Angular invokes the supplied handler method when the host element emits the specified event, 34768 * and updates the bound element with the result. 34769 * 34770 * If the handler method returns false, applies `preventDefault` on the bound element. 34771 * 34772 * @usageNotes 34773 * 34774 * The following example declares a directive 34775 * that attaches a click listener to a button and counts clicks. 34776 * 34777 * ```ts 34778 * @Directive({selector: 'button[counting]'}) 34779 * class CountClicks { 34780 * numberOfClicks = 0; 34781 * 34782 * @HostListener('click', ['$event.target']) 34783 * onClick(btn) { 34784 * console.log('button', btn, 'number of clicks:', this.numberOfClicks++); 34785 * } 34786 * } 34787 * 34788 * @Component({ 34789 * selector: 'app', 34790 * template: '<button counting>Increment</button>', 34791 * }) 34792 * class App {} 34793 * 34794 * ``` 34795 * 34796 * The following example registers another DOM event handler that listens for key-press events. 34797 * ``` ts 34798 * import { HostListener, Component } from "@angular/core"; 34799 * 34800 * @Component({ 34801 * selector: 'app', 34802 * template: `<h1>Hello, you have pressed keys {{counter}} number of times!</h1> Press any key to 34803 * increment the counter. 34804 * <button (click)="resetCounter()">Reset Counter</button>` 34805 * }) 34806 * class AppComponent { 34807 * counter = 0; 34808 * @HostListener('window:keydown', ['$event']) 34809 * handleKeyDown(event: KeyboardEvent) { 34810 * this.counter++; 34811 * } 34812 * resetCounter() { 34813 * this.counter = 0; 34814 * } 34815 * } 34816 * ``` 34817 * 34818 * @Annotation 34819 * @publicApi 34820 */ 34821const HostListener = makePropDecorator('HostListener', ɵ9); 34822const SWITCH_COMPILE_COMPONENT__POST_R3__ = compileComponent; 34823const SWITCH_COMPILE_DIRECTIVE__POST_R3__ = compileDirective; 34824const SWITCH_COMPILE_PIPE__POST_R3__ = compilePipe; 34825const SWITCH_COMPILE_COMPONENT__PRE_R3__ = noop; 34826const SWITCH_COMPILE_DIRECTIVE__PRE_R3__ = noop; 34827const SWITCH_COMPILE_PIPE__PRE_R3__ = noop; 34828const SWITCH_COMPILE_COMPONENT = SWITCH_COMPILE_COMPONENT__POST_R3__; 34829const SWITCH_COMPILE_DIRECTIVE = SWITCH_COMPILE_DIRECTIVE__POST_R3__; 34830const SWITCH_COMPILE_PIPE = SWITCH_COMPILE_PIPE__POST_R3__; 34831 34832/** 34833 * @license 34834 * Copyright Google LLC All Rights Reserved. 34835 * 34836 * Use of this source code is governed by an MIT-style license that can be 34837 * found in the LICENSE file at https://angular.io/license 34838 */ 34839const ɵ0$f = (ngModule) => ngModule, ɵ1$4 = 34840/** 34841 * Decorator that marks the following class as an NgModule, and supplies 34842 * configuration metadata for it. 34843 * 34844 * * The `declarations` and `entryComponents` options configure the compiler 34845 * with information about what belongs to the NgModule. 34846 * * The `providers` options configures the NgModule's injector to provide 34847 * dependencies the NgModule members. 34848 * * The `imports` and `exports` options bring in members from other modules, and make 34849 * this module's members available to others. 34850 */ 34851(type, meta) => SWITCH_COMPILE_NGMODULE(type, meta); 34852/** 34853 * @Annotation 34854 * @publicApi 34855 */ 34856const NgModule = makeDecorator('NgModule', ɵ0$f, undefined, undefined, ɵ1$4); 34857function preR3NgModuleCompile(moduleType, metadata) { 34858 let imports = (metadata && metadata.imports) || []; 34859 if (metadata && metadata.exports) { 34860 imports = [...imports, metadata.exports]; 34861 } 34862 moduleType.ɵinj = ɵɵdefineInjector({ 34863 factory: convertInjectableProviderToFactory(moduleType, { useClass: moduleType }), 34864 providers: metadata && metadata.providers, 34865 imports: imports, 34866 }); 34867} 34868const SWITCH_COMPILE_NGMODULE__POST_R3__ = compileNgModule; 34869const SWITCH_COMPILE_NGMODULE__PRE_R3__ = preR3NgModuleCompile; 34870const SWITCH_COMPILE_NGMODULE = SWITCH_COMPILE_NGMODULE__POST_R3__; 34871 34872/** 34873 * @license 34874 * Copyright Google LLC All Rights Reserved. 34875 * 34876 * Use of this source code is governed by an MIT-style license that can be 34877 * found in the LICENSE file at https://angular.io/license 34878 */ 34879 34880/** 34881 * @license 34882 * Copyright Google LLC All Rights Reserved. 34883 * 34884 * Use of this source code is governed by an MIT-style license that can be 34885 * found in the LICENSE file at https://angular.io/license 34886 */ 34887 34888/** 34889 * @license 34890 * Copyright Google LLC All Rights Reserved. 34891 * 34892 * Use of this source code is governed by an MIT-style license that can be 34893 * found in the LICENSE file at https://angular.io/license 34894 */ 34895/** 34896 * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide 34897 * one or more initialization functions. 34898 * 34899 * The provided functions are injected at application startup and executed during 34900 * app initialization. If any of these functions returns a Promise, initialization 34901 * does not complete until the Promise is resolved. 34902 * 34903 * You can, for example, create a factory function that loads language data 34904 * or an external configuration, and provide that function to the `APP_INITIALIZER` token. 34905 * The function is executed during the application bootstrap process, 34906 * and the needed data is available on startup. 34907 * 34908 * @see `ApplicationInitStatus` 34909 * 34910 * @publicApi 34911 */ 34912const APP_INITIALIZER = new InjectionToken('Application Initializer'); 34913/** 34914 * A class that reflects the state of running {@link APP_INITIALIZER} functions. 34915 * 34916 * @publicApi 34917 */ 34918class ApplicationInitStatus { 34919 constructor(appInits) { 34920 this.appInits = appInits; 34921 this.initialized = false; 34922 this.done = false; 34923 this.donePromise = new Promise((res, rej) => { 34924 this.resolve = res; 34925 this.reject = rej; 34926 }); 34927 } 34928 /** @internal */ 34929 runInitializers() { 34930 if (this.initialized) { 34931 return; 34932 } 34933 const asyncInitPromises = []; 34934 const complete = () => { 34935 this.done = true; 34936 this.resolve(); 34937 }; 34938 if (this.appInits) { 34939 for (let i = 0; i < this.appInits.length; i++) { 34940 const initResult = this.appInits[i](); 34941 if (isPromise(initResult)) { 34942 asyncInitPromises.push(initResult); 34943 } 34944 } 34945 } 34946 Promise.all(asyncInitPromises) 34947 .then(() => { 34948 complete(); 34949 }) 34950 .catch(e => { 34951 this.reject(e); 34952 }); 34953 if (asyncInitPromises.length === 0) { 34954 complete(); 34955 } 34956 this.initialized = true; 34957 } 34958} 34959ApplicationInitStatus.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(ɵɵinject(APP_INITIALIZER, 8)); }; 34960ApplicationInitStatus.ɵprov = ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac }); 34961ApplicationInitStatus.ctorParameters = () => [ 34962 { type: Array, decorators: [{ type: Inject, args: [APP_INITIALIZER,] }, { type: Optional }] } 34963]; 34964/*@__PURE__*/ (function () { setClassMetadata(ApplicationInitStatus, [{ 34965 type: Injectable 34966 }], function () { return [{ type: Array, decorators: [{ 34967 type: Inject, 34968 args: [APP_INITIALIZER] 34969 }, { 34970 type: Optional 34971 }] }]; }, null); })(); 34972 34973/** 34974 * @license 34975 * Copyright Google LLC All Rights Reserved. 34976 * 34977 * Use of this source code is governed by an MIT-style license that can be 34978 * found in the LICENSE file at https://angular.io/license 34979 */ 34980/** 34981 * A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used 34982 * primarily for prefixing application attributes and CSS styles when 34983 * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used. 34984 * 34985 * BY default, the value is randomly generated and assigned to the application by Angular. 34986 * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure 34987 * the root {@link Injector} that uses this token. 34988 * 34989 * @publicApi 34990 */ 34991const APP_ID = new InjectionToken('AppId'); 34992function _appIdRandomProviderFactory() { 34993 return `${_randomChar()}${_randomChar()}${_randomChar()}`; 34994} 34995/** 34996 * Providers that generate a random `APP_ID_TOKEN`. 34997 * @publicApi 34998 */ 34999const APP_ID_RANDOM_PROVIDER = { 35000 provide: APP_ID, 35001 useFactory: _appIdRandomProviderFactory, 35002 deps: [], 35003}; 35004function _randomChar() { 35005 return String.fromCharCode(97 + Math.floor(Math.random() * 25)); 35006} 35007/** 35008 * A function that is executed when a platform is initialized. 35009 * @publicApi 35010 */ 35011const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer'); 35012/** 35013 * A token that indicates an opaque platform ID. 35014 * @publicApi 35015 */ 35016const PLATFORM_ID = new InjectionToken('Platform ID'); 35017/** 35018 * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to 35019 * be called for every component that is bootstrapped. 35020 * 35021 * Each callback must take a `ComponentRef` instance and return nothing. 35022 * 35023 * `(componentRef: ComponentRef) => void` 35024 * 35025 * @publicApi 35026 */ 35027const APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener'); 35028/** 35029 * A [DI token](guide/glossary#di-token "DI token definition") that indicates the root directory of 35030 * the application 35031 * @publicApi 35032 */ 35033const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL'); 35034 35035/** 35036 * @license 35037 * Copyright Google LLC All Rights Reserved. 35038 * 35039 * Use of this source code is governed by an MIT-style license that can be 35040 * found in the LICENSE file at https://angular.io/license 35041 */ 35042class Console { 35043 log(message) { 35044 // tslint:disable-next-line:no-console 35045 console.log(message); 35046 } 35047 // Note: for reporting errors use `DOM.logError()` as it is platform specific 35048 warn(message) { 35049 // tslint:disable-next-line:no-console 35050 console.warn(message); 35051 } 35052} 35053Console.ɵfac = function Console_Factory(t) { return new (t || Console)(); }; 35054Console.ɵprov = ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac }); 35055/*@__PURE__*/ (function () { setClassMetadata(Console, [{ 35056 type: Injectable 35057 }], null, null); })(); 35058 35059/** 35060 * @license 35061 * Copyright Google LLC All Rights Reserved. 35062 * 35063 * Use of this source code is governed by an MIT-style license that can be 35064 * found in the LICENSE file at https://angular.io/license 35065 */ 35066/** 35067 * Provide this token to set the locale of your application. 35068 * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe, 35069 * DecimalPipe and PercentPipe) and by ICU expressions. 35070 * 35071 * See the [i18n guide](guide/i18n#setting-up-locale) for more information. 35072 * 35073 * @usageNotes 35074 * ### Example 35075 * 35076 * ```typescript 35077 * import { LOCALE_ID } from '@angular/core'; 35078 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 35079 * import { AppModule } from './app/app.module'; 35080 * 35081 * platformBrowserDynamic().bootstrapModule(AppModule, { 35082 * providers: [{provide: LOCALE_ID, useValue: 'en-US' }] 35083 * }); 35084 * ``` 35085 * 35086 * @publicApi 35087 */ 35088const LOCALE_ID$1 = new InjectionToken('LocaleId'); 35089/** 35090 * Provide this token to set the default currency code your application uses for 35091 * CurrencyPipe when there is no currency code passed into it. This is only used by 35092 * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured. 35093 * 35094 * See the [i18n guide](guide/i18n#setting-up-locale) for more information. 35095 * 35096 * <div class="alert is-helpful"> 35097 * 35098 * **Deprecation notice:** 35099 * 35100 * The default currency code is currently always `USD` but this is deprecated from v9. 35101 * 35102 * **In v10 the default currency code will be taken from the current locale.** 35103 * 35104 * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in 35105 * your application `NgModule`: 35106 * 35107 * ```ts 35108 * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'} 35109 * ``` 35110 * 35111 * </div> 35112 * 35113 * @usageNotes 35114 * ### Example 35115 * 35116 * ```typescript 35117 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 35118 * import { AppModule } from './app/app.module'; 35119 * 35120 * platformBrowserDynamic().bootstrapModule(AppModule, { 35121 * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }] 35122 * }); 35123 * ``` 35124 * 35125 * @publicApi 35126 */ 35127const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode'); 35128/** 35129 * Use this token at bootstrap to provide the content of your translation file (`xtb`, 35130 * `xlf` or `xlf2`) when you want to translate your application in another language. 35131 * 35132 * See the [i18n guide](guide/i18n#merge) for more information. 35133 * 35134 * @usageNotes 35135 * ### Example 35136 * 35137 * ```typescript 35138 * import { TRANSLATIONS } from '@angular/core'; 35139 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 35140 * import { AppModule } from './app/app.module'; 35141 * 35142 * // content of your translation file 35143 * const translations = '....'; 35144 * 35145 * platformBrowserDynamic().bootstrapModule(AppModule, { 35146 * providers: [{provide: TRANSLATIONS, useValue: translations }] 35147 * }); 35148 * ``` 35149 * 35150 * @publicApi 35151 */ 35152const TRANSLATIONS = new InjectionToken('Translations'); 35153/** 35154 * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`, 35155 * `xlf` or `xlf2`. 35156 * 35157 * See the [i18n guide](guide/i18n#merge) for more information. 35158 * 35159 * @usageNotes 35160 * ### Example 35161 * 35162 * ```typescript 35163 * import { TRANSLATIONS_FORMAT } from '@angular/core'; 35164 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 35165 * import { AppModule } from './app/app.module'; 35166 * 35167 * platformBrowserDynamic().bootstrapModule(AppModule, { 35168 * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }] 35169 * }); 35170 * ``` 35171 * 35172 * @publicApi 35173 */ 35174const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat'); 35175/** 35176 * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy 35177 * that the compiler should use in case of missing translations: 35178 * - Error: throw if you have missing translations. 35179 * - Warning (default): show a warning in the console and/or shell. 35180 * - Ignore: do nothing. 35181 * 35182 * See the [i18n guide](guide/i18n#missing-translation) for more information. 35183 * 35184 * @usageNotes 35185 * ### Example 35186 * ```typescript 35187 * import { MissingTranslationStrategy } from '@angular/core'; 35188 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 35189 * import { AppModule } from './app/app.module'; 35190 * 35191 * platformBrowserDynamic().bootstrapModule(AppModule, { 35192 * missingTranslation: MissingTranslationStrategy.Error 35193 * }); 35194 * ``` 35195 * 35196 * @publicApi 35197 */ 35198var MissingTranslationStrategy; 35199(function (MissingTranslationStrategy) { 35200 MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error"; 35201 MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning"; 35202 MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore"; 35203})(MissingTranslationStrategy || (MissingTranslationStrategy = {})); 35204 35205/** 35206 * @license 35207 * Copyright Google LLC All Rights Reserved. 35208 * 35209 * Use of this source code is governed by an MIT-style license that can be 35210 * found in the LICENSE file at https://angular.io/license 35211 */ 35212const SWITCH_IVY_ENABLED__POST_R3__ = true; 35213const SWITCH_IVY_ENABLED__PRE_R3__ = false; 35214const ivyEnabled = SWITCH_IVY_ENABLED__POST_R3__; 35215 35216/** 35217 * @license 35218 * Copyright Google LLC All Rights Reserved. 35219 * 35220 * Use of this source code is governed by an MIT-style license that can be 35221 * found in the LICENSE file at https://angular.io/license 35222 */ 35223/** 35224 * Combination of NgModuleFactory and ComponentFactorys. 35225 * 35226 * @publicApi 35227 */ 35228class ModuleWithComponentFactories { 35229 constructor(ngModuleFactory, componentFactories) { 35230 this.ngModuleFactory = ngModuleFactory; 35231 this.componentFactories = componentFactories; 35232 } 35233} 35234function _throwError() { 35235 throw new Error(`Runtime compiler is not loaded`); 35236} 35237const Compiler_compileModuleSync__PRE_R3__ = _throwError; 35238const Compiler_compileModuleSync__POST_R3__ = function (moduleType) { 35239 return new NgModuleFactory$1(moduleType); 35240}; 35241const Compiler_compileModuleSync = Compiler_compileModuleSync__POST_R3__; 35242const Compiler_compileModuleAsync__PRE_R3__ = _throwError; 35243const Compiler_compileModuleAsync__POST_R3__ = function (moduleType) { 35244 return Promise.resolve(Compiler_compileModuleSync__POST_R3__(moduleType)); 35245}; 35246const Compiler_compileModuleAsync = Compiler_compileModuleAsync__POST_R3__; 35247const Compiler_compileModuleAndAllComponentsSync__PRE_R3__ = _throwError; 35248const Compiler_compileModuleAndAllComponentsSync__POST_R3__ = function (moduleType) { 35249 const ngModuleFactory = Compiler_compileModuleSync__POST_R3__(moduleType); 35250 const moduleDef = getNgModuleDef(moduleType); 35251 const componentFactories = maybeUnwrapFn(moduleDef.declarations) 35252 .reduce((factories, declaration) => { 35253 const componentDef = getComponentDef(declaration); 35254 componentDef && factories.push(new ComponentFactory$1(componentDef)); 35255 return factories; 35256 }, []); 35257 return new ModuleWithComponentFactories(ngModuleFactory, componentFactories); 35258}; 35259const Compiler_compileModuleAndAllComponentsSync = Compiler_compileModuleAndAllComponentsSync__POST_R3__; 35260const Compiler_compileModuleAndAllComponentsAsync__PRE_R3__ = _throwError; 35261const Compiler_compileModuleAndAllComponentsAsync__POST_R3__ = function (moduleType) { 35262 return Promise.resolve(Compiler_compileModuleAndAllComponentsSync__POST_R3__(moduleType)); 35263}; 35264const Compiler_compileModuleAndAllComponentsAsync = Compiler_compileModuleAndAllComponentsAsync__POST_R3__; 35265/** 35266 * Low-level service for running the angular compiler during runtime 35267 * to create {@link ComponentFactory}s, which 35268 * can later be used to create and render a Component instance. 35269 * 35270 * Each `@NgModule` provides an own `Compiler` to its injector, 35271 * that will use the directives/pipes of the ng module for compilation 35272 * of components. 35273 * 35274 * @publicApi 35275 */ 35276class Compiler { 35277 constructor() { 35278 /** 35279 * Compiles the given NgModule and all of its components. All templates of the components listed 35280 * in `entryComponents` have to be inlined. 35281 */ 35282 this.compileModuleSync = Compiler_compileModuleSync; 35283 /** 35284 * Compiles the given NgModule and all of its components 35285 */ 35286 this.compileModuleAsync = Compiler_compileModuleAsync; 35287 /** 35288 * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components. 35289 */ 35290 this.compileModuleAndAllComponentsSync = Compiler_compileModuleAndAllComponentsSync; 35291 /** 35292 * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components. 35293 */ 35294 this.compileModuleAndAllComponentsAsync = Compiler_compileModuleAndAllComponentsAsync; 35295 } 35296 /** 35297 * Clears all caches. 35298 */ 35299 clearCache() { } 35300 /** 35301 * Clears the cache for the given component/ngModule. 35302 */ 35303 clearCacheFor(type) { } 35304 /** 35305 * Returns the id for a given NgModule, if one is defined and known to the compiler. 35306 */ 35307 getModuleId(moduleType) { 35308 return undefined; 35309 } 35310} 35311Compiler.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; 35312Compiler.ɵprov = ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac }); 35313/*@__PURE__*/ (function () { setClassMetadata(Compiler, [{ 35314 type: Injectable 35315 }], function () { return []; }, null); })(); 35316/** 35317 * Token to provide CompilerOptions in the platform injector. 35318 * 35319 * @publicApi 35320 */ 35321const COMPILER_OPTIONS = new InjectionToken('compilerOptions'); 35322/** 35323 * A factory for creating a Compiler 35324 * 35325 * @publicApi 35326 */ 35327class CompilerFactory { 35328} 35329 35330/** 35331 * @license 35332 * Copyright Google LLC All Rights Reserved. 35333 * 35334 * Use of this source code is governed by an MIT-style license that can be 35335 * found in the LICENSE file at https://angular.io/license 35336 */ 35337const promise = (() => Promise.resolve(0))(); 35338function scheduleMicroTask(fn) { 35339 if (typeof Zone === 'undefined') { 35340 // use promise to schedule microTask instead of use Zone 35341 promise.then(() => { 35342 fn && fn.apply(null, null); 35343 }); 35344 } 35345 else { 35346 Zone.current.scheduleMicroTask('scheduleMicrotask', fn); 35347 } 35348} 35349 35350/** 35351 * @license 35352 * Copyright Google LLC All Rights Reserved. 35353 * 35354 * Use of this source code is governed by an MIT-style license that can be 35355 * found in the LICENSE file at https://angular.io/license 35356 */ 35357function getNativeRequestAnimationFrame() { 35358 let nativeRequestAnimationFrame = _global['requestAnimationFrame']; 35359 let nativeCancelAnimationFrame = _global['cancelAnimationFrame']; 35360 if (typeof Zone !== 'undefined' && nativeRequestAnimationFrame && nativeCancelAnimationFrame) { 35361 // use unpatched version of requestAnimationFrame(native delegate) if possible 35362 // to avoid another Change detection 35363 const unpatchedRequestAnimationFrame = nativeRequestAnimationFrame[Zone.__symbol__('OriginalDelegate')]; 35364 if (unpatchedRequestAnimationFrame) { 35365 nativeRequestAnimationFrame = unpatchedRequestAnimationFrame; 35366 } 35367 const unpatchedCancelAnimationFrame = nativeCancelAnimationFrame[Zone.__symbol__('OriginalDelegate')]; 35368 if (unpatchedCancelAnimationFrame) { 35369 nativeCancelAnimationFrame = unpatchedCancelAnimationFrame; 35370 } 35371 } 35372 return { nativeRequestAnimationFrame, nativeCancelAnimationFrame }; 35373} 35374 35375/** 35376 * @license 35377 * Copyright Google LLC All Rights Reserved. 35378 * 35379 * Use of this source code is governed by an MIT-style license that can be 35380 * found in the LICENSE file at https://angular.io/license 35381 */ 35382/** 35383 * An injectable service for executing work inside or outside of the Angular zone. 35384 * 35385 * The most common use of this service is to optimize performance when starting a work consisting of 35386 * one or more asynchronous tasks that don't require UI updates or error handling to be handled by 35387 * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks 35388 * can reenter the Angular zone via {@link #run}. 35389 * 35390 * <!-- TODO: add/fix links to: 35391 * - docs explaining zones and the use of zones in Angular and change-detection 35392 * - link to runOutsideAngular/run (throughout this file!) 35393 * --> 35394 * 35395 * @usageNotes 35396 * ### Example 35397 * 35398 * ``` 35399 * import {Component, NgZone} from '@angular/core'; 35400 * import {NgIf} from '@angular/common'; 35401 * 35402 * @Component({ 35403 * selector: 'ng-zone-demo', 35404 * template: ` 35405 * <h2>Demo: NgZone</h2> 35406 * 35407 * <p>Progress: {{progress}}%</p> 35408 * <p *ngIf="progress >= 100">Done processing {{label}} of Angular zone!</p> 35409 * 35410 * <button (click)="processWithinAngularZone()">Process within Angular zone</button> 35411 * <button (click)="processOutsideOfAngularZone()">Process outside of Angular zone</button> 35412 * `, 35413 * }) 35414 * export class NgZoneDemo { 35415 * progress: number = 0; 35416 * label: string; 35417 * 35418 * constructor(private _ngZone: NgZone) {} 35419 * 35420 * // Loop inside the Angular zone 35421 * // so the UI DOES refresh after each setTimeout cycle 35422 * processWithinAngularZone() { 35423 * this.label = 'inside'; 35424 * this.progress = 0; 35425 * this._increaseProgress(() => console.log('Inside Done!')); 35426 * } 35427 * 35428 * // Loop outside of the Angular zone 35429 * // so the UI DOES NOT refresh after each setTimeout cycle 35430 * processOutsideOfAngularZone() { 35431 * this.label = 'outside'; 35432 * this.progress = 0; 35433 * this._ngZone.runOutsideAngular(() => { 35434 * this._increaseProgress(() => { 35435 * // reenter the Angular zone and display done 35436 * this._ngZone.run(() => { console.log('Outside Done!'); }); 35437 * }); 35438 * }); 35439 * } 35440 * 35441 * _increaseProgress(doneCallback: () => void) { 35442 * this.progress += 1; 35443 * console.log(`Current progress: ${this.progress}%`); 35444 * 35445 * if (this.progress < 100) { 35446 * window.setTimeout(() => this._increaseProgress(doneCallback), 10); 35447 * } else { 35448 * doneCallback(); 35449 * } 35450 * } 35451 * } 35452 * ``` 35453 * 35454 * @publicApi 35455 */ 35456class NgZone { 35457 constructor({ enableLongStackTrace = false, shouldCoalesceEventChangeDetection = false }) { 35458 this.hasPendingMacrotasks = false; 35459 this.hasPendingMicrotasks = false; 35460 /** 35461 * Whether there are no outstanding microtasks or macrotasks. 35462 */ 35463 this.isStable = true; 35464 /** 35465 * Notifies when code enters Angular Zone. This gets fired first on VM Turn. 35466 */ 35467 this.onUnstable = new EventEmitter(false); 35468 /** 35469 * Notifies when there is no more microtasks enqueued in the current VM Turn. 35470 * This is a hint for Angular to do change detection, which may enqueue more microtasks. 35471 * For this reason this event can fire multiple times per VM Turn. 35472 */ 35473 this.onMicrotaskEmpty = new EventEmitter(false); 35474 /** 35475 * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which 35476 * implies we are about to relinquish VM turn. 35477 * This event gets called just once. 35478 */ 35479 this.onStable = new EventEmitter(false); 35480 /** 35481 * Notifies that an error has been delivered. 35482 */ 35483 this.onError = new EventEmitter(false); 35484 if (typeof Zone == 'undefined') { 35485 throw new Error(`In this configuration Angular requires Zone.js`); 35486 } 35487 Zone.assertZonePatched(); 35488 const self = this; 35489 self._nesting = 0; 35490 self._outer = self._inner = Zone.current; 35491 if (Zone['wtfZoneSpec']) { 35492 self._inner = self._inner.fork(Zone['wtfZoneSpec']); 35493 } 35494 if (Zone['TaskTrackingZoneSpec']) { 35495 self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']); 35496 } 35497 if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) { 35498 self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']); 35499 } 35500 self.shouldCoalesceEventChangeDetection = shouldCoalesceEventChangeDetection; 35501 self.lastRequestAnimationFrameId = -1; 35502 self.nativeRequestAnimationFrame = getNativeRequestAnimationFrame().nativeRequestAnimationFrame; 35503 forkInnerZoneWithAngularBehavior(self); 35504 } 35505 static isInAngularZone() { 35506 return Zone.current.get('isAngularZone') === true; 35507 } 35508 static assertInAngularZone() { 35509 if (!NgZone.isInAngularZone()) { 35510 throw new Error('Expected to be in Angular Zone, but it is not!'); 35511 } 35512 } 35513 static assertNotInAngularZone() { 35514 if (NgZone.isInAngularZone()) { 35515 throw new Error('Expected to not be in Angular Zone, but it is!'); 35516 } 35517 } 35518 /** 35519 * Executes the `fn` function synchronously within the Angular zone and returns value returned by 35520 * the function. 35521 * 35522 * Running functions via `run` allows you to reenter Angular zone from a task that was executed 35523 * outside of the Angular zone (typically started via {@link #runOutsideAngular}). 35524 * 35525 * Any future tasks or microtasks scheduled from within this function will continue executing from 35526 * within the Angular zone. 35527 * 35528 * If a synchronous error happens it will be rethrown and not reported via `onError`. 35529 */ 35530 run(fn, applyThis, applyArgs) { 35531 return this._inner.run(fn, applyThis, applyArgs); 35532 } 35533 /** 35534 * Executes the `fn` function synchronously within the Angular zone as a task and returns value 35535 * returned by the function. 35536 * 35537 * Running functions via `run` allows you to reenter Angular zone from a task that was executed 35538 * outside of the Angular zone (typically started via {@link #runOutsideAngular}). 35539 * 35540 * Any future tasks or microtasks scheduled from within this function will continue executing from 35541 * within the Angular zone. 35542 * 35543 * If a synchronous error happens it will be rethrown and not reported via `onError`. 35544 */ 35545 runTask(fn, applyThis, applyArgs, name) { 35546 const zone = this._inner; 35547 const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop$1, noop$1); 35548 try { 35549 return zone.runTask(task, applyThis, applyArgs); 35550 } 35551 finally { 35552 zone.cancelTask(task); 35553 } 35554 } 35555 /** 35556 * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not 35557 * rethrown. 35558 */ 35559 runGuarded(fn, applyThis, applyArgs) { 35560 return this._inner.runGuarded(fn, applyThis, applyArgs); 35561 } 35562 /** 35563 * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by 35564 * the function. 35565 * 35566 * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do 35567 * work that 35568 * doesn't trigger Angular change-detection or is subject to Angular's error handling. 35569 * 35570 * Any future tasks or microtasks scheduled from within this function will continue executing from 35571 * outside of the Angular zone. 35572 * 35573 * Use {@link #run} to reenter the Angular zone and do work that updates the application model. 35574 */ 35575 runOutsideAngular(fn) { 35576 return this._outer.run(fn); 35577 } 35578} 35579function noop$1() { } 35580const EMPTY_PAYLOAD = {}; 35581function checkStable(zone) { 35582 if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) { 35583 try { 35584 zone._nesting++; 35585 zone.onMicrotaskEmpty.emit(null); 35586 } 35587 finally { 35588 zone._nesting--; 35589 if (!zone.hasPendingMicrotasks) { 35590 try { 35591 zone.runOutsideAngular(() => zone.onStable.emit(null)); 35592 } 35593 finally { 35594 zone.isStable = true; 35595 } 35596 } 35597 } 35598 } 35599} 35600function delayChangeDetectionForEvents(zone) { 35601 if (zone.lastRequestAnimationFrameId !== -1) { 35602 return; 35603 } 35604 zone.lastRequestAnimationFrameId = zone.nativeRequestAnimationFrame.call(_global, () => { 35605 // This is a work around for https://github.com/angular/angular/issues/36839. 35606 // The core issue is that when event coalescing is enabled it is possible for microtasks 35607 // to get flushed too early (As is the case with `Promise.then`) between the 35608 // coalescing eventTasks. 35609 // 35610 // To workaround this we schedule a "fake" eventTask before we process the 35611 // coalescing eventTasks. The benefit of this is that the "fake" container eventTask 35612 // will prevent the microtasks queue from getting drained in between the coalescing 35613 // eventTask execution. 35614 if (!zone.fakeTopEventTask) { 35615 zone.fakeTopEventTask = Zone.root.scheduleEventTask('fakeTopEventTask', () => { 35616 zone.lastRequestAnimationFrameId = -1; 35617 updateMicroTaskStatus(zone); 35618 checkStable(zone); 35619 }, undefined, () => { }, () => { }); 35620 } 35621 zone.fakeTopEventTask.invoke(); 35622 }); 35623 updateMicroTaskStatus(zone); 35624} 35625function forkInnerZoneWithAngularBehavior(zone) { 35626 const delayChangeDetectionForEventsDelegate = () => { 35627 delayChangeDetectionForEvents(zone); 35628 }; 35629 const maybeDelayChangeDetection = !!zone.shouldCoalesceEventChangeDetection && 35630 zone.nativeRequestAnimationFrame && delayChangeDetectionForEventsDelegate; 35631 zone._inner = zone._inner.fork({ 35632 name: 'angular', 35633 properties: { 'isAngularZone': true, 'maybeDelayChangeDetection': maybeDelayChangeDetection }, 35634 onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => { 35635 try { 35636 onEnter(zone); 35637 return delegate.invokeTask(target, task, applyThis, applyArgs); 35638 } 35639 finally { 35640 if (maybeDelayChangeDetection && task.type === 'eventTask') { 35641 maybeDelayChangeDetection(); 35642 } 35643 onLeave(zone); 35644 } 35645 }, 35646 onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => { 35647 try { 35648 onEnter(zone); 35649 return delegate.invoke(target, callback, applyThis, applyArgs, source); 35650 } 35651 finally { 35652 onLeave(zone); 35653 } 35654 }, 35655 onHasTask: (delegate, current, target, hasTaskState) => { 35656 delegate.hasTask(target, hasTaskState); 35657 if (current === target) { 35658 // We are only interested in hasTask events which originate from our zone 35659 // (A child hasTask event is not interesting to us) 35660 if (hasTaskState.change == 'microTask') { 35661 zone._hasPendingMicrotasks = hasTaskState.microTask; 35662 updateMicroTaskStatus(zone); 35663 checkStable(zone); 35664 } 35665 else if (hasTaskState.change == 'macroTask') { 35666 zone.hasPendingMacrotasks = hasTaskState.macroTask; 35667 } 35668 } 35669 }, 35670 onHandleError: (delegate, current, target, error) => { 35671 delegate.handleError(target, error); 35672 zone.runOutsideAngular(() => zone.onError.emit(error)); 35673 return false; 35674 } 35675 }); 35676} 35677function updateMicroTaskStatus(zone) { 35678 if (zone._hasPendingMicrotasks || 35679 (zone.shouldCoalesceEventChangeDetection && zone.lastRequestAnimationFrameId !== -1)) { 35680 zone.hasPendingMicrotasks = true; 35681 } 35682 else { 35683 zone.hasPendingMicrotasks = false; 35684 } 35685} 35686function onEnter(zone) { 35687 zone._nesting++; 35688 if (zone.isStable) { 35689 zone.isStable = false; 35690 zone.onUnstable.emit(null); 35691 } 35692} 35693function onLeave(zone) { 35694 zone._nesting--; 35695 checkStable(zone); 35696} 35697/** 35698 * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls 35699 * to framework to perform rendering. 35700 */ 35701class NoopNgZone { 35702 constructor() { 35703 this.hasPendingMicrotasks = false; 35704 this.hasPendingMacrotasks = false; 35705 this.isStable = true; 35706 this.onUnstable = new EventEmitter(); 35707 this.onMicrotaskEmpty = new EventEmitter(); 35708 this.onStable = new EventEmitter(); 35709 this.onError = new EventEmitter(); 35710 } 35711 run(fn, applyThis, applyArgs) { 35712 return fn.apply(applyThis, applyArgs); 35713 } 35714 runGuarded(fn, applyThis, applyArgs) { 35715 return fn.apply(applyThis, applyArgs); 35716 } 35717 runOutsideAngular(fn) { 35718 return fn(); 35719 } 35720 runTask(fn, applyThis, applyArgs, name) { 35721 return fn.apply(applyThis, applyArgs); 35722 } 35723} 35724 35725/** 35726 * @license 35727 * Copyright Google LLC All Rights Reserved. 35728 * 35729 * Use of this source code is governed by an MIT-style license that can be 35730 * found in the LICENSE file at https://angular.io/license 35731 */ 35732/** 35733 * The Testability service provides testing hooks that can be accessed from 35734 * the browser and by services such as Protractor. Each bootstrapped Angular 35735 * application on the page will have an instance of Testability. 35736 * @publicApi 35737 */ 35738class Testability { 35739 constructor(_ngZone) { 35740 this._ngZone = _ngZone; 35741 this._pendingCount = 0; 35742 this._isZoneStable = true; 35743 /** 35744 * Whether any work was done since the last 'whenStable' callback. This is 35745 * useful to detect if this could have potentially destabilized another 35746 * component while it is stabilizing. 35747 * @internal 35748 */ 35749 this._didWork = false; 35750 this._callbacks = []; 35751 this.taskTrackingZone = null; 35752 this._watchAngularEvents(); 35753 _ngZone.run(() => { 35754 this.taskTrackingZone = 35755 typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone'); 35756 }); 35757 } 35758 _watchAngularEvents() { 35759 this._ngZone.onUnstable.subscribe({ 35760 next: () => { 35761 this._didWork = true; 35762 this._isZoneStable = false; 35763 } 35764 }); 35765 this._ngZone.runOutsideAngular(() => { 35766 this._ngZone.onStable.subscribe({ 35767 next: () => { 35768 NgZone.assertNotInAngularZone(); 35769 scheduleMicroTask(() => { 35770 this._isZoneStable = true; 35771 this._runCallbacksIfReady(); 35772 }); 35773 } 35774 }); 35775 }); 35776 } 35777 /** 35778 * Increases the number of pending request 35779 * @deprecated pending requests are now tracked with zones. 35780 */ 35781 increasePendingRequestCount() { 35782 this._pendingCount += 1; 35783 this._didWork = true; 35784 return this._pendingCount; 35785 } 35786 /** 35787 * Decreases the number of pending request 35788 * @deprecated pending requests are now tracked with zones 35789 */ 35790 decreasePendingRequestCount() { 35791 this._pendingCount -= 1; 35792 if (this._pendingCount < 0) { 35793 throw new Error('pending async requests below zero'); 35794 } 35795 this._runCallbacksIfReady(); 35796 return this._pendingCount; 35797 } 35798 /** 35799 * Whether an associated application is stable 35800 */ 35801 isStable() { 35802 return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks; 35803 } 35804 _runCallbacksIfReady() { 35805 if (this.isStable()) { 35806 // Schedules the call backs in a new frame so that it is always async. 35807 scheduleMicroTask(() => { 35808 while (this._callbacks.length !== 0) { 35809 let cb = this._callbacks.pop(); 35810 clearTimeout(cb.timeoutId); 35811 cb.doneCb(this._didWork); 35812 } 35813 this._didWork = false; 35814 }); 35815 } 35816 else { 35817 // Still not stable, send updates. 35818 let pending = this.getPendingTasks(); 35819 this._callbacks = this._callbacks.filter((cb) => { 35820 if (cb.updateCb && cb.updateCb(pending)) { 35821 clearTimeout(cb.timeoutId); 35822 return false; 35823 } 35824 return true; 35825 }); 35826 this._didWork = true; 35827 } 35828 } 35829 getPendingTasks() { 35830 if (!this.taskTrackingZone) { 35831 return []; 35832 } 35833 // Copy the tasks data so that we don't leak tasks. 35834 return this.taskTrackingZone.macroTasks.map((t) => { 35835 return { 35836 source: t.source, 35837 // From TaskTrackingZone: 35838 // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40 35839 creationLocation: t.creationLocation, 35840 data: t.data 35841 }; 35842 }); 35843 } 35844 addCallback(cb, timeout, updateCb) { 35845 let timeoutId = -1; 35846 if (timeout && timeout > 0) { 35847 timeoutId = setTimeout(() => { 35848 this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId); 35849 cb(this._didWork, this.getPendingTasks()); 35850 }, timeout); 35851 } 35852 this._callbacks.push({ doneCb: cb, timeoutId: timeoutId, updateCb: updateCb }); 35853 } 35854 /** 35855 * Wait for the application to be stable with a timeout. If the timeout is reached before that 35856 * happens, the callback receives a list of the macro tasks that were pending, otherwise null. 35857 * 35858 * @param doneCb The callback to invoke when Angular is stable or the timeout expires 35859 * whichever comes first. 35860 * @param timeout Optional. The maximum time to wait for Angular to become stable. If not 35861 * specified, whenStable() will wait forever. 35862 * @param updateCb Optional. If specified, this callback will be invoked whenever the set of 35863 * pending macrotasks changes. If this callback returns true doneCb will not be invoked 35864 * and no further updates will be issued. 35865 */ 35866 whenStable(doneCb, timeout, updateCb) { 35867 if (updateCb && !this.taskTrackingZone) { 35868 throw new Error('Task tracking zone is required when passing an update callback to ' + 35869 'whenStable(). Is "zone.js/dist/task-tracking.js" loaded?'); 35870 } 35871 // These arguments are 'Function' above to keep the public API simple. 35872 this.addCallback(doneCb, timeout, updateCb); 35873 this._runCallbacksIfReady(); 35874 } 35875 /** 35876 * Get the number of pending requests 35877 * @deprecated pending requests are now tracked with zones 35878 */ 35879 getPendingRequestCount() { 35880 return this._pendingCount; 35881 } 35882 /** 35883 * Find providers by name 35884 * @param using The root element to search from 35885 * @param provider The name of binding variable 35886 * @param exactMatch Whether using exactMatch 35887 */ 35888 findProviders(using, provider, exactMatch) { 35889 // TODO(juliemr): implement. 35890 return []; 35891 } 35892} 35893Testability.ɵfac = function Testability_Factory(t) { return new (t || Testability)(ɵɵinject(NgZone)); }; 35894Testability.ɵprov = ɵɵdefineInjectable({ token: Testability, factory: Testability.ɵfac }); 35895Testability.ctorParameters = () => [ 35896 { type: NgZone } 35897]; 35898/*@__PURE__*/ (function () { setClassMetadata(Testability, [{ 35899 type: Injectable 35900 }], function () { return [{ type: NgZone }]; }, null); })(); 35901/** 35902 * A global registry of {@link Testability} instances for specific elements. 35903 * @publicApi 35904 */ 35905class TestabilityRegistry { 35906 constructor() { 35907 /** @internal */ 35908 this._applications = new Map(); 35909 _testabilityGetter.addToWindow(this); 35910 } 35911 /** 35912 * Registers an application with a testability hook so that it can be tracked 35913 * @param token token of application, root element 35914 * @param testability Testability hook 35915 */ 35916 registerApplication(token, testability) { 35917 this._applications.set(token, testability); 35918 } 35919 /** 35920 * Unregisters an application. 35921 * @param token token of application, root element 35922 */ 35923 unregisterApplication(token) { 35924 this._applications.delete(token); 35925 } 35926 /** 35927 * Unregisters all applications 35928 */ 35929 unregisterAllApplications() { 35930 this._applications.clear(); 35931 } 35932 /** 35933 * Get a testability hook associated with the application 35934 * @param elem root element 35935 */ 35936 getTestability(elem) { 35937 return this._applications.get(elem) || null; 35938 } 35939 /** 35940 * Get all registered testabilities 35941 */ 35942 getAllTestabilities() { 35943 return Array.from(this._applications.values()); 35944 } 35945 /** 35946 * Get all registered applications(root elements) 35947 */ 35948 getAllRootElements() { 35949 return Array.from(this._applications.keys()); 35950 } 35951 /** 35952 * Find testability of a node in the Tree 35953 * @param elem node 35954 * @param findInAncestors whether finding testability in ancestors if testability was not found in 35955 * current node 35956 */ 35957 findTestabilityInTree(elem, findInAncestors = true) { 35958 return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors); 35959 } 35960} 35961TestabilityRegistry.ɵfac = function TestabilityRegistry_Factory(t) { return new (t || TestabilityRegistry)(); }; 35962TestabilityRegistry.ɵprov = ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac }); 35963TestabilityRegistry.ctorParameters = () => []; 35964/*@__PURE__*/ (function () { setClassMetadata(TestabilityRegistry, [{ 35965 type: Injectable 35966 }], function () { return []; }, null); })(); 35967class _NoopGetTestability { 35968 addToWindow(registry) { } 35969 findTestabilityInTree(registry, elem, findInAncestors) { 35970 return null; 35971 } 35972} 35973/** 35974 * Set the {@link GetTestability} implementation used by the Angular testing framework. 35975 * @publicApi 35976 */ 35977function setTestabilityGetter(getter) { 35978 _testabilityGetter = getter; 35979} 35980let _testabilityGetter = new _NoopGetTestability(); 35981 35982/** 35983 * @license 35984 * Copyright Google LLC All Rights Reserved. 35985 * 35986 * Use of this source code is governed by an MIT-style license that can be 35987 * found in the LICENSE file at https://angular.io/license 35988 */ 35989let _platform; 35990let compileNgModuleFactory = compileNgModuleFactory__POST_R3__; 35991function compileNgModuleFactory__PRE_R3__(injector, options, moduleType) { 35992 const compilerFactory = injector.get(CompilerFactory); 35993 const compiler = compilerFactory.createCompiler([options]); 35994 return compiler.compileModuleAsync(moduleType); 35995} 35996function compileNgModuleFactory__POST_R3__(injector, options, moduleType) { 35997 ngDevMode && assertNgModuleType(moduleType); 35998 const moduleFactory = new NgModuleFactory$1(moduleType); 35999 // All of the logic below is irrelevant for AOT-compiled code. 36000 if (typeof ngJitMode !== 'undefined' && !ngJitMode) { 36001 return Promise.resolve(moduleFactory); 36002 } 36003 const compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options); 36004 // Configure the compiler to use the provided options. This call may fail when multiple modules 36005 // are bootstrapped with incompatible options, as a component can only be compiled according to 36006 // a single set of options. 36007 setJitOptions({ 36008 defaultEncapsulation: _lastDefined(compilerOptions.map(opts => opts.defaultEncapsulation)), 36009 preserveWhitespaces: _lastDefined(compilerOptions.map(opts => opts.preserveWhitespaces)), 36010 }); 36011 if (isComponentResourceResolutionQueueEmpty()) { 36012 return Promise.resolve(moduleFactory); 36013 } 36014 const compilerProviders = _mergeArrays(compilerOptions.map(o => o.providers)); 36015 // In case there are no compiler providers, we just return the module factory as 36016 // there won't be any resource loader. This can happen with Ivy, because AOT compiled 36017 // modules can be still passed through "bootstrapModule". In that case we shouldn't 36018 // unnecessarily require the JIT compiler. 36019 if (compilerProviders.length === 0) { 36020 return Promise.resolve(moduleFactory); 36021 } 36022 const compiler = getCompilerFacade(); 36023 const compilerInjector = Injector.create({ providers: compilerProviders }); 36024 const resourceLoader = compilerInjector.get(compiler.ResourceLoader); 36025 // The resource loader can also return a string while the "resolveComponentResources" 36026 // always expects a promise. Therefore we need to wrap the returned value in a promise. 36027 return resolveComponentResources(url => Promise.resolve(resourceLoader.get(url))) 36028 .then(() => moduleFactory); 36029} 36030// the `window.ng` global utilities are only available in non-VE versions of 36031// Angular. The function switch below will make sure that the code is not 36032// included into Angular when PRE mode is active. 36033function publishDefaultGlobalUtils__PRE_R3__() { } 36034function publishDefaultGlobalUtils__POST_R3__() { 36035 ngDevMode && publishDefaultGlobalUtils(); 36036} 36037let publishDefaultGlobalUtils$1 = publishDefaultGlobalUtils__POST_R3__; 36038let isBoundToModule = isBoundToModule__POST_R3__; 36039function isBoundToModule__PRE_R3__(cf) { 36040 return cf instanceof ComponentFactoryBoundToModule; 36041} 36042function isBoundToModule__POST_R3__(cf) { 36043 return cf.isBoundToModule; 36044} 36045const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken'); 36046/** 36047 * A token for third-party components that can register themselves with NgProbe. 36048 * 36049 * @publicApi 36050 */ 36051class NgProbeToken { 36052 constructor(name, token) { 36053 this.name = name; 36054 this.token = token; 36055 } 36056} 36057/** 36058 * Creates a platform. 36059 * Platforms must be created on launch using this function. 36060 * 36061 * @publicApi 36062 */ 36063function createPlatform(injector) { 36064 if (_platform && !_platform.destroyed && 36065 !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) { 36066 throw new Error('There can be only one platform. Destroy the previous one to create a new one.'); 36067 } 36068 publishDefaultGlobalUtils$1(); 36069 _platform = injector.get(PlatformRef); 36070 const inits = injector.get(PLATFORM_INITIALIZER, null); 36071 if (inits) 36072 inits.forEach((init) => init()); 36073 return _platform; 36074} 36075/** 36076 * Creates a factory for a platform. Can be used to provide or override `Providers` specific to 36077 * your applciation's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`. 36078 * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories 36079 * to build up configurations that might be required by different libraries or parts of the 36080 * application. 36081 * @param name Identifies the new platform factory. 36082 * @param providers A set of dependency providers for platforms created with the new factory. 36083 * 36084 * @publicApi 36085 */ 36086function createPlatformFactory(parentPlatformFactory, name, providers = []) { 36087 const desc = `Platform: ${name}`; 36088 const marker = new InjectionToken(desc); 36089 return (extraProviders = []) => { 36090 let platform = getPlatform(); 36091 if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) { 36092 if (parentPlatformFactory) { 36093 parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true })); 36094 } 36095 else { 36096 const injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, { 36097 provide: INJECTOR_SCOPE, 36098 useValue: 'platform' 36099 }); 36100 createPlatform(Injector.create({ providers: injectedProviders, name: desc })); 36101 } 36102 } 36103 return assertPlatform(marker); 36104 }; 36105} 36106/** 36107 * Checks that there is currently a platform that contains the given token as a provider. 36108 * 36109 * @publicApi 36110 */ 36111function assertPlatform(requiredToken) { 36112 const platform = getPlatform(); 36113 if (!platform) { 36114 throw new Error('No platform exists!'); 36115 } 36116 if (!platform.injector.get(requiredToken, null)) { 36117 throw new Error('A platform with a different configuration has been created. Please destroy it first.'); 36118 } 36119 return platform; 36120} 36121/** 36122 * Destroys the current Angular platform and all Angular applications on the page. 36123 * Destroys all modules and listeners registered with the platform. 36124 * 36125 * @publicApi 36126 */ 36127function destroyPlatform() { 36128 if (_platform && !_platform.destroyed) { 36129 _platform.destroy(); 36130 } 36131} 36132/** 36133 * Returns the current platform. 36134 * 36135 * @publicApi 36136 */ 36137function getPlatform() { 36138 return _platform && !_platform.destroyed ? _platform : null; 36139} 36140/** 36141 * The Angular platform is the entry point for Angular on a web page. 36142 * Each page has exactly one platform. Services (such as reflection) which are common 36143 * to every Angular application running on the page are bound in its scope. 36144 * A page's platform is initialized implicitly when a platform is created using a platform 36145 * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function. 36146 * 36147 * @publicApi 36148 */ 36149class PlatformRef { 36150 /** @internal */ 36151 constructor(_injector) { 36152 this._injector = _injector; 36153 this._modules = []; 36154 this._destroyListeners = []; 36155 this._destroyed = false; 36156 } 36157 /** 36158 * Creates an instance of an `@NgModule` for the given platform for offline compilation. 36159 * 36160 * @usageNotes 36161 * 36162 * The following example creates the NgModule for a browser platform. 36163 * 36164 * ```typescript 36165 * my_module.ts: 36166 * 36167 * @NgModule({ 36168 * imports: [BrowserModule] 36169 * }) 36170 * class MyModule {} 36171 * 36172 * main.ts: 36173 * import {MyModuleNgFactory} from './my_module.ngfactory'; 36174 * import {platformBrowser} from '@angular/platform-browser'; 36175 * 36176 * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory); 36177 * ``` 36178 */ 36179 bootstrapModuleFactory(moduleFactory, options) { 36180 // Note: We need to create the NgZone _before_ we instantiate the module, 36181 // as instantiating the module creates some providers eagerly. 36182 // So we create a mini parent injector that just contains the new NgZone and 36183 // pass that as parent to the NgModuleFactory. 36184 const ngZoneOption = options ? options.ngZone : undefined; 36185 const ngZoneEventCoalescing = (options && options.ngZoneEventCoalescing) || false; 36186 const ngZone = getNgZone(ngZoneOption, ngZoneEventCoalescing); 36187 const providers = [{ provide: NgZone, useValue: ngZone }]; 36188 // Attention: Don't use ApplicationRef.run here, 36189 // as we want to be sure that all possible constructor calls are inside `ngZone.run`! 36190 return ngZone.run(() => { 36191 const ngZoneInjector = Injector.create({ providers: providers, parent: this.injector, name: moduleFactory.moduleType.name }); 36192 const moduleRef = moduleFactory.create(ngZoneInjector); 36193 const exceptionHandler = moduleRef.injector.get(ErrorHandler, null); 36194 if (!exceptionHandler) { 36195 throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?'); 36196 } 36197 moduleRef.onDestroy(() => remove(this._modules, moduleRef)); 36198 ngZone.runOutsideAngular(() => ngZone.onError.subscribe({ 36199 next: (error) => { 36200 exceptionHandler.handleError(error); 36201 } 36202 })); 36203 return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => { 36204 const initStatus = moduleRef.injector.get(ApplicationInitStatus); 36205 initStatus.runInitializers(); 36206 return initStatus.donePromise.then(() => { 36207 if (ivyEnabled) { 36208 // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy 36209 const localeId = moduleRef.injector.get(LOCALE_ID$1, DEFAULT_LOCALE_ID); 36210 setLocaleId(localeId || DEFAULT_LOCALE_ID); 36211 } 36212 this._moduleDoBootstrap(moduleRef); 36213 return moduleRef; 36214 }); 36215 }); 36216 }); 36217 } 36218 /** 36219 * Creates an instance of an `@NgModule` for a given platform using the given runtime compiler. 36220 * 36221 * @usageNotes 36222 * ### Simple Example 36223 * 36224 * ```typescript 36225 * @NgModule({ 36226 * imports: [BrowserModule] 36227 * }) 36228 * class MyModule {} 36229 * 36230 * let moduleRef = platformBrowser().bootstrapModule(MyModule); 36231 * ``` 36232 * 36233 */ 36234 bootstrapModule(moduleType, compilerOptions = []) { 36235 const options = optionsReducer({}, compilerOptions); 36236 return compileNgModuleFactory(this.injector, options, moduleType) 36237 .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options)); 36238 } 36239 _moduleDoBootstrap(moduleRef) { 36240 const appRef = moduleRef.injector.get(ApplicationRef); 36241 if (moduleRef._bootstrapComponents.length > 0) { 36242 moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f)); 36243 } 36244 else if (moduleRef.instance.ngDoBootstrap) { 36245 moduleRef.instance.ngDoBootstrap(appRef); 36246 } 36247 else { 36248 throw new Error(`The module ${stringify(moduleRef.instance 36249 .constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` + 36250 `Please define one of these.`); 36251 } 36252 this._modules.push(moduleRef); 36253 } 36254 /** 36255 * Registers a listener to be called when the platform is destroyed. 36256 */ 36257 onDestroy(callback) { 36258 this._destroyListeners.push(callback); 36259 } 36260 /** 36261 * Retrieves the platform {@link Injector}, which is the parent injector for 36262 * every Angular application on the page and provides singleton providers. 36263 */ 36264 get injector() { 36265 return this._injector; 36266 } 36267 /** 36268 * Destroys the current Angular platform and all Angular applications on the page. 36269 * Destroys all modules and listeners registered with the platform. 36270 */ 36271 destroy() { 36272 if (this._destroyed) { 36273 throw new Error('The platform has already been destroyed!'); 36274 } 36275 this._modules.slice().forEach(module => module.destroy()); 36276 this._destroyListeners.forEach(listener => listener()); 36277 this._destroyed = true; 36278 } 36279 get destroyed() { 36280 return this._destroyed; 36281 } 36282} 36283PlatformRef.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; 36284PlatformRef.ɵprov = ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac }); 36285PlatformRef.ctorParameters = () => [ 36286 { type: Injector } 36287]; 36288/*@__PURE__*/ (function () { setClassMetadata(PlatformRef, [{ 36289 type: Injectable 36290 }], function () { return [{ type: Injector }]; }, null); })(); 36291function getNgZone(ngZoneOption, ngZoneEventCoalescing) { 36292 let ngZone; 36293 if (ngZoneOption === 'noop') { 36294 ngZone = new NoopNgZone(); 36295 } 36296 else { 36297 ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) || new NgZone({ 36298 enableLongStackTrace: isDevMode(), 36299 shouldCoalesceEventChangeDetection: ngZoneEventCoalescing 36300 }); 36301 } 36302 return ngZone; 36303} 36304function _callAndReportToErrorHandler(errorHandler, ngZone, callback) { 36305 try { 36306 const result = callback(); 36307 if (isPromise(result)) { 36308 return result.catch((e) => { 36309 ngZone.runOutsideAngular(() => errorHandler.handleError(e)); 36310 // rethrow as the exception handler might not do it 36311 throw e; 36312 }); 36313 } 36314 return result; 36315 } 36316 catch (e) { 36317 ngZone.runOutsideAngular(() => errorHandler.handleError(e)); 36318 // rethrow as the exception handler might not do it 36319 throw e; 36320 } 36321} 36322function optionsReducer(dst, objs) { 36323 if (Array.isArray(objs)) { 36324 dst = objs.reduce(optionsReducer, dst); 36325 } 36326 else { 36327 dst = Object.assign(Object.assign({}, dst), objs); 36328 } 36329 return dst; 36330} 36331/** 36332 * A reference to an Angular application running on a page. 36333 * 36334 * @usageNotes 36335 * 36336 * {@a is-stable-examples} 36337 * ### isStable examples and caveats 36338 * 36339 * Note two important points about `isStable`, demonstrated in the examples below: 36340 * - the application will never be stable if you start any kind 36341 * of recurrent asynchronous task when the application starts 36342 * (for example for a polling process, started with a `setInterval`, a `setTimeout` 36343 * or using RxJS operators like `interval`); 36344 * - the `isStable` Observable runs outside of the Angular zone. 36345 * 36346 * Let's imagine that you start a recurrent task 36347 * (here incrementing a counter, using RxJS `interval`), 36348 * and at the same time subscribe to `isStable`. 36349 * 36350 * ``` 36351 * constructor(appRef: ApplicationRef) { 36352 * appRef.isStable.pipe( 36353 * filter(stable => stable) 36354 * ).subscribe(() => console.log('App is stable now'); 36355 * interval(1000).subscribe(counter => console.log(counter)); 36356 * } 36357 * ``` 36358 * In this example, `isStable` will never emit `true`, 36359 * and the trace "App is stable now" will never get logged. 36360 * 36361 * If you want to execute something when the app is stable, 36362 * you have to wait for the application to be stable 36363 * before starting your polling process. 36364 * 36365 * ``` 36366 * constructor(appRef: ApplicationRef) { 36367 * appRef.isStable.pipe( 36368 * first(stable => stable), 36369 * tap(stable => console.log('App is stable now')), 36370 * switchMap(() => interval(1000)) 36371 * ).subscribe(counter => console.log(counter)); 36372 * } 36373 * ``` 36374 * In this example, the trace "App is stable now" will be logged 36375 * and then the counter starts incrementing every second. 36376 * 36377 * Note also that this Observable runs outside of the Angular zone, 36378 * which means that the code in the subscription 36379 * to this Observable will not trigger the change detection. 36380 * 36381 * Let's imagine that instead of logging the counter value, 36382 * you update a field of your component 36383 * and display it in its template. 36384 * 36385 * ``` 36386 * constructor(appRef: ApplicationRef) { 36387 * appRef.isStable.pipe( 36388 * first(stable => stable), 36389 * switchMap(() => interval(1000)) 36390 * ).subscribe(counter => this.value = counter); 36391 * } 36392 * ``` 36393 * As the `isStable` Observable runs outside the zone, 36394 * the `value` field will be updated properly, 36395 * but the template will not be refreshed! 36396 * 36397 * You'll have to manually trigger the change detection to update the template. 36398 * 36399 * ``` 36400 * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) { 36401 * appRef.isStable.pipe( 36402 * first(stable => stable), 36403 * switchMap(() => interval(1000)) 36404 * ).subscribe(counter => { 36405 * this.value = counter; 36406 * cd.detectChanges(); 36407 * }); 36408 * } 36409 * ``` 36410 * 36411 * Or make the subscription callback run inside the zone. 36412 * 36413 * ``` 36414 * constructor(appRef: ApplicationRef, zone: NgZone) { 36415 * appRef.isStable.pipe( 36416 * first(stable => stable), 36417 * switchMap(() => interval(1000)) 36418 * ).subscribe(counter => zone.run(() => this.value = counter)); 36419 * } 36420 * ``` 36421 * 36422 * @publicApi 36423 */ 36424class ApplicationRef { 36425 /** @internal */ 36426 constructor(_zone, _console, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) { 36427 this._zone = _zone; 36428 this._console = _console; 36429 this._injector = _injector; 36430 this._exceptionHandler = _exceptionHandler; 36431 this._componentFactoryResolver = _componentFactoryResolver; 36432 this._initStatus = _initStatus; 36433 /** @internal */ 36434 this._bootstrapListeners = []; 36435 this._views = []; 36436 this._runningTick = false; 36437 this._enforceNoNewChanges = false; 36438 this._stable = true; 36439 /** 36440 * Get a list of component types registered to this application. 36441 * This list is populated even before the component is created. 36442 */ 36443 this.componentTypes = []; 36444 /** 36445 * Get a list of components registered to this application. 36446 */ 36447 this.components = []; 36448 this._enforceNoNewChanges = isDevMode(); 36449 this._zone.onMicrotaskEmpty.subscribe({ 36450 next: () => { 36451 this._zone.run(() => { 36452 this.tick(); 36453 }); 36454 } 36455 }); 36456 const isCurrentlyStable = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Observable"]((observer) => { 36457 this._stable = this._zone.isStable && !this._zone.hasPendingMacrotasks && 36458 !this._zone.hasPendingMicrotasks; 36459 this._zone.runOutsideAngular(() => { 36460 observer.next(this._stable); 36461 observer.complete(); 36462 }); 36463 }); 36464 const isStable = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Observable"]((observer) => { 36465 // Create the subscription to onStable outside the Angular Zone so that 36466 // the callback is run outside the Angular Zone. 36467 let stableSub; 36468 this._zone.runOutsideAngular(() => { 36469 stableSub = this._zone.onStable.subscribe(() => { 36470 NgZone.assertNotInAngularZone(); 36471 // Check whether there are no pending macro/micro tasks in the next tick 36472 // to allow for NgZone to update the state. 36473 scheduleMicroTask(() => { 36474 if (!this._stable && !this._zone.hasPendingMacrotasks && 36475 !this._zone.hasPendingMicrotasks) { 36476 this._stable = true; 36477 observer.next(true); 36478 } 36479 }); 36480 }); 36481 }); 36482 const unstableSub = this._zone.onUnstable.subscribe(() => { 36483 NgZone.assertInAngularZone(); 36484 if (this._stable) { 36485 this._stable = false; 36486 this._zone.runOutsideAngular(() => { 36487 observer.next(false); 36488 }); 36489 } 36490 }); 36491 return () => { 36492 stableSub.unsubscribe(); 36493 unstableSub.unsubscribe(); 36494 }; 36495 }); 36496 this.isStable = 36497 Object(rxjs__WEBPACK_IMPORTED_MODULE_0__["merge"])(isCurrentlyStable, isStable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["share"])())); 36498 } 36499 /** 36500 * Bootstrap a new component at the root level of the application. 36501 * 36502 * @usageNotes 36503 * ### Bootstrap process 36504 * 36505 * When bootstrapping a new root component into an application, Angular mounts the 36506 * specified application component onto DOM elements identified by the componentType's 36507 * selector and kicks off automatic change detection to finish initializing the component. 36508 * 36509 * Optionally, a component can be mounted onto a DOM element that does not match the 36510 * componentType's selector. 36511 * 36512 * ### Example 36513 * {@example core/ts/platform/platform.ts region='longform'} 36514 */ 36515 bootstrap(componentOrFactory, rootSelectorOrNode) { 36516 if (!this._initStatus.done) { 36517 throw new Error('Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.'); 36518 } 36519 let componentFactory; 36520 if (componentOrFactory instanceof ComponentFactory) { 36521 componentFactory = componentOrFactory; 36522 } 36523 else { 36524 componentFactory = 36525 this._componentFactoryResolver.resolveComponentFactory(componentOrFactory); 36526 } 36527 this.componentTypes.push(componentFactory.componentType); 36528 // Create a factory associated with the current module if it's not bound to some other 36529 const ngModule = isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef); 36530 const selectorOrNode = rootSelectorOrNode || componentFactory.selector; 36531 const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule); 36532 compRef.onDestroy(() => { 36533 this._unloadComponent(compRef); 36534 }); 36535 const testability = compRef.injector.get(Testability, null); 36536 if (testability) { 36537 compRef.injector.get(TestabilityRegistry) 36538 .registerApplication(compRef.location.nativeElement, testability); 36539 } 36540 this._loadComponent(compRef); 36541 if (isDevMode()) { 36542 this._console.log(`Angular is running in development mode. Call enableProdMode() to enable production mode.`); 36543 } 36544 return compRef; 36545 } 36546 /** 36547 * Invoke this method to explicitly process change detection and its side-effects. 36548 * 36549 * In development mode, `tick()` also performs a second change detection cycle to ensure that no 36550 * further changes are detected. If additional changes are picked up during this second cycle, 36551 * bindings in the app have side-effects that cannot be resolved in a single change detection 36552 * pass. 36553 * In this case, Angular throws an error, since an Angular application can only have one change 36554 * detection pass during which all change detection must complete. 36555 */ 36556 tick() { 36557 if (this._runningTick) { 36558 throw new Error('ApplicationRef.tick is called recursively'); 36559 } 36560 try { 36561 this._runningTick = true; 36562 for (let view of this._views) { 36563 view.detectChanges(); 36564 } 36565 if (this._enforceNoNewChanges) { 36566 for (let view of this._views) { 36567 view.checkNoChanges(); 36568 } 36569 } 36570 } 36571 catch (e) { 36572 // Attention: Don't rethrow as it could cancel subscriptions to Observables! 36573 this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e)); 36574 } 36575 finally { 36576 this._runningTick = false; 36577 } 36578 } 36579 /** 36580 * Attaches a view so that it will be dirty checked. 36581 * The view will be automatically detached when it is destroyed. 36582 * This will throw if the view is already attached to a ViewContainer. 36583 */ 36584 attachView(viewRef) { 36585 const view = viewRef; 36586 this._views.push(view); 36587 view.attachToAppRef(this); 36588 } 36589 /** 36590 * Detaches a view from dirty checking again. 36591 */ 36592 detachView(viewRef) { 36593 const view = viewRef; 36594 remove(this._views, view); 36595 view.detachFromAppRef(); 36596 } 36597 _loadComponent(componentRef) { 36598 this.attachView(componentRef.hostView); 36599 this.tick(); 36600 this.components.push(componentRef); 36601 // Get the listeners lazily to prevent DI cycles. 36602 const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners); 36603 listeners.forEach((listener) => listener(componentRef)); 36604 } 36605 _unloadComponent(componentRef) { 36606 this.detachView(componentRef.hostView); 36607 remove(this.components, componentRef); 36608 } 36609 /** @internal */ 36610 ngOnDestroy() { 36611 // TODO(alxhub): Dispose of the NgZone. 36612 this._views.slice().forEach((view) => view.destroy()); 36613 } 36614 /** 36615 * Returns the number of attached views. 36616 */ 36617 get viewCount() { 36618 return this._views.length; 36619 } 36620} 36621ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Console), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ComponentFactoryResolver), ɵɵinject(ApplicationInitStatus)); }; 36622ApplicationRef.ɵprov = ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac }); 36623ApplicationRef.ctorParameters = () => [ 36624 { type: NgZone }, 36625 { type: Console }, 36626 { type: Injector }, 36627 { type: ErrorHandler }, 36628 { type: ComponentFactoryResolver }, 36629 { type: ApplicationInitStatus } 36630]; 36631/*@__PURE__*/ (function () { setClassMetadata(ApplicationRef, [{ 36632 type: Injectable 36633 }], function () { return [{ type: NgZone }, { type: Console }, { type: Injector }, { type: ErrorHandler }, { type: ComponentFactoryResolver }, { type: ApplicationInitStatus }]; }, null); })(); 36634function remove(list, el) { 36635 const index = list.indexOf(el); 36636 if (index > -1) { 36637 list.splice(index, 1); 36638 } 36639} 36640function _lastDefined(args) { 36641 for (let i = args.length - 1; i >= 0; i--) { 36642 if (args[i] !== undefined) { 36643 return args[i]; 36644 } 36645 } 36646 return undefined; 36647} 36648function _mergeArrays(parts) { 36649 const result = []; 36650 parts.forEach((part) => part && result.push(...part)); 36651 return result; 36652} 36653 36654/** 36655 * @license 36656 * Copyright Google LLC All Rights Reserved. 36657 * 36658 * Use of this source code is governed by an MIT-style license that can be 36659 * found in the LICENSE file at https://angular.io/license 36660 */ 36661 36662/** 36663 * @license 36664 * Copyright Google LLC All Rights Reserved. 36665 * 36666 * Use of this source code is governed by an MIT-style license that can be 36667 * found in the LICENSE file at https://angular.io/license 36668 */ 36669 36670/** 36671 * @license 36672 * Copyright Google LLC All Rights Reserved. 36673 * 36674 * Use of this source code is governed by an MIT-style license that can be 36675 * found in the LICENSE file at https://angular.io/license 36676 */ 36677/** 36678 * Used to load ng module factories. 36679 * 36680 * @publicApi 36681 * @deprecated the `string` form of `loadChildren` is deprecated, and `NgModuleFactoryLoader` is 36682 * part of its implementation. See `LoadChildren` for more details. 36683 */ 36684class NgModuleFactoryLoader { 36685} 36686function getModuleFactory__PRE_R3__(id) { 36687 const factory = getRegisteredNgModuleType(id); 36688 if (!factory) 36689 throw noModuleError(id); 36690 return factory; 36691} 36692function getModuleFactory__POST_R3__(id) { 36693 const type = getRegisteredNgModuleType(id); 36694 if (!type) 36695 throw noModuleError(id); 36696 return new NgModuleFactory$1(type); 36697} 36698/** 36699 * Returns the NgModuleFactory with the given id, if it exists and has been loaded. 36700 * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module 36701 * cannot be found. 36702 * @publicApi 36703 */ 36704const getModuleFactory = getModuleFactory__POST_R3__; 36705function noModuleError(id) { 36706 return new Error(`No module with ID ${id} loaded`); 36707} 36708 36709/** 36710 * @license 36711 * Copyright Google LLC All Rights Reserved. 36712 * 36713 * Use of this source code is governed by an MIT-style license that can be 36714 * found in the LICENSE file at https://angular.io/license 36715 */ 36716const _SEPARATOR = '#'; 36717const FACTORY_CLASS_SUFFIX = 'NgFactory'; 36718/** 36719 * Configuration for SystemJsNgModuleLoader. 36720 * token. 36721 * 36722 * @publicApi 36723 * @deprecated the `string` form of `loadChildren` is deprecated, and `SystemJsNgModuleLoaderConfig` 36724 * is part of its implementation. See `LoadChildren` for more details. 36725 */ 36726class SystemJsNgModuleLoaderConfig { 36727} 36728const DEFAULT_CONFIG = { 36729 factoryPathPrefix: '', 36730 factoryPathSuffix: '.ngfactory', 36731}; 36732/** 36733 * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory 36734 * @publicApi 36735 * @deprecated the `string` form of `loadChildren` is deprecated, and `SystemJsNgModuleLoader` is 36736 * part of its implementation. See `LoadChildren` for more details. 36737 */ 36738class SystemJsNgModuleLoader { 36739 constructor(_compiler, config) { 36740 this._compiler = _compiler; 36741 this._config = config || DEFAULT_CONFIG; 36742 } 36743 load(path) { 36744 const legacyOfflineMode = !ivyEnabled && this._compiler instanceof Compiler; 36745 return legacyOfflineMode ? this.loadFactory(path) : this.loadAndCompile(path); 36746 } 36747 loadAndCompile(path) { 36748 let [module, exportName] = path.split(_SEPARATOR); 36749 if (exportName === undefined) { 36750 exportName = 'default'; 36751 } 36752 return __webpack_require__("./$$_lazy_route_resource lazy recursive")(module) 36753 .then((module) => module[exportName]) 36754 .then((type) => checkNotEmpty(type, module, exportName)) 36755 .then((type) => this._compiler.compileModuleAsync(type)); 36756 } 36757 loadFactory(path) { 36758 let [module, exportName] = path.split(_SEPARATOR); 36759 let factoryClassSuffix = FACTORY_CLASS_SUFFIX; 36760 if (exportName === undefined) { 36761 exportName = 'default'; 36762 factoryClassSuffix = ''; 36763 } 36764 return __webpack_require__("./$$_lazy_route_resource lazy recursive")(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix) 36765 .then((module) => module[exportName + factoryClassSuffix]) 36766 .then((factory) => checkNotEmpty(factory, module, exportName)); 36767 } 36768} 36769SystemJsNgModuleLoader.ɵfac = function SystemJsNgModuleLoader_Factory(t) { return new (t || SystemJsNgModuleLoader)(ɵɵinject(Compiler), ɵɵinject(SystemJsNgModuleLoaderConfig, 8)); }; 36770SystemJsNgModuleLoader.ɵprov = ɵɵdefineInjectable({ token: SystemJsNgModuleLoader, factory: SystemJsNgModuleLoader.ɵfac }); 36771SystemJsNgModuleLoader.ctorParameters = () => [ 36772 { type: Compiler }, 36773 { type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional }] } 36774]; 36775/*@__PURE__*/ (function () { setClassMetadata(SystemJsNgModuleLoader, [{ 36776 type: Injectable 36777 }], function () { return [{ type: Compiler }, { type: SystemJsNgModuleLoaderConfig, decorators: [{ 36778 type: Optional 36779 }] }]; }, null); })(); 36780function checkNotEmpty(value, modulePath, exportName) { 36781 if (!value) { 36782 throw new Error(`Cannot find '${exportName}' in '${modulePath}'`); 36783 } 36784 return value; 36785} 36786 36787/** 36788 * @license 36789 * Copyright Google LLC All Rights Reserved. 36790 * 36791 * Use of this source code is governed by an MIT-style license that can be 36792 * found in the LICENSE file at https://angular.io/license 36793 */ 36794/** 36795 * Represents an Angular [view](guide/glossary#view "Definition"). 36796 * 36797 * @see {@link ChangeDetectorRef#usage-notes Change detection usage} 36798 * 36799 * @publicApi 36800 */ 36801class ViewRef$1 extends ChangeDetectorRef { 36802} 36803/** 36804 * Represents an Angular [view](guide/glossary#view) in a view container. 36805 * An [embedded view](guide/glossary#view-tree) can be referenced from a component 36806 * other than the hosting component whose template defines it, or it can be defined 36807 * independently by a `TemplateRef`. 36808 * 36809 * Properties of elements in a view can change, but the structure (number and order) of elements in 36810 * a view cannot. Change the structure of elements by inserting, moving, or 36811 * removing nested views in a view container. 36812 * 36813 * @see `ViewContainerRef` 36814 * 36815 * @usageNotes 36816 * 36817 * The following template breaks down into two separate `TemplateRef` instances, 36818 * an outer one and an inner one. 36819 * 36820 * ``` 36821 * Count: {{items.length}} 36822 * <ul> 36823 * <li *ngFor="let item of items">{{item}}</li> 36824 * </ul> 36825 * ``` 36826 * 36827 * This is the outer `TemplateRef`: 36828 * 36829 * ``` 36830 * Count: {{items.length}} 36831 * <ul> 36832 * <ng-template ngFor let-item [ngForOf]="items"></ng-template> 36833 * </ul> 36834 * ``` 36835 * 36836 * This is the inner `TemplateRef`: 36837 * 36838 * ``` 36839 * <li>{{item}}</li> 36840 * ``` 36841 * 36842 * The outer and inner `TemplateRef` instances are assembled into views as follows: 36843 * 36844 * ``` 36845 * <!-- ViewRef: outer-0 --> 36846 * Count: 2 36847 * <ul> 36848 * <ng-template view-container-ref></ng-template> 36849 * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 --> 36850 * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 --> 36851 * </ul> 36852 * <!-- /ViewRef: outer-0 --> 36853 * ``` 36854 * @publicApi 36855 */ 36856class EmbeddedViewRef extends ViewRef$1 { 36857} 36858 36859/** 36860 * @license 36861 * Copyright Google LLC All Rights Reserved. 36862 * 36863 * Use of this source code is governed by an MIT-style license that can be 36864 * found in the LICENSE file at https://angular.io/license 36865 */ 36866 36867/** 36868 * @license 36869 * Copyright Google LLC All Rights Reserved. 36870 * 36871 * Use of this source code is governed by an MIT-style license that can be 36872 * found in the LICENSE file at https://angular.io/license 36873 */ 36874/** 36875 * @publicApi 36876 */ 36877class DebugEventListener { 36878 constructor(name, callback) { 36879 this.name = name; 36880 this.callback = callback; 36881 } 36882} 36883class DebugNode__PRE_R3__ { 36884 constructor(nativeNode, parent, _debugContext) { 36885 this.listeners = []; 36886 this.parent = null; 36887 this._debugContext = _debugContext; 36888 this.nativeNode = nativeNode; 36889 if (parent && parent instanceof DebugElement__PRE_R3__) { 36890 parent.addChild(this); 36891 } 36892 } 36893 get injector() { 36894 return this._debugContext.injector; 36895 } 36896 get componentInstance() { 36897 return this._debugContext.component; 36898 } 36899 get context() { 36900 return this._debugContext.context; 36901 } 36902 get references() { 36903 return this._debugContext.references; 36904 } 36905 get providerTokens() { 36906 return this._debugContext.providerTokens; 36907 } 36908} 36909class DebugElement__PRE_R3__ extends DebugNode__PRE_R3__ { 36910 constructor(nativeNode, parent, _debugContext) { 36911 super(nativeNode, parent, _debugContext); 36912 this.properties = {}; 36913 this.attributes = {}; 36914 this.classes = {}; 36915 this.styles = {}; 36916 this.childNodes = []; 36917 this.nativeElement = nativeNode; 36918 } 36919 addChild(child) { 36920 if (child) { 36921 this.childNodes.push(child); 36922 child.parent = this; 36923 } 36924 } 36925 removeChild(child) { 36926 const childIndex = this.childNodes.indexOf(child); 36927 if (childIndex !== -1) { 36928 child.parent = null; 36929 this.childNodes.splice(childIndex, 1); 36930 } 36931 } 36932 insertChildrenAfter(child, newChildren) { 36933 const siblingIndex = this.childNodes.indexOf(child); 36934 if (siblingIndex !== -1) { 36935 this.childNodes.splice(siblingIndex + 1, 0, ...newChildren); 36936 newChildren.forEach(c => { 36937 if (c.parent) { 36938 c.parent.removeChild(c); 36939 } 36940 child.parent = this; 36941 }); 36942 } 36943 } 36944 insertBefore(refChild, newChild) { 36945 const refIndex = this.childNodes.indexOf(refChild); 36946 if (refIndex === -1) { 36947 this.addChild(newChild); 36948 } 36949 else { 36950 if (newChild.parent) { 36951 newChild.parent.removeChild(newChild); 36952 } 36953 newChild.parent = this; 36954 this.childNodes.splice(refIndex, 0, newChild); 36955 } 36956 } 36957 query(predicate) { 36958 const results = this.queryAll(predicate); 36959 return results[0] || null; 36960 } 36961 queryAll(predicate) { 36962 const matches = []; 36963 _queryElementChildren(this, predicate, matches); 36964 return matches; 36965 } 36966 queryAllNodes(predicate) { 36967 const matches = []; 36968 _queryNodeChildren(this, predicate, matches); 36969 return matches; 36970 } 36971 get children() { 36972 return this.childNodes // 36973 .filter((node) => node instanceof DebugElement__PRE_R3__); 36974 } 36975 triggerEventHandler(eventName, eventObj) { 36976 this.listeners.forEach((listener) => { 36977 if (listener.name == eventName) { 36978 listener.callback(eventObj); 36979 } 36980 }); 36981 } 36982} 36983/** 36984 * @publicApi 36985 */ 36986function asNativeElements(debugEls) { 36987 return debugEls.map((el) => el.nativeElement); 36988} 36989function _queryElementChildren(element, predicate, matches) { 36990 element.childNodes.forEach(node => { 36991 if (node instanceof DebugElement__PRE_R3__) { 36992 if (predicate(node)) { 36993 matches.push(node); 36994 } 36995 _queryElementChildren(node, predicate, matches); 36996 } 36997 }); 36998} 36999function _queryNodeChildren(parentNode, predicate, matches) { 37000 if (parentNode instanceof DebugElement__PRE_R3__) { 37001 parentNode.childNodes.forEach(node => { 37002 if (predicate(node)) { 37003 matches.push(node); 37004 } 37005 if (node instanceof DebugElement__PRE_R3__) { 37006 _queryNodeChildren(node, predicate, matches); 37007 } 37008 }); 37009 } 37010} 37011class DebugNode__POST_R3__ { 37012 constructor(nativeNode) { 37013 this.nativeNode = nativeNode; 37014 } 37015 get parent() { 37016 const parent = this.nativeNode.parentNode; 37017 return parent ? new DebugElement__POST_R3__(parent) : null; 37018 } 37019 get injector() { 37020 return getInjector(this.nativeNode); 37021 } 37022 get componentInstance() { 37023 const nativeElement = this.nativeNode; 37024 return nativeElement && 37025 (getComponent(nativeElement) || getOwningComponent(nativeElement)); 37026 } 37027 get context() { 37028 return getComponent(this.nativeNode) || getContext(this.nativeNode); 37029 } 37030 get listeners() { 37031 return getListeners(this.nativeNode).filter(listener => listener.type === 'dom'); 37032 } 37033 get references() { 37034 return getLocalRefs(this.nativeNode); 37035 } 37036 get providerTokens() { 37037 return getInjectionTokens(this.nativeNode); 37038 } 37039} 37040class DebugElement__POST_R3__ extends DebugNode__POST_R3__ { 37041 constructor(nativeNode) { 37042 ngDevMode && assertDomNode(nativeNode); 37043 super(nativeNode); 37044 } 37045 get nativeElement() { 37046 return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode : null; 37047 } 37048 get name() { 37049 try { 37050 const context = loadLContext(this.nativeNode); 37051 const lView = context.lView; 37052 const tData = lView[TVIEW].data; 37053 const tNode = tData[context.nodeIndex]; 37054 return tNode.tagName; 37055 } 37056 catch (e) { 37057 return this.nativeNode.nodeName; 37058 } 37059 } 37060 /** 37061 * Gets a map of property names to property values for an element. 37062 * 37063 * This map includes: 37064 * - Regular property bindings (e.g. `[id]="id"`) 37065 * - Host property bindings (e.g. `host: { '[id]': "id" }`) 37066 * - Interpolated property bindings (e.g. `id="{{ value }}") 37067 * 37068 * It does not include: 37069 * - input property bindings (e.g. `[myCustomInput]="value"`) 37070 * - attribute bindings (e.g. `[attr.role]="menu"`) 37071 */ 37072 get properties() { 37073 const context = loadLContext(this.nativeNode, false); 37074 if (context == null) { 37075 return {}; 37076 } 37077 const lView = context.lView; 37078 const tData = lView[TVIEW].data; 37079 const tNode = tData[context.nodeIndex]; 37080 const properties = {}; 37081 // Collect properties from the DOM. 37082 copyDomProperties(this.nativeElement, properties); 37083 // Collect properties from the bindings. This is needed for animation renderer which has 37084 // synthetic properties which don't get reflected into the DOM. 37085 collectPropertyBindings(properties, tNode, lView, tData); 37086 return properties; 37087 } 37088 get attributes() { 37089 const attributes = {}; 37090 const element = this.nativeElement; 37091 if (!element) { 37092 return attributes; 37093 } 37094 const context = loadLContext(element, false); 37095 if (context == null) { 37096 return {}; 37097 } 37098 const lView = context.lView; 37099 const tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs; 37100 const lowercaseTNodeAttrs = []; 37101 // For debug nodes we take the element's attribute directly from the DOM since it allows us 37102 // to account for ones that weren't set via bindings (e.g. ViewEngine keeps track of the ones 37103 // that are set through `Renderer2`). The problem is that the browser will lowercase all names, 37104 // however since we have the attributes already on the TNode, we can preserve the case by going 37105 // through them once, adding them to the `attributes` map and putting their lower-cased name 37106 // into an array. Afterwards when we're going through the native DOM attributes, we can check 37107 // whether we haven't run into an attribute already through the TNode. 37108 if (tNodeAttrs) { 37109 let i = 0; 37110 while (i < tNodeAttrs.length) { 37111 const attrName = tNodeAttrs[i]; 37112 // Stop as soon as we hit a marker. We only care about the regular attributes. Everything 37113 // else will be handled below when we read the final attributes off the DOM. 37114 if (typeof attrName !== 'string') 37115 break; 37116 const attrValue = tNodeAttrs[i + 1]; 37117 attributes[attrName] = attrValue; 37118 lowercaseTNodeAttrs.push(attrName.toLowerCase()); 37119 i += 2; 37120 } 37121 } 37122 const eAttrs = element.attributes; 37123 for (let i = 0; i < eAttrs.length; i++) { 37124 const attr = eAttrs[i]; 37125 const lowercaseName = attr.name.toLowerCase(); 37126 // Make sure that we don't assign the same attribute both in its 37127 // case-sensitive form and the lower-cased one from the browser. 37128 if (lowercaseTNodeAttrs.indexOf(lowercaseName) === -1) { 37129 // Save the lowercase name to align the behavior between browsers. 37130 // IE preserves the case, while all other browser convert it to lower case. 37131 attributes[lowercaseName] = attr.value; 37132 } 37133 } 37134 return attributes; 37135 } 37136 get styles() { 37137 if (this.nativeElement && this.nativeElement.style) { 37138 return this.nativeElement.style; 37139 } 37140 return {}; 37141 } 37142 get classes() { 37143 const result = {}; 37144 const element = this.nativeElement; 37145 // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`. 37146 const className = element.className; 37147 const classes = className && typeof className !== 'string' ? className.baseVal.split(' ') : 37148 className.split(' '); 37149 classes.forEach((value) => result[value] = true); 37150 return result; 37151 } 37152 get childNodes() { 37153 const childNodes = this.nativeNode.childNodes; 37154 const children = []; 37155 for (let i = 0; i < childNodes.length; i++) { 37156 const element = childNodes[i]; 37157 children.push(getDebugNode__POST_R3__(element)); 37158 } 37159 return children; 37160 } 37161 get children() { 37162 const nativeElement = this.nativeElement; 37163 if (!nativeElement) 37164 return []; 37165 const childNodes = nativeElement.children; 37166 const children = []; 37167 for (let i = 0; i < childNodes.length; i++) { 37168 const element = childNodes[i]; 37169 children.push(getDebugNode__POST_R3__(element)); 37170 } 37171 return children; 37172 } 37173 query(predicate) { 37174 const results = this.queryAll(predicate); 37175 return results[0] || null; 37176 } 37177 queryAll(predicate) { 37178 const matches = []; 37179 _queryAllR3(this, predicate, matches, true); 37180 return matches; 37181 } 37182 queryAllNodes(predicate) { 37183 const matches = []; 37184 _queryAllR3(this, predicate, matches, false); 37185 return matches; 37186 } 37187 triggerEventHandler(eventName, eventObj) { 37188 const node = this.nativeNode; 37189 const invokedListeners = []; 37190 this.listeners.forEach(listener => { 37191 if (listener.name === eventName) { 37192 const callback = listener.callback; 37193 callback.call(node, eventObj); 37194 invokedListeners.push(callback); 37195 } 37196 }); 37197 // We need to check whether `eventListeners` exists, because it's something 37198 // that Zone.js only adds to `EventTarget` in browser environments. 37199 if (typeof node.eventListeners === 'function') { 37200 // Note that in Ivy we wrap event listeners with a call to `event.preventDefault` in some 37201 // cases. We use '__ngUnwrap__' as a special token that gives us access to the actual event 37202 // listener. 37203 node.eventListeners(eventName).forEach((listener) => { 37204 // In order to ensure that we can detect the special __ngUnwrap__ token described above, we 37205 // use `toString` on the listener and see if it contains the token. We use this approach to 37206 // ensure that it still worked with compiled code since it cannot remove or rename string 37207 // literals. We also considered using a special function name (i.e. if(listener.name === 37208 // special)) but that was more cumbersome and we were also concerned the compiled code could 37209 // strip the name, turning the condition in to ("" === "") and always returning true. 37210 if (listener.toString().indexOf('__ngUnwrap__') !== -1) { 37211 const unwrappedListener = listener('__ngUnwrap__'); 37212 return invokedListeners.indexOf(unwrappedListener) === -1 && 37213 unwrappedListener.call(node, eventObj); 37214 } 37215 }); 37216 } 37217 } 37218} 37219function copyDomProperties(element, properties) { 37220 if (element) { 37221 // Skip own properties (as those are patched) 37222 let obj = Object.getPrototypeOf(element); 37223 const NodePrototype = Node.prototype; 37224 while (obj !== null && obj !== NodePrototype) { 37225 const descriptors = Object.getOwnPropertyDescriptors(obj); 37226 for (let key in descriptors) { 37227 if (!key.startsWith('__') && !key.startsWith('on')) { 37228 // don't include properties starting with `__` and `on`. 37229 // `__` are patched values which should not be included. 37230 // `on` are listeners which also should not be included. 37231 const value = element[key]; 37232 if (isPrimitiveValue(value)) { 37233 properties[key] = value; 37234 } 37235 } 37236 } 37237 obj = Object.getPrototypeOf(obj); 37238 } 37239 } 37240} 37241function isPrimitiveValue(value) { 37242 return typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number' || 37243 value === null; 37244} 37245function _queryAllR3(parentElement, predicate, matches, elementsOnly) { 37246 const context = loadLContext(parentElement.nativeNode, false); 37247 if (context !== null) { 37248 const parentTNode = context.lView[TVIEW].data[context.nodeIndex]; 37249 _queryNodeChildrenR3(parentTNode, context.lView, predicate, matches, elementsOnly, parentElement.nativeNode); 37250 } 37251 else { 37252 // If the context is null, then `parentElement` was either created with Renderer2 or native DOM 37253 // APIs. 37254 _queryNativeNodeDescendants(parentElement.nativeNode, predicate, matches, elementsOnly); 37255 } 37256} 37257/** 37258 * Recursively match the current TNode against the predicate, and goes on with the next ones. 37259 * 37260 * @param tNode the current TNode 37261 * @param lView the LView of this TNode 37262 * @param predicate the predicate to match 37263 * @param matches the list of positive matches 37264 * @param elementsOnly whether only elements should be searched 37265 * @param rootNativeNode the root native node on which predicate should not be matched 37266 */ 37267function _queryNodeChildrenR3(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) { 37268 const nativeNode = getNativeByTNodeOrNull(tNode, lView); 37269 // For each type of TNode, specific logic is executed. 37270 if (tNode.type === 3 /* Element */ || tNode.type === 4 /* ElementContainer */) { 37271 // Case 1: the TNode is an element 37272 // The native node has to be checked. 37273 _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode); 37274 if (isComponentHost(tNode)) { 37275 // If the element is the host of a component, then all nodes in its view have to be processed. 37276 // Note: the component's content (tNode.child) will be processed from the insertion points. 37277 const componentView = getComponentLViewByIndex(tNode.index, lView); 37278 if (componentView && componentView[TVIEW].firstChild) { 37279 _queryNodeChildrenR3(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode); 37280 } 37281 } 37282 else { 37283 if (tNode.child) { 37284 // Otherwise, its children have to be processed. 37285 _queryNodeChildrenR3(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode); 37286 } 37287 // We also have to query the DOM directly in order to catch elements inserted through 37288 // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple 37289 // times. ViewEngine could do it more efficiently, because all the insertions go through 37290 // Renderer2, however that's not the case in Ivy. This approach is being used because: 37291 // 1. Matching the ViewEngine behavior would mean potentially introducing a depedency 37292 // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine. 37293 // 2. We would have to make `Renderer3` "know" about debug nodes. 37294 // 3. It allows us to capture nodes that were inserted directly via the DOM. 37295 nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly); 37296 } 37297 // In all cases, if a dynamic container exists for this node, each view inside it has to be 37298 // processed. 37299 const nodeOrContainer = lView[tNode.index]; 37300 if (isLContainer(nodeOrContainer)) { 37301 _queryNodeChildrenInContainerR3(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode); 37302 } 37303 } 37304 else if (tNode.type === 0 /* Container */) { 37305 // Case 2: the TNode is a container 37306 // The native node has to be checked. 37307 const lContainer = lView[tNode.index]; 37308 _addQueryMatchR3(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode); 37309 // Each view inside the container has to be processed. 37310 _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode); 37311 } 37312 else if (tNode.type === 1 /* Projection */) { 37313 // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>). 37314 // The nodes projected at this location all need to be processed. 37315 const componentView = lView[DECLARATION_COMPONENT_VIEW]; 37316 const componentHost = componentView[T_HOST]; 37317 const head = componentHost.projection[tNode.projection]; 37318 if (Array.isArray(head)) { 37319 for (let nativeNode of head) { 37320 _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode); 37321 } 37322 } 37323 else if (head) { 37324 const nextLView = componentView[PARENT]; 37325 const nextTNode = nextLView[TVIEW].data[head.index]; 37326 _queryNodeChildrenR3(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode); 37327 } 37328 } 37329 else if (tNode.child) { 37330 // Case 4: the TNode is a view. 37331 _queryNodeChildrenR3(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode); 37332 } 37333 // We don't want to go to the next sibling of the root node. 37334 if (rootNativeNode !== nativeNode) { 37335 // To determine the next node to be processed, we need to use the next or the projectionNext 37336 // link, depending on whether the current node has been projected. 37337 const nextTNode = (tNode.flags & 4 /* isProjected */) ? tNode.projectionNext : tNode.next; 37338 if (nextTNode) { 37339 _queryNodeChildrenR3(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode); 37340 } 37341 } 37342} 37343/** 37344 * Process all TNodes in a given container. 37345 * 37346 * @param lContainer the container to be processed 37347 * @param predicate the predicate to match 37348 * @param matches the list of positive matches 37349 * @param elementsOnly whether only elements should be searched 37350 * @param rootNativeNode the root native node on which predicate should not be matched 37351 */ 37352function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) { 37353 for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) { 37354 const childView = lContainer[i]; 37355 _queryNodeChildrenR3(childView[TVIEW].node, childView, predicate, matches, elementsOnly, rootNativeNode); 37356 } 37357} 37358/** 37359 * Match the current native node against the predicate. 37360 * 37361 * @param nativeNode the current native node 37362 * @param predicate the predicate to match 37363 * @param matches the list of positive matches 37364 * @param elementsOnly whether only elements should be searched 37365 * @param rootNativeNode the root native node on which predicate should not be matched 37366 */ 37367function _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode) { 37368 if (rootNativeNode !== nativeNode) { 37369 const debugNode = getDebugNode$1(nativeNode); 37370 if (!debugNode) { 37371 return; 37372 } 37373 // Type of the "predicate and "matches" array are set based on the value of 37374 // the "elementsOnly" parameter. TypeScript is not able to properly infer these 37375 // types with generics, so we manually cast the parameters accordingly. 37376 if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) && 37377 matches.indexOf(debugNode) === -1) { 37378 matches.push(debugNode); 37379 } 37380 else if (!elementsOnly && predicate(debugNode) && 37381 matches.indexOf(debugNode) === -1) { 37382 matches.push(debugNode); 37383 } 37384 } 37385} 37386/** 37387 * Match all the descendants of a DOM node against a predicate. 37388 * 37389 * @param nativeNode the current native node 37390 * @param predicate the predicate to match 37391 * @param matches the list of positive matches 37392 * @param elementsOnly whether only elements should be searched 37393 */ 37394function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) { 37395 const nodes = parentNode.childNodes; 37396 const length = nodes.length; 37397 for (let i = 0; i < length; i++) { 37398 const node = nodes[i]; 37399 const debugNode = getDebugNode$1(node); 37400 if (debugNode) { 37401 if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) && 37402 matches.indexOf(debugNode) === -1) { 37403 matches.push(debugNode); 37404 } 37405 else if (!elementsOnly && predicate(debugNode) && 37406 matches.indexOf(debugNode) === -1) { 37407 matches.push(debugNode); 37408 } 37409 _queryNativeNodeDescendants(node, predicate, matches, elementsOnly); 37410 } 37411 } 37412} 37413/** 37414 * Iterates through the property bindings for a given node and generates 37415 * a map of property names to values. This map only contains property bindings 37416 * defined in templates, not in host bindings. 37417 */ 37418function collectPropertyBindings(properties, tNode, lView, tData) { 37419 let bindingIndexes = tNode.propertyBindings; 37420 if (bindingIndexes !== null) { 37421 for (let i = 0; i < bindingIndexes.length; i++) { 37422 const bindingIndex = bindingIndexes[i]; 37423 const propMetadata = tData[bindingIndex]; 37424 const metadataParts = propMetadata.split(INTERPOLATION_DELIMITER); 37425 const propertyName = metadataParts[0]; 37426 if (metadataParts.length > 1) { 37427 let value = metadataParts[1]; 37428 for (let j = 1; j < metadataParts.length - 1; j++) { 37429 value += renderStringify(lView[bindingIndex + j - 1]) + metadataParts[j + 1]; 37430 } 37431 properties[propertyName] = value; 37432 } 37433 else { 37434 properties[propertyName] = lView[bindingIndex]; 37435 } 37436 } 37437 } 37438} 37439// Need to keep the nodes in a global Map so that multiple angular apps are supported. 37440const _nativeNodeToDebugNode = new Map(); 37441function getDebugNode__PRE_R3__(nativeNode) { 37442 return _nativeNodeToDebugNode.get(nativeNode) || null; 37443} 37444const NG_DEBUG_PROPERTY = '__ng_debug__'; 37445function getDebugNode__POST_R3__(nativeNode) { 37446 if (nativeNode instanceof Node) { 37447 if (!(nativeNode.hasOwnProperty(NG_DEBUG_PROPERTY))) { 37448 nativeNode[NG_DEBUG_PROPERTY] = nativeNode.nodeType == Node.ELEMENT_NODE ? 37449 new DebugElement__POST_R3__(nativeNode) : 37450 new DebugNode__POST_R3__(nativeNode); 37451 } 37452 return nativeNode[NG_DEBUG_PROPERTY]; 37453 } 37454 return null; 37455} 37456/** 37457 * @publicApi 37458 */ 37459const getDebugNode$1 = getDebugNode__POST_R3__; 37460function getDebugNodeR2__PRE_R3__(nativeNode) { 37461 return getDebugNode__PRE_R3__(nativeNode); 37462} 37463function getDebugNodeR2__POST_R3__(_nativeNode) { 37464 return null; 37465} 37466const getDebugNodeR2 = getDebugNodeR2__POST_R3__; 37467function getAllDebugNodes() { 37468 return Array.from(_nativeNodeToDebugNode.values()); 37469} 37470function indexDebugNode(node) { 37471 _nativeNodeToDebugNode.set(node.nativeNode, node); 37472} 37473function removeDebugNodeFromIndex(node) { 37474 _nativeNodeToDebugNode.delete(node.nativeNode); 37475} 37476/** 37477 * @publicApi 37478 */ 37479const DebugNode = DebugNode__POST_R3__; 37480/** 37481 * @publicApi 37482 */ 37483const DebugElement = DebugElement__POST_R3__; 37484 37485/** 37486 * @license 37487 * Copyright Google LLC All Rights Reserved. 37488 * 37489 * Use of this source code is governed by an MIT-style license that can be 37490 * found in the LICENSE file at https://angular.io/license 37491 */ 37492 37493/** 37494 * @license 37495 * Copyright Google LLC All Rights Reserved. 37496 * 37497 * Use of this source code is governed by an MIT-style license that can be 37498 * found in the LICENSE file at https://angular.io/license 37499 */ 37500const _CORE_PLATFORM_PROVIDERS = [ 37501 // Set a default platform name for platforms that don't set it explicitly. 37502 { provide: PLATFORM_ID, useValue: 'unknown' }, 37503 { provide: PlatformRef, deps: [Injector] }, 37504 { provide: TestabilityRegistry, deps: [] }, 37505 { provide: Console, deps: [] }, 37506]; 37507/** 37508 * This platform has to be included in any other platform 37509 * 37510 * @publicApi 37511 */ 37512const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS); 37513 37514/** 37515 * @license 37516 * Copyright Google LLC All Rights Reserved. 37517 * 37518 * Use of this source code is governed by an MIT-style license that can be 37519 * found in the LICENSE file at https://angular.io/license 37520 */ 37521function _iterableDiffersFactory() { 37522 return defaultIterableDiffers; 37523} 37524function _keyValueDiffersFactory() { 37525 return defaultKeyValueDiffers; 37526} 37527function _localeFactory(locale) { 37528 locale = locale || getGlobalLocale(); 37529 if (ivyEnabled) { 37530 setLocaleId(locale); 37531 } 37532 return locale; 37533} 37534/** 37535 * Work out the locale from the potential global properties. 37536 * 37537 * * Closure Compiler: use `goog.LOCALE`. 37538 * * Ivy enabled: use `$localize.locale` 37539 */ 37540function getGlobalLocale() { 37541 if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode && 37542 typeof goog !== 'undefined' && goog.LOCALE !== 'en') { 37543 // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`. 37544 // * In order to preserve backwards compatibility, we use Angular default value over 37545 // Closure Compiler's one. 37546 return goog.LOCALE; 37547 } 37548 else { 37549 // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE 37550 // COMPILE-TIME INLINER. 37551 // 37552 // * During compile time inlining of translations the expression will be replaced 37553 // with a string literal that is the current locale. Other forms of this expression are not 37554 // guaranteed to be replaced. 37555 // 37556 // * During runtime translation evaluation, the developer is required to set `$localize.locale` 37557 // if required, or just to provide their own `LOCALE_ID` provider. 37558 return (ivyEnabled && typeof $localize !== 'undefined' && $localize.locale) || 37559 DEFAULT_LOCALE_ID; 37560 } 37561} 37562const ɵ0$g = USD_CURRENCY_CODE; 37563/** 37564 * A built-in [dependency injection token](guide/glossary#di-token) 37565 * that is used to configure the root injector for bootstrapping. 37566 */ 37567const APPLICATION_MODULE_PROVIDERS = [ 37568 { 37569 provide: ApplicationRef, 37570 useClass: ApplicationRef, 37571 deps: [NgZone, Console, Injector, ErrorHandler, ComponentFactoryResolver, ApplicationInitStatus] 37572 }, 37573 { provide: SCHEDULER, deps: [NgZone], useFactory: zoneSchedulerFactory }, 37574 { 37575 provide: ApplicationInitStatus, 37576 useClass: ApplicationInitStatus, 37577 deps: [[new Optional(), APP_INITIALIZER]] 37578 }, 37579 { provide: Compiler, useClass: Compiler, deps: [] }, 37580 APP_ID_RANDOM_PROVIDER, 37581 { provide: IterableDiffers, useFactory: _iterableDiffersFactory, deps: [] }, 37582 { provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory, deps: [] }, 37583 { 37584 provide: LOCALE_ID$1, 37585 useFactory: _localeFactory, 37586 deps: [[new Inject(LOCALE_ID$1), new Optional(), new SkipSelf()]] 37587 }, 37588 { provide: DEFAULT_CURRENCY_CODE, useValue: ɵ0$g }, 37589]; 37590/** 37591 * Schedule work at next available slot. 37592 * 37593 * In Ivy this is just `requestAnimationFrame`. For compatibility reasons when bootstrapped 37594 * using `platformRef.bootstrap` we need to use `NgZone.onStable` as the scheduling mechanism. 37595 * This overrides the scheduling mechanism in Ivy to `NgZone.onStable`. 37596 * 37597 * @param ngZone NgZone to use for scheduling. 37598 */ 37599function zoneSchedulerFactory(ngZone) { 37600 let queue = []; 37601 ngZone.onStable.subscribe(() => { 37602 while (queue.length) { 37603 queue.pop()(); 37604 } 37605 }); 37606 return function (fn) { 37607 queue.push(fn); 37608 }; 37609} 37610/** 37611 * Configures the root injector for an app with 37612 * providers of `@angular/core` dependencies that `ApplicationRef` needs 37613 * to bootstrap components. 37614 * 37615 * Re-exported by `BrowserModule`, which is included automatically in the root 37616 * `AppModule` when you create a new app with the CLI `new` command. 37617 * 37618 * @publicApi 37619 */ 37620class ApplicationModule { 37621 // Inject ApplicationRef to make it eager... 37622 constructor(appRef) { } 37623} 37624ApplicationModule.ɵmod = ɵɵdefineNgModule({ type: ApplicationModule }); 37625ApplicationModule.ɵinj = ɵɵdefineInjector({ factory: function ApplicationModule_Factory(t) { return new (t || ApplicationModule)(ɵɵinject(ApplicationRef)); }, providers: APPLICATION_MODULE_PROVIDERS }); 37626ApplicationModule.ctorParameters = () => [ 37627 { type: ApplicationRef } 37628]; 37629/*@__PURE__*/ (function () { setClassMetadata(ApplicationModule, [{ 37630 type: NgModule, 37631 args: [{ providers: APPLICATION_MODULE_PROVIDERS }] 37632 }], function () { return [{ type: ApplicationRef }]; }, null); })(); 37633 37634/** 37635 * @license 37636 * Copyright Google LLC All Rights Reserved. 37637 * 37638 * Use of this source code is governed by an MIT-style license that can be 37639 * found in the LICENSE file at https://angular.io/license 37640 */ 37641function anchorDef(flags, matchedQueriesDsl, ngContentIndex, childCount, handleEvent, templateFactory) { 37642 flags |= 1 /* TypeElement */; 37643 const { matchedQueries, references, matchedQueryIds } = splitMatchedQueriesDsl(matchedQueriesDsl); 37644 const template = templateFactory ? resolveDefinition(templateFactory) : null; 37645 return { 37646 // will bet set by the view definition 37647 nodeIndex: -1, 37648 parent: null, 37649 renderParent: null, 37650 bindingIndex: -1, 37651 outputIndex: -1, 37652 // regular values 37653 flags, 37654 checkIndex: -1, 37655 childFlags: 0, 37656 directChildFlags: 0, 37657 childMatchedQueries: 0, 37658 matchedQueries, 37659 matchedQueryIds, 37660 references, 37661 ngContentIndex, 37662 childCount, 37663 bindings: [], 37664 bindingFlags: 0, 37665 outputs: [], 37666 element: { 37667 ns: null, 37668 name: null, 37669 attrs: null, 37670 template, 37671 componentProvider: null, 37672 componentView: null, 37673 componentRendererType: null, 37674 publicProviders: null, 37675 allProviders: null, 37676 handleEvent: handleEvent || NOOP 37677 }, 37678 provider: null, 37679 text: null, 37680 query: null, 37681 ngContent: null 37682 }; 37683} 37684function elementDef(checkIndex, flags, matchedQueriesDsl, ngContentIndex, childCount, namespaceAndName, fixedAttrs = [], bindings, outputs, handleEvent, componentView, componentRendererType) { 37685 if (!handleEvent) { 37686 handleEvent = NOOP; 37687 } 37688 const { matchedQueries, references, matchedQueryIds } = splitMatchedQueriesDsl(matchedQueriesDsl); 37689 let ns = null; 37690 let name = null; 37691 if (namespaceAndName) { 37692 [ns, name] = splitNamespace(namespaceAndName); 37693 } 37694 bindings = bindings || []; 37695 const bindingDefs = []; 37696 for (let i = 0; i < bindings.length; i++) { 37697 const [bindingFlags, namespaceAndName, suffixOrSecurityContext] = bindings[i]; 37698 const [ns, name] = splitNamespace(namespaceAndName); 37699 let securityContext = undefined; 37700 let suffix = undefined; 37701 switch (bindingFlags & 15 /* Types */) { 37702 case 4 /* TypeElementStyle */: 37703 suffix = suffixOrSecurityContext; 37704 break; 37705 case 1 /* TypeElementAttribute */: 37706 case 8 /* TypeProperty */: 37707 securityContext = suffixOrSecurityContext; 37708 break; 37709 } 37710 bindingDefs[i] = 37711 { flags: bindingFlags, ns, name, nonMinifiedName: name, securityContext, suffix }; 37712 } 37713 outputs = outputs || []; 37714 const outputDefs = []; 37715 for (let i = 0; i < outputs.length; i++) { 37716 const [target, eventName] = outputs[i]; 37717 outputDefs[i] = 37718 { type: 0 /* ElementOutput */, target: target, eventName, propName: null }; 37719 } 37720 fixedAttrs = fixedAttrs || []; 37721 const attrs = fixedAttrs.map(([namespaceAndName, value]) => { 37722 const [ns, name] = splitNamespace(namespaceAndName); 37723 return [ns, name, value]; 37724 }); 37725 componentRendererType = resolveRendererType2(componentRendererType); 37726 if (componentView) { 37727 flags |= 33554432 /* ComponentView */; 37728 } 37729 flags |= 1 /* TypeElement */; 37730 return { 37731 // will bet set by the view definition 37732 nodeIndex: -1, 37733 parent: null, 37734 renderParent: null, 37735 bindingIndex: -1, 37736 outputIndex: -1, 37737 // regular values 37738 checkIndex, 37739 flags, 37740 childFlags: 0, 37741 directChildFlags: 0, 37742 childMatchedQueries: 0, 37743 matchedQueries, 37744 matchedQueryIds, 37745 references, 37746 ngContentIndex, 37747 childCount, 37748 bindings: bindingDefs, 37749 bindingFlags: calcBindingFlags(bindingDefs), 37750 outputs: outputDefs, 37751 element: { 37752 ns, 37753 name, 37754 attrs, 37755 template: null, 37756 // will bet set by the view definition 37757 componentProvider: null, 37758 componentView: componentView || null, 37759 componentRendererType: componentRendererType, 37760 publicProviders: null, 37761 allProviders: null, 37762 handleEvent: handleEvent || NOOP, 37763 }, 37764 provider: null, 37765 text: null, 37766 query: null, 37767 ngContent: null 37768 }; 37769} 37770function createElement(view, renderHost, def) { 37771 const elDef = def.element; 37772 const rootSelectorOrNode = view.root.selectorOrNode; 37773 const renderer = view.renderer; 37774 let el; 37775 if (view.parent || !rootSelectorOrNode) { 37776 if (elDef.name) { 37777 el = renderer.createElement(elDef.name, elDef.ns); 37778 } 37779 else { 37780 el = renderer.createComment(''); 37781 } 37782 const parentEl = getParentRenderElement(view, renderHost, def); 37783 if (parentEl) { 37784 renderer.appendChild(parentEl, el); 37785 } 37786 } 37787 else { 37788 // when using native Shadow DOM, do not clear the root element contents to allow slot projection 37789 const preserveContent = (!!elDef.componentRendererType && 37790 elDef.componentRendererType.encapsulation === ViewEncapsulation$1.ShadowDom); 37791 el = renderer.selectRootElement(rootSelectorOrNode, preserveContent); 37792 } 37793 if (elDef.attrs) { 37794 for (let i = 0; i < elDef.attrs.length; i++) { 37795 const [ns, name, value] = elDef.attrs[i]; 37796 renderer.setAttribute(el, name, value, ns); 37797 } 37798 } 37799 return el; 37800} 37801function listenToElementOutputs(view, compView, def, el) { 37802 for (let i = 0; i < def.outputs.length; i++) { 37803 const output = def.outputs[i]; 37804 const handleEventClosure = renderEventHandlerClosure(view, def.nodeIndex, elementEventFullName(output.target, output.eventName)); 37805 let listenTarget = output.target; 37806 let listenerView = view; 37807 if (output.target === 'component') { 37808 listenTarget = null; 37809 listenerView = compView; 37810 } 37811 const disposable = listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure); 37812 view.disposables[def.outputIndex + i] = disposable; 37813 } 37814} 37815function renderEventHandlerClosure(view, index, eventName) { 37816 return (event) => dispatchEvent(view, index, eventName, event); 37817} 37818function checkAndUpdateElementInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 37819 const bindLen = def.bindings.length; 37820 let changed = false; 37821 if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0)) 37822 changed = true; 37823 if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1)) 37824 changed = true; 37825 if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2)) 37826 changed = true; 37827 if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3)) 37828 changed = true; 37829 if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4)) 37830 changed = true; 37831 if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5)) 37832 changed = true; 37833 if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6)) 37834 changed = true; 37835 if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7)) 37836 changed = true; 37837 if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8)) 37838 changed = true; 37839 if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9)) 37840 changed = true; 37841 return changed; 37842} 37843function checkAndUpdateElementDynamic(view, def, values) { 37844 let changed = false; 37845 for (let i = 0; i < values.length; i++) { 37846 if (checkAndUpdateElementValue(view, def, i, values[i])) 37847 changed = true; 37848 } 37849 return changed; 37850} 37851function checkAndUpdateElementValue(view, def, bindingIdx, value) { 37852 if (!checkAndUpdateBinding(view, def, bindingIdx, value)) { 37853 return false; 37854 } 37855 const binding = def.bindings[bindingIdx]; 37856 const elData = asElementData(view, def.nodeIndex); 37857 const renderNode = elData.renderElement; 37858 const name = binding.name; 37859 switch (binding.flags & 15 /* Types */) { 37860 case 1 /* TypeElementAttribute */: 37861 setElementAttribute(view, binding, renderNode, binding.ns, name, value); 37862 break; 37863 case 2 /* TypeElementClass */: 37864 setElementClass(view, renderNode, name, value); 37865 break; 37866 case 4 /* TypeElementStyle */: 37867 setElementStyle(view, binding, renderNode, name, value); 37868 break; 37869 case 8 /* TypeProperty */: 37870 const bindView = (def.flags & 33554432 /* ComponentView */ && 37871 binding.flags & 32 /* SyntheticHostProperty */) ? 37872 elData.componentView : 37873 view; 37874 setElementProperty(bindView, binding, renderNode, name, value); 37875 break; 37876 } 37877 return true; 37878} 37879function setElementAttribute(view, binding, renderNode, ns, name, value) { 37880 const securityContext = binding.securityContext; 37881 let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value; 37882 renderValue = renderValue != null ? renderValue.toString() : null; 37883 const renderer = view.renderer; 37884 if (value != null) { 37885 renderer.setAttribute(renderNode, name, renderValue, ns); 37886 } 37887 else { 37888 renderer.removeAttribute(renderNode, name, ns); 37889 } 37890} 37891function setElementClass(view, renderNode, name, value) { 37892 const renderer = view.renderer; 37893 if (value) { 37894 renderer.addClass(renderNode, name); 37895 } 37896 else { 37897 renderer.removeClass(renderNode, name); 37898 } 37899} 37900function setElementStyle(view, binding, renderNode, name, value) { 37901 let renderValue = view.root.sanitizer.sanitize(SecurityContext.STYLE, value); 37902 if (renderValue != null) { 37903 renderValue = renderValue.toString(); 37904 const unit = binding.suffix; 37905 if (unit != null) { 37906 renderValue = renderValue + unit; 37907 } 37908 } 37909 else { 37910 renderValue = null; 37911 } 37912 const renderer = view.renderer; 37913 if (renderValue != null) { 37914 renderer.setStyle(renderNode, name, renderValue); 37915 } 37916 else { 37917 renderer.removeStyle(renderNode, name); 37918 } 37919} 37920function setElementProperty(view, binding, renderNode, name, value) { 37921 const securityContext = binding.securityContext; 37922 let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value; 37923 view.renderer.setProperty(renderNode, name, renderValue); 37924} 37925 37926/** 37927 * @license 37928 * Copyright Google LLC All Rights Reserved. 37929 * 37930 * Use of this source code is governed by an MIT-style license that can be 37931 * found in the LICENSE file at https://angular.io/license 37932 */ 37933function queryDef(flags, id, bindings) { 37934 let bindingDefs = []; 37935 for (let propName in bindings) { 37936 const bindingType = bindings[propName]; 37937 bindingDefs.push({ propName, bindingType }); 37938 } 37939 return { 37940 // will bet set by the view definition 37941 nodeIndex: -1, 37942 parent: null, 37943 renderParent: null, 37944 bindingIndex: -1, 37945 outputIndex: -1, 37946 // regular values 37947 // TODO(vicb): check 37948 checkIndex: -1, 37949 flags, 37950 childFlags: 0, 37951 directChildFlags: 0, 37952 childMatchedQueries: 0, 37953 ngContentIndex: -1, 37954 matchedQueries: {}, 37955 matchedQueryIds: 0, 37956 references: {}, 37957 childCount: 0, 37958 bindings: [], 37959 bindingFlags: 0, 37960 outputs: [], 37961 element: null, 37962 provider: null, 37963 text: null, 37964 query: { id, filterId: filterQueryId(id), bindings: bindingDefs }, 37965 ngContent: null 37966 }; 37967} 37968function createQuery() { 37969 return new QueryList(); 37970} 37971function dirtyParentQueries(view) { 37972 const queryIds = view.def.nodeMatchedQueries; 37973 while (view.parent && isEmbeddedView(view)) { 37974 let tplDef = view.parentNodeDef; 37975 view = view.parent; 37976 // content queries 37977 const end = tplDef.nodeIndex + tplDef.childCount; 37978 for (let i = 0; i <= end; i++) { 37979 const nodeDef = view.def.nodes[i]; 37980 if ((nodeDef.flags & 67108864 /* TypeContentQuery */) && 37981 (nodeDef.flags & 536870912 /* DynamicQuery */) && 37982 (nodeDef.query.filterId & queryIds) === nodeDef.query.filterId) { 37983 asQueryList(view, i).setDirty(); 37984 } 37985 if ((nodeDef.flags & 1 /* TypeElement */ && i + nodeDef.childCount < tplDef.nodeIndex) || 37986 !(nodeDef.childFlags & 67108864 /* TypeContentQuery */) || 37987 !(nodeDef.childFlags & 536870912 /* DynamicQuery */)) { 37988 // skip elements that don't contain the template element or no query. 37989 i += nodeDef.childCount; 37990 } 37991 } 37992 } 37993 // view queries 37994 if (view.def.nodeFlags & 134217728 /* TypeViewQuery */) { 37995 for (let i = 0; i < view.def.nodes.length; i++) { 37996 const nodeDef = view.def.nodes[i]; 37997 if ((nodeDef.flags & 134217728 /* TypeViewQuery */) && (nodeDef.flags & 536870912 /* DynamicQuery */)) { 37998 asQueryList(view, i).setDirty(); 37999 } 38000 // only visit the root nodes 38001 i += nodeDef.childCount; 38002 } 38003 } 38004} 38005function checkAndUpdateQuery(view, nodeDef) { 38006 const queryList = asQueryList(view, nodeDef.nodeIndex); 38007 if (!queryList.dirty) { 38008 return; 38009 } 38010 let directiveInstance; 38011 let newValues = undefined; 38012 if (nodeDef.flags & 67108864 /* TypeContentQuery */) { 38013 const elementDef = nodeDef.parent.parent; 38014 newValues = calcQueryValues(view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, nodeDef.query, []); 38015 directiveInstance = asProviderData(view, nodeDef.parent.nodeIndex).instance; 38016 } 38017 else if (nodeDef.flags & 134217728 /* TypeViewQuery */) { 38018 newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query, []); 38019 directiveInstance = view.component; 38020 } 38021 queryList.reset(newValues); 38022 const bindings = nodeDef.query.bindings; 38023 let notify = false; 38024 for (let i = 0; i < bindings.length; i++) { 38025 const binding = bindings[i]; 38026 let boundValue; 38027 switch (binding.bindingType) { 38028 case 0 /* First */: 38029 boundValue = queryList.first; 38030 break; 38031 case 1 /* All */: 38032 boundValue = queryList; 38033 notify = true; 38034 break; 38035 } 38036 directiveInstance[binding.propName] = boundValue; 38037 } 38038 if (notify) { 38039 queryList.notifyOnChanges(); 38040 } 38041} 38042function calcQueryValues(view, startIndex, endIndex, queryDef, values) { 38043 for (let i = startIndex; i <= endIndex; i++) { 38044 const nodeDef = view.def.nodes[i]; 38045 const valueType = nodeDef.matchedQueries[queryDef.id]; 38046 if (valueType != null) { 38047 values.push(getQueryValue(view, nodeDef, valueType)); 38048 } 38049 if (nodeDef.flags & 1 /* TypeElement */ && nodeDef.element.template && 38050 (nodeDef.element.template.nodeMatchedQueries & queryDef.filterId) === 38051 queryDef.filterId) { 38052 const elementData = asElementData(view, i); 38053 // check embedded views that were attached at the place of their template, 38054 // but process child nodes first if some match the query (see issue #16568) 38055 if ((nodeDef.childMatchedQueries & queryDef.filterId) === queryDef.filterId) { 38056 calcQueryValues(view, i + 1, i + nodeDef.childCount, queryDef, values); 38057 i += nodeDef.childCount; 38058 } 38059 if (nodeDef.flags & 16777216 /* EmbeddedViews */) { 38060 const embeddedViews = elementData.viewContainer._embeddedViews; 38061 for (let k = 0; k < embeddedViews.length; k++) { 38062 const embeddedView = embeddedViews[k]; 38063 const dvc = declaredViewContainer(embeddedView); 38064 if (dvc && dvc === elementData) { 38065 calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values); 38066 } 38067 } 38068 } 38069 const projectedViews = elementData.template._projectedViews; 38070 if (projectedViews) { 38071 for (let k = 0; k < projectedViews.length; k++) { 38072 const projectedView = projectedViews[k]; 38073 calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values); 38074 } 38075 } 38076 } 38077 if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) { 38078 // if no child matches the query, skip the children. 38079 i += nodeDef.childCount; 38080 } 38081 } 38082 return values; 38083} 38084function getQueryValue(view, nodeDef, queryValueType) { 38085 if (queryValueType != null) { 38086 // a match 38087 switch (queryValueType) { 38088 case 1 /* RenderElement */: 38089 return asElementData(view, nodeDef.nodeIndex).renderElement; 38090 case 0 /* ElementRef */: 38091 return new ElementRef(asElementData(view, nodeDef.nodeIndex).renderElement); 38092 case 2 /* TemplateRef */: 38093 return asElementData(view, nodeDef.nodeIndex).template; 38094 case 3 /* ViewContainerRef */: 38095 return asElementData(view, nodeDef.nodeIndex).viewContainer; 38096 case 4 /* Provider */: 38097 return asProviderData(view, nodeDef.nodeIndex).instance; 38098 } 38099 } 38100} 38101 38102/** 38103 * @license 38104 * Copyright Google LLC All Rights Reserved. 38105 * 38106 * Use of this source code is governed by an MIT-style license that can be 38107 * found in the LICENSE file at https://angular.io/license 38108 */ 38109function ngContentDef(ngContentIndex, index) { 38110 return { 38111 // will bet set by the view definition 38112 nodeIndex: -1, 38113 parent: null, 38114 renderParent: null, 38115 bindingIndex: -1, 38116 outputIndex: -1, 38117 // regular values 38118 checkIndex: -1, 38119 flags: 8 /* TypeNgContent */, 38120 childFlags: 0, 38121 directChildFlags: 0, 38122 childMatchedQueries: 0, 38123 matchedQueries: {}, 38124 matchedQueryIds: 0, 38125 references: {}, 38126 ngContentIndex, 38127 childCount: 0, 38128 bindings: [], 38129 bindingFlags: 0, 38130 outputs: [], 38131 element: null, 38132 provider: null, 38133 text: null, 38134 query: null, 38135 ngContent: { index } 38136 }; 38137} 38138function appendNgContent(view, renderHost, def) { 38139 const parentEl = getParentRenderElement(view, renderHost, def); 38140 if (!parentEl) { 38141 // Nothing to do if there is no parent element. 38142 return; 38143 } 38144 const ngContentIndex = def.ngContent.index; 38145 visitProjectedRenderNodes(view, ngContentIndex, 1 /* AppendChild */, parentEl, null, undefined); 38146} 38147 38148/** 38149 * @license 38150 * Copyright Google LLC All Rights Reserved. 38151 * 38152 * Use of this source code is governed by an MIT-style license that can be 38153 * found in the LICENSE file at https://angular.io/license 38154 */ 38155function purePipeDef(checkIndex, argCount) { 38156 // argCount + 1 to include the pipe as first arg 38157 return _pureExpressionDef(128 /* TypePurePipe */, checkIndex, newArray(argCount + 1)); 38158} 38159function pureArrayDef(checkIndex, argCount) { 38160 return _pureExpressionDef(32 /* TypePureArray */, checkIndex, newArray(argCount)); 38161} 38162function pureObjectDef(checkIndex, propToIndex) { 38163 const keys = Object.keys(propToIndex); 38164 const nbKeys = keys.length; 38165 const propertyNames = []; 38166 for (let i = 0; i < nbKeys; i++) { 38167 const key = keys[i]; 38168 const index = propToIndex[key]; 38169 propertyNames.push(key); 38170 } 38171 return _pureExpressionDef(64 /* TypePureObject */, checkIndex, propertyNames); 38172} 38173function _pureExpressionDef(flags, checkIndex, propertyNames) { 38174 const bindings = []; 38175 for (let i = 0; i < propertyNames.length; i++) { 38176 const prop = propertyNames[i]; 38177 bindings.push({ 38178 flags: 8 /* TypeProperty */, 38179 name: prop, 38180 ns: null, 38181 nonMinifiedName: prop, 38182 securityContext: null, 38183 suffix: null 38184 }); 38185 } 38186 return { 38187 // will bet set by the view definition 38188 nodeIndex: -1, 38189 parent: null, 38190 renderParent: null, 38191 bindingIndex: -1, 38192 outputIndex: -1, 38193 // regular values 38194 checkIndex, 38195 flags, 38196 childFlags: 0, 38197 directChildFlags: 0, 38198 childMatchedQueries: 0, 38199 matchedQueries: {}, 38200 matchedQueryIds: 0, 38201 references: {}, 38202 ngContentIndex: -1, 38203 childCount: 0, 38204 bindings, 38205 bindingFlags: calcBindingFlags(bindings), 38206 outputs: [], 38207 element: null, 38208 provider: null, 38209 text: null, 38210 query: null, 38211 ngContent: null 38212 }; 38213} 38214function createPureExpression(view, def) { 38215 return { value: undefined }; 38216} 38217function checkAndUpdatePureExpressionInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 38218 const bindings = def.bindings; 38219 let changed = false; 38220 const bindLen = bindings.length; 38221 if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0)) 38222 changed = true; 38223 if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1)) 38224 changed = true; 38225 if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2)) 38226 changed = true; 38227 if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3)) 38228 changed = true; 38229 if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4)) 38230 changed = true; 38231 if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5)) 38232 changed = true; 38233 if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6)) 38234 changed = true; 38235 if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7)) 38236 changed = true; 38237 if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8)) 38238 changed = true; 38239 if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9)) 38240 changed = true; 38241 if (changed) { 38242 const data = asPureExpressionData(view, def.nodeIndex); 38243 let value; 38244 switch (def.flags & 201347067 /* Types */) { 38245 case 32 /* TypePureArray */: 38246 value = []; 38247 if (bindLen > 0) 38248 value.push(v0); 38249 if (bindLen > 1) 38250 value.push(v1); 38251 if (bindLen > 2) 38252 value.push(v2); 38253 if (bindLen > 3) 38254 value.push(v3); 38255 if (bindLen > 4) 38256 value.push(v4); 38257 if (bindLen > 5) 38258 value.push(v5); 38259 if (bindLen > 6) 38260 value.push(v6); 38261 if (bindLen > 7) 38262 value.push(v7); 38263 if (bindLen > 8) 38264 value.push(v8); 38265 if (bindLen > 9) 38266 value.push(v9); 38267 break; 38268 case 64 /* TypePureObject */: 38269 value = {}; 38270 if (bindLen > 0) 38271 value[bindings[0].name] = v0; 38272 if (bindLen > 1) 38273 value[bindings[1].name] = v1; 38274 if (bindLen > 2) 38275 value[bindings[2].name] = v2; 38276 if (bindLen > 3) 38277 value[bindings[3].name] = v3; 38278 if (bindLen > 4) 38279 value[bindings[4].name] = v4; 38280 if (bindLen > 5) 38281 value[bindings[5].name] = v5; 38282 if (bindLen > 6) 38283 value[bindings[6].name] = v6; 38284 if (bindLen > 7) 38285 value[bindings[7].name] = v7; 38286 if (bindLen > 8) 38287 value[bindings[8].name] = v8; 38288 if (bindLen > 9) 38289 value[bindings[9].name] = v9; 38290 break; 38291 case 128 /* TypePurePipe */: 38292 const pipe = v0; 38293 switch (bindLen) { 38294 case 1: 38295 value = pipe.transform(v0); 38296 break; 38297 case 2: 38298 value = pipe.transform(v1); 38299 break; 38300 case 3: 38301 value = pipe.transform(v1, v2); 38302 break; 38303 case 4: 38304 value = pipe.transform(v1, v2, v3); 38305 break; 38306 case 5: 38307 value = pipe.transform(v1, v2, v3, v4); 38308 break; 38309 case 6: 38310 value = pipe.transform(v1, v2, v3, v4, v5); 38311 break; 38312 case 7: 38313 value = pipe.transform(v1, v2, v3, v4, v5, v6); 38314 break; 38315 case 8: 38316 value = pipe.transform(v1, v2, v3, v4, v5, v6, v7); 38317 break; 38318 case 9: 38319 value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8); 38320 break; 38321 case 10: 38322 value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9); 38323 break; 38324 } 38325 break; 38326 } 38327 data.value = value; 38328 } 38329 return changed; 38330} 38331function checkAndUpdatePureExpressionDynamic(view, def, values) { 38332 const bindings = def.bindings; 38333 let changed = false; 38334 for (let i = 0; i < values.length; i++) { 38335 // Note: We need to loop over all values, so that 38336 // the old values are updates as well! 38337 if (checkAndUpdateBinding(view, def, i, values[i])) { 38338 changed = true; 38339 } 38340 } 38341 if (changed) { 38342 const data = asPureExpressionData(view, def.nodeIndex); 38343 let value; 38344 switch (def.flags & 201347067 /* Types */) { 38345 case 32 /* TypePureArray */: 38346 value = values; 38347 break; 38348 case 64 /* TypePureObject */: 38349 value = {}; 38350 for (let i = 0; i < values.length; i++) { 38351 value[bindings[i].name] = values[i]; 38352 } 38353 break; 38354 case 128 /* TypePurePipe */: 38355 const pipe = values[0]; 38356 const params = values.slice(1); 38357 value = pipe.transform(...params); 38358 break; 38359 } 38360 data.value = value; 38361 } 38362 return changed; 38363} 38364 38365/** 38366 * @license 38367 * Copyright Google LLC All Rights Reserved. 38368 * 38369 * Use of this source code is governed by an MIT-style license that can be 38370 * found in the LICENSE file at https://angular.io/license 38371 */ 38372function textDef(checkIndex, ngContentIndex, staticText) { 38373 const bindings = []; 38374 for (let i = 1; i < staticText.length; i++) { 38375 bindings[i - 1] = { 38376 flags: 8 /* TypeProperty */, 38377 name: null, 38378 ns: null, 38379 nonMinifiedName: null, 38380 securityContext: null, 38381 suffix: staticText[i], 38382 }; 38383 } 38384 return { 38385 // will bet set by the view definition 38386 nodeIndex: -1, 38387 parent: null, 38388 renderParent: null, 38389 bindingIndex: -1, 38390 outputIndex: -1, 38391 // regular values 38392 checkIndex, 38393 flags: 2 /* TypeText */, 38394 childFlags: 0, 38395 directChildFlags: 0, 38396 childMatchedQueries: 0, 38397 matchedQueries: {}, 38398 matchedQueryIds: 0, 38399 references: {}, 38400 ngContentIndex, 38401 childCount: 0, 38402 bindings, 38403 bindingFlags: 8 /* TypeProperty */, 38404 outputs: [], 38405 element: null, 38406 provider: null, 38407 text: { prefix: staticText[0] }, 38408 query: null, 38409 ngContent: null, 38410 }; 38411} 38412function createText(view, renderHost, def) { 38413 let renderNode; 38414 const renderer = view.renderer; 38415 renderNode = renderer.createText(def.text.prefix); 38416 const parentEl = getParentRenderElement(view, renderHost, def); 38417 if (parentEl) { 38418 renderer.appendChild(parentEl, renderNode); 38419 } 38420 return { renderText: renderNode }; 38421} 38422function checkAndUpdateTextInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 38423 let changed = false; 38424 const bindings = def.bindings; 38425 const bindLen = bindings.length; 38426 if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0)) 38427 changed = true; 38428 if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1)) 38429 changed = true; 38430 if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2)) 38431 changed = true; 38432 if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3)) 38433 changed = true; 38434 if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4)) 38435 changed = true; 38436 if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5)) 38437 changed = true; 38438 if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6)) 38439 changed = true; 38440 if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7)) 38441 changed = true; 38442 if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8)) 38443 changed = true; 38444 if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9)) 38445 changed = true; 38446 if (changed) { 38447 let value = def.text.prefix; 38448 if (bindLen > 0) 38449 value += _addInterpolationPart(v0, bindings[0]); 38450 if (bindLen > 1) 38451 value += _addInterpolationPart(v1, bindings[1]); 38452 if (bindLen > 2) 38453 value += _addInterpolationPart(v2, bindings[2]); 38454 if (bindLen > 3) 38455 value += _addInterpolationPart(v3, bindings[3]); 38456 if (bindLen > 4) 38457 value += _addInterpolationPart(v4, bindings[4]); 38458 if (bindLen > 5) 38459 value += _addInterpolationPart(v5, bindings[5]); 38460 if (bindLen > 6) 38461 value += _addInterpolationPart(v6, bindings[6]); 38462 if (bindLen > 7) 38463 value += _addInterpolationPart(v7, bindings[7]); 38464 if (bindLen > 8) 38465 value += _addInterpolationPart(v8, bindings[8]); 38466 if (bindLen > 9) 38467 value += _addInterpolationPart(v9, bindings[9]); 38468 const renderNode = asTextData(view, def.nodeIndex).renderText; 38469 view.renderer.setValue(renderNode, value); 38470 } 38471 return changed; 38472} 38473function checkAndUpdateTextDynamic(view, def, values) { 38474 const bindings = def.bindings; 38475 let changed = false; 38476 for (let i = 0; i < values.length; i++) { 38477 // Note: We need to loop over all values, so that 38478 // the old values are updates as well! 38479 if (checkAndUpdateBinding(view, def, i, values[i])) { 38480 changed = true; 38481 } 38482 } 38483 if (changed) { 38484 let value = ''; 38485 for (let i = 0; i < values.length; i++) { 38486 value = value + _addInterpolationPart(values[i], bindings[i]); 38487 } 38488 value = def.text.prefix + value; 38489 const renderNode = asTextData(view, def.nodeIndex).renderText; 38490 view.renderer.setValue(renderNode, value); 38491 } 38492 return changed; 38493} 38494function _addInterpolationPart(value, binding) { 38495 const valueStr = value != null ? value.toString() : ''; 38496 return valueStr + binding.suffix; 38497} 38498 38499/** 38500 * @license 38501 * Copyright Google LLC All Rights Reserved. 38502 * 38503 * Use of this source code is governed by an MIT-style license that can be 38504 * found in the LICENSE file at https://angular.io/license 38505 */ 38506function viewDef(flags, nodes, updateDirectives, updateRenderer) { 38507 // clone nodes and set auto calculated values 38508 let viewBindingCount = 0; 38509 let viewDisposableCount = 0; 38510 let viewNodeFlags = 0; 38511 let viewRootNodeFlags = 0; 38512 let viewMatchedQueries = 0; 38513 let currentParent = null; 38514 let currentRenderParent = null; 38515 let currentElementHasPublicProviders = false; 38516 let currentElementHasPrivateProviders = false; 38517 let lastRenderRootNode = null; 38518 for (let i = 0; i < nodes.length; i++) { 38519 const node = nodes[i]; 38520 node.nodeIndex = i; 38521 node.parent = currentParent; 38522 node.bindingIndex = viewBindingCount; 38523 node.outputIndex = viewDisposableCount; 38524 node.renderParent = currentRenderParent; 38525 viewNodeFlags |= node.flags; 38526 viewMatchedQueries |= node.matchedQueryIds; 38527 if (node.element) { 38528 const elDef = node.element; 38529 elDef.publicProviders = 38530 currentParent ? currentParent.element.publicProviders : Object.create(null); 38531 elDef.allProviders = elDef.publicProviders; 38532 // Note: We assume that all providers of an element are before any child element! 38533 currentElementHasPublicProviders = false; 38534 currentElementHasPrivateProviders = false; 38535 if (node.element.template) { 38536 viewMatchedQueries |= node.element.template.nodeMatchedQueries; 38537 } 38538 } 38539 validateNode(currentParent, node, nodes.length); 38540 viewBindingCount += node.bindings.length; 38541 viewDisposableCount += node.outputs.length; 38542 if (!currentRenderParent && (node.flags & 3 /* CatRenderNode */)) { 38543 lastRenderRootNode = node; 38544 } 38545 if (node.flags & 20224 /* CatProvider */) { 38546 if (!currentElementHasPublicProviders) { 38547 currentElementHasPublicProviders = true; 38548 // Use prototypical inheritance to not get O(n^2) complexity... 38549 currentParent.element.publicProviders = 38550 Object.create(currentParent.element.publicProviders); 38551 currentParent.element.allProviders = currentParent.element.publicProviders; 38552 } 38553 const isPrivateService = (node.flags & 8192 /* PrivateProvider */) !== 0; 38554 const isComponent = (node.flags & 32768 /* Component */) !== 0; 38555 if (!isPrivateService || isComponent) { 38556 currentParent.element.publicProviders[tokenKey(node.provider.token)] = node; 38557 } 38558 else { 38559 if (!currentElementHasPrivateProviders) { 38560 currentElementHasPrivateProviders = true; 38561 // Use prototypical inheritance to not get O(n^2) complexity... 38562 currentParent.element.allProviders = 38563 Object.create(currentParent.element.publicProviders); 38564 } 38565 currentParent.element.allProviders[tokenKey(node.provider.token)] = node; 38566 } 38567 if (isComponent) { 38568 currentParent.element.componentProvider = node; 38569 } 38570 } 38571 if (currentParent) { 38572 currentParent.childFlags |= node.flags; 38573 currentParent.directChildFlags |= node.flags; 38574 currentParent.childMatchedQueries |= node.matchedQueryIds; 38575 if (node.element && node.element.template) { 38576 currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries; 38577 } 38578 } 38579 else { 38580 viewRootNodeFlags |= node.flags; 38581 } 38582 if (node.childCount > 0) { 38583 currentParent = node; 38584 if (!isNgContainer(node)) { 38585 currentRenderParent = node; 38586 } 38587 } 38588 else { 38589 // When the current node has no children, check if it is the last children of its parent. 38590 // When it is, propagate the flags up. 38591 // The loop is required because an element could be the last transitive children of several 38592 // elements. We loop to either the root or the highest opened element (= with remaining 38593 // children) 38594 while (currentParent && i === currentParent.nodeIndex + currentParent.childCount) { 38595 const newParent = currentParent.parent; 38596 if (newParent) { 38597 newParent.childFlags |= currentParent.childFlags; 38598 newParent.childMatchedQueries |= currentParent.childMatchedQueries; 38599 } 38600 currentParent = newParent; 38601 // We also need to update the render parent & account for ng-container 38602 if (currentParent && isNgContainer(currentParent)) { 38603 currentRenderParent = currentParent.renderParent; 38604 } 38605 else { 38606 currentRenderParent = currentParent; 38607 } 38608 } 38609 } 38610 } 38611 const handleEvent = (view, nodeIndex, eventName, event) => nodes[nodeIndex].element.handleEvent(view, eventName, event); 38612 return { 38613 // Will be filled later... 38614 factory: null, 38615 nodeFlags: viewNodeFlags, 38616 rootNodeFlags: viewRootNodeFlags, 38617 nodeMatchedQueries: viewMatchedQueries, 38618 flags, 38619 nodes: nodes, 38620 updateDirectives: updateDirectives || NOOP, 38621 updateRenderer: updateRenderer || NOOP, 38622 handleEvent, 38623 bindingCount: viewBindingCount, 38624 outputCount: viewDisposableCount, 38625 lastRenderRootNode 38626 }; 38627} 38628function isNgContainer(node) { 38629 return (node.flags & 1 /* TypeElement */) !== 0 && node.element.name === null; 38630} 38631function validateNode(parent, node, nodeCount) { 38632 const template = node.element && node.element.template; 38633 if (template) { 38634 if (!template.lastRenderRootNode) { 38635 throw new Error(`Illegal State: Embedded templates without nodes are not allowed!`); 38636 } 38637 if (template.lastRenderRootNode && 38638 template.lastRenderRootNode.flags & 16777216 /* EmbeddedViews */) { 38639 throw new Error(`Illegal State: Last root node of a template can't have embedded views, at index ${node.nodeIndex}!`); 38640 } 38641 } 38642 if (node.flags & 20224 /* CatProvider */) { 38643 const parentFlags = parent ? parent.flags : 0; 38644 if ((parentFlags & 1 /* TypeElement */) === 0) { 38645 throw new Error(`Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index ${node.nodeIndex}!`); 38646 } 38647 } 38648 if (node.query) { 38649 if (node.flags & 67108864 /* TypeContentQuery */ && 38650 (!parent || (parent.flags & 16384 /* TypeDirective */) === 0)) { 38651 throw new Error(`Illegal State: Content Query nodes need to be children of directives, at index ${node.nodeIndex}!`); 38652 } 38653 if (node.flags & 134217728 /* TypeViewQuery */ && parent) { 38654 throw new Error(`Illegal State: View Query nodes have to be top level nodes, at index ${node.nodeIndex}!`); 38655 } 38656 } 38657 if (node.childCount) { 38658 const parentEnd = parent ? parent.nodeIndex + parent.childCount : nodeCount - 1; 38659 if (node.nodeIndex <= parentEnd && node.nodeIndex + node.childCount > parentEnd) { 38660 throw new Error(`Illegal State: childCount of node leads outside of parent, at index ${node.nodeIndex}!`); 38661 } 38662 } 38663} 38664function createEmbeddedView(parent, anchorDef, viewDef, context) { 38665 // embedded views are seen as siblings to the anchor, so we need 38666 // to get the parent of the anchor and use it as parentIndex. 38667 const view = createView(parent.root, parent.renderer, parent, anchorDef, viewDef); 38668 initView(view, parent.component, context); 38669 createViewNodes(view); 38670 return view; 38671} 38672function createRootView(root, def, context) { 38673 const view = createView(root, root.renderer, null, null, def); 38674 initView(view, context, context); 38675 createViewNodes(view); 38676 return view; 38677} 38678function createComponentView(parentView, nodeDef, viewDef, hostElement) { 38679 const rendererType = nodeDef.element.componentRendererType; 38680 let compRenderer; 38681 if (!rendererType) { 38682 compRenderer = parentView.root.renderer; 38683 } 38684 else { 38685 compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType); 38686 } 38687 return createView(parentView.root, compRenderer, parentView, nodeDef.element.componentProvider, viewDef); 38688} 38689function createView(root, renderer, parent, parentNodeDef, def) { 38690 const nodes = new Array(def.nodes.length); 38691 const disposables = def.outputCount ? new Array(def.outputCount) : null; 38692 const view = { 38693 def, 38694 parent, 38695 viewContainerParent: null, 38696 parentNodeDef, 38697 context: null, 38698 component: null, 38699 nodes, 38700 state: 13 /* CatInit */, 38701 root, 38702 renderer, 38703 oldValues: new Array(def.bindingCount), 38704 disposables, 38705 initIndex: -1 38706 }; 38707 return view; 38708} 38709function initView(view, component, context) { 38710 view.component = component; 38711 view.context = context; 38712} 38713function createViewNodes(view) { 38714 let renderHost; 38715 if (isComponentView(view)) { 38716 const hostDef = view.parentNodeDef; 38717 renderHost = asElementData(view.parent, hostDef.parent.nodeIndex).renderElement; 38718 } 38719 const def = view.def; 38720 const nodes = view.nodes; 38721 for (let i = 0; i < def.nodes.length; i++) { 38722 const nodeDef = def.nodes[i]; 38723 Services.setCurrentNode(view, i); 38724 let nodeData; 38725 switch (nodeDef.flags & 201347067 /* Types */) { 38726 case 1 /* TypeElement */: 38727 const el = createElement(view, renderHost, nodeDef); 38728 let componentView = undefined; 38729 if (nodeDef.flags & 33554432 /* ComponentView */) { 38730 const compViewDef = resolveDefinition(nodeDef.element.componentView); 38731 componentView = Services.createComponentView(view, nodeDef, compViewDef, el); 38732 } 38733 listenToElementOutputs(view, componentView, nodeDef, el); 38734 nodeData = { 38735 renderElement: el, 38736 componentView, 38737 viewContainer: null, 38738 template: nodeDef.element.template ? createTemplateData(view, nodeDef) : undefined 38739 }; 38740 if (nodeDef.flags & 16777216 /* EmbeddedViews */) { 38741 nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData); 38742 } 38743 break; 38744 case 2 /* TypeText */: 38745 nodeData = createText(view, renderHost, nodeDef); 38746 break; 38747 case 512 /* TypeClassProvider */: 38748 case 1024 /* TypeFactoryProvider */: 38749 case 2048 /* TypeUseExistingProvider */: 38750 case 256 /* TypeValueProvider */: { 38751 nodeData = nodes[i]; 38752 if (!nodeData && !(nodeDef.flags & 4096 /* LazyProvider */)) { 38753 const instance = createProviderInstance(view, nodeDef); 38754 nodeData = { instance }; 38755 } 38756 break; 38757 } 38758 case 16 /* TypePipe */: { 38759 const instance = createPipeInstance(view, nodeDef); 38760 nodeData = { instance }; 38761 break; 38762 } 38763 case 16384 /* TypeDirective */: { 38764 nodeData = nodes[i]; 38765 if (!nodeData) { 38766 const instance = createDirectiveInstance(view, nodeDef); 38767 nodeData = { instance }; 38768 } 38769 if (nodeDef.flags & 32768 /* Component */) { 38770 const compView = asElementData(view, nodeDef.parent.nodeIndex).componentView; 38771 initView(compView, nodeData.instance, nodeData.instance); 38772 } 38773 break; 38774 } 38775 case 32 /* TypePureArray */: 38776 case 64 /* TypePureObject */: 38777 case 128 /* TypePurePipe */: 38778 nodeData = createPureExpression(view, nodeDef); 38779 break; 38780 case 67108864 /* TypeContentQuery */: 38781 case 134217728 /* TypeViewQuery */: 38782 nodeData = createQuery(); 38783 break; 38784 case 8 /* TypeNgContent */: 38785 appendNgContent(view, renderHost, nodeDef); 38786 // no runtime data needed for NgContent... 38787 nodeData = undefined; 38788 break; 38789 } 38790 nodes[i] = nodeData; 38791 } 38792 // Create the ViewData.nodes of component views after we created everything else, 38793 // so that e.g. ng-content works 38794 execComponentViewsAction(view, ViewAction.CreateViewNodes); 38795 // fill static content and view queries 38796 execQueriesAction(view, 67108864 /* TypeContentQuery */ | 134217728 /* TypeViewQuery */, 268435456 /* StaticQuery */, 0 /* CheckAndUpdate */); 38797} 38798function checkNoChangesView(view) { 38799 markProjectedViewsForCheck(view); 38800 Services.updateDirectives(view, 1 /* CheckNoChanges */); 38801 execEmbeddedViewsAction(view, ViewAction.CheckNoChanges); 38802 Services.updateRenderer(view, 1 /* CheckNoChanges */); 38803 execComponentViewsAction(view, ViewAction.CheckNoChanges); 38804 // Note: We don't check queries for changes as we didn't do this in v2.x. 38805 // TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message. 38806 view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */); 38807} 38808function checkAndUpdateView(view) { 38809 if (view.state & 1 /* BeforeFirstCheck */) { 38810 view.state &= ~1 /* BeforeFirstCheck */; 38811 view.state |= 2 /* FirstCheck */; 38812 } 38813 else { 38814 view.state &= ~2 /* FirstCheck */; 38815 } 38816 shiftInitState(view, 0 /* InitState_BeforeInit */, 256 /* InitState_CallingOnInit */); 38817 markProjectedViewsForCheck(view); 38818 Services.updateDirectives(view, 0 /* CheckAndUpdate */); 38819 execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate); 38820 execQueriesAction(view, 67108864 /* TypeContentQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */); 38821 let callInit = shiftInitState(view, 256 /* InitState_CallingOnInit */, 512 /* InitState_CallingAfterContentInit */); 38822 callLifecycleHooksChildrenFirst(view, 2097152 /* AfterContentChecked */ | (callInit ? 1048576 /* AfterContentInit */ : 0)); 38823 Services.updateRenderer(view, 0 /* CheckAndUpdate */); 38824 execComponentViewsAction(view, ViewAction.CheckAndUpdate); 38825 execQueriesAction(view, 134217728 /* TypeViewQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */); 38826 callInit = shiftInitState(view, 512 /* InitState_CallingAfterContentInit */, 768 /* InitState_CallingAfterViewInit */); 38827 callLifecycleHooksChildrenFirst(view, 8388608 /* AfterViewChecked */ | (callInit ? 4194304 /* AfterViewInit */ : 0)); 38828 if (view.def.flags & 2 /* OnPush */) { 38829 view.state &= ~8 /* ChecksEnabled */; 38830 } 38831 view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */); 38832 shiftInitState(view, 768 /* InitState_CallingAfterViewInit */, 1024 /* InitState_AfterInit */); 38833} 38834function checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 38835 if (argStyle === 0 /* Inline */) { 38836 return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9); 38837 } 38838 else { 38839 return checkAndUpdateNodeDynamic(view, nodeDef, v0); 38840 } 38841} 38842function markProjectedViewsForCheck(view) { 38843 const def = view.def; 38844 if (!(def.nodeFlags & 4 /* ProjectedTemplate */)) { 38845 return; 38846 } 38847 for (let i = 0; i < def.nodes.length; i++) { 38848 const nodeDef = def.nodes[i]; 38849 if (nodeDef.flags & 4 /* ProjectedTemplate */) { 38850 const projectedViews = asElementData(view, i).template._projectedViews; 38851 if (projectedViews) { 38852 for (let i = 0; i < projectedViews.length; i++) { 38853 const projectedView = projectedViews[i]; 38854 projectedView.state |= 32 /* CheckProjectedView */; 38855 markParentViewsForCheckProjectedViews(projectedView, view); 38856 } 38857 } 38858 } 38859 else if ((nodeDef.childFlags & 4 /* ProjectedTemplate */) === 0) { 38860 // a parent with leafs 38861 // no child is a component, 38862 // then skip the children 38863 i += nodeDef.childCount; 38864 } 38865 } 38866} 38867function checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 38868 switch (nodeDef.flags & 201347067 /* Types */) { 38869 case 1 /* TypeElement */: 38870 return checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9); 38871 case 2 /* TypeText */: 38872 return checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9); 38873 case 16384 /* TypeDirective */: 38874 return checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9); 38875 case 32 /* TypePureArray */: 38876 case 64 /* TypePureObject */: 38877 case 128 /* TypePurePipe */: 38878 return checkAndUpdatePureExpressionInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9); 38879 default: 38880 throw 'unreachable'; 38881 } 38882} 38883function checkAndUpdateNodeDynamic(view, nodeDef, values) { 38884 switch (nodeDef.flags & 201347067 /* Types */) { 38885 case 1 /* TypeElement */: 38886 return checkAndUpdateElementDynamic(view, nodeDef, values); 38887 case 2 /* TypeText */: 38888 return checkAndUpdateTextDynamic(view, nodeDef, values); 38889 case 16384 /* TypeDirective */: 38890 return checkAndUpdateDirectiveDynamic(view, nodeDef, values); 38891 case 32 /* TypePureArray */: 38892 case 64 /* TypePureObject */: 38893 case 128 /* TypePurePipe */: 38894 return checkAndUpdatePureExpressionDynamic(view, nodeDef, values); 38895 default: 38896 throw 'unreachable'; 38897 } 38898} 38899function checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 38900 if (argStyle === 0 /* Inline */) { 38901 checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9); 38902 } 38903 else { 38904 checkNoChangesNodeDynamic(view, nodeDef, v0); 38905 } 38906 // Returning false is ok here as we would have thrown in case of a change. 38907 return false; 38908} 38909function checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 38910 const bindLen = nodeDef.bindings.length; 38911 if (bindLen > 0) 38912 checkBindingNoChanges(view, nodeDef, 0, v0); 38913 if (bindLen > 1) 38914 checkBindingNoChanges(view, nodeDef, 1, v1); 38915 if (bindLen > 2) 38916 checkBindingNoChanges(view, nodeDef, 2, v2); 38917 if (bindLen > 3) 38918 checkBindingNoChanges(view, nodeDef, 3, v3); 38919 if (bindLen > 4) 38920 checkBindingNoChanges(view, nodeDef, 4, v4); 38921 if (bindLen > 5) 38922 checkBindingNoChanges(view, nodeDef, 5, v5); 38923 if (bindLen > 6) 38924 checkBindingNoChanges(view, nodeDef, 6, v6); 38925 if (bindLen > 7) 38926 checkBindingNoChanges(view, nodeDef, 7, v7); 38927 if (bindLen > 8) 38928 checkBindingNoChanges(view, nodeDef, 8, v8); 38929 if (bindLen > 9) 38930 checkBindingNoChanges(view, nodeDef, 9, v9); 38931} 38932function checkNoChangesNodeDynamic(view, nodeDef, values) { 38933 for (let i = 0; i < values.length; i++) { 38934 checkBindingNoChanges(view, nodeDef, i, values[i]); 38935 } 38936} 38937/** 38938 * Workaround https://github.com/angular/tsickle/issues/497 38939 * @suppress {misplacedTypeAnnotation} 38940 */ 38941function checkNoChangesQuery(view, nodeDef) { 38942 const queryList = asQueryList(view, nodeDef.nodeIndex); 38943 if (queryList.dirty) { 38944 throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, nodeDef.nodeIndex), `Query ${nodeDef.query.id} not dirty`, `Query ${nodeDef.query.id} dirty`, (view.state & 1 /* BeforeFirstCheck */) !== 0); 38945 } 38946} 38947function destroyView(view) { 38948 if (view.state & 128 /* Destroyed */) { 38949 return; 38950 } 38951 execEmbeddedViewsAction(view, ViewAction.Destroy); 38952 execComponentViewsAction(view, ViewAction.Destroy); 38953 callLifecycleHooksChildrenFirst(view, 131072 /* OnDestroy */); 38954 if (view.disposables) { 38955 for (let i = 0; i < view.disposables.length; i++) { 38956 view.disposables[i](); 38957 } 38958 } 38959 detachProjectedView(view); 38960 if (view.renderer.destroyNode) { 38961 destroyViewNodes(view); 38962 } 38963 if (isComponentView(view)) { 38964 view.renderer.destroy(); 38965 } 38966 view.state |= 128 /* Destroyed */; 38967} 38968function destroyViewNodes(view) { 38969 const len = view.def.nodes.length; 38970 for (let i = 0; i < len; i++) { 38971 const def = view.def.nodes[i]; 38972 if (def.flags & 1 /* TypeElement */) { 38973 view.renderer.destroyNode(asElementData(view, i).renderElement); 38974 } 38975 else if (def.flags & 2 /* TypeText */) { 38976 view.renderer.destroyNode(asTextData(view, i).renderText); 38977 } 38978 else if (def.flags & 67108864 /* TypeContentQuery */ || def.flags & 134217728 /* TypeViewQuery */) { 38979 asQueryList(view, i).destroy(); 38980 } 38981 } 38982} 38983var ViewAction; 38984(function (ViewAction) { 38985 ViewAction[ViewAction["CreateViewNodes"] = 0] = "CreateViewNodes"; 38986 ViewAction[ViewAction["CheckNoChanges"] = 1] = "CheckNoChanges"; 38987 ViewAction[ViewAction["CheckNoChangesProjectedViews"] = 2] = "CheckNoChangesProjectedViews"; 38988 ViewAction[ViewAction["CheckAndUpdate"] = 3] = "CheckAndUpdate"; 38989 ViewAction[ViewAction["CheckAndUpdateProjectedViews"] = 4] = "CheckAndUpdateProjectedViews"; 38990 ViewAction[ViewAction["Destroy"] = 5] = "Destroy"; 38991})(ViewAction || (ViewAction = {})); 38992function execComponentViewsAction(view, action) { 38993 const def = view.def; 38994 if (!(def.nodeFlags & 33554432 /* ComponentView */)) { 38995 return; 38996 } 38997 for (let i = 0; i < def.nodes.length; i++) { 38998 const nodeDef = def.nodes[i]; 38999 if (nodeDef.flags & 33554432 /* ComponentView */) { 39000 // a leaf 39001 callViewAction(asElementData(view, i).componentView, action); 39002 } 39003 else if ((nodeDef.childFlags & 33554432 /* ComponentView */) === 0) { 39004 // a parent with leafs 39005 // no child is a component, 39006 // then skip the children 39007 i += nodeDef.childCount; 39008 } 39009 } 39010} 39011function execEmbeddedViewsAction(view, action) { 39012 const def = view.def; 39013 if (!(def.nodeFlags & 16777216 /* EmbeddedViews */)) { 39014 return; 39015 } 39016 for (let i = 0; i < def.nodes.length; i++) { 39017 const nodeDef = def.nodes[i]; 39018 if (nodeDef.flags & 16777216 /* EmbeddedViews */) { 39019 // a leaf 39020 const embeddedViews = asElementData(view, i).viewContainer._embeddedViews; 39021 for (let k = 0; k < embeddedViews.length; k++) { 39022 callViewAction(embeddedViews[k], action); 39023 } 39024 } 39025 else if ((nodeDef.childFlags & 16777216 /* EmbeddedViews */) === 0) { 39026 // a parent with leafs 39027 // no child is a component, 39028 // then skip the children 39029 i += nodeDef.childCount; 39030 } 39031 } 39032} 39033function callViewAction(view, action) { 39034 const viewState = view.state; 39035 switch (action) { 39036 case ViewAction.CheckNoChanges: 39037 if ((viewState & 128 /* Destroyed */) === 0) { 39038 if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) { 39039 checkNoChangesView(view); 39040 } 39041 else if (viewState & 64 /* CheckProjectedViews */) { 39042 execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews); 39043 } 39044 } 39045 break; 39046 case ViewAction.CheckNoChangesProjectedViews: 39047 if ((viewState & 128 /* Destroyed */) === 0) { 39048 if (viewState & 32 /* CheckProjectedView */) { 39049 checkNoChangesView(view); 39050 } 39051 else if (viewState & 64 /* CheckProjectedViews */) { 39052 execProjectedViewsAction(view, action); 39053 } 39054 } 39055 break; 39056 case ViewAction.CheckAndUpdate: 39057 if ((viewState & 128 /* Destroyed */) === 0) { 39058 if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) { 39059 checkAndUpdateView(view); 39060 } 39061 else if (viewState & 64 /* CheckProjectedViews */) { 39062 execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews); 39063 } 39064 } 39065 break; 39066 case ViewAction.CheckAndUpdateProjectedViews: 39067 if ((viewState & 128 /* Destroyed */) === 0) { 39068 if (viewState & 32 /* CheckProjectedView */) { 39069 checkAndUpdateView(view); 39070 } 39071 else if (viewState & 64 /* CheckProjectedViews */) { 39072 execProjectedViewsAction(view, action); 39073 } 39074 } 39075 break; 39076 case ViewAction.Destroy: 39077 // Note: destroyView recurses over all views, 39078 // so we don't need to special case projected views here. 39079 destroyView(view); 39080 break; 39081 case ViewAction.CreateViewNodes: 39082 createViewNodes(view); 39083 break; 39084 } 39085} 39086function execProjectedViewsAction(view, action) { 39087 execEmbeddedViewsAction(view, action); 39088 execComponentViewsAction(view, action); 39089} 39090function execQueriesAction(view, queryFlags, staticDynamicQueryFlag, checkType) { 39091 if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) { 39092 return; 39093 } 39094 const nodeCount = view.def.nodes.length; 39095 for (let i = 0; i < nodeCount; i++) { 39096 const nodeDef = view.def.nodes[i]; 39097 if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) { 39098 Services.setCurrentNode(view, nodeDef.nodeIndex); 39099 switch (checkType) { 39100 case 0 /* CheckAndUpdate */: 39101 checkAndUpdateQuery(view, nodeDef); 39102 break; 39103 case 1 /* CheckNoChanges */: 39104 checkNoChangesQuery(view, nodeDef); 39105 break; 39106 } 39107 } 39108 if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) { 39109 // no child has a matching query 39110 // then skip the children 39111 i += nodeDef.childCount; 39112 } 39113 } 39114} 39115 39116/** 39117 * @license 39118 * Copyright Google LLC All Rights Reserved. 39119 * 39120 * Use of this source code is governed by an MIT-style license that can be 39121 * found in the LICENSE file at https://angular.io/license 39122 */ 39123let initialized = false; 39124function initServicesIfNeeded() { 39125 if (initialized) { 39126 return; 39127 } 39128 initialized = true; 39129 const services = isDevMode() ? createDebugServices() : createProdServices(); 39130 Services.setCurrentNode = services.setCurrentNode; 39131 Services.createRootView = services.createRootView; 39132 Services.createEmbeddedView = services.createEmbeddedView; 39133 Services.createComponentView = services.createComponentView; 39134 Services.createNgModuleRef = services.createNgModuleRef; 39135 Services.overrideProvider = services.overrideProvider; 39136 Services.overrideComponentView = services.overrideComponentView; 39137 Services.clearOverrides = services.clearOverrides; 39138 Services.checkAndUpdateView = services.checkAndUpdateView; 39139 Services.checkNoChangesView = services.checkNoChangesView; 39140 Services.destroyView = services.destroyView; 39141 Services.resolveDep = resolveDep; 39142 Services.createDebugContext = services.createDebugContext; 39143 Services.handleEvent = services.handleEvent; 39144 Services.updateDirectives = services.updateDirectives; 39145 Services.updateRenderer = services.updateRenderer; 39146 Services.dirtyParentQueries = dirtyParentQueries; 39147} 39148function createProdServices() { 39149 return { 39150 setCurrentNode: () => { }, 39151 createRootView: createProdRootView, 39152 createEmbeddedView: createEmbeddedView, 39153 createComponentView: createComponentView, 39154 createNgModuleRef: createNgModuleRef, 39155 overrideProvider: NOOP, 39156 overrideComponentView: NOOP, 39157 clearOverrides: NOOP, 39158 checkAndUpdateView: checkAndUpdateView, 39159 checkNoChangesView: checkNoChangesView, 39160 destroyView: destroyView, 39161 createDebugContext: (view, nodeIndex) => new DebugContext_(view, nodeIndex), 39162 handleEvent: (view, nodeIndex, eventName, event) => view.def.handleEvent(view, nodeIndex, eventName, event), 39163 updateDirectives: (view, checkType) => view.def.updateDirectives(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode : prodCheckNoChangesNode, view), 39164 updateRenderer: (view, checkType) => view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode : prodCheckNoChangesNode, view), 39165 }; 39166} 39167function createDebugServices() { 39168 return { 39169 setCurrentNode: debugSetCurrentNode, 39170 createRootView: debugCreateRootView, 39171 createEmbeddedView: debugCreateEmbeddedView, 39172 createComponentView: debugCreateComponentView, 39173 createNgModuleRef: debugCreateNgModuleRef, 39174 overrideProvider: debugOverrideProvider, 39175 overrideComponentView: debugOverrideComponentView, 39176 clearOverrides: debugClearOverrides, 39177 checkAndUpdateView: debugCheckAndUpdateView, 39178 checkNoChangesView: debugCheckNoChangesView, 39179 destroyView: debugDestroyView, 39180 createDebugContext: (view, nodeIndex) => new DebugContext_(view, nodeIndex), 39181 handleEvent: debugHandleEvent, 39182 updateDirectives: debugUpdateDirectives, 39183 updateRenderer: debugUpdateRenderer, 39184 }; 39185} 39186function createProdRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) { 39187 const rendererFactory = ngModule.injector.get(RendererFactory2); 39188 return createRootView(createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode), def, context); 39189} 39190function debugCreateRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) { 39191 const rendererFactory = ngModule.injector.get(RendererFactory2); 39192 const root = createRootData(elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes, rootSelectorOrNode); 39193 const defWithOverride = applyProviderOverridesToView(def); 39194 return callWithDebugContext(DebugAction.create, createRootView, null, [root, defWithOverride, context]); 39195} 39196function createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode) { 39197 const sanitizer = ngModule.injector.get(Sanitizer); 39198 const errorHandler = ngModule.injector.get(ErrorHandler); 39199 const renderer = rendererFactory.createRenderer(null, null); 39200 return { 39201 ngModule, 39202 injector: elInjector, 39203 projectableNodes, 39204 selectorOrNode: rootSelectorOrNode, 39205 sanitizer, 39206 rendererFactory, 39207 renderer, 39208 errorHandler 39209 }; 39210} 39211function debugCreateEmbeddedView(parentView, anchorDef, viewDef, context) { 39212 const defWithOverride = applyProviderOverridesToView(viewDef); 39213 return callWithDebugContext(DebugAction.create, createEmbeddedView, null, [parentView, anchorDef, defWithOverride, context]); 39214} 39215function debugCreateComponentView(parentView, nodeDef, viewDef, hostElement) { 39216 const overrideComponentView = viewDefOverrides.get(nodeDef.element.componentProvider.provider.token); 39217 if (overrideComponentView) { 39218 viewDef = overrideComponentView; 39219 } 39220 else { 39221 viewDef = applyProviderOverridesToView(viewDef); 39222 } 39223 return callWithDebugContext(DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef, hostElement]); 39224} 39225function debugCreateNgModuleRef(moduleType, parentInjector, bootstrapComponents, def) { 39226 const defWithOverride = applyProviderOverridesToNgModule(def); 39227 return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride); 39228} 39229const providerOverrides = new Map(); 39230const providerOverridesWithScope = new Map(); 39231const viewDefOverrides = new Map(); 39232function debugOverrideProvider(override) { 39233 providerOverrides.set(override.token, override); 39234 let injectableDef; 39235 if (typeof override.token === 'function' && (injectableDef = getInjectableDef(override.token)) && 39236 typeof injectableDef.providedIn === 'function') { 39237 providerOverridesWithScope.set(override.token, override); 39238 } 39239} 39240function debugOverrideComponentView(comp, compFactory) { 39241 const hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory)); 39242 const compViewDef = resolveDefinition(hostViewDef.nodes[0].element.componentView); 39243 viewDefOverrides.set(comp, compViewDef); 39244} 39245function debugClearOverrides() { 39246 providerOverrides.clear(); 39247 providerOverridesWithScope.clear(); 39248 viewDefOverrides.clear(); 39249} 39250// Notes about the algorithm: 39251// 1) Locate the providers of an element and check if one of them was overwritten 39252// 2) Change the providers of that element 39253// 39254// We only create new datastructures if we need to, to keep perf impact 39255// reasonable. 39256function applyProviderOverridesToView(def) { 39257 if (providerOverrides.size === 0) { 39258 return def; 39259 } 39260 const elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def); 39261 if (elementIndicesWithOverwrittenProviders.length === 0) { 39262 return def; 39263 } 39264 // clone the whole view definition, 39265 // as it maintains references between the nodes that are hard to update. 39266 def = def.factory(() => NOOP); 39267 for (let i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) { 39268 applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]); 39269 } 39270 return def; 39271 function findElementIndicesWithOverwrittenProviders(def) { 39272 const elIndicesWithOverwrittenProviders = []; 39273 let lastElementDef = null; 39274 for (let i = 0; i < def.nodes.length; i++) { 39275 const nodeDef = def.nodes[i]; 39276 if (nodeDef.flags & 1 /* TypeElement */) { 39277 lastElementDef = nodeDef; 39278 } 39279 if (lastElementDef && nodeDef.flags & 3840 /* CatProviderNoDirective */ && 39280 providerOverrides.has(nodeDef.provider.token)) { 39281 elIndicesWithOverwrittenProviders.push(lastElementDef.nodeIndex); 39282 lastElementDef = null; 39283 } 39284 } 39285 return elIndicesWithOverwrittenProviders; 39286 } 39287 function applyProviderOverridesToElement(viewDef, elIndex) { 39288 for (let i = elIndex + 1; i < viewDef.nodes.length; i++) { 39289 const nodeDef = viewDef.nodes[i]; 39290 if (nodeDef.flags & 1 /* TypeElement */) { 39291 // stop at the next element 39292 return; 39293 } 39294 if (nodeDef.flags & 3840 /* CatProviderNoDirective */) { 39295 const provider = nodeDef.provider; 39296 const override = providerOverrides.get(provider.token); 39297 if (override) { 39298 nodeDef.flags = (nodeDef.flags & ~3840 /* CatProviderNoDirective */) | override.flags; 39299 provider.deps = splitDepsDsl(override.deps); 39300 provider.value = override.value; 39301 } 39302 } 39303 } 39304 } 39305} 39306// Notes about the algorithm: 39307// We only create new datastructures if we need to, to keep perf impact 39308// reasonable. 39309function applyProviderOverridesToNgModule(def) { 39310 const { hasOverrides, hasDeprecatedOverrides } = calcHasOverrides(def); 39311 if (!hasOverrides) { 39312 return def; 39313 } 39314 // clone the whole view definition, 39315 // as it maintains references between the nodes that are hard to update. 39316 def = def.factory(() => NOOP); 39317 applyProviderOverrides(def); 39318 return def; 39319 function calcHasOverrides(def) { 39320 let hasOverrides = false; 39321 let hasDeprecatedOverrides = false; 39322 if (providerOverrides.size === 0) { 39323 return { hasOverrides, hasDeprecatedOverrides }; 39324 } 39325 def.providers.forEach(node => { 39326 const override = providerOverrides.get(node.token); 39327 if ((node.flags & 3840 /* CatProviderNoDirective */) && override) { 39328 hasOverrides = true; 39329 hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior; 39330 } 39331 }); 39332 def.modules.forEach(module => { 39333 providerOverridesWithScope.forEach((override, token) => { 39334 if (getInjectableDef(token).providedIn === module) { 39335 hasOverrides = true; 39336 hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior; 39337 } 39338 }); 39339 }); 39340 return { hasOverrides, hasDeprecatedOverrides }; 39341 } 39342 function applyProviderOverrides(def) { 39343 for (let i = 0; i < def.providers.length; i++) { 39344 const provider = def.providers[i]; 39345 if (hasDeprecatedOverrides) { 39346 // We had a bug where me made 39347 // all providers lazy. Keep this logic behind a flag 39348 // for migrating existing users. 39349 provider.flags |= 4096 /* LazyProvider */; 39350 } 39351 const override = providerOverrides.get(provider.token); 39352 if (override) { 39353 provider.flags = (provider.flags & ~3840 /* CatProviderNoDirective */) | override.flags; 39354 provider.deps = splitDepsDsl(override.deps); 39355 provider.value = override.value; 39356 } 39357 } 39358 if (providerOverridesWithScope.size > 0) { 39359 let moduleSet = new Set(def.modules); 39360 providerOverridesWithScope.forEach((override, token) => { 39361 if (moduleSet.has(getInjectableDef(token).providedIn)) { 39362 let provider = { 39363 token: token, 39364 flags: override.flags | (hasDeprecatedOverrides ? 4096 /* LazyProvider */ : 0 /* None */), 39365 deps: splitDepsDsl(override.deps), 39366 value: override.value, 39367 index: def.providers.length, 39368 }; 39369 def.providers.push(provider); 39370 def.providersByKey[tokenKey(token)] = provider; 39371 } 39372 }); 39373 } 39374 } 39375} 39376function prodCheckAndUpdateNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 39377 const nodeDef = view.def.nodes[checkIndex]; 39378 checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9); 39379 return (nodeDef.flags & 224 /* CatPureExpression */) ? 39380 asPureExpressionData(view, checkIndex).value : 39381 undefined; 39382} 39383function prodCheckNoChangesNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) { 39384 const nodeDef = view.def.nodes[checkIndex]; 39385 checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9); 39386 return (nodeDef.flags & 224 /* CatPureExpression */) ? 39387 asPureExpressionData(view, checkIndex).value : 39388 undefined; 39389} 39390function debugCheckAndUpdateView(view) { 39391 return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]); 39392} 39393function debugCheckNoChangesView(view) { 39394 return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]); 39395} 39396function debugDestroyView(view) { 39397 return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]); 39398} 39399var DebugAction; 39400(function (DebugAction) { 39401 DebugAction[DebugAction["create"] = 0] = "create"; 39402 DebugAction[DebugAction["detectChanges"] = 1] = "detectChanges"; 39403 DebugAction[DebugAction["checkNoChanges"] = 2] = "checkNoChanges"; 39404 DebugAction[DebugAction["destroy"] = 3] = "destroy"; 39405 DebugAction[DebugAction["handleEvent"] = 4] = "handleEvent"; 39406})(DebugAction || (DebugAction = {})); 39407let _currentAction; 39408let _currentView; 39409let _currentNodeIndex; 39410function debugSetCurrentNode(view, nodeIndex) { 39411 _currentView = view; 39412 _currentNodeIndex = nodeIndex; 39413} 39414function debugHandleEvent(view, nodeIndex, eventName, event) { 39415 debugSetCurrentNode(view, nodeIndex); 39416 return callWithDebugContext(DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]); 39417} 39418function debugUpdateDirectives(view, checkType) { 39419 if (view.state & 128 /* Destroyed */) { 39420 throw viewDestroyedError(DebugAction[_currentAction]); 39421 } 39422 debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0)); 39423 return view.def.updateDirectives(debugCheckDirectivesFn, view); 39424 function debugCheckDirectivesFn(view, nodeIndex, argStyle, ...values) { 39425 const nodeDef = view.def.nodes[nodeIndex]; 39426 if (checkType === 0 /* CheckAndUpdate */) { 39427 debugCheckAndUpdateNode(view, nodeDef, argStyle, values); 39428 } 39429 else { 39430 debugCheckNoChangesNode(view, nodeDef, argStyle, values); 39431 } 39432 if (nodeDef.flags & 16384 /* TypeDirective */) { 39433 debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex)); 39434 } 39435 return (nodeDef.flags & 224 /* CatPureExpression */) ? 39436 asPureExpressionData(view, nodeDef.nodeIndex).value : 39437 undefined; 39438 } 39439} 39440function debugUpdateRenderer(view, checkType) { 39441 if (view.state & 128 /* Destroyed */) { 39442 throw viewDestroyedError(DebugAction[_currentAction]); 39443 } 39444 debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0)); 39445 return view.def.updateRenderer(debugCheckRenderNodeFn, view); 39446 function debugCheckRenderNodeFn(view, nodeIndex, argStyle, ...values) { 39447 const nodeDef = view.def.nodes[nodeIndex]; 39448 if (checkType === 0 /* CheckAndUpdate */) { 39449 debugCheckAndUpdateNode(view, nodeDef, argStyle, values); 39450 } 39451 else { 39452 debugCheckNoChangesNode(view, nodeDef, argStyle, values); 39453 } 39454 if (nodeDef.flags & 3 /* CatRenderNode */) { 39455 debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex)); 39456 } 39457 return (nodeDef.flags & 224 /* CatPureExpression */) ? 39458 asPureExpressionData(view, nodeDef.nodeIndex).value : 39459 undefined; 39460 } 39461} 39462function debugCheckAndUpdateNode(view, nodeDef, argStyle, givenValues) { 39463 const changed = checkAndUpdateNode(view, nodeDef, argStyle, ...givenValues); 39464 if (changed) { 39465 const values = argStyle === 1 /* Dynamic */ ? givenValues[0] : givenValues; 39466 if (nodeDef.flags & 16384 /* TypeDirective */) { 39467 const bindingValues = {}; 39468 for (let i = 0; i < nodeDef.bindings.length; i++) { 39469 const binding = nodeDef.bindings[i]; 39470 const value = values[i]; 39471 if (binding.flags & 8 /* TypeProperty */) { 39472 bindingValues[normalizeDebugBindingName(binding.nonMinifiedName)] = 39473 normalizeDebugBindingValue(value); 39474 } 39475 } 39476 const elDef = nodeDef.parent; 39477 const el = asElementData(view, elDef.nodeIndex).renderElement; 39478 if (!elDef.element.name) { 39479 // a comment. 39480 view.renderer.setValue(el, `bindings=${JSON.stringify(bindingValues, null, 2)}`); 39481 } 39482 else { 39483 // a regular element. 39484 for (let attr in bindingValues) { 39485 const value = bindingValues[attr]; 39486 if (value != null) { 39487 view.renderer.setAttribute(el, attr, value); 39488 } 39489 else { 39490 view.renderer.removeAttribute(el, attr); 39491 } 39492 } 39493 } 39494 } 39495 } 39496} 39497function debugCheckNoChangesNode(view, nodeDef, argStyle, values) { 39498 checkNoChangesNode(view, nodeDef, argStyle, ...values); 39499} 39500function nextDirectiveWithBinding(view, nodeIndex) { 39501 for (let i = nodeIndex; i < view.def.nodes.length; i++) { 39502 const nodeDef = view.def.nodes[i]; 39503 if (nodeDef.flags & 16384 /* TypeDirective */ && nodeDef.bindings && nodeDef.bindings.length) { 39504 return i; 39505 } 39506 } 39507 return null; 39508} 39509function nextRenderNodeWithBinding(view, nodeIndex) { 39510 for (let i = nodeIndex; i < view.def.nodes.length; i++) { 39511 const nodeDef = view.def.nodes[i]; 39512 if ((nodeDef.flags & 3 /* CatRenderNode */) && nodeDef.bindings && nodeDef.bindings.length) { 39513 return i; 39514 } 39515 } 39516 return null; 39517} 39518class DebugContext_ { 39519 constructor(view, nodeIndex) { 39520 this.view = view; 39521 this.nodeIndex = nodeIndex; 39522 if (nodeIndex == null) { 39523 this.nodeIndex = nodeIndex = 0; 39524 } 39525 this.nodeDef = view.def.nodes[nodeIndex]; 39526 let elDef = this.nodeDef; 39527 let elView = view; 39528 while (elDef && (elDef.flags & 1 /* TypeElement */) === 0) { 39529 elDef = elDef.parent; 39530 } 39531 if (!elDef) { 39532 while (!elDef && elView) { 39533 elDef = viewParentEl(elView); 39534 elView = elView.parent; 39535 } 39536 } 39537 this.elDef = elDef; 39538 this.elView = elView; 39539 } 39540 get elOrCompView() { 39541 // Has to be done lazily as we use the DebugContext also during creation of elements... 39542 return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view; 39543 } 39544 get injector() { 39545 return createInjector$1(this.elView, this.elDef); 39546 } 39547 get component() { 39548 return this.elOrCompView.component; 39549 } 39550 get context() { 39551 return this.elOrCompView.context; 39552 } 39553 get providerTokens() { 39554 const tokens = []; 39555 if (this.elDef) { 39556 for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) { 39557 const childDef = this.elView.def.nodes[i]; 39558 if (childDef.flags & 20224 /* CatProvider */) { 39559 tokens.push(childDef.provider.token); 39560 } 39561 i += childDef.childCount; 39562 } 39563 } 39564 return tokens; 39565 } 39566 get references() { 39567 const references = {}; 39568 if (this.elDef) { 39569 collectReferences(this.elView, this.elDef, references); 39570 for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) { 39571 const childDef = this.elView.def.nodes[i]; 39572 if (childDef.flags & 20224 /* CatProvider */) { 39573 collectReferences(this.elView, childDef, references); 39574 } 39575 i += childDef.childCount; 39576 } 39577 } 39578 return references; 39579 } 39580 get componentRenderElement() { 39581 const elData = findHostElement(this.elOrCompView); 39582 return elData ? elData.renderElement : undefined; 39583 } 39584 get renderNode() { 39585 return this.nodeDef.flags & 2 /* TypeText */ ? renderNode(this.view, this.nodeDef) : 39586 renderNode(this.elView, this.elDef); 39587 } 39588 logError(console, ...values) { 39589 let logViewDef; 39590 let logNodeIndex; 39591 if (this.nodeDef.flags & 2 /* TypeText */) { 39592 logViewDef = this.view.def; 39593 logNodeIndex = this.nodeDef.nodeIndex; 39594 } 39595 else { 39596 logViewDef = this.elView.def; 39597 logNodeIndex = this.elDef.nodeIndex; 39598 } 39599 // Note: we only generate a log function for text and element nodes 39600 // to make the generated code as small as possible. 39601 const renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex); 39602 let currRenderNodeIndex = -1; 39603 let nodeLogger = () => { 39604 currRenderNodeIndex++; 39605 if (currRenderNodeIndex === renderNodeIndex) { 39606 return console.error.bind(console, ...values); 39607 } 39608 else { 39609 return NOOP; 39610 } 39611 }; 39612 logViewDef.factory(nodeLogger); 39613 if (currRenderNodeIndex < renderNodeIndex) { 39614 console.error('Illegal state: the ViewDefinitionFactory did not call the logger!'); 39615 console.error(...values); 39616 } 39617 } 39618} 39619function getRenderNodeIndex(viewDef, nodeIndex) { 39620 let renderNodeIndex = -1; 39621 for (let i = 0; i <= nodeIndex; i++) { 39622 const nodeDef = viewDef.nodes[i]; 39623 if (nodeDef.flags & 3 /* CatRenderNode */) { 39624 renderNodeIndex++; 39625 } 39626 } 39627 return renderNodeIndex; 39628} 39629function findHostElement(view) { 39630 while (view && !isComponentView(view)) { 39631 view = view.parent; 39632 } 39633 if (view.parent) { 39634 return asElementData(view.parent, viewParentEl(view).nodeIndex); 39635 } 39636 return null; 39637} 39638function collectReferences(view, nodeDef, references) { 39639 for (let refName in nodeDef.references) { 39640 references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]); 39641 } 39642} 39643function callWithDebugContext(action, fn, self, args) { 39644 const oldAction = _currentAction; 39645 const oldView = _currentView; 39646 const oldNodeIndex = _currentNodeIndex; 39647 try { 39648 _currentAction = action; 39649 const result = fn.apply(self, args); 39650 _currentView = oldView; 39651 _currentNodeIndex = oldNodeIndex; 39652 _currentAction = oldAction; 39653 return result; 39654 } 39655 catch (e) { 39656 if (isViewDebugError(e) || !_currentView) { 39657 throw e; 39658 } 39659 throw viewWrappedDebugError(e, getCurrentDebugContext()); 39660 } 39661} 39662function getCurrentDebugContext() { 39663 return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null; 39664} 39665class DebugRendererFactory2 { 39666 constructor(delegate) { 39667 this.delegate = delegate; 39668 } 39669 createRenderer(element, renderData) { 39670 return new DebugRenderer2(this.delegate.createRenderer(element, renderData)); 39671 } 39672 begin() { 39673 if (this.delegate.begin) { 39674 this.delegate.begin(); 39675 } 39676 } 39677 end() { 39678 if (this.delegate.end) { 39679 this.delegate.end(); 39680 } 39681 } 39682 whenRenderingDone() { 39683 if (this.delegate.whenRenderingDone) { 39684 return this.delegate.whenRenderingDone(); 39685 } 39686 return Promise.resolve(null); 39687 } 39688} 39689class DebugRenderer2 { 39690 constructor(delegate) { 39691 this.delegate = delegate; 39692 /** 39693 * Factory function used to create a `DebugContext` when a node is created. 39694 * 39695 * The `DebugContext` allows to retrieve information about the nodes that are useful in tests. 39696 * 39697 * The factory is configurable so that the `DebugRenderer2` could instantiate either a View Engine 39698 * or a Render context. 39699 */ 39700 this.debugContextFactory = getCurrentDebugContext; 39701 this.data = this.delegate.data; 39702 } 39703 createDebugContext(nativeElement) { 39704 return this.debugContextFactory(nativeElement); 39705 } 39706 destroyNode(node) { 39707 const debugNode = getDebugNode$1(node); 39708 removeDebugNodeFromIndex(debugNode); 39709 if (debugNode instanceof DebugNode__PRE_R3__) { 39710 debugNode.listeners.length = 0; 39711 } 39712 if (this.delegate.destroyNode) { 39713 this.delegate.destroyNode(node); 39714 } 39715 } 39716 destroy() { 39717 this.delegate.destroy(); 39718 } 39719 createElement(name, namespace) { 39720 const el = this.delegate.createElement(name, namespace); 39721 const debugCtx = this.createDebugContext(el); 39722 if (debugCtx) { 39723 const debugEl = new DebugElement__PRE_R3__(el, null, debugCtx); 39724 debugEl.name = name; 39725 indexDebugNode(debugEl); 39726 } 39727 return el; 39728 } 39729 createComment(value) { 39730 const comment = this.delegate.createComment(value); 39731 const debugCtx = this.createDebugContext(comment); 39732 if (debugCtx) { 39733 indexDebugNode(new DebugNode__PRE_R3__(comment, null, debugCtx)); 39734 } 39735 return comment; 39736 } 39737 createText(value) { 39738 const text = this.delegate.createText(value); 39739 const debugCtx = this.createDebugContext(text); 39740 if (debugCtx) { 39741 indexDebugNode(new DebugNode__PRE_R3__(text, null, debugCtx)); 39742 } 39743 return text; 39744 } 39745 appendChild(parent, newChild) { 39746 const debugEl = getDebugNode$1(parent); 39747 const debugChildEl = getDebugNode$1(newChild); 39748 if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) { 39749 debugEl.addChild(debugChildEl); 39750 } 39751 this.delegate.appendChild(parent, newChild); 39752 } 39753 insertBefore(parent, newChild, refChild) { 39754 const debugEl = getDebugNode$1(parent); 39755 const debugChildEl = getDebugNode$1(newChild); 39756 const debugRefEl = getDebugNode$1(refChild); 39757 if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) { 39758 debugEl.insertBefore(debugRefEl, debugChildEl); 39759 } 39760 this.delegate.insertBefore(parent, newChild, refChild); 39761 } 39762 removeChild(parent, oldChild) { 39763 const debugEl = getDebugNode$1(parent); 39764 const debugChildEl = getDebugNode$1(oldChild); 39765 if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) { 39766 debugEl.removeChild(debugChildEl); 39767 } 39768 this.delegate.removeChild(parent, oldChild); 39769 } 39770 selectRootElement(selectorOrNode, preserveContent) { 39771 const el = this.delegate.selectRootElement(selectorOrNode, preserveContent); 39772 const debugCtx = getCurrentDebugContext(); 39773 if (debugCtx) { 39774 indexDebugNode(new DebugElement__PRE_R3__(el, null, debugCtx)); 39775 } 39776 return el; 39777 } 39778 setAttribute(el, name, value, namespace) { 39779 const debugEl = getDebugNode$1(el); 39780 if (debugEl && debugEl instanceof DebugElement__PRE_R3__) { 39781 const fullName = namespace ? namespace + ':' + name : name; 39782 debugEl.attributes[fullName] = value; 39783 } 39784 this.delegate.setAttribute(el, name, value, namespace); 39785 } 39786 removeAttribute(el, name, namespace) { 39787 const debugEl = getDebugNode$1(el); 39788 if (debugEl && debugEl instanceof DebugElement__PRE_R3__) { 39789 const fullName = namespace ? namespace + ':' + name : name; 39790 debugEl.attributes[fullName] = null; 39791 } 39792 this.delegate.removeAttribute(el, name, namespace); 39793 } 39794 addClass(el, name) { 39795 const debugEl = getDebugNode$1(el); 39796 if (debugEl && debugEl instanceof DebugElement__PRE_R3__) { 39797 debugEl.classes[name] = true; 39798 } 39799 this.delegate.addClass(el, name); 39800 } 39801 removeClass(el, name) { 39802 const debugEl = getDebugNode$1(el); 39803 if (debugEl && debugEl instanceof DebugElement__PRE_R3__) { 39804 debugEl.classes[name] = false; 39805 } 39806 this.delegate.removeClass(el, name); 39807 } 39808 setStyle(el, style, value, flags) { 39809 const debugEl = getDebugNode$1(el); 39810 if (debugEl && debugEl instanceof DebugElement__PRE_R3__) { 39811 debugEl.styles[style] = value; 39812 } 39813 this.delegate.setStyle(el, style, value, flags); 39814 } 39815 removeStyle(el, style, flags) { 39816 const debugEl = getDebugNode$1(el); 39817 if (debugEl && debugEl instanceof DebugElement__PRE_R3__) { 39818 debugEl.styles[style] = null; 39819 } 39820 this.delegate.removeStyle(el, style, flags); 39821 } 39822 setProperty(el, name, value) { 39823 const debugEl = getDebugNode$1(el); 39824 if (debugEl && debugEl instanceof DebugElement__PRE_R3__) { 39825 debugEl.properties[name] = value; 39826 } 39827 this.delegate.setProperty(el, name, value); 39828 } 39829 listen(target, eventName, callback) { 39830 if (typeof target !== 'string') { 39831 const debugEl = getDebugNode$1(target); 39832 if (debugEl) { 39833 debugEl.listeners.push(new DebugEventListener(eventName, callback)); 39834 } 39835 } 39836 return this.delegate.listen(target, eventName, callback); 39837 } 39838 parentNode(node) { 39839 return this.delegate.parentNode(node); 39840 } 39841 nextSibling(node) { 39842 return this.delegate.nextSibling(node); 39843 } 39844 setValue(node, value) { 39845 return this.delegate.setValue(node, value); 39846 } 39847} 39848 39849/** 39850 * @license 39851 * Copyright Google LLC All Rights Reserved. 39852 * 39853 * Use of this source code is governed by an MIT-style license that can be 39854 * found in the LICENSE file at https://angular.io/license 39855 */ 39856function overrideProvider(override) { 39857 initServicesIfNeeded(); 39858 return Services.overrideProvider(override); 39859} 39860function overrideComponentView(comp, componentFactory) { 39861 initServicesIfNeeded(); 39862 return Services.overrideComponentView(comp, componentFactory); 39863} 39864function clearOverrides() { 39865 initServicesIfNeeded(); 39866 return Services.clearOverrides(); 39867} 39868// Attention: this function is called as top level function. 39869// Putting any logic in here will destroy closure tree shaking! 39870function createNgModuleFactory(ngModuleType, bootstrapComponents, defFactory) { 39871 return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory); 39872} 39873function cloneNgModuleDefinition(def) { 39874 const providers = Array.from(def.providers); 39875 const modules = Array.from(def.modules); 39876 const providersByKey = {}; 39877 for (const key in def.providersByKey) { 39878 providersByKey[key] = def.providersByKey[key]; 39879 } 39880 return { 39881 factory: def.factory, 39882 scope: def.scope, 39883 providers, 39884 modules, 39885 providersByKey, 39886 }; 39887} 39888class NgModuleFactory_ extends NgModuleFactory { 39889 constructor(moduleType, _bootstrapComponents, _ngModuleDefFactory) { 39890 // Attention: this ctor is called as top level function. 39891 // Putting any logic in here will destroy closure tree shaking! 39892 super(); 39893 this.moduleType = moduleType; 39894 this._bootstrapComponents = _bootstrapComponents; 39895 this._ngModuleDefFactory = _ngModuleDefFactory; 39896 } 39897 create(parentInjector) { 39898 initServicesIfNeeded(); 39899 // Clone the NgModuleDefinition so that any tree shakeable provider definition 39900 // added to this instance of the NgModuleRef doesn't affect the cached copy. 39901 // See https://github.com/angular/angular/issues/25018. 39902 const def = cloneNgModuleDefinition(resolveDefinition(this._ngModuleDefFactory)); 39903 return Services.createNgModuleRef(this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def); 39904 } 39905} 39906 39907/** 39908 * @license 39909 * Copyright Google LLC All Rights Reserved. 39910 * 39911 * Use of this source code is governed by an MIT-style license that can be 39912 * found in the LICENSE file at https://angular.io/license 39913 */ 39914 39915/** 39916 * @license 39917 * Copyright Google LLC All Rights Reserved. 39918 * 39919 * Use of this source code is governed by an MIT-style license that can be 39920 * found in the LICENSE file at https://angular.io/license 39921 */ 39922 39923/** 39924 * @license 39925 * Copyright Google LLC All Rights Reserved. 39926 * 39927 * Use of this source code is governed by an MIT-style license that can be 39928 * found in the LICENSE file at https://angular.io/license 39929 */ 39930// clang-format on 39931 39932/** 39933 * @license 39934 * Copyright Google LLC All Rights Reserved. 39935 * 39936 * Use of this source code is governed by an MIT-style license that can be 39937 * found in the LICENSE file at https://angular.io/license 39938 */ 39939 39940/** 39941 * @license 39942 * Copyright Google LLC All Rights Reserved. 39943 * 39944 * Use of this source code is governed by an MIT-style license that can be 39945 * found in the LICENSE file at https://angular.io/license 39946 */ 39947if (ngDevMode) { 39948 // This helper is to give a reasonable error message to people upgrading to v9 that have not yet 39949 // installed `@angular/localize` in their app. 39950 // tslint:disable-next-line: no-toplevel-property-access 39951 _global.$localize = _global.$localize || function () { 39952 throw new Error('It looks like your application or one of its dependencies is using i18n.\n' + 39953 'Angular 9 introduced a global `$localize()` function that needs to be loaded.\n' + 39954 'Please run `ng add @angular/localize` from the Angular CLI.\n' + 39955 '(For non-CLI projects, add `import \'@angular/localize/init\';` to your `polyfills.ts` file.\n' + 39956 'For server-side rendering applications add the import to your `main.server.ts` file.)'); 39957 }; 39958} 39959 39960/** 39961 * @license 39962 * Copyright Google LLC All Rights Reserved. 39963 * 39964 * Use of this source code is governed by an MIT-style license that can be 39965 * found in the LICENSE file at https://angular.io/license 39966 */ 39967// This file only reexports content of the `src` folder. Keep it that way. 39968 39969/** 39970 * @license 39971 * Copyright Google LLC All Rights Reserved. 39972 * 39973 * Use of this source code is governed by an MIT-style license that can be 39974 * found in the LICENSE file at https://angular.io/license 39975 */ 39976 39977/** 39978 * Generated bundle index. Do not edit. 39979 */ 39980 39981 39982 39983//# sourceMappingURL=core.js.map 39984 39985/***/ }), 39986
vendor: 290,004 bytes, lines 39987-46987
39987/***/ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js": 39988/*!********************************************************************!*\ 39989 !*** ./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js ***! 39990 \********************************************************************/ 39991/*! exports provided: AbstractControl, AbstractControlDirective, AbstractFormGroupDirective, COMPOSITION_BUFFER_MODE, CheckboxControlValueAccessor, CheckboxRequiredValidator, ControlContainer, DefaultValueAccessor, EmailValidator, FormArray, FormArrayName, FormBuilder, FormControl, FormControlDirective, FormControlName, FormGroup, FormGroupDirective, FormGroupName, FormsModule, MaxLengthValidator, MinLengthValidator, NG_ASYNC_VALIDATORS, NG_VALIDATORS, NG_VALUE_ACCESSOR, NgControl, NgControlStatus, NgControlStatusGroup, NgForm, NgModel, NgModelGroup, NgSelectOption, NumberValueAccessor, PatternValidator, RadioControlValueAccessor, RangeValueAccessor, ReactiveFormsModule, RequiredValidator, SelectControlValueAccessor, SelectMultipleControlValueAccessor, VERSION, Validators, ɵInternalFormsSharedModule, ɵNgNoValidate, ɵNgSelectMultipleOption, ɵangular_packages_forms_forms_a, ɵangular_packages_forms_forms_b, ɵangular_packages_forms_forms_ba, ɵangular_packages_forms_forms_bb, ɵangular_packages_forms_forms_bc, ɵangular_packages_forms_forms_bd, ɵangular_packages_forms_forms_be, ɵangular_packages_forms_forms_c, ɵangular_packages_forms_forms_d, ɵangular_packages_forms_forms_e, ɵangular_packages_forms_forms_f, ɵangular_packages_forms_forms_g, ɵangular_packages_forms_forms_h, ɵangular_packages_forms_forms_i, ɵangular_packages_forms_forms_j, ɵangular_packages_forms_forms_k, ɵangular_packages_forms_forms_l, ɵangular_packages_forms_forms_m, ɵangular_packages_forms_forms_n, ɵangular_packages_forms_forms_o, ɵangular_packages_forms_forms_p, ɵangular_packages_forms_forms_q, ɵangular_packages_forms_forms_r, ɵangular_packages_forms_forms_s, ɵangular_packages_forms_forms_t, ɵangular_packages_forms_forms_u, ɵangular_packages_forms_forms_v, ɵangular_packages_forms_forms_w, ɵangular_packages_forms_forms_x, ɵangular_packages_forms_forms_y, ɵangular_packages_forms_forms_z */ 39992/***/ (function(module, __webpack_exports__, __webpack_require__) { 39993 39994"use strict"; 39995__webpack_require__.r(__webpack_exports__); 39996/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractControl", function() { return AbstractControl; }); 39997/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractControlDirective", function() { return AbstractControlDirective; }); 39998/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractFormGroupDirective", function() { return AbstractFormGroupDirective; }); 39999/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMPOSITION_BUFFER_MODE", function() { return COMPOSITION_BUFFER_MODE; }); 40000/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckboxControlValueAccessor", function() { return CheckboxControlValueAccessor; }); 40001/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckboxRequiredValidator", function() { return CheckboxRequiredValidator; }); 40002/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ControlContainer", function() { return ControlContainer; }); 40003/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultValueAccessor", function() { return DefaultValueAccessor; }); 40004/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmailValidator", function() { return EmailValidator; }); 40005/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormArray", function() { return FormArray; }); 40006/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormArrayName", function() { return FormArrayName; }); 40007/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormBuilder", function() { return FormBuilder; }); 40008/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControl", function() { return FormControl; }); 40009/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControlDirective", function() { return FormControlDirective; }); 40010/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControlName", function() { return FormControlName; }); 40011/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroup", function() { return FormGroup; }); 40012/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroupDirective", function() { return FormGroupDirective; }); 40013/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroupName", function() { return FormGroupName; }); 40014/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormsModule", function() { return FormsModule; }); 40015/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaxLengthValidator", function() { return MaxLengthValidator; }); 40016/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinLengthValidator", function() { return MinLengthValidator; }); 40017/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_ASYNC_VALIDATORS", function() { return NG_ASYNC_VALIDATORS; }); 40018/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_VALIDATORS", function() { return NG_VALIDATORS; }); 40019/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_VALUE_ACCESSOR", function() { return NG_VALUE_ACCESSOR; }); 40020/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControl", function() { return NgControl; }); 40021/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControlStatus", function() { return NgControlStatus; }); 40022/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControlStatusGroup", function() { return NgControlStatusGroup; }); 40023/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForm", function() { return NgForm; }); 40024/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModel", function() { return NgModel; }); 40025/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModelGroup", function() { return NgModelGroup; }); 40026/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSelectOption", function() { return NgSelectOption; }); 40027/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberValueAccessor", function() { return NumberValueAccessor; }); 40028/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PatternValidator", function() { return PatternValidator; }); 40029/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadioControlValueAccessor", function() { return RadioControlValueAccessor; }); 40030/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RangeValueAccessor", function() { return RangeValueAccessor; }); 40031/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReactiveFormsModule", function() { return ReactiveFormsModule; }); 40032/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequiredValidator", function() { return RequiredValidator; }); 40033/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectControlValueAccessor", function() { return SelectControlValueAccessor; }); 40034/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectMultipleControlValueAccessor", function() { return SelectMultipleControlValueAccessor; }); 40035/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); 40036/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Validators", function() { return Validators; }); 40037/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵInternalFormsSharedModule", function() { return ɵInternalFormsSharedModule; }); 40038/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNgNoValidate", function() { return ɵNgNoValidate; }); 40039/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNgSelectMultipleOption", function() { return ɵNgSelectMultipleOption; }); 40040/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_a", function() { return SHARED_FORM_DIRECTIVES; }); 40041/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_b", function() { return TEMPLATE_DRIVEN_DIRECTIVES; }); 40042/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_ba", function() { return CHECKBOX_REQUIRED_VALIDATOR; }); 40043/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_bb", function() { return EMAIL_VALIDATOR; }); 40044/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_bc", function() { return MIN_LENGTH_VALIDATOR; }); 40045/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_bd", function() { return MAX_LENGTH_VALIDATOR; }); 40046/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_be", function() { return PATTERN_VALIDATOR; }); 40047/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_c", function() { return REACTIVE_DRIVEN_DIRECTIVES; }); 40048/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_d", function() { return ɵInternalFormsSharedModule; }); 40049/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_e", function() { return CHECKBOX_VALUE_ACCESSOR; }); 40050/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_f", function() { return DEFAULT_VALUE_ACCESSOR; }); 40051/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_g", function() { return AbstractControlStatus; }); 40052/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_h", function() { return ngControlStatusHost; }); 40053/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_i", function() { return formDirectiveProvider; }); 40054/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_j", function() { return formControlBinding; }); 40055/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_k", function() { return modelGroupProvider; }); 40056/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_l", function() { return NUMBER_VALUE_ACCESSOR; }); 40057/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_m", function() { return RADIO_VALUE_ACCESSOR; }); 40058/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_n", function() { return RadioControlRegistry; }); 40059/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_o", function() { return RANGE_VALUE_ACCESSOR; }); 40060/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_p", function() { return NG_MODEL_WITH_FORM_CONTROL_WARNING; }); 40061/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_q", function() { return formControlBinding$1; }); 40062/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_r", function() { return controlNameBinding; }); 40063/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_s", function() { return formDirectiveProvider$1; }); 40064/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_t", function() { return formGroupNameProvider; }); 40065/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_u", function() { return formArrayNameProvider; }); 40066/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_v", function() { return SELECT_VALUE_ACCESSOR; }); 40067/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_w", function() { return SELECT_MULTIPLE_VALUE_ACCESSOR; }); 40068/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_x", function() { return ɵNgSelectMultipleOption; }); 40069/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_y", function() { return ɵNgNoValidate; }); 40070/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_forms_forms_z", function() { return REQUIRED_VALIDATOR; }); 40071/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js"); 40072/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js"); 40073/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); 40074/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js"); 40075/** 40076 * @license Angular v10.0.14 40077 * (c) 2010-2020 Google LLC. https://angular.io/ 40078 * License: MIT 40079 */ 40080 40081 40082 40083 40084 40085 40086/** 40087 * @license 40088 * Copyright Google LLC All Rights Reserved. 40089 * 40090 * Use of this source code is governed by an MIT-style license that can be 40091 * found in the LICENSE file at https://angular.io/license 40092 */ 40093/** 40094 * Used to provide a `ControlValueAccessor` for form controls. 40095 * 40096 * See `DefaultValueAccessor` for how to implement one. 40097 * 40098 * @publicApi 40099 */ 40100 40101const NG_VALUE_ACCESSOR = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('NgValueAccessor'); 40102 40103/** 40104 * @license 40105 * Copyright Google LLC All Rights Reserved. 40106 * 40107 * Use of this source code is governed by an MIT-style license that can be 40108 * found in the LICENSE file at https://angular.io/license 40109 */ 40110const CHECKBOX_VALUE_ACCESSOR = { 40111 provide: NG_VALUE_ACCESSOR, 40112 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => CheckboxControlValueAccessor), 40113 multi: true, 40114}; 40115/** 40116 * @description 40117 * A `ControlValueAccessor` for writing a value and listening to changes on a checkbox input 40118 * element. 40119 * 40120 * @usageNotes 40121 * 40122 * ### Using a checkbox with a reactive form. 40123 * 40124 * The following example shows how to use a checkbox with a reactive form. 40125 * 40126 * ```ts 40127 * const rememberLoginControl = new FormControl(); 40128 * ``` 40129 * 40130 * ``` 40131 * <input type="checkbox" [formControl]="rememberLoginControl"> 40132 * ``` 40133 * 40134 * @ngModule ReactiveFormsModule 40135 * @ngModule FormsModule 40136 * @publicApi 40137 */ 40138class CheckboxControlValueAccessor { 40139 constructor(_renderer, _elementRef) { 40140 this._renderer = _renderer; 40141 this._elementRef = _elementRef; 40142 /** 40143 * @description 40144 * The registered callback function called when a change event occurs on the input element. 40145 */ 40146 this.onChange = (_) => { }; 40147 /** 40148 * @description 40149 * The registered callback function called when a blur event occurs on the input element. 40150 */ 40151 this.onTouched = () => { }; 40152 } 40153 /** 40154 * Sets the "checked" property on the input element. 40155 * 40156 * @param value The checked value 40157 */ 40158 writeValue(value) { 40159 this._renderer.setProperty(this._elementRef.nativeElement, 'checked', value); 40160 } 40161 /** 40162 * @description 40163 * Registers a function called when the control value changes. 40164 * 40165 * @param fn The callback function 40166 */ 40167 registerOnChange(fn) { 40168 this.onChange = fn; 40169 } 40170 /** 40171 * @description 40172 * Registers a function called when the control is touched. 40173 * 40174 * @param fn The callback function 40175 */ 40176 registerOnTouched(fn) { 40177 this.onTouched = fn; 40178 } 40179 /** 40180 * Sets the "disabled" property on the input element. 40181 * 40182 * @param isDisabled The disabled value 40183 */ 40184 setDisabledState(isDisabled) { 40185 this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); 40186 } 40187} 40188CheckboxControlValueAccessor.ɵfac = function CheckboxControlValueAccessor_Factory(t) { return new (t || CheckboxControlValueAccessor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"])); }; 40189CheckboxControlValueAccessor.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CheckboxControlValueAccessor, selectors: [["input", "type", "checkbox", "formControlName", ""], ["input", "type", "checkbox", "formControl", ""], ["input", "type", "checkbox", "ngModel", ""]], hostBindings: function CheckboxControlValueAccessor_HostBindings(rf, ctx) { if (rf & 1) { 40190 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function CheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function CheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); }); 40191 } }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([CHECKBOX_VALUE_ACCESSOR])] }); 40192CheckboxControlValueAccessor.ctorParameters = () => [ 40193 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 40194 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] } 40195]; 40196/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CheckboxControlValueAccessor, [{ 40197 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 40198 args: [{ 40199 selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]', 40200 host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' }, 40201 providers: [CHECKBOX_VALUE_ACCESSOR] 40202 }] 40203 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }]; }, null); })(); 40204 40205/** 40206 * @license 40207 * Copyright Google LLC All Rights Reserved. 40208 * 40209 * Use of this source code is governed by an MIT-style license that can be 40210 * found in the LICENSE file at https://angular.io/license 40211 */ 40212const DEFAULT_VALUE_ACCESSOR = { 40213 provide: NG_VALUE_ACCESSOR, 40214 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => DefaultValueAccessor), 40215 multi: true 40216}; 40217/** 40218 * We must check whether the agent is Android because composition events 40219 * behave differently between iOS and Android. 40220 */ 40221function _isAndroid() { 40222 const userAgent = Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["ɵgetDOM"])() ? Object(_angular_common__WEBPACK_IMPORTED_MODULE_1__["ɵgetDOM"])().getUserAgent() : ''; 40223 return /android (\d+)/.test(userAgent.toLowerCase()); 40224} 40225/** 40226 * @description 40227 * Provide this token to control if form directives buffer IME input until 40228 * the "compositionend" event occurs. 40229 * @publicApi 40230 */ 40231const COMPOSITION_BUFFER_MODE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('CompositionEventMode'); 40232/** 40233 * @description 40234 * The default `ControlValueAccessor` for writing a value and listening to changes on input 40235 * elements. The accessor is used by the `FormControlDirective`, `FormControlName`, and 40236 * `NgModel` directives. 40237 * 40238 * @usageNotes 40239 * 40240 * ### Using the default value accessor 40241 * 40242 * The following example shows how to use an input element that activates the default value accessor 40243 * (in this case, a text field). 40244 * 40245 * ```ts 40246 * const firstNameControl = new FormControl(); 40247 * ``` 40248 * 40249 * ``` 40250 * <input type="text" [formControl]="firstNameControl"> 40251 * ``` 40252 * 40253 * @ngModule ReactiveFormsModule 40254 * @ngModule FormsModule 40255 * @publicApi 40256 */ 40257class DefaultValueAccessor { 40258 constructor(_renderer, _elementRef, _compositionMode) { 40259 this._renderer = _renderer; 40260 this._elementRef = _elementRef; 40261 this._compositionMode = _compositionMode; 40262 /** 40263 * @description 40264 * The registered callback function called when an input event occurs on the input element. 40265 */ 40266 this.onChange = (_) => { }; 40267 /** 40268 * @description 40269 * The registered callback function called when a blur event occurs on the input element. 40270 */ 40271 this.onTouched = () => { }; 40272 /** Whether the user is creating a composition string (IME events). */ 40273 this._composing = false; 40274 if (this._compositionMode == null) { 40275 this._compositionMode = !_isAndroid(); 40276 } 40277 } 40278 /** 40279 * Sets the "value" property on the input element. 40280 * 40281 * @param value The checked value 40282 */ 40283 writeValue(value) { 40284 const normalizedValue = value == null ? '' : value; 40285 this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue); 40286 } 40287 /** 40288 * @description 40289 * Registers a function called when the control value changes. 40290 * 40291 * @param fn The callback function 40292 */ 40293 registerOnChange(fn) { 40294 this.onChange = fn; 40295 } 40296 /** 40297 * @description 40298 * Registers a function called when the control is touched. 40299 * 40300 * @param fn The callback function 40301 */ 40302 registerOnTouched(fn) { 40303 this.onTouched = fn; 40304 } 40305 /** 40306 * Sets the "disabled" property on the input element. 40307 * 40308 * @param isDisabled The disabled value 40309 */ 40310 setDisabledState(isDisabled) { 40311 this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); 40312 } 40313 /** @internal */ 40314 _handleInput(value) { 40315 if (!this._compositionMode || (this._compositionMode && !this._composing)) { 40316 this.onChange(value); 40317 } 40318 } 40319 /** @internal */ 40320 _compositionStart() { 40321 this._composing = true; 40322 } 40323 /** @internal */ 40324 _compositionEnd(value) { 40325 this._composing = false; 40326 this._compositionMode && this.onChange(value); 40327 } 40328} 40329DefaultValueAccessor.ɵfac = function DefaultValueAccessor_Factory(t) { return new (t || DefaultValueAccessor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](COMPOSITION_BUFFER_MODE, 8)); }; 40330DefaultValueAccessor.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: DefaultValueAccessor, selectors: [["input", "formControlName", "", 3, "type", "checkbox"], ["textarea", "formControlName", ""], ["input", "formControl", "", 3, "type", "checkbox"], ["textarea", "formControl", ""], ["input", "ngModel", "", 3, "type", "checkbox"], ["textarea", "ngModel", ""], ["", "ngDefaultControl", ""]], hostBindings: function DefaultValueAccessor_HostBindings(rf, ctx) { if (rf & 1) { 40331 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("input", function DefaultValueAccessor_input_HostBindingHandler($event) { return ctx._handleInput($event.target.value); })("blur", function DefaultValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); })("compositionstart", function DefaultValueAccessor_compositionstart_HostBindingHandler() { return ctx._compositionStart(); })("compositionend", function DefaultValueAccessor_compositionend_HostBindingHandler($event) { return ctx._compositionEnd($event.target.value); }); 40332 } }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([DEFAULT_VALUE_ACCESSOR])] }); 40333DefaultValueAccessor.ctorParameters = () => [ 40334 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 40335 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, 40336 { type: Boolean, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [COMPOSITION_BUFFER_MODE,] }] } 40337]; 40338/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DefaultValueAccessor, [{ 40339 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 40340 args: [{ 40341 selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]', 40342 // TODO: vsavkin replace the above selector with the one below it once 40343 // https://github.com/angular/angular/issues/3011 is implemented 40344 // selector: '[ngModel],[formControl],[formControlName]', 40345 host: { 40346 '(input)': '$any(this)._handleInput($event.target.value)', 40347 '(blur)': 'onTouched()', 40348 '(compositionstart)': '$any(this)._compositionStart()', 40349 '(compositionend)': '$any(this)._compositionEnd($event.target.value)' 40350 }, 40351 providers: [DEFAULT_VALUE_ACCESSOR] 40352 }] 40353 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, { type: Boolean, decorators: [{ 40354 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 40355 }, { 40356 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 40357 args: [COMPOSITION_BUFFER_MODE] 40358 }] }]; }, null); })(); 40359 40360/** 40361 * @license 40362 * Copyright Google LLC All Rights Reserved. 40363 * 40364 * Use of this source code is governed by an MIT-style license that can be 40365 * found in the LICENSE file at https://angular.io/license 40366 */ 40367/** 40368 * @description 40369 * Base class for control directives. 40370 * 40371 * This class is only used internally in the `ReactiveFormsModule` and the `FormsModule`. 40372 * 40373 * @publicApi 40374 */ 40375class AbstractControlDirective { 40376 /** 40377 * @description 40378 * Reports the value of the control if it is present, otherwise null. 40379 */ 40380 get value() { 40381 return this.control ? this.control.value : null; 40382 } 40383 /** 40384 * @description 40385 * Reports whether the control is valid. A control is considered valid if no 40386 * validation errors exist with the current value. 40387 * If the control is not present, null is returned. 40388 */ 40389 get valid() { 40390 return this.control ? this.control.valid : null; 40391 } 40392 /** 40393 * @description 40394 * Reports whether the control is invalid, meaning that an error exists in the input value. 40395 * If the control is not present, null is returned. 40396 */ 40397 get invalid() { 40398 return this.control ? this.control.invalid : null; 40399 } 40400 /** 40401 * @description 40402 * Reports whether a control is pending, meaning that that async validation is occurring and 40403 * errors are not yet available for the input value. If the control is not present, null is 40404 * returned. 40405 */ 40406 get pending() { 40407 return this.control ? this.control.pending : null; 40408 } 40409 /** 40410 * @description 40411 * Reports whether the control is disabled, meaning that the control is disabled 40412 * in the UI and is exempt from validation checks and excluded from aggregate 40413 * values of ancestor controls. If the control is not present, null is returned. 40414 */ 40415 get disabled() { 40416 return this.control ? this.control.disabled : null; 40417 } 40418 /** 40419 * @description 40420 * Reports whether the control is enabled, meaning that the control is included in ancestor 40421 * calculations of validity or value. If the control is not present, null is returned. 40422 */ 40423 get enabled() { 40424 return this.control ? this.control.enabled : null; 40425 } 40426 /** 40427 * @description 40428 * Reports the control's validation errors. If the control is not present, null is returned. 40429 */ 40430 get errors() { 40431 return this.control ? this.control.errors : null; 40432 } 40433 /** 40434 * @description 40435 * Reports whether the control is pristine, meaning that the user has not yet changed 40436 * the value in the UI. If the control is not present, null is returned. 40437 */ 40438 get pristine() { 40439 return this.control ? this.control.pristine : null; 40440 } 40441 /** 40442 * @description 40443 * Reports whether the control is dirty, meaning that the user has changed 40444 * the value in the UI. If the control is not present, null is returned. 40445 */ 40446 get dirty() { 40447 return this.control ? this.control.dirty : null; 40448 } 40449 /** 40450 * @description 40451 * Reports whether the control is touched, meaning that the user has triggered 40452 * a `blur` event on it. If the control is not present, null is returned. 40453 */ 40454 get touched() { 40455 return this.control ? this.control.touched : null; 40456 } 40457 /** 40458 * @description 40459 * Reports the validation status of the control. Possible values include: 40460 * 'VALID', 'INVALID', 'DISABLED', and 'PENDING'. 40461 * If the control is not present, null is returned. 40462 */ 40463 get status() { 40464 return this.control ? this.control.status : null; 40465 } 40466 /** 40467 * @description 40468 * Reports whether the control is untouched, meaning that the user has not yet triggered 40469 * a `blur` event on it. If the control is not present, null is returned. 40470 */ 40471 get untouched() { 40472 return this.control ? this.control.untouched : null; 40473 } 40474 /** 40475 * @description 40476 * Returns a multicasting observable that emits a validation status whenever it is 40477 * calculated for the control. If the control is not present, null is returned. 40478 */ 40479 get statusChanges() { 40480 return this.control ? this.control.statusChanges : null; 40481 } 40482 /** 40483 * @description 40484 * Returns a multicasting observable of value changes for the control that emits every time the 40485 * value of the control changes in the UI or programmatically. 40486 * If the control is not present, null is returned. 40487 */ 40488 get valueChanges() { 40489 return this.control ? this.control.valueChanges : null; 40490 } 40491 /** 40492 * @description 40493 * Returns an array that represents the path from the top-level form to this control. 40494 * Each index is the string name of the control on that level. 40495 */ 40496 get path() { 40497 return null; 40498 } 40499 /** 40500 * @description 40501 * Resets the control with the provided value if the control is present. 40502 */ 40503 reset(value = undefined) { 40504 if (this.control) 40505 this.control.reset(value); 40506 } 40507 /** 40508 * @description 40509 * Reports whether the control with the given path has the error specified. 40510 * 40511 * @param errorCode The code of the error to check 40512 * @param path A list of control names that designates how to move from the current control 40513 * to the control that should be queried for errors. 40514 * 40515 * @usageNotes 40516 * For example, for the following `FormGroup`: 40517 * 40518 * ``` 40519 * form = new FormGroup({ 40520 * address: new FormGroup({ street: new FormControl() }) 40521 * }); 40522 * ``` 40523 * 40524 * The path to the 'street' control from the root form would be 'address' -> 'street'. 40525 * 40526 * It can be provided to this method in one of two formats: 40527 * 40528 * 1. An array of string control names, e.g. `['address', 'street']` 40529 * 1. A period-delimited list of control names in one string, e.g. `'address.street'` 40530 * 40531 * If no path is given, this method checks for the error on the current control. 40532 * 40533 * @returns whether the given error is present in the control at the given path. 40534 * 40535 * If the control is not present, false is returned. 40536 */ 40537 hasError(errorCode, path) { 40538 return this.control ? this.control.hasError(errorCode, path) : false; 40539 } 40540 /** 40541 * @description 40542 * Reports error data for the control with the given path. 40543 * 40544 * @param errorCode The code of the error to check 40545 * @param path A list of control names that designates how to move from the current control 40546 * to the control that should be queried for errors. 40547 * 40548 * @usageNotes 40549 * For example, for the following `FormGroup`: 40550 * 40551 * ``` 40552 * form = new FormGroup({ 40553 * address: new FormGroup({ street: new FormControl() }) 40554 * }); 40555 * ``` 40556 * 40557 * The path to the 'street' control from the root form would be 'address' -> 'street'. 40558 * 40559 * It can be provided to this method in one of two formats: 40560 * 40561 * 1. An array of string control names, e.g. `['address', 'street']` 40562 * 1. A period-delimited list of control names in one string, e.g. `'address.street'` 40563 * 40564 * @returns error data for that particular error. If the control or error is not present, 40565 * null is returned. 40566 */ 40567 getError(errorCode, path) { 40568 return this.control ? this.control.getError(errorCode, path) : null; 40569 } 40570} 40571AbstractControlDirective.ɵfac = function AbstractControlDirective_Factory(t) { return new (t || AbstractControlDirective)(); }; 40572AbstractControlDirective.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: AbstractControlDirective }); 40573 40574 40575/** 40576 * @license 40577 * Copyright Google LLC All Rights Reserved. 40578 * 40579 * Use of this source code is governed by an MIT-style license that can be 40580 * found in the LICENSE file at https://angular.io/license 40581 */ 40582/** 40583 * @description 40584 * A base class for directives that contain multiple registered instances of `NgControl`. 40585 * Only used by the forms module. 40586 * 40587 * @publicApi 40588 */ 40589class ControlContainer extends AbstractControlDirective { 40590 /** 40591 * @description 40592 * The top-level form directive for the control. 40593 */ 40594 get formDirective() { 40595 return null; 40596 } 40597 /** 40598 * @description 40599 * The path to this group. 40600 */ 40601 get path() { 40602 return null; 40603 } 40604} 40605ControlContainer.ɵfac = function ControlContainer_Factory(t) { return ɵControlContainer_BaseFactory(t || ControlContainer); }; 40606ControlContainer.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: ControlContainer, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 40607const ɵControlContainer_BaseFactory = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](ControlContainer); 40608 40609/** 40610 * @license 40611 * Copyright Google LLC All Rights Reserved. 40612 * 40613 * Use of this source code is governed by an MIT-style license that can be 40614 * found in the LICENSE file at https://angular.io/license 40615 */ 40616function unimplemented() { 40617 throw new Error('unimplemented'); 40618} 40619/** 40620 * @description 40621 * A base class that all `FormControl`-based directives extend. It binds a `FormControl` 40622 * object to a DOM element. 40623 * 40624 * @publicApi 40625 */ 40626class NgControl extends AbstractControlDirective { 40627 constructor() { 40628 super(...arguments); 40629 /** 40630 * @description 40631 * The parent form for the control. 40632 * 40633 * @internal 40634 */ 40635 this._parent = null; 40636 /** 40637 * @description 40638 * The name for the control 40639 */ 40640 this.name = null; 40641 /** 40642 * @description 40643 * The value accessor for the control 40644 */ 40645 this.valueAccessor = null; 40646 /** 40647 * @description 40648 * The uncomposed array of synchronous validators for the control 40649 * 40650 * @internal 40651 */ 40652 this._rawValidators = []; 40653 /** 40654 * @description 40655 * The uncomposed array of async validators for the control 40656 * 40657 * @internal 40658 */ 40659 this._rawAsyncValidators = []; 40660 } 40661 /** 40662 * @description 40663 * The registered synchronous validator function for the control 40664 * 40665 * @throws An exception that this method is not implemented 40666 */ 40667 get validator() { 40668 return unimplemented(); 40669 } 40670 /** 40671 * @description 40672 * The registered async validator function for the control 40673 * 40674 * @throws An exception that this method is not implemented 40675 */ 40676 get asyncValidator() { 40677 return unimplemented(); 40678 } 40679} 40680 40681/** 40682 * @license 40683 * Copyright Google LLC All Rights Reserved. 40684 * 40685 * Use of this source code is governed by an MIT-style license that can be 40686 * found in the LICENSE file at https://angular.io/license 40687 */ 40688class AbstractControlStatus { 40689 constructor(cd) { 40690 this._cd = cd; 40691 } 40692 get ngClassUntouched() { 40693 return this._cd.control ? this._cd.control.untouched : false; 40694 } 40695 get ngClassTouched() { 40696 return this._cd.control ? this._cd.control.touched : false; 40697 } 40698 get ngClassPristine() { 40699 return this._cd.control ? this._cd.control.pristine : false; 40700 } 40701 get ngClassDirty() { 40702 return this._cd.control ? this._cd.control.dirty : false; 40703 } 40704 get ngClassValid() { 40705 return this._cd.control ? this._cd.control.valid : false; 40706 } 40707 get ngClassInvalid() { 40708 return this._cd.control ? this._cd.control.invalid : false; 40709 } 40710 get ngClassPending() { 40711 return this._cd.control ? this._cd.control.pending : false; 40712 } 40713} 40714const ngControlStatusHost = { 40715 '[class.ng-untouched]': 'ngClassUntouched', 40716 '[class.ng-touched]': 'ngClassTouched', 40717 '[class.ng-pristine]': 'ngClassPristine', 40718 '[class.ng-dirty]': 'ngClassDirty', 40719 '[class.ng-valid]': 'ngClassValid', 40720 '[class.ng-invalid]': 'ngClassInvalid', 40721 '[class.ng-pending]': 'ngClassPending', 40722}; 40723/** 40724 * @description 40725 * Directive automatically applied to Angular form controls that sets CSS classes 40726 * based on control status. 40727 * 40728 * @usageNotes 40729 * 40730 * ### CSS classes applied 40731 * 40732 * The following classes are applied as the properties become true: 40733 * 40734 * * ng-valid 40735 * * ng-invalid 40736 * * ng-pending 40737 * * ng-pristine 40738 * * ng-dirty 40739 * * ng-untouched 40740 * * ng-touched 40741 * 40742 * @ngModule ReactiveFormsModule 40743 * @ngModule FormsModule 40744 * @publicApi 40745 */ 40746class NgControlStatus extends AbstractControlStatus { 40747 constructor(cd) { 40748 super(cd); 40749 } 40750} 40751NgControlStatus.ɵfac = function NgControlStatus_Factory(t) { return new (t || NgControlStatus)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgControl, 2)); }; 40752NgControlStatus.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgControlStatus, selectors: [["", "formControlName", ""], ["", "ngModel", ""], ["", "formControl", ""]], hostVars: 14, hostBindings: function NgControlStatus_HostBindings(rf, ctx) { if (rf & 2) { 40753 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("ng-untouched", ctx.ngClassUntouched)("ng-touched", ctx.ngClassTouched)("ng-pristine", ctx.ngClassPristine)("ng-dirty", ctx.ngClassDirty)("ng-valid", ctx.ngClassValid)("ng-invalid", ctx.ngClassInvalid)("ng-pending", ctx.ngClassPending); 40754 } }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 40755NgControlStatus.ctorParameters = () => [ 40756 { type: NgControl, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }] } 40757]; 40758/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgControlStatus, [{ 40759 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 40760 args: [{ selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost }] 40761 }], function () { return [{ type: NgControl, decorators: [{ 40762 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 40763 }] }]; }, null); })(); 40764/** 40765 * @description 40766 * Directive automatically applied to Angular form groups that sets CSS classes 40767 * based on control status (valid/invalid/dirty/etc). 40768 * 40769 * @see `NgControlStatus` 40770 * 40771 * @ngModule ReactiveFormsModule 40772 * @ngModule FormsModule 40773 * @publicApi 40774 */ 40775class NgControlStatusGroup extends AbstractControlStatus { 40776 constructor(cd) { 40777 super(cd); 40778 } 40779} 40780NgControlStatusGroup.ɵfac = function NgControlStatusGroup_Factory(t) { return new (t || NgControlStatusGroup)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ControlContainer, 2)); }; 40781NgControlStatusGroup.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgControlStatusGroup, selectors: [["", "formGroupName", ""], ["", "formArrayName", ""], ["", "ngModelGroup", ""], ["", "formGroup", ""], ["form", 3, "ngNoForm", ""], ["", "ngForm", ""]], hostVars: 14, hostBindings: function NgControlStatusGroup_HostBindings(rf, ctx) { if (rf & 2) { 40782 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("ng-untouched", ctx.ngClassUntouched)("ng-touched", ctx.ngClassTouched)("ng-pristine", ctx.ngClassPristine)("ng-dirty", ctx.ngClassDirty)("ng-valid", ctx.ngClassValid)("ng-invalid", ctx.ngClassInvalid)("ng-pending", ctx.ngClassPending); 40783 } }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 40784NgControlStatusGroup.ctorParameters = () => [ 40785 { type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }] } 40786]; 40787/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgControlStatusGroup, [{ 40788 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 40789 args: [{ 40790 selector: '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]', 40791 host: ngControlStatusHost 40792 }] 40793 }], function () { return [{ type: ControlContainer, decorators: [{ 40794 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 40795 }] }]; }, null); })(); 40796 40797/** 40798 * @license 40799 * Copyright Google LLC All Rights Reserved. 40800 * 40801 * Use of this source code is governed by an MIT-style license that can be 40802 * found in the LICENSE file at https://angular.io/license 40803 */ 40804function isEmptyInputValue(value) { 40805 // we don't check for string here so it also works with arrays 40806 return value == null || value.length === 0; 40807} 40808function hasValidLength(value) { 40809 // non-strict comparison is intentional, to check for both `null` and `undefined` values 40810 return value != null && typeof value.length === 'number'; 40811} 40812/** 40813 * @description 40814 * An `InjectionToken` for registering additional synchronous validators used with 40815 * `AbstractControl`s. 40816 * 40817 * @see `NG_ASYNC_VALIDATORS` 40818 * 40819 * @usageNotes 40820 * 40821 * ### Providing a custom validator 40822 * 40823 * The following example registers a custom validator directive. Adding the validator to the 40824 * existing collection of validators requires the `multi: true` option. 40825 * 40826 * ```typescript 40827 * @Directive({ 40828 * selector: '[customValidator]', 40829 * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}] 40830 * }) 40831 * class CustomValidatorDirective implements Validator { 40832 * validate(control: AbstractControl): ValidationErrors | null { 40833 * return { 'custom': true }; 40834 * } 40835 * } 40836 * ``` 40837 * 40838 * @publicApi 40839 */ 40840const NG_VALIDATORS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('NgValidators'); 40841/** 40842 * @description 40843 * An `InjectionToken` for registering additional asynchronous validators used with 40844 * `AbstractControl`s. 40845 * 40846 * @see `NG_VALIDATORS` 40847 * 40848 * @publicApi 40849 */ 40850const NG_ASYNC_VALIDATORS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('NgAsyncValidators'); 40851/** 40852 * A regular expression that matches valid e-mail addresses. 40853 * 40854 * At a high level, this regexp matches e-mail addresses of the format `local-part@tld`, where: 40855 * - `local-part` consists of one or more of the allowed characters (alphanumeric and some 40856 * punctuation symbols). 40857 * - `local-part` cannot begin or end with a period (`.`). 40858 * - `local-part` cannot be longer than 64 characters. 40859 * - `tld` consists of one or more `labels` separated by periods (`.`). For example `localhost` or 40860 * `foo.com`. 40861 * - A `label` consists of one or more of the allowed characters (alphanumeric, dashes (`-`) and 40862 * periods (`.`)). 40863 * - A `label` cannot begin or end with a dash (`-`) or a period (`.`). 40864 * - A `label` cannot be longer than 63 characters. 40865 * - The whole address cannot be longer than 254 characters. 40866 * 40867 * ## Implementation background 40868 * 40869 * This regexp was ported over from AngularJS (see there for git history): 40870 * https://github.com/angular/angular.js/blob/c133ef836/src/ng/directive/input.js#L27 40871 * It is based on the 40872 * [WHATWG version](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with 40873 * some enhancements to incorporate more RFC rules (such as rules related to domain names and the 40874 * lengths of different parts of the address). The main differences from the WHATWG version are: 40875 * - Disallow `local-part` to begin or end with a period (`.`). 40876 * - Disallow `local-part` length to exceed 64 characters. 40877 * - Disallow total address length to exceed 254 characters. 40878 * 40879 * See [this commit](https://github.com/angular/angular.js/commit/f3f5cf72e) for more details. 40880 */ 40881const EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; 40882/** 40883 * @description 40884 * Provides a set of built-in validators that can be used by form controls. 40885 * 40886 * A validator is a function that processes a `FormControl` or collection of 40887 * controls and returns an error map or null. A null map means that validation has passed. 40888 * 40889 * @see [Form Validation](/guide/form-validation) 40890 * 40891 * @publicApi 40892 */ 40893class Validators { 40894 /** 40895 * @description 40896 * Validator that requires the control's value to be greater than or equal to the provided number. 40897 * The validator exists only as a function and not as a directive. 40898 * 40899 * @usageNotes 40900 * 40901 * ### Validate against a minimum of 3 40902 * 40903 * ```typescript 40904 * const control = new FormControl(2, Validators.min(3)); 40905 * 40906 * console.log(control.errors); // {min: {min: 3, actual: 2}} 40907 * ``` 40908 * 40909 * @returns A validator function that returns an error map with the 40910 * `min` property if the validation check fails, otherwise `null`. 40911 * 40912 * @see `updateValueAndValidity()` 40913 * 40914 */ 40915 static min(min) { 40916 return (control) => { 40917 if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) { 40918 return null; // don't validate empty values to allow optional controls 40919 } 40920 const value = parseFloat(control.value); 40921 // Controls with NaN values after parsing should be treated as not having a 40922 // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min 40923 return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null; 40924 }; 40925 } 40926 /** 40927 * @description 40928 * Validator that requires the control's value to be less than or equal to the provided number. 40929 * The validator exists only as a function and not as a directive. 40930 * 40931 * @usageNotes 40932 * 40933 * ### Validate against a maximum of 15 40934 * 40935 * ```typescript 40936 * const control = new FormControl(16, Validators.max(15)); 40937 * 40938 * console.log(control.errors); // {max: {max: 15, actual: 16}} 40939 * ``` 40940 * 40941 * @returns A validator function that returns an error map with the 40942 * `max` property if the validation check fails, otherwise `null`. 40943 * 40944 * @see `updateValueAndValidity()` 40945 * 40946 */ 40947 static max(max) { 40948 return (control) => { 40949 if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) { 40950 return null; // don't validate empty values to allow optional controls 40951 } 40952 const value = parseFloat(control.value); 40953 // Controls with NaN values after parsing should be treated as not having a 40954 // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max 40955 return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null; 40956 }; 40957 } 40958 /** 40959 * @description 40960 * Validator that requires the control have a non-empty value. 40961 * 40962 * @usageNotes 40963 * 40964 * ### Validate that the field is non-empty 40965 * 40966 * ```typescript 40967 * const control = new FormControl('', Validators.required); 40968 * 40969 * console.log(control.errors); // {required: true} 40970 * ``` 40971 * 40972 * @returns An error map with the `required` property 40973 * if the validation check fails, otherwise `null`. 40974 * 40975 * @see `updateValueAndValidity()` 40976 * 40977 */ 40978 static required(control) { 40979 return isEmptyInputValue(control.value) ? { 'required': true } : null; 40980 } 40981 /** 40982 * @description 40983 * Validator that requires the control's value be true. This validator is commonly 40984 * used for required checkboxes. 40985 * 40986 * @usageNotes 40987 * 40988 * ### Validate that the field value is true 40989 * 40990 * ```typescript 40991 * const control = new FormControl('', Validators.requiredTrue); 40992 * 40993 * console.log(control.errors); // {required: true} 40994 * ``` 40995 * 40996 * @returns An error map that contains the `required` property 40997 * set to `true` if the validation check fails, otherwise `null`. 40998 * 40999 * @see `updateValueAndValidity()` 41000 * 41001 */ 41002 static requiredTrue(control) { 41003 return control.value === true ? null : { 'required': true }; 41004 } 41005 /** 41006 * @description 41007 * Validator that requires the control's value pass an email validation test. 41008 * 41009 * Tests the value using a [regular 41010 * expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) 41011 * pattern suitable for common usecases. The pattern is based on the definition of a valid email 41012 * address in the [WHATWG HTML 41013 * specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with 41014 * some enhancements to incorporate more RFC rules (such as rules related to domain names and the 41015 * lengths of different parts of the address). 41016 * 41017 * The differences from the WHATWG version include: 41018 * - Disallow `local-part` (the part before the `@` symbol) to begin or end with a period (`.`). 41019 * - Disallow `local-part` to be longer than 64 characters. 41020 * - Disallow the whole address to be longer than 254 characters. 41021 * 41022 * If this pattern does not satisfy your business needs, you can use `Validators.pattern()` to 41023 * validate the value against a different pattern. 41024 * 41025 * @usageNotes 41026 * 41027 * ### Validate that the field matches a valid email pattern 41028 * 41029 * ```typescript 41030 * const control = new FormControl('bad@', Validators.email); 41031 * 41032 * console.log(control.errors); // {email: true} 41033 * ``` 41034 * 41035 * @returns An error map with the `email` property 41036 * if the validation check fails, otherwise `null`. 41037 * 41038 * @see `updateValueAndValidity()` 41039 * 41040 */ 41041 static email(control) { 41042 if (isEmptyInputValue(control.value)) { 41043 return null; // don't validate empty values to allow optional controls 41044 } 41045 return EMAIL_REGEXP.test(control.value) ? null : { 'email': true }; 41046 } 41047 /** 41048 * @description 41049 * Validator that requires the length of the control's value to be greater than or equal 41050 * to the provided minimum length. This validator is also provided by default if you use the 41051 * the HTML5 `minlength` attribute. Note that the `minLength` validator is intended to be used 41052 * only for types that have a numeric `length` property, such as strings or arrays. The 41053 * `minLength` validator logic is also not invoked for values when their `length` property is 0 41054 * (for example in case of an empty string or an empty array), to support optional controls. You 41055 * can use the standard `required` validator if empty values should not be considered valid. 41056 * 41057 * @usageNotes 41058 * 41059 * ### Validate that the field has a minimum of 3 characters 41060 * 41061 * ```typescript 41062 * const control = new FormControl('ng', Validators.minLength(3)); 41063 * 41064 * console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}} 41065 * ``` 41066 * 41067 * ```html 41068 * <input minlength="5"> 41069 * ``` 41070 * 41071 * @returns A validator function that returns an error map with the 41072 * `minlength` if the validation check fails, otherwise `null`. 41073 * 41074 * @see `updateValueAndValidity()` 41075 * 41076 */ 41077 static minLength(minLength) { 41078 return (control) => { 41079 if (isEmptyInputValue(control.value) || !hasValidLength(control.value)) { 41080 // don't validate empty values to allow optional controls 41081 // don't validate values without `length` property 41082 return null; 41083 } 41084 return control.value.length < minLength ? 41085 { 'minlength': { 'requiredLength': minLength, 'actualLength': control.value.length } } : 41086 null; 41087 }; 41088 } 41089 /** 41090 * @description 41091 * Validator that requires the length of the control's value to be less than or equal 41092 * to the provided maximum length. This validator is also provided by default if you use the 41093 * the HTML5 `maxlength` attribute. Note that the `maxLength` validator is intended to be used 41094 * only for types that have a numeric `length` property, such as strings or arrays. 41095 * 41096 * @usageNotes 41097 * 41098 * ### Validate that the field has maximum of 5 characters 41099 * 41100 * ```typescript 41101 * const control = new FormControl('Angular', Validators.maxLength(5)); 41102 * 41103 * console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}} 41104 * ``` 41105 * 41106 * ```html 41107 * <input maxlength="5"> 41108 * ``` 41109 * 41110 * @returns A validator function that returns an error map with the 41111 * `maxlength` property if the validation check fails, otherwise `null`. 41112 * 41113 * @see `updateValueAndValidity()` 41114 * 41115 */ 41116 static maxLength(maxLength) { 41117 return (control) => { 41118 return hasValidLength(control.value) && control.value.length > maxLength ? 41119 { 'maxlength': { 'requiredLength': maxLength, 'actualLength': control.value.length } } : 41120 null; 41121 }; 41122 } 41123 /** 41124 * @description 41125 * Validator that requires the control's value to match a regex pattern. This validator is also 41126 * provided by default if you use the HTML5 `pattern` attribute. 41127 * 41128 * @usageNotes 41129 * 41130 * ### Validate that the field only contains letters or spaces 41131 * 41132 * ```typescript 41133 * const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*')); 41134 * 41135 * console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}} 41136 * ``` 41137 * 41138 * ```html 41139 * <input pattern="[a-zA-Z ]*"> 41140 * ``` 41141 * 41142 * @param pattern A regular expression to be used as is to test the values, or a string. 41143 * If a string is passed, the `^` character is prepended and the `$` character is 41144 * appended to the provided string (if not already present), and the resulting regular 41145 * expression is used to test the values. 41146 * 41147 * @returns A validator function that returns an error map with the 41148 * `pattern` property if the validation check fails, otherwise `null`. 41149 * 41150 * @see `updateValueAndValidity()` 41151 * 41152 */ 41153 static pattern(pattern) { 41154 if (!pattern) 41155 return Validators.nullValidator; 41156 let regex; 41157 let regexStr; 41158 if (typeof pattern === 'string') { 41159 regexStr = ''; 41160 if (pattern.charAt(0) !== '^') 41161 regexStr += '^'; 41162 regexStr += pattern; 41163 if (pattern.charAt(pattern.length - 1) !== '$') 41164 regexStr += '$'; 41165 regex = new RegExp(regexStr); 41166 } 41167 else { 41168 regexStr = pattern.toString(); 41169 regex = pattern; 41170 } 41171 return (control) => { 41172 if (isEmptyInputValue(control.value)) { 41173 return null; // don't validate empty values to allow optional controls 41174 } 41175 const value = control.value; 41176 return regex.test(value) ? null : 41177 { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } }; 41178 }; 41179 } 41180 /** 41181 * @description 41182 * Validator that performs no operation. 41183 * 41184 * @see `updateValueAndValidity()` 41185 * 41186 */ 41187 static nullValidator(control) { 41188 return null; 41189 } 41190 static compose(validators) { 41191 if (!validators) 41192 return null; 41193 const presentValidators = validators.filter(isPresent); 41194 if (presentValidators.length == 0) 41195 return null; 41196 return function (control) { 41197 return mergeErrors(executeValidators(control, presentValidators)); 41198 }; 41199 } 41200 /** 41201 * @description 41202 * Compose multiple async validators into a single function that returns the union 41203 * of the individual error objects for the provided control. 41204 * 41205 * @returns A validator function that returns an error map with the 41206 * merged error objects of the async validators if the validation check fails, otherwise `null`. 41207 * 41208 * @see `updateValueAndValidity()` 41209 * 41210 */ 41211 static composeAsync(validators) { 41212 if (!validators) 41213 return null; 41214 const presentValidators = validators.filter(isPresent); 41215 if (presentValidators.length == 0) 41216 return null; 41217 return function (control) { 41218 const observables = executeValidators(control, presentValidators).map(toObservable); 41219 return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["forkJoin"])(observables).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(mergeErrors)); 41220 }; 41221 } 41222} 41223function isPresent(o) { 41224 return o != null; 41225} 41226function toObservable(r) { 41227 const obs = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisPromise"])(r) ? Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(r) : r; 41228 if (!(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisObservable"])(obs))) { 41229 throw new Error(`Expected validator to return Promise or Observable.`); 41230 } 41231 return obs; 41232} 41233function mergeErrors(arrayOfErrors) { 41234 let res = {}; 41235 // Not using Array.reduce here due to a Chrome 80 bug 41236 // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 41237 arrayOfErrors.forEach((errors) => { 41238 res = errors != null ? Object.assign(Object.assign({}, res), errors) : res; 41239 }); 41240 return Object.keys(res).length === 0 ? null : res; 41241} 41242function executeValidators(control, validators) { 41243 return validators.map(validator => validator(control)); 41244} 41245function isValidatorFn(validator) { 41246 return !validator.validate; 41247} 41248/** 41249 * Given the list of validators that may contain both functions as well as classes, return the list 41250 * of validator functions (convert validator classes into validator functions). This is needed to 41251 * have consistent structure in validators list before composing them. 41252 * 41253 * @param validators The set of validators that may contain validators both in plain function form 41254 * as well as represented as a validator class. 41255 */ 41256function normalizeValidators(validators) { 41257 return validators.map(validator => { 41258 return isValidatorFn(validator) ? 41259 validator : 41260 ((c) => validator.validate(c)); 41261 }); 41262} 41263 41264/** 41265 * @license 41266 * Copyright Google LLC All Rights Reserved. 41267 * 41268 * Use of this source code is governed by an MIT-style license that can be 41269 * found in the LICENSE file at https://angular.io/license 41270 */ 41271const NUMBER_VALUE_ACCESSOR = { 41272 provide: NG_VALUE_ACCESSOR, 41273 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => NumberValueAccessor), 41274 multi: true 41275}; 41276/** 41277 * @description 41278 * The `ControlValueAccessor` for writing a number value and listening to number input changes. 41279 * The value accessor is used by the `FormControlDirective`, `FormControlName`, and `NgModel` 41280 * directives. 41281 * 41282 * @usageNotes 41283 * 41284 * ### Using a number input with a reactive form. 41285 * 41286 * The following example shows how to use a number input with a reactive form. 41287 * 41288 * ```ts 41289 * const totalCountControl = new FormControl(); 41290 * ``` 41291 * 41292 * ``` 41293 * <input type="number" [formControl]="totalCountControl"> 41294 * ``` 41295 * 41296 * @ngModule ReactiveFormsModule 41297 * @ngModule FormsModule 41298 * @publicApi 41299 */ 41300class NumberValueAccessor { 41301 constructor(_renderer, _elementRef) { 41302 this._renderer = _renderer; 41303 this._elementRef = _elementRef; 41304 /** 41305 * @description 41306 * The registered callback function called when a change or input event occurs on the input 41307 * element. 41308 */ 41309 this.onChange = (_) => { }; 41310 /** 41311 * @description 41312 * The registered callback function called when a blur event occurs on the input element. 41313 */ 41314 this.onTouched = () => { }; 41315 } 41316 /** 41317 * Sets the "value" property on the input element. 41318 * 41319 * @param value The checked value 41320 */ 41321 writeValue(value) { 41322 // The value needs to be normalized for IE9, otherwise it is set to 'null' when null 41323 const normalizedValue = value == null ? '' : value; 41324 this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue); 41325 } 41326 /** 41327 * @description 41328 * Registers a function called when the control value changes. 41329 * 41330 * @param fn The callback function 41331 */ 41332 registerOnChange(fn) { 41333 this.onChange = (value) => { 41334 fn(value == '' ? null : parseFloat(value)); 41335 }; 41336 } 41337 /** 41338 * @description 41339 * Registers a function called when the control is touched. 41340 * 41341 * @param fn The callback function 41342 */ 41343 registerOnTouched(fn) { 41344 this.onTouched = fn; 41345 } 41346 /** 41347 * Sets the "disabled" property on the input element. 41348 * 41349 * @param isDisabled The disabled value 41350 */ 41351 setDisabledState(isDisabled) { 41352 this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); 41353 } 41354} 41355NumberValueAccessor.ɵfac = function NumberValueAccessor_Factory(t) { return new (t || NumberValueAccessor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"])); }; 41356NumberValueAccessor.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NumberValueAccessor, selectors: [["input", "type", "number", "formControlName", ""], ["input", "type", "number", "formControl", ""], ["input", "type", "number", "ngModel", ""]], hostBindings: function NumberValueAccessor_HostBindings(rf, ctx) { if (rf & 1) { 41357 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("input", function NumberValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.value); })("blur", function NumberValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); }); 41358 } }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([NUMBER_VALUE_ACCESSOR])] }); 41359NumberValueAccessor.ctorParameters = () => [ 41360 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 41361 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] } 41362]; 41363/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NumberValueAccessor, [{ 41364 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 41365 args: [{ 41366 selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]', 41367 host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' }, 41368 providers: [NUMBER_VALUE_ACCESSOR] 41369 }] 41370 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }]; }, null); })(); 41371 41372/** 41373 * @license 41374 * Copyright Google LLC All Rights Reserved. 41375 * 41376 * Use of this source code is governed by an MIT-style license that can be 41377 * found in the LICENSE file at https://angular.io/license 41378 */ 41379const RADIO_VALUE_ACCESSOR = { 41380 provide: NG_VALUE_ACCESSOR, 41381 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => RadioControlValueAccessor), 41382 multi: true 41383}; 41384/** 41385 * @description 41386 * Class used by Angular to track radio buttons. For internal use only. 41387 */ 41388class RadioControlRegistry { 41389 constructor() { 41390 this._accessors = []; 41391 } 41392 /** 41393 * @description 41394 * Adds a control to the internal registry. For internal use only. 41395 */ 41396 add(control, accessor) { 41397 this._accessors.push([control, accessor]); 41398 } 41399 /** 41400 * @description 41401 * Removes a control from the internal registry. For internal use only. 41402 */ 41403 remove(accessor) { 41404 for (let i = this._accessors.length - 1; i >= 0; --i) { 41405 if (this._accessors[i][1] === accessor) { 41406 this._accessors.splice(i, 1); 41407 return; 41408 } 41409 } 41410 } 41411 /** 41412 * @description 41413 * Selects a radio button. For internal use only. 41414 */ 41415 select(accessor) { 41416 this._accessors.forEach((c) => { 41417 if (this._isSameGroup(c, accessor) && c[1] !== accessor) { 41418 c[1].fireUncheck(accessor.value); 41419 } 41420 }); 41421 } 41422 _isSameGroup(controlPair, accessor) { 41423 if (!controlPair[0].control) 41424 return false; 41425 return controlPair[0]._parent === accessor._control._parent && 41426 controlPair[1].name === accessor.name; 41427 } 41428} 41429RadioControlRegistry.ɵfac = function RadioControlRegistry_Factory(t) { return new (t || RadioControlRegistry)(); }; 41430RadioControlRegistry.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: RadioControlRegistry, factory: RadioControlRegistry.ɵfac }); 41431/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RadioControlRegistry, [{ 41432 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 41433 }], function () { return []; }, null); })(); 41434/** 41435 * @description 41436 * The `ControlValueAccessor` for writing radio control values and listening to radio control 41437 * changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and 41438 * `NgModel` directives. 41439 * 41440 * @usageNotes 41441 * 41442 * ### Using radio buttons with reactive form directives 41443 * 41444 * The follow example shows how to use radio buttons in a reactive form. When using radio buttons in 41445 * a reactive form, radio buttons in the same group should have the same `formControlName`. 41446 * Providing a `name` attribute is optional. 41447 * 41448 * {@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'} 41449 * 41450 * @ngModule ReactiveFormsModule 41451 * @ngModule FormsModule 41452 * @publicApi 41453 */ 41454class RadioControlValueAccessor { 41455 constructor(_renderer, _elementRef, _registry, _injector) { 41456 this._renderer = _renderer; 41457 this._elementRef = _elementRef; 41458 this._registry = _registry; 41459 this._injector = _injector; 41460 /** 41461 * @description 41462 * The registered callback function called when a change event occurs on the input element. 41463 */ 41464 this.onChange = () => { }; 41465 /** 41466 * @description 41467 * The registered callback function called when a blur event occurs on the input element. 41468 */ 41469 this.onTouched = () => { }; 41470 } 41471 /** 41472 * @description 41473 * A lifecycle method called when the directive is initialized. For internal use only. 41474 */ 41475 ngOnInit() { 41476 this._control = this._injector.get(NgControl); 41477 this._checkName(); 41478 this._registry.add(this._control, this); 41479 } 41480 /** 41481 * @description 41482 * Lifecycle method called before the directive's instance is destroyed. For internal use only. 41483 */ 41484 ngOnDestroy() { 41485 this._registry.remove(this); 41486 } 41487 /** 41488 * @description 41489 * Sets the "checked" property value on the radio input element. 41490 * 41491 * @param value The checked value 41492 */ 41493 writeValue(value) { 41494 this._state = value === this.value; 41495 this._renderer.setProperty(this._elementRef.nativeElement, 'checked', this._state); 41496 } 41497 /** 41498 * @description 41499 * Registers a function called when the control value changes. 41500 * 41501 * @param fn The callback function 41502 */ 41503 registerOnChange(fn) { 41504 this._fn = fn; 41505 this.onChange = () => { 41506 fn(this.value); 41507 this._registry.select(this); 41508 }; 41509 } 41510 /** 41511 * Sets the "value" on the radio input element and unchecks it. 41512 * 41513 * @param value 41514 */ 41515 fireUncheck(value) { 41516 this.writeValue(value); 41517 } 41518 /** 41519 * @description 41520 * Registers a function called when the control is touched. 41521 * 41522 * @param fn The callback function 41523 */ 41524 registerOnTouched(fn) { 41525 this.onTouched = fn; 41526 } 41527 /** 41528 * Sets the "disabled" property on the input element. 41529 * 41530 * @param isDisabled The disabled value 41531 */ 41532 setDisabledState(isDisabled) { 41533 this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); 41534 } 41535 _checkName() { 41536 if (this.name && this.formControlName && this.name !== this.formControlName) { 41537 this._throwNameError(); 41538 } 41539 if (!this.name && this.formControlName) 41540 this.name = this.formControlName; 41541 } 41542 _throwNameError() { 41543 throw new Error(` 41544 If you define both a name and a formControlName attribute on your radio button, their values 41545 must match. Ex: <input type="radio" formControlName="food" name="food"> 41546 `); 41547 } 41548} 41549RadioControlValueAccessor.ɵfac = function RadioControlValueAccessor_Factory(t) { return new (t || RadioControlValueAccessor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](RadioControlRegistry), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"])); }; 41550RadioControlValueAccessor.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: RadioControlValueAccessor, selectors: [["input", "type", "radio", "formControlName", ""], ["input", "type", "radio", "formControl", ""], ["input", "type", "radio", "ngModel", ""]], hostBindings: function RadioControlValueAccessor_HostBindings(rf, ctx) { if (rf & 1) { 41551 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function RadioControlValueAccessor_change_HostBindingHandler() { return ctx.onChange(); })("blur", function RadioControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); }); 41552 } }, inputs: { name: "name", formControlName: "formControlName", value: "value" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([RADIO_VALUE_ACCESSOR])] }); 41553RadioControlValueAccessor.ctorParameters = () => [ 41554 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 41555 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, 41556 { type: RadioControlRegistry }, 41557 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"] } 41558]; 41559RadioControlValueAccessor.propDecorators = { 41560 name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 41561 formControlName: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 41562 value: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 41563}; 41564/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RadioControlValueAccessor, [{ 41565 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 41566 args: [{ 41567 selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]', 41568 host: { '(change)': 'onChange()', '(blur)': 'onTouched()' }, 41569 providers: [RADIO_VALUE_ACCESSOR] 41570 }] 41571 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, { type: RadioControlRegistry }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injector"] }]; }, { name: [{ 41572 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 41573 }], formControlName: [{ 41574 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 41575 }], value: [{ 41576 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 41577 }] }); })(); 41578 41579/** 41580 * @license 41581 * Copyright Google LLC All Rights Reserved. 41582 * 41583 * Use of this source code is governed by an MIT-style license that can be 41584 * found in the LICENSE file at https://angular.io/license 41585 */ 41586const RANGE_VALUE_ACCESSOR = { 41587 provide: NG_VALUE_ACCESSOR, 41588 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => RangeValueAccessor), 41589 multi: true 41590}; 41591/** 41592 * @description 41593 * The `ControlValueAccessor` for writing a range value and listening to range input changes. 41594 * The value accessor is used by the `FormControlDirective`, `FormControlName`, and `NgModel` 41595 * directives. 41596 * 41597 * @usageNotes 41598 * 41599 * ### Using a range input with a reactive form 41600 * 41601 * The following example shows how to use a range input with a reactive form. 41602 * 41603 * ```ts 41604 * const ageControl = new FormControl(); 41605 * ``` 41606 * 41607 * ``` 41608 * <input type="range" [formControl]="ageControl"> 41609 * ``` 41610 * 41611 * @ngModule ReactiveFormsModule 41612 * @ngModule FormsModule 41613 * @publicApi 41614 */ 41615class RangeValueAccessor { 41616 constructor(_renderer, _elementRef) { 41617 this._renderer = _renderer; 41618 this._elementRef = _elementRef; 41619 /** 41620 * @description 41621 * The registered callback function called when a change or input event occurs on the input 41622 * element. 41623 */ 41624 this.onChange = (_) => { }; 41625 /** 41626 * @description 41627 * The registered callback function called when a blur event occurs on the input element. 41628 */ 41629 this.onTouched = () => { }; 41630 } 41631 /** 41632 * Sets the "value" property on the input element. 41633 * 41634 * @param value The checked value 41635 */ 41636 writeValue(value) { 41637 this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value)); 41638 } 41639 /** 41640 * @description 41641 * Registers a function called when the control value changes. 41642 * 41643 * @param fn The callback function 41644 */ 41645 registerOnChange(fn) { 41646 this.onChange = (value) => { 41647 fn(value == '' ? null : parseFloat(value)); 41648 }; 41649 } 41650 /** 41651 * @description 41652 * Registers a function called when the control is touched. 41653 * 41654 * @param fn The callback function 41655 */ 41656 registerOnTouched(fn) { 41657 this.onTouched = fn; 41658 } 41659 /** 41660 * Sets the "disabled" property on the range input element. 41661 * 41662 * @param isDisabled The disabled value 41663 */ 41664 setDisabledState(isDisabled) { 41665 this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); 41666 } 41667} 41668RangeValueAccessor.ɵfac = function RangeValueAccessor_Factory(t) { return new (t || RangeValueAccessor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"])); }; 41669RangeValueAccessor.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: RangeValueAccessor, selectors: [["input", "type", "range", "formControlName", ""], ["input", "type", "range", "formControl", ""], ["input", "type", "range", "ngModel", ""]], hostBindings: function RangeValueAccessor_HostBindings(rf, ctx) { if (rf & 1) { 41670 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function RangeValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.value); })("input", function RangeValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.value); })("blur", function RangeValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); }); 41671 } }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([RANGE_VALUE_ACCESSOR])] }); 41672RangeValueAccessor.ctorParameters = () => [ 41673 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 41674 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] } 41675]; 41676/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RangeValueAccessor, [{ 41677 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 41678 args: [{ 41679 selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]', 41680 host: { 41681 '(change)': 'onChange($event.target.value)', 41682 '(input)': 'onChange($event.target.value)', 41683 '(blur)': 'onTouched()' 41684 }, 41685 providers: [RANGE_VALUE_ACCESSOR] 41686 }] 41687 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }]; }, null); })(); 41688 41689/** 41690 * @license 41691 * Copyright Google LLC All Rights Reserved. 41692 * 41693 * Use of this source code is governed by an MIT-style license that can be 41694 * found in the LICENSE file at https://angular.io/license 41695 */ 41696const FormErrorExamples = { 41697 formControlName: ` 41698 <div [formGroup]="myGroup"> 41699 <input formControlName="firstName"> 41700 </div> 41701 41702 In your class: 41703 41704 this.myGroup = new FormGroup({ 41705 firstName: new FormControl() 41706 });`, 41707 formGroupName: ` 41708 <div [formGroup]="myGroup"> 41709 <div formGroupName="person"> 41710 <input formControlName="firstName"> 41711 </div> 41712 </div> 41713 41714 In your class: 41715 41716 this.myGroup = new FormGroup({ 41717 person: new FormGroup({ firstName: new FormControl() }) 41718 });`, 41719 formArrayName: ` 41720 <div [formGroup]="myGroup"> 41721 <div formArrayName="cities"> 41722 <div *ngFor="let city of cityArray.controls; index as i"> 41723 <input [formControlName]="i"> 41724 </div> 41725 </div> 41726 </div> 41727 41728 In your class: 41729 41730 this.cityArray = new FormArray([new FormControl('SF')]); 41731 this.myGroup = new FormGroup({ 41732 cities: this.cityArray 41733 });`, 41734 ngModelGroup: ` 41735 <form> 41736 <div ngModelGroup="person"> 41737 <input [(ngModel)]="person.name" name="firstName"> 41738 </div> 41739 </form>`, 41740 ngModelWithFormGroup: ` 41741 <div [formGroup]="myGroup"> 41742 <input formControlName="firstName"> 41743 <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}"> 41744 </div> 41745 ` 41746}; 41747 41748/** 41749 * @license 41750 * Copyright Google LLC All Rights Reserved. 41751 * 41752 * Use of this source code is governed by an MIT-style license that can be 41753 * found in the LICENSE file at https://angular.io/license 41754 */ 41755class ReactiveErrors { 41756 static controlParentException() { 41757 throw new Error(`formControlName must be used with a parent formGroup directive. You'll want to add a formGroup 41758 directive and pass it an existing FormGroup instance (you can create one in your class). 41759 41760 Example: 41761 41762 ${FormErrorExamples.formControlName}`); 41763 } 41764 static ngModelGroupException() { 41765 throw new Error(`formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents 41766 that also have a "form" prefix: formGroupName, formArrayName, or formGroup. 41767 41768 Option 1: Update the parent to be formGroupName (reactive form strategy) 41769 41770 ${FormErrorExamples.formGroupName} 41771 41772 Option 2: Use ngModel instead of formControlName (template-driven strategy) 41773 41774 ${FormErrorExamples.ngModelGroup}`); 41775 } 41776 static missingFormException() { 41777 throw new Error(`formGroup expects a FormGroup instance. Please pass one in. 41778 41779 Example: 41780 41781 ${FormErrorExamples.formControlName}`); 41782 } 41783 static groupParentException() { 41784 throw new Error(`formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup 41785 directive and pass it an existing FormGroup instance (you can create one in your class). 41786 41787 Example: 41788 41789 ${FormErrorExamples.formGroupName}`); 41790 } 41791 static arrayParentException() { 41792 throw new Error(`formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup 41793 directive and pass it an existing FormGroup instance (you can create one in your class). 41794 41795 Example: 41796 41797 ${FormErrorExamples.formArrayName}`); 41798 } 41799 static disabledAttrWarning() { 41800 console.warn(` 41801 It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true 41802 when you set up this control in your component class, the disabled attribute will actually be set in the DOM for 41803 you. We recommend using this approach to avoid 'changed after checked' errors. 41804 41805 Example: 41806 form = new FormGroup({ 41807 first: new FormControl({value: 'Nancy', disabled: true}, Validators.required), 41808 last: new FormControl('Drew', Validators.required) 41809 }); 41810 `); 41811 } 41812 static ngModelWarning(directiveName) { 41813 console.warn(` 41814 It looks like you're using ngModel on the same form field as ${directiveName}. 41815 Support for using the ngModel input property and ngModelChange event with 41816 reactive form directives has been deprecated in Angular v6 and will be removed 41817 in a future version of Angular. 41818 41819 For more information on this, see our API docs here: 41820 https://angular.io/api/forms/${directiveName === 'formControl' ? 'FormControlDirective' : 41821 'FormControlName'}#use-with-ngmodel 41822 `); 41823 } 41824} 41825 41826/** 41827 * @license 41828 * Copyright Google LLC All Rights Reserved. 41829 * 41830 * Use of this source code is governed by an MIT-style license that can be 41831 * found in the LICENSE file at https://angular.io/license 41832 */ 41833const SELECT_VALUE_ACCESSOR = { 41834 provide: NG_VALUE_ACCESSOR, 41835 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => SelectControlValueAccessor), 41836 multi: true 41837}; 41838function _buildValueString(id, value) { 41839 if (id == null) 41840 return `${value}`; 41841 if (value && typeof value === 'object') 41842 value = 'Object'; 41843 return `${id}: ${value}`.slice(0, 50); 41844} 41845function _extractId(valueString) { 41846 return valueString.split(':')[0]; 41847} 41848/** 41849 * @description 41850 * The `ControlValueAccessor` for writing select control values and listening to select control 41851 * changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and 41852 * `NgModel` directives. 41853 * 41854 * @usageNotes 41855 * 41856 * ### Using select controls in a reactive form 41857 * 41858 * The following examples show how to use a select control in a reactive form. 41859 * 41860 * {@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'} 41861 * 41862 * ### Using select controls in a template-driven form 41863 * 41864 * To use a select in a template-driven form, simply add an `ngModel` and a `name` 41865 * attribute to the main `<select>` tag. 41866 * 41867 * {@example forms/ts/selectControl/select_control_example.ts region='Component'} 41868 * 41869 * ### Customizing option selection 41870 * 41871 * Angular uses object identity to select option. It's possible for the identities of items 41872 * to change while the data does not. This can happen, for example, if the items are produced 41873 * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the 41874 * second response will produce objects with different identities. 41875 * 41876 * To customize the default option comparison algorithm, `<select>` supports `compareWith` input. 41877 * `compareWith` takes a **function** which has two arguments: `option1` and `option2`. 41878 * If `compareWith` is given, Angular selects option by the return value of the function. 41879 * 41880 * ```ts 41881 * const selectedCountriesControl = new FormControl(); 41882 * ``` 41883 * 41884 * ``` 41885 * <select [compareWith]="compareFn" [formControl]="selectedCountriesControl"> 41886 * <option *ngFor="let country of countries" [ngValue]="country"> 41887 * {{country.name}} 41888 * </option> 41889 * </select> 41890 * 41891 * compareFn(c1: Country, c2: Country): boolean { 41892 * return c1 && c2 ? c1.id === c2.id : c1 === c2; 41893 * } 41894 * ``` 41895 * 41896 * **Note:** We listen to the 'change' event because 'input' events aren't fired 41897 * for selects in Firefox and IE: 41898 * https://bugzilla.mozilla.org/show_bug.cgi?id=1024350 41899 * https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045/ 41900 * 41901 * @ngModule ReactiveFormsModule 41902 * @ngModule FormsModule 41903 * @publicApi 41904 */ 41905class SelectControlValueAccessor { 41906 constructor(_renderer, _elementRef) { 41907 this._renderer = _renderer; 41908 this._elementRef = _elementRef; 41909 /** @internal */ 41910 this._optionMap = new Map(); 41911 /** @internal */ 41912 this._idCounter = 0; 41913 /** 41914 * @description 41915 * The registered callback function called when a change event occurs on the input element. 41916 */ 41917 this.onChange = (_) => { }; 41918 /** 41919 * @description 41920 * The registered callback function called when a blur event occurs on the input element. 41921 */ 41922 this.onTouched = () => { }; 41923 this._compareWith = Object.is; 41924 } 41925 /** 41926 * @description 41927 * Tracks the option comparison algorithm for tracking identities when 41928 * checking for changes. 41929 */ 41930 set compareWith(fn) { 41931 if (typeof fn !== 'function') { 41932 throw new Error(`compareWith must be a function, but received ${JSON.stringify(fn)}`); 41933 } 41934 this._compareWith = fn; 41935 } 41936 /** 41937 * Sets the "value" property on the input element. The "selectedIndex" 41938 * property is also set if an ID is provided on the option element. 41939 * 41940 * @param value The checked value 41941 */ 41942 writeValue(value) { 41943 this.value = value; 41944 const id = this._getOptionId(value); 41945 if (id == null) { 41946 this._renderer.setProperty(this._elementRef.nativeElement, 'selectedIndex', -1); 41947 } 41948 const valueString = _buildValueString(id, value); 41949 this._renderer.setProperty(this._elementRef.nativeElement, 'value', valueString); 41950 } 41951 /** 41952 * @description 41953 * Registers a function called when the control value changes. 41954 * 41955 * @param fn The callback function 41956 */ 41957 registerOnChange(fn) { 41958 this.onChange = (valueString) => { 41959 this.value = this._getOptionValue(valueString); 41960 fn(this.value); 41961 }; 41962 } 41963 /** 41964 * @description 41965 * Registers a function called when the control is touched. 41966 * 41967 * @param fn The callback function 41968 */ 41969 registerOnTouched(fn) { 41970 this.onTouched = fn; 41971 } 41972 /** 41973 * Sets the "disabled" property on the select input element. 41974 * 41975 * @param isDisabled The disabled value 41976 */ 41977 setDisabledState(isDisabled) { 41978 this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); 41979 } 41980 /** @internal */ 41981 _registerOption() { 41982 return (this._idCounter++).toString(); 41983 } 41984 /** @internal */ 41985 _getOptionId(value) { 41986 for (const id of Array.from(this._optionMap.keys())) { 41987 if (this._compareWith(this._optionMap.get(id), value)) 41988 return id; 41989 } 41990 return null; 41991 } 41992 /** @internal */ 41993 _getOptionValue(valueString) { 41994 const id = _extractId(valueString); 41995 return this._optionMap.has(id) ? this._optionMap.get(id) : valueString; 41996 } 41997} 41998SelectControlValueAccessor.ɵfac = function SelectControlValueAccessor_Factory(t) { return new (t || SelectControlValueAccessor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"])); }; 41999SelectControlValueAccessor.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: SelectControlValueAccessor, selectors: [["select", "formControlName", "", 3, "multiple", ""], ["select", "formControl", "", 3, "multiple", ""], ["select", "ngModel", "", 3, "multiple", ""]], hostBindings: function SelectControlValueAccessor_HostBindings(rf, ctx) { if (rf & 1) { 42000 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function SelectControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.value); })("blur", function SelectControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); }); 42001 } }, inputs: { compareWith: "compareWith" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([SELECT_VALUE_ACCESSOR])] }); 42002SelectControlValueAccessor.ctorParameters = () => [ 42003 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 42004 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] } 42005]; 42006SelectControlValueAccessor.propDecorators = { 42007 compareWith: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 42008}; 42009/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](SelectControlValueAccessor, [{ 42010 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 42011 args: [{ 42012 selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]', 42013 host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' }, 42014 providers: [SELECT_VALUE_ACCESSOR] 42015 }] 42016 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }]; }, { compareWith: [{ 42017 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 42018 }] }); })(); 42019/** 42020 * @description 42021 * Marks `<option>` as dynamic, so Angular can be notified when options change. 42022 * 42023 * @see `SelectControlValueAccessor` 42024 * 42025 * @ngModule ReactiveFormsModule 42026 * @ngModule FormsModule 42027 * @publicApi 42028 */ 42029class NgSelectOption { 42030 constructor(_element, _renderer, _select) { 42031 this._element = _element; 42032 this._renderer = _renderer; 42033 this._select = _select; 42034 if (this._select) 42035 this.id = this._select._registerOption(); 42036 } 42037 /** 42038 * @description 42039 * Tracks the value bound to the option element. Unlike the value binding, 42040 * ngValue supports binding to objects. 42041 */ 42042 set ngValue(value) { 42043 if (this._select == null) 42044 return; 42045 this._select._optionMap.set(this.id, value); 42046 this._setElementValue(_buildValueString(this.id, value)); 42047 this._select.writeValue(this._select.value); 42048 } 42049 /** 42050 * @description 42051 * Tracks simple string values bound to the option element. 42052 * For objects, use the `ngValue` input binding. 42053 */ 42054 set value(value) { 42055 this._setElementValue(value); 42056 if (this._select) 42057 this._select.writeValue(this._select.value); 42058 } 42059 /** @internal */ 42060 _setElementValue(value) { 42061 this._renderer.setProperty(this._element.nativeElement, 'value', value); 42062 } 42063 /** 42064 * @description 42065 * Lifecycle method called before the directive's instance is destroyed. For internal use only. 42066 */ 42067 ngOnDestroy() { 42068 if (this._select) { 42069 this._select._optionMap.delete(this.id); 42070 this._select.writeValue(this._select.value); 42071 } 42072 } 42073} 42074NgSelectOption.ɵfac = function NgSelectOption_Factory(t) { return new (t || NgSelectOption)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](SelectControlValueAccessor, 9)); }; 42075NgSelectOption.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSelectOption, selectors: [["option"]], inputs: { ngValue: "ngValue", value: "value" } }); 42076NgSelectOption.ctorParameters = () => [ 42077 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, 42078 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 42079 { type: SelectControlValueAccessor, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] } 42080]; 42081NgSelectOption.propDecorators = { 42082 ngValue: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngValue',] }], 42083 value: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['value',] }] 42084}; 42085/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSelectOption, [{ 42086 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 42087 args: [{ selector: 'option' }] 42088 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: SelectControlValueAccessor, decorators: [{ 42089 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 42090 }, { 42091 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 42092 }] }]; }, { ngValue: [{ 42093 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 42094 args: ['ngValue'] 42095 }], value: [{ 42096 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 42097 args: ['value'] 42098 }] }); })(); 42099 42100/** 42101 * @license 42102 * Copyright Google LLC All Rights Reserved. 42103 * 42104 * Use of this source code is governed by an MIT-style license that can be 42105 * found in the LICENSE file at https://angular.io/license 42106 */ 42107const SELECT_MULTIPLE_VALUE_ACCESSOR = { 42108 provide: NG_VALUE_ACCESSOR, 42109 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => SelectMultipleControlValueAccessor), 42110 multi: true 42111}; 42112function _buildValueString$1(id, value) { 42113 if (id == null) 42114 return `${value}`; 42115 if (typeof value === 'string') 42116 value = `'${value}'`; 42117 if (value && typeof value === 'object') 42118 value = 'Object'; 42119 return `${id}: ${value}`.slice(0, 50); 42120} 42121function _extractId$1(valueString) { 42122 return valueString.split(':')[0]; 42123} 42124/** Mock interface for HTMLCollection */ 42125class HTMLCollection { 42126} 42127/** 42128 * @description 42129 * The `ControlValueAccessor` for writing multi-select control values and listening to multi-select 42130 * control changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and 42131 * `NgModel` directives. 42132 * 42133 * @see `SelectControlValueAccessor` 42134 * 42135 * @usageNotes 42136 * 42137 * ### Using a multi-select control 42138 * 42139 * The follow example shows you how to use a multi-select control with a reactive form. 42140 * 42141 * ```ts 42142 * const countryControl = new FormControl(); 42143 * ``` 42144 * 42145 * ``` 42146 * <select multiple name="countries" [formControl]="countryControl"> 42147 * <option *ngFor="let country of countries" [ngValue]="country"> 42148 * {{ country.name }} 42149 * </option> 42150 * </select> 42151 * ``` 42152 * 42153 * ### Customizing option selection 42154 * 42155 * To customize the default option comparison algorithm, `<select>` supports `compareWith` input. 42156 * See the `SelectControlValueAccessor` for usage. 42157 * 42158 * @ngModule ReactiveFormsModule 42159 * @ngModule FormsModule 42160 * @publicApi 42161 */ 42162class SelectMultipleControlValueAccessor { 42163 constructor(_renderer, _elementRef) { 42164 this._renderer = _renderer; 42165 this._elementRef = _elementRef; 42166 /** @internal */ 42167 this._optionMap = new Map(); 42168 /** @internal */ 42169 this._idCounter = 0; 42170 /** 42171 * @description 42172 * The registered callback function called when a change event occurs on the input element. 42173 */ 42174 this.onChange = (_) => { }; 42175 /** 42176 * @description 42177 * The registered callback function called when a blur event occurs on the input element. 42178 */ 42179 this.onTouched = () => { }; 42180 this._compareWith = Object.is; 42181 } 42182 /** 42183 * @description 42184 * Tracks the option comparison algorithm for tracking identities when 42185 * checking for changes. 42186 */ 42187 set compareWith(fn) { 42188 if (typeof fn !== 'function') { 42189 throw new Error(`compareWith must be a function, but received ${JSON.stringify(fn)}`); 42190 } 42191 this._compareWith = fn; 42192 } 42193 /** 42194 * @description 42195 * Sets the "value" property on one or of more 42196 * of the select's options. 42197 * 42198 * @param value The value 42199 */ 42200 writeValue(value) { 42201 this.value = value; 42202 let optionSelectedStateSetter; 42203 if (Array.isArray(value)) { 42204 // convert values to ids 42205 const ids = value.map((v) => this._getOptionId(v)); 42206 optionSelectedStateSetter = (opt, o) => { 42207 opt._setSelected(ids.indexOf(o.toString()) > -1); 42208 }; 42209 } 42210 else { 42211 optionSelectedStateSetter = (opt, o) => { 42212 opt._setSelected(false); 42213 }; 42214 } 42215 this._optionMap.forEach(optionSelectedStateSetter); 42216 } 42217 /** 42218 * @description 42219 * Registers a function called when the control value changes 42220 * and writes an array of the selected options. 42221 * 42222 * @param fn The callback function 42223 */ 42224 registerOnChange(fn) { 42225 this.onChange = (_) => { 42226 const selected = []; 42227 if (_.selectedOptions !== undefined) { 42228 const options = _.selectedOptions; 42229 for (let i = 0; i < options.length; i++) { 42230 const opt = options.item(i); 42231 const val = this._getOptionValue(opt.value); 42232 selected.push(val); 42233 } 42234 } 42235 // Degrade on IE 42236 else { 42237 const options = _.options; 42238 for (let i = 0; i < options.length; i++) { 42239 const opt = options.item(i); 42240 if (opt.selected) { 42241 const val = this._getOptionValue(opt.value); 42242 selected.push(val); 42243 } 42244 } 42245 } 42246 this.value = selected; 42247 fn(selected); 42248 }; 42249 } 42250 /** 42251 * @description 42252 * Registers a function called when the control is touched. 42253 * 42254 * @param fn The callback function 42255 */ 42256 registerOnTouched(fn) { 42257 this.onTouched = fn; 42258 } 42259 /** 42260 * Sets the "disabled" property on the select input element. 42261 * 42262 * @param isDisabled The disabled value 42263 */ 42264 setDisabledState(isDisabled) { 42265 this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); 42266 } 42267 /** @internal */ 42268 _registerOption(value) { 42269 const id = (this._idCounter++).toString(); 42270 this._optionMap.set(id, value); 42271 return id; 42272 } 42273 /** @internal */ 42274 _getOptionId(value) { 42275 for (const id of Array.from(this._optionMap.keys())) { 42276 if (this._compareWith(this._optionMap.get(id)._value, value)) 42277 return id; 42278 } 42279 return null; 42280 } 42281 /** @internal */ 42282 _getOptionValue(valueString) { 42283 const id = _extractId$1(valueString); 42284 return this._optionMap.has(id) ? this._optionMap.get(id)._value : valueString; 42285 } 42286} 42287SelectMultipleControlValueAccessor.ɵfac = function SelectMultipleControlValueAccessor_Factory(t) { return new (t || SelectMultipleControlValueAccessor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"])); }; 42288SelectMultipleControlValueAccessor.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: SelectMultipleControlValueAccessor, selectors: [["select", "multiple", "", "formControlName", ""], ["select", "multiple", "", "formControl", ""], ["select", "multiple", "", "ngModel", ""]], hostBindings: function SelectMultipleControlValueAccessor_HostBindings(rf, ctx) { if (rf & 1) { 42289 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function SelectMultipleControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target); })("blur", function SelectMultipleControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); }); 42290 } }, inputs: { compareWith: "compareWith" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([SELECT_MULTIPLE_VALUE_ACCESSOR])] }); 42291SelectMultipleControlValueAccessor.ctorParameters = () => [ 42292 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 42293 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] } 42294]; 42295SelectMultipleControlValueAccessor.propDecorators = { 42296 compareWith: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 42297}; 42298/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](SelectMultipleControlValueAccessor, [{ 42299 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 42300 args: [{ 42301 selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]', 42302 host: { '(change)': 'onChange($event.target)', '(blur)': 'onTouched()' }, 42303 providers: [SELECT_MULTIPLE_VALUE_ACCESSOR] 42304 }] 42305 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }]; }, { compareWith: [{ 42306 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 42307 }] }); })(); 42308/** 42309 * @description 42310 * Marks `<option>` as dynamic, so Angular can be notified when options change. 42311 * 42312 * @see `SelectMultipleControlValueAccessor` 42313 * 42314 * @ngModule ReactiveFormsModule 42315 * @ngModule FormsModule 42316 * @publicApi 42317 */ 42318class ɵNgSelectMultipleOption { 42319 constructor(_element, _renderer, _select) { 42320 this._element = _element; 42321 this._renderer = _renderer; 42322 this._select = _select; 42323 if (this._select) { 42324 this.id = this._select._registerOption(this); 42325 } 42326 } 42327 /** 42328 * @description 42329 * Tracks the value bound to the option element. Unlike the value binding, 42330 * ngValue supports binding to objects. 42331 */ 42332 set ngValue(value) { 42333 if (this._select == null) 42334 return; 42335 this._value = value; 42336 this._setElementValue(_buildValueString$1(this.id, value)); 42337 this._select.writeValue(this._select.value); 42338 } 42339 /** 42340 * @description 42341 * Tracks simple string values bound to the option element. 42342 * For objects, use the `ngValue` input binding. 42343 */ 42344 set value(value) { 42345 if (this._select) { 42346 this._value = value; 42347 this._setElementValue(_buildValueString$1(this.id, value)); 42348 this._select.writeValue(this._select.value); 42349 } 42350 else { 42351 this._setElementValue(value); 42352 } 42353 } 42354 /** @internal */ 42355 _setElementValue(value) { 42356 this._renderer.setProperty(this._element.nativeElement, 'value', value); 42357 } 42358 /** @internal */ 42359 _setSelected(selected) { 42360 this._renderer.setProperty(this._element.nativeElement, 'selected', selected); 42361 } 42362 /** 42363 * @description 42364 * Lifecycle method called before the directive's instance is destroyed. For internal use only. 42365 */ 42366 ngOnDestroy() { 42367 if (this._select) { 42368 this._select._optionMap.delete(this.id); 42369 this._select.writeValue(this._select.value); 42370 } 42371 } 42372} 42373ɵNgSelectMultipleOption.ɵfac = function ɵNgSelectMultipleOption_Factory(t) { return new (t || ɵNgSelectMultipleOption)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](SelectMultipleControlValueAccessor, 9)); }; 42374ɵNgSelectMultipleOption.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: ɵNgSelectMultipleOption, selectors: [["option"]], inputs: { ngValue: "ngValue", value: "value" } }); 42375ɵNgSelectMultipleOption.ctorParameters = () => [ 42376 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, 42377 { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, 42378 { type: SelectMultipleControlValueAccessor, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] } 42379]; 42380ɵNgSelectMultipleOption.propDecorators = { 42381 ngValue: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngValue',] }], 42382 value: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['value',] }] 42383}; 42384/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ɵNgSelectMultipleOption, [{ 42385 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 42386 args: [{ selector: 'option' }] 42387 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }, { type: SelectMultipleControlValueAccessor, decorators: [{ 42388 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 42389 }, { 42390 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 42391 }] }]; }, { ngValue: [{ 42392 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 42393 args: ['ngValue'] 42394 }], value: [{ 42395 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 42396 args: ['value'] 42397 }] }); })(); 42398 42399/** 42400 * @license 42401 * Copyright Google LLC All Rights Reserved. 42402 * 42403 * Use of this source code is governed by an MIT-style license that can be 42404 * found in the LICENSE file at https://angular.io/license 42405 */ 42406function controlPath(name, parent) { 42407 return [...parent.path, name]; 42408} 42409function setUpControl(control, dir) { 42410 if (!control) 42411 _throwError(dir, 'Cannot find control with'); 42412 if (!dir.valueAccessor) 42413 _throwError(dir, 'No value accessor for form control with'); 42414 control.validator = Validators.compose([control.validator, dir.validator]); 42415 control.asyncValidator = Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); 42416 dir.valueAccessor.writeValue(control.value); 42417 setUpViewChangePipeline(control, dir); 42418 setUpModelChangePipeline(control, dir); 42419 setUpBlurPipeline(control, dir); 42420 if (dir.valueAccessor.setDisabledState) { 42421 control.registerOnDisabledChange((isDisabled) => { 42422 dir.valueAccessor.setDisabledState(isDisabled); 42423 }); 42424 } 42425 // re-run validation when validator binding changes, e.g. minlength=3 -> minlength=4 42426 dir._rawValidators.forEach((validator) => { 42427 if (validator.registerOnValidatorChange) 42428 validator.registerOnValidatorChange(() => control.updateValueAndValidity()); 42429 }); 42430 dir._rawAsyncValidators.forEach((validator) => { 42431 if (validator.registerOnValidatorChange) 42432 validator.registerOnValidatorChange(() => control.updateValueAndValidity()); 42433 }); 42434} 42435function cleanUpControl(control, dir) { 42436 dir.valueAccessor.registerOnChange(() => _noControlError(dir)); 42437 dir.valueAccessor.registerOnTouched(() => _noControlError(dir)); 42438 dir._rawValidators.forEach((validator) => { 42439 if (validator.registerOnValidatorChange) { 42440 validator.registerOnValidatorChange(null); 42441 } 42442 }); 42443 dir._rawAsyncValidators.forEach((validator) => { 42444 if (validator.registerOnValidatorChange) { 42445 validator.registerOnValidatorChange(null); 42446 } 42447 }); 42448 if (control) 42449 control._clearChangeFns(); 42450} 42451function setUpViewChangePipeline(control, dir) { 42452 dir.valueAccessor.registerOnChange((newValue) => { 42453 control._pendingValue = newValue; 42454 control._pendingChange = true; 42455 control._pendingDirty = true; 42456 if (control.updateOn === 'change') 42457 updateControl(control, dir); 42458 }); 42459} 42460function setUpBlurPipeline(control, dir) { 42461 dir.valueAccessor.registerOnTouched(() => { 42462 control._pendingTouched = true; 42463 if (control.updateOn === 'blur' && control._pendingChange) 42464 updateControl(control, dir); 42465 if (control.updateOn !== 'submit') 42466 control.markAsTouched(); 42467 }); 42468} 42469function updateControl(control, dir) { 42470 if (control._pendingDirty) 42471 control.markAsDirty(); 42472 control.setValue(control._pendingValue, { emitModelToViewChange: false }); 42473 dir.viewToModelUpdate(control._pendingValue); 42474 control._pendingChange = false; 42475} 42476function setUpModelChangePipeline(control, dir) { 42477 control.registerOnChange((newValue, emitModelEvent) => { 42478 // control -> view 42479 dir.valueAccessor.writeValue(newValue); 42480 // control -> ngModel 42481 if (emitModelEvent) 42482 dir.viewToModelUpdate(newValue); 42483 }); 42484} 42485function setUpFormContainer(control, dir) { 42486 if (control == null) 42487 _throwError(dir, 'Cannot find control with'); 42488 control.validator = Validators.compose([control.validator, dir.validator]); 42489 control.asyncValidator = Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); 42490} 42491function _noControlError(dir) { 42492 return _throwError(dir, 'There is no FormControl instance attached to form control element with'); 42493} 42494function _throwError(dir, message) { 42495 let messageEnd; 42496 if (dir.path.length > 1) { 42497 messageEnd = `path: '${dir.path.join(' -> ')}'`; 42498 } 42499 else if (dir.path[0]) { 42500 messageEnd = `name: '${dir.path}'`; 42501 } 42502 else { 42503 messageEnd = 'unspecified name attribute'; 42504 } 42505 throw new Error(`${message} ${messageEnd}`); 42506} 42507function composeValidators(validators) { 42508 return validators != null ? Validators.compose(normalizeValidators(validators)) : 42509 null; 42510} 42511function composeAsyncValidators(validators) { 42512 return validators != null ? 42513 Validators.composeAsync(normalizeValidators(validators)) : 42514 null; 42515} 42516function isPropertyUpdated(changes, viewModel) { 42517 if (!changes.hasOwnProperty('model')) 42518 return false; 42519 const change = changes['model']; 42520 if (change.isFirstChange()) 42521 return true; 42522 return !Object.is(viewModel, change.currentValue); 42523} 42524const BUILTIN_ACCESSORS = [ 42525 CheckboxControlValueAccessor, 42526 RangeValueAccessor, 42527 NumberValueAccessor, 42528 SelectControlValueAccessor, 42529 SelectMultipleControlValueAccessor, 42530 RadioControlValueAccessor, 42531]; 42532function isBuiltInAccessor(valueAccessor) { 42533 return BUILTIN_ACCESSORS.some(a => valueAccessor.constructor === a); 42534} 42535function syncPendingControls(form, directives) { 42536 form._syncPendingControls(); 42537 directives.forEach(dir => { 42538 const control = dir.control; 42539 if (control.updateOn === 'submit' && control._pendingChange) { 42540 dir.viewToModelUpdate(control._pendingValue); 42541 control._pendingChange = false; 42542 } 42543 }); 42544} 42545// TODO: vsavkin remove it once https://github.com/angular/angular/issues/3011 is implemented 42546function selectValueAccessor(dir, valueAccessors) { 42547 if (!valueAccessors) 42548 return null; 42549 if (!Array.isArray(valueAccessors)) 42550 _throwError(dir, 'Value accessor was not provided as an array for form control with'); 42551 let defaultAccessor = undefined; 42552 let builtinAccessor = undefined; 42553 let customAccessor = undefined; 42554 valueAccessors.forEach((v) => { 42555 if (v.constructor === DefaultValueAccessor) { 42556 defaultAccessor = v; 42557 } 42558 else if (isBuiltInAccessor(v)) { 42559 if (builtinAccessor) 42560 _throwError(dir, 'More than one built-in value accessor matches form control with'); 42561 builtinAccessor = v; 42562 } 42563 else { 42564 if (customAccessor) 42565 _throwError(dir, 'More than one custom value accessor matches form control with'); 42566 customAccessor = v; 42567 } 42568 }); 42569 if (customAccessor) 42570 return customAccessor; 42571 if (builtinAccessor) 42572 return builtinAccessor; 42573 if (defaultAccessor) 42574 return defaultAccessor; 42575 _throwError(dir, 'No valid value accessor for form control with'); 42576 return null; 42577} 42578function removeDir(list, el) { 42579 const index = list.indexOf(el); 42580 if (index > -1) 42581 list.splice(index, 1); 42582} 42583// TODO(kara): remove after deprecation period 42584function _ngModelWarning(name, type, instance, warningConfig) { 42585 if (!Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["isDevMode"])() || warningConfig === 'never') 42586 return; 42587 if (((warningConfig === null || warningConfig === 'once') && !type._ngModelWarningSentOnce) || 42588 (warningConfig === 'always' && !instance._ngModelWarningSent)) { 42589 ReactiveErrors.ngModelWarning(name); 42590 type._ngModelWarningSentOnce = true; 42591 instance._ngModelWarningSent = true; 42592 } 42593} 42594 42595/** 42596 * @license 42597 * Copyright Google LLC All Rights Reserved. 42598 * 42599 * Use of this source code is governed by an MIT-style license that can be 42600 * found in the LICENSE file at https://angular.io/license 42601 */ 42602/** 42603 * Reports that a FormControl is valid, meaning that no errors exist in the input value. 42604 * 42605 * @see `status` 42606 */ 42607const VALID = 'VALID'; 42608/** 42609 * Reports that a FormControl is invalid, meaning that an error exists in the input value. 42610 * 42611 * @see `status` 42612 */ 42613const INVALID = 'INVALID'; 42614/** 42615 * Reports that a FormControl is pending, meaning that that async validation is occurring and 42616 * errors are not yet available for the input value. 42617 * 42618 * @see `markAsPending` 42619 * @see `status` 42620 */ 42621const PENDING = 'PENDING'; 42622/** 42623 * Reports that a FormControl is disabled, meaning that the control is exempt from ancestor 42624 * calculations of validity or value. 42625 * 42626 * @see `markAsDisabled` 42627 * @see `status` 42628 */ 42629const DISABLED = 'DISABLED'; 42630function _find(control, path, delimiter) { 42631 if (path == null) 42632 return null; 42633 if (!Array.isArray(path)) { 42634 path = path.split(delimiter); 42635 } 42636 if (Array.isArray(path) && path.length === 0) 42637 return null; 42638 // Not using Array.reduce here due to a Chrome 80 bug 42639 // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 42640 let controlToFind = control; 42641 path.forEach((name) => { 42642 if (controlToFind instanceof FormGroup) { 42643 controlToFind = controlToFind.controls.hasOwnProperty(name) ? 42644 controlToFind.controls[name] : 42645 null; 42646 } 42647 else if (controlToFind instanceof FormArray) { 42648 controlToFind = controlToFind.at(name) || null; 42649 } 42650 else { 42651 controlToFind = null; 42652 } 42653 }); 42654 return controlToFind; 42655} 42656function coerceToValidator(validatorOrOpts) { 42657 const validator = isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts; 42658 return Array.isArray(validator) ? composeValidators(validator) : validator || null; 42659} 42660function coerceToAsyncValidator(asyncValidator, validatorOrOpts) { 42661 const origAsyncValidator = isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators : asyncValidator; 42662 return Array.isArray(origAsyncValidator) ? composeAsyncValidators(origAsyncValidator) : 42663 origAsyncValidator || null; 42664} 42665function isOptionsObj(validatorOrOpts) { 42666 return validatorOrOpts != null && !Array.isArray(validatorOrOpts) && 42667 typeof validatorOrOpts === 'object'; 42668} 42669/** 42670 * This is the base class for `FormControl`, `FormGroup`, and `FormArray`. 42671 * 42672 * It provides some of the shared behavior that all controls and groups of controls have, like 42673 * running validators, calculating status, and resetting state. It also defines the properties 42674 * that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be 42675 * instantiated directly. 42676 * 42677 * @see [Forms Guide](/guide/forms) 42678 * @see [Reactive Forms Guide](/guide/reactive-forms) 42679 * @see [Dynamic Forms Guide](/guide/dynamic-form) 42680 * 42681 * @publicApi 42682 */ 42683class AbstractControl { 42684 /** 42685 * Initialize the AbstractControl instance. 42686 * 42687 * @param validator The function that determines the synchronous validity of this control. 42688 * @param asyncValidator The function that determines the asynchronous validity of this 42689 * control. 42690 */ 42691 constructor(validator, asyncValidator) { 42692 this.validator = validator; 42693 this.asyncValidator = asyncValidator; 42694 /** @internal */ 42695 this._onCollectionChange = () => { }; 42696 /** 42697 * A control is `pristine` if the user has not yet changed 42698 * the value in the UI. 42699 * 42700 * @returns True if the user has not yet changed the value in the UI; compare `dirty`. 42701 * Programmatic changes to a control's value do not mark it dirty. 42702 */ 42703 this.pristine = true; 42704 /** 42705 * True if the control is marked as `touched`. 42706 * 42707 * A control is marked `touched` once the user has triggered 42708 * a `blur` event on it. 42709 */ 42710 this.touched = false; 42711 /** @internal */ 42712 this._onDisabledChange = []; 42713 } 42714 /** 42715 * The parent control. 42716 */ 42717 get parent() { 42718 return this._parent; 42719 } 42720 /** 42721 * A control is `valid` when its `status` is `VALID`. 42722 * 42723 * @see {@link AbstractControl.status} 42724 * 42725 * @returns True if the control has passed all of its validation tests, 42726 * false otherwise. 42727 */ 42728 get valid() { 42729 return this.status === VALID; 42730 } 42731 /** 42732 * A control is `invalid` when its `status` is `INVALID`. 42733 * 42734 * @see {@link AbstractControl.status} 42735 * 42736 * @returns True if this control has failed one or more of its validation checks, 42737 * false otherwise. 42738 */ 42739 get invalid() { 42740 return this.status === INVALID; 42741 } 42742 /** 42743 * A control is `pending` when its `status` is `PENDING`. 42744 * 42745 * @see {@link AbstractControl.status} 42746 * 42747 * @returns True if this control is in the process of conducting a validation check, 42748 * false otherwise. 42749 */ 42750 get pending() { 42751 return this.status == PENDING; 42752 } 42753 /** 42754 * A control is `disabled` when its `status` is `DISABLED`. 42755 * 42756 * Disabled controls are exempt from validation checks and 42757 * are not included in the aggregate value of their ancestor 42758 * controls. 42759 * 42760 * @see {@link AbstractControl.status} 42761 * 42762 * @returns True if the control is disabled, false otherwise. 42763 */ 42764 get disabled() { 42765 return this.status === DISABLED; 42766 } 42767 /** 42768 * A control is `enabled` as long as its `status` is not `DISABLED`. 42769 * 42770 * @returns True if the control has any status other than 'DISABLED', 42771 * false if the status is 'DISABLED'. 42772 * 42773 * @see {@link AbstractControl.status} 42774 * 42775 */ 42776 get enabled() { 42777 return this.status !== DISABLED; 42778 } 42779 /** 42780 * A control is `dirty` if the user has changed the value 42781 * in the UI. 42782 * 42783 * @returns True if the user has changed the value of this control in the UI; compare `pristine`. 42784 * Programmatic changes to a control's value do not mark it dirty. 42785 */ 42786 get dirty() { 42787 return !this.pristine; 42788 } 42789 /** 42790 * True if the control has not been marked as touched 42791 * 42792 * A control is `untouched` if the user has not yet triggered 42793 * a `blur` event on it. 42794 */ 42795 get untouched() { 42796 return !this.touched; 42797 } 42798 /** 42799 * Reports the update strategy of the `AbstractControl` (meaning 42800 * the event on which the control updates itself). 42801 * Possible values: `'change'` | `'blur'` | `'submit'` 42802 * Default value: `'change'` 42803 */ 42804 get updateOn() { 42805 return this._updateOn ? this._updateOn : (this.parent ? this.parent.updateOn : 'change'); 42806 } 42807 /** 42808 * Sets the synchronous validators that are active on this control. Calling 42809 * this overwrites any existing sync validators. 42810 * 42811 * When you add or remove a validator at run time, you must call 42812 * `updateValueAndValidity()` for the new validation to take effect. 42813 * 42814 */ 42815 setValidators(newValidator) { 42816 this.validator = coerceToValidator(newValidator); 42817 } 42818 /** 42819 * Sets the async validators that are active on this control. Calling this 42820 * overwrites any existing async validators. 42821 * 42822 * When you add or remove a validator at run time, you must call 42823 * `updateValueAndValidity()` for the new validation to take effect. 42824 * 42825 */ 42826 setAsyncValidators(newValidator) { 42827 this.asyncValidator = coerceToAsyncValidator(newValidator); 42828 } 42829 /** 42830 * Empties out the sync validator list. 42831 * 42832 * When you add or remove a validator at run time, you must call 42833 * `updateValueAndValidity()` for the new validation to take effect. 42834 * 42835 */ 42836 clearValidators() { 42837 this.validator = null; 42838 } 42839 /** 42840 * Empties out the async validator list. 42841 * 42842 * When you add or remove a validator at run time, you must call 42843 * `updateValueAndValidity()` for the new validation to take effect. 42844 * 42845 */ 42846 clearAsyncValidators() { 42847 this.asyncValidator = null; 42848 } 42849 /** 42850 * Marks the control as `touched`. A control is touched by focus and 42851 * blur events that do not change the value. 42852 * 42853 * @see `markAsUntouched()` 42854 * @see `markAsDirty()` 42855 * @see `markAsPristine()` 42856 * 42857 * @param opts Configuration options that determine how the control propagates changes 42858 * and emits events after marking is applied. 42859 * * `onlySelf`: When true, mark only this control. When false or not supplied, 42860 * marks all direct ancestors. Default is false. 42861 */ 42862 markAsTouched(opts = {}) { 42863 this.touched = true; 42864 if (this._parent && !opts.onlySelf) { 42865 this._parent.markAsTouched(opts); 42866 } 42867 } 42868 /** 42869 * Marks the control and all its descendant controls as `touched`. 42870 * @see `markAsTouched()` 42871 */ 42872 markAllAsTouched() { 42873 this.markAsTouched({ onlySelf: true }); 42874 this._forEachChild((control) => control.markAllAsTouched()); 42875 } 42876 /** 42877 * Marks the control as `untouched`. 42878 * 42879 * If the control has any children, also marks all children as `untouched` 42880 * and recalculates the `touched` status of all parent controls. 42881 * 42882 * @see `markAsTouched()` 42883 * @see `markAsDirty()` 42884 * @see `markAsPristine()` 42885 * 42886 * @param opts Configuration options that determine how the control propagates changes 42887 * and emits events after the marking is applied. 42888 * * `onlySelf`: When true, mark only this control. When false or not supplied, 42889 * marks all direct ancestors. Default is false. 42890 */ 42891 markAsUntouched(opts = {}) { 42892 this.touched = false; 42893 this._pendingTouched = false; 42894 this._forEachChild((control) => { 42895 control.markAsUntouched({ onlySelf: true }); 42896 }); 42897 if (this._parent && !opts.onlySelf) { 42898 this._parent._updateTouched(opts); 42899 } 42900 } 42901 /** 42902 * Marks the control as `dirty`. A control becomes dirty when 42903 * the control's value is changed through the UI; compare `markAsTouched`. 42904 * 42905 * @see `markAsTouched()` 42906 * @see `markAsUntouched()` 42907 * @see `markAsPristine()` 42908 * 42909 * @param opts Configuration options that determine how the control propagates changes 42910 * and emits events after marking is applied. 42911 * * `onlySelf`: When true, mark only this control. When false or not supplied, 42912 * marks all direct ancestors. Default is false. 42913 */ 42914 markAsDirty(opts = {}) { 42915 this.pristine = false; 42916 if (this._parent && !opts.onlySelf) { 42917 this._parent.markAsDirty(opts); 42918 } 42919 } 42920 /** 42921 * Marks the control as `pristine`. 42922 * 42923 * If the control has any children, marks all children as `pristine`, 42924 * and recalculates the `pristine` status of all parent 42925 * controls. 42926 * 42927 * @see `markAsTouched()` 42928 * @see `markAsUntouched()` 42929 * @see `markAsDirty()` 42930 * 42931 * @param opts Configuration options that determine how the control emits events after 42932 * marking is applied. 42933 * * `onlySelf`: When true, mark only this control. When false or not supplied, 42934 * marks all direct ancestors. Default is false. 42935 */ 42936 markAsPristine(opts = {}) { 42937 this.pristine = true; 42938 this._pendingDirty = false; 42939 this._forEachChild((control) => { 42940 control.markAsPristine({ onlySelf: true }); 42941 }); 42942 if (this._parent && !opts.onlySelf) { 42943 this._parent._updatePristine(opts); 42944 } 42945 } 42946 /** 42947 * Marks the control as `pending`. 42948 * 42949 * A control is pending while the control performs async validation. 42950 * 42951 * @see {@link AbstractControl.status} 42952 * 42953 * @param opts Configuration options that determine how the control propagates changes and 42954 * emits events after marking is applied. 42955 * * `onlySelf`: When true, mark only this control. When false or not supplied, 42956 * marks all direct ancestors. Default is false. 42957 * * `emitEvent`: When true or not supplied (the default), the `statusChanges` 42958 * observable emits an event with the latest status the control is marked pending. 42959 * When false, no events are emitted. 42960 * 42961 */ 42962 markAsPending(opts = {}) { 42963 this.status = PENDING; 42964 if (opts.emitEvent !== false) { 42965 this.statusChanges.emit(this.status); 42966 } 42967 if (this._parent && !opts.onlySelf) { 42968 this._parent.markAsPending(opts); 42969 } 42970 } 42971 /** 42972 * Disables the control. This means the control is exempt from validation checks and 42973 * excluded from the aggregate value of any parent. Its status is `DISABLED`. 42974 * 42975 * If the control has children, all children are also disabled. 42976 * 42977 * @see {@link AbstractControl.status} 42978 * 42979 * @param opts Configuration options that determine how the control propagates 42980 * changes and emits events after the control is disabled. 42981 * * `onlySelf`: When true, mark only this control. When false or not supplied, 42982 * marks all direct ancestors. Default is false. 42983 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 42984 * `valueChanges` 42985 * observables emit events with the latest status and value when the control is disabled. 42986 * When false, no events are emitted. 42987 */ 42988 disable(opts = {}) { 42989 // If parent has been marked artificially dirty we don't want to re-calculate the 42990 // parent's dirtiness based on the children. 42991 const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf); 42992 this.status = DISABLED; 42993 this.errors = null; 42994 this._forEachChild((control) => { 42995 control.disable(Object.assign(Object.assign({}, opts), { onlySelf: true })); 42996 }); 42997 this._updateValue(); 42998 if (opts.emitEvent !== false) { 42999 this.valueChanges.emit(this.value); 43000 this.statusChanges.emit(this.status); 43001 } 43002 this._updateAncestors(Object.assign(Object.assign({}, opts), { skipPristineCheck })); 43003 this._onDisabledChange.forEach((changeFn) => changeFn(true)); 43004 } 43005 /** 43006 * Enables the control. This means the control is included in validation checks and 43007 * the aggregate value of its parent. Its status recalculates based on its value and 43008 * its validators. 43009 * 43010 * By default, if the control has children, all children are enabled. 43011 * 43012 * @see {@link AbstractControl.status} 43013 * 43014 * @param opts Configure options that control how the control propagates changes and 43015 * emits events when marked as untouched 43016 * * `onlySelf`: When true, mark only this control. When false or not supplied, 43017 * marks all direct ancestors. Default is false. 43018 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 43019 * `valueChanges` 43020 * observables emit events with the latest status and value when the control is enabled. 43021 * When false, no events are emitted. 43022 */ 43023 enable(opts = {}) { 43024 // If parent has been marked artificially dirty we don't want to re-calculate the 43025 // parent's dirtiness based on the children. 43026 const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf); 43027 this.status = VALID; 43028 this._forEachChild((control) => { 43029 control.enable(Object.assign(Object.assign({}, opts), { onlySelf: true })); 43030 }); 43031 this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent }); 43032 this._updateAncestors(Object.assign(Object.assign({}, opts), { skipPristineCheck })); 43033 this._onDisabledChange.forEach((changeFn) => changeFn(false)); 43034 } 43035 _updateAncestors(opts) { 43036 if (this._parent && !opts.onlySelf) { 43037 this._parent.updateValueAndValidity(opts); 43038 if (!opts.skipPristineCheck) { 43039 this._parent._updatePristine(); 43040 } 43041 this._parent._updateTouched(); 43042 } 43043 } 43044 /** 43045 * @param parent Sets the parent of the control 43046 */ 43047 setParent(parent) { 43048 this._parent = parent; 43049 } 43050 /** 43051 * Recalculates the value and validation status of the control. 43052 * 43053 * By default, it also updates the value and validity of its ancestors. 43054 * 43055 * @param opts Configuration options determine how the control propagates changes and emits events 43056 * after updates and validity checks are applied. 43057 * * `onlySelf`: When true, only update this control. When false or not supplied, 43058 * update all direct ancestors. Default is false. 43059 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 43060 * `valueChanges` 43061 * observables emit events with the latest status and value when the control is updated. 43062 * When false, no events are emitted. 43063 */ 43064 updateValueAndValidity(opts = {}) { 43065 this._setInitialStatus(); 43066 this._updateValue(); 43067 if (this.enabled) { 43068 this._cancelExistingSubscription(); 43069 this.errors = this._runValidator(); 43070 this.status = this._calculateStatus(); 43071 if (this.status === VALID || this.status === PENDING) { 43072 this._runAsyncValidator(opts.emitEvent); 43073 } 43074 } 43075 if (opts.emitEvent !== false) { 43076 this.valueChanges.emit(this.value); 43077 this.statusChanges.emit(this.status); 43078 } 43079 if (this._parent && !opts.onlySelf) { 43080 this._parent.updateValueAndValidity(opts); 43081 } 43082 } 43083 /** @internal */ 43084 _updateTreeValidity(opts = { emitEvent: true }) { 43085 this._forEachChild((ctrl) => ctrl._updateTreeValidity(opts)); 43086 this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent }); 43087 } 43088 _setInitialStatus() { 43089 this.status = this._allControlsDisabled() ? DISABLED : VALID; 43090 } 43091 _runValidator() { 43092 return this.validator ? this.validator(this) : null; 43093 } 43094 _runAsyncValidator(emitEvent) { 43095 if (this.asyncValidator) { 43096 this.status = PENDING; 43097 const obs = toObservable(this.asyncValidator(this)); 43098 this._asyncValidationSubscription = 43099 obs.subscribe((errors) => this.setErrors(errors, { emitEvent })); 43100 } 43101 } 43102 _cancelExistingSubscription() { 43103 if (this._asyncValidationSubscription) { 43104 this._asyncValidationSubscription.unsubscribe(); 43105 } 43106 } 43107 /** 43108 * Sets errors on a form control when running validations manually, rather than automatically. 43109 * 43110 * Calling `setErrors` also updates the validity of the parent control. 43111 * 43112 * @usageNotes 43113 * 43114 * ### Manually set the errors for a control 43115 * 43116 * ``` 43117 * const login = new FormControl('someLogin'); 43118 * login.setErrors({ 43119 * notUnique: true 43120 * }); 43121 * 43122 * expect(login.valid).toEqual(false); 43123 * expect(login.errors).toEqual({ notUnique: true }); 43124 * 43125 * login.setValue('someOtherLogin'); 43126 * 43127 * expect(login.valid).toEqual(true); 43128 * ``` 43129 */ 43130 setErrors(errors, opts = {}) { 43131 this.errors = errors; 43132 this._updateControlsErrors(opts.emitEvent !== false); 43133 } 43134 /** 43135 * Retrieves a child control given the control's name or path. 43136 * 43137 * @param path A dot-delimited string or array of string/number values that define the path to the 43138 * control. 43139 * 43140 * @usageNotes 43141 * ### Retrieve a nested control 43142 * 43143 * For example, to get a `name` control nested within a `person` sub-group: 43144 * 43145 * * `this.form.get('person.name');` 43146 * 43147 * -OR- 43148 * 43149 * * `this.form.get(['person', 'name']);` 43150 */ 43151 get(path) { 43152 return _find(this, path, '.'); 43153 } 43154 /** 43155 * @description 43156 * Reports error data for the control with the given path. 43157 * 43158 * @param errorCode The code of the error to check 43159 * @param path A list of control names that designates how to move from the current control 43160 * to the control that should be queried for errors. 43161 * 43162 * @usageNotes 43163 * For example, for the following `FormGroup`: 43164 * 43165 * ``` 43166 * form = new FormGroup({ 43167 * address: new FormGroup({ street: new FormControl() }) 43168 * }); 43169 * ``` 43170 * 43171 * The path to the 'street' control from the root form would be 'address' -> 'street'. 43172 * 43173 * It can be provided to this method in one of two formats: 43174 * 43175 * 1. An array of string control names, e.g. `['address', 'street']` 43176 * 1. A period-delimited list of control names in one string, e.g. `'address.street'` 43177 * 43178 * @returns error data for that particular error. If the control or error is not present, 43179 * null is returned. 43180 */ 43181 getError(errorCode, path) { 43182 const control = path ? this.get(path) : this; 43183 return control && control.errors ? control.errors[errorCode] : null; 43184 } 43185 /** 43186 * @description 43187 * Reports whether the control with the given path has the error specified. 43188 * 43189 * @param errorCode The code of the error to check 43190 * @param path A list of control names that designates how to move from the current control 43191 * to the control that should be queried for errors. 43192 * 43193 * @usageNotes 43194 * For example, for the following `FormGroup`: 43195 * 43196 * ``` 43197 * form = new FormGroup({ 43198 * address: new FormGroup({ street: new FormControl() }) 43199 * }); 43200 * ``` 43201 * 43202 * The path to the 'street' control from the root form would be 'address' -> 'street'. 43203 * 43204 * It can be provided to this method in one of two formats: 43205 * 43206 * 1. An array of string control names, e.g. `['address', 'street']` 43207 * 1. A period-delimited list of control names in one string, e.g. `'address.street'` 43208 * 43209 * If no path is given, this method checks for the error on the current control. 43210 * 43211 * @returns whether the given error is present in the control at the given path. 43212 * 43213 * If the control is not present, false is returned. 43214 */ 43215 hasError(errorCode, path) { 43216 return !!this.getError(errorCode, path); 43217 } 43218 /** 43219 * Retrieves the top-level ancestor of this control. 43220 */ 43221 get root() { 43222 let x = this; 43223 while (x._parent) { 43224 x = x._parent; 43225 } 43226 return x; 43227 } 43228 /** @internal */ 43229 _updateControlsErrors(emitEvent) { 43230 this.status = this._calculateStatus(); 43231 if (emitEvent) { 43232 this.statusChanges.emit(this.status); 43233 } 43234 if (this._parent) { 43235 this._parent._updateControlsErrors(emitEvent); 43236 } 43237 } 43238 /** @internal */ 43239 _initObservables() { 43240 this.valueChanges = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); 43241 this.statusChanges = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); 43242 } 43243 _calculateStatus() { 43244 if (this._allControlsDisabled()) 43245 return DISABLED; 43246 if (this.errors) 43247 return INVALID; 43248 if (this._anyControlsHaveStatus(PENDING)) 43249 return PENDING; 43250 if (this._anyControlsHaveStatus(INVALID)) 43251 return INVALID; 43252 return VALID; 43253 } 43254 /** @internal */ 43255 _anyControlsHaveStatus(status) { 43256 return this._anyControls((control) => control.status === status); 43257 } 43258 /** @internal */ 43259 _anyControlsDirty() { 43260 return this._anyControls((control) => control.dirty); 43261 } 43262 /** @internal */ 43263 _anyControlsTouched() { 43264 return this._anyControls((control) => control.touched); 43265 } 43266 /** @internal */ 43267 _updatePristine(opts = {}) { 43268 this.pristine = !this._anyControlsDirty(); 43269 if (this._parent && !opts.onlySelf) { 43270 this._parent._updatePristine(opts); 43271 } 43272 } 43273 /** @internal */ 43274 _updateTouched(opts = {}) { 43275 this.touched = this._anyControlsTouched(); 43276 if (this._parent && !opts.onlySelf) { 43277 this._parent._updateTouched(opts); 43278 } 43279 } 43280 /** @internal */ 43281 _isBoxedValue(formState) { 43282 return typeof formState === 'object' && formState !== null && 43283 Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState; 43284 } 43285 /** @internal */ 43286 _registerOnCollectionChange(fn) { 43287 this._onCollectionChange = fn; 43288 } 43289 /** @internal */ 43290 _setUpdateStrategy(opts) { 43291 if (isOptionsObj(opts) && opts.updateOn != null) { 43292 this._updateOn = opts.updateOn; 43293 } 43294 } 43295 /** 43296 * Check to see if parent has been marked artificially dirty. 43297 * 43298 * @internal 43299 */ 43300 _parentMarkedDirty(onlySelf) { 43301 const parentDirty = this._parent && this._parent.dirty; 43302 return !onlySelf && parentDirty && !this._parent._anyControlsDirty(); 43303 } 43304} 43305/** 43306 * Tracks the value and validation status of an individual form control. 43307 * 43308 * This is one of the three fundamental building blocks of Angular forms, along with 43309 * `FormGroup` and `FormArray`. It extends the `AbstractControl` class that 43310 * implements most of the base functionality for accessing the value, validation status, 43311 * user interactions and events. See [usage examples below](#usage-notes). 43312 * 43313 * @see `AbstractControl` 43314 * @see [Reactive Forms Guide](guide/reactive-forms) 43315 * @see [Usage Notes](#usage-notes) 43316 * 43317 * @usageNotes 43318 * 43319 * ### Initializing Form Controls 43320 * 43321 * Instantiate a `FormControl`, with an initial value. 43322 * 43323 * ```ts 43324 * const control = new FormControl('some value'); 43325 * console.log(control.value); // 'some value' 43326 *``` 43327 * 43328 * The following example initializes the control with a form state object. The `value` 43329 * and `disabled` keys are required in this case. 43330 * 43331 * ```ts 43332 * const control = new FormControl({ value: 'n/a', disabled: true }); 43333 * console.log(control.value); // 'n/a' 43334 * console.log(control.status); // 'DISABLED' 43335 * ``` 43336 * 43337 * The following example initializes the control with a sync validator. 43338 * 43339 * ```ts 43340 * const control = new FormControl('', Validators.required); 43341 * console.log(control.value); // '' 43342 * console.log(control.status); // 'INVALID' 43343 * ``` 43344 * 43345 * The following example initializes the control using an options object. 43346 * 43347 * ```ts 43348 * const control = new FormControl('', { 43349 * validators: Validators.required, 43350 * asyncValidators: myAsyncValidator 43351 * }); 43352 * ``` 43353 * 43354 * ### Configure the control to update on a blur event 43355 * 43356 * Set the `updateOn` option to `'blur'` to update on the blur `event`. 43357 * 43358 * ```ts 43359 * const control = new FormControl('', { updateOn: 'blur' }); 43360 * ``` 43361 * 43362 * ### Configure the control to update on a submit event 43363 * 43364 * Set the `updateOn` option to `'submit'` to update on a submit `event`. 43365 * 43366 * ```ts 43367 * const control = new FormControl('', { updateOn: 'submit' }); 43368 * ``` 43369 * 43370 * ### Reset the control back to an initial value 43371 * 43372 * You reset to a specific form state by passing through a standalone 43373 * value or a form state object that contains both a value and a disabled state 43374 * (these are the only two properties that cannot be calculated). 43375 * 43376 * ```ts 43377 * const control = new FormControl('Nancy'); 43378 * 43379 * console.log(control.value); // 'Nancy' 43380 * 43381 * control.reset('Drew'); 43382 * 43383 * console.log(control.value); // 'Drew' 43384 * ``` 43385 * 43386 * ### Reset the control back to an initial value and disabled 43387 * 43388 * ``` 43389 * const control = new FormControl('Nancy'); 43390 * 43391 * console.log(control.value); // 'Nancy' 43392 * console.log(control.status); // 'VALID' 43393 * 43394 * control.reset({ value: 'Drew', disabled: true }); 43395 * 43396 * console.log(control.value); // 'Drew' 43397 * console.log(control.status); // 'DISABLED' 43398 * ``` 43399 * 43400 * @publicApi 43401 */ 43402class FormControl extends AbstractControl { 43403 /** 43404 * Creates a new `FormControl` instance. 43405 * 43406 * @param formState Initializes the control with an initial value, 43407 * or an object that defines the initial value and disabled state. 43408 * 43409 * @param validatorOrOpts A synchronous validator function, or an array of 43410 * such functions, or an `AbstractControlOptions` object that contains validation functions 43411 * and a validation trigger. 43412 * 43413 * @param asyncValidator A single async validator or array of async validator functions 43414 * 43415 */ 43416 constructor(formState = null, validatorOrOpts, asyncValidator) { 43417 super(coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)); 43418 /** @internal */ 43419 this._onChange = []; 43420 this._applyFormState(formState); 43421 this._setUpdateStrategy(validatorOrOpts); 43422 this.updateValueAndValidity({ onlySelf: true, emitEvent: false }); 43423 this._initObservables(); 43424 } 43425 /** 43426 * Sets a new value for the form control. 43427 * 43428 * @param value The new value for the control. 43429 * @param options Configuration options that determine how the control propagates changes 43430 * and emits events when the value changes. 43431 * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity 43432 * updateValueAndValidity} method. 43433 * 43434 * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is 43435 * false. 43436 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 43437 * `valueChanges` 43438 * observables emit events with the latest status and value when the control value is updated. 43439 * When false, no events are emitted. 43440 * * `emitModelToViewChange`: When true or not supplied (the default), each change triggers an 43441 * `onChange` event to 43442 * update the view. 43443 * * `emitViewToModelChange`: When true or not supplied (the default), each change triggers an 43444 * `ngModelChange` 43445 * event to update the model. 43446 * 43447 */ 43448 setValue(value, options = {}) { 43449 this.value = this._pendingValue = value; 43450 if (this._onChange.length && options.emitModelToViewChange !== false) { 43451 this._onChange.forEach((changeFn) => changeFn(this.value, options.emitViewToModelChange !== false)); 43452 } 43453 this.updateValueAndValidity(options); 43454 } 43455 /** 43456 * Patches the value of a control. 43457 * 43458 * This function is functionally the same as {@link FormControl#setValue setValue} at this level. 43459 * It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and 43460 * `FormArrays`, where it does behave differently. 43461 * 43462 * @see `setValue` for options 43463 */ 43464 patchValue(value, options = {}) { 43465 this.setValue(value, options); 43466 } 43467 /** 43468 * Resets the form control, marking it `pristine` and `untouched`, and setting 43469 * the value to null. 43470 * 43471 * @param formState Resets the control with an initial value, 43472 * or an object that defines the initial value and disabled state. 43473 * 43474 * @param options Configuration options that determine how the control propagates changes 43475 * and emits events after the value changes. 43476 * 43477 * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is 43478 * false. 43479 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 43480 * `valueChanges` 43481 * observables emit events with the latest status and value when the control is reset. 43482 * When false, no events are emitted. 43483 * 43484 */ 43485 reset(formState = null, options = {}) { 43486 this._applyFormState(formState); 43487 this.markAsPristine(options); 43488 this.markAsUntouched(options); 43489 this.setValue(this.value, options); 43490 this._pendingChange = false; 43491 } 43492 /** 43493 * @internal 43494 */ 43495 _updateValue() { } 43496 /** 43497 * @internal 43498 */ 43499 _anyControls(condition) { 43500 return false; 43501 } 43502 /** 43503 * @internal 43504 */ 43505 _allControlsDisabled() { 43506 return this.disabled; 43507 } 43508 /** 43509 * Register a listener for change events. 43510 * 43511 * @param fn The method that is called when the value changes 43512 */ 43513 registerOnChange(fn) { 43514 this._onChange.push(fn); 43515 } 43516 /** 43517 * @internal 43518 */ 43519 _clearChangeFns() { 43520 this._onChange = []; 43521 this._onDisabledChange = []; 43522 this._onCollectionChange = () => { }; 43523 } 43524 /** 43525 * Register a listener for disabled events. 43526 * 43527 * @param fn The method that is called when the disabled status changes. 43528 */ 43529 registerOnDisabledChange(fn) { 43530 this._onDisabledChange.push(fn); 43531 } 43532 /** 43533 * @internal 43534 */ 43535 _forEachChild(cb) { } 43536 /** @internal */ 43537 _syncPendingControls() { 43538 if (this.updateOn === 'submit') { 43539 if (this._pendingDirty) 43540 this.markAsDirty(); 43541 if (this._pendingTouched) 43542 this.markAsTouched(); 43543 if (this._pendingChange) { 43544 this.setValue(this._pendingValue, { onlySelf: true, emitModelToViewChange: false }); 43545 return true; 43546 } 43547 } 43548 return false; 43549 } 43550 _applyFormState(formState) { 43551 if (this._isBoxedValue(formState)) { 43552 this.value = this._pendingValue = formState.value; 43553 formState.disabled ? this.disable({ onlySelf: true, emitEvent: false }) : 43554 this.enable({ onlySelf: true, emitEvent: false }); 43555 } 43556 else { 43557 this.value = this._pendingValue = formState; 43558 } 43559 } 43560} 43561/** 43562 * Tracks the value and validity state of a group of `FormControl` instances. 43563 * 43564 * A `FormGroup` aggregates the values of each child `FormControl` into one object, 43565 * with each control name as the key. It calculates its status by reducing the status values 43566 * of its children. For example, if one of the controls in a group is invalid, the entire 43567 * group becomes invalid. 43568 * 43569 * `FormGroup` is one of the three fundamental building blocks used to define forms in Angular, 43570 * along with `FormControl` and `FormArray`. 43571 * 43572 * When instantiating a `FormGroup`, pass in a collection of child controls as the first 43573 * argument. The key for each child registers the name for the control. 43574 * 43575 * @usageNotes 43576 * 43577 * ### Create a form group with 2 controls 43578 * 43579 * ``` 43580 * const form = new FormGroup({ 43581 * first: new FormControl('Nancy', Validators.minLength(2)), 43582 * last: new FormControl('Drew'), 43583 * }); 43584 * 43585 * console.log(form.value); // {first: 'Nancy', last; 'Drew'} 43586 * console.log(form.status); // 'VALID' 43587 * ``` 43588 * 43589 * ### Create a form group with a group-level validator 43590 * 43591 * You include group-level validators as the second arg, or group-level async 43592 * validators as the third arg. These come in handy when you want to perform validation 43593 * that considers the value of more than one child control. 43594 * 43595 * ``` 43596 * const form = new FormGroup({ 43597 * password: new FormControl('', Validators.minLength(2)), 43598 * passwordConfirm: new FormControl('', Validators.minLength(2)), 43599 * }, passwordMatchValidator); 43600 * 43601 * 43602 * function passwordMatchValidator(g: FormGroup) { 43603 * return g.get('password').value === g.get('passwordConfirm').value 43604 * ? null : {'mismatch': true}; 43605 * } 43606 * ``` 43607 * 43608 * Like `FormControl` instances, you choose to pass in 43609 * validators and async validators as part of an options object. 43610 * 43611 * ``` 43612 * const form = new FormGroup({ 43613 * password: new FormControl('') 43614 * passwordConfirm: new FormControl('') 43615 * }, { validators: passwordMatchValidator, asyncValidators: otherValidator }); 43616 * ``` 43617 * 43618 * ### Set the updateOn property for all controls in a form group 43619 * 43620 * The options object is used to set a default value for each child 43621 * control's `updateOn` property. If you set `updateOn` to `'blur'` at the 43622 * group level, all child controls default to 'blur', unless the child 43623 * has explicitly specified a different `updateOn` value. 43624 * 43625 * ```ts 43626 * const c = new FormGroup({ 43627 * one: new FormControl() 43628 * }, { updateOn: 'blur' }); 43629 * ``` 43630 * 43631 * @publicApi 43632 */ 43633class FormGroup extends AbstractControl { 43634 /** 43635 * Creates a new `FormGroup` instance. 43636 * 43637 * @param controls A collection of child controls. The key for each child is the name 43638 * under which it is registered. 43639 * 43640 * @param validatorOrOpts A synchronous validator function, or an array of 43641 * such functions, or an `AbstractControlOptions` object that contains validation functions 43642 * and a validation trigger. 43643 * 43644 * @param asyncValidator A single async validator or array of async validator functions 43645 * 43646 */ 43647 constructor(controls, validatorOrOpts, asyncValidator) { 43648 super(coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)); 43649 this.controls = controls; 43650 this._initObservables(); 43651 this._setUpdateStrategy(validatorOrOpts); 43652 this._setUpControls(); 43653 this.updateValueAndValidity({ onlySelf: true, emitEvent: false }); 43654 } 43655 /** 43656 * Registers a control with the group's list of controls. 43657 * 43658 * This method does not update the value or validity of the control. 43659 * Use {@link FormGroup#addControl addControl} instead. 43660 * 43661 * @param name The control name to register in the collection 43662 * @param control Provides the control for the given name 43663 */ 43664 registerControl(name, control) { 43665 if (this.controls[name]) 43666 return this.controls[name]; 43667 this.controls[name] = control; 43668 control.setParent(this); 43669 control._registerOnCollectionChange(this._onCollectionChange); 43670 return control; 43671 } 43672 /** 43673 * Add a control to this group. 43674 * 43675 * This method also updates the value and validity of the control. 43676 * 43677 * @param name The control name to add to the collection 43678 * @param control Provides the control for the given name 43679 */ 43680 addControl(name, control) { 43681 this.registerControl(name, control); 43682 this.updateValueAndValidity(); 43683 this._onCollectionChange(); 43684 } 43685 /** 43686 * Remove a control from this group. 43687 * 43688 * @param name The control name to remove from the collection 43689 */ 43690 removeControl(name) { 43691 if (this.controls[name]) 43692 this.controls[name]._registerOnCollectionChange(() => { }); 43693 delete (this.controls[name]); 43694 this.updateValueAndValidity(); 43695 this._onCollectionChange(); 43696 } 43697 /** 43698 * Replace an existing control. 43699 * 43700 * @param name The control name to replace in the collection 43701 * @param control Provides the control for the given name 43702 */ 43703 setControl(name, control) { 43704 if (this.controls[name]) 43705 this.controls[name]._registerOnCollectionChange(() => { }); 43706 delete (this.controls[name]); 43707 if (control) 43708 this.registerControl(name, control); 43709 this.updateValueAndValidity(); 43710 this._onCollectionChange(); 43711 } 43712 /** 43713 * Check whether there is an enabled control with the given name in the group. 43714 * 43715 * Reports false for disabled controls. If you'd like to check for existence in the group 43716 * only, use {@link AbstractControl#get get} instead. 43717 * 43718 * @param controlName The control name to check for existence in the collection 43719 * 43720 * @returns false for disabled controls, true otherwise. 43721 */ 43722 contains(controlName) { 43723 return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled; 43724 } 43725 /** 43726 * Sets the value of the `FormGroup`. It accepts an object that matches 43727 * the structure of the group, with control names as keys. 43728 * 43729 * @usageNotes 43730 * ### Set the complete value for the form group 43731 * 43732 * ``` 43733 * const form = new FormGroup({ 43734 * first: new FormControl(), 43735 * last: new FormControl() 43736 * }); 43737 * 43738 * console.log(form.value); // {first: null, last: null} 43739 * 43740 * form.setValue({first: 'Nancy', last: 'Drew'}); 43741 * console.log(form.value); // {first: 'Nancy', last: 'Drew'} 43742 * ``` 43743 * 43744 * @throws When strict checks fail, such as setting the value of a control 43745 * that doesn't exist or if you exclude a value of a control that does exist. 43746 * 43747 * @param value The new value for the control that matches the structure of the group. 43748 * @param options Configuration options that determine how the control propagates changes 43749 * and emits events after the value changes. 43750 * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity 43751 * updateValueAndValidity} method. 43752 * 43753 * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is 43754 * false. 43755 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 43756 * `valueChanges` 43757 * observables emit events with the latest status and value when the control value is updated. 43758 * When false, no events are emitted. 43759 */ 43760 setValue(value, options = {}) { 43761 this._checkAllValuesPresent(value); 43762 Object.keys(value).forEach(name => { 43763 this._throwIfControlMissing(name); 43764 this.controls[name].setValue(value[name], { onlySelf: true, emitEvent: options.emitEvent }); 43765 }); 43766 this.updateValueAndValidity(options); 43767 } 43768 /** 43769 * Patches the value of the `FormGroup`. It accepts an object with control 43770 * names as keys, and does its best to match the values to the correct controls 43771 * in the group. 43772 * 43773 * It accepts both super-sets and sub-sets of the group without throwing an error. 43774 * 43775 * @usageNotes 43776 * ### Patch the value for a form group 43777 * 43778 * ``` 43779 * const form = new FormGroup({ 43780 * first: new FormControl(), 43781 * last: new FormControl() 43782 * }); 43783 * console.log(form.value); // {first: null, last: null} 43784 * 43785 * form.patchValue({first: 'Nancy'}); 43786 * console.log(form.value); // {first: 'Nancy', last: null} 43787 * ``` 43788 * 43789 * @param value The object that matches the structure of the group. 43790 * @param options Configuration options that determine how the control propagates changes and 43791 * emits events after the value is patched. 43792 * * `onlySelf`: When true, each change only affects this control and not its parent. Default is 43793 * true. 43794 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 43795 * `valueChanges` 43796 * observables emit events with the latest status and value when the control value is updated. 43797 * When false, no events are emitted. 43798 * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity 43799 * updateValueAndValidity} method. 43800 */ 43801 patchValue(value, options = {}) { 43802 Object.keys(value).forEach(name => { 43803 if (this.controls[name]) { 43804 this.controls[name].patchValue(value[name], { onlySelf: true, emitEvent: options.emitEvent }); 43805 } 43806 }); 43807 this.updateValueAndValidity(options); 43808 } 43809 /** 43810 * Resets the `FormGroup`, marks all descendants are marked `pristine` and `untouched`, and 43811 * the value of all descendants to null. 43812 * 43813 * You reset to a specific form state by passing in a map of states 43814 * that matches the structure of your form, with control names as keys. The state 43815 * is a standalone value or a form state object with both a value and a disabled 43816 * status. 43817 * 43818 * @param value Resets the control with an initial value, 43819 * or an object that defines the initial value and disabled state. 43820 * 43821 * @param options Configuration options that determine how the control propagates changes 43822 * and emits events when the group is reset. 43823 * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is 43824 * false. 43825 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 43826 * `valueChanges` 43827 * observables emit events with the latest status and value when the control is reset. 43828 * When false, no events are emitted. 43829 * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity 43830 * updateValueAndValidity} method. 43831 * 43832 * @usageNotes 43833 * 43834 * ### Reset the form group values 43835 * 43836 * ```ts 43837 * const form = new FormGroup({ 43838 * first: new FormControl('first name'), 43839 * last: new FormControl('last name') 43840 * }); 43841 * 43842 * console.log(form.value); // {first: 'first name', last: 'last name'} 43843 * 43844 * form.reset({ first: 'name', last: 'last name' }); 43845 * 43846 * console.log(form.value); // {first: 'name', last: 'last name'} 43847 * ``` 43848 * 43849 * ### Reset the form group values and disabled status 43850 * 43851 * ``` 43852 * const form = new FormGroup({ 43853 * first: new FormControl('first name'), 43854 * last: new FormControl('last name') 43855 * }); 43856 * 43857 * form.reset({ 43858 * first: {value: 'name', disabled: true}, 43859 * last: 'last' 43860 * }); 43861 * 43862 * console.log(this.form.value); // {first: 'name', last: 'last name'} 43863 * console.log(this.form.get('first').status); // 'DISABLED' 43864 * ``` 43865 */ 43866 reset(value = {}, options = {}) { 43867 this._forEachChild((control, name) => { 43868 control.reset(value[name], { onlySelf: true, emitEvent: options.emitEvent }); 43869 }); 43870 this._updatePristine(options); 43871 this._updateTouched(options); 43872 this.updateValueAndValidity(options); 43873 } 43874 /** 43875 * The aggregate value of the `FormGroup`, including any disabled controls. 43876 * 43877 * Retrieves all values regardless of disabled status. 43878 * The `value` property is the best way to get the value of the group, because 43879 * it excludes disabled controls in the `FormGroup`. 43880 */ 43881 getRawValue() { 43882 return this._reduceChildren({}, (acc, control, name) => { 43883 acc[name] = control instanceof FormControl ? control.value : control.getRawValue(); 43884 return acc; 43885 }); 43886 } 43887 /** @internal */ 43888 _syncPendingControls() { 43889 let subtreeUpdated = this._reduceChildren(false, (updated, child) => { 43890 return child._syncPendingControls() ? true : updated; 43891 }); 43892 if (subtreeUpdated) 43893 this.updateValueAndValidity({ onlySelf: true }); 43894 return subtreeUpdated; 43895 } 43896 /** @internal */ 43897 _throwIfControlMissing(name) { 43898 if (!Object.keys(this.controls).length) { 43899 throw new Error(` 43900 There are no form controls registered with this group yet. If you're using ngModel, 43901 you may want to check next tick (e.g. use setTimeout). 43902 `); 43903 } 43904 if (!this.controls[name]) { 43905 throw new Error(`Cannot find form control with name: ${name}.`); 43906 } 43907 } 43908 /** @internal */ 43909 _forEachChild(cb) { 43910 Object.keys(this.controls).forEach(k => cb(this.controls[k], k)); 43911 } 43912 /** @internal */ 43913 _setUpControls() { 43914 this._forEachChild((control) => { 43915 control.setParent(this); 43916 control._registerOnCollectionChange(this._onCollectionChange); 43917 }); 43918 } 43919 /** @internal */ 43920 _updateValue() { 43921 this.value = this._reduceValue(); 43922 } 43923 /** @internal */ 43924 _anyControls(condition) { 43925 for (const controlName of Object.keys(this.controls)) { 43926 const control = this.controls[controlName]; 43927 if (this.contains(controlName) && condition(control)) { 43928 return true; 43929 } 43930 } 43931 return false; 43932 } 43933 /** @internal */ 43934 _reduceValue() { 43935 return this._reduceChildren({}, (acc, control, name) => { 43936 if (control.enabled || this.disabled) { 43937 acc[name] = control.value; 43938 } 43939 return acc; 43940 }); 43941 } 43942 /** @internal */ 43943 _reduceChildren(initValue, fn) { 43944 let res = initValue; 43945 this._forEachChild((control, name) => { 43946 res = fn(res, control, name); 43947 }); 43948 return res; 43949 } 43950 /** @internal */ 43951 _allControlsDisabled() { 43952 for (const controlName of Object.keys(this.controls)) { 43953 if (this.controls[controlName].enabled) { 43954 return false; 43955 } 43956 } 43957 return Object.keys(this.controls).length > 0 || this.disabled; 43958 } 43959 /** @internal */ 43960 _checkAllValuesPresent(value) { 43961 this._forEachChild((control, name) => { 43962 if (value[name] === undefined) { 43963 throw new Error(`Must supply a value for form control with name: '${name}'.`); 43964 } 43965 }); 43966 } 43967} 43968/** 43969 * Tracks the value and validity state of an array of `FormControl`, 43970 * `FormGroup` or `FormArray` instances. 43971 * 43972 * A `FormArray` aggregates the values of each child `FormControl` into an array. 43973 * It calculates its status by reducing the status values of its children. For example, if one of 43974 * the controls in a `FormArray` is invalid, the entire array becomes invalid. 43975 * 43976 * `FormArray` is one of the three fundamental building blocks used to define forms in Angular, 43977 * along with `FormControl` and `FormGroup`. 43978 * 43979 * @usageNotes 43980 * 43981 * ### Create an array of form controls 43982 * 43983 * ``` 43984 * const arr = new FormArray([ 43985 * new FormControl('Nancy', Validators.minLength(2)), 43986 * new FormControl('Drew'), 43987 * ]); 43988 * 43989 * console.log(arr.value); // ['Nancy', 'Drew'] 43990 * console.log(arr.status); // 'VALID' 43991 * ``` 43992 * 43993 * ### Create a form array with array-level validators 43994 * 43995 * You include array-level validators and async validators. These come in handy 43996 * when you want to perform validation that considers the value of more than one child 43997 * control. 43998 * 43999 * The two types of validators are passed in separately as the second and third arg 44000 * respectively, or together as part of an options object. 44001 * 44002 * ``` 44003 * const arr = new FormArray([ 44004 * new FormControl('Nancy'), 44005 * new FormControl('Drew') 44006 * ], {validators: myValidator, asyncValidators: myAsyncValidator}); 44007 * ``` 44008 * 44009 * ### Set the updateOn property for all controls in a form array 44010 * 44011 * The options object is used to set a default value for each child 44012 * control's `updateOn` property. If you set `updateOn` to `'blur'` at the 44013 * array level, all child controls default to 'blur', unless the child 44014 * has explicitly specified a different `updateOn` value. 44015 * 44016 * ```ts 44017 * const arr = new FormArray([ 44018 * new FormControl() 44019 * ], {updateOn: 'blur'}); 44020 * ``` 44021 * 44022 * ### Adding or removing controls from a form array 44023 * 44024 * To change the controls in the array, use the `push`, `insert`, `removeAt` or `clear` methods 44025 * in `FormArray` itself. These methods ensure the controls are properly tracked in the 44026 * form's hierarchy. Do not modify the array of `AbstractControl`s used to instantiate 44027 * the `FormArray` directly, as that result in strange and unexpected behavior such 44028 * as broken change detection. 44029 * 44030 * @publicApi 44031 */ 44032class FormArray extends AbstractControl { 44033 /** 44034 * Creates a new `FormArray` instance. 44035 * 44036 * @param controls An array of child controls. Each child control is given an index 44037 * where it is registered. 44038 * 44039 * @param validatorOrOpts A synchronous validator function, or an array of 44040 * such functions, or an `AbstractControlOptions` object that contains validation functions 44041 * and a validation trigger. 44042 * 44043 * @param asyncValidator A single async validator or array of async validator functions 44044 * 44045 */ 44046 constructor(controls, validatorOrOpts, asyncValidator) { 44047 super(coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)); 44048 this.controls = controls; 44049 this._initObservables(); 44050 this._setUpdateStrategy(validatorOrOpts); 44051 this._setUpControls(); 44052 this.updateValueAndValidity({ onlySelf: true, emitEvent: false }); 44053 } 44054 /** 44055 * Get the `AbstractControl` at the given `index` in the array. 44056 * 44057 * @param index Index in the array to retrieve the control 44058 */ 44059 at(index) { 44060 return this.controls[index]; 44061 } 44062 /** 44063 * Insert a new `AbstractControl` at the end of the array. 44064 * 44065 * @param control Form control to be inserted 44066 */ 44067 push(control) { 44068 this.controls.push(control); 44069 this._registerControl(control); 44070 this.updateValueAndValidity(); 44071 this._onCollectionChange(); 44072 } 44073 /** 44074 * Insert a new `AbstractControl` at the given `index` in the array. 44075 * 44076 * @param index Index in the array to insert the control 44077 * @param control Form control to be inserted 44078 */ 44079 insert(index, control) { 44080 this.controls.splice(index, 0, control); 44081 this._registerControl(control); 44082 this.updateValueAndValidity(); 44083 } 44084 /** 44085 * Remove the control at the given `index` in the array. 44086 * 44087 * @param index Index in the array to remove the control 44088 */ 44089 removeAt(index) { 44090 if (this.controls[index]) 44091 this.controls[index]._registerOnCollectionChange(() => { }); 44092 this.controls.splice(index, 1); 44093 this.updateValueAndValidity(); 44094 } 44095 /** 44096 * Replace an existing control. 44097 * 44098 * @param index Index in the array to replace the control 44099 * @param control The `AbstractControl` control to replace the existing control 44100 */ 44101 setControl(index, control) { 44102 if (this.controls[index]) 44103 this.controls[index]._registerOnCollectionChange(() => { }); 44104 this.controls.splice(index, 1); 44105 if (control) { 44106 this.controls.splice(index, 0, control); 44107 this._registerControl(control); 44108 } 44109 this.updateValueAndValidity(); 44110 this._onCollectionChange(); 44111 } 44112 /** 44113 * Length of the control array. 44114 */ 44115 get length() { 44116 return this.controls.length; 44117 } 44118 /** 44119 * Sets the value of the `FormArray`. It accepts an array that matches 44120 * the structure of the control. 44121 * 44122 * This method performs strict checks, and throws an error if you try 44123 * to set the value of a control that doesn't exist or if you exclude the 44124 * value of a control. 44125 * 44126 * @usageNotes 44127 * ### Set the values for the controls in the form array 44128 * 44129 * ``` 44130 * const arr = new FormArray([ 44131 * new FormControl(), 44132 * new FormControl() 44133 * ]); 44134 * console.log(arr.value); // [null, null] 44135 * 44136 * arr.setValue(['Nancy', 'Drew']); 44137 * console.log(arr.value); // ['Nancy', 'Drew'] 44138 * ``` 44139 * 44140 * @param value Array of values for the controls 44141 * @param options Configure options that determine how the control propagates changes and 44142 * emits events after the value changes 44143 * 44144 * * `onlySelf`: When true, each change only affects this control, and not its parent. Default 44145 * is false. 44146 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 44147 * `valueChanges` 44148 * observables emit events with the latest status and value when the control value is updated. 44149 * When false, no events are emitted. 44150 * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity 44151 * updateValueAndValidity} method. 44152 */ 44153 setValue(value, options = {}) { 44154 this._checkAllValuesPresent(value); 44155 value.forEach((newValue, index) => { 44156 this._throwIfControlMissing(index); 44157 this.at(index).setValue(newValue, { onlySelf: true, emitEvent: options.emitEvent }); 44158 }); 44159 this.updateValueAndValidity(options); 44160 } 44161 /** 44162 * Patches the value of the `FormArray`. It accepts an array that matches the 44163 * structure of the control, and does its best to match the values to the correct 44164 * controls in the group. 44165 * 44166 * It accepts both super-sets and sub-sets of the array without throwing an error. 44167 * 44168 * @usageNotes 44169 * ### Patch the values for controls in a form array 44170 * 44171 * ``` 44172 * const arr = new FormArray([ 44173 * new FormControl(), 44174 * new FormControl() 44175 * ]); 44176 * console.log(arr.value); // [null, null] 44177 * 44178 * arr.patchValue(['Nancy']); 44179 * console.log(arr.value); // ['Nancy', null] 44180 * ``` 44181 * 44182 * @param value Array of latest values for the controls 44183 * @param options Configure options that determine how the control propagates changes and 44184 * emits events after the value changes 44185 * 44186 * * `onlySelf`: When true, each change only affects this control, and not its parent. Default 44187 * is false. 44188 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 44189 * `valueChanges` 44190 * observables emit events with the latest status and value when the control value is updated. 44191 * When false, no events are emitted. 44192 * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity 44193 * updateValueAndValidity} method. 44194 */ 44195 patchValue(value, options = {}) { 44196 value.forEach((newValue, index) => { 44197 if (this.at(index)) { 44198 this.at(index).patchValue(newValue, { onlySelf: true, emitEvent: options.emitEvent }); 44199 } 44200 }); 44201 this.updateValueAndValidity(options); 44202 } 44203 /** 44204 * Resets the `FormArray` and all descendants are marked `pristine` and `untouched`, and the 44205 * value of all descendants to null or null maps. 44206 * 44207 * You reset to a specific form state by passing in an array of states 44208 * that matches the structure of the control. The state is a standalone value 44209 * or a form state object with both a value and a disabled status. 44210 * 44211 * @usageNotes 44212 * ### Reset the values in a form array 44213 * 44214 * ```ts 44215 * const arr = new FormArray([ 44216 * new FormControl(), 44217 * new FormControl() 44218 * ]); 44219 * arr.reset(['name', 'last name']); 44220 * 44221 * console.log(this.arr.value); // ['name', 'last name'] 44222 * ``` 44223 * 44224 * ### Reset the values in a form array and the disabled status for the first control 44225 * 44226 * ``` 44227 * this.arr.reset([ 44228 * {value: 'name', disabled: true}, 44229 * 'last' 44230 * ]); 44231 * 44232 * console.log(this.arr.value); // ['name', 'last name'] 44233 * console.log(this.arr.get(0).status); // 'DISABLED' 44234 * ``` 44235 * 44236 * @param value Array of values for the controls 44237 * @param options Configure options that determine how the control propagates changes and 44238 * emits events after the value changes 44239 * 44240 * * `onlySelf`: When true, each change only affects this control, and not its parent. Default 44241 * is false. 44242 * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and 44243 * `valueChanges` 44244 * observables emit events with the latest status and value when the control is reset. 44245 * When false, no events are emitted. 44246 * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity 44247 * updateValueAndValidity} method. 44248 */ 44249 reset(value = [], options = {}) { 44250 this._forEachChild((control, index) => { 44251 control.reset(value[index], { onlySelf: true, emitEvent: options.emitEvent }); 44252 }); 44253 this._updatePristine(options); 44254 this._updateTouched(options); 44255 this.updateValueAndValidity(options); 44256 } 44257 /** 44258 * The aggregate value of the array, including any disabled controls. 44259 * 44260 * Reports all values regardless of disabled status. 44261 * For enabled controls only, the `value` property is the best way to get the value of the array. 44262 */ 44263 getRawValue() { 44264 return this.controls.map((control) => { 44265 return control instanceof FormControl ? control.value : control.getRawValue(); 44266 }); 44267 } 44268 /** 44269 * Remove all controls in the `FormArray`. 44270 * 44271 * @usageNotes 44272 * ### Remove all elements from a FormArray 44273 * 44274 * ```ts 44275 * const arr = new FormArray([ 44276 * new FormControl(), 44277 * new FormControl() 44278 * ]); 44279 * console.log(arr.length); // 2 44280 * 44281 * arr.clear(); 44282 * console.log(arr.length); // 0 44283 * ``` 44284 * 44285 * It's a simpler and more efficient alternative to removing all elements one by one: 44286 * 44287 * ```ts 44288 * const arr = new FormArray([ 44289 * new FormControl(), 44290 * new FormControl() 44291 * ]); 44292 * 44293 * while (arr.length) { 44294 * arr.removeAt(0); 44295 * } 44296 * ``` 44297 */ 44298 clear() { 44299 if (this.controls.length < 1) 44300 return; 44301 this._forEachChild((control) => control._registerOnCollectionChange(() => { })); 44302 this.controls.splice(0); 44303 this.updateValueAndValidity(); 44304 } 44305 /** @internal */ 44306 _syncPendingControls() { 44307 let subtreeUpdated = this.controls.reduce((updated, child) => { 44308 return child._syncPendingControls() ? true : updated; 44309 }, false); 44310 if (subtreeUpdated) 44311 this.updateValueAndValidity({ onlySelf: true }); 44312 return subtreeUpdated; 44313 } 44314 /** @internal */ 44315 _throwIfControlMissing(index) { 44316 if (!this.controls.length) { 44317 throw new Error(` 44318 There are no form controls registered with this array yet. If you're using ngModel, 44319 you may want to check next tick (e.g. use setTimeout). 44320 `); 44321 } 44322 if (!this.at(index)) { 44323 throw new Error(`Cannot find form control at index ${index}`); 44324 } 44325 } 44326 /** @internal */ 44327 _forEachChild(cb) { 44328 this.controls.forEach((control, index) => { 44329 cb(control, index); 44330 }); 44331 } 44332 /** @internal */ 44333 _updateValue() { 44334 this.value = 44335 this.controls.filter((control) => control.enabled || this.disabled) 44336 .map((control) => control.value); 44337 } 44338 /** @internal */ 44339 _anyControls(condition) { 44340 return this.controls.some((control) => control.enabled && condition(control)); 44341 } 44342 /** @internal */ 44343 _setUpControls() { 44344 this._forEachChild((control) => this._registerControl(control)); 44345 } 44346 /** @internal */ 44347 _checkAllValuesPresent(value) { 44348 this._forEachChild((control, i) => { 44349 if (value[i] === undefined) { 44350 throw new Error(`Must supply a value for form control at index: ${i}.`); 44351 } 44352 }); 44353 } 44354 /** @internal */ 44355 _allControlsDisabled() { 44356 for (const control of this.controls) { 44357 if (control.enabled) 44358 return false; 44359 } 44360 return this.controls.length > 0 || this.disabled; 44361 } 44362 _registerControl(control) { 44363 control.setParent(this); 44364 control._registerOnCollectionChange(this._onCollectionChange); 44365 } 44366} 44367 44368/** 44369 * @license 44370 * Copyright Google LLC All Rights Reserved. 44371 * 44372 * Use of this source code is governed by an MIT-style license that can be 44373 * found in the LICENSE file at https://angular.io/license 44374 */ 44375const formDirectiveProvider = { 44376 provide: ControlContainer, 44377 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => NgForm) 44378}; 44379const ɵ0 = () => Promise.resolve(null); 44380const resolvedPromise = (ɵ0)(); 44381/** 44382 * @description 44383 * Creates a top-level `FormGroup` instance and binds it to a form 44384 * to track aggregate form value and validation status. 44385 * 44386 * As soon as you import the `FormsModule`, this directive becomes active by default on 44387 * all `<form>` tags. You don't need to add a special selector. 44388 * 44389 * You optionally export the directive into a local template variable using `ngForm` as the key 44390 * (ex: `#myForm="ngForm"`). This is optional, but useful. Many properties from the underlying 44391 * `FormGroup` instance are duplicated on the directive itself, so a reference to it 44392 * gives you access to the aggregate value and validity status of the form, as well as 44393 * user interaction properties like `dirty` and `touched`. 44394 * 44395 * To register child controls with the form, use `NgModel` with a `name` 44396 * attribute. You may use `NgModelGroup` to create sub-groups within the form. 44397 * 44398 * If necessary, listen to the directive's `ngSubmit` event to be notified when the user has 44399 * triggered a form submission. The `ngSubmit` event emits the original form 44400 * submission event. 44401 * 44402 * In template driven forms, all `<form>` tags are automatically tagged as `NgForm`. 44403 * To import the `FormsModule` but skip its usage in some forms, 44404 * for example, to use native HTML5 validation, add the `ngNoForm` and the `<form>` 44405 * tags won't create an `NgForm` directive. In reactive forms, using `ngNoForm` is 44406 * unnecessary because the `<form>` tags are inert. In that case, you would 44407 * refrain from using the `formGroup` directive. 44408 * 44409 * @usageNotes 44410 * 44411 * ### Listening for form submission 44412 * 44413 * The following example shows how to capture the form values from the "ngSubmit" event. 44414 * 44415 * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'} 44416 * 44417 * ### Setting the update options 44418 * 44419 * The following example shows you how to change the "updateOn" option from its default using 44420 * ngFormOptions. 44421 * 44422 * ```html 44423 * <form [ngFormOptions]="{updateOn: 'blur'}"> 44424 * <input name="one" ngModel> <!-- this ngModel will update on blur --> 44425 * </form> 44426 * ``` 44427 * 44428 * ### Native DOM validation UI 44429 * 44430 * In order to prevent the native DOM form validation UI from interfering with Angular's form 44431 * validation, Angular automatically adds the `novalidate` attribute on any `<form>` whenever 44432 * `FormModule` or `ReactiveFormModule` are imported into the application. 44433 * If you want to explicitly enable native DOM validation UI with Angular forms, you can add the 44434 * `ngNativeValidate` attribute to the `<form>` element: 44435 * 44436 * ```html 44437 * <form ngNativeValidate> 44438 * ... 44439 * </form> 44440 * ``` 44441 * 44442 * @ngModule FormsModule 44443 * @publicApi 44444 */ 44445class NgForm extends ControlContainer { 44446 constructor(validators, asyncValidators) { 44447 super(); 44448 /** 44449 * @description 44450 * Returns whether the form submission has been triggered. 44451 */ 44452 this.submitted = false; 44453 this._directives = []; 44454 /** 44455 * @description 44456 * Event emitter for the "ngSubmit" event 44457 */ 44458 this.ngSubmit = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); 44459 this.form = 44460 new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators)); 44461 } 44462 /** 44463 * @description 44464 * Lifecycle method called after the view is initialized. For internal use only. 44465 */ 44466 ngAfterViewInit() { 44467 this._setUpdateStrategy(); 44468 } 44469 /** 44470 * @description 44471 * The directive instance. 44472 */ 44473 get formDirective() { 44474 return this; 44475 } 44476 /** 44477 * @description 44478 * The internal `FormGroup` instance. 44479 */ 44480 get control() { 44481 return this.form; 44482 } 44483 /** 44484 * @description 44485 * Returns an array representing the path to this group. Because this directive 44486 * always lives at the top level of a form, it is always an empty array. 44487 */ 44488 get path() { 44489 return []; 44490 } 44491 /** 44492 * @description 44493 * Returns a map of the controls in this group. 44494 */ 44495 get controls() { 44496 return this.form.controls; 44497 } 44498 /** 44499 * @description 44500 * Method that sets up the control directive in this group, re-calculates its value 44501 * and validity, and adds the instance to the internal list of directives. 44502 * 44503 * @param dir The `NgModel` directive instance. 44504 */ 44505 addControl(dir) { 44506 resolvedPromise.then(() => { 44507 const container = this._findContainer(dir.path); 44508 dir.control = 44509 container.registerControl(dir.name, dir.control); 44510 setUpControl(dir.control, dir); 44511 dir.control.updateValueAndValidity({ emitEvent: false }); 44512 this._directives.push(dir); 44513 }); 44514 } 44515 /** 44516 * @description 44517 * Retrieves the `FormControl` instance from the provided `NgModel` directive. 44518 * 44519 * @param dir The `NgModel` directive instance. 44520 */ 44521 getControl(dir) { 44522 return this.form.get(dir.path); 44523 } 44524 /** 44525 * @description 44526 * Removes the `NgModel` instance from the internal list of directives 44527 * 44528 * @param dir The `NgModel` directive instance. 44529 */ 44530 removeControl(dir) { 44531 resolvedPromise.then(() => { 44532 const container = this._findContainer(dir.path); 44533 if (container) { 44534 container.removeControl(dir.name); 44535 } 44536 removeDir(this._directives, dir); 44537 }); 44538 } 44539 /** 44540 * @description 44541 * Adds a new `NgModelGroup` directive instance to the form. 44542 * 44543 * @param dir The `NgModelGroup` directive instance. 44544 */ 44545 addFormGroup(dir) { 44546 resolvedPromise.then(() => { 44547 const container = this._findContainer(dir.path); 44548 const group = new FormGroup({}); 44549 setUpFormContainer(group, dir); 44550 container.registerControl(dir.name, group); 44551 group.updateValueAndValidity({ emitEvent: false }); 44552 }); 44553 } 44554 /** 44555 * @description 44556 * Removes the `NgModelGroup` directive instance from the form. 44557 * 44558 * @param dir The `NgModelGroup` directive instance. 44559 */ 44560 removeFormGroup(dir) { 44561 resolvedPromise.then(() => { 44562 const container = this._findContainer(dir.path); 44563 if (container) { 44564 container.removeControl(dir.name); 44565 } 44566 }); 44567 } 44568 /** 44569 * @description 44570 * Retrieves the `FormGroup` for a provided `NgModelGroup` directive instance 44571 * 44572 * @param dir The `NgModelGroup` directive instance. 44573 */ 44574 getFormGroup(dir) { 44575 return this.form.get(dir.path); 44576 } 44577 /** 44578 * Sets the new value for the provided `NgControl` directive. 44579 * 44580 * @param dir The `NgControl` directive instance. 44581 * @param value The new value for the directive's control. 44582 */ 44583 updateModel(dir, value) { 44584 resolvedPromise.then(() => { 44585 const ctrl = this.form.get(dir.path); 44586 ctrl.setValue(value); 44587 }); 44588 } 44589 /** 44590 * @description 44591 * Sets the value for this `FormGroup`. 44592 * 44593 * @param value The new value 44594 */ 44595 setValue(value) { 44596 this.control.setValue(value); 44597 } 44598 /** 44599 * @description 44600 * Method called when the "submit" event is triggered on the form. 44601 * Triggers the `ngSubmit` emitter to emit the "submit" event as its payload. 44602 * 44603 * @param $event The "submit" event object 44604 */ 44605 onSubmit($event) { 44606 this.submitted = true; 44607 syncPendingControls(this.form, this._directives); 44608 this.ngSubmit.emit($event); 44609 return false; 44610 } 44611 /** 44612 * @description 44613 * Method called when the "reset" event is triggered on the form. 44614 */ 44615 onReset() { 44616 this.resetForm(); 44617 } 44618 /** 44619 * @description 44620 * Resets the form to an initial value and resets its submitted status. 44621 * 44622 * @param value The new value for the form. 44623 */ 44624 resetForm(value = undefined) { 44625 this.form.reset(value); 44626 this.submitted = false; 44627 } 44628 _setUpdateStrategy() { 44629 if (this.options && this.options.updateOn != null) { 44630 this.form._updateOn = this.options.updateOn; 44631 } 44632 } 44633 /** @internal */ 44634 _findContainer(path) { 44635 path.pop(); 44636 return path.length ? this.form.get(path) : this.form; 44637 } 44638} 44639NgForm.ɵfac = function NgForm_Factory(t) { return new (t || NgForm)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_ASYNC_VALIDATORS, 10)); }; 44640NgForm.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgForm, selectors: [["form", 3, "ngNoForm", "", 3, "formGroup", ""], ["ng-form"], ["", "ngForm", ""]], hostBindings: function NgForm_HostBindings(rf, ctx) { if (rf & 1) { 44641 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("submit", function NgForm_submit_HostBindingHandler($event) { return ctx.onSubmit($event); })("reset", function NgForm_reset_HostBindingHandler() { return ctx.onReset(); }); 44642 } }, inputs: { options: ["ngFormOptions", "options"] }, outputs: { ngSubmit: "ngSubmit" }, exportAs: ["ngForm"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([formDirectiveProvider]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 44643NgForm.ctorParameters = () => [ 44644 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALIDATORS,] }] }, 44645 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] } 44646]; 44647NgForm.propDecorators = { 44648 options: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngFormOptions',] }] 44649}; 44650/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgForm, [{ 44651 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 44652 args: [{ 44653 selector: 'form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]', 44654 providers: [formDirectiveProvider], 44655 host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' }, 44656 outputs: ['ngSubmit'], 44657 exportAs: 'ngForm' 44658 }] 44659 }], function () { return [{ type: Array, decorators: [{ 44660 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 44661 }, { 44662 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 44663 }, { 44664 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 44665 args: [NG_VALIDATORS] 44666 }] }, { type: Array, decorators: [{ 44667 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 44668 }, { 44669 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 44670 }, { 44671 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 44672 args: [NG_ASYNC_VALIDATORS] 44673 }] }]; }, { options: [{ 44674 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 44675 args: ['ngFormOptions'] 44676 }] }); })(); 44677 44678/** 44679 * @license 44680 * Copyright Google LLC All Rights Reserved. 44681 * 44682 * Use of this source code is governed by an MIT-style license that can be 44683 * found in the LICENSE file at https://angular.io/license 44684 */ 44685/** 44686 * @description 44687 * A base class for code shared between the `NgModelGroup` and `FormGroupName` directives. 44688 * 44689 * @publicApi 44690 */ 44691class AbstractFormGroupDirective extends ControlContainer { 44692 /** 44693 * @description 44694 * An internal callback method triggered on the instance after the inputs are set. 44695 * Registers the group with its parent group. 44696 */ 44697 ngOnInit() { 44698 this._checkParentType(); 44699 this.formDirective.addFormGroup(this); 44700 } 44701 /** 44702 * @description 44703 * An internal callback method triggered before the instance is destroyed. 44704 * Removes the group from its parent group. 44705 */ 44706 ngOnDestroy() { 44707 if (this.formDirective) { 44708 this.formDirective.removeFormGroup(this); 44709 } 44710 } 44711 /** 44712 * @description 44713 * The `FormGroup` bound to this directive. 44714 */ 44715 get control() { 44716 return this.formDirective.getFormGroup(this); 44717 } 44718 /** 44719 * @description 44720 * The path to this group from the top-level directive. 44721 */ 44722 get path() { 44723 return controlPath(this.name == null ? this.name : this.name.toString(), this._parent); 44724 } 44725 /** 44726 * @description 44727 * The top-level directive for this group if present, otherwise null. 44728 */ 44729 get formDirective() { 44730 return this._parent ? this._parent.formDirective : null; 44731 } 44732 /** 44733 * @description 44734 * The synchronous validators registered with this group. 44735 */ 44736 get validator() { 44737 return composeValidators(this._validators); 44738 } 44739 /** 44740 * @description 44741 * The async validators registered with this group. 44742 */ 44743 get asyncValidator() { 44744 return composeAsyncValidators(this._asyncValidators); 44745 } 44746 /** @internal */ 44747 _checkParentType() { } 44748} 44749AbstractFormGroupDirective.ɵfac = function AbstractFormGroupDirective_Factory(t) { return ɵAbstractFormGroupDirective_BaseFactory(t || AbstractFormGroupDirective); }; 44750AbstractFormGroupDirective.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: AbstractFormGroupDirective, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 44751const ɵAbstractFormGroupDirective_BaseFactory = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](AbstractFormGroupDirective); 44752/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AbstractFormGroupDirective, [{ 44753 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"] 44754 }], null, null); })(); 44755 44756/** 44757 * @license 44758 * Copyright Google LLC All Rights Reserved. 44759 * 44760 * Use of this source code is governed by an MIT-style license that can be 44761 * found in the LICENSE file at https://angular.io/license 44762 */ 44763class TemplateDrivenErrors { 44764 static modelParentException() { 44765 throw new Error(` 44766 ngModel cannot be used to register form controls with a parent formGroup directive. Try using 44767 formGroup's partner directive "formControlName" instead. Example: 44768 44769 ${FormErrorExamples.formControlName} 44770 44771 Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions: 44772 44773 Example: 44774 44775 ${FormErrorExamples.ngModelWithFormGroup}`); 44776 } 44777 static formGroupNameException() { 44778 throw new Error(` 44779 ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive. 44780 44781 Option 1: Use formControlName instead of ngModel (reactive strategy): 44782 44783 ${FormErrorExamples.formGroupName} 44784 44785 Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy): 44786 44787 ${FormErrorExamples.ngModelGroup}`); 44788 } 44789 static missingNameException() { 44790 throw new Error(`If ngModel is used within a form tag, either the name attribute must be set or the form 44791 control must be defined as 'standalone' in ngModelOptions. 44792 44793 Example 1: <input [(ngModel)]="person.firstName" name="first"> 44794 Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">`); 44795 } 44796 static modelGroupParentException() { 44797 throw new Error(` 44798 ngModelGroup cannot be used with a parent formGroup directive. 44799 44800 Option 1: Use formGroupName instead of ngModelGroup (reactive strategy): 44801 44802 ${FormErrorExamples.formGroupName} 44803 44804 Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy): 44805 44806 ${FormErrorExamples.ngModelGroup}`); 44807 } 44808} 44809 44810/** 44811 * @license 44812 * Copyright Google LLC All Rights Reserved. 44813 * 44814 * Use of this source code is governed by an MIT-style license that can be 44815 * found in the LICENSE file at https://angular.io/license 44816 */ 44817const modelGroupProvider = { 44818 provide: ControlContainer, 44819 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => NgModelGroup) 44820}; 44821/** 44822 * @description 44823 * Creates and binds a `FormGroup` instance to a DOM element. 44824 * 44825 * This directive can only be used as a child of `NgForm` (within `<form>` tags). 44826 * 44827 * Use this directive to validate a sub-group of your form separately from the 44828 * rest of your form, or if some values in your domain model make more sense 44829 * to consume together in a nested object. 44830 * 44831 * Provide a name for the sub-group and it will become the key 44832 * for the sub-group in the form's full value. If you need direct access, export the directive into 44833 * a local template variable using `ngModelGroup` (ex: `#myGroup="ngModelGroup"`). 44834 * 44835 * @usageNotes 44836 * 44837 * ### Consuming controls in a grouping 44838 * 44839 * The following example shows you how to combine controls together in a sub-group 44840 * of the form. 44841 * 44842 * {@example forms/ts/ngModelGroup/ng_model_group_example.ts region='Component'} 44843 * 44844 * @ngModule FormsModule 44845 * @publicApi 44846 */ 44847class NgModelGroup extends AbstractFormGroupDirective { 44848 constructor(parent, validators, asyncValidators) { 44849 super(); 44850 this._parent = parent; 44851 this._validators = validators; 44852 this._asyncValidators = asyncValidators; 44853 } 44854 /** @internal */ 44855 _checkParentType() { 44856 if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) { 44857 TemplateDrivenErrors.modelGroupParentException(); 44858 } 44859 } 44860} 44861NgModelGroup.ɵfac = function NgModelGroup_Factory(t) { return new (t || NgModelGroup)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ControlContainer, 5), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_ASYNC_VALIDATORS, 10)); }; 44862NgModelGroup.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgModelGroup, selectors: [["", "ngModelGroup", ""]], inputs: { name: ["ngModelGroup", "name"] }, exportAs: ["ngModelGroup"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([modelGroupProvider]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 44863NgModelGroup.ctorParameters = () => [ 44864 { type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] }] }, 44865 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALIDATORS,] }] }, 44866 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] } 44867]; 44868NgModelGroup.propDecorators = { 44869 name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngModelGroup',] }] 44870}; 44871/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgModelGroup, [{ 44872 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 44873 args: [{ selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup' }] 44874 }], function () { return [{ type: ControlContainer, decorators: [{ 44875 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 44876 }, { 44877 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] 44878 }] }, { type: Array, decorators: [{ 44879 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 44880 }, { 44881 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 44882 }, { 44883 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 44884 args: [NG_VALIDATORS] 44885 }] }, { type: Array, decorators: [{ 44886 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 44887 }, { 44888 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 44889 }, { 44890 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 44891 args: [NG_ASYNC_VALIDATORS] 44892 }] }]; }, { name: [{ 44893 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 44894 args: ['ngModelGroup'] 44895 }] }); })(); 44896 44897/** 44898 * @license 44899 * Copyright Google LLC All Rights Reserved. 44900 * 44901 * Use of this source code is governed by an MIT-style license that can be 44902 * found in the LICENSE file at https://angular.io/license 44903 */ 44904const formControlBinding = { 44905 provide: NgControl, 44906 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => NgModel) 44907}; 44908const ɵ0$1 = () => Promise.resolve(null); 44909/** 44910 * `ngModel` forces an additional change detection run when its inputs change: 44911 * E.g.: 44912 * ``` 44913 * <div>{{myModel.valid}}</div> 44914 * <input [(ngModel)]="myValue" #myModel="ngModel"> 44915 * ``` 44916 * I.e. `ngModel` can export itself on the element and then be used in the template. 44917 * Normally, this would result in expressions before the `input` that use the exported directive 44918 * to have and old value as they have been 44919 * dirty checked before. As this is a very common case for `ngModel`, we added this second change 44920 * detection run. 44921 * 44922 * Notes: 44923 * - this is just one extra run no matter how many `ngModel` have been changed. 44924 * - this is a general problem when using `exportAs` for directives! 44925 */ 44926const resolvedPromise$1 = (ɵ0$1)(); 44927/** 44928 * @description 44929 * Creates a `FormControl` instance from a domain model and binds it 44930 * to a form control element. 44931 * 44932 * The `FormControl` instance tracks the value, user interaction, and 44933 * validation status of the control and keeps the view synced with the model. If used 44934 * within a parent form, the directive also registers itself with the form as a child 44935 * control. 44936 * 44937 * This directive is used by itself or as part of a larger form. Use the 44938 * `ngModel` selector to activate it. 44939 * 44940 * It accepts a domain model as an optional `Input`. If you have a one-way binding 44941 * to `ngModel` with `[]` syntax, changing the value of the domain model in the component 44942 * class sets the value in the view. If you have a two-way binding with `[()]` syntax 44943 * (also known as 'banana-box syntax'), the value in the UI always syncs back to 44944 * the domain model in your class. 44945 * 44946 * To inspect the properties of the associated `FormControl` (like validity state), 44947 * export the directive into a local template variable using `ngModel` as the key (ex: 44948 * `#myVar="ngModel"`). You then access the control using the directive's `control` property, but 44949 * most properties used (like `valid` and `dirty`) fall through to the control anyway for direct 44950 * access. See a full list of properties directly available in `AbstractControlDirective`. 44951 * 44952 * @see `RadioControlValueAccessor` 44953 * @see `SelectControlValueAccessor` 44954 * 44955 * @usageNotes 44956 * 44957 * ### Using ngModel on a standalone control 44958 * 44959 * The following examples show a simple standalone control using `ngModel`: 44960 * 44961 * {@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'} 44962 * 44963 * When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute 44964 * so that the control can be registered with the parent form under that name. 44965 * 44966 * In the context of a parent form, it's often unnecessary to include one-way or two-way binding, 44967 * as the parent form syncs the value for you. You access its properties by exporting it into a 44968 * local template variable using `ngForm` such as (`#f="ngForm"`). Use the variable where 44969 * needed on form submission. 44970 * 44971 * If you do need to populate initial values into your form, using a one-way binding for 44972 * `ngModel` tends to be sufficient as long as you use the exported form's value rather 44973 * than the domain model's value on submit. 44974 * 44975 * ### Using ngModel within a form 44976 * 44977 * The following example shows controls using `ngModel` within a form: 44978 * 44979 * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'} 44980 * 44981 * ### Using a standalone ngModel within a group 44982 * 44983 * The following example shows you how to use a standalone ngModel control 44984 * within a form. This controls the display of the form, but doesn't contain form data. 44985 * 44986 * ```html 44987 * <form> 44988 * <input name="login" ngModel placeholder="Login"> 44989 * <input type="checkbox" ngModel [ngModelOptions]="{standalone: true}"> Show more options? 44990 * </form> 44991 * <!-- form value: {login: ''} --> 44992 * ``` 44993 * 44994 * ### Setting the ngModel name attribute through options 44995 * 44996 * The following example shows you an alternate way to set the name attribute. The name attribute is 44997 * used within a custom form component, and the name `@Input` property serves a different purpose. 44998 * 44999 * ```html 45000 * <form> 45001 * <my-person-control name="Nancy" ngModel [ngModelOptions]="{name: 'user'}"> 45002 * </my-person-control> 45003 * </form> 45004 * <!-- form value: {user: ''} --> 45005 * ``` 45006 * 45007 * @ngModule FormsModule 45008 * @publicApi 45009 */ 45010class NgModel extends NgControl { 45011 constructor(parent, validators, asyncValidators, valueAccessors) { 45012 super(); 45013 this.control = new FormControl(); 45014 /** @internal */ 45015 this._registered = false; 45016 /** 45017 * @description 45018 * Event emitter for producing the `ngModelChange` event after 45019 * the view model updates. 45020 */ 45021 this.update = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); 45022 this._parent = parent; 45023 this._rawValidators = validators || []; 45024 this._rawAsyncValidators = asyncValidators || []; 45025 this.valueAccessor = selectValueAccessor(this, valueAccessors); 45026 } 45027 /** 45028 * @description 45029 * A lifecycle method called when the directive's inputs change. For internal use 45030 * only. 45031 * 45032 * @param changes A object of key/value pairs for the set of changed inputs. 45033 */ 45034 ngOnChanges(changes) { 45035 this._checkForErrors(); 45036 if (!this._registered) 45037 this._setUpControl(); 45038 if ('isDisabled' in changes) { 45039 this._updateDisabled(changes); 45040 } 45041 if (isPropertyUpdated(changes, this.viewModel)) { 45042 this._updateValue(this.model); 45043 this.viewModel = this.model; 45044 } 45045 } 45046 /** 45047 * @description 45048 * Lifecycle method called before the directive's instance is destroyed. For internal 45049 * use only. 45050 */ 45051 ngOnDestroy() { 45052 this.formDirective && this.formDirective.removeControl(this); 45053 } 45054 /** 45055 * @description 45056 * Returns an array that represents the path from the top-level form to this control. 45057 * Each index is the string name of the control on that level. 45058 */ 45059 get path() { 45060 return this._parent ? controlPath(this.name, this._parent) : [this.name]; 45061 } 45062 /** 45063 * @description 45064 * The top-level directive for this control if present, otherwise null. 45065 */ 45066 get formDirective() { 45067 return this._parent ? this._parent.formDirective : null; 45068 } 45069 /** 45070 * @description 45071 * Synchronous validator function composed of all the synchronous validators 45072 * registered with this directive. 45073 */ 45074 get validator() { 45075 return composeValidators(this._rawValidators); 45076 } 45077 /** 45078 * @description 45079 * Async validator function composed of all the async validators registered with this 45080 * directive. 45081 */ 45082 get asyncValidator() { 45083 return composeAsyncValidators(this._rawAsyncValidators); 45084 } 45085 /** 45086 * @description 45087 * Sets the new value for the view model and emits an `ngModelChange` event. 45088 * 45089 * @param newValue The new value emitted by `ngModelChange`. 45090 */ 45091 viewToModelUpdate(newValue) { 45092 this.viewModel = newValue; 45093 this.update.emit(newValue); 45094 } 45095 _setUpControl() { 45096 this._setUpdateStrategy(); 45097 this._isStandalone() ? this._setUpStandalone() : this.formDirective.addControl(this); 45098 this._registered = true; 45099 } 45100 _setUpdateStrategy() { 45101 if (this.options && this.options.updateOn != null) { 45102 this.control._updateOn = this.options.updateOn; 45103 } 45104 } 45105 _isStandalone() { 45106 return !this._parent || !!(this.options && this.options.standalone); 45107 } 45108 _setUpStandalone() { 45109 setUpControl(this.control, this); 45110 this.control.updateValueAndValidity({ emitEvent: false }); 45111 } 45112 _checkForErrors() { 45113 if (!this._isStandalone()) { 45114 this._checkParentType(); 45115 } 45116 this._checkName(); 45117 } 45118 _checkParentType() { 45119 if (!(this._parent instanceof NgModelGroup) && 45120 this._parent instanceof AbstractFormGroupDirective) { 45121 TemplateDrivenErrors.formGroupNameException(); 45122 } 45123 else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) { 45124 TemplateDrivenErrors.modelParentException(); 45125 } 45126 } 45127 _checkName() { 45128 if (this.options && this.options.name) 45129 this.name = this.options.name; 45130 if (!this._isStandalone() && !this.name) { 45131 TemplateDrivenErrors.missingNameException(); 45132 } 45133 } 45134 _updateValue(value) { 45135 resolvedPromise$1.then(() => { 45136 this.control.setValue(value, { emitViewToModelChange: false }); 45137 }); 45138 } 45139 _updateDisabled(changes) { 45140 const disabledValue = changes['isDisabled'].currentValue; 45141 const isDisabled = disabledValue === '' || (disabledValue && disabledValue !== 'false'); 45142 resolvedPromise$1.then(() => { 45143 if (isDisabled && !this.control.disabled) { 45144 this.control.disable(); 45145 } 45146 else if (!isDisabled && this.control.disabled) { 45147 this.control.enable(); 45148 } 45149 }); 45150 } 45151} 45152NgModel.ɵfac = function NgModel_Factory(t) { return new (t || NgModel)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ControlContainer, 9), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_ASYNC_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALUE_ACCESSOR, 10)); }; 45153NgModel.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgModel, selectors: [["", "ngModel", "", 3, "formControlName", "", 3, "formControl", ""]], inputs: { name: "name", isDisabled: ["disabled", "isDisabled"], model: ["ngModel", "model"], options: ["ngModelOptions", "options"] }, outputs: { update: "ngModelChange" }, exportAs: ["ngModel"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([formControlBinding]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 45154NgModel.ctorParameters = () => [ 45155 { type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] }, 45156 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALIDATORS,] }] }, 45157 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] }, 45158 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALUE_ACCESSOR,] }] } 45159]; 45160NgModel.propDecorators = { 45161 name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], 45162 isDisabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['disabled',] }], 45163 model: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngModel',] }], 45164 options: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngModelOptions',] }], 45165 update: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['ngModelChange',] }] 45166}; 45167/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgModel, [{ 45168 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 45169 args: [{ 45170 selector: '[ngModel]:not([formControlName]):not([formControl])', 45171 providers: [formControlBinding], 45172 exportAs: 'ngModel' 45173 }] 45174 }], function () { return [{ type: ControlContainer, decorators: [{ 45175 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45176 }, { 45177 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 45178 }] }, { type: Array, decorators: [{ 45179 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45180 }, { 45181 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45182 }, { 45183 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45184 args: [NG_VALIDATORS] 45185 }] }, { type: Array, decorators: [{ 45186 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45187 }, { 45188 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45189 }, { 45190 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45191 args: [NG_ASYNC_VALIDATORS] 45192 }] }, { type: Array, decorators: [{ 45193 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45194 }, { 45195 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45196 }, { 45197 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45198 args: [NG_VALUE_ACCESSOR] 45199 }] }]; }, { update: [{ 45200 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], 45201 args: ['ngModelChange'] 45202 }], name: [{ 45203 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 45204 }], isDisabled: [{ 45205 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45206 args: ['disabled'] 45207 }], model: [{ 45208 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45209 args: ['ngModel'] 45210 }], options: [{ 45211 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45212 args: ['ngModelOptions'] 45213 }] }); })(); 45214 45215/** 45216 * @license 45217 * Copyright Google LLC All Rights Reserved. 45218 * 45219 * Use of this source code is governed by an MIT-style license that can be 45220 * found in the LICENSE file at https://angular.io/license 45221 */ 45222/** 45223 * @description 45224 * 45225 * Adds `novalidate` attribute to all forms by default. 45226 * 45227 * `novalidate` is used to disable browser's native form validation. 45228 * 45229 * If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute: 45230 * 45231 * ``` 45232 * <form ngNativeValidate></form> 45233 * ``` 45234 * 45235 * @publicApi 45236 * @ngModule ReactiveFormsModule 45237 * @ngModule FormsModule 45238 */ 45239class ɵNgNoValidate { 45240} 45241ɵNgNoValidate.ɵfac = function ɵNgNoValidate_Factory(t) { return new (t || ɵNgNoValidate)(); }; 45242ɵNgNoValidate.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: ɵNgNoValidate, selectors: [["form", 3, "ngNoForm", "", 3, "ngNativeValidate", ""]], hostAttrs: ["novalidate", ""] }); 45243/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ɵNgNoValidate, [{ 45244 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 45245 args: [{ 45246 selector: 'form:not([ngNoForm]):not([ngNativeValidate])', 45247 host: { 'novalidate': '' } 45248 }] 45249 }], null, null); })(); 45250 45251/** 45252 * @license 45253 * Copyright Google LLC All Rights Reserved. 45254 * 45255 * Use of this source code is governed by an MIT-style license that can be 45256 * found in the LICENSE file at https://angular.io/license 45257 */ 45258/** 45259 * Token to provide to turn off the ngModel warning on formControl and formControlName. 45260 */ 45261const NG_MODEL_WITH_FORM_CONTROL_WARNING = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('NgModelWithFormControlWarning'); 45262const formControlBinding$1 = { 45263 provide: NgControl, 45264 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => FormControlDirective) 45265}; 45266/** 45267 * @description 45268 * Synchronizes a standalone `FormControl` instance to a form control element. 45269 * 45270 * Note that support for using the `ngModel` input property and `ngModelChange` event with reactive 45271 * form directives was deprecated in Angular v6 and is scheduled for removal in 45272 * a future version of Angular. 45273 * For details, see [Deprecated features](guide/deprecations#ngmodel-with-reactive-forms). 45274 * 45275 * @see [Reactive Forms Guide](guide/reactive-forms) 45276 * @see `FormControl` 45277 * @see `AbstractControl` 45278 * 45279 * @usageNotes 45280 * 45281 * The following example shows how to register a standalone control and set its value. 45282 * 45283 * {@example forms/ts/simpleFormControl/simple_form_control_example.ts region='Component'} 45284 * 45285 * @ngModule ReactiveFormsModule 45286 * @publicApi 45287 */ 45288class FormControlDirective extends NgControl { 45289 constructor(validators, asyncValidators, valueAccessors, _ngModelWarningConfig) { 45290 super(); 45291 this._ngModelWarningConfig = _ngModelWarningConfig; 45292 /** @deprecated as of v6 */ 45293 this.update = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); 45294 /** 45295 * @description 45296 * Instance property used to track whether an ngModel warning has been sent out for this 45297 * particular `FormControlDirective` instance. Used to support warning config of "always". 45298 * 45299 * @internal 45300 */ 45301 this._ngModelWarningSent = false; 45302 this._rawValidators = validators || []; 45303 this._rawAsyncValidators = asyncValidators || []; 45304 this.valueAccessor = selectValueAccessor(this, valueAccessors); 45305 } 45306 /** 45307 * @description 45308 * Triggers a warning that this input should not be used with reactive forms. 45309 */ 45310 set isDisabled(isDisabled) { 45311 ReactiveErrors.disabledAttrWarning(); 45312 } 45313 /** 45314 * @description 45315 * A lifecycle method called when the directive's inputs change. For internal use 45316 * only. 45317 * 45318 * @param changes A object of key/value pairs for the set of changed inputs. 45319 */ 45320 ngOnChanges(changes) { 45321 if (this._isControlChanged(changes)) { 45322 setUpControl(this.form, this); 45323 if (this.control.disabled && this.valueAccessor.setDisabledState) { 45324 this.valueAccessor.setDisabledState(true); 45325 } 45326 this.form.updateValueAndValidity({ emitEvent: false }); 45327 } 45328 if (isPropertyUpdated(changes, this.viewModel)) { 45329 _ngModelWarning('formControl', FormControlDirective, this, this._ngModelWarningConfig); 45330 this.form.setValue(this.model); 45331 this.viewModel = this.model; 45332 } 45333 } 45334 /** 45335 * @description 45336 * Returns an array that represents the path from the top-level form to this control. 45337 * Each index is the string name of the control on that level. 45338 */ 45339 get path() { 45340 return []; 45341 } 45342 /** 45343 * @description 45344 * Synchronous validator function composed of all the synchronous validators 45345 * registered with this directive. 45346 */ 45347 get validator() { 45348 return composeValidators(this._rawValidators); 45349 } 45350 /** 45351 * @description 45352 * Async validator function composed of all the async validators registered with this 45353 * directive. 45354 */ 45355 get asyncValidator() { 45356 return composeAsyncValidators(this._rawAsyncValidators); 45357 } 45358 /** 45359 * @description 45360 * The `FormControl` bound to this directive. 45361 */ 45362 get control() { 45363 return this.form; 45364 } 45365 /** 45366 * @description 45367 * Sets the new value for the view model and emits an `ngModelChange` event. 45368 * 45369 * @param newValue The new value for the view model. 45370 */ 45371 viewToModelUpdate(newValue) { 45372 this.viewModel = newValue; 45373 this.update.emit(newValue); 45374 } 45375 _isControlChanged(changes) { 45376 return changes.hasOwnProperty('form'); 45377 } 45378} 45379FormControlDirective.ɵfac = function FormControlDirective_Factory(t) { return new (t || FormControlDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_ASYNC_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALUE_ACCESSOR, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_MODEL_WITH_FORM_CONTROL_WARNING, 8)); }; 45380FormControlDirective.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: FormControlDirective, selectors: [["", "formControl", ""]], inputs: { isDisabled: ["disabled", "isDisabled"], form: ["formControl", "form"], model: ["ngModel", "model"] }, outputs: { update: "ngModelChange" }, exportAs: ["ngForm"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([formControlBinding$1]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 45381/** 45382 * @description 45383 * Static property used to track whether any ngModel warnings have been sent across 45384 * all instances of FormControlDirective. Used to support warning config of "once". 45385 * 45386 * @internal 45387 */ 45388FormControlDirective._ngModelWarningSentOnce = false; 45389FormControlDirective.ctorParameters = () => [ 45390 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALIDATORS,] }] }, 45391 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] }, 45392 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALUE_ACCESSOR,] }] }, 45393 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_MODEL_WITH_FORM_CONTROL_WARNING,] }] } 45394]; 45395FormControlDirective.propDecorators = { 45396 form: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['formControl',] }], 45397 isDisabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['disabled',] }], 45398 model: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngModel',] }], 45399 update: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['ngModelChange',] }] 45400}; 45401/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FormControlDirective, [{ 45402 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 45403 args: [{ selector: '[formControl]', providers: [formControlBinding$1], exportAs: 'ngForm' }] 45404 }], function () { return [{ type: Array, decorators: [{ 45405 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45406 }, { 45407 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45408 }, { 45409 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45410 args: [NG_VALIDATORS] 45411 }] }, { type: Array, decorators: [{ 45412 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45413 }, { 45414 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45415 }, { 45416 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45417 args: [NG_ASYNC_VALIDATORS] 45418 }] }, { type: Array, decorators: [{ 45419 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45420 }, { 45421 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45422 }, { 45423 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45424 args: [NG_VALUE_ACCESSOR] 45425 }] }, { type: String, decorators: [{ 45426 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45427 }, { 45428 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45429 args: [NG_MODEL_WITH_FORM_CONTROL_WARNING] 45430 }] }]; }, { update: [{ 45431 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], 45432 args: ['ngModelChange'] 45433 }], isDisabled: [{ 45434 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45435 args: ['disabled'] 45436 }], form: [{ 45437 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45438 args: ['formControl'] 45439 }], model: [{ 45440 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45441 args: ['ngModel'] 45442 }] }); })(); 45443 45444/** 45445 * @license 45446 * Copyright Google LLC All Rights Reserved. 45447 * 45448 * Use of this source code is governed by an MIT-style license that can be 45449 * found in the LICENSE file at https://angular.io/license 45450 */ 45451const formDirectiveProvider$1 = { 45452 provide: ControlContainer, 45453 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => FormGroupDirective) 45454}; 45455/** 45456 * @description 45457 * 45458 * Binds an existing `FormGroup` to a DOM element. 45459 * 45460 * This directive accepts an existing `FormGroup` instance. It will then use this 45461 * `FormGroup` instance to match any child `FormControl`, `FormGroup`, 45462 * and `FormArray` instances to child `FormControlName`, `FormGroupName`, 45463 * and `FormArrayName` directives. 45464 * 45465 * @see [Reactive Forms Guide](guide/reactive-forms) 45466 * @see `AbstractControl` 45467 * 45468 * ### Register Form Group 45469 * 45470 * The following example registers a `FormGroup` with first name and last name controls, 45471 * and listens for the *ngSubmit* event when the button is clicked. 45472 * 45473 * {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'} 45474 * 45475 * @ngModule ReactiveFormsModule 45476 * @publicApi 45477 */ 45478class FormGroupDirective extends ControlContainer { 45479 constructor(_validators, _asyncValidators) { 45480 super(); 45481 this._validators = _validators; 45482 this._asyncValidators = _asyncValidators; 45483 /** 45484 * @description 45485 * Reports whether the form submission has been triggered. 45486 */ 45487 this.submitted = false; 45488 /** 45489 * @description 45490 * Tracks the list of added `FormControlName` instances 45491 */ 45492 this.directives = []; 45493 /** 45494 * @description 45495 * Tracks the `FormGroup` bound to this directive. 45496 */ 45497 this.form = null; 45498 /** 45499 * @description 45500 * Emits an event when the form submission has been triggered. 45501 */ 45502 this.ngSubmit = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); 45503 } 45504 /** 45505 * @description 45506 * A lifecycle method called when the directive's inputs change. For internal use only. 45507 * 45508 * @param changes A object of key/value pairs for the set of changed inputs. 45509 */ 45510 ngOnChanges(changes) { 45511 this._checkFormPresent(); 45512 if (changes.hasOwnProperty('form')) { 45513 this._updateValidators(); 45514 this._updateDomValue(); 45515 this._updateRegistrations(); 45516 } 45517 } 45518 /** 45519 * @description 45520 * Returns this directive's instance. 45521 */ 45522 get formDirective() { 45523 return this; 45524 } 45525 /** 45526 * @description 45527 * Returns the `FormGroup` bound to this directive. 45528 */ 45529 get control() { 45530 return this.form; 45531 } 45532 /** 45533 * @description 45534 * Returns an array representing the path to this group. Because this directive 45535 * always lives at the top level of a form, it always an empty array. 45536 */ 45537 get path() { 45538 return []; 45539 } 45540 /** 45541 * @description 45542 * Method that sets up the control directive in this group, re-calculates its value 45543 * and validity, and adds the instance to the internal list of directives. 45544 * 45545 * @param dir The `FormControlName` directive instance. 45546 */ 45547 addControl(dir) { 45548 const ctrl = this.form.get(dir.path); 45549 setUpControl(ctrl, dir); 45550 ctrl.updateValueAndValidity({ emitEvent: false }); 45551 this.directives.push(dir); 45552 return ctrl; 45553 } 45554 /** 45555 * @description 45556 * Retrieves the `FormControl` instance from the provided `FormControlName` directive 45557 * 45558 * @param dir The `FormControlName` directive instance. 45559 */ 45560 getControl(dir) { 45561 return this.form.get(dir.path); 45562 } 45563 /** 45564 * @description 45565 * Removes the `FormControlName` instance from the internal list of directives 45566 * 45567 * @param dir The `FormControlName` directive instance. 45568 */ 45569 removeControl(dir) { 45570 removeDir(this.directives, dir); 45571 } 45572 /** 45573 * Adds a new `FormGroupName` directive instance to the form. 45574 * 45575 * @param dir The `FormGroupName` directive instance. 45576 */ 45577 addFormGroup(dir) { 45578 const ctrl = this.form.get(dir.path); 45579 setUpFormContainer(ctrl, dir); 45580 ctrl.updateValueAndValidity({ emitEvent: false }); 45581 } 45582 /** 45583 * No-op method to remove the form group. 45584 * 45585 * @param dir The `FormGroupName` directive instance. 45586 */ 45587 removeFormGroup(dir) { } 45588 /** 45589 * @description 45590 * Retrieves the `FormGroup` for a provided `FormGroupName` directive instance 45591 * 45592 * @param dir The `FormGroupName` directive instance. 45593 */ 45594 getFormGroup(dir) { 45595 return this.form.get(dir.path); 45596 } 45597 /** 45598 * Adds a new `FormArrayName` directive instance to the form. 45599 * 45600 * @param dir The `FormArrayName` directive instance. 45601 */ 45602 addFormArray(dir) { 45603 const ctrl = this.form.get(dir.path); 45604 setUpFormContainer(ctrl, dir); 45605 ctrl.updateValueAndValidity({ emitEvent: false }); 45606 } 45607 /** 45608 * No-op method to remove the form array. 45609 * 45610 * @param dir The `FormArrayName` directive instance. 45611 */ 45612 removeFormArray(dir) { } 45613 /** 45614 * @description 45615 * Retrieves the `FormArray` for a provided `FormArrayName` directive instance. 45616 * 45617 * @param dir The `FormArrayName` directive instance. 45618 */ 45619 getFormArray(dir) { 45620 return this.form.get(dir.path); 45621 } 45622 /** 45623 * Sets the new value for the provided `FormControlName` directive. 45624 * 45625 * @param dir The `FormControlName` directive instance. 45626 * @param value The new value for the directive's control. 45627 */ 45628 updateModel(dir, value) { 45629 const ctrl = this.form.get(dir.path); 45630 ctrl.setValue(value); 45631 } 45632 /** 45633 * @description 45634 * Method called with the "submit" event is triggered on the form. 45635 * Triggers the `ngSubmit` emitter to emit the "submit" event as its payload. 45636 * 45637 * @param $event The "submit" event object 45638 */ 45639 onSubmit($event) { 45640 this.submitted = true; 45641 syncPendingControls(this.form, this.directives); 45642 this.ngSubmit.emit($event); 45643 return false; 45644 } 45645 /** 45646 * @description 45647 * Method called when the "reset" event is triggered on the form. 45648 */ 45649 onReset() { 45650 this.resetForm(); 45651 } 45652 /** 45653 * @description 45654 * Resets the form to an initial value and resets its submitted status. 45655 * 45656 * @param value The new value for the form. 45657 */ 45658 resetForm(value = undefined) { 45659 this.form.reset(value); 45660 this.submitted = false; 45661 } 45662 /** @internal */ 45663 _updateDomValue() { 45664 this.directives.forEach(dir => { 45665 const newCtrl = this.form.get(dir.path); 45666 if (dir.control !== newCtrl) { 45667 cleanUpControl(dir.control, dir); 45668 if (newCtrl) 45669 setUpControl(newCtrl, dir); 45670 dir.control = newCtrl; 45671 } 45672 }); 45673 this.form._updateTreeValidity({ emitEvent: false }); 45674 } 45675 _updateRegistrations() { 45676 this.form._registerOnCollectionChange(() => this._updateDomValue()); 45677 if (this._oldForm) 45678 this._oldForm._registerOnCollectionChange(() => { }); 45679 this._oldForm = this.form; 45680 } 45681 _updateValidators() { 45682 const sync = composeValidators(this._validators); 45683 this.form.validator = Validators.compose([this.form.validator, sync]); 45684 const async = composeAsyncValidators(this._asyncValidators); 45685 this.form.asyncValidator = Validators.composeAsync([this.form.asyncValidator, async]); 45686 } 45687 _checkFormPresent() { 45688 if (!this.form) { 45689 ReactiveErrors.missingFormException(); 45690 } 45691 } 45692} 45693FormGroupDirective.ɵfac = function FormGroupDirective_Factory(t) { return new (t || FormGroupDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_ASYNC_VALIDATORS, 10)); }; 45694FormGroupDirective.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: FormGroupDirective, selectors: [["", "formGroup", ""]], hostBindings: function FormGroupDirective_HostBindings(rf, ctx) { if (rf & 1) { 45695 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("submit", function FormGroupDirective_submit_HostBindingHandler($event) { return ctx.onSubmit($event); })("reset", function FormGroupDirective_reset_HostBindingHandler() { return ctx.onReset(); }); 45696 } }, inputs: { form: ["formGroup", "form"] }, outputs: { ngSubmit: "ngSubmit" }, exportAs: ["ngForm"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([formDirectiveProvider$1]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 45697FormGroupDirective.ctorParameters = () => [ 45698 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALIDATORS,] }] }, 45699 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] } 45700]; 45701FormGroupDirective.propDecorators = { 45702 form: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['formGroup',] }], 45703 ngSubmit: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] }] 45704}; 45705/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FormGroupDirective, [{ 45706 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 45707 args: [{ 45708 selector: '[formGroup]', 45709 providers: [formDirectiveProvider$1], 45710 host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' }, 45711 exportAs: 'ngForm' 45712 }] 45713 }], function () { return [{ type: Array, decorators: [{ 45714 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45715 }, { 45716 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45717 }, { 45718 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45719 args: [NG_VALIDATORS] 45720 }] }, { type: Array, decorators: [{ 45721 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45722 }, { 45723 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45724 }, { 45725 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45726 args: [NG_ASYNC_VALIDATORS] 45727 }] }]; }, { form: [{ 45728 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45729 args: ['formGroup'] 45730 }], ngSubmit: [{ 45731 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] 45732 }] }); })(); 45733 45734/** 45735 * @license 45736 * Copyright Google LLC All Rights Reserved. 45737 * 45738 * Use of this source code is governed by an MIT-style license that can be 45739 * found in the LICENSE file at https://angular.io/license 45740 */ 45741const formGroupNameProvider = { 45742 provide: ControlContainer, 45743 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => FormGroupName) 45744}; 45745/** 45746 * @description 45747 * 45748 * Syncs a nested `FormGroup` to a DOM element. 45749 * 45750 * This directive can only be used with a parent `FormGroupDirective`. 45751 * 45752 * It accepts the string name of the nested `FormGroup` to link, and 45753 * looks for a `FormGroup` registered with that name in the parent 45754 * `FormGroup` instance you passed into `FormGroupDirective`. 45755 * 45756 * Use nested form groups to validate a sub-group of a 45757 * form separately from the rest or to group the values of certain 45758 * controls into their own nested object. 45759 * 45760 * @see [Reactive Forms Guide](guide/reactive-forms) 45761 * 45762 * @usageNotes 45763 * 45764 * ### Access the group by name 45765 * 45766 * The following example uses the {@link AbstractControl#get get} method to access the 45767 * associated `FormGroup` 45768 * 45769 * ```ts 45770 * this.form.get('name'); 45771 * ``` 45772 * 45773 * ### Access individual controls in the group 45774 * 45775 * The following example uses the {@link AbstractControl#get get} method to access 45776 * individual controls within the group using dot syntax. 45777 * 45778 * ```ts 45779 * this.form.get('name.first'); 45780 * ``` 45781 * 45782 * ### Register a nested `FormGroup`. 45783 * 45784 * The following example registers a nested *name* `FormGroup` within an existing `FormGroup`, 45785 * and provides methods to retrieve the nested `FormGroup` and individual controls. 45786 * 45787 * {@example forms/ts/nestedFormGroup/nested_form_group_example.ts region='Component'} 45788 * 45789 * @ngModule ReactiveFormsModule 45790 * @publicApi 45791 */ 45792class FormGroupName extends AbstractFormGroupDirective { 45793 constructor(parent, validators, asyncValidators) { 45794 super(); 45795 this._parent = parent; 45796 this._validators = validators; 45797 this._asyncValidators = asyncValidators; 45798 } 45799 /** @internal */ 45800 _checkParentType() { 45801 if (_hasInvalidParent(this._parent)) { 45802 ReactiveErrors.groupParentException(); 45803 } 45804 } 45805} 45806FormGroupName.ɵfac = function FormGroupName_Factory(t) { return new (t || FormGroupName)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ControlContainer, 13), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_ASYNC_VALIDATORS, 10)); }; 45807FormGroupName.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: FormGroupName, selectors: [["", "formGroupName", ""]], inputs: { name: ["formGroupName", "name"] }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([formGroupNameProvider]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 45808FormGroupName.ctorParameters = () => [ 45809 { type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] }] }, 45810 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALIDATORS,] }] }, 45811 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] } 45812]; 45813FormGroupName.propDecorators = { 45814 name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['formGroupName',] }] 45815}; 45816/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FormGroupName, [{ 45817 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 45818 args: [{ selector: '[formGroupName]', providers: [formGroupNameProvider] }] 45819 }], function () { return [{ type: ControlContainer, decorators: [{ 45820 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45821 }, { 45822 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 45823 }, { 45824 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] 45825 }] }, { type: Array, decorators: [{ 45826 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45827 }, { 45828 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45829 }, { 45830 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45831 args: [NG_VALIDATORS] 45832 }] }, { type: Array, decorators: [{ 45833 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45834 }, { 45835 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45836 }, { 45837 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45838 args: [NG_ASYNC_VALIDATORS] 45839 }] }]; }, { name: [{ 45840 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45841 args: ['formGroupName'] 45842 }] }); })(); 45843const formArrayNameProvider = { 45844 provide: ControlContainer, 45845 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => FormArrayName) 45846}; 45847/** 45848 * @description 45849 * 45850 * Syncs a nested `FormArray` to a DOM element. 45851 * 45852 * This directive is designed to be used with a parent `FormGroupDirective` (selector: 45853 * `[formGroup]`). 45854 * 45855 * It accepts the string name of the nested `FormArray` you want to link, and 45856 * will look for a `FormArray` registered with that name in the parent 45857 * `FormGroup` instance you passed into `FormGroupDirective`. 45858 * 45859 * @see [Reactive Forms Guide](guide/reactive-forms) 45860 * @see `AbstractControl` 45861 * 45862 * @usageNotes 45863 * 45864 * ### Example 45865 * 45866 * {@example forms/ts/nestedFormArray/nested_form_array_example.ts region='Component'} 45867 * 45868 * @ngModule ReactiveFormsModule 45869 * @publicApi 45870 */ 45871class FormArrayName extends ControlContainer { 45872 constructor(parent, validators, asyncValidators) { 45873 super(); 45874 this._parent = parent; 45875 this._validators = validators; 45876 this._asyncValidators = asyncValidators; 45877 } 45878 /** 45879 * @description 45880 * A lifecycle method called when the directive's inputs are initialized. For internal use only. 45881 * 45882 * @throws If the directive does not have a valid parent. 45883 */ 45884 ngOnInit() { 45885 this._checkParentType(); 45886 this.formDirective.addFormArray(this); 45887 } 45888 /** 45889 * @description 45890 * A lifecycle method called before the directive's instance is destroyed. For internal use only. 45891 */ 45892 ngOnDestroy() { 45893 if (this.formDirective) { 45894 this.formDirective.removeFormArray(this); 45895 } 45896 } 45897 /** 45898 * @description 45899 * The `FormArray` bound to this directive. 45900 */ 45901 get control() { 45902 return this.formDirective.getFormArray(this); 45903 } 45904 /** 45905 * @description 45906 * The top-level directive for this group if present, otherwise null. 45907 */ 45908 get formDirective() { 45909 return this._parent ? this._parent.formDirective : null; 45910 } 45911 /** 45912 * @description 45913 * Returns an array that represents the path from the top-level form to this control. 45914 * Each index is the string name of the control on that level. 45915 */ 45916 get path() { 45917 return controlPath(this.name == null ? this.name : this.name.toString(), this._parent); 45918 } 45919 /** 45920 * @description 45921 * Synchronous validator function composed of all the synchronous validators registered with this 45922 * directive. 45923 */ 45924 get validator() { 45925 return composeValidators(this._validators); 45926 } 45927 /** 45928 * @description 45929 * Async validator function composed of all the async validators registered with this directive. 45930 */ 45931 get asyncValidator() { 45932 return composeAsyncValidators(this._asyncValidators); 45933 } 45934 _checkParentType() { 45935 if (_hasInvalidParent(this._parent)) { 45936 ReactiveErrors.arrayParentException(); 45937 } 45938 } 45939} 45940FormArrayName.ɵfac = function FormArrayName_Factory(t) { return new (t || FormArrayName)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ControlContainer, 13), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_ASYNC_VALIDATORS, 10)); }; 45941FormArrayName.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: FormArrayName, selectors: [["", "formArrayName", ""]], inputs: { name: ["formArrayName", "name"] }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([formArrayNameProvider]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 45942FormArrayName.ctorParameters = () => [ 45943 { type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] }] }, 45944 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALIDATORS,] }] }, 45945 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] } 45946]; 45947FormArrayName.propDecorators = { 45948 name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['formArrayName',] }] 45949}; 45950/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FormArrayName, [{ 45951 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 45952 args: [{ selector: '[formArrayName]', providers: [formArrayNameProvider] }] 45953 }], function () { return [{ type: ControlContainer, decorators: [{ 45954 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45955 }, { 45956 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 45957 }, { 45958 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] 45959 }] }, { type: Array, decorators: [{ 45960 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45961 }, { 45962 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45963 }, { 45964 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45965 args: [NG_VALIDATORS] 45966 }] }, { type: Array, decorators: [{ 45967 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 45968 }, { 45969 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 45970 }, { 45971 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 45972 args: [NG_ASYNC_VALIDATORS] 45973 }] }]; }, { name: [{ 45974 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 45975 args: ['formArrayName'] 45976 }] }); })(); 45977function _hasInvalidParent(parent) { 45978 return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) && 45979 !(parent instanceof FormArrayName); 45980} 45981 45982/** 45983 * @license 45984 * Copyright Google LLC All Rights Reserved. 45985 * 45986 * Use of this source code is governed by an MIT-style license that can be 45987 * found in the LICENSE file at https://angular.io/license 45988 */ 45989const controlNameBinding = { 45990 provide: NgControl, 45991 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => FormControlName) 45992}; 45993/** 45994 * @description 45995 * Syncs a `FormControl` in an existing `FormGroup` to a form control 45996 * element by name. 45997 * 45998 * @see [Reactive Forms Guide](guide/reactive-forms) 45999 * @see `FormControl` 46000 * @see `AbstractControl` 46001 * 46002 * @usageNotes 46003 * 46004 * ### Register `FormControl` within a group 46005 * 46006 * The following example shows how to register multiple form controls within a form group 46007 * and set their value. 46008 * 46009 * {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'} 46010 * 46011 * To see `formControlName` examples with different form control types, see: 46012 * 46013 * * Radio buttons: `RadioControlValueAccessor` 46014 * * Selects: `SelectControlValueAccessor` 46015 * 46016 * ### Use with ngModel is deprecated 46017 * 46018 * Support for using the `ngModel` input property and `ngModelChange` event with reactive 46019 * form directives has been deprecated in Angular v6 and is scheduled for removal in 46020 * a future version of Angular. 46021 * 46022 * For details, see [Deprecated features](guide/deprecations#ngmodel-with-reactive-forms). 46023 * 46024 * @ngModule ReactiveFormsModule 46025 * @publicApi 46026 */ 46027class FormControlName extends NgControl { 46028 constructor(parent, validators, asyncValidators, valueAccessors, _ngModelWarningConfig) { 46029 super(); 46030 this._ngModelWarningConfig = _ngModelWarningConfig; 46031 this._added = false; 46032 /** @deprecated as of v6 */ 46033 this.update = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); 46034 /** 46035 * @description 46036 * Instance property used to track whether an ngModel warning has been sent out for this 46037 * particular FormControlName instance. Used to support warning config of "always". 46038 * 46039 * @internal 46040 */ 46041 this._ngModelWarningSent = false; 46042 this._parent = parent; 46043 this._rawValidators = validators || []; 46044 this._rawAsyncValidators = asyncValidators || []; 46045 this.valueAccessor = selectValueAccessor(this, valueAccessors); 46046 } 46047 /** 46048 * @description 46049 * Triggers a warning that this input should not be used with reactive forms. 46050 */ 46051 set isDisabled(isDisabled) { 46052 ReactiveErrors.disabledAttrWarning(); 46053 } 46054 /** 46055 * @description 46056 * A lifecycle method called when the directive's inputs change. For internal use only. 46057 * 46058 * @param changes A object of key/value pairs for the set of changed inputs. 46059 */ 46060 ngOnChanges(changes) { 46061 if (!this._added) 46062 this._setUpControl(); 46063 if (isPropertyUpdated(changes, this.viewModel)) { 46064 _ngModelWarning('formControlName', FormControlName, this, this._ngModelWarningConfig); 46065 this.viewModel = this.model; 46066 this.formDirective.updateModel(this, this.model); 46067 } 46068 } 46069 /** 46070 * @description 46071 * Lifecycle method called before the directive's instance is destroyed. For internal use only. 46072 */ 46073 ngOnDestroy() { 46074 if (this.formDirective) { 46075 this.formDirective.removeControl(this); 46076 } 46077 } 46078 /** 46079 * @description 46080 * Sets the new value for the view model and emits an `ngModelChange` event. 46081 * 46082 * @param newValue The new value for the view model. 46083 */ 46084 viewToModelUpdate(newValue) { 46085 this.viewModel = newValue; 46086 this.update.emit(newValue); 46087 } 46088 /** 46089 * @description 46090 * Returns an array that represents the path from the top-level form to this control. 46091 * Each index is the string name of the control on that level. 46092 */ 46093 get path() { 46094 return controlPath(this.name == null ? this.name : this.name.toString(), this._parent); 46095 } 46096 /** 46097 * @description 46098 * The top-level directive for this group if present, otherwise null. 46099 */ 46100 get formDirective() { 46101 return this._parent ? this._parent.formDirective : null; 46102 } 46103 /** 46104 * @description 46105 * Synchronous validator function composed of all the synchronous validators 46106 * registered with this directive. 46107 */ 46108 get validator() { 46109 return composeValidators(this._rawValidators); 46110 } 46111 /** 46112 * @description 46113 * Async validator function composed of all the async validators registered with this 46114 * directive. 46115 */ 46116 get asyncValidator() { 46117 return composeAsyncValidators(this._rawAsyncValidators); 46118 } 46119 _checkParentType() { 46120 if (!(this._parent instanceof FormGroupName) && 46121 this._parent instanceof AbstractFormGroupDirective) { 46122 ReactiveErrors.ngModelGroupException(); 46123 } 46124 else if (!(this._parent instanceof FormGroupName) && !(this._parent instanceof FormGroupDirective) && 46125 !(this._parent instanceof FormArrayName)) { 46126 ReactiveErrors.controlParentException(); 46127 } 46128 } 46129 _setUpControl() { 46130 this._checkParentType(); 46131 this.control = this.formDirective.addControl(this); 46132 if (this.control.disabled && this.valueAccessor.setDisabledState) { 46133 this.valueAccessor.setDisabledState(true); 46134 } 46135 this._added = true; 46136 } 46137} 46138FormControlName.ɵfac = function FormControlName_Factory(t) { return new (t || FormControlName)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ControlContainer, 13), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_ASYNC_VALIDATORS, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_VALUE_ACCESSOR, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NG_MODEL_WITH_FORM_CONTROL_WARNING, 8)); }; 46139FormControlName.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: FormControlName, selectors: [["", "formControlName", ""]], inputs: { isDisabled: ["disabled", "isDisabled"], name: ["formControlName", "name"], model: ["ngModel", "model"] }, outputs: { update: "ngModelChange" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([controlNameBinding]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 46140/** 46141 * @description 46142 * Static property used to track whether any ngModel warnings have been sent across 46143 * all instances of FormControlName. Used to support warning config of "once". 46144 * 46145 * @internal 46146 */ 46147FormControlName._ngModelWarningSentOnce = false; 46148FormControlName.ctorParameters = () => [ 46149 { type: ControlContainer, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] }] }, 46150 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALIDATORS,] }] }, 46151 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_ASYNC_VALIDATORS,] }] }, 46152 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_VALUE_ACCESSOR,] }] }, 46153 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [NG_MODEL_WITH_FORM_CONTROL_WARNING,] }] } 46154]; 46155FormControlName.propDecorators = { 46156 name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['formControlName',] }], 46157 isDisabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['disabled',] }], 46158 model: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngModel',] }], 46159 update: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], args: ['ngModelChange',] }] 46160}; 46161/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FormControlName, [{ 46162 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 46163 args: [{ selector: '[formControlName]', providers: [controlNameBinding] }] 46164 }], function () { return [{ type: ControlContainer, decorators: [{ 46165 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 46166 }, { 46167 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] 46168 }, { 46169 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"] 46170 }] }, { type: Array, decorators: [{ 46171 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 46172 }, { 46173 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 46174 }, { 46175 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 46176 args: [NG_VALIDATORS] 46177 }] }, { type: Array, decorators: [{ 46178 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 46179 }, { 46180 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 46181 }, { 46182 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 46183 args: [NG_ASYNC_VALIDATORS] 46184 }] }, { type: Array, decorators: [{ 46185 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 46186 }, { 46187 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Self"] 46188 }, { 46189 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 46190 args: [NG_VALUE_ACCESSOR] 46191 }] }, { type: String, decorators: [{ 46192 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] 46193 }, { 46194 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], 46195 args: [NG_MODEL_WITH_FORM_CONTROL_WARNING] 46196 }] }]; }, { update: [{ 46197 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"], 46198 args: ['ngModelChange'] 46199 }], isDisabled: [{ 46200 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 46201 args: ['disabled'] 46202 }], name: [{ 46203 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 46204 args: ['formControlName'] 46205 }], model: [{ 46206 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], 46207 args: ['ngModel'] 46208 }] }); })(); 46209 46210/** 46211 * @license 46212 * Copyright Google LLC All Rights Reserved. 46213 * 46214 * Use of this source code is governed by an MIT-style license that can be 46215 * found in the LICENSE file at https://angular.io/license 46216 */ 46217/** 46218 * @description 46219 * Provider which adds `RequiredValidator` to the `NG_VALIDATORS` multi-provider list. 46220 */ 46221const REQUIRED_VALIDATOR = { 46222 provide: NG_VALIDATORS, 46223 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => RequiredValidator), 46224 multi: true 46225}; 46226/** 46227 * @description 46228 * Provider which adds `CheckboxRequiredValidator` to the `NG_VALIDATORS` multi-provider list. 46229 */ 46230const CHECKBOX_REQUIRED_VALIDATOR = { 46231 provide: NG_VALIDATORS, 46232 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => CheckboxRequiredValidator), 46233 multi: true 46234}; 46235/** 46236 * @description 46237 * A directive that adds the `required` validator to any controls marked with the 46238 * `required` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. 46239 * 46240 * @see [Form Validation](guide/form-validation) 46241 * 46242 * @usageNotes 46243 * 46244 * ### Adding a required validator using template-driven forms 46245 * 46246 * ``` 46247 * <input name="fullName" ngModel required> 46248 * ``` 46249 * 46250 * @ngModule FormsModule 46251 * @ngModule ReactiveFormsModule 46252 * @publicApi 46253 */ 46254class RequiredValidator { 46255 constructor() { 46256 this._required = false; 46257 } 46258 /** 46259 * @description 46260 * Tracks changes to the required attribute bound to this directive. 46261 */ 46262 get required() { 46263 return this._required; 46264 } 46265 set required(value) { 46266 this._required = value != null && value !== false && `${value}` !== 'false'; 46267 if (this._onChange) 46268 this._onChange(); 46269 } 46270 /** 46271 * @description 46272 * Method that validates whether the control is empty. 46273 * Returns the validation result if enabled, otherwise null. 46274 */ 46275 validate(control) { 46276 return this.required ? Validators.required(control) : null; 46277 } 46278 /** 46279 * @description 46280 * Registers a callback function to call when the validator inputs change. 46281 * 46282 * @param fn The callback function 46283 */ 46284 registerOnValidatorChange(fn) { 46285 this._onChange = fn; 46286 } 46287} 46288RequiredValidator.ɵfac = function RequiredValidator_Factory(t) { return new (t || RequiredValidator)(); }; 46289RequiredValidator.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: RequiredValidator, selectors: [["", "required", "", "formControlName", "", 3, "type", "checkbox"], ["", "required", "", "formControl", "", 3, "type", "checkbox"], ["", "required", "", "ngModel", "", 3, "type", "checkbox"]], hostVars: 1, hostBindings: function RequiredValidator_HostBindings(rf, ctx) { if (rf & 2) { 46290 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("required", ctx.required ? "" : null); 46291 } }, inputs: { required: "required" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([REQUIRED_VALIDATOR])] }); 46292RequiredValidator.propDecorators = { 46293 required: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 46294}; 46295/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RequiredValidator, [{ 46296 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 46297 args: [{ 46298 selector: ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]', 46299 providers: [REQUIRED_VALIDATOR], 46300 host: { '[attr.required]': 'required ? "" : null' } 46301 }] 46302 }], function () { return []; }, { required: [{ 46303 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 46304 }] }); })(); 46305/** 46306 * A Directive that adds the `required` validator to checkbox controls marked with the 46307 * `required` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. 46308 * 46309 * @see [Form Validation](guide/form-validation) 46310 * 46311 * @usageNotes 46312 * 46313 * ### Adding a required checkbox validator using template-driven forms 46314 * 46315 * The following example shows how to add a checkbox required validator to an input attached to an 46316 * ngModel binding. 46317 * 46318 * ``` 46319 * <input type="checkbox" name="active" ngModel required> 46320 * ``` 46321 * 46322 * @publicApi 46323 * @ngModule FormsModule 46324 * @ngModule ReactiveFormsModule 46325 */ 46326class CheckboxRequiredValidator extends RequiredValidator { 46327 /** 46328 * @description 46329 * Method that validates whether or not the checkbox has been checked. 46330 * Returns the validation result if enabled, otherwise null. 46331 */ 46332 validate(control) { 46333 return this.required ? Validators.requiredTrue(control) : null; 46334 } 46335} 46336CheckboxRequiredValidator.ɵfac = function CheckboxRequiredValidator_Factory(t) { return ɵCheckboxRequiredValidator_BaseFactory(t || CheckboxRequiredValidator); }; 46337CheckboxRequiredValidator.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: CheckboxRequiredValidator, selectors: [["input", "type", "checkbox", "required", "", "formControlName", ""], ["input", "type", "checkbox", "required", "", "formControl", ""], ["input", "type", "checkbox", "required", "", "ngModel", ""]], hostVars: 1, hostBindings: function CheckboxRequiredValidator_HostBindings(rf, ctx) { if (rf & 2) { 46338 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("required", ctx.required ? "" : null); 46339 } }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([CHECKBOX_REQUIRED_VALIDATOR]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]] }); 46340const ɵCheckboxRequiredValidator_BaseFactory = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](CheckboxRequiredValidator); 46341/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CheckboxRequiredValidator, [{ 46342 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 46343 args: [{ 46344 selector: 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]', 46345 providers: [CHECKBOX_REQUIRED_VALIDATOR], 46346 host: { '[attr.required]': 'required ? "" : null' } 46347 }] 46348 }], null, null); })(); 46349/** 46350 * @description 46351 * Provider which adds `EmailValidator` to the `NG_VALIDATORS` multi-provider list. 46352 */ 46353const EMAIL_VALIDATOR = { 46354 provide: NG_VALIDATORS, 46355 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => EmailValidator), 46356 multi: true 46357}; 46358/** 46359 * A directive that adds the `email` validator to controls marked with the 46360 * `email` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. 46361 * 46362 * @see [Form Validation](guide/form-validation) 46363 * 46364 * @usageNotes 46365 * 46366 * ### Adding an email validator 46367 * 46368 * The following example shows how to add an email validator to an input attached to an ngModel 46369 * binding. 46370 * 46371 * ``` 46372 * <input type="email" name="email" ngModel email> 46373 * <input type="email" name="email" ngModel email="true"> 46374 * <input type="email" name="email" ngModel [email]="true"> 46375 * ``` 46376 * 46377 * @publicApi 46378 * @ngModule FormsModule 46379 * @ngModule ReactiveFormsModule 46380 */ 46381class EmailValidator { 46382 constructor() { 46383 this._enabled = false; 46384 } 46385 /** 46386 * @description 46387 * Tracks changes to the email attribute bound to this directive. 46388 */ 46389 set email(value) { 46390 this._enabled = value === '' || value === true || value === 'true'; 46391 if (this._onChange) 46392 this._onChange(); 46393 } 46394 /** 46395 * @description 46396 * Method that validates whether an email address is valid. 46397 * Returns the validation result if enabled, otherwise null. 46398 */ 46399 validate(control) { 46400 return this._enabled ? Validators.email(control) : null; 46401 } 46402 /** 46403 * @description 46404 * Registers a callback function to call when the validator inputs change. 46405 * 46406 * @param fn The callback function 46407 */ 46408 registerOnValidatorChange(fn) { 46409 this._onChange = fn; 46410 } 46411} 46412EmailValidator.ɵfac = function EmailValidator_Factory(t) { return new (t || EmailValidator)(); }; 46413EmailValidator.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: EmailValidator, selectors: [["", "email", "", "formControlName", ""], ["", "email", "", "formControl", ""], ["", "email", "", "ngModel", ""]], inputs: { email: "email" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([EMAIL_VALIDATOR])] }); 46414EmailValidator.propDecorators = { 46415 email: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 46416}; 46417/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](EmailValidator, [{ 46418 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 46419 args: [{ 46420 selector: '[email][formControlName],[email][formControl],[email][ngModel]', 46421 providers: [EMAIL_VALIDATOR] 46422 }] 46423 }], function () { return []; }, { email: [{ 46424 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 46425 }] }); })(); 46426/** 46427 * @description 46428 * Provider which adds `MinLengthValidator` to the `NG_VALIDATORS` multi-provider list. 46429 */ 46430const MIN_LENGTH_VALIDATOR = { 46431 provide: NG_VALIDATORS, 46432 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => MinLengthValidator), 46433 multi: true 46434}; 46435/** 46436 * A directive that adds minimum length validation to controls marked with the 46437 * `minlength` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. 46438 * 46439 * @see [Form Validation](guide/form-validation) 46440 * 46441 * @usageNotes 46442 * 46443 * ### Adding a minimum length validator 46444 * 46445 * The following example shows how to add a minimum length validator to an input attached to an 46446 * ngModel binding. 46447 * 46448 * ```html 46449 * <input name="firstName" ngModel minlength="4"> 46450 * ``` 46451 * 46452 * @ngModule ReactiveFormsModule 46453 * @ngModule FormsModule 46454 * @publicApi 46455 */ 46456class MinLengthValidator { 46457 constructor() { 46458 this._validator = Validators.nullValidator; 46459 } 46460 /** 46461 * @description 46462 * A lifecycle method called when the directive's inputs change. For internal use 46463 * only. 46464 * 46465 * @param changes A object of key/value pairs for the set of changed inputs. 46466 */ 46467 ngOnChanges(changes) { 46468 if ('minlength' in changes) { 46469 this._createValidator(); 46470 if (this._onChange) 46471 this._onChange(); 46472 } 46473 } 46474 /** 46475 * @description 46476 * Method that validates whether the value meets a minimum length 46477 * requirement. Returns the validation result if enabled, otherwise null. 46478 */ 46479 validate(control) { 46480 return this.minlength == null ? null : this._validator(control); 46481 } 46482 /** 46483 * @description 46484 * Registers a callback function to call when the validator inputs change. 46485 * 46486 * @param fn The callback function 46487 */ 46488 registerOnValidatorChange(fn) { 46489 this._onChange = fn; 46490 } 46491 _createValidator() { 46492 this._validator = Validators.minLength(typeof this.minlength === 'number' ? this.minlength : parseInt(this.minlength, 10)); 46493 } 46494} 46495MinLengthValidator.ɵfac = function MinLengthValidator_Factory(t) { return new (t || MinLengthValidator)(); }; 46496MinLengthValidator.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: MinLengthValidator, selectors: [["", "minlength", "", "formControlName", ""], ["", "minlength", "", "formControl", ""], ["", "minlength", "", "ngModel", ""]], hostVars: 1, hostBindings: function MinLengthValidator_HostBindings(rf, ctx) { if (rf & 2) { 46497 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("minlength", ctx.minlength ? ctx.minlength : null); 46498 } }, inputs: { minlength: "minlength" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([MIN_LENGTH_VALIDATOR]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 46499MinLengthValidator.propDecorators = { 46500 minlength: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 46501}; 46502/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](MinLengthValidator, [{ 46503 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 46504 args: [{ 46505 selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]', 46506 providers: [MIN_LENGTH_VALIDATOR], 46507 host: { '[attr.minlength]': 'minlength ? minlength : null' } 46508 }] 46509 }], function () { return []; }, { minlength: [{ 46510 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 46511 }] }); })(); 46512/** 46513 * @description 46514 * Provider which adds `MaxLengthValidator` to the `NG_VALIDATORS` multi-provider list. 46515 */ 46516const MAX_LENGTH_VALIDATOR = { 46517 provide: NG_VALIDATORS, 46518 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => MaxLengthValidator), 46519 multi: true 46520}; 46521/** 46522 * A directive that adds max length validation to controls marked with the 46523 * `maxlength` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. 46524 * 46525 * @see [Form Validation](guide/form-validation) 46526 * 46527 * @usageNotes 46528 * 46529 * ### Adding a maximum length validator 46530 * 46531 * The following example shows how to add a maximum length validator to an input attached to an 46532 * ngModel binding. 46533 * 46534 * ```html 46535 * <input name="firstName" ngModel maxlength="25"> 46536 * ``` 46537 * 46538 * @ngModule ReactiveFormsModule 46539 * @ngModule FormsModule 46540 * @publicApi 46541 */ 46542class MaxLengthValidator { 46543 constructor() { 46544 this._validator = Validators.nullValidator; 46545 } 46546 /** 46547 * @description 46548 * A lifecycle method called when the directive's inputs change. For internal use 46549 * only. 46550 * 46551 * @param changes A object of key/value pairs for the set of changed inputs. 46552 */ 46553 ngOnChanges(changes) { 46554 if ('maxlength' in changes) { 46555 this._createValidator(); 46556 if (this._onChange) 46557 this._onChange(); 46558 } 46559 } 46560 /** 46561 * @description 46562 * Method that validates whether the value exceeds 46563 * the maximum length requirement. 46564 */ 46565 validate(control) { 46566 return this.maxlength != null ? this._validator(control) : null; 46567 } 46568 /** 46569 * @description 46570 * Registers a callback function to call when the validator inputs change. 46571 * 46572 * @param fn The callback function 46573 */ 46574 registerOnValidatorChange(fn) { 46575 this._onChange = fn; 46576 } 46577 _createValidator() { 46578 this._validator = Validators.maxLength(typeof this.maxlength === 'number' ? this.maxlength : parseInt(this.maxlength, 10)); 46579 } 46580} 46581MaxLengthValidator.ɵfac = function MaxLengthValidator_Factory(t) { return new (t || MaxLengthValidator)(); }; 46582MaxLengthValidator.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: MaxLengthValidator, selectors: [["", "maxlength", "", "formControlName", ""], ["", "maxlength", "", "formControl", ""], ["", "maxlength", "", "ngModel", ""]], hostVars: 1, hostBindings: function MaxLengthValidator_HostBindings(rf, ctx) { if (rf & 2) { 46583 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("maxlength", ctx.maxlength ? ctx.maxlength : null); 46584 } }, inputs: { maxlength: "maxlength" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([MAX_LENGTH_VALIDATOR]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 46585MaxLengthValidator.propDecorators = { 46586 maxlength: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 46587}; 46588/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](MaxLengthValidator, [{ 46589 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 46590 args: [{ 46591 selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]', 46592 providers: [MAX_LENGTH_VALIDATOR], 46593 host: { '[attr.maxlength]': 'maxlength ? maxlength : null' } 46594 }] 46595 }], function () { return []; }, { maxlength: [{ 46596 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 46597 }] }); })(); 46598/** 46599 * @description 46600 * Provider which adds `PatternValidator` to the `NG_VALIDATORS` multi-provider list. 46601 */ 46602const PATTERN_VALIDATOR = { 46603 provide: NG_VALIDATORS, 46604 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(() => PatternValidator), 46605 multi: true 46606}; 46607/** 46608 * @description 46609 * A directive that adds regex pattern validation to controls marked with the 46610 * `pattern` attribute. The regex must match the entire control value. 46611 * The directive is provided with the `NG_VALIDATORS` multi-provider list. 46612 * 46613 * @see [Form Validation](guide/form-validation) 46614 * 46615 * @usageNotes 46616 * 46617 * ### Adding a pattern validator 46618 * 46619 * The following example shows how to add a pattern validator to an input attached to an 46620 * ngModel binding. 46621 * 46622 * ```html 46623 * <input name="firstName" ngModel pattern="[a-zA-Z ]*"> 46624 * ``` 46625 * 46626 * @ngModule ReactiveFormsModule 46627 * @ngModule FormsModule 46628 * @publicApi 46629 */ 46630class PatternValidator { 46631 constructor() { 46632 this._validator = Validators.nullValidator; 46633 } 46634 /** 46635 * @description 46636 * A lifecycle method called when the directive's inputs change. For internal use 46637 * only. 46638 * 46639 * @param changes A object of key/value pairs for the set of changed inputs. 46640 */ 46641 ngOnChanges(changes) { 46642 if ('pattern' in changes) { 46643 this._createValidator(); 46644 if (this._onChange) 46645 this._onChange(); 46646 } 46647 } 46648 /** 46649 * @description 46650 * Method that validates whether the value matches the 46651 * the pattern requirement. 46652 */ 46653 validate(control) { 46654 return this._validator(control); 46655 } 46656 /** 46657 * @description 46658 * Registers a callback function to call when the validator inputs change. 46659 * 46660 * @param fn The callback function 46661 */ 46662 registerOnValidatorChange(fn) { 46663 this._onChange = fn; 46664 } 46665 _createValidator() { 46666 this._validator = Validators.pattern(this.pattern); 46667 } 46668} 46669PatternValidator.ɵfac = function PatternValidator_Factory(t) { return new (t || PatternValidator)(); }; 46670PatternValidator.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: PatternValidator, selectors: [["", "pattern", "", "formControlName", ""], ["", "pattern", "", "formControl", ""], ["", "pattern", "", "ngModel", ""]], hostVars: 1, hostBindings: function PatternValidator_HostBindings(rf, ctx) { if (rf & 2) { 46671 _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("pattern", ctx.pattern ? ctx.pattern : null); 46672 } }, inputs: { pattern: "pattern" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([PATTERN_VALIDATOR]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); 46673PatternValidator.propDecorators = { 46674 pattern: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }] 46675}; 46676/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PatternValidator, [{ 46677 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"], 46678 args: [{ 46679 selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]', 46680 providers: [PATTERN_VALIDATOR], 46681 host: { '[attr.pattern]': 'pattern ? pattern : null' } 46682 }] 46683 }], function () { return []; }, { pattern: [{ 46684 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] 46685 }] }); })(); 46686 46687/** 46688 * @license 46689 * Copyright Google LLC All Rights Reserved. 46690 * 46691 * Use of this source code is governed by an MIT-style license that can be 46692 * found in the LICENSE file at https://angular.io/license 46693 */ 46694const SHARED_FORM_DIRECTIVES = [ 46695 ɵNgNoValidate, 46696 NgSelectOption, 46697 ɵNgSelectMultipleOption, 46698 DefaultValueAccessor, 46699 NumberValueAccessor, 46700 RangeValueAccessor, 46701 CheckboxControlValueAccessor, 46702 SelectControlValueAccessor, 46703 SelectMultipleControlValueAccessor, 46704 RadioControlValueAccessor, 46705 NgControlStatus, 46706 NgControlStatusGroup, 46707 RequiredValidator, 46708 MinLengthValidator, 46709 MaxLengthValidator, 46710 PatternValidator, 46711 CheckboxRequiredValidator, 46712 EmailValidator, 46713]; 46714const TEMPLATE_DRIVEN_DIRECTIVES = [NgModel, NgModelGroup, NgForm]; 46715const REACTIVE_DRIVEN_DIRECTIVES = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName]; 46716/** 46717 * Internal module used for sharing directives between FormsModule and ReactiveFormsModule 46718 */ 46719class ɵInternalFormsSharedModule { 46720} 46721ɵInternalFormsSharedModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: ɵInternalFormsSharedModule }); 46722ɵInternalFormsSharedModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ factory: function ɵInternalFormsSharedModule_Factory(t) { return new (t || ɵInternalFormsSharedModule)(); } }); 46723(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](ɵInternalFormsSharedModule, { declarations: [ɵNgNoValidate, NgSelectOption, ɵNgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator], exports: [ɵNgNoValidate, NgSelectOption, ɵNgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator] }); })(); 46724/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ɵInternalFormsSharedModule, [{ 46725 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], 46726 args: [{ 46727 declarations: SHARED_FORM_DIRECTIVES, 46728 exports: SHARED_FORM_DIRECTIVES 46729 }] 46730 }], null, null); })(); 46731 46732/** 46733 * @license 46734 * Copyright Google LLC All Rights Reserved. 46735 * 46736 * Use of this source code is governed by an MIT-style license that can be 46737 * found in the LICENSE file at https://angular.io/license 46738 */ 46739function isAbstractControlOptions(options) { 46740 return options.asyncValidators !== undefined || 46741 options.validators !== undefined || 46742 options.updateOn !== undefined; 46743} 46744/** 46745 * @description 46746 * Creates an `AbstractControl` from a user-specified configuration. 46747 * 46748 * The `FormBuilder` provides syntactic sugar that shortens creating instances of a `FormControl`, 46749 * `FormGroup`, or `FormArray`. It reduces the amount of boilerplate needed to build complex 46750 * forms. 46751 * 46752 * @see [Reactive Forms Guide](/guide/reactive-forms) 46753 * 46754 * @publicApi 46755 */ 46756class FormBuilder { 46757 /** 46758 * @description 46759 * Construct a new `FormGroup` instance. 46760 * 46761 * @param controlsConfig A collection of child controls. The key for each child is the name 46762 * under which it is registered. 46763 * 46764 * @param options Configuration options object for the `FormGroup`. The object can 46765 * have two shapes: 46766 * 46767 * 1) `AbstractControlOptions` object (preferred), which consists of: 46768 * * `validators`: A synchronous validator function, or an array of validator functions 46769 * * `asyncValidators`: A single async validator or array of async validator functions 46770 * * `updateOn`: The event upon which the control should be updated (options: 'change' | 'blur' | 46771 * submit') 46772 * 46773 * 2) Legacy configuration object, which consists of: 46774 * * `validator`: A synchronous validator function, or an array of validator functions 46775 * * `asyncValidator`: A single async validator or array of async validator functions 46776 * 46777 */ 46778 group(controlsConfig, options = null) { 46779 const controls = this._reduceControls(controlsConfig); 46780 let validators = null; 46781 let asyncValidators = null; 46782 let updateOn = undefined; 46783 if (options != null) { 46784 if (isAbstractControlOptions(options)) { 46785 // `options` are `AbstractControlOptions` 46786 validators = options.validators != null ? options.validators : null; 46787 asyncValidators = options.asyncValidators != null ? options.asyncValidators : null; 46788 updateOn = options.updateOn != null ? options.updateOn : undefined; 46789 } 46790 else { 46791 // `options` are legacy form group options 46792 validators = options['validator'] != null ? options['validator'] : null; 46793 asyncValidators = options['asyncValidator'] != null ? options['asyncValidator'] : null; 46794 } 46795 } 46796 return new FormGroup(controls, { asyncValidators, updateOn, validators }); 46797 } 46798 /** 46799 * @description 46800 * Construct a new `FormControl` with the given state, validators and options. 46801 * 46802 * @param formState Initializes the control with an initial state value, or 46803 * with an object that contains both a value and a disabled status. 46804 * 46805 * @param validatorOrOpts A synchronous validator function, or an array of 46806 * such functions, or an `AbstractControlOptions` object that contains 46807 * validation functions and a validation trigger. 46808 * 46809 * @param asyncValidator A single async validator or array of async validator 46810 * functions. 46811 * 46812 * @usageNotes 46813 * 46814 * ### Initialize a control as disabled 46815 * 46816 * The following example returns a control with an initial value in a disabled state. 46817 * 46818 * <code-example path="forms/ts/formBuilder/form_builder_example.ts" region="disabled-control"> 46819 * </code-example> 46820 */ 46821 control(formState, validatorOrOpts, asyncValidator) { 46822 return new FormControl(formState, validatorOrOpts, asyncValidator); 46823 } 46824 /** 46825 * Constructs a new `FormArray` from the given array of configurations, 46826 * validators and options. 46827 * 46828 * @param controlsConfig An array of child controls or control configs. Each 46829 * child control is given an index when it is registered. 46830 * 46831 * @param validatorOrOpts A synchronous validator function, or an array of 46832 * such functions, or an `AbstractControlOptions` object that contains 46833 * validation functions and a validation trigger. 46834 * 46835 * @param asyncValidator A single async validator or array of async validator 46836 * functions. 46837 */ 46838 array(controlsConfig, validatorOrOpts, asyncValidator) { 46839 const controls = controlsConfig.map(c => this._createControl(c)); 46840 return new FormArray(controls, validatorOrOpts, asyncValidator); 46841 } 46842 /** @internal */ 46843 _reduceControls(controlsConfig) { 46844 const controls = {}; 46845 Object.keys(controlsConfig).forEach(controlName => { 46846 controls[controlName] = this._createControl(controlsConfig[controlName]); 46847 }); 46848 return controls; 46849 } 46850 /** @internal */ 46851 _createControl(controlConfig) { 46852 if (controlConfig instanceof FormControl || controlConfig instanceof FormGroup || 46853 controlConfig instanceof FormArray) { 46854 return controlConfig; 46855 } 46856 else if (Array.isArray(controlConfig)) { 46857 const value = controlConfig[0]; 46858 const validator = controlConfig.length > 1 ? controlConfig[1] : null; 46859 const asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null; 46860 return this.control(value, validator, asyncValidator); 46861 } 46862 else { 46863 return this.control(controlConfig); 46864 } 46865 } 46866} 46867FormBuilder.ɵfac = function FormBuilder_Factory(t) { return new (t || FormBuilder)(); }; 46868FormBuilder.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: FormBuilder, factory: FormBuilder.ɵfac }); 46869/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FormBuilder, [{ 46870 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"] 46871 }], null, null); })(); 46872 46873/** 46874 * @license 46875 * Copyright Google LLC All Rights Reserved. 46876 * 46877 * Use of this source code is governed by an MIT-style license that can be 46878 * found in the LICENSE file at https://angular.io/license 46879 */ 46880/** 46881 * @publicApi 46882 */ 46883const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Version"]('10.0.14'); 46884 46885/** 46886 * @license 46887 * Copyright Google LLC All Rights Reserved. 46888 * 46889 * Use of this source code is governed by an MIT-style license that can be 46890 * found in the LICENSE file at https://angular.io/license 46891 */ 46892/** 46893 * Exports the required providers and directives for template-driven forms, 46894 * making them available for import by NgModules that import this module. 46895 * 46896 * @see [Forms Overview](/guide/forms-overview) 46897 * @see [Template-driven Forms Guide](/guide/forms) 46898 * 46899 * @publicApi 46900 */ 46901class FormsModule { 46902} 46903FormsModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: FormsModule }); 46904FormsModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ factory: function FormsModule_Factory(t) { return new (t || FormsModule)(); }, providers: [RadioControlRegistry], imports: [ɵInternalFormsSharedModule] }); 46905(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](FormsModule, { declarations: [NgModel, NgModelGroup, NgForm], exports: [ɵInternalFormsSharedModule, NgModel, NgModelGroup, NgForm] }); })(); 46906/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FormsModule, [{ 46907 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], 46908 args: [{ 46909 declarations: TEMPLATE_DRIVEN_DIRECTIVES, 46910 providers: [RadioControlRegistry], 46911 exports: [ɵInternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES] 46912 }] 46913 }], null, null); })(); 46914/** 46915 * Exports the required infrastructure and directives for reactive forms, 46916 * making them available for import by NgModules that import this module. 46917 * 46918 * @see [Forms Overview](guide/forms-overview) 46919 * @see [Reactive Forms Guide](guide/reactive-forms) 46920 * 46921 * @publicApi 46922 */ 46923class ReactiveFormsModule { 46924 /** 46925 * @description 46926 * Provides options for configuring the reactive forms module. 46927 * 46928 * @param opts An object of configuration options 46929 * * `warnOnNgModelWithFormControl` Configures when to emit a warning when an `ngModel` 46930 * binding is used with reactive form directives. 46931 */ 46932 static withConfig(opts) { 46933 return { 46934 ngModule: ReactiveFormsModule, 46935 providers: [ 46936 { provide: NG_MODEL_WITH_FORM_CONTROL_WARNING, useValue: opts.warnOnNgModelWithFormControl } 46937 ] 46938 }; 46939 } 46940} 46941ReactiveFormsModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: ReactiveFormsModule }); 46942ReactiveFormsModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ factory: function ReactiveFormsModule_Factory(t) { return new (t || ReactiveFormsModule)(); }, providers: [FormBuilder, RadioControlRegistry], imports: [ɵInternalFormsSharedModule] }); 46943(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](ReactiveFormsModule, { declarations: [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName], exports: [ɵInternalFormsSharedModule, FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName] }); })(); 46944/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ReactiveFormsModule, [{ 46945 type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], 46946 args: [{ 46947 declarations: [REACTIVE_DRIVEN_DIRECTIVES], 46948 providers: [FormBuilder, RadioControlRegistry], 46949 exports: [ɵInternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES] 46950 }] 46951 }], null, null); })(); 46952 46953/** 46954 * @license 46955 * Copyright Google LLC All Rights Reserved. 46956 * 46957 * Use of this source code is governed by an MIT-style license that can be 46958 * found in the LICENSE file at https://angular.io/license 46959 */ 46960 46961/** 46962 * @license 46963 * Copyright Google LLC All Rights Reserved. 46964 * 46965 * Use of this source code is governed by an MIT-style license that can be 46966 * found in the LICENSE file at https://angular.io/license 46967 */ 46968// This file only reexports content of the `src` folder. Keep it that way. 46969 46970/** 46971 * @license 46972 * Copyright Google LLC All Rights Reserved. 46973 * 46974 * Use of this source code is governed by an MIT-style license that can be 46975 * found in the LICENSE file at https://angular.io/license 46976 */ 46977 46978/** 46979 * Generated bundle index. Do not edit. 46980 */ 46981 46982 46983 46984//# sourceMappingURL=forms.js.map 46985 46986/***/ }), 46987
vendor: 101,536 bytes, lines 46988-49224
46988/***/ "./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/platform-browser.js": 46989/*!******************************************************************************************!*\ 46990 !*** ./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/platform-browser.js ***! 46991 \******************************************************************************************/ 46992/*! exports provided: ɵgetDOM, BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, Title, TransferState, VERSION, disableDebugTools, enableDebugTools, makeStateKey, platformBrowser, ɵBROWSER_SANITIZATION_PROVIDERS, ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__, ɵBrowserDomAdapter, ɵBrowserGetTestability, ɵDomEventsPlugin, ɵDomRendererFactory2, ɵDomSanitizerImpl, ɵDomSharedStylesHost, ɵELEMENT_PROBE_PROVIDERS, ɵELEMENT_PROBE_PROVIDERS__POST_R3__, ɵHAMMER_PROVIDERS__POST_R3__, ɵHammerGesturesPlugin, ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, ɵKeyEventsPlugin, ɵNAMESPACE_URIS, ɵSharedStylesHost, ɵTRANSITION_ID, ɵangular_packages_platform_browser_platform_browser_a, ɵangular_packages_platform_browser_platform_browser_b, ɵangular_packages_platform_browser_platform_browser_c, ɵangular_packages_platform_browser_platform_browser_d, ɵangular_packages_platform_browser_platform_browser_e, ɵangular_packages_platform_browser_platform_browser_f, ɵangular_packages_platform_browser_platform_browser_g, ɵangular_packages_platform_browser_platform_browser_h, ɵangular_packages_platform_browser_platform_browser_i, ɵangular_packages_platform_browser_platform_browser_j, ɵangular_packages_platform_browser_platform_browser_k, ɵangular_packages_platform_browser_platform_browser_l, ɵangular_packages_platform_browser_platform_browser_m, ɵangular_packages_platform_browser_platform_browser_n, ɵangular_packages_platform_browser_platform_browser_o, ɵescapeHtml, ɵflattenStyles, ɵinitDomAdapter, ɵshimContentAttribute, ɵshimHostAttribute */ 46993/***/ (function(module, __webpack_exports__, __webpack_require__) { 46994 46995"use strict"; 46996__webpack_require__.r(__webpack_exports__); 46997/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserModule", function() { return BrowserModule; }); 46998/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserTransferStateModule", function() { return BrowserTransferStateModule; }); 46999/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "By", function() { return By; }); 47000/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomSanitizer", function() { return DomSanitizer; }); 47001/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_MANAGER_PLUGINS", function() { return EVENT_MANAGER_PLUGINS; }); 47002/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventManager", function() { return EventManager; }); 47003/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HAMMER_GESTURE_CONFIG", function() { return HAMMER_GESTURE_CONFIG; }); 47004/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HAMMER_LOADER", function() { return HAMMER_LOADER; }); 47005/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HammerGestureConfig", function() { return HammerGestureConfig; }); 47006/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HammerModule", function() { return HammerModule; }); 47007/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Meta", function() { return Meta; }); 47008/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Title", function() { return Title; }); 47009/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransferState", function() { return TransferState; }); 47010/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); 47011/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disableDebugTools", function() { return disableDebugTools; }); 47012/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableDebugTools", function() { return enableDebugTools; }); 47013/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeStateKey", function() { return makeStateKey; }); 47014/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platformBrowser", function() { return platformBrowser; }); 47015/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBROWSER_SANITIZATION_PROVIDERS", function() { return BROWSER_SANITIZATION_PROVIDERS; }); 47016/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__", function() { return BROWSER_SANITIZATION_PROVIDERS__POST_R3__; }); 47017/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserDomAdapter", function() { return BrowserDomAdapter; }); 47018/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserGetTestability", function() { return BrowserGetTestability; }); 47019/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomEventsPlugin", function() { return DomEventsPlugin; }); 47020/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomRendererFactory2", function() { return DomRendererFactory2; }); 47021/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomSanitizerImpl", function() { return DomSanitizerImpl; }); 47022/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomSharedStylesHost", function() { return DomSharedStylesHost; }); 47023/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵELEMENT_PROBE_PROVIDERS", function() { return ELEMENT_PROBE_PROVIDERS; }); 47024/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵELEMENT_PROBE_PROVIDERS__POST_R3__", function() { return ELEMENT_PROBE_PROVIDERS__POST_R3__; }); 47025/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵHAMMER_PROVIDERS__POST_R3__", function() { return HAMMER_PROVIDERS__POST_R3__; }); 47026/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵHammerGesturesPlugin", function() { return HammerGesturesPlugin; }); 47027/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS", function() { return INTERNAL_BROWSER_PLATFORM_PROVIDERS; }); 47028/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵKeyEventsPlugin", function() { return KeyEventsPlugin; }); 47029/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNAMESPACE_URIS", function() { return NAMESPACE_URIS; }); 47030/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSharedStylesHost", function() { return SharedStylesHost; }); 47031/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵTRANSITION_ID", function() { return TRANSITION_ID; }); 47032/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_a", function() { return errorHandler; }); 47033/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_b", function() { return _document; }); 47034/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_c", function() { return BROWSER_MODULE_PROVIDERS; }); 47035/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_d", function() { return createMeta; }); 47036/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_e", function() { return createTitle; }); 47037/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_f", function() { return initTransferState; }); 47038/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_g", function() { return EventManagerPlugin; }); 47039/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_h", function() { return HAMMER_PROVIDERS__PRE_R3__; }); 47040/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_i", function() { return HAMMER_PROVIDERS; }); 47041/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_j", function() { return domSanitizerImplFactory; }); 47042/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_k", function() { return appInitializerFactory; }); 47043/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_l", function() { return SERVER_TRANSITION_PROVIDERS; }); 47044/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_m", function() { return _createNgProbeR2; }); 47045/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_n", function() { return ELEMENT_PROBE_PROVIDERS__PRE_R3__; }); 47046/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_o", function() { return GenericBrowserDomAdapter; }); 47047/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵescapeHtml", function() { return escapeHtml; }); 47048/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵflattenStyles", function() { return flattenStyles; }); 47049/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinitDomAdapter", function() { return initDomAdapter; }); 47050/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵshimContentAttribute", function() { return shimContentAttribute; }); 47051/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵshimHostAttribute", function() { return shimHostAttribute; }); 47052/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js"); 47053/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js"); 47054/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵgetDOM", function() { return _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"]; }); 47055 47056/** 47057 * @license Angular v10.0.14 47058 * (c) 2010-2020 Google LLC. https://angular.io/ 47059 * License: MIT 47060 */ 47061 47062 47063 47064 47065 47066 47067/** 47068 * @license 47069 * Copyright Google LLC All Rights Reserved. 47070 * 47071 * Use of this source code is governed by an MIT-style license that can be 47072 * found in the LICENSE file at https://angular.io/license 47073 */ 47074/** 47075 * Provides DOM operations in any browser environment. 47076 * 47077 * @security Tread carefully! Interacting with the DOM directly is dangerous and 47078 * can introduce XSS risks. 47079 */ 47080class GenericBrowserDomAdapter extends _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵDomAdapter"] { 47081 constructor() { 47082 super(); 47083 } 47084 supportsDOMEvents() { 47085 return true; 47086 } 47087} 47088 47089/** 47090 * @license 47091 * Copyright Google LLC All Rights Reserved. 47092 * 47093 * Use of this source code is governed by an MIT-style license that can be 47094 * found in the LICENSE file at https://angular.io/license 47095 */ 47096const ɵ0 = () => { 47097 if (_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['Node']) { 47098 return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['Node'].prototype.contains || function (node) { 47099 return !!(this.compareDocumentPosition(node) & 16); 47100 }; 47101 } 47102 return undefined; 47103}; 47104const nodeContains = (ɵ0)(); 47105/** 47106 * A `DomAdapter` powered by full browser DOM APIs. 47107 * 47108 * @security Tread carefully! Interacting with the DOM directly is dangerous and 47109 * can introduce XSS risks. 47110 */ 47111/* tslint:disable:requireParameterType no-console */ 47112class BrowserDomAdapter extends GenericBrowserDomAdapter { 47113 static makeCurrent() { 47114 Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵsetRootDomAdapter"])(new BrowserDomAdapter()); 47115 } 47116 getProperty(el, name) { 47117 return el[name]; 47118 } 47119 log(error) { 47120 if (window.console) { 47121 window.console.log && window.console.log(error); 47122 } 47123 } 47124 logGroup(error) { 47125 if (window.console) { 47126 window.console.group && window.console.group(error); 47127 } 47128 } 47129 logGroupEnd() { 47130 if (window.console) { 47131 window.console.groupEnd && window.console.groupEnd(); 47132 } 47133 } 47134 onAndCancel(el, evt, listener) { 47135 el.addEventListener(evt, listener, false); 47136 // Needed to follow Dart's subscription semantic, until fix of 47137 // https://code.google.com/p/dart/issues/detail?id=17406 47138 return () => { 47139 el.removeEventListener(evt, listener, false); 47140 }; 47141 } 47142 dispatchEvent(el, evt) { 47143 el.dispatchEvent(evt); 47144 } 47145 remove(node) { 47146 if (node.parentNode) { 47147 node.parentNode.removeChild(node); 47148 } 47149 return node; 47150 } 47151 getValue(el) { 47152 return el.value; 47153 } 47154 createElement(tagName, doc) { 47155 doc = doc || this.getDefaultDocument(); 47156 return doc.createElement(tagName); 47157 } 47158 createHtmlDocument() { 47159 return document.implementation.createHTMLDocument('fakeTitle'); 47160 } 47161 getDefaultDocument() { 47162 return document; 47163 } 47164 isElementNode(node) { 47165 return node.nodeType === Node.ELEMENT_NODE; 47166 } 47167 isShadowRoot(node) { 47168 return node instanceof DocumentFragment; 47169 } 47170 getGlobalEventTarget(doc, target) { 47171 if (target === 'window') { 47172 return window; 47173 } 47174 if (target === 'document') { 47175 return doc; 47176 } 47177 if (target === 'body') { 47178 return doc.body; 47179 } 47180 return null; 47181 } 47182 getHistory() { 47183 return window.history; 47184 } 47185 getLocation() { 47186 return window.location; 47187 } 47188 getBaseHref(doc) { 47189 const href = getBaseElementHref(); 47190 return href == null ? null : relativePath(href); 47191 } 47192 resetBaseElement() { 47193 baseElement = null; 47194 } 47195 getUserAgent() { 47196 return window.navigator.userAgent; 47197 } 47198 performanceNow() { 47199 // performance.now() is not available in all browsers, see 47200 // http://caniuse.com/#search=performance.now 47201 return window.performance && window.performance.now ? window.performance.now() : 47202 new Date().getTime(); 47203 } 47204 supportsCookies() { 47205 return true; 47206 } 47207 getCookie(name) { 47208 return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵparseCookieValue"])(document.cookie, name); 47209 } 47210} 47211let baseElement = null; 47212function getBaseElementHref() { 47213 if (!baseElement) { 47214 baseElement = document.querySelector('base'); 47215 if (!baseElement) { 47216 return null; 47217 } 47218 } 47219 return baseElement.getAttribute('href'); 47220} 47221// based on urlUtils.js in AngularJS 1 47222let urlParsingNode; 47223function relativePath(url) { 47224 if (!urlParsingNode) { 47225 urlParsingNode = document.createElement('a'); 47226 } 47227 urlParsingNode.setAttribute('href', url); 47228 return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : 47229 '/' + urlParsingNode.pathname; 47230} 47231 47232/** 47233 * @license 47234 * Copyright Google LLC All Rights Reserved. 47235 * 47236 * Use of this source code is governed by an MIT-style license that can be 47237 * found in the LICENSE file at https://angular.io/license 47238 */ 47239/** 47240 * An id that identifies a particular application being bootstrapped, that should 47241 * match across the client/server boundary. 47242 */ 47243const TRANSITION_ID = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('TRANSITION_ID'); 47244function appInitializerFactory(transitionId, document, injector) { 47245 return () => { 47246 // Wait for all application initializers to be completed before removing the styles set by 47247 // the server. 47248 injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationInitStatus"]).donePromise.then(() => { 47249 const dom = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])(); 47250 const styles = Array.prototype.slice.apply(document.querySelectorAll(`style[ng-transition]`)); 47251 styles.filter(el => el.getAttribute('ng-transition') === transitionId) 47252 .forEach(el => dom.remove(el)); 47253 }); 47254 }; 47255} 47256const SERVER_TRANSITION_PROVIDERS = [ 47257 { 47258 provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_INITIALIZER"], 47259 useFactory: appInitializerFactory, 47260 deps: [TRANSITION_ID, _angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"]], 47261 multi: true 47262 }, 47263]; 47264 47265/** 47266 * @license 47267 * Copyright Google LLC All Rights Reserved. 47268 * 47269 * Use of this source code is governed by an MIT-style license that can be 47270 * found in the LICENSE file at https://angular.io/license 47271 */ 47272class BrowserGetTestability { 47273 static init() { 47274 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["setTestabilityGetter"])(new BrowserGetTestability()); 47275 } 47276 addToWindow(registry) { 47277 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['getAngularTestability'] = (elem, findInAncestors = true) => { 47278 const testability = registry.findTestabilityInTree(elem, findInAncestors); 47279 if (testability == null) { 47280 throw new Error('Could not find testability for element.'); 47281 } 47282 return testability; 47283 }; 47284 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['getAllAngularTestabilities'] = () => registry.getAllTestabilities(); 47285 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['getAllAngularRootElements'] = () => registry.getAllRootElements(); 47286 const whenAllStable = (callback /** TODO #9100 */) => { 47287 const testabilities = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['getAllAngularTestabilities'](); 47288 let count = testabilities.length; 47289 let didWork = false; 47290 const decrement = function (didWork_ /** TODO #9100 */) { 47291 didWork = didWork || didWork_; 47292 count--; 47293 if (count == 0) { 47294 callback(didWork); 47295 } 47296 }; 47297 testabilities.forEach(function (testability /** TODO #9100 */) { 47298 testability.whenStable(decrement); 47299 }); 47300 }; 47301 if (!_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['frameworkStabilizers']) { 47302 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['frameworkStabilizers'] = []; 47303 } 47304 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['frameworkStabilizers'].push(whenAllStable); 47305 } 47306 findTestabilityInTree(registry, elem, findInAncestors) { 47307 if (elem == null) { 47308 return null; 47309 } 47310 const t = registry.getTestability(elem); 47311 if (t != null) { 47312 return t; 47313 } 47314 else if (!findInAncestors) { 47315 return null; 47316 } 47317 if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().isShadowRoot(elem)) { 47318 return this.findTestabilityInTree(registry, elem.host, true); 47319 } 47320 return this.findTestabilityInTree(registry, elem.parentElement, true); 47321 } 47322} 47323 47324/** 47325 * @license 47326 * Copyright Google LLC All Rights Reserved. 47327 * 47328 * Use of this source code is governed by an MIT-style license that can be 47329 * found in the LICENSE file at https://angular.io/license 47330 */ 47331const CAMEL_CASE_REGEXP = /([A-Z])/g; 47332const DASH_CASE_REGEXP = /-([a-z])/g; 47333function camelCaseToDashCase(input) { 47334 return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase()); 47335} 47336function dashCaseToCamelCase(input) { 47337 return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase()); 47338} 47339/** 47340 * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if 47341 * `name` is `'probe'`. 47342 * @param name Name under which it will be exported. Keep in mind this will be a property of the 47343 * global `ng` object. 47344 * @param value The value to export. 47345 */ 47346function exportNgVar(name, value) { 47347 if (typeof COMPILED === 'undefined' || !COMPILED) { 47348 // Note: we can't export `ng` when using closure enhanced optimization as: 47349 // - closure declares globals itself for minified names, which sometimes clobber our `ng` global 47350 // - we can't declare a closure extern as the namespace `ng` is already used within Google 47351 // for typings for angularJS (via `goog.provide('ng....')`). 47352 const ng = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['ng'] = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['ng'] || {}; 47353 ng[name] = value; 47354 } 47355} 47356 47357/** 47358 * @license 47359 * Copyright Google LLC All Rights Reserved. 47360 * 47361 * Use of this source code is governed by an MIT-style license that can be 47362 * found in the LICENSE file at https://angular.io/license 47363 */ 47364const ɵ0$1 = () => ({ 47365 'ApplicationRef': _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"], 47366 'NgZone': _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], 47367}); 47368const CORE_TOKENS = (ɵ0$1)(); 47369const INSPECT_GLOBAL_NAME = 'probe'; 47370const CORE_TOKENS_GLOBAL_NAME = 'coreTokens'; 47371/** 47372 * Returns a {@link DebugElement} for the given native DOM element, or 47373 * null if the given native element does not have an Angular view associated 47374 * with it. 47375 */ 47376function inspectNativeElementR2(element) { 47377 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵgetDebugNodeR2"])(element); 47378} 47379function _createNgProbeR2(coreTokens) { 47380 exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElementR2); 47381 exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object.assign(Object.assign({}, CORE_TOKENS), _ngProbeTokensToMap(coreTokens || []))); 47382 return () => inspectNativeElementR2; 47383} 47384function _ngProbeTokensToMap(tokens) { 47385 return tokens.reduce((prev, t) => (prev[t.name] = t.token, prev), {}); 47386} 47387/** 47388 * In Ivy, we don't support NgProbe because we have our own set of testing utilities 47389 * with more robust functionality. 47390 * 47391 * We shouldn't bring in NgProbe because it prevents DebugNode and friends from 47392 * tree-shaking properly. 47393 */ 47394const ELEMENT_PROBE_PROVIDERS__POST_R3__ = []; 47395/** 47396 * Providers which support debugging Angular applications (e.g. via `ng.probe`). 47397 */ 47398const ELEMENT_PROBE_PROVIDERS__PRE_R3__ = [ 47399 { 47400 provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_INITIALIZER"], 47401 useFactory: _createNgProbeR2, 47402 deps: [ 47403 [_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgProbeToken"], new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]()], 47404 ], 47405 multi: true, 47406 }, 47407]; 47408const ELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS__POST_R3__; 47409 47410/** 47411 * @license 47412 * Copyright Google LLC All Rights Reserved. 47413 * 47414 * Use of this source code is governed by an MIT-style license that can be 47415 * found in the LICENSE file at https://angular.io/license 47416 */ 47417/** 47418 * The injection token for the event-manager plug-in service. 47419 * 47420 * @publicApi 47421 */ 47422const EVENT_MANAGER_PLUGINS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('EventManagerPlugins'); 47423/** 47424 * An injectable service that provides event management for Angular 47425 * through a browser plug-in. 47426 * 47427 * @publicApi 47428 */ 47429class EventManager { 47430 /** 47431 * Initializes an instance of the event-manager service. 47432 */ 47433 constructor(plugins, _zone) { 47434 this._zone = _zone; 47435 this._eventNameToPlugin = new Map(); 47436 plugins.forEach(p => p.manager = this); 47437 this._plugins = plugins.slice().reverse(); 47438 } 47439 /** 47440 * Registers a handler for a specific element and event. 47441 * 47442 * @param element The HTML element to receive event notifications. 47443 * @param eventName The name of the event to listen for. 47444 * @param handler A function to call when the notification occurs. Receives the 47445 * event object as an argument. 47446 * @returns A callback function that can be used to remove the handler. 47447 */ 47448 addEventListener(element, eventName, handler) { 47449 const plugin = this._findPluginFor(eventName); 47450 return plugin.addEventListener(element, eventName, handler); 47451 } 47452 /** 47453 * Registers a global handler for an event in a target view. 47454 * 47455 * @param target A target for global event notifications. One of "window", "document", or "body". 47456 * @param eventName The name of the event to listen for. 47457 * @param handler A function to call when the notification occurs. Receives the 47458 * event object as an argument. 47459 * @returns A callback function that can be used to remove the handler. 47460 */ 47461 addGlobalEventListener(target, eventName, handler) { 47462 const plugin = this._findPluginFor(eventName); 47463 return plugin.addGlobalEventListener(target, eventName, handler); 47464 } 47465 /** 47466 * Retrieves the compilation zone in which event listeners are registered. 47467 */ 47468 getZone() { 47469 return this._zone; 47470 } 47471 /** @internal */ 47472 _findPluginFor(eventName) { 47473 const plugin = this._eventNameToPlugin.get(eventName); 47474 if (plugin) { 47475 return plugin; 47476 } 47477 const plugins = this._plugins; 47478 for (let i = 0; i < plugins.length; i++) { 47479 const plugin = plugins[i]; 47480 if (plugin.supports(eventName)) { 47481 this._eventNameToPlugin.set(eventName, plugin); 47482 return plugin; 47483 } 47484 } 47485 throw new Error(`No event manager plugin found for event ${eventName}`); 47486 } 47487} 47488EventManager.ɵfac = function EventManager_Factory(t) { return new (t || EventManager)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](EVENT_MANAGER_PLUGINS), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"])); }; 47489EventManager.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: EventManager, factory: EventManager.ɵfac }); 47490EventManager.ctorParameters = () => [ 47491 { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [EVENT_MANAGER_PLUGINS,] }] }, 47492 { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"] } 47493]; 47494/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](EventManager, [{ 47495 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 47496 }], function () { return [{ type: Array, decorators: [{ 47497 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 47498 args: [EVENT_MANAGER_PLUGINS] 47499 }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"] }]; }, null); })(); 47500class EventManagerPlugin { 47501 constructor(_doc) { 47502 this._doc = _doc; 47503 } 47504 addGlobalEventListener(element, eventName, handler) { 47505 const target = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().getGlobalEventTarget(this._doc, element); 47506 if (!target) { 47507 throw new Error(`Unsupported event target ${target} for event ${eventName}`); 47508 } 47509 return this.addEventListener(target, eventName, handler); 47510 } 47511} 47512 47513/** 47514 * @license 47515 * Copyright Google LLC All Rights Reserved. 47516 * 47517 * Use of this source code is governed by an MIT-style license that can be 47518 * found in the LICENSE file at https://angular.io/license 47519 */ 47520class SharedStylesHost { 47521 constructor() { 47522 /** @internal */ 47523 this._stylesSet = new Set(); 47524 } 47525 addStyles(styles) { 47526 const additions = new Set(); 47527 styles.forEach(style => { 47528 if (!this._stylesSet.has(style)) { 47529 this._stylesSet.add(style); 47530 additions.add(style); 47531 } 47532 }); 47533 this.onStylesAdded(additions); 47534 } 47535 onStylesAdded(additions) { } 47536 getAllStyles() { 47537 return Array.from(this._stylesSet); 47538 } 47539} 47540SharedStylesHost.ɵfac = function SharedStylesHost_Factory(t) { return new (t || SharedStylesHost)(); }; 47541SharedStylesHost.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: SharedStylesHost, factory: SharedStylesHost.ɵfac }); 47542/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SharedStylesHost, [{ 47543 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 47544 }], function () { return []; }, null); })(); 47545class DomSharedStylesHost extends SharedStylesHost { 47546 constructor(_doc) { 47547 super(); 47548 this._doc = _doc; 47549 this._hostNodes = new Set(); 47550 this._styleNodes = new Set(); 47551 this._hostNodes.add(_doc.head); 47552 } 47553 _addStylesToHost(styles, host) { 47554 styles.forEach((style) => { 47555 const styleEl = this._doc.createElement('style'); 47556 styleEl.textContent = style; 47557 this._styleNodes.add(host.appendChild(styleEl)); 47558 }); 47559 } 47560 addHost(hostNode) { 47561 this._addStylesToHost(this._stylesSet, hostNode); 47562 this._hostNodes.add(hostNode); 47563 } 47564 removeHost(hostNode) { 47565 this._hostNodes.delete(hostNode); 47566 } 47567 onStylesAdded(additions) { 47568 this._hostNodes.forEach(hostNode => this._addStylesToHost(additions, hostNode)); 47569 } 47570 ngOnDestroy() { 47571 this._styleNodes.forEach(styleNode => Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().remove(styleNode)); 47572 } 47573} 47574DomSharedStylesHost.ɵfac = function DomSharedStylesHost_Factory(t) { return new (t || DomSharedStylesHost)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }; 47575DomSharedStylesHost.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomSharedStylesHost, factory: DomSharedStylesHost.ɵfac }); 47576DomSharedStylesHost.ctorParameters = () => [ 47577 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] } 47578]; 47579/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSharedStylesHost, [{ 47580 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 47581 }], function () { return [{ type: undefined, decorators: [{ 47582 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 47583 args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] 47584 }] }]; }, null); })(); 47585 47586/** 47587 * @license 47588 * Copyright Google LLC All Rights Reserved. 47589 * 47590 * Use of this source code is governed by an MIT-style license that can be 47591 * found in the LICENSE file at https://angular.io/license 47592 */ 47593const NAMESPACE_URIS = { 47594 'svg': 'http://www.w3.org/2000/svg', 47595 'xhtml': 'http://www.w3.org/1999/xhtml', 47596 'xlink': 'http://www.w3.org/1999/xlink', 47597 'xml': 'http://www.w3.org/XML/1998/namespace', 47598 'xmlns': 'http://www.w3.org/2000/xmlns/', 47599}; 47600const COMPONENT_REGEX = /%COMP%/g; 47601const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; 47602const COMPONENT_VARIABLE = '%COMP%'; 47603const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`; 47604const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`; 47605function shimContentAttribute(componentShortId) { 47606 return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId); 47607} 47608function shimHostAttribute(componentShortId) { 47609 return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId); 47610} 47611function flattenStyles(compId, styles, target) { 47612 for (let i = 0; i < styles.length; i++) { 47613 let style = styles[i]; 47614 if (Array.isArray(style)) { 47615 flattenStyles(compId, style, target); 47616 } 47617 else { 47618 style = style.replace(COMPONENT_REGEX, compId); 47619 target.push(style); 47620 } 47621 } 47622 return target; 47623} 47624function decoratePreventDefault(eventHandler) { 47625 // `DebugNode.triggerEventHandler` needs to know if the listener was created with 47626 // decoratePreventDefault or is a listener added outside the Angular context so it can handle the 47627 // two differently. In the first case, the special '__ngUnwrap__' token is passed to the unwrap 47628 // the listener (see below). 47629 return (event) => { 47630 // Ivy uses '__ngUnwrap__' as a special token that allows us to unwrap the function 47631 // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. The debug_node 47632 // can inspect the listener toString contents for the existence of this special token. Because 47633 // the token is a string literal, it is ensured to not be modified by compiled code. 47634 if (event === '__ngUnwrap__') { 47635 return eventHandler; 47636 } 47637 const allowDefaultBehavior = eventHandler(event); 47638 if (allowDefaultBehavior === false) { 47639 // TODO(tbosch): move preventDefault into event plugins... 47640 event.preventDefault(); 47641 event.returnValue = false; 47642 } 47643 return undefined; 47644 }; 47645} 47646class DomRendererFactory2 { 47647 constructor(eventManager, sharedStylesHost, appId) { 47648 this.eventManager = eventManager; 47649 this.sharedStylesHost = sharedStylesHost; 47650 this.appId = appId; 47651 this.rendererByCompId = new Map(); 47652 this.defaultRenderer = new DefaultDomRenderer2(eventManager); 47653 } 47654 createRenderer(element, type) { 47655 if (!element || !type) { 47656 return this.defaultRenderer; 47657 } 47658 switch (type.encapsulation) { 47659 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].Emulated: { 47660 let renderer = this.rendererByCompId.get(type.id); 47661 if (!renderer) { 47662 renderer = new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type, this.appId); 47663 this.rendererByCompId.set(type.id, renderer); 47664 } 47665 renderer.applyToHost(element); 47666 return renderer; 47667 } 47668 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].Native: 47669 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].ShadowDom: 47670 return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type); 47671 default: { 47672 if (!this.rendererByCompId.has(type.id)) { 47673 const styles = flattenStyles(type.id, type.styles, []); 47674 this.sharedStylesHost.addStyles(styles); 47675 this.rendererByCompId.set(type.id, this.defaultRenderer); 47676 } 47677 return this.defaultRenderer; 47678 } 47679 } 47680 } 47681 begin() { } 47682 end() { } 47683} 47684DomRendererFactory2.ɵfac = function DomRendererFactory2_Factory(t) { return new (t || DomRendererFactory2)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](EventManager), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](DomSharedStylesHost), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"])); }; 47685DomRendererFactory2.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomRendererFactory2, factory: DomRendererFactory2.ɵfac }); 47686DomRendererFactory2.ctorParameters = () => [ 47687 { type: EventManager }, 47688 { type: DomSharedStylesHost }, 47689 { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"],] }] } 47690]; 47691/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomRendererFactory2, [{ 47692 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 47693 }], function () { return [{ type: EventManager }, { type: DomSharedStylesHost }, { type: String, decorators: [{ 47694 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 47695 args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"]] 47696 }] }]; }, null); })(); 47697class DefaultDomRenderer2 { 47698 constructor(eventManager) { 47699 this.eventManager = eventManager; 47700 this.data = Object.create(null); 47701 } 47702 destroy() { } 47703 createElement(name, namespace) { 47704 if (namespace) { 47705 // In cases where Ivy (not ViewEngine) is giving us the actual namespace, the look up by key 47706 // will result in undefined, so we just return the namespace here. 47707 return document.createElementNS(NAMESPACE_URIS[namespace] || namespace, name); 47708 } 47709 return document.createElement(name); 47710 } 47711 createComment(value) { 47712 return document.createComment(value); 47713 } 47714 createText(value) { 47715 return document.createTextNode(value); 47716 } 47717 appendChild(parent, newChild) { 47718 parent.appendChild(newChild); 47719 } 47720 insertBefore(parent, newChild, refChild) { 47721 if (parent) { 47722 parent.insertBefore(newChild, refChild); 47723 } 47724 } 47725 removeChild(parent, oldChild) { 47726 if (parent) { 47727 parent.removeChild(oldChild); 47728 } 47729 } 47730 selectRootElement(selectorOrNode, preserveContent) { 47731 let el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) : 47732 selectorOrNode; 47733 if (!el) { 47734 throw new Error(`The selector "${selectorOrNode}" did not match any elements`); 47735 } 47736 if (!preserveContent) { 47737 el.textContent = ''; 47738 } 47739 return el; 47740 } 47741 parentNode(node) { 47742 return node.parentNode; 47743 } 47744 nextSibling(node) { 47745 return node.nextSibling; 47746 } 47747 setAttribute(el, name, value, namespace) { 47748 if (namespace) { 47749 name = namespace + ':' + name; 47750 // TODO(FW-811): Ivy may cause issues here because it's passing around 47751 // full URIs for namespaces, therefore this lookup will fail. 47752 const namespaceUri = NAMESPACE_URIS[namespace]; 47753 if (namespaceUri) { 47754 el.setAttributeNS(namespaceUri, name, value); 47755 } 47756 else { 47757 el.setAttribute(name, value); 47758 } 47759 } 47760 else { 47761 el.setAttribute(name, value); 47762 } 47763 } 47764 removeAttribute(el, name, namespace) { 47765 if (namespace) { 47766 // TODO(FW-811): Ivy may cause issues here because it's passing around 47767 // full URIs for namespaces, therefore this lookup will fail. 47768 const namespaceUri = NAMESPACE_URIS[namespace]; 47769 if (namespaceUri) { 47770 el.removeAttributeNS(namespaceUri, name); 47771 } 47772 else { 47773 // TODO(FW-811): Since ivy is passing around full URIs for namespaces 47774 // this could result in properties like `http://www.w3.org/2000/svg:cx="123"`, 47775 // which is wrong. 47776 el.removeAttribute(`${namespace}:${name}`); 47777 } 47778 } 47779 else { 47780 el.removeAttribute(name); 47781 } 47782 } 47783 addClass(el, name) { 47784 el.classList.add(name); 47785 } 47786 removeClass(el, name) { 47787 el.classList.remove(name); 47788 } 47789 setStyle(el, style, value, flags) { 47790 if (flags & _angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererStyleFlags2"].DashCase) { 47791 el.style.setProperty(style, value, !!(flags & _angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererStyleFlags2"].Important) ? 'important' : ''); 47792 } 47793 else { 47794 el.style[style] = value; 47795 } 47796 } 47797 removeStyle(el, style, flags) { 47798 if (flags & _angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererStyleFlags2"].DashCase) { 47799 el.style.removeProperty(style); 47800 } 47801 else { 47802 // IE requires '' instead of null 47803 // see https://github.com/angular/angular/issues/7916 47804 el.style[style] = ''; 47805 } 47806 } 47807 setProperty(el, name, value) { 47808 NG_DEV_MODE && checkNoSyntheticProp(name, 'property'); 47809 el[name] = value; 47810 } 47811 setValue(node, value) { 47812 node.nodeValue = value; 47813 } 47814 listen(target, event, callback) { 47815 NG_DEV_MODE && checkNoSyntheticProp(event, 'listener'); 47816 if (typeof target === 'string') { 47817 return this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback)); 47818 } 47819 return this.eventManager.addEventListener(target, event, decoratePreventDefault(callback)); 47820 } 47821} 47822const ɵ0$2 = () => '@'.charCodeAt(0); 47823const AT_CHARCODE = (ɵ0$2)(); 47824function checkNoSyntheticProp(name, nameKind) { 47825 if (name.charCodeAt(0) === AT_CHARCODE) { 47826 throw new Error(`Found the synthetic ${nameKind} ${name}. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.`); 47827 } 47828} 47829class EmulatedEncapsulationDomRenderer2 extends DefaultDomRenderer2 { 47830 constructor(eventManager, sharedStylesHost, component, appId) { 47831 super(eventManager); 47832 this.component = component; 47833 const styles = flattenStyles(appId + '-' + component.id, component.styles, []); 47834 sharedStylesHost.addStyles(styles); 47835 this.contentAttr = shimContentAttribute(appId + '-' + component.id); 47836 this.hostAttr = shimHostAttribute(appId + '-' + component.id); 47837 } 47838 applyToHost(element) { 47839 super.setAttribute(element, this.hostAttr, ''); 47840 } 47841 createElement(parent, name) { 47842 const el = super.createElement(parent, name); 47843 super.setAttribute(el, this.contentAttr, ''); 47844 return el; 47845 } 47846} 47847class ShadowDomRenderer extends DefaultDomRenderer2 { 47848 constructor(eventManager, sharedStylesHost, hostEl, component) { 47849 super(eventManager); 47850 this.sharedStylesHost = sharedStylesHost; 47851 this.hostEl = hostEl; 47852 this.component = component; 47853 if (component.encapsulation === _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].ShadowDom) { 47854 this.shadowRoot = hostEl.attachShadow({ mode: 'open' }); 47855 } 47856 else { 47857 this.shadowRoot = hostEl.createShadowRoot(); 47858 } 47859 this.sharedStylesHost.addHost(this.shadowRoot); 47860 const styles = flattenStyles(component.id, component.styles, []); 47861 for (let i = 0; i < styles.length; i++) { 47862 const styleEl = document.createElement('style'); 47863 styleEl.textContent = styles[i]; 47864 this.shadowRoot.appendChild(styleEl); 47865 } 47866 } 47867 nodeOrShadowRoot(node) { 47868 return node === this.hostEl ? this.shadowRoot : node; 47869 } 47870 destroy() { 47871 this.sharedStylesHost.removeHost(this.shadowRoot); 47872 } 47873 appendChild(parent, newChild) { 47874 return super.appendChild(this.nodeOrShadowRoot(parent), newChild); 47875 } 47876 insertBefore(parent, newChild, refChild) { 47877 return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild); 47878 } 47879 removeChild(parent, oldChild) { 47880 return super.removeChild(this.nodeOrShadowRoot(parent), oldChild); 47881 } 47882 parentNode(node) { 47883 return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node))); 47884 } 47885} 47886 47887/** 47888 * @license 47889 * Copyright Google LLC All Rights Reserved. 47890 * 47891 * Use of this source code is governed by an MIT-style license that can be 47892 * found in the LICENSE file at https://angular.io/license 47893 */ 47894class DomEventsPlugin extends EventManagerPlugin { 47895 constructor(doc) { 47896 super(doc); 47897 } 47898 // This plugin should come last in the list of plugins, because it accepts all 47899 // events. 47900 supports(eventName) { 47901 return true; 47902 } 47903 addEventListener(element, eventName, handler) { 47904 element.addEventListener(eventName, handler, false); 47905 return () => this.removeEventListener(element, eventName, handler); 47906 } 47907 removeEventListener(target, eventName, callback) { 47908 return target.removeEventListener(eventName, callback); 47909 } 47910} 47911DomEventsPlugin.ɵfac = function DomEventsPlugin_Factory(t) { return new (t || DomEventsPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }; 47912DomEventsPlugin.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomEventsPlugin, factory: DomEventsPlugin.ɵfac }); 47913DomEventsPlugin.ctorParameters = () => [ 47914 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] } 47915]; 47916/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomEventsPlugin, [{ 47917 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 47918 }], function () { return [{ type: undefined, decorators: [{ 47919 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 47920 args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] 47921 }] }]; }, null); })(); 47922 47923/** 47924 * @license 47925 * Copyright Google LLC All Rights Reserved. 47926 * 47927 * Use of this source code is governed by an MIT-style license that can be 47928 * found in the LICENSE file at https://angular.io/license 47929 */ 47930/** 47931 * Supported HammerJS recognizer event names. 47932 */ 47933const EVENT_NAMES = { 47934 // pan 47935 'pan': true, 47936 'panstart': true, 47937 'panmove': true, 47938 'panend': true, 47939 'pancancel': true, 47940 'panleft': true, 47941 'panright': true, 47942 'panup': true, 47943 'pandown': true, 47944 // pinch 47945 'pinch': true, 47946 'pinchstart': true, 47947 'pinchmove': true, 47948 'pinchend': true, 47949 'pinchcancel': true, 47950 'pinchin': true, 47951 'pinchout': true, 47952 // press 47953 'press': true, 47954 'pressup': true, 47955 // rotate 47956 'rotate': true, 47957 'rotatestart': true, 47958 'rotatemove': true, 47959 'rotateend': true, 47960 'rotatecancel': true, 47961 // swipe 47962 'swipe': true, 47963 'swipeleft': true, 47964 'swiperight': true, 47965 'swipeup': true, 47966 'swipedown': true, 47967 // tap 47968 'tap': true, 47969}; 47970/** 47971 * DI token for providing [HammerJS](http://hammerjs.github.io/) support to Angular. 47972 * @see `HammerGestureConfig` 47973 * 47974 * @ngModule HammerModule 47975 * @publicApi 47976 */ 47977const HAMMER_GESTURE_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('HammerGestureConfig'); 47978/** 47979 * Injection token used to provide a {@link HammerLoader} to Angular. 47980 * 47981 * @publicApi 47982 */ 47983const HAMMER_LOADER = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('HammerLoader'); 47984/** 47985 * An injectable [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager) 47986 * for gesture recognition. Configures specific event recognition. 47987 * @publicApi 47988 */ 47989class HammerGestureConfig { 47990 constructor() { 47991 /** 47992 * A set of supported event names for gestures to be used in Angular. 47993 * Angular supports all built-in recognizers, as listed in 47994 * [HammerJS documentation](http://hammerjs.github.io/). 47995 */ 47996 this.events = []; 47997 /** 47998 * Maps gesture event names to a set of configuration options 47999 * that specify overrides to the default values for specific properties. 48000 * 48001 * The key is a supported event name to be configured, 48002 * and the options object contains a set of properties, with override values 48003 * to be applied to the named recognizer event. 48004 * For example, to disable recognition of the rotate event, specify 48005 * `{"rotate": {"enable": false}}`. 48006 * 48007 * Properties that are not present take the HammerJS default values. 48008 * For information about which properties are supported for which events, 48009 * and their allowed and default values, see 48010 * [HammerJS documentation](http://hammerjs.github.io/). 48011 * 48012 */ 48013 this.overrides = {}; 48014 } 48015 /** 48016 * Creates a [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager) 48017 * and attaches it to a given HTML element. 48018 * @param element The element that will recognize gestures. 48019 * @returns A HammerJS event-manager object. 48020 */ 48021 buildHammer(element) { 48022 const mc = new Hammer(element, this.options); 48023 mc.get('pinch').set({ enable: true }); 48024 mc.get('rotate').set({ enable: true }); 48025 for (const eventName in this.overrides) { 48026 mc.get(eventName).set(this.overrides[eventName]); 48027 } 48028 return mc; 48029 } 48030} 48031HammerGestureConfig.ɵfac = function HammerGestureConfig_Factory(t) { return new (t || HammerGestureConfig)(); }; 48032HammerGestureConfig.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HammerGestureConfig, factory: HammerGestureConfig.ɵfac }); 48033/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerGestureConfig, [{ 48034 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 48035 }], function () { return []; }, null); })(); 48036/** 48037 * Event plugin that adds Hammer support to an application. 48038 * 48039 * @ngModule HammerModule 48040 */ 48041class HammerGesturesPlugin extends EventManagerPlugin { 48042 constructor(doc, _config, console, loader) { 48043 super(doc); 48044 this._config = _config; 48045 this.console = console; 48046 this.loader = loader; 48047 } 48048 supports(eventName) { 48049 if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) { 48050 return false; 48051 } 48052 if (!window.Hammer && !this.loader) { 48053 this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` + 48054 `loaded and no custom loader has been specified.`); 48055 return false; 48056 } 48057 return true; 48058 } 48059 addEventListener(element, eventName, handler) { 48060 const zone = this.manager.getZone(); 48061 eventName = eventName.toLowerCase(); 48062 // If Hammer is not present but a loader is specified, we defer adding the event listener 48063 // until Hammer is loaded. 48064 if (!window.Hammer && this.loader) { 48065 // This `addEventListener` method returns a function to remove the added listener. 48066 // Until Hammer is loaded, the returned function needs to *cancel* the registration rather 48067 // than remove anything. 48068 let cancelRegistration = false; 48069 let deregister = () => { 48070 cancelRegistration = true; 48071 }; 48072 this.loader() 48073 .then(() => { 48074 // If Hammer isn't actually loaded when the custom loader resolves, give up. 48075 if (!window.Hammer) { 48076 this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`); 48077 deregister = () => { }; 48078 return; 48079 } 48080 if (!cancelRegistration) { 48081 // Now that Hammer is loaded and the listener is being loaded for real, 48082 // the deregistration function changes from canceling registration to removal. 48083 deregister = this.addEventListener(element, eventName, handler); 48084 } 48085 }) 48086 .catch(() => { 48087 this.console.warn(`The "${eventName}" event cannot be bound because the custom ` + 48088 `Hammer.JS loader failed.`); 48089 deregister = () => { }; 48090 }); 48091 // Return a function that *executes* `deregister` (and not `deregister` itself) so that we 48092 // can change the behavior of `deregister` once the listener is added. Using a closure in 48093 // this way allows us to avoid any additional data structures to track listener removal. 48094 return () => { 48095 deregister(); 48096 }; 48097 } 48098 return zone.runOutsideAngular(() => { 48099 // Creating the manager bind events, must be done outside of angular 48100 const mc = this._config.buildHammer(element); 48101 const callback = function (eventObj) { 48102 zone.runGuarded(function () { 48103 handler(eventObj); 48104 }); 48105 }; 48106 mc.on(eventName, callback); 48107 return () => { 48108 mc.off(eventName, callback); 48109 // destroy mc to prevent memory leak 48110 if (typeof mc.destroy === 'function') { 48111 mc.destroy(); 48112 } 48113 }; 48114 }); 48115 } 48116 isCustomEvent(eventName) { 48117 return this._config.events.indexOf(eventName) > -1; 48118 } 48119} 48120HammerGesturesPlugin.ɵfac = function HammerGesturesPlugin_Factory(t) { return new (t || HammerGesturesPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HAMMER_GESTURE_CONFIG), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HAMMER_LOADER, 8)); }; 48121HammerGesturesPlugin.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HammerGesturesPlugin, factory: HammerGesturesPlugin.ɵfac }); 48122HammerGesturesPlugin.ctorParameters = () => [ 48123 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] }, 48124 { type: HammerGestureConfig, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [HAMMER_GESTURE_CONFIG,] }] }, 48125 { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"] }, 48126 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [HAMMER_LOADER,] }] } 48127]; 48128/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerGesturesPlugin, [{ 48129 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 48130 }], function () { return [{ type: undefined, decorators: [{ 48131 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 48132 args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] 48133 }] }, { type: HammerGestureConfig, decorators: [{ 48134 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 48135 args: [HAMMER_GESTURE_CONFIG] 48136 }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"] }, { type: undefined, decorators: [{ 48137 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] 48138 }, { 48139 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 48140 args: [HAMMER_LOADER] 48141 }] }]; }, null); })(); 48142/** 48143 * In Ivy, support for Hammer gestures is optional, so applications must 48144 * import the `HammerModule` at root to turn on support. This means that 48145 * Hammer-specific code can be tree-shaken away if not needed. 48146 */ 48147const HAMMER_PROVIDERS__POST_R3__ = []; 48148/** 48149 * In View Engine, support for Hammer gestures is built-in by default. 48150 */ 48151const HAMMER_PROVIDERS__PRE_R3__ = [ 48152 { 48153 provide: EVENT_MANAGER_PLUGINS, 48154 useClass: HammerGesturesPlugin, 48155 multi: true, 48156 deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], HAMMER_GESTURE_CONFIG, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"], [new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), HAMMER_LOADER]] 48157 }, 48158 { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] }, 48159]; 48160const HAMMER_PROVIDERS = HAMMER_PROVIDERS__POST_R3__; 48161/** 48162 * Adds support for HammerJS. 48163 * 48164 * Import this module at the root of your application so that Angular can work with 48165 * HammerJS to detect gesture events. 48166 * 48167 * Note that applications still need to include the HammerJS script itself. This module 48168 * simply sets up the coordination layer between HammerJS and Angular's EventManager. 48169 * 48170 * @publicApi 48171 */ 48172class HammerModule { 48173} 48174HammerModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: HammerModule }); 48175HammerModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ factory: function HammerModule_Factory(t) { return new (t || HammerModule)(); }, providers: HAMMER_PROVIDERS__PRE_R3__ }); 48176/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerModule, [{ 48177 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], 48178 args: [{ providers: HAMMER_PROVIDERS__PRE_R3__ }] 48179 }], null, null); })(); 48180 48181/** 48182 * @license 48183 * Copyright Google LLC All Rights Reserved. 48184 * 48185 * Use of this source code is governed by an MIT-style license that can be 48186 * found in the LICENSE file at https://angular.io/license 48187 */ 48188/** 48189 * Defines supported modifiers for key events. 48190 */ 48191const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift']; 48192const DOM_KEY_LOCATION_NUMPAD = 3; 48193// Map to convert some key or keyIdentifier values to what will be returned by getEventKey 48194const _keyMap = { 48195 // The following values are here for cross-browser compatibility and to match the W3C standard 48196 // cf http://www.w3.org/TR/DOM-Level-3-Events-key/ 48197 '\b': 'Backspace', 48198 '\t': 'Tab', 48199 '\x7F': 'Delete', 48200 '\x1B': 'Escape', 48201 'Del': 'Delete', 48202 'Esc': 'Escape', 48203 'Left': 'ArrowLeft', 48204 'Right': 'ArrowRight', 48205 'Up': 'ArrowUp', 48206 'Down': 'ArrowDown', 48207 'Menu': 'ContextMenu', 48208 'Scroll': 'ScrollLock', 48209 'Win': 'OS' 48210}; 48211// There is a bug in Chrome for numeric keypad keys: 48212// https://code.google.com/p/chromium/issues/detail?id=155654 48213// 1, 2, 3 ... are reported as A, B, C ... 48214const _chromeNumKeyPadMap = { 48215 'A': '1', 48216 'B': '2', 48217 'C': '3', 48218 'D': '4', 48219 'E': '5', 48220 'F': '6', 48221 'G': '7', 48222 'H': '8', 48223 'I': '9', 48224 'J': '*', 48225 'K': '+', 48226 'M': '-', 48227 'N': '.', 48228 'O': '/', 48229 '\x60': '0', 48230 '\x90': 'NumLock' 48231}; 48232const ɵ0$3 = (event) => event.altKey, ɵ1 = (event) => event.ctrlKey, ɵ2 = (event) => event.metaKey, ɵ3 = (event) => event.shiftKey; 48233/** 48234 * Retrieves modifiers from key-event objects. 48235 */ 48236const MODIFIER_KEY_GETTERS = { 48237 'alt': ɵ0$3, 48238 'control': ɵ1, 48239 'meta': ɵ2, 48240 'shift': ɵ3 48241}; 48242/** 48243 * @publicApi 48244 * A browser plug-in that provides support for handling of key events in Angular. 48245 */ 48246class KeyEventsPlugin extends EventManagerPlugin { 48247 /** 48248 * Initializes an instance of the browser plug-in. 48249 * @param doc The document in which key events will be detected. 48250 */ 48251 constructor(doc) { 48252 super(doc); 48253 } 48254 /** 48255 * Reports whether a named key event is supported. 48256 * @param eventName The event name to query. 48257 * @return True if the named key event is supported. 48258 */ 48259 supports(eventName) { 48260 return KeyEventsPlugin.parseEventName(eventName) != null; 48261 } 48262 /** 48263 * Registers a handler for a specific element and key event. 48264 * @param element The HTML element to receive event notifications. 48265 * @param eventName The name of the key event to listen for. 48266 * @param handler A function to call when the notification occurs. Receives the 48267 * event object as an argument. 48268 * @returns The key event that was registered. 48269 */ 48270 addEventListener(element, eventName, handler) { 48271 const parsedEvent = KeyEventsPlugin.parseEventName(eventName); 48272 const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone()); 48273 return this.manager.getZone().runOutsideAngular(() => { 48274 return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler); 48275 }); 48276 } 48277 static parseEventName(eventName) { 48278 const parts = eventName.toLowerCase().split('.'); 48279 const domEventName = parts.shift(); 48280 if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) { 48281 return null; 48282 } 48283 const key = KeyEventsPlugin._normalizeKey(parts.pop()); 48284 let fullKey = ''; 48285 MODIFIER_KEYS.forEach(modifierName => { 48286 const index = parts.indexOf(modifierName); 48287 if (index > -1) { 48288 parts.splice(index, 1); 48289 fullKey += modifierName + '.'; 48290 } 48291 }); 48292 fullKey += key; 48293 if (parts.length != 0 || key.length === 0) { 48294 // returning null instead of throwing to let another plugin process the event 48295 return null; 48296 } 48297 // NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming. 48298 // The code must remain in the `result['domEventName']` form. 48299 // return {domEventName, fullKey}; 48300 const result = {}; 48301 result['domEventName'] = domEventName; 48302 result['fullKey'] = fullKey; 48303 return result; 48304 } 48305 static getEventFullKey(event) { 48306 let fullKey = ''; 48307 let key = getEventKey(event); 48308 key = key.toLowerCase(); 48309 if (key === ' ') { 48310 key = 'space'; // for readability 48311 } 48312 else if (key === '.') { 48313 key = 'dot'; // because '.' is used as a separator in event names 48314 } 48315 MODIFIER_KEYS.forEach(modifierName => { 48316 if (modifierName != key) { 48317 const modifierGetter = MODIFIER_KEY_GETTERS[modifierName]; 48318 if (modifierGetter(event)) { 48319 fullKey += modifierName + '.'; 48320 } 48321 } 48322 }); 48323 fullKey += key; 48324 return fullKey; 48325 } 48326 /** 48327 * Configures a handler callback for a key event. 48328 * @param fullKey The event name that combines all simultaneous keystrokes. 48329 * @param handler The function that responds to the key event. 48330 * @param zone The zone in which the event occurred. 48331 * @returns A callback function. 48332 */ 48333 static eventCallback(fullKey, handler, zone) { 48334 return (event /** TODO #9100 */) => { 48335 if (KeyEventsPlugin.getEventFullKey(event) === fullKey) { 48336 zone.runGuarded(() => handler(event)); 48337 } 48338 }; 48339 } 48340 /** @internal */ 48341 static _normalizeKey(keyName) { 48342 // TODO: switch to a Map if the mapping grows too much 48343 switch (keyName) { 48344 case 'esc': 48345 return 'escape'; 48346 default: 48347 return keyName; 48348 } 48349 } 48350} 48351KeyEventsPlugin.ɵfac = function KeyEventsPlugin_Factory(t) { return new (t || KeyEventsPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }; 48352KeyEventsPlugin.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: KeyEventsPlugin, factory: KeyEventsPlugin.ɵfac }); 48353KeyEventsPlugin.ctorParameters = () => [ 48354 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] } 48355]; 48356/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](KeyEventsPlugin, [{ 48357 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 48358 }], function () { return [{ type: undefined, decorators: [{ 48359 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 48360 args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] 48361 }] }]; }, null); })(); 48362function getEventKey(event) { 48363 let key = event.key; 48364 if (key == null) { 48365 key = event.keyIdentifier; 48366 // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and 48367 // Safari cf 48368 // http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces 48369 if (key == null) { 48370 return 'Unidentified'; 48371 } 48372 if (key.startsWith('U+')) { 48373 key = String.fromCharCode(parseInt(key.substring(2), 16)); 48374 if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) { 48375 // There is a bug in Chrome for numeric keypad keys: 48376 // https://code.google.com/p/chromium/issues/detail?id=155654 48377 // 1, 2, 3 ... are reported as A, B, C ... 48378 key = _chromeNumKeyPadMap[key]; 48379 } 48380 } 48381 } 48382 return _keyMap[key] || key; 48383} 48384 48385/** 48386 * @license 48387 * Copyright Google LLC All Rights Reserved. 48388 * 48389 * Use of this source code is governed by an MIT-style license that can be 48390 * found in the LICENSE file at https://angular.io/license 48391 */ 48392/** 48393 * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing 48394 * values to be safe to use in the different DOM contexts. 48395 * 48396 * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be 48397 * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on 48398 * the website. 48399 * 48400 * In specific situations, it might be necessary to disable sanitization, for example if the 48401 * application genuinely needs to produce a `javascript:` style link with a dynamic value in it. 48402 * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...` 48403 * methods, and then binding to that value from the template. 48404 * 48405 * These situations should be very rare, and extraordinary care must be taken to avoid creating a 48406 * Cross Site Scripting (XSS) security bug! 48407 * 48408 * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as 48409 * close as possible to the source of the value, to make it easy to verify no security bug is 48410 * created by its use. 48411 * 48412 * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that 48413 * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous 48414 * code. The sanitizer leaves safe values intact. 48415 * 48416 * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in 48417 * sanitization for the value passed in. Carefully check and audit all values and code paths going 48418 * into this call. Make sure any user data is appropriately escaped for this security context. 48419 * For more detail, see the [Security Guide](http://g.co/ng/security). 48420 * 48421 * @publicApi 48422 */ 48423class DomSanitizer { 48424} 48425DomSanitizer.ɵfac = function DomSanitizer_Factory(t) { return new (t || DomSanitizer)(); }; 48426DomSanitizer.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: function DomSanitizer_Factory() { return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(DomSanitizerImpl); }, token: DomSanitizer, providedIn: "root" }); 48427/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSanitizer, [{ 48428 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], 48429 args: [{ providedIn: 'root', useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(() => DomSanitizerImpl) }] 48430 }], null, null); })(); 48431function domSanitizerImplFactory(injector) { 48432 return new DomSanitizerImpl(injector.get(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); 48433} 48434class DomSanitizerImpl extends DomSanitizer { 48435 constructor(_doc) { 48436 super(); 48437 this._doc = _doc; 48438 } 48439 sanitize(ctx, value) { 48440 if (value == null) 48441 return null; 48442 switch (ctx) { 48443 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].NONE: 48444 return value; 48445 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].HTML: 48446 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "HTML" /* Html */)) { 48447 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); 48448 } 48449 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵ_sanitizeHtml"])(this._doc, String(value)); 48450 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].STYLE: 48451 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "Style" /* Style */)) { 48452 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); 48453 } 48454 return value; 48455 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].SCRIPT: 48456 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "Script" /* Script */)) { 48457 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); 48458 } 48459 throw new Error('unsafe value used in a script context'); 48460 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].URL: 48461 const type = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵgetSanitizationBypassType"])(value); 48462 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "URL" /* Url */)) { 48463 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); 48464 } 48465 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵ_sanitizeUrl"])(String(value)); 48466 case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].RESOURCE_URL: 48467 if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "ResourceURL" /* ResourceUrl */)) { 48468 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); 48469 } 48470 throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)'); 48471 default: 48472 throw new Error(`Unexpected SecurityContext ${ctx} (see http://g.co/ng/security#xss)`); 48473 } 48474 } 48475 bypassSecurityTrustHtml(value) { 48476 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustHtml"])(value); 48477 } 48478 bypassSecurityTrustStyle(value) { 48479 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustStyle"])(value); 48480 } 48481 bypassSecurityTrustScript(value) { 48482 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustScript"])(value); 48483 } 48484 bypassSecurityTrustUrl(value) { 48485 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustUrl"])(value); 48486 } 48487 bypassSecurityTrustResourceUrl(value) { 48488 return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustResourceUrl"])(value); 48489 } 48490} 48491DomSanitizerImpl.ɵfac = function DomSanitizerImpl_Factory(t) { return new (t || DomSanitizerImpl)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }; 48492DomSanitizerImpl.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: function DomSanitizerImpl_Factory() { return domSanitizerImplFactory(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["INJECTOR"])); }, token: DomSanitizerImpl, providedIn: "root" }); 48493DomSanitizerImpl.ctorParameters = () => [ 48494 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] } 48495]; 48496/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSanitizerImpl, [{ 48497 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], 48498 args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"]] }] 48499 }], function () { return [{ type: undefined, decorators: [{ 48500 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 48501 args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] 48502 }] }]; }, null); })(); 48503 48504/** 48505 * @license 48506 * Copyright Google LLC All Rights Reserved. 48507 * 48508 * Use of this source code is governed by an MIT-style license that can be 48509 * found in the LICENSE file at https://angular.io/license 48510 */ 48511function initDomAdapter() { 48512 BrowserDomAdapter.makeCurrent(); 48513 BrowserGetTestability.init(); 48514} 48515function errorHandler() { 48516 return new _angular_core__WEBPACK_IMPORTED_MODULE_1__["ErrorHandler"](); 48517} 48518function _document() { 48519 // Tell ivy about the global document 48520 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetDocument"])(document); 48521 return document; 48522} 48523const ɵ0$4 = _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵPLATFORM_BROWSER_ID"]; 48524const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [ 48525 { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"], useValue: ɵ0$4 }, 48526 { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_INITIALIZER"], useValue: initDomAdapter, multi: true }, 48527 { provide: _angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], useFactory: _document, deps: [] }, 48528]; 48529const BROWSER_SANITIZATION_PROVIDERS__PRE_R3__ = [ 48530 { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Sanitizer"], useExisting: DomSanitizer }, 48531 { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] }, 48532]; 48533const BROWSER_SANITIZATION_PROVIDERS__POST_R3__ = []; 48534/** 48535 * @security Replacing built-in sanitization providers exposes the application to XSS risks. 48536 * Attacker-controlled data introduced by an unsanitized provider could expose your 48537 * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security). 48538 * @publicApi 48539 */ 48540const BROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS__POST_R3__; 48541/** 48542 * A factory function that returns a `PlatformRef` instance associated with browser service 48543 * providers. 48544 * 48545 * @publicApi 48546 */ 48547const platformBrowser = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["createPlatformFactory"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["platformCore"], 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS); 48548const BROWSER_MODULE_PROVIDERS = [ 48549 BROWSER_SANITIZATION_PROVIDERS, 48550 { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵINJECTOR_SCOPE"], useValue: 'root' }, 48551 { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ErrorHandler"], useFactory: errorHandler, deps: [] }, 48552 { 48553 provide: EVENT_MANAGER_PLUGINS, 48554 useClass: DomEventsPlugin, 48555 multi: true, 48556 deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"]] 48557 }, 48558 { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] }, 48559 HAMMER_PROVIDERS, 48560 { 48561 provide: DomRendererFactory2, 48562 useClass: DomRendererFactory2, 48563 deps: [EventManager, DomSharedStylesHost, _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"]] 48564 }, 48565 { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererFactory2"], useExisting: DomRendererFactory2 }, 48566 { provide: SharedStylesHost, useExisting: DomSharedStylesHost }, 48567 { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] }, 48568 { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Testability"], useClass: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Testability"], deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]] }, 48569 { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]] }, 48570 ELEMENT_PROBE_PROVIDERS, 48571]; 48572/** 48573 * Exports required infrastructure for all Angular apps. 48574 * Included by default in all Angular apps created with the CLI 48575 * `new` command. 48576 * Re-exports `CommonModule` and `ApplicationModule`, making their 48577 * exports and providers available to all apps. 48578 * 48579 * @publicApi 48580 */ 48581class BrowserModule { 48582 constructor(parentModule) { 48583 if (parentModule) { 48584 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.`); 48585 } 48586 } 48587 /** 48588 * Configures a browser-based app to transition from a server-rendered app, if 48589 * one is present on the page. 48590 * 48591 * @param params An object containing an identifier for the app to transition. 48592 * The ID must match between the client and server versions of the app. 48593 * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`. 48594 */ 48595 static withServerTransition(params) { 48596 return { 48597 ngModule: BrowserModule, 48598 providers: [ 48599 { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"], useValue: params.appId }, 48600 { provide: TRANSITION_ID, useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"] }, 48601 SERVER_TRANSITION_PROVIDERS, 48602 ], 48603 }; 48604 } 48605} 48606BrowserModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: BrowserModule }); 48607BrowserModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ factory: function BrowserModule_Factory(t) { return new (t || BrowserModule)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](BrowserModule, 12)); }, providers: BROWSER_MODULE_PROVIDERS, imports: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["CommonModule"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationModule"]] }); 48608BrowserModule.ctorParameters = () => [ 48609 { type: BrowserModule, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [BrowserModule,] }] } 48610]; 48611(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](BrowserModule, { exports: function () { return [_angular_common__WEBPACK_IMPORTED_MODULE_0__["CommonModule"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationModule"]]; } }); })(); 48612/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](BrowserModule, [{ 48613 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], 48614 args: [{ providers: BROWSER_MODULE_PROVIDERS, exports: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["CommonModule"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationModule"]] }] 48615 }], function () { return [{ type: BrowserModule, decorators: [{ 48616 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] 48617 }, { 48618 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] 48619 }, { 48620 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 48621 args: [BrowserModule] 48622 }] }]; }, null); })(); 48623 48624/** 48625 * @license 48626 * Copyright Google LLC All Rights Reserved. 48627 * 48628 * Use of this source code is governed by an MIT-style license that can be 48629 * found in the LICENSE file at https://angular.io/license 48630 */ 48631/** 48632 * Factory to create a `Meta` service instance for the current DOM document. 48633 */ 48634function createMeta() { 48635 return new Meta(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); 48636} 48637/** 48638 * A service for managing HTML `<meta>` tags. 48639 * 48640 * Properties of the `MetaDefinition` object match the attributes of the 48641 * HTML `<meta>` tag. These tags define document metadata that is important for 48642 * things like configuring a Content Security Policy, defining browser compatibility 48643 * and security settings, setting HTTP Headers, defining rich content for social sharing, 48644 * and Search Engine Optimization (SEO). 48645 * 48646 * To identify specific `<meta>` tags in a document, use an attribute selection 48647 * string in the format `"tag_attribute='value string'"`. 48648 * For example, an `attrSelector` value of `"name='description'"` matches a tag 48649 * whose `name` attribute has the value `"description"`. 48650 * Selectors are used with the `querySelector()` Document method, 48651 * in the format `meta[{attrSelector}]`. 48652 * 48653 * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta) 48654 * @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector) 48655 * 48656 * 48657 * @publicApi 48658 */ 48659class Meta { 48660 constructor(_doc) { 48661 this._doc = _doc; 48662 this._dom = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])(); 48663 } 48664 /** 48665 * Retrieves or creates a specific `<meta>` tag element in the current HTML document. 48666 * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute 48667 * values in the provided tag definition, and verifies that all other attribute values are equal. 48668 * If an existing element is found, it is returned and is not modified in any way. 48669 * @param tag The definition of a `<meta>` element to match or create. 48670 * @param forceCreation True to create a new element without checking whether one already exists. 48671 * @returns The existing element with the same attributes and values if found, 48672 * the new element if no match is found, or `null` if the tag parameter is not defined. 48673 */ 48674 addTag(tag, forceCreation = false) { 48675 if (!tag) 48676 return null; 48677 return this._getOrCreateElement(tag, forceCreation); 48678 } 48679 /** 48680 * Retrieves or creates a set of `<meta>` tag elements in the current HTML document. 48681 * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute 48682 * values in the provided tag definition, and verifies that all other attribute values are equal. 48683 * @param tags An array of tag definitions to match or create. 48684 * @param forceCreation True to create new elements without checking whether they already exist. 48685 * @returns The matching elements if found, or the new elements. 48686 */ 48687 addTags(tags, forceCreation = false) { 48688 if (!tags) 48689 return []; 48690 return tags.reduce((result, tag) => { 48691 if (tag) { 48692 result.push(this._getOrCreateElement(tag, forceCreation)); 48693 } 48694 return result; 48695 }, []); 48696 } 48697 /** 48698 * Retrieves a `<meta>` tag element in the current HTML document. 48699 * @param attrSelector The tag attribute and value to match against, in the format 48700 * `"tag_attribute='value string'"`. 48701 * @returns The matching element, if any. 48702 */ 48703 getTag(attrSelector) { 48704 if (!attrSelector) 48705 return null; 48706 return this._doc.querySelector(`meta[${attrSelector}]`) || null; 48707 } 48708 /** 48709 * Retrieves a set of `<meta>` tag elements in the current HTML document. 48710 * @param attrSelector The tag attribute and value to match against, in the format 48711 * `"tag_attribute='value string'"`. 48712 * @returns The matching elements, if any. 48713 */ 48714 getTags(attrSelector) { 48715 if (!attrSelector) 48716 return []; 48717 const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`); 48718 return list ? [].slice.call(list) : []; 48719 } 48720 /** 48721 * Modifies an existing `<meta>` tag element in the current HTML document. 48722 * @param tag The tag description with which to replace the existing tag content. 48723 * @param selector A tag attribute and value to match against, to identify 48724 * an existing tag. A string in the format `"tag_attribute=`value string`"`. 48725 * If not supplied, matches a tag with the same `name` or `property` attribute value as the 48726 * replacement tag. 48727 * @return The modified element. 48728 */ 48729 updateTag(tag, selector) { 48730 if (!tag) 48731 return null; 48732 selector = selector || this._parseSelector(tag); 48733 const meta = this.getTag(selector); 48734 if (meta) { 48735 return this._setMetaElementAttributes(tag, meta); 48736 } 48737 return this._getOrCreateElement(tag, true); 48738 } 48739 /** 48740 * Removes an existing `<meta>` tag element from the current HTML document. 48741 * @param attrSelector A tag attribute and value to match against, to identify 48742 * an existing tag. A string in the format `"tag_attribute=`value string`"`. 48743 */ 48744 removeTag(attrSelector) { 48745 this.removeTagElement(this.getTag(attrSelector)); 48746 } 48747 /** 48748 * Removes an existing `<meta>` tag element from the current HTML document. 48749 * @param meta The tag definition to match against to identify an existing tag. 48750 */ 48751 removeTagElement(meta) { 48752 if (meta) { 48753 this._dom.remove(meta); 48754 } 48755 } 48756 _getOrCreateElement(meta, forceCreation = false) { 48757 if (!forceCreation) { 48758 const selector = this._parseSelector(meta); 48759 const elem = this.getTag(selector); 48760 // It's allowed to have multiple elements with the same name so it's not enough to 48761 // just check that element with the same name already present on the page. We also need to 48762 // check if element has tag attributes 48763 if (elem && this._containsAttributes(meta, elem)) 48764 return elem; 48765 } 48766 const element = this._dom.createElement('meta'); 48767 this._setMetaElementAttributes(meta, element); 48768 const head = this._doc.getElementsByTagName('head')[0]; 48769 head.appendChild(element); 48770 return element; 48771 } 48772 _setMetaElementAttributes(tag, el) { 48773 Object.keys(tag).forEach((prop) => el.setAttribute(prop, tag[prop])); 48774 return el; 48775 } 48776 _parseSelector(tag) { 48777 const attr = tag.name ? 'name' : 'property'; 48778 return `${attr}="${tag[attr]}"`; 48779 } 48780 _containsAttributes(tag, elem) { 48781 return Object.keys(tag).every((key) => elem.getAttribute(key) === tag[key]); 48782 } 48783} 48784Meta.ɵfac = function Meta_Factory(t) { return new (t || Meta)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }; 48785Meta.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: createMeta, token: Meta, providedIn: "root" }); 48786Meta.ctorParameters = () => [ 48787 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] } 48788]; 48789/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](Meta, [{ 48790 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], 48791 args: [{ providedIn: 'root', useFactory: createMeta, deps: [] }] 48792 }], function () { return [{ type: undefined, decorators: [{ 48793 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 48794 args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] 48795 }] }]; }, null); })(); 48796 48797/** 48798 * @license 48799 * Copyright Google LLC All Rights Reserved. 48800 * 48801 * Use of this source code is governed by an MIT-style license that can be 48802 * found in the LICENSE file at https://angular.io/license 48803 */ 48804/** 48805 * Factory to create Title service. 48806 */ 48807function createTitle() { 48808 return new Title(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); 48809} 48810/** 48811 * A service that can be used to get and set the title of a current HTML document. 48812 * 48813 * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag) 48814 * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements 48815 * (representing the `<title>` tag). Instead, this service can be used to set and get the current 48816 * title value. 48817 * 48818 * @publicApi 48819 */ 48820class Title { 48821 constructor(_doc) { 48822 this._doc = _doc; 48823 } 48824 /** 48825 * Get the title of the current HTML document. 48826 */ 48827 getTitle() { 48828 return this._doc.title; 48829 } 48830 /** 48831 * Set the title of the current HTML document. 48832 * @param newTitle 48833 */ 48834 setTitle(newTitle) { 48835 this._doc.title = newTitle || ''; 48836 } 48837} 48838Title.ɵfac = function Title_Factory(t) { return new (t || Title)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); }; 48839Title.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: createTitle, token: Title, providedIn: "root" }); 48840Title.ctorParameters = () => [ 48841 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] } 48842]; 48843/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](Title, [{ 48844 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], 48845 args: [{ providedIn: 'root', useFactory: createTitle, deps: [] }] 48846 }], function () { return [{ type: undefined, decorators: [{ 48847 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 48848 args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] 48849 }] }]; }, null); })(); 48850 48851/** 48852 * @license 48853 * Copyright Google LLC All Rights Reserved. 48854 * 48855 * Use of this source code is governed by an MIT-style license that can be 48856 * found in the LICENSE file at https://angular.io/license 48857 */ 48858const win = typeof window !== 'undefined' && window || {}; 48859 48860/** 48861 * @license 48862 * Copyright Google LLC All Rights Reserved. 48863 * 48864 * Use of this source code is governed by an MIT-style license that can be 48865 * found in the LICENSE file at https://angular.io/license 48866 */ 48867class ChangeDetectionPerfRecord { 48868 constructor(msPerTick, numTicks) { 48869 this.msPerTick = msPerTick; 48870 this.numTicks = numTicks; 48871 } 48872} 48873/** 48874 * Entry point for all Angular profiling-related debug tools. This object 48875 * corresponds to the `ng.profiler` in the dev console. 48876 */ 48877class AngularProfiler { 48878 constructor(ref) { 48879 this.appRef = ref.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"]); 48880 } 48881 // tslint:disable:no-console 48882 /** 48883 * Exercises change detection in a loop and then prints the average amount of 48884 * time in milliseconds how long a single round of change detection takes for 48885 * the current state of the UI. It runs a minimum of 5 rounds for a minimum 48886 * of 500 milliseconds. 48887 * 48888 * Optionally, a user may pass a `config` parameter containing a map of 48889 * options. Supported options are: 48890 * 48891 * `record` (boolean) - causes the profiler to record a CPU profile while 48892 * it exercises the change detector. Example: 48893 * 48894 * ``` 48895 * ng.profiler.timeChangeDetection({record: true}) 48896 * ``` 48897 */ 48898 timeChangeDetection(config) { 48899 const record = config && config['record']; 48900 const profileName = 'Change Detection'; 48901 // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened 48902 const isProfilerAvailable = win.console.profile != null; 48903 if (record && isProfilerAvailable) { 48904 win.console.profile(profileName); 48905 } 48906 const start = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().performanceNow(); 48907 let numTicks = 0; 48908 while (numTicks < 5 || (Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().performanceNow() - start) < 500) { 48909 this.appRef.tick(); 48910 numTicks++; 48911 } 48912 const end = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().performanceNow(); 48913 if (record && isProfilerAvailable) { 48914 win.console.profileEnd(profileName); 48915 } 48916 const msPerTick = (end - start) / numTicks; 48917 win.console.log(`ran ${numTicks} change detection cycles`); 48918 win.console.log(`${msPerTick.toFixed(2)} ms per check`); 48919 return new ChangeDetectionPerfRecord(msPerTick, numTicks); 48920 } 48921} 48922 48923/** 48924 * @license 48925 * Copyright Google LLC All Rights Reserved. 48926 * 48927 * Use of this source code is governed by an MIT-style license that can be 48928 * found in the LICENSE file at https://angular.io/license 48929 */ 48930const PROFILER_GLOBAL_NAME = 'profiler'; 48931/** 48932 * Enabled Angular debug tools that are accessible via your browser's 48933 * developer console. 48934 * 48935 * Usage: 48936 * 48937 * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j) 48938 * 1. Type `ng.` (usually the console will show auto-complete suggestion) 48939 * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()` 48940 * then hit Enter. 48941 * 48942 * @publicApi 48943 */ 48944function enableDebugTools(ref) { 48945 exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref)); 48946 return ref; 48947} 48948/** 48949 * Disables Angular tools. 48950 * 48951 * @publicApi 48952 */ 48953function disableDebugTools() { 48954 exportNgVar(PROFILER_GLOBAL_NAME, null); 48955} 48956 48957/** 48958 * @license 48959 * Copyright Google LLC All Rights Reserved. 48960 * 48961 * Use of this source code is governed by an MIT-style license that can be 48962 * found in the LICENSE file at https://angular.io/license 48963 */ 48964function escapeHtml(text) { 48965 const escapedText = { 48966 '&': '&a;', 48967 '"': '&q;', 48968 '\'': '&s;', 48969 '<': '&l;', 48970 '>': '&g;', 48971 }; 48972 return text.replace(/[&"'<>]/g, s => escapedText[s]); 48973} 48974function unescapeHtml(text) { 48975 const unescapedText = { 48976 '&a;': '&', 48977 '&q;': '"', 48978 '&s;': '\'', 48979 '&l;': '<', 48980 '&g;': '>', 48981 }; 48982 return text.replace(/&[^;]+;/g, s => unescapedText[s]); 48983} 48984/** 48985 * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`. 48986 * 48987 * Example: 48988 * 48989 * ``` 48990 * const COUNTER_KEY = makeStateKey<number>('counter'); 48991 * let value = 10; 48992 * 48993 * transferState.set(COUNTER_KEY, value); 48994 * ``` 48995 * 48996 * @publicApi 48997 */ 48998function makeStateKey(key) { 48999 return key; 49000} 49001/** 49002 * A key value store that is transferred from the application on the server side to the application 49003 * on the client side. 49004 * 49005 * `TransferState` will be available as an injectable token. To use it import 49006 * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client. 49007 * 49008 * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only 49009 * boolean, number, string, null and non-class objects will be serialized and deserialzied in a 49010 * non-lossy manner. 49011 * 49012 * @publicApi 49013 */ 49014class TransferState { 49015 constructor() { 49016 this.store = {}; 49017 this.onSerializeCallbacks = {}; 49018 } 49019 /** @internal */ 49020 static init(initState) { 49021 const transferState = new TransferState(); 49022 transferState.store = initState; 49023 return transferState; 49024 } 49025 /** 49026 * Get the value corresponding to a key. Return `defaultValue` if key is not found. 49027 */ 49028 get(key, defaultValue) { 49029 return this.store[key] !== undefined ? this.store[key] : defaultValue; 49030 } 49031 /** 49032 * Set the value corresponding to a key. 49033 */ 49034 set(key, value) { 49035 this.store[key] = value; 49036 } 49037 /** 49038 * Remove a key from the store. 49039 */ 49040 remove(key) { 49041 delete this.store[key]; 49042 } 49043 /** 49044 * Test whether a key exists in the store. 49045 */ 49046 hasKey(key) { 49047 return this.store.hasOwnProperty(key); 49048 } 49049 /** 49050 * Register a callback to provide the value for a key when `toJson` is called. 49051 */ 49052 onSerialize(key, callback) { 49053 this.onSerializeCallbacks[key] = callback; 49054 } 49055 /** 49056 * Serialize the current state of the store to JSON. 49057 */ 49058 toJson() { 49059 // Call the onSerialize callbacks and put those values into the store. 49060 for (const key in this.onSerializeCallbacks) { 49061 if (this.onSerializeCallbacks.hasOwnProperty(key)) { 49062 try { 49063 this.store[key] = this.onSerializeCallbacks[key](); 49064 } 49065 catch (e) { 49066 console.warn('Exception in onSerialize callback: ', e); 49067 } 49068 } 49069 } 49070 return JSON.stringify(this.store); 49071 } 49072} 49073TransferState.ɵfac = function TransferState_Factory(t) { return new (t || TransferState)(); }; 49074TransferState.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: TransferState, factory: TransferState.ɵfac }); 49075/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TransferState, [{ 49076 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 49077 }], function () { return []; }, null); })(); 49078function initTransferState(doc, appId) { 49079 // Locate the script tag with the JSON data transferred from the server. 49080 // The id of the script tag is set to the Angular appId + 'state'. 49081 const script = doc.getElementById(appId + '-state'); 49082 let initialState = {}; 49083 if (script && script.textContent) { 49084 try { 49085 initialState = JSON.parse(unescapeHtml(script.textContent)); 49086 } 49087 catch (e) { 49088 console.warn('Exception while restoring TransferState for app ' + appId, e); 49089 } 49090 } 49091 return TransferState.init(initialState); 49092} 49093/** 49094 * NgModule to install on the client side while using the `TransferState` to transfer state from 49095 * server to client. 49096 * 49097 * @publicApi 49098 */ 49099class BrowserTransferStateModule { 49100} 49101BrowserTransferStateModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: BrowserTransferStateModule }); 49102BrowserTransferStateModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ factory: function BrowserTransferStateModule_Factory(t) { return new (t || BrowserTransferStateModule)(); }, providers: [{ provide: TransferState, useFactory: initTransferState, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"]] }] }); 49103/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](BrowserTransferStateModule, [{ 49104 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], 49105 args: [{ 49106 providers: [{ provide: TransferState, useFactory: initTransferState, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"]] }] 49107 }] 49108 }], null, null); })(); 49109 49110/** 49111 * @license 49112 * Copyright Google LLC All Rights Reserved. 49113 * 49114 * Use of this source code is governed by an MIT-style license that can be 49115 * found in the LICENSE file at https://angular.io/license 49116 */ 49117/** 49118 * Predicates for use with {@link DebugElement}'s query functions. 49119 * 49120 * @publicApi 49121 */ 49122class By { 49123 /** 49124 * Match all nodes. 49125 * 49126 * @usageNotes 49127 * ### Example 49128 * 49129 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'} 49130 */ 49131 static all() { 49132 return () => true; 49133 } 49134 /** 49135 * Match elements by the given CSS selector. 49136 * 49137 * @usageNotes 49138 * ### Example 49139 * 49140 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'} 49141 */ 49142 static css(selector) { 49143 return (debugElement) => { 49144 return debugElement.nativeElement != null ? 49145 elementMatches(debugElement.nativeElement, selector) : 49146 false; 49147 }; 49148 } 49149 /** 49150 * Match nodes that have the given directive present. 49151 * 49152 * @usageNotes 49153 * ### Example 49154 * 49155 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'} 49156 */ 49157 static directive(type) { 49158 return (debugNode) => debugNode.providerTokens.indexOf(type) !== -1; 49159 } 49160} 49161function elementMatches(n, selector) { 49162 if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().isElementNode(n)) { 49163 return n.matches && n.matches(selector) || 49164 n.msMatchesSelector && n.msMatchesSelector(selector) || 49165 n.webkitMatchesSelector && n.webkitMatchesSelector(selector); 49166 } 49167 return false; 49168} 49169 49170/** 49171 * @license 49172 * Copyright Google LLC All Rights Reserved. 49173 * 49174 * Use of this source code is governed by an MIT-style license that can be 49175 * found in the LICENSE file at https://angular.io/license 49176 */ 49177 49178/** 49179 * @license 49180 * Copyright Google LLC All Rights Reserved. 49181 * 49182 * Use of this source code is governed by an MIT-style license that can be 49183 * found in the LICENSE file at https://angular.io/license 49184 */ 49185/** 49186 * @publicApi 49187 */ 49188const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Version"]('10.0.14'); 49189 49190/** 49191 * @license 49192 * Copyright Google LLC All Rights Reserved. 49193 * 49194 * Use of this source code is governed by an MIT-style license that can be 49195 * found in the LICENSE file at https://angular.io/license 49196 */ 49197 49198/** 49199 * @license 49200 * Copyright Google LLC All Rights Reserved. 49201 * 49202 * Use of this source code is governed by an MIT-style license that can be 49203 * found in the LICENSE file at https://angular.io/license 49204 */ 49205// This file only reexports content of the `src` folder. Keep it that way. 49206 49207/** 49208 * @license 49209 * Copyright Google LLC All Rights Reserved. 49210 * 49211 * Use of this source code is governed by an MIT-style license that can be 49212 * found in the LICENSE file at https://angular.io/license 49213 */ 49214 49215/** 49216 * Generated bundle index. Do not edit. 49217 */ 49218 49219 49220 49221//# sourceMappingURL=platform-browser.js.map 49222 49223/***/ }), 49224
vendor: 67,840 bytes, lines 49225-50425
49225/***/ "./node_modules/@sweetalert2/ngx-sweetalert2/__ivy_ngcc__/fesm2015/sweetalert2-ngx-sweetalert2.js": 49226/*!********************************************************************************************************!*\ 49227 !*** ./node_modules/@sweetalert2/ngx-sweetalert2/__ivy_ngcc__/fesm2015/sweetalert2-ngx-sweetalert2.js ***! 49228 \********************************************************************************************************/ 49229/*! exports provided: SwalComponent, SwalDirective, SwalPortalDirective, SwalPortalTargets, SweetAlert2LoaderService, SweetAlert2Module, ɵa, ɵb, ɵc, ɵd, ɵe */ 49230/***/ (function(module, __webpack_exports__, __webpack_require__) { 49231 49232"use strict"; 49233__webpack_require__.r(__webpack_exports__); 49234/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwalComponent", function() { return SwalComponent; }); 49235/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwalDirective", function() { return SwalDirective; }); 49236/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwalPortalDirective", function() { return SwalPortalDirective; }); 49237/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwalPortalTargets", function() { return SwalPortalTargets; }); 49238/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SweetAlert2LoaderService", function() { return SweetAlert2LoaderService; }); 49239/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SweetAlert2Module", function() { return SweetAlert2Module; }); 49240/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa", function() { return provideDefaultSwal; }); 49241/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵb", function() { return swalProviderToken; }); 49242/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵc", function() { return fireOnInitToken; }); 49243/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵd", function() { return dismissOnDestroyToken; }); 49244/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵe", function() { return SwalPortalComponent; }); 49245/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/ng-recaptcha/node_modules/tslib/tslib.es6.js"); 49246/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js"); 49247/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); 49248/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js"); 49249/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js"); 49250 49251 49252 49253 49254 49255 49256 49257 49258 49259function SwalPortalComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) { 49260 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementContainer"](0); 49261} } 49262const swalProviderToken = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('@sweetalert2/ngx-sweetalert2#swalProvider'); 49263const fireOnInitToken = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('@sweetalert2/ngx-sweetalert2#fireOnInit'); 49264const dismissOnDestroyToken = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('@sweetalert2/ngx-sweetalert2#dismissOnDestroy'); 49265 49266let SweetAlert2LoaderService = class SweetAlert2LoaderService { 49267 // Using any because Angular metadata generator does not understand a pure TS type here 49268 constructor(swalProvider) { 49269 this.swalProvider = swalProvider; 49270 } 49271 get swal() { 49272 if (!this.swalPromiseCache) { 49273 this.preloadSweetAlertLibrary(); 49274 } 49275 return this.swalPromiseCache; 49276 } 49277 preloadSweetAlertLibrary() { 49278 if (this.swalPromiseCache) 49279 return; 49280 const libPromise = isLoader(this.swalProvider) 49281 ? this.swalProvider() 49282 : Promise.resolve(this.swalProvider); 49283 this.swalPromiseCache = libPromise.then(value => isDefaultExport(value) ? value : value.default); 49284 function isLoader(value) { 49285 return typeof value === 'function' && value.version === undefined; 49286 } 49287 function isDefaultExport(value) { 49288 return typeof value === 'function'; 49289 } 49290 } 49291}; 49292SweetAlert2LoaderService.ɵfac = function SweetAlert2LoaderService_Factory(t) { return new (t || SweetAlert2LoaderService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](swalProviderToken)); }; 49293SweetAlert2LoaderService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: SweetAlert2LoaderService, factory: function (t) { return SweetAlert2LoaderService.ɵfac(t); } }); 49294SweetAlert2LoaderService.ctorParameters = () => [ 49295 { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [swalProviderToken,] }] } 49296]; 49297SweetAlert2LoaderService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(swalProviderToken)) 49298], SweetAlert2LoaderService); 49299 49300/** 49301 * <swal> component. See the README.md for usage. 49302 * 49303 * It contains a bunch of @Inputs that have a perfect 1:1 mapping with SweetAlert2 options. 49304 * Their types are directly coming from SweetAlert2 types defintitions, meaning that ngx-sweetalert2 is tightly coupled 49305 * to SweetAlert2, but also is type-safe. 49306 * 49307 * (?) If you want to use an object that declares the SweetAlert2 options all at once rather than many @Inputs, 49308 * take a look at [swalOptions], that lets you pass a full {@link SweetAlertOptions} object. 49309 * 49310 * (?) If you are reading the TypeScript source of this component, you may think that it's a lot of code. 49311 * Be sure that a lot of this code is types and Angular boilerplate. Compiled and minified code is much smaller. 49312 * If you are really concerned about performance and/or don't care about the API and its convenient integration 49313 * with Angular (notably change detection and transclusion), you may totally use SweetAlert2 natively as well ;) 49314 * 49315 * /!\ Some SweetAlert options aren't @Inputs but @Outputs: onBeforeOpen, onOpen, onClose, onAfterClose and onDestroy 49316 * (but without "on*" prefix to respect community standards). 49317 * However, preConfirm and inputValidator are still @Inputs because there are not event handlers, there can't be 49318 * multiple listeners and we need the values they can/must return. 49319 */ 49320let SwalComponent = class SwalComponent { 49321 constructor(sweetAlert2Loader, moduleLevelFireOnInit, moduleLevelDismissOnDestroy) { 49322 this.sweetAlert2Loader = sweetAlert2Loader; 49323 this.moduleLevelFireOnInit = moduleLevelFireOnInit; 49324 this.moduleLevelDismissOnDestroy = moduleLevelDismissOnDestroy; 49325 /** 49326 * Emits an event when the modal DOM element has been created. 49327 * Useful to perform DOM mutations before the modal is shown. 49328 */ 49329 this.beforeOpen = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49330 /** 49331 * Emits an event when the modal is shown. 49332 */ 49333 this.open = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49334 /** 49335 * Emits an event when the modal DOM is rendered. 49336 */ 49337 this.render = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49338 /** 49339 * Emits an event when the modal will be closed. 49340 * If you just want to know when the user dismissed the modal, prefer the higher-level (cancel) output. 49341 */ 49342 this.close = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49343 /** 49344 * Emits an event after the modal had been closed. 49345 * If you just want to know when the user dismissed the modal, prefer the higher-level (cancel) output. 49346 */ 49347 this.afterClose = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49348 /** 49349 * Emits an event after the modal had been closed. 49350 * The difference between {@link destroy} and {@link afterClose} is that the latter is called for user interactions 49351 * only (clicks), whereas {@link destroy} is always called, both for user interactions and popup being closed by 49352 * another popup. 49353 */ 49354 this.destroy = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49355 /** 49356 * Emits when the user clicks "Confirm". 49357 * Bears a value when using "input", resolved "preConfirm", etc. 49358 * 49359 * Example: 49360 * <swal (confirm)="handleConfirm($event)"></swal> 49361 * 49362 * public handleConfirm(email: string): void { 49363 * // ... save user email 49364 * } 49365 */ 49366 this.confirm = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49367 /** 49368 * Emits when the user clicks "Cancel", or dismisses the modal by any other allowed way. 49369 * By default, it will emit a string representing the reason for which the SweetAlert has been closed. 49370 * The reason is `undefined` when {@link dismiss} is called. 49371 * 49372 * Example: 49373 * <swal (cancel)="handleCancel($event)"></swal> 49374 * 49375 * public handleCancel(reason: DismissReason | undefined): void { 49376 * // reason can be 'cancel', 'overlay', 'close', 'timer' or undefined. 49377 * // ... do something 49378 * } 49379 */ 49380 this.cancel = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49381 /** 49382 * This Set retains the properties that have been changed from @Inputs, so we can know precisely 49383 * what options we have to send to {@link Swal.fire}. 49384 */ 49385 this.touchedProps = new Set(); 49386 /** 49387 * A function of signature `(propName: string): void` that adds a given property name to the list of 49388 * touched properties, ie. {@link touchedProps}. 49389 */ 49390 this.markTouched = this.touchedProps.add.bind(this.touchedProps); 49391 /** 49392 * Is the SweetAlert2 modal represented by this component currently opened? 49393 */ 49394 this.isCurrentlyShown = false; 49395 } 49396 /** 49397 * An object of SweetAlert2 native options, useful if: 49398 * - you don't want to use the @Inputs for practical/philosophical reasons ; 49399 * - there are missing @Inputs because ngx-sweetalert2 isn't up-to-date with SweetAlert2's latest changes. 49400 * 49401 * /!\ Please note that setting this property does NOT erase what has been set before unless you specify the 49402 * previous properties you want to erase again. 49403 * Ie. setting { title: 'Title' } and then { text: 'Text' } will give { title: 'Title', text: 'Text' }. 49404 * 49405 * /!\ Be aware that the options defined in this object will override the @Inputs of the same name. 49406 */ 49407 set swalOptions(options) { 49408 //=> Update properties 49409 Object.assign(this, options); 49410 //=> Mark changed properties as touched 49411 const touchedKeys = Object.keys(options); 49412 touchedKeys.forEach(this.markTouched); 49413 } 49414 /** 49415 * Computes the options object that will get passed to SweetAlert2. 49416 * Only the properties that have been set at least once on this component will be returned. 49417 * Mostly for internal usage. 49418 */ 49419 get swalOptions() { 49420 //=> We will compute the options object based on the option keys that are known to have changed. 49421 // That avoids passing a gigantic object to SweetAlert2, making debugging easier and potentially 49422 // avoiding side effects. 49423 return [...this.touchedProps].reduce((obj, key) => (Object.assign(Object.assign({}, obj), { [key]: this[key] })), {}); 49424 } 49425 set swalVisible(visible) { 49426 visible ? this.fire() : this.dismiss(); 49427 } 49428 get swalVisible() { 49429 return this.isCurrentlyShown; 49430 } 49431 /** 49432 * Angular lifecycle hook. 49433 * Asks the SweetAlert2 loader service to preload the SweetAlert2 library, so it begins to be loaded only if there 49434 * is a <swal> component somewhere, and is probably fully loaded when the modal has to be displayed, 49435 * causing no delay. 49436 */ 49437 ngOnInit() { 49438 //=> Preload SweetAlert2 library in case this component is activated. 49439 this.sweetAlert2Loader.preloadSweetAlertLibrary(); 49440 } 49441 /** 49442 * Angular lifecycle hook. 49443 * Fires the modal, if the component or module is configured to do so. 49444 */ 49445 ngAfterViewInit() { 49446 const fireOnInit = this.swalFireOnInit === undefined 49447 ? this.moduleLevelFireOnInit 49448 : this.swalFireOnInit; 49449 fireOnInit && this.fire(); 49450 } 49451 /** 49452 * Angular lifecycle hook. 49453 * Updates the SweetAlert options, and if the modal is opened, asks SweetAlert to render it again. 49454 */ 49455 ngOnChanges(changes) { 49456 //=> For each changed @Input that matches a SweetAlert2 option, mark as touched so we can 49457 // send it with the next fire() or update() calls. 49458 Object.keys(changes) 49459 //=> If the filtering logic becomes more complex here, we can use Swal.isValidParameter 49460 .filter((key) => !key.startsWith('swal')) 49461 .forEach(this.markTouched); 49462 //=> Eventually trigger re-render if the modal is open. 49463 void this.update(); 49464 } 49465 /** 49466 * Angular lifecycle hook. 49467 * Closes the SweetAlert when the component is destroyed. 49468 */ 49469 ngOnDestroy() { 49470 //=> Release the modal if the component is destroyed and if that behaviour is not disabled. 49471 const dismissOnDestroy = this.swalDismissOnDestroy === undefined 49472 ? this.moduleLevelDismissOnDestroy 49473 : this.swalDismissOnDestroy; 49474 dismissOnDestroy && this.dismiss(); 49475 } 49476 /** 49477 * Shows the SweetAlert. 49478 * 49479 * Returns the SweetAlert2 promise for convenience and use in code behind templates. 49480 * Otherwise, (confirm)="myHandler($event)" and (cancel)="myHandler($event)" can be used in templates. 49481 */ 49482 fire() { 49483 return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () { 49484 const swal = yield this.sweetAlert2Loader.swal; 49485 const userOptions = this.swalOptions; 49486 //=> Build the SweetAlert2 options 49487 const options = Object.assign(Object.assign({}, userOptions), { 49488 //=> Handle modal lifecycle events 49489 onBeforeOpen: composeHook(userOptions.onBeforeOpen, (modalElement) => { 49490 this.beforeOpen.emit({ modalElement }); 49491 }), onOpen: composeHook(userOptions.onOpen, (modalElement) => { 49492 this.isCurrentlyShown = true; 49493 this.open.emit({ modalElement }); 49494 }), onRender: composeHook(userOptions.onRender, (modalElement) => { 49495 this.render.emit({ modalElement }); 49496 }), onClose: composeHook(userOptions.onClose, (modalElement) => { 49497 this.isCurrentlyShown = false; 49498 this.close.emit({ modalElement }); 49499 }), onAfterClose: composeHook(userOptions.onAfterClose, () => { 49500 this.afterClose.emit(); 49501 }), onDestroy: composeHook(userOptions.onDestroy, () => { 49502 this.destroy.emit(); 49503 }) }); 49504 //=> Show the Swal! And wait for confirmation or dimissal. 49505 const result = yield swal.fire(options); 49506 //=> Emit on (confirm) or (cancel) 49507 if ('value' in result) { 49508 this.confirm.emit(result.value); 49509 } 49510 else { 49511 this.cancel.emit(result.dismiss); 49512 } 49513 return result; 49514 function composeHook(userHook, libHook) { 49515 return (...args) => (libHook(...args), userHook === null || userHook === void 0 ? void 0 : userHook(...args)); 49516 } 49517 }); 49518 } 49519 /** 49520 * Closes the modal, if opened. 49521 * 49522 * @param result The value that the modal will resolve with, triggering either (confirm) or (cancel). 49523 * If the argument is not passed, (dimiss) will emit `undefined`. 49524 * See {@link Swal.close} 49525 */ 49526 dismiss(result) { 49527 return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () { 49528 if (!this.isCurrentlyShown) 49529 return; 49530 const swal = yield this.sweetAlert2Loader.swal; 49531 swal.close(result); 49532 }); 49533 } 49534 /** 49535 * Updates SweetAlert2 options while the modal is opened, causing the modal to re-render. 49536 * If the modal is not opened, the component options will simply be updated and that's it. 49537 * 49538 * /!\ Please note that not all SweetAlert2 options are updatable while the modal is opened. 49539 * 49540 * @param options 49541 */ 49542 update(options) { 49543 return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () { 49544 if (options) { 49545 this.swalOptions = options; 49546 } 49547 if (!this.isCurrentlyShown) 49548 return; 49549 const swal = yield this.sweetAlert2Loader.swal; 49550 const allOptions = this.swalOptions; 49551 const updatableOptions = Object.keys(allOptions) 49552 .filter(swal.isUpdatableParameter) 49553 .reduce((obj, key) => (Object.assign(Object.assign({}, obj), { [key]: allOptions[key] })), {}); 49554 swal.update(updatableOptions); 49555 }); 49556 } 49557}; 49558SwalComponent.ɵfac = function SwalComponent_Factory(t) { return new (t || SwalComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](SweetAlert2LoaderService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](fireOnInitToken), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](dismissOnDestroyToken)); }; 49559SwalComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: SwalComponent, selectors: [["swal"]], inputs: { swalOptions: "swalOptions", swalVisible: "swalVisible", title: "title", titleText: "titleText", text: "text", html: "html", footer: "footer", icon: "icon", iconHtml: "iconHtml", backdrop: "backdrop", toast: "toast", target: "target", input: "input", width: "width", padding: "padding", background: "background", position: "position", grow: "grow", showClass: "showClass", hideClass: "hideClass", customClass: "customClass", timer: "timer", timerProgressBar: "timerProgressBar", animation: "animation", heightAuto: "heightAuto", allowOutsideClick: "allowOutsideClick", allowEscapeKey: "allowEscapeKey", allowEnterKey: "allowEnterKey", stopKeydownPropagation: "stopKeydownPropagation", keydownListenerCapture: "keydownListenerCapture", showConfirmButton: "showConfirmButton", showCancelButton: "showCancelButton", confirmButtonText: "confirmButtonText", cancelButtonText: "cancelButtonText", confirmButtonColor: "confirmButtonColor", cancelButtonColor: "cancelButtonColor", confirmButtonAriaLabel: "confirmButtonAriaLabel", cancelButtonAriaLabel: "cancelButtonAriaLabel", buttonsStyling: "buttonsStyling", reverseButtons: "reverseButtons", focusConfirm: "focusConfirm", focusCancel: "focusCancel", showCloseButton: "showCloseButton", closeButtonHtml: "closeButtonHtml", closeButtonAriaLabel: "closeButtonAriaLabel", showLoaderOnConfirm: "showLoaderOnConfirm", preConfirm: "preConfirm", imageUrl: "imageUrl", imageWidth: "imageWidth", imageHeight: "imageHeight", imageAlt: "imageAlt", inputPlaceholder: "inputPlaceholder", inputValue: "inputValue", inputOptions: "inputOptions", inputAutoTrim: "inputAutoTrim", inputAttributes: "inputAttributes", inputValidator: "inputValidator", validationMessage: "validationMessage", progressSteps: "progressSteps", currentProgressStep: "currentProgressStep", progressStepsDistance: "progressStepsDistance", scrollbarPadding: "scrollbarPadding", swalFireOnInit: "swalFireOnInit", swalDismissOnDestroy: "swalDismissOnDestroy" }, outputs: { beforeOpen: "beforeOpen", open: "open", render: "render", close: "close", afterClose: "afterClose", destroy: "destroy", confirm: "confirm", cancel: "cancel" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵNgOnChangesFeature"]], decls: 0, vars: 0, template: function SwalComponent_Template(rf, ctx) { }, encapsulation: 2, changeDetection: 0 }); 49560SwalComponent.ctorParameters = () => [ 49561 { type: SweetAlert2LoaderService }, 49562 { type: Boolean, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [fireOnInitToken,] }] }, 49563 { type: Boolean, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [dismissOnDestroyToken,] }] } 49564]; 49565Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49566 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49567], SwalComponent.prototype, "title", void 0); 49568Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49569 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49570], SwalComponent.prototype, "titleText", void 0); 49571Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49572 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49573], SwalComponent.prototype, "text", void 0); 49574Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49575 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49576], SwalComponent.prototype, "html", void 0); 49577Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49578 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49579], SwalComponent.prototype, "footer", void 0); 49580Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49581 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49582], SwalComponent.prototype, "icon", void 0); 49583Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49584 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49585], SwalComponent.prototype, "iconHtml", void 0); 49586Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49587 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49588], SwalComponent.prototype, "backdrop", void 0); 49589Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49590 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49591], SwalComponent.prototype, "toast", void 0); 49592Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49593 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49594], SwalComponent.prototype, "target", void 0); 49595Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49596 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49597], SwalComponent.prototype, "input", void 0); 49598Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49599 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49600], SwalComponent.prototype, "width", void 0); 49601Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49602 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49603], SwalComponent.prototype, "padding", void 0); 49604Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49605 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49606], SwalComponent.prototype, "background", void 0); 49607Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49608 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49609], SwalComponent.prototype, "position", void 0); 49610Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49611 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49612], SwalComponent.prototype, "grow", void 0); 49613Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49614 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49615], SwalComponent.prototype, "showClass", void 0); 49616Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49617 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49618], SwalComponent.prototype, "hideClass", void 0); 49619Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49620 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49621], SwalComponent.prototype, "customClass", void 0); 49622Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49623 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49624], SwalComponent.prototype, "timer", void 0); 49625Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49626 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49627], SwalComponent.prototype, "timerProgressBar", void 0); 49628Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49629 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49630], SwalComponent.prototype, "animation", void 0); 49631Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49632 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49633], SwalComponent.prototype, "heightAuto", void 0); 49634Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49635 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49636], SwalComponent.prototype, "allowOutsideClick", void 0); 49637Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49638 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49639], SwalComponent.prototype, "allowEscapeKey", void 0); 49640Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49641 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49642], SwalComponent.prototype, "allowEnterKey", void 0); 49643Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49644 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49645], SwalComponent.prototype, "stopKeydownPropagation", void 0); 49646Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49647 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49648], SwalComponent.prototype, "keydownListenerCapture", void 0); 49649Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49650 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49651], SwalComponent.prototype, "showConfirmButton", void 0); 49652Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49653 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49654], SwalComponent.prototype, "showCancelButton", void 0); 49655Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49656 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49657], SwalComponent.prototype, "confirmButtonText", void 0); 49658Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49659 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49660], SwalComponent.prototype, "cancelButtonText", void 0); 49661Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49662 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49663], SwalComponent.prototype, "confirmButtonColor", void 0); 49664Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49665 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49666], SwalComponent.prototype, "cancelButtonColor", void 0); 49667Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49668 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49669], SwalComponent.prototype, "confirmButtonAriaLabel", void 0); 49670Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49671 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49672], SwalComponent.prototype, "cancelButtonAriaLabel", void 0); 49673Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49674 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49675], SwalComponent.prototype, "buttonsStyling", void 0); 49676Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49677 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49678], SwalComponent.prototype, "reverseButtons", void 0); 49679Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49680 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49681], SwalComponent.prototype, "focusConfirm", void 0); 49682Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49683 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49684], SwalComponent.prototype, "focusCancel", void 0); 49685Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49686 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49687], SwalComponent.prototype, "showCloseButton", void 0); 49688Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49689 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49690], SwalComponent.prototype, "closeButtonHtml", void 0); 49691Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49692 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49693], SwalComponent.prototype, "closeButtonAriaLabel", void 0); 49694Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49695 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49696], SwalComponent.prototype, "showLoaderOnConfirm", void 0); 49697Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49698 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49699], SwalComponent.prototype, "preConfirm", void 0); 49700Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49701 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49702], SwalComponent.prototype, "imageUrl", void 0); 49703Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49704 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49705], SwalComponent.prototype, "imageWidth", void 0); 49706Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49707 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49708], SwalComponent.prototype, "imageHeight", void 0); 49709Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49710 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49711], SwalComponent.prototype, "imageAlt", void 0); 49712Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49713 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49714], SwalComponent.prototype, "inputPlaceholder", void 0); 49715Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49716 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49717], SwalComponent.prototype, "inputValue", void 0); 49718Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49719 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49720], SwalComponent.prototype, "inputOptions", void 0); 49721Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49722 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49723], SwalComponent.prototype, "inputAutoTrim", void 0); 49724Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49725 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49726], SwalComponent.prototype, "inputAttributes", void 0); 49727Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49728 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49729], SwalComponent.prototype, "inputValidator", void 0); 49730Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49731 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49732], SwalComponent.prototype, "validationMessage", void 0); 49733Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49734 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49735], SwalComponent.prototype, "progressSteps", void 0); 49736Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49737 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49738], SwalComponent.prototype, "currentProgressStep", void 0); 49739Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49740 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49741], SwalComponent.prototype, "progressStepsDistance", void 0); 49742Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49743 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49744], SwalComponent.prototype, "scrollbarPadding", void 0); 49745Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49746 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49747], SwalComponent.prototype, "swalOptions", null); 49748Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49749 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49750], SwalComponent.prototype, "swalFireOnInit", void 0); 49751Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49752 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49753], SwalComponent.prototype, "swalDismissOnDestroy", void 0); 49754Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49755 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49756], SwalComponent.prototype, "swalVisible", null); 49757Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49758 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49759], SwalComponent.prototype, "beforeOpen", void 0); 49760Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49761 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49762], SwalComponent.prototype, "open", void 0); 49763Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49764 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49765], SwalComponent.prototype, "render", void 0); 49766Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49767 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49768], SwalComponent.prototype, "close", void 0); 49769Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49770 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49771], SwalComponent.prototype, "afterClose", void 0); 49772Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49773 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49774], SwalComponent.prototype, "destroy", void 0); 49775Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49776 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49777], SwalComponent.prototype, "confirm", void 0); 49778Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49779 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49780], SwalComponent.prototype, "cancel", void 0); 49781SwalComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(1, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(fireOnInitToken)), 49782 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(2, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(dismissOnDestroyToken)) 49783], SwalComponent); 49784 49785/** 49786 * [swal] directive. It takes a value that defines the SweetAlert and can be of three types: 49787 * 49788 * 1) A simple array of two or three strings defining [title, text, icon] - the icon being optional, ex: 49789 * 49790 * <button [swal]="['Title', 'Text']">Click me</button> 49791 * 49792 * 2) A native SweetAlert2 options object, ex: 49793 * 49794 * <button [swal]="{ title: 'Title', text: 'Text' }">Click me</button> 49795 * 49796 * 3) A reference to an existing SwalComponent instance for more advanced uses, ex: 49797 * 49798 * <button [swal]="mySwal">Click me</button> 49799 * <swal #mySwal title="Title" text="Text"></swal> 49800 */ 49801let SwalDirective = class SwalDirective { 49802 constructor(viewContainerRef, resolver) { 49803 this.viewContainerRef = viewContainerRef; 49804 this.resolver = resolver; 49805 /** 49806 * Emits when the user clicks "Confirm". 49807 * Bears a value when using "input", resolved "preConfirm", etc. 49808 * 49809 * Example: 49810 * <swal (confirm)="handleConfirm($event)"></swal> 49811 * 49812 * public handleConfirm(email: string): void { 49813 * // ... save user email 49814 * } 49815 */ 49816 this.confirm = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49817 /** 49818 * Emits when the user clicks "Cancel", or dismisses the modal by any other allowed way. 49819 * By default, it will emit a string representing the reason for which the SweetAlert has been closed. 49820 * The reason is `undefined` when {@link dismiss} is called. 49821 * 49822 * Example: 49823 * <swal (cancel)="handleCancel($event)"></swal> 49824 * 49825 * public handleCancel(reason: DismissReason | undefined): void { 49826 * // reason can be 'cancel', 'overlay', 'close', 'timer' or undefined. 49827 * // ... do something 49828 * } 49829 */ 49830 this.cancel = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 49831 } 49832 /** 49833 * SweetAlert2 options or a SwalComponent instance. 49834 * See the class doc block for more informations. 49835 */ 49836 set swal(options) { 49837 if (options instanceof SwalComponent) { 49838 this.swalInstance = options; 49839 } 49840 else if (isArrayOptions(options)) { 49841 this.swalOptions = {}; 49842 [this.swalOptions.title, this.swalOptions.text, this.swalOptions.icon] = options; 49843 } 49844 else { 49845 this.swalOptions = options; 49846 } 49847 function isArrayOptions(value) { 49848 return Array.isArray(options); 49849 } 49850 } 49851 /** 49852 * OnInit lifecycle handler. 49853 * Creates a SwalComponent instance if the user didn't provided one and binds on that component (confirm) and 49854 * (cancel) outputs to reemit on the directive. 49855 */ 49856 ngOnInit() { 49857 if (!this.swalInstance) { 49858 const factory = this.resolver.resolveComponentFactory(SwalComponent); 49859 this.swalRef = this.viewContainerRef.createComponent(factory); 49860 this.swalInstance = this.swalRef.instance; 49861 } 49862 } 49863 /** 49864 * OnDestroy lifecycle handler. 49865 * Destroys the dynamically-created SwalComponent. 49866 */ 49867 ngOnDestroy() { 49868 if (this.swalRef) { 49869 this.swalRef.destroy(); 49870 } 49871 } 49872 /** 49873 * Click handler. 49874 * The directive listens for onclick events on its host element. 49875 * When this happens, it shows the <swal> attached to this directive. 49876 */ 49877 onClick(event) { 49878 event.preventDefault(); 49879 event.stopImmediatePropagation(); 49880 event.stopPropagation(); 49881 if (!this.swalInstance) 49882 return; 49883 if (this.swalOptions) { 49884 this.swalInstance.swalOptions = this.swalOptions; 49885 } 49886 const swalClosed = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"](); 49887 this.swalInstance.confirm.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(swalClosed)).subscribe(v => this.confirm.emit(v)); 49888 this.swalInstance.cancel.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(swalClosed)).subscribe(v => this.cancel.emit(v)); 49889 this.swalInstance.fire().then(() => swalClosed.next()); 49890 } 49891}; 49892SwalDirective.ɵfac = function SwalDirective_Factory(t) { return new (t || SwalDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"])); }; 49893SwalDirective.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: SwalDirective, selectors: [["", "swal", ""]], hostBindings: function SwalDirective_HostBindings(rf, ctx) { if (rf & 1) { 49894 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function SwalDirective_click_HostBindingHandler($event) { return ctx.onClick($event); }); 49895 } }, inputs: { swal: "swal" }, outputs: { confirm: "confirm", cancel: "cancel" } }); 49896SwalDirective.ctorParameters = () => [ 49897 { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] }, 49898 { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"] } 49899]; 49900Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49901 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 49902], SwalDirective.prototype, "swal", null); 49903Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49904 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49905], SwalDirective.prototype, "confirm", void 0); 49906Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49907 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])() 49908], SwalDirective.prototype, "cancel", void 0); 49909Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 49910 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"])('click', ['$event']) 49911], SwalDirective.prototype, "onClick", null); 49912 49913/** 49914 * Represents an object of targets for <swal> portals (use with *swalPortal directive). 49915 * We must use thunks to access the Swal.* functions listed below, because they get created after the first modal is 49916 * shown, so this object lets us reference those functions safely and in a statically-typed manner. 49917 */ 49918let SwalPortalTargets = class SwalPortalTargets { 49919 constructor() { 49920 /** 49921 * Targets the modal close button block contents. 49922 */ 49923 this.closeButton = { 49924 element: swal => swal.getCloseButton(), 49925 options: { showCloseButton: true } 49926 }; 49927 /** 49928 * Targets the modal title block contents. 49929 */ 49930 this.title = { 49931 element: swal => swal.getTitle(), 49932 // Empty text that will never be shown but necessary so SweetAlert2 makes the div visible. 49933 options: { title: ' ' } 49934 }; 49935 /** 49936 * Targets the modal text block contents (that is another block inside the first content block, so you can still 49937 * use other modal features like Swal inputs, that are situated inside that parent content block). 49938 */ 49939 this.content = { 49940 element: swal => swal.getHtmlContainer(), 49941 // Empty text that will never be shown but necessary so SweetAlert2 makes the div visible. 49942 options: { text: ' ' } 49943 }; 49944 /** 49945 * Targets the actions block contents, where are the confirm and cancel buttons in a normal time. 49946 * /!\ WARNING: using this target destroys some of the native SweetAlert2 modal's DOM, therefore, if you use this 49947 * target, do not update the modal via <swal> @Inputs while the modal is open, or you'll get an error. 49948 * We could workaround that inconvenient inside this integration, but that'd be detrimental to memory and 49949 * performance of everyone, for a relatively rare use case. 49950 */ 49951 this.actions = { 49952 element: swal => swal.getActions(), 49953 // The button will never exist, but SweetAlert2 shows the actions block only if there is at least one button. 49954 options: { showConfirmButton: true } 49955 }; 49956 /** 49957 * Targets the confirm button contents, replacing the text inside it (not the button itself) 49958 */ 49959 this.confirmButton = { 49960 element: swal => swal.getConfirmButton(), 49961 options: { showConfirmButton: true } 49962 }; 49963 /** 49964 * Targets the cancel button contents, replacing the text inside it (not the button itself) 49965 */ 49966 this.cancelButton = { 49967 element: swal => swal.getCancelButton(), 49968 options: { showCancelButton: true } 49969 }; 49970 /** 49971 * Targets the modal footer contents. 49972 */ 49973 this.footer = { 49974 element: swal => swal.getFooter(), 49975 // Empty text that will never be shown but necessary so SweetAlert2 makes the div visible. 49976 options: { footer: ' ' } 49977 }; 49978 } 49979}; 49980SwalPortalTargets.ɵfac = function SwalPortalTargets_Factory(t) { return new (t || SwalPortalTargets)(); }; 49981SwalPortalTargets.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: function SwalPortalTargets_Factory() { return new SwalPortalTargets(); }, token: SwalPortalTargets, providedIn: "root" }); 49982 49983/** 49984 * @internal 49985 * Holds a consumer's Angular template and displays it on a Sweet Alert. 49986 * See SwalPortalDirective for info about the covered feature. 49987 */ 49988let SwalPortalComponent = class SwalPortalComponent { 49989 constructor() { 49990 this.template = null; 49991 } 49992}; 49993SwalPortalComponent.ɵfac = function SwalPortalComponent_Factory(t) { return new (t || SwalPortalComponent)(); }; 49994SwalPortalComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: SwalPortalComponent, selectors: [["swal-portal"]], inputs: { template: "template" }, decls: 1, vars: 1, consts: [[4, "ngTemplateOutlet"]], template: function SwalPortalComponent_Template(rf, ctx) { if (rf & 1) { 49995 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](0, SwalPortalComponent_ng_container_0_Template, 1, 0, "ng-container", 0); 49996 } if (rf & 2) { 49997 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngTemplateOutlet", ctx.template); 49998 } }, directives: [_angular_common__WEBPACK_IMPORTED_MODULE_4__["NgTemplateOutlet"]], encapsulation: 2, changeDetection: 0 }); 49999Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50000 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])() 50001], SwalPortalComponent.prototype, "template", void 0); 50002 50003/** 50004 * A structural directive that lets you use Angular templates inside of SweetAlerts. 50005 * There are different targetable zones provided by {@link SwalPortalTargets}: title, content, confirmButton, etc, but 50006 * you can also make your own target by implementing {@link SwalPortalTarget} and giving it to this directive. 50007 * The default target is the alert text content zone. 50008 * 50009 * Usage in your component's TypeScript (if you use another target than {@link SwalPortalTargets.content}): 50010 * 50011 * @Component({ ... }) 50012 * export class MyComponent { 50013 * public constructor(public readonly swalTargets: SwalPortalTargets) { 50014 * } 50015 * } 50016 * 50017 * Usage in the template: 50018 * 50019 * <swal title="Fill the form" (confirm)="confirmHandler()"> 50020 * <!-- This form will be displayed as the alert main content 50021 * Targets the alert's main content zone by default --> 50022 * <form *swalPortal [formControl]="myForm"> 50023 * ... 50024 * </form> 50025 * 50026 * <!-- This targets the confirm button's inner content 50027 * Notice the usage of ng-container to avoid creating an useless DOM element inside the button --> 50028 * <ng-container *swalPortal="swalTargets.confirmButton"> 50029 * Send ({{ secondsLeft }} seconds left) 50030 * </ng-container> 50031 * <swal> 50032 */ 50033let SwalPortalDirective = class SwalPortalDirective { 50034 constructor(resolver, injector, app, templateRef, sweetAlert2Loader, swalTargets, swalComponent) { 50035 this.resolver = resolver; 50036 this.injector = injector; 50037 this.app = app; 50038 this.templateRef = templateRef; 50039 this.sweetAlert2Loader = sweetAlert2Loader; 50040 this.swalTargets = swalTargets; 50041 this.swalComponent = swalComponent; 50042 this.destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"](); 50043 } 50044 /** 50045 * Subscribes to the the SweetAlert appearance/disappearance events to create/destroy the SwalPortalComponent 50046 * that will receive the consumer's template. 50047 */ 50048 ngOnInit() { 50049 // Can't be set in a default property value, if the customer lets *swalPortal empty, the value we get is undef. 50050 this.target = this.target || this.swalTargets.content; 50051 //=> Apply the options provided by the target definition 50052 void this.swalComponent.update(this.target.options); 50053 //=> Subscribe to a few hooks frm the parent SwalComponent. 50054 this.swalComponent.render.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this.destroyed)).subscribe(this.renderHook.bind(this)); 50055 this.swalComponent.beforeOpen.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this.destroyed)).subscribe(this.beforeOpenHook.bind(this)); 50056 this.swalComponent.destroy.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this.destroyed)).subscribe(this.destroyHook.bind(this)); 50057 } 50058 /** 50059 * Signal any {@link destroyed} consumer that this is over, so they can unsubscribe from the 50060 * parent SwalComponent events. 50061 */ 50062 ngOnDestroy() { 50063 this.destroyed.next(); 50064 } 50065 /** 50066 * This render hook runs 1..n times (per modal instance), just before the modal is shown (and also before the 50067 * {@link beforeOpenHook}), or after Swal.update() is called. 50068 * This is a good place to render, or re-render, our portal contents. 50069 */ 50070 renderHook() { 50071 return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () { 50072 //=> Ensure the portal component is created 50073 if (!this.portalComponentRef) { 50074 this.portalComponentRef = this.createPortalComponent(); 50075 } 50076 //=> SweetAlert2 created the modal or just erased all of our content, so we need to install/reinstall it. 50077 // Swal.update() is synchronous, this observable too, and mountComponentOnTarget too (the promise inside 50078 // this function is already resolved at this point), so the whole process of re-rendering and re-mounting 50079 // the portal component is fully synchronous, causing no blinks in the modal contents. 50080 const swal = yield this.sweetAlert2Loader.swal; 50081 //=> Find target element 50082 const targetEl = this.target.element(swal); 50083 if (!targetEl) 50084 return; 50085 //=> Replace target's contents with our component 50086 // https://jsperf.com/innerhtml-vs-removechild/15 50087 while (targetEl.firstChild) { 50088 targetEl.removeChild(targetEl.firstChild); 50089 } 50090 targetEl.appendChild(this.portalComponentRef.location.nativeElement); 50091 }); 50092 } 50093 /** 50094 * This beforeOpen hook runs once (per modal instance), just before the modal is shown on the screen. 50095 * This is a good place to declare our detached view to the Angular app. 50096 */ 50097 beforeOpenHook() { 50098 if (!this.portalComponentRef) 50099 return; 50100 //=> Make the Angular app aware of that detached view so rendering and change detection can happen 50101 this.app.attachView(this.portalComponentRef.hostView); 50102 } 50103 /** 50104 * This afterClose hook runs once (per modal instance), just after the modal closing animation terminated. 50105 * This is a good place to detach and destroy our content, that is not visible anymore. 50106 */ 50107 destroyHook() { 50108 if (!this.portalComponentRef) 50109 return; 50110 //=> Detach the portal component from the app and destroy it 50111 this.app.detachView(this.portalComponentRef.hostView); 50112 this.portalComponentRef.destroy(); 50113 this.portalComponentRef = void 0; 50114 } 50115 /** 50116 * Creates the {@link SwalPortalComponent} and gives it the customer's template ref. 50117 */ 50118 createPortalComponent() { 50119 //=> Create the SwalPortalComponent that will hold our content 50120 const factory = this.resolver.resolveComponentFactory(SwalPortalComponent); 50121 // Yes, we do not use the third argument that would directly use the target as the component's view 50122 // (unfortunately, because that would give a cleaner DOM and would avoid dirty and direct DOM manipulations) 50123 // That's because we want to keep our component safe from SweetAlert2's operations on the DOM, and to be 50124 // able to restore it at any moment, ie. after the modal has been re-rendered. 50125 const componentRef = factory.create(this.injector, []); 50126 //=> Apply the consumer's template on the component 50127 componentRef.instance.template = this.templateRef; 50128 return componentRef; 50129 } 50130}; 50131SwalPortalDirective.ɵfac = function SwalPortalDirective_Factory(t) { return new (t || SwalPortalDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](SweetAlert2LoaderService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](SwalPortalTargets), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](SwalComponent, 1)); }; 50132SwalPortalDirective.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: SwalPortalDirective, selectors: [["", "swalPortal", ""]], inputs: { target: ["swalPortal", "target"] } }); 50133SwalPortalDirective.ctorParameters = () => [ 50134 { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"] }, 50135 { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }, 50136 { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"] }, 50137 { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"] }, 50138 { type: SweetAlert2LoaderService }, 50139 { type: SwalPortalTargets }, 50140 { type: SwalComponent, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] }] } 50141]; 50142Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50143 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])('swalPortal') 50144], SwalPortalDirective.prototype, "target", void 0); 50145SwalPortalDirective = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(6, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"])()) 50146], SwalPortalDirective); 50147 50148var SweetAlert2Module_1; 50149function provideDefaultSwal() { 50150 return Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(null, /*! sweetalert2 */ "./node_modules/sweetalert2/dist/sweetalert2.all.js", 7)); 50151} 50152let SweetAlert2Module = SweetAlert2Module_1 = class SweetAlert2Module { 50153 static forRoot(options = {}) { 50154 return { 50155 ngModule: SweetAlert2Module_1, 50156 providers: [ 50157 SweetAlert2LoaderService, 50158 { provide: swalProviderToken, useValue: options.provideSwal || provideDefaultSwal }, 50159 { provide: fireOnInitToken, useValue: options.fireOnInit || false }, 50160 { provide: dismissOnDestroyToken, useValue: options.dismissOnDestroy || true } 50161 ] 50162 }; 50163 } 50164 static forChild(options = {}) { 50165 return { 50166 ngModule: SweetAlert2Module_1, 50167 providers: [ 50168 ...options.provideSwal ? [ 50169 SweetAlert2LoaderService, 50170 { provide: swalProviderToken, useValue: options.provideSwal } 50171 ] : [], 50172 ...options.fireOnInit !== undefined ? [ 50173 { provide: fireOnInitToken, useValue: options.fireOnInit } 50174 ] : [], 50175 ...options.dismissOnDestroy !== undefined ? [ 50176 { provide: dismissOnDestroyToken, useValue: options.dismissOnDestroy } 50177 ] : [] 50178 ] 50179 }; 50180 } 50181}; 50182SweetAlert2Module.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: SweetAlert2Module }); 50183SweetAlert2Module.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ factory: function SweetAlert2Module_Factory(t) { return new (t || SweetAlert2Module)(); }, imports: [[ 50184 _angular_common__WEBPACK_IMPORTED_MODULE_4__["CommonModule"] 50185 ]] }); 50186/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SweetAlert2LoaderService, [{ 50187 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 50188 }], function () { return [{ type: undefined, decorators: [{ 50189 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50190 args: [swalProviderToken] 50191 }] }]; }, null); })(); 50192/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SwalComponent, [{ 50193 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], 50194 args: [{ 50195 // tslint:disable-next-line:component-selector 50196 selector: 'swal', 50197 template: '', 50198 changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush 50199 }] 50200 }], function () { return [{ type: SweetAlert2LoaderService }, { type: Boolean, decorators: [{ 50201 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50202 args: [fireOnInitToken] 50203 }] }, { type: Boolean, decorators: [{ 50204 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50205 args: [dismissOnDestroyToken] 50206 }] }]; }, { beforeOpen: [{ 50207 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50208 }], open: [{ 50209 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50210 }], render: [{ 50211 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50212 }], close: [{ 50213 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50214 }], afterClose: [{ 50215 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50216 }], destroy: [{ 50217 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50218 }], confirm: [{ 50219 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50220 }], cancel: [{ 50221 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50222 }], swalOptions: [{ 50223 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50224 }], swalVisible: [{ 50225 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50226 }], title: [{ 50227 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50228 }], titleText: [{ 50229 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50230 }], text: [{ 50231 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50232 }], html: [{ 50233 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50234 }], footer: [{ 50235 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50236 }], icon: [{ 50237 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50238 }], iconHtml: [{ 50239 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50240 }], backdrop: [{ 50241 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50242 }], toast: [{ 50243 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50244 }], target: [{ 50245 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50246 }], input: [{ 50247 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50248 }], width: [{ 50249 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50250 }], padding: [{ 50251 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50252 }], background: [{ 50253 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50254 }], position: [{ 50255 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50256 }], grow: [{ 50257 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50258 }], showClass: [{ 50259 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50260 }], hideClass: [{ 50261 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50262 }], customClass: [{ 50263 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50264 }], timer: [{ 50265 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50266 }], timerProgressBar: [{ 50267 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50268 }], animation: [{ 50269 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50270 }], heightAuto: [{ 50271 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50272 }], allowOutsideClick: [{ 50273 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50274 }], allowEscapeKey: [{ 50275 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50276 }], allowEnterKey: [{ 50277 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50278 }], stopKeydownPropagation: [{ 50279 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50280 }], keydownListenerCapture: [{ 50281 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50282 }], showConfirmButton: [{ 50283 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50284 }], showCancelButton: [{ 50285 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50286 }], confirmButtonText: [{ 50287 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50288 }], cancelButtonText: [{ 50289 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50290 }], confirmButtonColor: [{ 50291 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50292 }], cancelButtonColor: [{ 50293 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50294 }], confirmButtonAriaLabel: [{ 50295 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50296 }], cancelButtonAriaLabel: [{ 50297 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50298 }], buttonsStyling: [{ 50299 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50300 }], reverseButtons: [{ 50301 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50302 }], focusConfirm: [{ 50303 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50304 }], focusCancel: [{ 50305 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50306 }], showCloseButton: [{ 50307 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50308 }], closeButtonHtml: [{ 50309 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50310 }], closeButtonAriaLabel: [{ 50311 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50312 }], showLoaderOnConfirm: [{ 50313 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50314 }], preConfirm: [{ 50315 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50316 }], imageUrl: [{ 50317 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50318 }], imageWidth: [{ 50319 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50320 }], imageHeight: [{ 50321 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50322 }], imageAlt: [{ 50323 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50324 }], inputPlaceholder: [{ 50325 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50326 }], inputValue: [{ 50327 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50328 }], inputOptions: [{ 50329 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50330 }], inputAutoTrim: [{ 50331 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50332 }], inputAttributes: [{ 50333 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50334 }], inputValidator: [{ 50335 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50336 }], validationMessage: [{ 50337 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50338 }], progressSteps: [{ 50339 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50340 }], currentProgressStep: [{ 50341 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50342 }], progressStepsDistance: [{ 50343 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50344 }], scrollbarPadding: [{ 50345 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50346 }], swalFireOnInit: [{ 50347 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50348 }], swalDismissOnDestroy: [{ 50349 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50350 }] }); })(); 50351/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SwalDirective, [{ 50352 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], 50353 args: [{ 50354 selector: '[swal]' 50355 }] 50356 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"] }]; }, { confirm: [{ 50357 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50358 }], cancel: [{ 50359 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50360 }], swal: [{ 50361 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50362 }], 50363 /** 50364 * Click handler. 50365 * The directive listens for onclick events on its host element. 50366 * When this happens, it shows the <swal> attached to this directive. 50367 */ 50368 onClick: [{ 50369 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"], 50370 args: ['click', ['$event']] 50371 }] }); })(); 50372/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SwalPortalTargets, [{ 50373 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], 50374 args: [{ providedIn: 'root' }] 50375 }], function () { return []; }, null); })(); 50376/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SwalPortalComponent, [{ 50377 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], 50378 args: [{ 50379 selector: 'swal-portal', 50380 template: '<ng-container *ngTemplateOutlet="template"></ng-container>', 50381 changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush 50382 }] 50383 }], function () { return []; }, { template: [{ 50384 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50385 }] }); })(); 50386/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SwalPortalDirective, [{ 50387 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], 50388 args: [{ 50389 selector: '[swalPortal]' 50390 }] 50391 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"] }, { type: SweetAlert2LoaderService }, { type: SwalPortalTargets }, { type: SwalComponent, decorators: [{ 50392 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Host"] 50393 }] }]; }, { target: [{ 50394 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], 50395 args: ['swalPortal'] 50396 }] }); })(); 50397(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](SweetAlert2Module, { declarations: function () { return [SwalDirective, SwalComponent, SwalPortalDirective, SwalPortalComponent]; }, imports: function () { return [_angular_common__WEBPACK_IMPORTED_MODULE_4__["CommonModule"]]; }, exports: function () { return [SwalComponent, SwalPortalDirective, SwalDirective]; } }); })(); 50398/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SweetAlert2Module, [{ 50399 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], 50400 args: [{ 50401 declarations: [ 50402 SwalDirective, SwalComponent, SwalPortalDirective, SwalPortalComponent 50403 ], 50404 imports: [ 50405 _angular_common__WEBPACK_IMPORTED_MODULE_4__["CommonModule"] 50406 ], 50407 exports: [ 50408 SwalComponent, SwalPortalDirective, SwalDirective 50409 ], 50410 entryComponents: [ 50411 SwalComponent, SwalPortalComponent 50412 ] 50413 }] 50414 }], null, null); })(); 50415 50416/** 50417 * Generated bundle index. Do not edit. 50418 */ 50419 50420 50421 50422//# sourceMappingURL=sweetalert2-ngx-sweetalert2.js.map 50423 50424/***/ }), 50425
vendor: 32,437 bytes, lines 50426-50971
50426/***/ "./node_modules/ng-recaptcha/__ivy_ngcc__/fesm2015/ng-recaptcha.js": 50427/*!*************************************************************************!*\ 50428 !*** ./node_modules/ng-recaptcha/__ivy_ngcc__/fesm2015/ng-recaptcha.js ***! 50429 \*************************************************************************/ 50430/*! exports provided: RECAPTCHA_BASE_URL, RECAPTCHA_LANGUAGE, RECAPTCHA_NONCE, RECAPTCHA_SETTINGS, RECAPTCHA_V3_SITE_KEY, ReCaptchaV3Service, RecaptchaComponent, RecaptchaFormsModule, RecaptchaLoaderService, RecaptchaModule, RecaptchaV3Module, RecaptchaValueAccessorDirective, ɵa */ 50431/***/ (function(module, __webpack_exports__, __webpack_require__) { 50432 50433"use strict"; 50434__webpack_require__.r(__webpack_exports__); 50435/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECAPTCHA_BASE_URL", function() { return RECAPTCHA_BASE_URL; }); 50436/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECAPTCHA_LANGUAGE", function() { return RECAPTCHA_LANGUAGE; }); 50437/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECAPTCHA_NONCE", function() { return RECAPTCHA_NONCE; }); 50438/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECAPTCHA_SETTINGS", function() { return RECAPTCHA_SETTINGS; }); 50439/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECAPTCHA_V3_SITE_KEY", function() { return RECAPTCHA_V3_SITE_KEY; }); 50440/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReCaptchaV3Service", function() { return ReCaptchaV3Service; }); 50441/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecaptchaComponent", function() { return RecaptchaComponent; }); 50442/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecaptchaFormsModule", function() { return RecaptchaFormsModule; }); 50443/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecaptchaLoaderService", function() { return RecaptchaLoaderService; }); 50444/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecaptchaModule", function() { return RecaptchaModule; }); 50445/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecaptchaV3Module", function() { return RecaptchaV3Module; }); 50446/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecaptchaValueAccessorDirective", function() { return RecaptchaValueAccessorDirective; }); 50447/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa", function() { return RecaptchaCommonModule; }); 50448/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/ng-recaptcha/node_modules/tslib/tslib.es6.js"); 50449/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js"); 50450/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js"); 50451/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); 50452/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js"); 50453 50454 50455 50456 50457 50458 50459 50460const RECAPTCHA_LANGUAGE = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('recaptcha-language'); 50461const RECAPTCHA_BASE_URL = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('recaptcha-base-url'); 50462const RECAPTCHA_NONCE = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('recaptcha-nonce-tag'); 50463function loadScript(renderMode, onLoaded, urlParams, url, nonce) { 50464 window.ng2recaptchaloaded = () => { 50465 onLoaded(grecaptcha); 50466 }; 50467 const script = document.createElement('script'); 50468 script.innerHTML = ''; 50469 const baseUrl = url || 'https://www.google.com/recaptcha/api.js'; 50470 script.src = `${baseUrl}?render=${renderMode}&onload=ng2recaptchaloaded${urlParams}`; 50471 if (nonce) { 50472 // tslint:disable-next-line:no-any Remove "any" cast once we upgrade Angular to 7 and TypeScript along with it 50473 script.nonce = nonce; 50474 } 50475 script.async = true; 50476 script.defer = true; 50477 document.head.appendChild(script); 50478} 50479let RecaptchaLoaderService = RecaptchaLoaderService_1 = class RecaptchaLoaderService { 50480 constructor( 50481 // tslint:disable-next-line:no-any 50482 platformId, language, baseUrl, nonce) { 50483 this.platformId = platformId; 50484 this.language = language; 50485 this.baseUrl = baseUrl; 50486 this.nonce = nonce; 50487 this.init(); 50488 this.ready = Object(_angular_common__WEBPACK_IMPORTED_MODULE_2__["isPlatformBrowser"])(this.platformId) ? RecaptchaLoaderService_1.ready.asObservable() : Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["of"])(); 50489 } 50490 /** @internal */ 50491 init() { 50492 if (RecaptchaLoaderService_1.ready) { 50493 return; 50494 } 50495 if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_2__["isPlatformBrowser"])(this.platformId)) { 50496 const subject = new rxjs__WEBPACK_IMPORTED_MODULE_3__["BehaviorSubject"](null); 50497 RecaptchaLoaderService_1.ready = subject; 50498 const langParam = this.language ? '&hl=' + this.language : ''; 50499 loadScript('explicit', (grecaptcha) => subject.next(grecaptcha), langParam, this.baseUrl, this.nonce); 50500 } 50501 } 50502}; 50503RecaptchaLoaderService.ɵfac = function RecaptchaLoaderService_Factory(t) { return new (t || RecaptchaLoaderService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](RECAPTCHA_LANGUAGE, 8), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](RECAPTCHA_BASE_URL, 8), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](RECAPTCHA_NONCE, 8)); }; 50504RecaptchaLoaderService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: RecaptchaLoaderService, factory: function (t) { return RecaptchaLoaderService.ɵfac(t); } }); 50505/** 50506 * @internal 50507 * @nocollapse 50508 */ 50509RecaptchaLoaderService.ready = null; 50510RecaptchaLoaderService = RecaptchaLoaderService_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"])), 50511 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(1, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(1, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(RECAPTCHA_LANGUAGE)), 50512 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(2, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(2, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(RECAPTCHA_BASE_URL)), 50513 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(3, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(3, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(RECAPTCHA_NONCE)), 50514 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [Object, String, String, String]) 50515], RecaptchaLoaderService); 50516var RecaptchaLoaderService_1; 50517 50518const RECAPTCHA_SETTINGS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('recaptcha-settings'); 50519 50520let nextId = 0; 50521let RecaptchaComponent = class RecaptchaComponent { 50522 constructor(elementRef, loader, zone, settings) { 50523 this.elementRef = elementRef; 50524 this.loader = loader; 50525 this.zone = zone; 50526 this.id = `ngrecaptcha-${nextId++}`; 50527 this.resolved = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); 50528 if (settings) { 50529 this.siteKey = settings.siteKey; 50530 this.theme = settings.theme; 50531 this.type = settings.type; 50532 this.size = settings.size; 50533 this.badge = settings.badge; 50534 } 50535 } 50536 ngAfterViewInit() { 50537 this.subscription = this.loader.ready.subscribe((grecaptcha) => { 50538 if (grecaptcha != null && grecaptcha.render instanceof Function) { 50539 this.grecaptcha = grecaptcha; 50540 this.renderRecaptcha(); 50541 } 50542 }); 50543 } 50544 ngOnDestroy() { 50545 // reset the captcha to ensure it does not leave anything behind 50546 // after the component is no longer needed 50547 this.grecaptchaReset(); 50548 if (this.subscription) { 50549 this.subscription.unsubscribe(); 50550 } 50551 } 50552 /** 50553 * Executes the invisible recaptcha. 50554 * Does nothing if component's size is not set to "invisible". 50555 */ 50556 execute() { 50557 if (this.size !== 'invisible') { 50558 return; 50559 } 50560 if (this.widget != null) { 50561 this.grecaptcha.execute(this.widget); 50562 } 50563 else { 50564 // delay execution of recaptcha until it actually renders 50565 this.executeRequested = true; 50566 } 50567 } 50568 reset() { 50569 if (this.widget != null) { 50570 if (this.grecaptcha.getResponse(this.widget)) { 50571 // Only emit an event in case if something would actually change. 50572 // That way we do not trigger "touching" of the control if someone does a "reset" 50573 // on a non-resolved captcha. 50574 this.resolved.emit(null); 50575 } 50576 this.grecaptchaReset(); 50577 } 50578 } 50579 /** @internal */ 50580 expired() { 50581 this.resolved.emit(null); 50582 } 50583 /** @internal */ 50584 captchaResponseCallback(response) { 50585 this.resolved.emit(response); 50586 } 50587 /** @internal */ 50588 grecaptchaReset() { 50589 if (this.widget != null) { 50590 this.zone.runOutsideAngular(() => this.grecaptcha.reset(this.widget)); 50591 } 50592 } 50593 /** @internal */ 50594 renderRecaptcha() { 50595 this.widget = this.grecaptcha.render(this.elementRef.nativeElement, { 50596 badge: this.badge, 50597 callback: (response) => { 50598 this.zone.run(() => this.captchaResponseCallback(response)); 50599 }, 50600 'expired-callback': () => { 50601 this.zone.run(() => this.expired()); 50602 }, 50603 sitekey: this.siteKey, 50604 size: this.size, 50605 tabindex: this.tabIndex, 50606 theme: this.theme, 50607 type: this.type, 50608 }); 50609 if (this.executeRequested === true) { 50610 this.executeRequested = false; 50611 this.execute(); 50612 } 50613 } 50614}; 50615RecaptchaComponent.ɵfac = function RecaptchaComponent_Factory(t) { return new (t || RecaptchaComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](RecaptchaLoaderService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](RECAPTCHA_SETTINGS, 8)); }; 50616RecaptchaComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: RecaptchaComponent, selectors: [["re-captcha"]], hostVars: 1, hostBindings: function RecaptchaComponent_HostBindings(rf, ctx) { if (rf & 2) { 50617 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵattribute"]("id", ctx.id); 50618 } }, inputs: { id: "id", siteKey: "siteKey", theme: "theme", type: "type", size: "size", badge: "badge", tabIndex: "tabIndex" }, outputs: { resolved: "resolved" }, exportAs: ["reCaptcha"], decls: 0, vars: 0, template: function RecaptchaComponent_Template(rf, ctx) { }, encapsulation: 2 }); 50619Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50620 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(), 50621 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["HostBinding"])('attr.id'), 50622 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", Object) 50623], RecaptchaComponent.prototype, "id", void 0); 50624Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50625 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(), 50626 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", String) 50627], RecaptchaComponent.prototype, "siteKey", void 0); 50628Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50629 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(), 50630 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", String) 50631], RecaptchaComponent.prototype, "theme", void 0); 50632Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50633 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(), 50634 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", String) 50635], RecaptchaComponent.prototype, "type", void 0); 50636Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50637 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(), 50638 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", String) 50639], RecaptchaComponent.prototype, "size", void 0); 50640Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50641 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(), 50642 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", Number) 50643], RecaptchaComponent.prototype, "tabIndex", void 0); 50644Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50645 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(), 50646 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", String) 50647], RecaptchaComponent.prototype, "badge", void 0); 50648Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50649 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])(), 50650 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", Object) 50651], RecaptchaComponent.prototype, "resolved", void 0); 50652RecaptchaComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(3, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(3, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(RECAPTCHA_SETTINGS)), 50653 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"], 50654 RecaptchaLoaderService, 50655 _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], Object]) 50656], RecaptchaComponent); 50657 50658let RecaptchaCommonModule = class RecaptchaCommonModule { 50659}; 50660RecaptchaCommonModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: RecaptchaCommonModule }); 50661RecaptchaCommonModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ factory: function RecaptchaCommonModule_Factory(t) { return new (t || RecaptchaCommonModule)(); } }); 50662 50663let RecaptchaModule = RecaptchaModule_1 = class RecaptchaModule { 50664 // We need this to maintain backwards-compatibility with v4. Removing this will be a breaking change 50665 static forRoot() { 50666 return RecaptchaModule_1; 50667 } 50668}; 50669RecaptchaModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: RecaptchaModule }); 50670RecaptchaModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ factory: function RecaptchaModule_Factory(t) { return new (t || RecaptchaModule)(); }, providers: [ 50671 RecaptchaLoaderService, 50672 ], imports: [[ 50673 RecaptchaCommonModule, 50674 ]] }); 50675var RecaptchaModule_1; 50676 50677const RECAPTCHA_V3_SITE_KEY = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('recaptcha-v3-site-key'); 50678/** 50679 * The main service for working with reCAPTCHA v3 APIs. 50680 * 50681 * Use the `execute` method for executing a single action, and 50682 * `onExecute` observable for listening to all actions at once. 50683 */ 50684let ReCaptchaV3Service = class ReCaptchaV3Service { 50685 constructor(zone, siteKey, 50686 // tslint:disable-next-line:no-any 50687 platformId, baseUrl, nonce) { 50688 /** @internal */ 50689 this.onLoadComplete = (grecaptcha) => { 50690 this.grecaptcha = grecaptcha; 50691 if (this.actionBacklog && this.actionBacklog.length > 0) { 50692 this.actionBacklog.forEach(([action, subject]) => this.executeActionWithSubject(action, subject)); 50693 this.actionBacklog = undefined; 50694 } 50695 }; 50696 this.zone = zone; 50697 this.isBrowser = Object(_angular_common__WEBPACK_IMPORTED_MODULE_2__["isPlatformBrowser"])(platformId); 50698 this.siteKey = siteKey; 50699 this.nonce = nonce; 50700 this.baseUrl = baseUrl; 50701 this.init(); 50702 } 50703 get onExecute() { 50704 if (!this.onExecuteSubject) { 50705 this.onExecuteSubject = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"](); 50706 this.onExecuteObservable = this.onExecuteSubject.asObservable(); 50707 } 50708 return this.onExecuteObservable; 50709 } 50710 /** 50711 * Executes the provided `action` with reCAPTCHA v3 API. 50712 * Use the emitted token value for verification purposes on the backend. 50713 * 50714 * For more information about reCAPTCHA v3 actions and tokens refer to the official documentation at 50715 * https://developers.google.com/recaptcha/docs/v3. 50716 * 50717 * @param {string} action the action to execute 50718 * @returns {Observable<string>} an `Observable` that will emit the reCAPTCHA v3 string `token` value whenever ready. 50719 * The returned `Observable` completes immediately after emitting a value. 50720 */ 50721 execute(action) { 50722 const subject = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"](); 50723 if (this.isBrowser) { 50724 if (!this.grecaptcha) { 50725 // todo: add to array of later executions 50726 if (!this.actionBacklog) { 50727 this.actionBacklog = []; 50728 } 50729 this.actionBacklog.push([action, subject]); 50730 } 50731 else { 50732 this.executeActionWithSubject(action, subject); 50733 } 50734 } 50735 return subject.asObservable(); 50736 } 50737 /** @internal */ 50738 executeActionWithSubject(action, subject) { 50739 this.zone.runOutsideAngular(() => { 50740 // tslint:disable-next-line:no-any 50741 this.grecaptcha.execute(this.siteKey, { action }).then((token) => { 50742 this.zone.run(() => { 50743 subject.next(token); 50744 subject.complete(); 50745 if (this.onExecuteSubject) { 50746 this.onExecuteSubject.next({ action, token }); 50747 } 50748 }); 50749 }); 50750 }); 50751 } 50752 /** @internal */ 50753 init() { 50754 if (this.isBrowser) { 50755 if ('grecaptcha' in window) { 50756 this.grecaptcha = grecaptcha; 50757 } 50758 else { 50759 loadScript(this.siteKey, this.onLoadComplete, '', this.baseUrl, this.nonce); 50760 } 50761 } 50762 } 50763}; 50764ReCaptchaV3Service.ɵfac = function ReCaptchaV3Service_Factory(t) { return new (t || ReCaptchaV3Service)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](RECAPTCHA_V3_SITE_KEY), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](RECAPTCHA_BASE_URL, 8), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](RECAPTCHA_NONCE, 8)); }; 50765ReCaptchaV3Service.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: ReCaptchaV3Service, factory: function (t) { return ReCaptchaV3Service.ɵfac(t); } }); 50766ReCaptchaV3Service = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(1, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(RECAPTCHA_V3_SITE_KEY)), 50767 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(2, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"])), 50768 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(3, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(3, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(RECAPTCHA_BASE_URL)), 50769 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(4, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(4, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(RECAPTCHA_NONCE)), 50770 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], String, Object, String, String]) 50771], ReCaptchaV3Service); 50772 50773let RecaptchaV3Module = class RecaptchaV3Module { 50774}; 50775RecaptchaV3Module.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: RecaptchaV3Module }); 50776RecaptchaV3Module.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ factory: function RecaptchaV3Module_Factory(t) { return new (t || RecaptchaV3Module)(); }, providers: [ 50777 ReCaptchaV3Service, 50778 ] }); 50779 50780let RecaptchaValueAccessorDirective = RecaptchaValueAccessorDirective_1 = class RecaptchaValueAccessorDirective { 50781 constructor(host) { 50782 this.host = host; 50783 } 50784 writeValue(value) { 50785 if (!value) { 50786 this.host.reset(); 50787 } 50788 } 50789 registerOnChange(fn) { this.onChange = fn; } 50790 registerOnTouched(fn) { this.onTouched = fn; } 50791 onResolve($event) { 50792 if (this.onChange) { 50793 this.onChange($event); 50794 } 50795 if (this.onTouched) { 50796 this.onTouched(); 50797 } 50798 } 50799}; 50800RecaptchaValueAccessorDirective.ɵfac = function RecaptchaValueAccessorDirective_Factory(t) { return new (t || RecaptchaValueAccessorDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](RecaptchaComponent)); }; 50801RecaptchaValueAccessorDirective.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: RecaptchaValueAccessorDirective, selectors: [["re-captcha", "formControlName", ""], ["re-captcha", "formControl", ""], ["re-captcha", "ngModel", ""]], hostBindings: function RecaptchaValueAccessorDirective_HostBindings(rf, ctx) { if (rf & 1) { 50802 _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("resolved", function RecaptchaValueAccessorDirective_resolved_HostBindingHandler($event) { return ctx.onResolve($event); }); 50803 } }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([ 50804 { 50805 multi: true, 50806 provide: _angular_forms__WEBPACK_IMPORTED_MODULE_4__["NG_VALUE_ACCESSOR"], 50807 // tslint:disable-next-line:no-forward-ref 50808 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(() => RecaptchaValueAccessorDirective_1) 50809 }, 50810 ])] }); 50811Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ 50812 Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"])('resolved', ['$event']), 50813 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:type", Function), 50814 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [String]), 50815 Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:returntype", void 0) 50816], RecaptchaValueAccessorDirective.prototype, "onResolve", null); 50817RecaptchaValueAccessorDirective = RecaptchaValueAccessorDirective_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [RecaptchaComponent]) 50818], RecaptchaValueAccessorDirective); 50819var RecaptchaValueAccessorDirective_1; 50820 50821let RecaptchaFormsModule = class RecaptchaFormsModule { 50822}; 50823RecaptchaFormsModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: RecaptchaFormsModule }); 50824RecaptchaFormsModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ factory: function RecaptchaFormsModule_Factory(t) { return new (t || RecaptchaFormsModule)(); }, imports: [[_angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"], RecaptchaCommonModule]] }); 50825/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RecaptchaLoaderService, [{ 50826 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 50827 }], function () { return [{ type: Object, decorators: [{ 50828 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50829 args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"]] 50830 }] }, { type: String, decorators: [{ 50831 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] 50832 }, { 50833 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50834 args: [RECAPTCHA_LANGUAGE] 50835 }] }, { type: String, decorators: [{ 50836 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] 50837 }, { 50838 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50839 args: [RECAPTCHA_BASE_URL] 50840 }] }, { type: String, decorators: [{ 50841 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] 50842 }, { 50843 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50844 args: [RECAPTCHA_NONCE] 50845 }] }]; }, null); })(); 50846/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RecaptchaComponent, [{ 50847 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], 50848 args: [{ 50849 exportAs: 'reCaptcha', 50850 selector: 're-captcha', 50851 template: `` 50852 }] 50853 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }, { type: RecaptchaLoaderService }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"] }, { type: Object, decorators: [{ 50854 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] 50855 }, { 50856 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50857 args: [RECAPTCHA_SETTINGS] 50858 }] }]; }, { id: [{ 50859 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50860 }, { 50861 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostBinding"], 50862 args: ['attr.id'] 50863 }], resolved: [{ 50864 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"] 50865 }], siteKey: [{ 50866 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50867 }], theme: [{ 50868 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50869 }], type: [{ 50870 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50871 }], size: [{ 50872 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50873 }], badge: [{ 50874 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50875 }], tabIndex: [{ 50876 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] 50877 }] }); })(); 50878(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](RecaptchaCommonModule, { declarations: [RecaptchaComponent], exports: [RecaptchaComponent] }); })(); 50879/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RecaptchaCommonModule, [{ 50880 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], 50881 args: [{ 50882 declarations: [ 50883 RecaptchaComponent, 50884 ], 50885 exports: [ 50886 RecaptchaComponent, 50887 ] 50888 }] 50889 }], null, null); })(); 50890(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](RecaptchaModule, { imports: [RecaptchaCommonModule], exports: [RecaptchaComponent] }); })(); 50891/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RecaptchaModule, [{ 50892 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], 50893 args: [{ 50894 exports: [ 50895 RecaptchaComponent, 50896 ], 50897 imports: [ 50898 RecaptchaCommonModule, 50899 ], 50900 providers: [ 50901 RecaptchaLoaderService, 50902 ] 50903 }] 50904 }], null, null); })(); 50905/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](ReCaptchaV3Service, [{ 50906 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"] 50907 }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"] }, { type: String, decorators: [{ 50908 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50909 args: [RECAPTCHA_V3_SITE_KEY] 50910 }] }, { type: Object, decorators: [{ 50911 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50912 args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"]] 50913 }] }, { type: String, decorators: [{ 50914 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] 50915 }, { 50916 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50917 args: [RECAPTCHA_BASE_URL] 50918 }] }, { type: String, decorators: [{ 50919 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] 50920 }, { 50921 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], 50922 args: [RECAPTCHA_NONCE] 50923 }] }]; }, null); })(); 50924/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RecaptchaV3Module, [{ 50925 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], 50926 args: [{ 50927 providers: [ 50928 ReCaptchaV3Service, 50929 ] 50930 }] 50931 }], null, null); })(); 50932/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RecaptchaValueAccessorDirective, [{ 50933 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], 50934 args: [{ 50935 providers: [ 50936 { 50937 multi: true, 50938 provide: _angular_forms__WEBPACK_IMPORTED_MODULE_4__["NG_VALUE_ACCESSOR"], 50939 // tslint:disable-next-line:no-forward-ref 50940 useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(() => RecaptchaValueAccessorDirective_1) 50941 }, 50942 ], 50943 // tslint:disable-next-line:directive-selector 50944 selector: 're-captcha[formControlName],re-captcha[formControl],re-captcha[ngModel]' 50945 }] 50946 }], function () { return [{ type: RecaptchaComponent }]; }, { onResolve: [{ 50947 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"], 50948 args: ['resolved', ['$event']] 50949 }] }); })(); 50950(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](RecaptchaFormsModule, { declarations: function () { return [RecaptchaValueAccessorDirective]; }, imports: function () { return [_angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"], RecaptchaCommonModule]; }, exports: function () { return [RecaptchaValueAccessorDirective]; } }); })(); 50951/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RecaptchaFormsModule, [{ 50952 type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], 50953 args: [{ 50954 declarations: [ 50955 RecaptchaValueAccessorDirective, 50956 ], 50957 exports: [RecaptchaValueAccessorDirective], 50958 imports: [_angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"], RecaptchaCommonModule] 50959 }] 50960 }], null, null); })(); 50961 50962/** 50963 * Generated bundle index. Do not edit. 50964 */ 50965 50966 50967 50968//# sourceMappingURL=ng-recaptcha.js.map 50969 50970/***/ }), 50971
vendor: 13,830 bytes, lines 50972-51225
50972/***/ "./node_modules/ng-recaptcha/node_modules/tslib/tslib.es6.js": 50973/*!*******************************************************************!*\ 50974 !*** ./node_modules/ng-recaptcha/node_modules/tslib/tslib.es6.js ***! 50975 \*******************************************************************/ 50976/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */ 50977/***/ (function(module, __webpack_exports__, __webpack_require__) { 50978 50979"use strict"; 50980__webpack_require__.r(__webpack_exports__); 50981/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; }); 50982/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; }); 50983/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; }); 50984/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; }); 50985/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; }); 50986/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; }); 50987/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; }); 50988/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; }); 50989/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; }); 50990/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; }); 50991/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; }); 50992/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); 50993/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); 50994/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; }); 50995/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); 50996/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); 50997/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); 50998/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; }); 50999/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); 51000/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); 51001/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); 51002/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); 51003/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); 51004/*! ***************************************************************************** 51005Copyright (c) Microsoft Corporation. 51006 51007Permission to use, copy, modify, and/or distribute this software for any 51008purpose with or without fee is hereby granted. 51009 51010THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 51011REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 51012AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 51013INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 51014LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 51015OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 51016PERFORMANCE OF THIS SOFTWARE. 51017***************************************************************************** */ 51018/* global Reflect, Promise */ 51019 51020var extendStatics = function(d, b) { 51021 extendStatics = Object.setPrototypeOf || 51022 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 51023 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 51024 return extendStatics(d, b); 51025}; 51026 51027function __extends(d, b) { 51028 extendStatics(d, b); 51029 function __() { this.constructor = d; } 51030 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 51031} 51032 51033var __assign = function() { 51034 __assign = Object.assign || function __assign(t) { 51035 for (var s, i = 1, n = arguments.length; i < n; i++) { 51036 s = arguments[i]; 51037 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 51038 } 51039 return t; 51040 } 51041 return __assign.apply(this, arguments); 51042} 51043 51044function __rest(s, e) { 51045 var t = {}; 51046 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 51047 t[p] = s[p]; 51048 if (s != null && typeof Object.getOwnPropertySymbols === "function") 51049 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 51050 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 51051 t[p[i]] = s[p[i]]; 51052 } 51053 return t; 51054} 51055 51056function __decorate(decorators, target, key, desc) { 51057 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 51058 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 51059 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; 51060 return c > 3 && r && Object.defineProperty(target, key, r), r; 51061} 51062 51063function __param(paramIndex, decorator) { 51064 return function (target, key) { decorator(target, key, paramIndex); } 51065} 51066 51067function __metadata(metadataKey, metadataValue) { 51068 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 51069} 51070 51071function __awaiter(thisArg, _arguments, P, generator) { 51072 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 51073 return new (P || (P = Promise))(function (resolve, reject) { 51074 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 51075 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 51076 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 51077 step((generator = generator.apply(thisArg, _arguments || [])).next()); 51078 }); 51079} 51080 51081function __generator(thisArg, body) { 51082 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 51083 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 51084 function verb(n) { return function (v) { return step([n, v]); }; } 51085 function step(op) { 51086 if (f) throw new TypeError("Generator is already executing."); 51087 while (_) try { 51088 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 51089 if (y = 0, t) op = [op[0] & 2, t.value]; 51090 switch (op[0]) { 51091 case 0: case 1: t = op; break; 51092 case 4: _.label++; return { value: op[1], done: false }; 51093 case 5: _.label++; y = op[1]; op = [0]; continue; 51094 case 7: op = _.ops.pop(); _.trys.pop(); continue; 51095 default: 51096 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 51097 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 51098 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 51099 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 51100 if (t[2]) _.ops.pop(); 51101 _.trys.pop(); continue; 51102 } 51103 op = body.call(thisArg, _); 51104 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 51105 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 51106 } 51107} 51108 51109function __createBinding(o, m, k, k2) { 51110 if (k2 === undefined) k2 = k; 51111 o[k2] = m[k]; 51112} 51113 51114function __exportStar(m, exports) { 51115 for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; 51116} 51117 51118function __values(o) { 51119 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 51120 if (m) return m.call(o); 51121 if (o && typeof o.length === "number") return { 51122 next: function () { 51123 if (o && i >= o.length) o = void 0; 51124 return { value: o && o[i++], done: !o }; 51125 } 51126 }; 51127 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 51128} 51129 51130function __read(o, n) { 51131 var m = typeof Symbol === "function" && o[Symbol.iterator]; 51132 if (!m) return o; 51133 var i = m.call(o), r, ar = [], e; 51134 try { 51135 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 51136 } 51137 catch (error) { e = { error: error }; } 51138 finally { 51139 try { 51140 if (r && !r.done && (m = i["return"])) m.call(i); 51141 } 51142 finally { if (e) throw e.error; } 51143 } 51144 return ar; 51145} 51146 51147function __spread() { 51148 for (var ar = [], i = 0; i < arguments.length; i++) 51149 ar = ar.concat(__read(arguments[i])); 51150 return ar; 51151} 51152 51153function __spreadArrays() { 51154 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 51155 for (var r = Array(s), k = 0, i = 0; i < il; i++) 51156 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 51157 r[k] = a[j]; 51158 return r; 51159}; 51160 51161function __await(v) { 51162 return this instanceof __await ? (this.v = v, this) : new __await(v); 51163} 51164 51165function __asyncGenerator(thisArg, _arguments, generator) { 51166 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 51167 var g = generator.apply(thisArg, _arguments || []), i, q = []; 51168 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 51169 function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } 51170 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 51171 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 51172 function fulfill(value) { resume("next", value); } 51173 function reject(value) { resume("throw", value); } 51174 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 51175} 51176 51177function __asyncDelegator(o) { 51178 var i, p; 51179 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 51180 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 51181} 51182 51183function __asyncValues(o) { 51184 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 51185 var m = o[Symbol.asyncIterator], i; 51186 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 51187 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 51188 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 51189} 51190 51191function __makeTemplateObject(cooked, raw) { 51192 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 51193 return cooked; 51194}; 51195 51196function __importStar(mod) { 51197 if (mod && mod.__esModule) return mod; 51198 var result = {}; 51199 if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 51200 result.default = mod; 51201 return result; 51202} 51203 51204function __importDefault(mod) { 51205 return (mod && mod.__esModule) ? mod : { default: mod }; 51206} 51207 51208function __classPrivateFieldGet(receiver, privateMap) { 51209 if (!privateMap.has(receiver)) { 51210 throw new TypeError("attempted to get private field on non-instance"); 51211 } 51212 return privateMap.get(receiver); 51213} 51214 51215function __classPrivateFieldSet(receiver, privateMap, value) { 51216 if (!privateMap.has(receiver)) { 51217 throw new TypeError("attempted to set private field on non-instance"); 51218 } 51219 privateMap.set(receiver, value); 51220 return value; 51221} 51222 51223 51224/***/ }), 51225
vendor: 22,543 bytes, lines 51226-51460
51226/***/ "./node_modules/rxjs/_esm2015/index.js": 51227/*!*********************************************!*\ 51228 !*** ./node_modules/rxjs/_esm2015/index.js ***! 51229 \*********************************************/ 51230/*! exports provided: Observable, ConnectableObservable, GroupedObservable, observable, Subject, BehaviorSubject, ReplaySubject, AsyncSubject, asapScheduler, asyncScheduler, queueScheduler, animationFrameScheduler, VirtualTimeScheduler, VirtualAction, Scheduler, Subscription, Subscriber, Notification, NotificationKind, pipe, noop, identity, isObservable, ArgumentOutOfRangeError, EmptyError, ObjectUnsubscribedError, UnsubscriptionError, TimeoutError, bindCallback, bindNodeCallback, combineLatest, concat, defer, empty, forkJoin, from, fromEvent, fromEventPattern, generate, iif, interval, merge, never, of, onErrorResumeNext, pairs, partition, race, range, throwError, timer, using, zip, scheduled, EMPTY, NEVER, config */ 51231/***/ (function(module, __webpack_exports__, __webpack_require__) { 51232 51233"use strict"; 51234__webpack_require__.r(__webpack_exports__); 51235/* harmony import */ var _internal_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./internal/Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 51236/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return _internal_Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]; }); 51237 51238/* harmony import */ var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/observable/ConnectableObservable */ "./node_modules/rxjs/_esm2015/internal/observable/ConnectableObservable.js"); 51239/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__["ConnectableObservable"]; }); 51240 51241/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./internal/operators/groupBy */ "./node_modules/rxjs/_esm2015/internal/operators/groupBy.js"); 51242/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__["GroupedObservable"]; }); 51243 51244/* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./internal/symbol/observable */ "./node_modules/rxjs/_esm2015/internal/symbol/observable.js"); 51245/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__["observable"]; }); 51246 51247/* harmony import */ var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./internal/Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 51248/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return _internal_Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]; }); 51249 51250/* harmony import */ var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./internal/BehaviorSubject */ "./node_modules/rxjs/_esm2015/internal/BehaviorSubject.js"); 51251/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"]; }); 51252 51253/* harmony import */ var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./internal/ReplaySubject */ "./node_modules/rxjs/_esm2015/internal/ReplaySubject.js"); 51254/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__["ReplaySubject"]; }); 51255 51256/* harmony import */ var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./internal/AsyncSubject */ "./node_modules/rxjs/_esm2015/internal/AsyncSubject.js"); 51257/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__["AsyncSubject"]; }); 51258 51259/* harmony import */ var _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./internal/scheduler/asap */ "./node_modules/rxjs/_esm2015/internal/scheduler/asap.js"); 51260/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__["asap"]; }); 51261 51262/* harmony import */ var _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./internal/scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 51263/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__["async"]; }); 51264 51265/* harmony import */ var _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internal/scheduler/queue */ "./node_modules/rxjs/_esm2015/internal/scheduler/queue.js"); 51266/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__["queue"]; }); 51267 51268/* harmony import */ var _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./internal/scheduler/animationFrame */ "./node_modules/rxjs/_esm2015/internal/scheduler/animationFrame.js"); 51269/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__["animationFrame"]; }); 51270 51271/* harmony import */ var _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internal/scheduler/VirtualTimeScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/VirtualTimeScheduler.js"); 51272/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualTimeScheduler"]; }); 51273 51274/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualAction"]; }); 51275 51276/* harmony import */ var _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./internal/Scheduler */ "./node_modules/rxjs/_esm2015/internal/Scheduler.js"); 51277/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__["Scheduler"]; }); 51278 51279/* harmony import */ var _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./internal/Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 51280/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__["Subscription"]; }); 51281 51282/* harmony import */ var _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./internal/Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 51283/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__["Subscriber"]; }); 51284 51285/* harmony import */ var _internal_Notification__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./internal/Notification */ "./node_modules/rxjs/_esm2015/internal/Notification.js"); 51286/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["Notification"]; }); 51287 51288/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["NotificationKind"]; }); 51289 51290/* harmony import */ var _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./internal/util/pipe */ "./node_modules/rxjs/_esm2015/internal/util/pipe.js"); 51291/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__["pipe"]; }); 51292 51293/* harmony import */ var _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./internal/util/noop */ "./node_modules/rxjs/_esm2015/internal/util/noop.js"); 51294/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__["noop"]; }); 51295 51296/* harmony import */ var _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internal/util/identity */ "./node_modules/rxjs/_esm2015/internal/util/identity.js"); 51297/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__["identity"]; }); 51298 51299/* harmony import */ var _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./internal/util/isObservable */ "./node_modules/rxjs/_esm2015/internal/util/isObservable.js"); 51300/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__["isObservable"]; }); 51301 51302/* harmony import */ var _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./internal/util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js"); 51303/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__["ArgumentOutOfRangeError"]; }); 51304 51305/* harmony import */ var _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./internal/util/EmptyError */ "./node_modules/rxjs/_esm2015/internal/util/EmptyError.js"); 51306/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__["EmptyError"]; }); 51307 51308/* harmony import */ var _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./internal/util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js"); 51309/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__["ObjectUnsubscribedError"]; }); 51310 51311/* harmony import */ var _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./internal/util/UnsubscriptionError */ "./node_modules/rxjs/_esm2015/internal/util/UnsubscriptionError.js"); 51312/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__["UnsubscriptionError"]; }); 51313 51314/* harmony import */ var _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./internal/util/TimeoutError */ "./node_modules/rxjs/_esm2015/internal/util/TimeoutError.js"); 51315/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__["TimeoutError"]; }); 51316 51317/* harmony import */ var _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./internal/observable/bindCallback */ "./node_modules/rxjs/_esm2015/internal/observable/bindCallback.js"); 51318/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__["bindCallback"]; }); 51319 51320/* harmony import */ var _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internal/observable/bindNodeCallback */ "./node_modules/rxjs/_esm2015/internal/observable/bindNodeCallback.js"); 51321/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__["bindNodeCallback"]; }); 51322 51323/* harmony import */ var _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./internal/observable/combineLatest */ "./node_modules/rxjs/_esm2015/internal/observable/combineLatest.js"); 51324/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__["combineLatest"]; }); 51325 51326/* harmony import */ var _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./internal/observable/concat */ "./node_modules/rxjs/_esm2015/internal/observable/concat.js"); 51327/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__["concat"]; }); 51328 51329/* harmony import */ var _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./internal/observable/defer */ "./node_modules/rxjs/_esm2015/internal/observable/defer.js"); 51330/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__["defer"]; }); 51331 51332/* harmony import */ var _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./internal/observable/empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 51333/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["empty"]; }); 51334 51335/* harmony import */ var _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./internal/observable/forkJoin */ "./node_modules/rxjs/_esm2015/internal/observable/forkJoin.js"); 51336/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__["forkJoin"]; }); 51337 51338/* harmony import */ var _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./internal/observable/from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 51339/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "from", function() { return _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__["from"]; }); 51340 51341/* harmony import */ var _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./internal/observable/fromEvent */ "./node_modules/rxjs/_esm2015/internal/observable/fromEvent.js"); 51342/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__["fromEvent"]; }); 51343 51344/* harmony import */ var _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./internal/observable/fromEventPattern */ "./node_modules/rxjs/_esm2015/internal/observable/fromEventPattern.js"); 51345/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__["fromEventPattern"]; }); 51346 51347/* harmony import */ var _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./internal/observable/generate */ "./node_modules/rxjs/_esm2015/internal/observable/generate.js"); 51348/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__["generate"]; }); 51349 51350/* harmony import */ var _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./internal/observable/iif */ "./node_modules/rxjs/_esm2015/internal/observable/iif.js"); 51351/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__["iif"]; }); 51352 51353/* harmony import */ var _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./internal/observable/interval */ "./node_modules/rxjs/_esm2015/internal/observable/interval.js"); 51354/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__["interval"]; }); 51355 51356/* harmony import */ var _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./internal/observable/merge */ "./node_modules/rxjs/_esm2015/internal/observable/merge.js"); 51357/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__["merge"]; }); 51358 51359/* harmony import */ var _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./internal/observable/never */ "./node_modules/rxjs/_esm2015/internal/observable/never.js"); 51360/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "never", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["never"]; }); 51361 51362/* harmony import */ var _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./internal/observable/of */ "./node_modules/rxjs/_esm2015/internal/observable/of.js"); 51363/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "of", function() { return _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__["of"]; }); 51364 51365/* harmony import */ var _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./internal/observable/onErrorResumeNext */ "./node_modules/rxjs/_esm2015/internal/observable/onErrorResumeNext.js"); 51366/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__["onErrorResumeNext"]; }); 51367 51368/* harmony import */ var _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./internal/observable/pairs */ "./node_modules/rxjs/_esm2015/internal/observable/pairs.js"); 51369/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__["pairs"]; }); 51370 51371/* harmony import */ var _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./internal/observable/partition */ "./node_modules/rxjs/_esm2015/internal/observable/partition.js"); 51372/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__["partition"]; }); 51373 51374/* harmony import */ var _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./internal/observable/race */ "./node_modules/rxjs/_esm2015/internal/observable/race.js"); 51375/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__["race"]; }); 51376 51377/* harmony import */ var _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./internal/observable/range */ "./node_modules/rxjs/_esm2015/internal/observable/range.js"); 51378/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__["range"]; }); 51379 51380/* harmony import */ var _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./internal/observable/throwError */ "./node_modules/rxjs/_esm2015/internal/observable/throwError.js"); 51381/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__["throwError"]; }); 51382 51383/* harmony import */ var _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./internal/observable/timer */ "./node_modules/rxjs/_esm2015/internal/observable/timer.js"); 51384/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__["timer"]; }); 51385 51386/* harmony import */ var _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./internal/observable/using */ "./node_modules/rxjs/_esm2015/internal/observable/using.js"); 51387/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "using", function() { return _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__["using"]; }); 51388 51389/* harmony import */ var _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./internal/observable/zip */ "./node_modules/rxjs/_esm2015/internal/observable/zip.js"); 51390/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__["zip"]; }); 51391 51392/* harmony import */ var _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./internal/scheduled/scheduled */ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduled.js"); 51393/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scheduled", function() { return _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__["scheduled"]; }); 51394 51395/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["EMPTY"]; }); 51396 51397/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["NEVER"]; }); 51398 51399/* harmony import */ var _internal_config__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./internal/config */ "./node_modules/rxjs/_esm2015/internal/config.js"); 51400/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "config", function() { return _internal_config__WEBPACK_IMPORTED_MODULE_52__["config"]; }); 51401 51402 51403 51404 51405 51406 51407 51408 51409 51410 51411 51412 51413 51414 51415 51416 51417 51418 51419 51420 51421 51422 51423 51424 51425 51426 51427 51428 51429 51430 51431 51432 51433 51434 51435 51436 51437 51438 51439 51440 51441 51442 51443 51444 51445 51446 51447 51448 51449 51450 51451 51452 51453 51454 51455 51456 51457//# sourceMappingURL=index.js.map 51458 51459/***/ }), 51460
vendor: 2,031 bytes, lines 51461-51516
51461/***/ "./node_modules/rxjs/_esm2015/internal/AsyncSubject.js": 51462/*!*************************************************************!*\ 51463 !*** ./node_modules/rxjs/_esm2015/internal/AsyncSubject.js ***! 51464 \*************************************************************/ 51465/*! exports provided: AsyncSubject */ 51466/***/ (function(module, __webpack_exports__, __webpack_require__) { 51467 51468"use strict"; 51469__webpack_require__.r(__webpack_exports__); 51470/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return AsyncSubject; }); 51471/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 51472/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 51473 51474 51475class AsyncSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"] { 51476 constructor() { 51477 super(...arguments); 51478 this.value = null; 51479 this.hasNext = false; 51480 this.hasCompleted = false; 51481 } 51482 _subscribe(subscriber) { 51483 if (this.hasError) { 51484 subscriber.error(this.thrownError); 51485 return _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"].EMPTY; 51486 } 51487 else if (this.hasCompleted && this.hasNext) { 51488 subscriber.next(this.value); 51489 subscriber.complete(); 51490 return _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"].EMPTY; 51491 } 51492 return super._subscribe(subscriber); 51493 } 51494 next(value) { 51495 if (!this.hasCompleted) { 51496 this.value = value; 51497 this.hasNext = true; 51498 } 51499 } 51500 error(error) { 51501 if (!this.hasCompleted) { 51502 super.error(error); 51503 } 51504 } 51505 complete() { 51506 this.hasCompleted = true; 51507 if (this.hasNext) { 51508 super.next(this.value); 51509 } 51510 super.complete(); 51511 } 51512} 51513//# sourceMappingURL=AsyncSubject.js.map 51514 51515/***/ }), 51516
vendor: 1,826 bytes, lines 51517-51564
51517/***/ "./node_modules/rxjs/_esm2015/internal/BehaviorSubject.js": 51518/*!****************************************************************!*\ 51519 !*** ./node_modules/rxjs/_esm2015/internal/BehaviorSubject.js ***! 51520 \****************************************************************/ 51521/*! exports provided: BehaviorSubject */ 51522/***/ (function(module, __webpack_exports__, __webpack_require__) { 51523 51524"use strict"; 51525__webpack_require__.r(__webpack_exports__); 51526/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return BehaviorSubject; }); 51527/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 51528/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js"); 51529 51530 51531class BehaviorSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"] { 51532 constructor(_value) { 51533 super(); 51534 this._value = _value; 51535 } 51536 get value() { 51537 return this.getValue(); 51538 } 51539 _subscribe(subscriber) { 51540 const subscription = super._subscribe(subscriber); 51541 if (subscription && !subscription.closed) { 51542 subscriber.next(this._value); 51543 } 51544 return subscription; 51545 } 51546 getValue() { 51547 if (this.hasError) { 51548 throw this.thrownError; 51549 } 51550 else if (this.closed) { 51551 throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_1__["ObjectUnsubscribedError"](); 51552 } 51553 else { 51554 return this._value; 51555 } 51556 } 51557 next(value) { 51558 super.next(this._value = value); 51559 } 51560} 51561//# sourceMappingURL=BehaviorSubject.js.map 51562 51563/***/ }), 51564
vendor: 1,402 bytes, lines 51565-51600
51565/***/ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js": 51566/*!****************************************************************!*\ 51567 !*** ./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js ***! 51568 \****************************************************************/ 51569/*! exports provided: InnerSubscriber */ 51570/***/ (function(module, __webpack_exports__, __webpack_require__) { 51571 51572"use strict"; 51573__webpack_require__.r(__webpack_exports__); 51574/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerSubscriber", function() { return InnerSubscriber; }); 51575/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 51576 51577class InnerSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 51578 constructor(parent, outerValue, outerIndex) { 51579 super(); 51580 this.parent = parent; 51581 this.outerValue = outerValue; 51582 this.outerIndex = outerIndex; 51583 this.index = 0; 51584 } 51585 _next(value) { 51586 this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this); 51587 } 51588 _error(error) { 51589 this.parent.notifyError(error, this); 51590 this.unsubscribe(); 51591 } 51592 _complete() { 51593 this.parent.notifyComplete(this); 51594 this.unsubscribe(); 51595 } 51596} 51597//# sourceMappingURL=InnerSubscriber.js.map 51598 51599/***/ }), 51600
vendor: 3,668 bytes, lines 51601-51690
51601/***/ "./node_modules/rxjs/_esm2015/internal/Notification.js": 51602/*!*************************************************************!*\ 51603 !*** ./node_modules/rxjs/_esm2015/internal/Notification.js ***! 51604 \*************************************************************/ 51605/*! exports provided: NotificationKind, Notification */ 51606/***/ (function(module, __webpack_exports__, __webpack_require__) { 51607 51608"use strict"; 51609__webpack_require__.r(__webpack_exports__); 51610/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return NotificationKind; }); 51611/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return Notification; }); 51612/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observable/empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 51613/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observable/of */ "./node_modules/rxjs/_esm2015/internal/observable/of.js"); 51614/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./observable/throwError */ "./node_modules/rxjs/_esm2015/internal/observable/throwError.js"); 51615 51616 51617 51618var NotificationKind; 51619(function (NotificationKind) { 51620 NotificationKind["NEXT"] = "N"; 51621 NotificationKind["ERROR"] = "E"; 51622 NotificationKind["COMPLETE"] = "C"; 51623})(NotificationKind || (NotificationKind = {})); 51624class Notification { 51625 constructor(kind, value, error) { 51626 this.kind = kind; 51627 this.value = value; 51628 this.error = error; 51629 this.hasValue = kind === 'N'; 51630 } 51631 observe(observer) { 51632 switch (this.kind) { 51633 case 'N': 51634 return observer.next && observer.next(this.value); 51635 case 'E': 51636 return observer.error && observer.error(this.error); 51637 case 'C': 51638 return observer.complete && observer.complete(); 51639 } 51640 } 51641 do(next, error, complete) { 51642 const kind = this.kind; 51643 switch (kind) { 51644 case 'N': 51645 return next && next(this.value); 51646 case 'E': 51647 return error && error(this.error); 51648 case 'C': 51649 return complete && complete(); 51650 } 51651 } 51652 accept(nextOrObserver, error, complete) { 51653 if (nextOrObserver && typeof nextOrObserver.next === 'function') { 51654 return this.observe(nextOrObserver); 51655 } 51656 else { 51657 return this.do(nextOrObserver, error, complete); 51658 } 51659 } 51660 toObservable() { 51661 const kind = this.kind; 51662 switch (kind) { 51663 case 'N': 51664 return Object(_observable_of__WEBPACK_IMPORTED_MODULE_1__["of"])(this.value); 51665 case 'E': 51666 return Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_2__["throwError"])(this.error); 51667 case 'C': 51668 return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_0__["empty"])(); 51669 } 51670 throw new Error('unexpected notification kind value'); 51671 } 51672 static createNext(value) { 51673 if (typeof value !== 'undefined') { 51674 return new Notification('N', value); 51675 } 51676 return Notification.undefinedValueNotification; 51677 } 51678 static createError(err) { 51679 return new Notification('E', undefined, err); 51680 } 51681 static createComplete() { 51682 return Notification.completeNotification; 51683 } 51684} 51685Notification.completeNotification = new Notification('C'); 51686Notification.undefinedValueNotification = new Notification('N', undefined); 51687//# sourceMappingURL=Notification.js.map 51688 51689/***/ }), 51690
vendor: 4,851 bytes, lines 51691-51815
51691/***/ "./node_modules/rxjs/_esm2015/internal/Observable.js": 51692/*!***********************************************************!*\ 51693 !*** ./node_modules/rxjs/_esm2015/internal/Observable.js ***! 51694 \***********************************************************/ 51695/*! exports provided: Observable */ 51696/***/ (function(module, __webpack_exports__, __webpack_require__) { 51697 51698"use strict"; 51699__webpack_require__.r(__webpack_exports__); 51700/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return Observable; }); 51701/* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/canReportError */ "./node_modules/rxjs/_esm2015/internal/util/canReportError.js"); 51702/* harmony import */ var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/toSubscriber */ "./node_modules/rxjs/_esm2015/internal/util/toSubscriber.js"); 51703/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./symbol/observable */ "./node_modules/rxjs/_esm2015/internal/symbol/observable.js"); 51704/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/pipe */ "./node_modules/rxjs/_esm2015/internal/util/pipe.js"); 51705/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm2015/internal/config.js"); 51706 51707 51708 51709 51710 51711class Observable { 51712 constructor(subscribe) { 51713 this._isScalar = false; 51714 if (subscribe) { 51715 this._subscribe = subscribe; 51716 } 51717 } 51718 lift(operator) { 51719 const observable = new Observable(); 51720 observable.source = this; 51721 observable.operator = operator; 51722 return observable; 51723 } 51724 subscribe(observerOrNext, error, complete) { 51725 const { operator } = this; 51726 const sink = Object(_util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__["toSubscriber"])(observerOrNext, error, complete); 51727 if (operator) { 51728 sink.add(operator.call(sink, this.source)); 51729 } 51730 else { 51731 sink.add(this.source || (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? 51732 this._subscribe(sink) : 51733 this._trySubscribe(sink)); 51734 } 51735 if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) { 51736 if (sink.syncErrorThrowable) { 51737 sink.syncErrorThrowable = false; 51738 if (sink.syncErrorThrown) { 51739 throw sink.syncErrorValue; 51740 } 51741 } 51742 } 51743 return sink; 51744 } 51745 _trySubscribe(sink) { 51746 try { 51747 return this._subscribe(sink); 51748 } 51749 catch (err) { 51750 if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) { 51751 sink.syncErrorThrown = true; 51752 sink.syncErrorValue = err; 51753 } 51754 if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_0__["canReportError"])(sink)) { 51755 sink.error(err); 51756 } 51757 else { 51758 console.warn(err); 51759 } 51760 } 51761 } 51762 forEach(next, promiseCtor) { 51763 promiseCtor = getPromiseCtor(promiseCtor); 51764 return new promiseCtor((resolve, reject) => { 51765 let subscription; 51766 subscription = this.subscribe((value) => { 51767 try { 51768 next(value); 51769 } 51770 catch (err) { 51771 reject(err); 51772 if (subscription) { 51773 subscription.unsubscribe(); 51774 } 51775 } 51776 }, reject, resolve); 51777 }); 51778 } 51779 _subscribe(subscriber) { 51780 const { source } = this; 51781 return source && source.subscribe(subscriber); 51782 } 51783 [_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]]() { 51784 return this; 51785 } 51786 pipe(...operations) { 51787 if (operations.length === 0) { 51788 return this; 51789 } 51790 return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipeFromArray"])(operations)(this); 51791 } 51792 toPromise(promiseCtor) { 51793 promiseCtor = getPromiseCtor(promiseCtor); 51794 return new promiseCtor((resolve, reject) => { 51795 let value; 51796 this.subscribe((x) => value = x, (err) => reject(err), () => resolve(value)); 51797 }); 51798 } 51799} 51800Observable.create = (subscribe) => { 51801 return new Observable(subscribe); 51802}; 51803function getPromiseCtor(promiseCtor) { 51804 if (!promiseCtor) { 51805 promiseCtor = _config__WEBPACK_IMPORTED_MODULE_4__["config"].Promise || Promise; 51806 } 51807 if (!promiseCtor) { 51808 throw new Error('no Promise impl found'); 51809 } 51810 return promiseCtor; 51811} 51812//# sourceMappingURL=Observable.js.map 51813 51814/***/ }), 51815
vendor: 1,271 bytes, lines 51816-51846
51816/***/ "./node_modules/rxjs/_esm2015/internal/Observer.js": 51817/*!*********************************************************!*\ 51818 !*** ./node_modules/rxjs/_esm2015/internal/Observer.js ***! 51819 \*********************************************************/ 51820/*! exports provided: empty */ 51821/***/ (function(module, __webpack_exports__, __webpack_require__) { 51822 51823"use strict"; 51824__webpack_require__.r(__webpack_exports__); 51825/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); 51826/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm2015/internal/config.js"); 51827/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/hostReportError */ "./node_modules/rxjs/_esm2015/internal/util/hostReportError.js"); 51828 51829 51830const empty = { 51831 closed: true, 51832 next(value) { }, 51833 error(err) { 51834 if (_config__WEBPACK_IMPORTED_MODULE_0__["config"].useDeprecatedSynchronousErrorHandling) { 51835 throw err; 51836 } 51837 else { 51838 Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_1__["hostReportError"])(err); 51839 } 51840 }, 51841 complete() { } 51842}; 51843//# sourceMappingURL=Observer.js.map 51844 51845/***/ }), 51846
vendor: 1,165 bytes, lines 51847-51873
51847/***/ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js": 51848/*!****************************************************************!*\ 51849 !*** ./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js ***! 51850 \****************************************************************/ 51851/*! exports provided: OuterSubscriber */ 51852/***/ (function(module, __webpack_exports__, __webpack_require__) { 51853 51854"use strict"; 51855__webpack_require__.r(__webpack_exports__); 51856/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OuterSubscriber", function() { return OuterSubscriber; }); 51857/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 51858 51859class OuterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 51860 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 51861 this.destination.next(innerValue); 51862 } 51863 notifyError(error, innerSub) { 51864 this.destination.error(error); 51865 } 51866 notifyComplete(innerSub) { 51867 this.destination.complete(); 51868 } 51869} 51870//# sourceMappingURL=OuterSubscriber.js.map 51871 51872/***/ }), 51873
vendor: 5,210 bytes, lines 51874-51996
51874/***/ "./node_modules/rxjs/_esm2015/internal/ReplaySubject.js": 51875/*!**************************************************************!*\ 51876 !*** ./node_modules/rxjs/_esm2015/internal/ReplaySubject.js ***! 51877 \**************************************************************/ 51878/*! exports provided: ReplaySubject */ 51879/***/ (function(module, __webpack_exports__, __webpack_require__) { 51880 51881"use strict"; 51882__webpack_require__.r(__webpack_exports__); 51883/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return ReplaySubject; }); 51884/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 51885/* harmony import */ var _scheduler_queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scheduler/queue */ "./node_modules/rxjs/_esm2015/internal/scheduler/queue.js"); 51886/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 51887/* harmony import */ var _operators_observeOn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./operators/observeOn */ "./node_modules/rxjs/_esm2015/internal/operators/observeOn.js"); 51888/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js"); 51889/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SubjectSubscription */ "./node_modules/rxjs/_esm2015/internal/SubjectSubscription.js"); 51890 51891 51892 51893 51894 51895 51896class ReplaySubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"] { 51897 constructor(bufferSize = Number.POSITIVE_INFINITY, windowTime = Number.POSITIVE_INFINITY, scheduler) { 51898 super(); 51899 this.scheduler = scheduler; 51900 this._events = []; 51901 this._infiniteTimeWindow = false; 51902 this._bufferSize = bufferSize < 1 ? 1 : bufferSize; 51903 this._windowTime = windowTime < 1 ? 1 : windowTime; 51904 if (windowTime === Number.POSITIVE_INFINITY) { 51905 this._infiniteTimeWindow = true; 51906 this.next = this.nextInfiniteTimeWindow; 51907 } 51908 else { 51909 this.next = this.nextTimeWindow; 51910 } 51911 } 51912 nextInfiniteTimeWindow(value) { 51913 const _events = this._events; 51914 _events.push(value); 51915 if (_events.length > this._bufferSize) { 51916 _events.shift(); 51917 } 51918 super.next(value); 51919 } 51920 nextTimeWindow(value) { 51921 this._events.push(new ReplayEvent(this._getNow(), value)); 51922 this._trimBufferThenGetEvents(); 51923 super.next(value); 51924 } 51925 _subscribe(subscriber) { 51926 const _infiniteTimeWindow = this._infiniteTimeWindow; 51927 const _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents(); 51928 const scheduler = this.scheduler; 51929 const len = _events.length; 51930 let subscription; 51931 if (this.closed) { 51932 throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"](); 51933 } 51934 else if (this.isStopped || this.hasError) { 51935 subscription = _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY; 51936 } 51937 else { 51938 this.observers.push(subscriber); 51939 subscription = new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__["SubjectSubscription"](this, subscriber); 51940 } 51941 if (scheduler) { 51942 subscriber.add(subscriber = new _operators_observeOn__WEBPACK_IMPORTED_MODULE_3__["ObserveOnSubscriber"](subscriber, scheduler)); 51943 } 51944 if (_infiniteTimeWindow) { 51945 for (let i = 0; i < len && !subscriber.closed; i++) { 51946 subscriber.next(_events[i]); 51947 } 51948 } 51949 else { 51950 for (let i = 0; i < len && !subscriber.closed; i++) { 51951 subscriber.next(_events[i].value); 51952 } 51953 } 51954 if (this.hasError) { 51955 subscriber.error(this.thrownError); 51956 } 51957 else if (this.isStopped) { 51958 subscriber.complete(); 51959 } 51960 return subscription; 51961 } 51962 _getNow() { 51963 return (this.scheduler || _scheduler_queue__WEBPACK_IMPORTED_MODULE_1__["queue"]).now(); 51964 } 51965 _trimBufferThenGetEvents() { 51966 const now = this._getNow(); 51967 const _bufferSize = this._bufferSize; 51968 const _windowTime = this._windowTime; 51969 const _events = this._events; 51970 const eventsCount = _events.length; 51971 let spliceCount = 0; 51972 while (spliceCount < eventsCount) { 51973 if ((now - _events[spliceCount].time) < _windowTime) { 51974 break; 51975 } 51976 spliceCount++; 51977 } 51978 if (eventsCount > _bufferSize) { 51979 spliceCount = Math.max(spliceCount, eventsCount - _bufferSize); 51980 } 51981 if (spliceCount > 0) { 51982 _events.splice(0, spliceCount); 51983 } 51984 return _events; 51985 } 51986} 51987class ReplayEvent { 51988 constructor(time, value) { 51989 this.time = time; 51990 this.value = value; 51991 } 51992} 51993//# sourceMappingURL=ReplaySubject.js.map 51994 51995/***/ }), 51996
vendor: 894 bytes, lines 51997-52020
51997/***/ "./node_modules/rxjs/_esm2015/internal/Scheduler.js": 51998/*!**********************************************************!*\ 51999 !*** ./node_modules/rxjs/_esm2015/internal/Scheduler.js ***! 52000 \**********************************************************/ 52001/*! exports provided: Scheduler */ 52002/***/ (function(module, __webpack_exports__, __webpack_require__) { 52003 52004"use strict"; 52005__webpack_require__.r(__webpack_exports__); 52006/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return Scheduler; }); 52007class Scheduler { 52008 constructor(SchedulerAction, now = Scheduler.now) { 52009 this.SchedulerAction = SchedulerAction; 52010 this.now = now; 52011 } 52012 schedule(work, delay = 0, state) { 52013 return new this.SchedulerAction(this, work).schedule(state, delay); 52014 } 52015} 52016Scheduler.now = () => Date.now(); 52017//# sourceMappingURL=Scheduler.js.map 52018 52019/***/ }), 52020
vendor: 6,405 bytes, lines 52021-52185
52021/***/ "./node_modules/rxjs/_esm2015/internal/Subject.js": 52022/*!********************************************************!*\ 52023 !*** ./node_modules/rxjs/_esm2015/internal/Subject.js ***! 52024 \********************************************************/ 52025/*! exports provided: SubjectSubscriber, Subject, AnonymousSubject */ 52026/***/ (function(module, __webpack_exports__, __webpack_require__) { 52027 52028"use strict"; 52029__webpack_require__.r(__webpack_exports__); 52030/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscriber", function() { return SubjectSubscriber; }); 52031/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; }); 52032/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnonymousSubject", function() { return AnonymousSubject; }); 52033/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 52034/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 52035/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 52036/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js"); 52037/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SubjectSubscription */ "./node_modules/rxjs/_esm2015/internal/SubjectSubscription.js"); 52038/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ "./node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js"); 52039 52040 52041 52042 52043 52044 52045class SubjectSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"] { 52046 constructor(destination) { 52047 super(destination); 52048 this.destination = destination; 52049 } 52050} 52051class Subject extends _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] { 52052 constructor() { 52053 super(); 52054 this.observers = []; 52055 this.closed = false; 52056 this.isStopped = false; 52057 this.hasError = false; 52058 this.thrownError = null; 52059 } 52060 [_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_5__["rxSubscriber"]]() { 52061 return new SubjectSubscriber(this); 52062 } 52063 lift(operator) { 52064 const subject = new AnonymousSubject(this, this); 52065 subject.operator = operator; 52066 return subject; 52067 } 52068 next(value) { 52069 if (this.closed) { 52070 throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"](); 52071 } 52072 if (!this.isStopped) { 52073 const { observers } = this; 52074 const len = observers.length; 52075 const copy = observers.slice(); 52076 for (let i = 0; i < len; i++) { 52077 copy[i].next(value); 52078 } 52079 } 52080 } 52081 error(err) { 52082 if (this.closed) { 52083 throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"](); 52084 } 52085 this.hasError = true; 52086 this.thrownError = err; 52087 this.isStopped = true; 52088 const { observers } = this; 52089 const len = observers.length; 52090 const copy = observers.slice(); 52091 for (let i = 0; i < len; i++) { 52092 copy[i].error(err); 52093 } 52094 this.observers.length = 0; 52095 } 52096 complete() { 52097 if (this.closed) { 52098 throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"](); 52099 } 52100 this.isStopped = true; 52101 const { observers } = this; 52102 const len = observers.length; 52103 const copy = observers.slice(); 52104 for (let i = 0; i < len; i++) { 52105 copy[i].complete(); 52106 } 52107 this.observers.length = 0; 52108 } 52109 unsubscribe() { 52110 this.isStopped = true; 52111 this.closed = true; 52112 this.observers = null; 52113 } 52114 _trySubscribe(subscriber) { 52115 if (this.closed) { 52116 throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"](); 52117 } 52118 else { 52119 return super._trySubscribe(subscriber); 52120 } 52121 } 52122 _subscribe(subscriber) { 52123 if (this.closed) { 52124 throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"](); 52125 } 52126 else if (this.hasError) { 52127 subscriber.error(this.thrownError); 52128 return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY; 52129 } 52130 else if (this.isStopped) { 52131 subscriber.complete(); 52132 return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY; 52133 } 52134 else { 52135 this.observers.push(subscriber); 52136 return new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_4__["SubjectSubscription"](this, subscriber); 52137 } 52138 } 52139 asObservable() { 52140 const observable = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](); 52141 observable.source = this; 52142 return observable; 52143 } 52144} 52145Subject.create = (destination, source) => { 52146 return new AnonymousSubject(destination, source); 52147}; 52148class AnonymousSubject extends Subject { 52149 constructor(destination, source) { 52150 super(); 52151 this.destination = destination; 52152 this.source = source; 52153 } 52154 next(value) { 52155 const { destination } = this; 52156 if (destination && destination.next) { 52157 destination.next(value); 52158 } 52159 } 52160 error(err) { 52161 const { destination } = this; 52162 if (destination && destination.error) { 52163 this.destination.error(err); 52164 } 52165 } 52166 complete() { 52167 const { destination } = this; 52168 if (destination && destination.complete) { 52169 this.destination.complete(); 52170 } 52171 } 52172 _subscribe(subscriber) { 52173 const { source } = this; 52174 if (source) { 52175 return this.source.subscribe(subscriber); 52176 } 52177 else { 52178 return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY; 52179 } 52180 } 52181} 52182//# sourceMappingURL=Subject.js.map 52183 52184/***/ }), 52185
vendor: 1,604 bytes, lines 52186-52225
52186/***/ "./node_modules/rxjs/_esm2015/internal/SubjectSubscription.js": 52187/*!********************************************************************!*\ 52188 !*** ./node_modules/rxjs/_esm2015/internal/SubjectSubscription.js ***! 52189 \********************************************************************/ 52190/*! exports provided: SubjectSubscription */ 52191/***/ (function(module, __webpack_exports__, __webpack_require__) { 52192 52193"use strict"; 52194__webpack_require__.r(__webpack_exports__); 52195/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; }); 52196/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 52197 52198class SubjectSubscription extends _Subscription__WEBPACK_IMPORTED_MODULE_0__["Subscription"] { 52199 constructor(subject, subscriber) { 52200 super(); 52201 this.subject = subject; 52202 this.subscriber = subscriber; 52203 this.closed = false; 52204 } 52205 unsubscribe() { 52206 if (this.closed) { 52207 return; 52208 } 52209 this.closed = true; 52210 const subject = this.subject; 52211 const observers = subject.observers; 52212 this.subject = null; 52213 if (!observers || observers.length === 0 || subject.isStopped || subject.closed) { 52214 return; 52215 } 52216 const subscriberIndex = observers.indexOf(this.subscriber); 52217 if (subscriberIndex !== -1) { 52218 observers.splice(subscriberIndex, 1); 52219 } 52220 } 52221} 52222//# sourceMappingURL=SubjectSubscription.js.map 52223 52224/***/ }), 52225
vendor: 9,609 bytes, lines 52226-52467
52226/***/ "./node_modules/rxjs/_esm2015/internal/Subscriber.js": 52227/*!***********************************************************!*\ 52228 !*** ./node_modules/rxjs/_esm2015/internal/Subscriber.js ***! 52229 \***********************************************************/ 52230/*! exports provided: Subscriber, SafeSubscriber */ 52231/***/ (function(module, __webpack_exports__, __webpack_require__) { 52232 52233"use strict"; 52234__webpack_require__.r(__webpack_exports__); 52235/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return Subscriber; }); 52236/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SafeSubscriber", function() { return SafeSubscriber; }); 52237/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isFunction */ "./node_modules/rxjs/_esm2015/internal/util/isFunction.js"); 52238/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observer */ "./node_modules/rxjs/_esm2015/internal/Observer.js"); 52239/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 52240/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ "./node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js"); 52241/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm2015/internal/config.js"); 52242/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/hostReportError */ "./node_modules/rxjs/_esm2015/internal/util/hostReportError.js"); 52243 52244 52245 52246 52247 52248 52249class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"] { 52250 constructor(destinationOrNext, error, complete) { 52251 super(); 52252 this.syncErrorValue = null; 52253 this.syncErrorThrown = false; 52254 this.syncErrorThrowable = false; 52255 this.isStopped = false; 52256 switch (arguments.length) { 52257 case 0: 52258 this.destination = _Observer__WEBPACK_IMPORTED_MODULE_1__["empty"]; 52259 break; 52260 case 1: 52261 if (!destinationOrNext) { 52262 this.destination = _Observer__WEBPACK_IMPORTED_MODULE_1__["empty"]; 52263 break; 52264 } 52265 if (typeof destinationOrNext === 'object') { 52266 if (destinationOrNext instanceof Subscriber) { 52267 this.syncErrorThrowable = destinationOrNext.syncErrorThrowable; 52268 this.destination = destinationOrNext; 52269 destinationOrNext.add(this); 52270 } 52271 else { 52272 this.syncErrorThrowable = true; 52273 this.destination = new SafeSubscriber(this, destinationOrNext); 52274 } 52275 break; 52276 } 52277 default: 52278 this.syncErrorThrowable = true; 52279 this.destination = new SafeSubscriber(this, destinationOrNext, error, complete); 52280 break; 52281 } 52282 } 52283 [_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_3__["rxSubscriber"]]() { return this; } 52284 static create(next, error, complete) { 52285 const subscriber = new Subscriber(next, error, complete); 52286 subscriber.syncErrorThrowable = false; 52287 return subscriber; 52288 } 52289 next(value) { 52290 if (!this.isStopped) { 52291 this._next(value); 52292 } 52293 } 52294 error(err) { 52295 if (!this.isStopped) { 52296 this.isStopped = true; 52297 this._error(err); 52298 } 52299 } 52300 complete() { 52301 if (!this.isStopped) { 52302 this.isStopped = true; 52303 this._complete(); 52304 } 52305 } 52306 unsubscribe() { 52307 if (this.closed) { 52308 return; 52309 } 52310 this.isStopped = true; 52311 super.unsubscribe(); 52312 } 52313 _next(value) { 52314 this.destination.next(value); 52315 } 52316 _error(err) { 52317 this.destination.error(err); 52318 this.unsubscribe(); 52319 } 52320 _complete() { 52321 this.destination.complete(); 52322 this.unsubscribe(); 52323 } 52324 _unsubscribeAndRecycle() { 52325 const { _parentOrParents } = this; 52326 this._parentOrParents = null; 52327 this.unsubscribe(); 52328 this.closed = false; 52329 this.isStopped = false; 52330 this._parentOrParents = _parentOrParents; 52331 return this; 52332 } 52333} 52334class SafeSubscriber extends Subscriber { 52335 constructor(_parentSubscriber, observerOrNext, error, complete) { 52336 super(); 52337 this._parentSubscriber = _parentSubscriber; 52338 let next; 52339 let context = this; 52340 if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_0__["isFunction"])(observerOrNext)) { 52341 next = observerOrNext; 52342 } 52343 else if (observerOrNext) { 52344 next = observerOrNext.next; 52345 error = observerOrNext.error; 52346 complete = observerOrNext.complete; 52347 if (observerOrNext !== _Observer__WEBPACK_IMPORTED_MODULE_1__["empty"]) { 52348 context = Object.create(observerOrNext); 52349 if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_0__["isFunction"])(context.unsubscribe)) { 52350 this.add(context.unsubscribe.bind(context)); 52351 } 52352 context.unsubscribe = this.unsubscribe.bind(this); 52353 } 52354 } 52355 this._context = context; 52356 this._next = next; 52357 this._error = error; 52358 this._complete = complete; 52359 } 52360 next(value) { 52361 if (!this.isStopped && this._next) { 52362 const { _parentSubscriber } = this; 52363 if (!_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { 52364 this.__tryOrUnsub(this._next, value); 52365 } 52366 else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) { 52367 this.unsubscribe(); 52368 } 52369 } 52370 } 52371 error(err) { 52372 if (!this.isStopped) { 52373 const { _parentSubscriber } = this; 52374 const { useDeprecatedSynchronousErrorHandling } = _config__WEBPACK_IMPORTED_MODULE_4__["config"]; 52375 if (this._error) { 52376 if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { 52377 this.__tryOrUnsub(this._error, err); 52378 this.unsubscribe(); 52379 } 52380 else { 52381 this.__tryOrSetError(_parentSubscriber, this._error, err); 52382 this.unsubscribe(); 52383 } 52384 } 52385 else if (!_parentSubscriber.syncErrorThrowable) { 52386 this.unsubscribe(); 52387 if (useDeprecatedSynchronousErrorHandling) { 52388 throw err; 52389 } 52390 Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__["hostReportError"])(err); 52391 } 52392 else { 52393 if (useDeprecatedSynchronousErrorHandling) { 52394 _parentSubscriber.syncErrorValue = err; 52395 _parentSubscriber.syncErrorThrown = true; 52396 } 52397 else { 52398 Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__["hostReportError"])(err); 52399 } 52400 this.unsubscribe(); 52401 } 52402 } 52403 } 52404 complete() { 52405 if (!this.isStopped) { 52406 const { _parentSubscriber } = this; 52407 if (this._complete) { 52408 const wrappedComplete = () => this._complete.call(this._context); 52409 if (!_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { 52410 this.__tryOrUnsub(wrappedComplete); 52411 this.unsubscribe(); 52412 } 52413 else { 52414 this.__tryOrSetError(_parentSubscriber, wrappedComplete); 52415 this.unsubscribe(); 52416 } 52417 } 52418 else { 52419 this.unsubscribe(); 52420 } 52421 } 52422 } 52423 __tryOrUnsub(fn, value) { 52424 try { 52425 fn.call(this._context, value); 52426 } 52427 catch (err) { 52428 this.unsubscribe(); 52429 if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) { 52430 throw err; 52431 } 52432 else { 52433 Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__["hostReportError"])(err); 52434 } 52435 } 52436 } 52437 __tryOrSetError(parent, fn, value) { 52438 if (!_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) { 52439 throw new Error('bad call'); 52440 } 52441 try { 52442 fn.call(this._context, value); 52443 } 52444 catch (err) { 52445 if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) { 52446 parent.syncErrorValue = err; 52447 parent.syncErrorThrown = true; 52448 return true; 52449 } 52450 else { 52451 Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__["hostReportError"])(err); 52452 return true; 52453 } 52454 } 52455 return false; 52456 } 52457 _unsubscribe() { 52458 const { _parentSubscriber } = this; 52459 this._context = null; 52460 this._parentSubscriber = null; 52461 _parentSubscriber.unsubscribe(); 52462 } 52463} 52464//# sourceMappingURL=Subscriber.js.map 52465 52466/***/ }), 52467
vendor: 6,123 bytes, lines 52468-52617
52468/***/ "./node_modules/rxjs/_esm2015/internal/Subscription.js": 52469/*!*************************************************************!*\ 52470 !*** ./node_modules/rxjs/_esm2015/internal/Subscription.js ***! 52471 \*************************************************************/ 52472/*! exports provided: Subscription */ 52473/***/ (function(module, __webpack_exports__, __webpack_require__) { 52474 52475"use strict"; 52476__webpack_require__.r(__webpack_exports__); 52477/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return Subscription; }); 52478/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 52479/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/isObject */ "./node_modules/rxjs/_esm2015/internal/util/isObject.js"); 52480/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/isFunction */ "./node_modules/rxjs/_esm2015/internal/util/isFunction.js"); 52481/* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/UnsubscriptionError */ "./node_modules/rxjs/_esm2015/internal/util/UnsubscriptionError.js"); 52482 52483 52484 52485 52486class Subscription { 52487 constructor(unsubscribe) { 52488 this.closed = false; 52489 this._parentOrParents = null; 52490 this._subscriptions = null; 52491 if (unsubscribe) { 52492 this._unsubscribe = unsubscribe; 52493 } 52494 } 52495 unsubscribe() { 52496 let errors; 52497 if (this.closed) { 52498 return; 52499 } 52500 let { _parentOrParents, _unsubscribe, _subscriptions } = this; 52501 this.closed = true; 52502 this._parentOrParents = null; 52503 this._subscriptions = null; 52504 if (_parentOrParents instanceof Subscription) { 52505 _parentOrParents.remove(this); 52506 } 52507 else if (_parentOrParents !== null) { 52508 for (let index = 0; index < _parentOrParents.length; ++index) { 52509 const parent = _parentOrParents[index]; 52510 parent.remove(this); 52511 } 52512 } 52513 if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(_unsubscribe)) { 52514 try { 52515 _unsubscribe.call(this); 52516 } 52517 catch (e) { 52518 errors = e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"] ? flattenUnsubscriptionErrors(e.errors) : [e]; 52519 } 52520 } 52521 if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(_subscriptions)) { 52522 let index = -1; 52523 let len = _subscriptions.length; 52524 while (++index < len) { 52525 const sub = _subscriptions[index]; 52526 if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_1__["isObject"])(sub)) { 52527 try { 52528 sub.unsubscribe(); 52529 } 52530 catch (e) { 52531 errors = errors || []; 52532 if (e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"]) { 52533 errors = errors.concat(flattenUnsubscriptionErrors(e.errors)); 52534 } 52535 else { 52536 errors.push(e); 52537 } 52538 } 52539 } 52540 } 52541 } 52542 if (errors) { 52543 throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"](errors); 52544 } 52545 } 52546 add(teardown) { 52547 let subscription = teardown; 52548 if (!teardown) { 52549 return Subscription.EMPTY; 52550 } 52551 switch (typeof teardown) { 52552 case 'function': 52553 subscription = new Subscription(teardown); 52554 case 'object': 52555 if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') { 52556 return subscription; 52557 } 52558 else if (this.closed) { 52559 subscription.unsubscribe(); 52560 return subscription; 52561 } 52562 else if (!(subscription instanceof Subscription)) { 52563 const tmp = subscription; 52564 subscription = new Subscription(); 52565 subscription._subscriptions = [tmp]; 52566 } 52567 break; 52568 default: { 52569 throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.'); 52570 } 52571 } 52572 let { _parentOrParents } = subscription; 52573 if (_parentOrParents === null) { 52574 subscription._parentOrParents = this; 52575 } 52576 else if (_parentOrParents instanceof Subscription) { 52577 if (_parentOrParents === this) { 52578 return subscription; 52579 } 52580 subscription._parentOrParents = [_parentOrParents, this]; 52581 } 52582 else if (_parentOrParents.indexOf(this) === -1) { 52583 _parentOrParents.push(this); 52584 } 52585 else { 52586 return subscription; 52587 } 52588 const subscriptions = this._subscriptions; 52589 if (subscriptions === null) { 52590 this._subscriptions = [subscription]; 52591 } 52592 else { 52593 subscriptions.push(subscription); 52594 } 52595 return subscription; 52596 } 52597 remove(subscription) { 52598 const subscriptions = this._subscriptions; 52599 if (subscriptions) { 52600 const subscriptionIndex = subscriptions.indexOf(subscription); 52601 if (subscriptionIndex !== -1) { 52602 subscriptions.splice(subscriptionIndex, 1); 52603 } 52604 } 52605 } 52606} 52607Subscription.EMPTY = (function (empty) { 52608 empty.closed = true; 52609 return empty; 52610}(new Subscription())); 52611function flattenUnsubscriptionErrors(errors) { 52612 return errors.reduce((errs, err) => errs.concat((err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"]) ? err.errors : err), []); 52613} 52614//# sourceMappingURL=Subscription.js.map 52615 52616/***/ }), 52617
vendor: 1,296 bytes, lines 52618-52648
52618/***/ "./node_modules/rxjs/_esm2015/internal/config.js": 52619/*!*******************************************************!*\ 52620 !*** ./node_modules/rxjs/_esm2015/internal/config.js ***! 52621 \*******************************************************/ 52622/*! exports provided: config */ 52623/***/ (function(module, __webpack_exports__, __webpack_require__) { 52624 52625"use strict"; 52626__webpack_require__.r(__webpack_exports__); 52627/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); 52628let _enable_super_gross_mode_that_will_cause_bad_things = false; 52629const config = { 52630 Promise: undefined, 52631 set useDeprecatedSynchronousErrorHandling(value) { 52632 if (value) { 52633 const error = new Error(); 52634 console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack); 52635 } 52636 else if (_enable_super_gross_mode_that_will_cause_bad_things) { 52637 console.log('RxJS: Back to a better error behavior. Thank you. <3'); 52638 } 52639 _enable_super_gross_mode_that_will_cause_bad_things = value; 52640 }, 52641 get useDeprecatedSynchronousErrorHandling() { 52642 return _enable_super_gross_mode_that_will_cause_bad_things; 52643 }, 52644}; 52645//# sourceMappingURL=config.js.map 52646 52647/***/ }), 52648
vendor: 5,961 bytes, lines 52649-52796
52649/***/ "./node_modules/rxjs/_esm2015/internal/observable/ConnectableObservable.js": 52650/*!*********************************************************************************!*\ 52651 !*** ./node_modules/rxjs/_esm2015/internal/observable/ConnectableObservable.js ***! 52652 \*********************************************************************************/ 52653/*! exports provided: ConnectableObservable, connectableObservableDescriptor */ 52654/***/ (function(module, __webpack_exports__, __webpack_require__) { 52655 52656"use strict"; 52657__webpack_require__.r(__webpack_exports__); 52658/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return ConnectableObservable; }); 52659/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "connectableObservableDescriptor", function() { return connectableObservableDescriptor; }); 52660/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 52661/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 52662/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 52663/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 52664/* harmony import */ var _operators_refCount__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../operators/refCount */ "./node_modules/rxjs/_esm2015/internal/operators/refCount.js"); 52665 52666 52667 52668 52669 52670class ConnectableObservable extends _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"] { 52671 constructor(source, subjectFactory) { 52672 super(); 52673 this.source = source; 52674 this.subjectFactory = subjectFactory; 52675 this._refCount = 0; 52676 this._isComplete = false; 52677 } 52678 _subscribe(subscriber) { 52679 return this.getSubject().subscribe(subscriber); 52680 } 52681 getSubject() { 52682 const subject = this._subject; 52683 if (!subject || subject.isStopped) { 52684 this._subject = this.subjectFactory(); 52685 } 52686 return this._subject; 52687 } 52688 connect() { 52689 let connection = this._connection; 52690 if (!connection) { 52691 this._isComplete = false; 52692 connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"](); 52693 connection.add(this.source 52694 .subscribe(new ConnectableSubscriber(this.getSubject(), this))); 52695 if (connection.closed) { 52696 this._connection = null; 52697 connection = _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY; 52698 } 52699 } 52700 return connection; 52701 } 52702 refCount() { 52703 return Object(_operators_refCount__WEBPACK_IMPORTED_MODULE_4__["refCount"])()(this); 52704 } 52705} 52706const connectableObservableDescriptor = (() => { 52707 const connectableProto = ConnectableObservable.prototype; 52708 return { 52709 operator: { value: null }, 52710 _refCount: { value: 0, writable: true }, 52711 _subject: { value: null, writable: true }, 52712 _connection: { value: null, writable: true }, 52713 _subscribe: { value: connectableProto._subscribe }, 52714 _isComplete: { value: connectableProto._isComplete, writable: true }, 52715 getSubject: { value: connectableProto.getSubject }, 52716 connect: { value: connectableProto.connect }, 52717 refCount: { value: connectableProto.refCount } 52718 }; 52719})(); 52720class ConnectableSubscriber extends _Subject__WEBPACK_IMPORTED_MODULE_0__["SubjectSubscriber"] { 52721 constructor(destination, connectable) { 52722 super(destination); 52723 this.connectable = connectable; 52724 } 52725 _error(err) { 52726 this._unsubscribe(); 52727 super._error(err); 52728 } 52729 _complete() { 52730 this.connectable._isComplete = true; 52731 this._unsubscribe(); 52732 super._complete(); 52733 } 52734 _unsubscribe() { 52735 const connectable = this.connectable; 52736 if (connectable) { 52737 this.connectable = null; 52738 const connection = connectable._connection; 52739 connectable._refCount = 0; 52740 connectable._subject = null; 52741 connectable._connection = null; 52742 if (connection) { 52743 connection.unsubscribe(); 52744 } 52745 } 52746 } 52747} 52748class RefCountOperator { 52749 constructor(connectable) { 52750 this.connectable = connectable; 52751 } 52752 call(subscriber, source) { 52753 const { connectable } = this; 52754 connectable._refCount++; 52755 const refCounter = new RefCountSubscriber(subscriber, connectable); 52756 const subscription = source.subscribe(refCounter); 52757 if (!refCounter.closed) { 52758 refCounter.connection = connectable.connect(); 52759 } 52760 return subscription; 52761 } 52762} 52763class RefCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"] { 52764 constructor(destination, connectable) { 52765 super(destination); 52766 this.connectable = connectable; 52767 } 52768 _unsubscribe() { 52769 const { connectable } = this; 52770 if (!connectable) { 52771 this.connection = null; 52772 return; 52773 } 52774 this.connectable = null; 52775 const refCount = connectable._refCount; 52776 if (refCount <= 0) { 52777 this.connection = null; 52778 return; 52779 } 52780 connectable._refCount = refCount - 1; 52781 if (refCount > 1) { 52782 this.connection = null; 52783 return; 52784 } 52785 const { connection } = this; 52786 const sharedConnection = connectable._connection; 52787 this.connection = null; 52788 if (sharedConnection && (!connection || sharedConnection === connection)) { 52789 sharedConnection.unsubscribe(); 52790 } 52791 } 52792} 52793//# sourceMappingURL=ConnectableObservable.js.map 52794 52795/***/ }), 52796
vendor: 2,469 bytes, lines 52797-52845
52797/***/ "./node_modules/rxjs/_esm2015/internal/observable/SubscribeOnObservable.js": 52798/*!*********************************************************************************!*\ 52799 !*** ./node_modules/rxjs/_esm2015/internal/observable/SubscribeOnObservable.js ***! 52800 \*********************************************************************************/ 52801/*! exports provided: SubscribeOnObservable */ 52802/***/ (function(module, __webpack_exports__, __webpack_require__) { 52803 52804"use strict"; 52805__webpack_require__.r(__webpack_exports__); 52806/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubscribeOnObservable", function() { return SubscribeOnObservable; }); 52807/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 52808/* harmony import */ var _scheduler_asap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/asap */ "./node_modules/rxjs/_esm2015/internal/scheduler/asap.js"); 52809/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isNumeric */ "./node_modules/rxjs/_esm2015/internal/util/isNumeric.js"); 52810 52811 52812 52813class SubscribeOnObservable extends _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] { 52814 constructor(source, delayTime = 0, scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_1__["asap"]) { 52815 super(); 52816 this.source = source; 52817 this.delayTime = delayTime; 52818 this.scheduler = scheduler; 52819 if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(delayTime) || delayTime < 0) { 52820 this.delayTime = 0; 52821 } 52822 if (!scheduler || typeof scheduler.schedule !== 'function') { 52823 this.scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_1__["asap"]; 52824 } 52825 } 52826 static create(source, delay = 0, scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_1__["asap"]) { 52827 return new SubscribeOnObservable(source, delay, scheduler); 52828 } 52829 static dispatch(arg) { 52830 const { source, subscriber } = arg; 52831 return this.add(source.subscribe(subscriber)); 52832 } 52833 _subscribe(subscriber) { 52834 const delay = this.delayTime; 52835 const source = this.source; 52836 const scheduler = this.scheduler; 52837 return scheduler.schedule(SubscribeOnObservable.dispatch, delay, { 52838 source, subscriber 52839 }); 52840 } 52841} 52842//# sourceMappingURL=SubscribeOnObservable.js.map 52843 52844/***/ }), 52845
vendor: 4,633 bytes, lines 52846-52949
52846/***/ "./node_modules/rxjs/_esm2015/internal/observable/bindCallback.js": 52847/*!************************************************************************!*\ 52848 !*** ./node_modules/rxjs/_esm2015/internal/observable/bindCallback.js ***! 52849 \************************************************************************/ 52850/*! exports provided: bindCallback */ 52851/***/ (function(module, __webpack_exports__, __webpack_require__) { 52852 52853"use strict"; 52854__webpack_require__.r(__webpack_exports__); 52855/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return bindCallback; }); 52856/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 52857/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AsyncSubject */ "./node_modules/rxjs/_esm2015/internal/AsyncSubject.js"); 52858/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 52859/* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/canReportError */ "./node_modules/rxjs/_esm2015/internal/util/canReportError.js"); 52860/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 52861/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 52862 52863 52864 52865 52866 52867 52868function bindCallback(callbackFunc, resultSelector, scheduler) { 52869 if (resultSelector) { 52870 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(resultSelector)) { 52871 scheduler = resultSelector; 52872 } 52873 else { 52874 return (...args) => bindCallback(callbackFunc, scheduler)(...args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])((args) => Object(_util_isArray__WEBPACK_IMPORTED_MODULE_4__["isArray"])(args) ? resultSelector(...args) : resultSelector(args))); 52875 } 52876 } 52877 return function (...args) { 52878 const context = this; 52879 let subject; 52880 const params = { 52881 context, 52882 subject, 52883 callbackFunc, 52884 scheduler, 52885 }; 52886 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 52887 if (!scheduler) { 52888 if (!subject) { 52889 subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"](); 52890 const handler = (...innerArgs) => { 52891 subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs); 52892 subject.complete(); 52893 }; 52894 try { 52895 callbackFunc.apply(context, [...args, handler]); 52896 } 52897 catch (err) { 52898 if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_3__["canReportError"])(subject)) { 52899 subject.error(err); 52900 } 52901 else { 52902 console.warn(err); 52903 } 52904 } 52905 } 52906 return subject.subscribe(subscriber); 52907 } 52908 else { 52909 const state = { 52910 args, subscriber, params, 52911 }; 52912 return scheduler.schedule(dispatch, 0, state); 52913 } 52914 }); 52915 }; 52916} 52917function dispatch(state) { 52918 const self = this; 52919 const { args, subscriber, params } = state; 52920 const { callbackFunc, context, scheduler } = params; 52921 let { subject } = params; 52922 if (!subject) { 52923 subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"](); 52924 const handler = (...innerArgs) => { 52925 const value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs; 52926 this.add(scheduler.schedule(dispatchNext, 0, { value, subject })); 52927 }; 52928 try { 52929 callbackFunc.apply(context, [...args, handler]); 52930 } 52931 catch (err) { 52932 subject.error(err); 52933 } 52934 } 52935 this.add(subject.subscribe(subscriber)); 52936} 52937function dispatchNext(state) { 52938 const { value, subject } = state; 52939 subject.next(value); 52940 subject.complete(); 52941} 52942function dispatchError(state) { 52943 const { err, subject } = state; 52944 subject.error(err); 52945} 52946//# sourceMappingURL=bindCallback.js.map 52947 52948/***/ }), 52949
vendor: 5,101 bytes, lines 52950-53061
52950/***/ "./node_modules/rxjs/_esm2015/internal/observable/bindNodeCallback.js": 52951/*!****************************************************************************!*\ 52952 !*** ./node_modules/rxjs/_esm2015/internal/observable/bindNodeCallback.js ***! 52953 \****************************************************************************/ 52954/*! exports provided: bindNodeCallback */ 52955/***/ (function(module, __webpack_exports__, __webpack_require__) { 52956 52957"use strict"; 52958__webpack_require__.r(__webpack_exports__); 52959/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return bindNodeCallback; }); 52960/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 52961/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AsyncSubject */ "./node_modules/rxjs/_esm2015/internal/AsyncSubject.js"); 52962/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 52963/* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/canReportError */ "./node_modules/rxjs/_esm2015/internal/util/canReportError.js"); 52964/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 52965/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 52966 52967 52968 52969 52970 52971 52972function bindNodeCallback(callbackFunc, resultSelector, scheduler) { 52973 if (resultSelector) { 52974 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(resultSelector)) { 52975 scheduler = resultSelector; 52976 } 52977 else { 52978 return (...args) => bindNodeCallback(callbackFunc, scheduler)(...args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(args => Object(_util_isArray__WEBPACK_IMPORTED_MODULE_5__["isArray"])(args) ? resultSelector(...args) : resultSelector(args))); 52979 } 52980 } 52981 return function (...args) { 52982 const params = { 52983 subject: undefined, 52984 args, 52985 callbackFunc, 52986 scheduler, 52987 context: this, 52988 }; 52989 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 52990 const { context } = params; 52991 let { subject } = params; 52992 if (!scheduler) { 52993 if (!subject) { 52994 subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"](); 52995 const handler = (...innerArgs) => { 52996 const err = innerArgs.shift(); 52997 if (err) { 52998 subject.error(err); 52999 return; 53000 } 53001 subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs); 53002 subject.complete(); 53003 }; 53004 try { 53005 callbackFunc.apply(context, [...args, handler]); 53006 } 53007 catch (err) { 53008 if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_3__["canReportError"])(subject)) { 53009 subject.error(err); 53010 } 53011 else { 53012 console.warn(err); 53013 } 53014 } 53015 } 53016 return subject.subscribe(subscriber); 53017 } 53018 else { 53019 return scheduler.schedule(dispatch, 0, { params, subscriber, context }); 53020 } 53021 }); 53022 }; 53023} 53024function dispatch(state) { 53025 const { params, subscriber, context } = state; 53026 const { callbackFunc, args, scheduler } = params; 53027 let subject = params.subject; 53028 if (!subject) { 53029 subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"](); 53030 const handler = (...innerArgs) => { 53031 const err = innerArgs.shift(); 53032 if (err) { 53033 this.add(scheduler.schedule(dispatchError, 0, { err, subject })); 53034 } 53035 else { 53036 const value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs; 53037 this.add(scheduler.schedule(dispatchNext, 0, { value, subject })); 53038 } 53039 }; 53040 try { 53041 callbackFunc.apply(context, [...args, handler]); 53042 } 53043 catch (err) { 53044 this.add(scheduler.schedule(dispatchError, 0, { err, subject })); 53045 } 53046 } 53047 this.add(subject.subscribe(subscriber)); 53048} 53049function dispatchNext(arg) { 53050 const { value, subject } = arg; 53051 subject.next(value); 53052 subject.complete(); 53053} 53054function dispatchError(arg) { 53055 const { err, subject } = arg; 53056 subject.error(err); 53057} 53058//# sourceMappingURL=bindNodeCallback.js.map 53059 53060/***/ }), 53061
vendor: 4,780 bytes, lines 53062-53170
53062/***/ "./node_modules/rxjs/_esm2015/internal/observable/combineLatest.js": 53063/*!*************************************************************************!*\ 53064 !*** ./node_modules/rxjs/_esm2015/internal/observable/combineLatest.js ***! 53065 \*************************************************************************/ 53066/*! exports provided: combineLatest, CombineLatestOperator, CombineLatestSubscriber */ 53067/***/ (function(module, __webpack_exports__, __webpack_require__) { 53068 53069"use strict"; 53070__webpack_require__.r(__webpack_exports__); 53071/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; }); 53072/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestOperator", function() { return CombineLatestOperator; }); 53073/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestSubscriber", function() { return CombineLatestSubscriber; }); 53074/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 53075/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 53076/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 53077/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 53078/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm2015/internal/observable/fromArray.js"); 53079 53080 53081 53082 53083 53084const NONE = {}; 53085function combineLatest(...observables) { 53086 let resultSelector = null; 53087 let scheduler = null; 53088 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(observables[observables.length - 1])) { 53089 scheduler = observables.pop(); 53090 } 53091 if (typeof observables[observables.length - 1] === 'function') { 53092 resultSelector = observables.pop(); 53093 } 53094 if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(observables[0])) { 53095 observables = observables[0]; 53096 } 53097 return Object(_fromArray__WEBPACK_IMPORTED_MODULE_4__["fromArray"])(observables, scheduler).lift(new CombineLatestOperator(resultSelector)); 53098} 53099class CombineLatestOperator { 53100 constructor(resultSelector) { 53101 this.resultSelector = resultSelector; 53102 } 53103 call(subscriber, source) { 53104 return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector)); 53105 } 53106} 53107class CombineLatestSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] { 53108 constructor(destination, resultSelector) { 53109 super(destination); 53110 this.resultSelector = resultSelector; 53111 this.active = 0; 53112 this.values = []; 53113 this.observables = []; 53114 } 53115 _next(observable) { 53116 this.values.push(NONE); 53117 this.observables.push(observable); 53118 } 53119 _complete() { 53120 const observables = this.observables; 53121 const len = observables.length; 53122 if (len === 0) { 53123 this.destination.complete(); 53124 } 53125 else { 53126 this.active = len; 53127 this.toRespond = len; 53128 for (let i = 0; i < len; i++) { 53129 const observable = observables[i]; 53130 this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, observable, observable, i)); 53131 } 53132 } 53133 } 53134 notifyComplete(unused) { 53135 if ((this.active -= 1) === 0) { 53136 this.destination.complete(); 53137 } 53138 } 53139 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 53140 const values = this.values; 53141 const oldVal = values[outerIndex]; 53142 const toRespond = !this.toRespond 53143 ? 0 53144 : oldVal === NONE ? --this.toRespond : this.toRespond; 53145 values[outerIndex] = innerValue; 53146 if (toRespond === 0) { 53147 if (this.resultSelector) { 53148 this._tryResultSelector(values); 53149 } 53150 else { 53151 this.destination.next(values.slice()); 53152 } 53153 } 53154 } 53155 _tryResultSelector(values) { 53156 let result; 53157 try { 53158 result = this.resultSelector.apply(this, values); 53159 } 53160 catch (err) { 53161 this.destination.error(err); 53162 return; 53163 } 53164 this.destination.next(result); 53165 } 53166} 53167//# sourceMappingURL=combineLatest.js.map 53168 53169/***/ }), 53170
vendor: 1,135 bytes, lines 53171-53191
53171/***/ "./node_modules/rxjs/_esm2015/internal/observable/concat.js": 53172/*!******************************************************************!*\ 53173 !*** ./node_modules/rxjs/_esm2015/internal/observable/concat.js ***! 53174 \******************************************************************/ 53175/*! exports provided: concat */ 53176/***/ (function(module, __webpack_exports__, __webpack_require__) { 53177 53178"use strict"; 53179__webpack_require__.r(__webpack_exports__); 53180/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; }); 53181/* harmony import */ var _of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./of */ "./node_modules/rxjs/_esm2015/internal/observable/of.js"); 53182/* harmony import */ var _operators_concatAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operators/concatAll */ "./node_modules/rxjs/_esm2015/internal/operators/concatAll.js"); 53183 53184 53185function concat(...observables) { 53186 return Object(_operators_concatAll__WEBPACK_IMPORTED_MODULE_1__["concatAll"])()(Object(_of__WEBPACK_IMPORTED_MODULE_0__["of"])(...observables)); 53187} 53188//# sourceMappingURL=concat.js.map 53189 53190/***/ }), 53191
vendor: 1,587 bytes, lines 53192-53225
53192/***/ "./node_modules/rxjs/_esm2015/internal/observable/defer.js": 53193/*!*****************************************************************!*\ 53194 !*** ./node_modules/rxjs/_esm2015/internal/observable/defer.js ***! 53195 \*****************************************************************/ 53196/*! exports provided: defer */ 53197/***/ (function(module, __webpack_exports__, __webpack_require__) { 53198 53199"use strict"; 53200__webpack_require__.r(__webpack_exports__); 53201/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return defer; }); 53202/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53203/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 53204/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 53205 53206 53207 53208function defer(observableFactory) { 53209 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53210 let input; 53211 try { 53212 input = observableFactory(); 53213 } 53214 catch (err) { 53215 subscriber.error(err); 53216 return undefined; 53217 } 53218 const source = input ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(input) : Object(_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(); 53219 return source.subscribe(subscriber); 53220 }); 53221} 53222//# sourceMappingURL=defer.js.map 53223 53224/***/ }), 53225
vendor: 1,256 bytes, lines 53226-53249
53226/***/ "./node_modules/rxjs/_esm2015/internal/observable/empty.js": 53227/*!*****************************************************************!*\ 53228 !*** ./node_modules/rxjs/_esm2015/internal/observable/empty.js ***! 53229 \*****************************************************************/ 53230/*! exports provided: EMPTY, empty */ 53231/***/ (function(module, __webpack_exports__, __webpack_require__) { 53232 53233"use strict"; 53234__webpack_require__.r(__webpack_exports__); 53235/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return EMPTY; }); 53236/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); 53237/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53238 53239const EMPTY = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => subscriber.complete()); 53240function empty(scheduler) { 53241 return scheduler ? emptyScheduled(scheduler) : EMPTY; 53242} 53243function emptyScheduled(scheduler) { 53244 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => scheduler.schedule(() => subscriber.complete())); 53245} 53246//# sourceMappingURL=empty.js.map 53247 53248/***/ }), 53249
vendor: 3,785 bytes, lines 53250-53328
53250/***/ "./node_modules/rxjs/_esm2015/internal/observable/forkJoin.js": 53251/*!********************************************************************!*\ 53252 !*** ./node_modules/rxjs/_esm2015/internal/observable/forkJoin.js ***! 53253 \********************************************************************/ 53254/*! exports provided: forkJoin */ 53255/***/ (function(module, __webpack_exports__, __webpack_require__) { 53256 53257"use strict"; 53258__webpack_require__.r(__webpack_exports__); 53259/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return forkJoin; }); 53260/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53261/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 53262/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 53263/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isObject */ "./node_modules/rxjs/_esm2015/internal/util/isObject.js"); 53264/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 53265 53266 53267 53268 53269 53270function forkJoin(...sources) { 53271 if (sources.length === 1) { 53272 const first = sources[0]; 53273 if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(first)) { 53274 return forkJoinInternal(first, null); 53275 } 53276 if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_3__["isObject"])(first) && Object.getPrototypeOf(first) === Object.prototype) { 53277 const keys = Object.keys(first); 53278 return forkJoinInternal(keys.map(key => first[key]), keys); 53279 } 53280 } 53281 if (typeof sources[sources.length - 1] === 'function') { 53282 const resultSelector = sources.pop(); 53283 sources = (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(sources[0])) ? sources[0] : sources; 53284 return forkJoinInternal(sources, null).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])((args) => resultSelector(...args))); 53285 } 53286 return forkJoinInternal(sources, null); 53287} 53288function forkJoinInternal(sources, keys) { 53289 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53290 const len = sources.length; 53291 if (len === 0) { 53292 subscriber.complete(); 53293 return; 53294 } 53295 const values = new Array(len); 53296 let completed = 0; 53297 let emitted = 0; 53298 for (let i = 0; i < len; i++) { 53299 const source = Object(_from__WEBPACK_IMPORTED_MODULE_4__["from"])(sources[i]); 53300 let hasValue = false; 53301 subscriber.add(source.subscribe({ 53302 next: value => { 53303 if (!hasValue) { 53304 hasValue = true; 53305 emitted++; 53306 } 53307 values[i] = value; 53308 }, 53309 error: err => subscriber.error(err), 53310 complete: () => { 53311 completed++; 53312 if (completed === len || !hasValue) { 53313 if (emitted === len) { 53314 subscriber.next(keys ? 53315 keys.reduce((result, key, i) => (result[key] = values[i], result), {}) : 53316 values); 53317 } 53318 subscriber.complete(); 53319 } 53320 } 53321 })); 53322 } 53323 }); 53324} 53325//# sourceMappingURL=forkJoin.js.map 53326 53327/***/ }), 53328
vendor: 1,594 bytes, lines 53329-53359
53329/***/ "./node_modules/rxjs/_esm2015/internal/observable/from.js": 53330/*!****************************************************************!*\ 53331 !*** ./node_modules/rxjs/_esm2015/internal/observable/from.js ***! 53332 \****************************************************************/ 53333/*! exports provided: from */ 53334/***/ (function(module, __webpack_exports__, __webpack_require__) { 53335 53336"use strict"; 53337__webpack_require__.r(__webpack_exports__); 53338/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return from; }); 53339/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53340/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeTo */ "./node_modules/rxjs/_esm2015/internal/util/subscribeTo.js"); 53341/* harmony import */ var _scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduled/scheduled */ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduled.js"); 53342 53343 53344 53345function from(input, scheduler) { 53346 if (!scheduler) { 53347 if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) { 53348 return input; 53349 } 53350 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(input)); 53351 } 53352 else { 53353 return Object(_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__["scheduled"])(input, scheduler); 53354 } 53355} 53356//# sourceMappingURL=from.js.map 53357 53358/***/ }), 53359
vendor: 1,561 bytes, lines 53360-53387
53360/***/ "./node_modules/rxjs/_esm2015/internal/observable/fromArray.js": 53361/*!*********************************************************************!*\ 53362 !*** ./node_modules/rxjs/_esm2015/internal/observable/fromArray.js ***! 53363 \*********************************************************************/ 53364/*! exports provided: fromArray */ 53365/***/ (function(module, __webpack_exports__, __webpack_require__) { 53366 53367"use strict"; 53368__webpack_require__.r(__webpack_exports__); 53369/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromArray", function() { return fromArray; }); 53370/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53371/* harmony import */ var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToArray */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToArray.js"); 53372/* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduled/scheduleArray */ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js"); 53373 53374 53375 53376function fromArray(input, scheduler) { 53377 if (!scheduler) { 53378 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__["subscribeToArray"])(input)); 53379 } 53380 else { 53381 return Object(_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(input, scheduler); 53382 } 53383} 53384//# sourceMappingURL=fromArray.js.map 53385 53386/***/ }), 53387
vendor: 3,819 bytes, lines 53388-53466
53388/***/ "./node_modules/rxjs/_esm2015/internal/observable/fromEvent.js": 53389/*!*********************************************************************!*\ 53390 !*** ./node_modules/rxjs/_esm2015/internal/observable/fromEvent.js ***! 53391 \*********************************************************************/ 53392/*! exports provided: fromEvent */ 53393/***/ (function(module, __webpack_exports__, __webpack_require__) { 53394 53395"use strict"; 53396__webpack_require__.r(__webpack_exports__); 53397/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return fromEvent; }); 53398/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53399/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 53400/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ "./node_modules/rxjs/_esm2015/internal/util/isFunction.js"); 53401/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 53402 53403 53404 53405 53406const toString = (() => Object.prototype.toString)(); 53407function fromEvent(target, eventName, options, resultSelector) { 53408 if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(options)) { 53409 resultSelector = options; 53410 options = undefined; 53411 } 53412 if (resultSelector) { 53413 return fromEvent(target, eventName, options).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(args => Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector(...args) : resultSelector(args))); 53414 } 53415 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53416 function handler(e) { 53417 if (arguments.length > 1) { 53418 subscriber.next(Array.prototype.slice.call(arguments)); 53419 } 53420 else { 53421 subscriber.next(e); 53422 } 53423 } 53424 setupSubscription(target, eventName, handler, subscriber, options); 53425 }); 53426} 53427function setupSubscription(sourceObj, eventName, handler, subscriber, options) { 53428 let unsubscribe; 53429 if (isEventTarget(sourceObj)) { 53430 const source = sourceObj; 53431 sourceObj.addEventListener(eventName, handler, options); 53432 unsubscribe = () => source.removeEventListener(eventName, handler, options); 53433 } 53434 else if (isJQueryStyleEventEmitter(sourceObj)) { 53435 const source = sourceObj; 53436 sourceObj.on(eventName, handler); 53437 unsubscribe = () => source.off(eventName, handler); 53438 } 53439 else if (isNodeStyleEventEmitter(sourceObj)) { 53440 const source = sourceObj; 53441 sourceObj.addListener(eventName, handler); 53442 unsubscribe = () => source.removeListener(eventName, handler); 53443 } 53444 else if (sourceObj && sourceObj.length) { 53445 for (let i = 0, len = sourceObj.length; i < len; i++) { 53446 setupSubscription(sourceObj[i], eventName, handler, subscriber, options); 53447 } 53448 } 53449 else { 53450 throw new TypeError('Invalid event target'); 53451 } 53452 subscriber.add(unsubscribe); 53453} 53454function isNodeStyleEventEmitter(sourceObj) { 53455 return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function'; 53456} 53457function isJQueryStyleEventEmitter(sourceObj) { 53458 return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function'; 53459} 53460function isEventTarget(sourceObj) { 53461 return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function'; 53462} 53463//# sourceMappingURL=fromEvent.js.map 53464 53465/***/ }), 53466
vendor: 2,288 bytes, lines 53467-53508
53467/***/ "./node_modules/rxjs/_esm2015/internal/observable/fromEventPattern.js": 53468/*!****************************************************************************!*\ 53469 !*** ./node_modules/rxjs/_esm2015/internal/observable/fromEventPattern.js ***! 53470 \****************************************************************************/ 53471/*! exports provided: fromEventPattern */ 53472/***/ (function(module, __webpack_exports__, __webpack_require__) { 53473 53474"use strict"; 53475__webpack_require__.r(__webpack_exports__); 53476/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return fromEventPattern; }); 53477/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53478/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 53479/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ "./node_modules/rxjs/_esm2015/internal/util/isFunction.js"); 53480/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operators/map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 53481 53482 53483 53484 53485function fromEventPattern(addHandler, removeHandler, resultSelector) { 53486 if (resultSelector) { 53487 return fromEventPattern(addHandler, removeHandler).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(args => Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector(...args) : resultSelector(args))); 53488 } 53489 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53490 const handler = (...e) => subscriber.next(e.length === 1 ? e[0] : e); 53491 let retValue; 53492 try { 53493 retValue = addHandler(handler); 53494 } 53495 catch (err) { 53496 subscriber.error(err); 53497 return undefined; 53498 } 53499 if (!Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(removeHandler)) { 53500 return undefined; 53501 } 53502 return () => removeHandler(handler, retValue); 53503 }); 53504} 53505//# sourceMappingURL=fromEventPattern.js.map 53506 53507/***/ }), 53508
vendor: 4,629 bytes, lines 53509-53648
53509/***/ "./node_modules/rxjs/_esm2015/internal/observable/generate.js": 53510/*!********************************************************************!*\ 53511 !*** ./node_modules/rxjs/_esm2015/internal/observable/generate.js ***! 53512 \********************************************************************/ 53513/*! exports provided: generate */ 53514/***/ (function(module, __webpack_exports__, __webpack_require__) { 53515 53516"use strict"; 53517__webpack_require__.r(__webpack_exports__); 53518/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; }); 53519/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53520/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm2015/internal/util/identity.js"); 53521/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 53522 53523 53524 53525function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) { 53526 let resultSelector; 53527 let initialState; 53528 if (arguments.length == 1) { 53529 const options = initialStateOrOptions; 53530 initialState = options.initialState; 53531 condition = options.condition; 53532 iterate = options.iterate; 53533 resultSelector = options.resultSelector || _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]; 53534 scheduler = options.scheduler; 53535 } 53536 else if (resultSelectorOrObservable === undefined || Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(resultSelectorOrObservable)) { 53537 initialState = initialStateOrOptions; 53538 resultSelector = _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]; 53539 scheduler = resultSelectorOrObservable; 53540 } 53541 else { 53542 initialState = initialStateOrOptions; 53543 resultSelector = resultSelectorOrObservable; 53544 } 53545 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53546 let state = initialState; 53547 if (scheduler) { 53548 return scheduler.schedule(dispatch, 0, { 53549 subscriber, 53550 iterate, 53551 condition, 53552 resultSelector, 53553 state 53554 }); 53555 } 53556 do { 53557 if (condition) { 53558 let conditionResult; 53559 try { 53560 conditionResult = condition(state); 53561 } 53562 catch (err) { 53563 subscriber.error(err); 53564 return undefined; 53565 } 53566 if (!conditionResult) { 53567 subscriber.complete(); 53568 break; 53569 } 53570 } 53571 let value; 53572 try { 53573 value = resultSelector(state); 53574 } 53575 catch (err) { 53576 subscriber.error(err); 53577 return undefined; 53578 } 53579 subscriber.next(value); 53580 if (subscriber.closed) { 53581 break; 53582 } 53583 try { 53584 state = iterate(state); 53585 } 53586 catch (err) { 53587 subscriber.error(err); 53588 return undefined; 53589 } 53590 } while (true); 53591 return undefined; 53592 }); 53593} 53594function dispatch(state) { 53595 const { subscriber, condition } = state; 53596 if (subscriber.closed) { 53597 return undefined; 53598 } 53599 if (state.needIterate) { 53600 try { 53601 state.state = state.iterate(state.state); 53602 } 53603 catch (err) { 53604 subscriber.error(err); 53605 return undefined; 53606 } 53607 } 53608 else { 53609 state.needIterate = true; 53610 } 53611 if (condition) { 53612 let conditionResult; 53613 try { 53614 conditionResult = condition(state.state); 53615 } 53616 catch (err) { 53617 subscriber.error(err); 53618 return undefined; 53619 } 53620 if (!conditionResult) { 53621 subscriber.complete(); 53622 return undefined; 53623 } 53624 if (subscriber.closed) { 53625 return undefined; 53626 } 53627 } 53628 let value; 53629 try { 53630 value = state.resultSelector(state.state); 53631 } 53632 catch (err) { 53633 subscriber.error(err); 53634 return undefined; 53635 } 53636 if (subscriber.closed) { 53637 return undefined; 53638 } 53639 subscriber.next(value); 53640 if (subscriber.closed) { 53641 return undefined; 53642 } 53643 return this.schedule(state); 53644} 53645//# sourceMappingURL=generate.js.map 53646 53647/***/ }), 53648
vendor: 1,161 bytes, lines 53649-53669
53649/***/ "./node_modules/rxjs/_esm2015/internal/observable/iif.js": 53650/*!***************************************************************!*\ 53651 !*** ./node_modules/rxjs/_esm2015/internal/observable/iif.js ***! 53652 \***************************************************************/ 53653/*! exports provided: iif */ 53654/***/ (function(module, __webpack_exports__, __webpack_require__) { 53655 53656"use strict"; 53657__webpack_require__.r(__webpack_exports__); 53658/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return iif; }); 53659/* harmony import */ var _defer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defer */ "./node_modules/rxjs/_esm2015/internal/observable/defer.js"); 53660/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 53661 53662 53663function iif(condition, trueResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"], falseResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"]) { 53664 return Object(_defer__WEBPACK_IMPORTED_MODULE_0__["defer"])(() => condition() ? trueResult : falseResult); 53665} 53666//# sourceMappingURL=iif.js.map 53667 53668/***/ }), 53669
vendor: 1,924 bytes, lines 53670-53706
53670/***/ "./node_modules/rxjs/_esm2015/internal/observable/interval.js": 53671/*!********************************************************************!*\ 53672 !*** ./node_modules/rxjs/_esm2015/internal/observable/interval.js ***! 53673 \********************************************************************/ 53674/*! exports provided: interval */ 53675/***/ (function(module, __webpack_exports__, __webpack_require__) { 53676 53677"use strict"; 53678__webpack_require__.r(__webpack_exports__); 53679/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return interval; }); 53680/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53681/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 53682/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isNumeric */ "./node_modules/rxjs/_esm2015/internal/util/isNumeric.js"); 53683 53684 53685 53686function interval(period = 0, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]) { 53687 if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(period) || period < 0) { 53688 period = 0; 53689 } 53690 if (!scheduler || typeof scheduler.schedule !== 'function') { 53691 scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; 53692 } 53693 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53694 subscriber.add(scheduler.schedule(dispatch, period, { subscriber, counter: 0, period })); 53695 return subscriber; 53696 }); 53697} 53698function dispatch(state) { 53699 const { subscriber, counter, period } = state; 53700 subscriber.next(counter); 53701 this.schedule({ subscriber, counter: counter + 1, period }, period); 53702} 53703//# sourceMappingURL=interval.js.map 53704 53705/***/ }), 53706
vendor: 2,198 bytes, lines 53707-53746
53707/***/ "./node_modules/rxjs/_esm2015/internal/observable/merge.js": 53708/*!*****************************************************************!*\ 53709 !*** ./node_modules/rxjs/_esm2015/internal/observable/merge.js ***! 53710 \*****************************************************************/ 53711/*! exports provided: merge */ 53712/***/ (function(module, __webpack_exports__, __webpack_require__) { 53713 53714"use strict"; 53715__webpack_require__.r(__webpack_exports__); 53716/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; }); 53717/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53718/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 53719/* harmony import */ var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/mergeAll */ "./node_modules/rxjs/_esm2015/internal/operators/mergeAll.js"); 53720/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm2015/internal/observable/fromArray.js"); 53721 53722 53723 53724 53725function merge(...observables) { 53726 let concurrent = Number.POSITIVE_INFINITY; 53727 let scheduler = null; 53728 let last = observables[observables.length - 1]; 53729 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(last)) { 53730 scheduler = observables.pop(); 53731 if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { 53732 concurrent = observables.pop(); 53733 } 53734 } 53735 else if (typeof last === 'number') { 53736 concurrent = observables.pop(); 53737 } 53738 if (scheduler === null && observables.length === 1 && observables[0] instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) { 53739 return observables[0]; 53740 } 53741 return Object(_operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__["mergeAll"])(concurrent)(Object(_fromArray__WEBPACK_IMPORTED_MODULE_3__["fromArray"])(observables, scheduler)); 53742} 53743//# sourceMappingURL=merge.js.map 53744 53745/***/ }), 53746
vendor: 1,209 bytes, lines 53747-53769
53747/***/ "./node_modules/rxjs/_esm2015/internal/observable/never.js": 53748/*!*****************************************************************!*\ 53749 !*** ./node_modules/rxjs/_esm2015/internal/observable/never.js ***! 53750 \*****************************************************************/ 53751/*! exports provided: NEVER, never */ 53752/***/ (function(module, __webpack_exports__, __webpack_require__) { 53753 53754"use strict"; 53755__webpack_require__.r(__webpack_exports__); 53756/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return NEVER; }); 53757/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return never; }); 53758/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53759/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/noop */ "./node_modules/rxjs/_esm2015/internal/util/noop.js"); 53760 53761 53762const NEVER = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](_util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]); 53763function never() { 53764 return NEVER; 53765} 53766//# sourceMappingURL=never.js.map 53767 53768/***/ }), 53769
vendor: 1,533 bytes, lines 53770-53799
53770/***/ "./node_modules/rxjs/_esm2015/internal/observable/of.js": 53771/*!**************************************************************!*\ 53772 !*** ./node_modules/rxjs/_esm2015/internal/observable/of.js ***! 53773 \**************************************************************/ 53774/*! exports provided: of */ 53775/***/ (function(module, __webpack_exports__, __webpack_require__) { 53776 53777"use strict"; 53778__webpack_require__.r(__webpack_exports__); 53779/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return of; }); 53780/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 53781/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm2015/internal/observable/fromArray.js"); 53782/* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduled/scheduleArray */ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js"); 53783 53784 53785 53786function of(...args) { 53787 let scheduler = args[args.length - 1]; 53788 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(scheduler)) { 53789 args.pop(); 53790 return Object(_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(args, scheduler); 53791 } 53792 else { 53793 return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(args); 53794 } 53795} 53796//# sourceMappingURL=of.js.map 53797 53798/***/ }), 53799
vendor: 2,093 bytes, lines 53800-53838
53800/***/ "./node_modules/rxjs/_esm2015/internal/observable/onErrorResumeNext.js": 53801/*!*****************************************************************************!*\ 53802 !*** ./node_modules/rxjs/_esm2015/internal/observable/onErrorResumeNext.js ***! 53803 \*****************************************************************************/ 53804/*! exports provided: onErrorResumeNext */ 53805/***/ (function(module, __webpack_exports__, __webpack_require__) { 53806 53807"use strict"; 53808__webpack_require__.r(__webpack_exports__); 53809/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; }); 53810/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53811/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 53812/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 53813/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 53814 53815 53816 53817 53818function onErrorResumeNext(...sources) { 53819 if (sources.length === 0) { 53820 return _empty__WEBPACK_IMPORTED_MODULE_3__["EMPTY"]; 53821 } 53822 const [first, ...remainder] = sources; 53823 if (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(first)) { 53824 return onErrorResumeNext(...first); 53825 } 53826 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53827 const subNext = () => subscriber.add(onErrorResumeNext(...remainder).subscribe(subscriber)); 53828 return Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(first).subscribe({ 53829 next(value) { subscriber.next(value); }, 53830 error: subNext, 53831 complete: subNext, 53832 }); 53833 }); 53834} 53835//# sourceMappingURL=onErrorResumeNext.js.map 53836 53837/***/ }), 53838
vendor: 2,383 bytes, lines 53839-53892
53839/***/ "./node_modules/rxjs/_esm2015/internal/observable/pairs.js": 53840/*!*****************************************************************!*\ 53841 !*** ./node_modules/rxjs/_esm2015/internal/observable/pairs.js ***! 53842 \*****************************************************************/ 53843/*! exports provided: pairs, dispatch */ 53844/***/ (function(module, __webpack_exports__, __webpack_require__) { 53845 53846"use strict"; 53847__webpack_require__.r(__webpack_exports__); 53848/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return pairs; }); 53849/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; }); 53850/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53851/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 53852 53853 53854function pairs(obj, scheduler) { 53855 if (!scheduler) { 53856 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53857 const keys = Object.keys(obj); 53858 for (let i = 0; i < keys.length && !subscriber.closed; i++) { 53859 const key = keys[i]; 53860 if (obj.hasOwnProperty(key)) { 53861 subscriber.next([key, obj[key]]); 53862 } 53863 } 53864 subscriber.complete(); 53865 }); 53866 } 53867 else { 53868 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 53869 const keys = Object.keys(obj); 53870 const subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); 53871 subscription.add(scheduler.schedule(dispatch, 0, { keys, index: 0, subscriber, subscription, obj })); 53872 return subscription; 53873 }); 53874 } 53875} 53876function dispatch(state) { 53877 const { keys, index, subscriber, subscription, obj } = state; 53878 if (!subscriber.closed) { 53879 if (index < keys.length) { 53880 const key = keys[index]; 53881 subscriber.next([key, obj[key]]); 53882 subscription.add(this.schedule({ keys, index: index + 1, subscriber, subscription, obj })); 53883 } 53884 else { 53885 subscriber.complete(); 53886 } 53887 } 53888} 53889//# sourceMappingURL=pairs.js.map 53890 53891/***/ }), 53892
vendor: 1,914 bytes, lines 53893-53920
53893/***/ "./node_modules/rxjs/_esm2015/internal/observable/partition.js": 53894/*!*********************************************************************!*\ 53895 !*** ./node_modules/rxjs/_esm2015/internal/observable/partition.js ***! 53896 \*********************************************************************/ 53897/*! exports provided: partition */ 53898/***/ (function(module, __webpack_exports__, __webpack_require__) { 53899 53900"use strict"; 53901__webpack_require__.r(__webpack_exports__); 53902/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; }); 53903/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/not */ "./node_modules/rxjs/_esm2015/internal/util/not.js"); 53904/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeTo */ "./node_modules/rxjs/_esm2015/internal/util/subscribeTo.js"); 53905/* harmony import */ var _operators_filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/filter */ "./node_modules/rxjs/_esm2015/internal/operators/filter.js"); 53906/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 53907 53908 53909 53910 53911function partition(source, predicate, thisArg) { 53912 return [ 53913 Object(_operators_filter__WEBPACK_IMPORTED_MODULE_2__["filter"])(predicate, thisArg)(new _Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(source))), 53914 Object(_operators_filter__WEBPACK_IMPORTED_MODULE_2__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(new _Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(source))) 53915 ]; 53916} 53917//# sourceMappingURL=partition.js.map 53918 53919/***/ }), 53920
vendor: 3,681 bytes, lines 53921-54003
53921/***/ "./node_modules/rxjs/_esm2015/internal/observable/race.js": 53922/*!****************************************************************!*\ 53923 !*** ./node_modules/rxjs/_esm2015/internal/observable/race.js ***! 53924 \****************************************************************/ 53925/*! exports provided: race, RaceOperator, RaceSubscriber */ 53926/***/ (function(module, __webpack_exports__, __webpack_require__) { 53927 53928"use strict"; 53929__webpack_require__.r(__webpack_exports__); 53930/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; }); 53931/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceOperator", function() { return RaceOperator; }); 53932/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceSubscriber", function() { return RaceSubscriber; }); 53933/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 53934/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm2015/internal/observable/fromArray.js"); 53935/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 53936/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 53937 53938 53939 53940 53941function race(...observables) { 53942 if (observables.length === 1) { 53943 if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) { 53944 observables = observables[0]; 53945 } 53946 else { 53947 return observables[0]; 53948 } 53949 } 53950 return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(observables, undefined).lift(new RaceOperator()); 53951} 53952class RaceOperator { 53953 call(subscriber, source) { 53954 return source.subscribe(new RaceSubscriber(subscriber)); 53955 } 53956} 53957class RaceSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] { 53958 constructor(destination) { 53959 super(destination); 53960 this.hasFirst = false; 53961 this.observables = []; 53962 this.subscriptions = []; 53963 } 53964 _next(observable) { 53965 this.observables.push(observable); 53966 } 53967 _complete() { 53968 const observables = this.observables; 53969 const len = observables.length; 53970 if (len === 0) { 53971 this.destination.complete(); 53972 } 53973 else { 53974 for (let i = 0; i < len && !this.hasFirst; i++) { 53975 let observable = observables[i]; 53976 let subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, observable, observable, i); 53977 if (this.subscriptions) { 53978 this.subscriptions.push(subscription); 53979 } 53980 this.add(subscription); 53981 } 53982 this.observables = null; 53983 } 53984 } 53985 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 53986 if (!this.hasFirst) { 53987 this.hasFirst = true; 53988 for (let i = 0; i < this.subscriptions.length; i++) { 53989 if (i !== outerIndex) { 53990 let subscription = this.subscriptions[i]; 53991 subscription.unsubscribe(); 53992 this.remove(subscription); 53993 } 53994 } 53995 this.subscriptions = null; 53996 } 53997 this.destination.next(innerValue); 53998 } 53999} 54000//# sourceMappingURL=race.js.map 54001 54002/***/ }), 54003
vendor: 2,014 bytes, lines 54004-54062
54004/***/ "./node_modules/rxjs/_esm2015/internal/observable/range.js": 54005/*!*****************************************************************!*\ 54006 !*** ./node_modules/rxjs/_esm2015/internal/observable/range.js ***! 54007 \*****************************************************************/ 54008/*! exports provided: range, dispatch */ 54009/***/ (function(module, __webpack_exports__, __webpack_require__) { 54010 54011"use strict"; 54012__webpack_require__.r(__webpack_exports__); 54013/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); 54014/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; }); 54015/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 54016 54017function range(start = 0, count, scheduler) { 54018 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 54019 if (count === undefined) { 54020 count = start; 54021 start = 0; 54022 } 54023 let index = 0; 54024 let current = start; 54025 if (scheduler) { 54026 return scheduler.schedule(dispatch, 0, { 54027 index, count, start, subscriber 54028 }); 54029 } 54030 else { 54031 do { 54032 if (index++ >= count) { 54033 subscriber.complete(); 54034 break; 54035 } 54036 subscriber.next(current++); 54037 if (subscriber.closed) { 54038 break; 54039 } 54040 } while (true); 54041 } 54042 return undefined; 54043 }); 54044} 54045function dispatch(state) { 54046 const { start, index, count, subscriber } = state; 54047 if (index >= count) { 54048 subscriber.complete(); 54049 return; 54050 } 54051 subscriber.next(start); 54052 if (subscriber.closed) { 54053 return; 54054 } 54055 state.index = index + 1; 54056 state.start = start + 1; 54057 this.schedule(state); 54058} 54059//# sourceMappingURL=range.js.map 54060 54061/***/ }), 54062
vendor: 1,223 bytes, lines 54063-54089
54063/***/ "./node_modules/rxjs/_esm2015/internal/observable/throwError.js": 54064/*!**********************************************************************!*\ 54065 !*** ./node_modules/rxjs/_esm2015/internal/observable/throwError.js ***! 54066 \**********************************************************************/ 54067/*! exports provided: throwError */ 54068/***/ (function(module, __webpack_exports__, __webpack_require__) { 54069 54070"use strict"; 54071__webpack_require__.r(__webpack_exports__); 54072/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return throwError; }); 54073/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 54074 54075function throwError(error, scheduler) { 54076 if (!scheduler) { 54077 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => subscriber.error(error)); 54078 } 54079 else { 54080 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => scheduler.schedule(dispatch, 0, { error, subscriber })); 54081 } 54082} 54083function dispatch({ error, subscriber }) { 54084 subscriber.error(error); 54085} 54086//# sourceMappingURL=throwError.js.map 54087 54088/***/ }), 54089
vendor: 2,551 bytes, lines 54090-54143
54090/***/ "./node_modules/rxjs/_esm2015/internal/observable/timer.js": 54091/*!*****************************************************************!*\ 54092 !*** ./node_modules/rxjs/_esm2015/internal/observable/timer.js ***! 54093 \*****************************************************************/ 54094/*! exports provided: timer */ 54095/***/ (function(module, __webpack_exports__, __webpack_require__) { 54096 54097"use strict"; 54098__webpack_require__.r(__webpack_exports__); 54099/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; }); 54100/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 54101/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 54102/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isNumeric */ "./node_modules/rxjs/_esm2015/internal/util/isNumeric.js"); 54103/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 54104 54105 54106 54107 54108function timer(dueTime = 0, periodOrScheduler, scheduler) { 54109 let period = -1; 54110 if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(periodOrScheduler)) { 54111 period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler); 54112 } 54113 else if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(periodOrScheduler)) { 54114 scheduler = periodOrScheduler; 54115 } 54116 if (!Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(scheduler)) { 54117 scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; 54118 } 54119 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 54120 const due = Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(dueTime) 54121 ? dueTime 54122 : (+dueTime - scheduler.now()); 54123 return scheduler.schedule(dispatch, due, { 54124 index: 0, period, subscriber 54125 }); 54126 }); 54127} 54128function dispatch(state) { 54129 const { index, period, subscriber } = state; 54130 subscriber.next(index); 54131 if (subscriber.closed) { 54132 return; 54133 } 54134 else if (period === -1) { 54135 return subscriber.complete(); 54136 } 54137 state.index = index + 1; 54138 this.schedule(state, period); 54139} 54140//# sourceMappingURL=timer.js.map 54141 54142/***/ }), 54143
vendor: 1,961 bytes, lines 54144-54191
54144/***/ "./node_modules/rxjs/_esm2015/internal/observable/using.js": 54145/*!*****************************************************************!*\ 54146 !*** ./node_modules/rxjs/_esm2015/internal/observable/using.js ***! 54147 \*****************************************************************/ 54148/*! exports provided: using */ 54149/***/ (function(module, __webpack_exports__, __webpack_require__) { 54150 54151"use strict"; 54152__webpack_require__.r(__webpack_exports__); 54153/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return using; }); 54154/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 54155/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 54156/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 54157 54158 54159 54160function using(resourceFactory, observableFactory) { 54161 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 54162 let resource; 54163 try { 54164 resource = resourceFactory(); 54165 } 54166 catch (err) { 54167 subscriber.error(err); 54168 return undefined; 54169 } 54170 let result; 54171 try { 54172 result = observableFactory(resource); 54173 } 54174 catch (err) { 54175 subscriber.error(err); 54176 return undefined; 54177 } 54178 const source = result ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(result) : _empty__WEBPACK_IMPORTED_MODULE_2__["EMPTY"]; 54179 const subscription = source.subscribe(subscriber); 54180 return () => { 54181 subscription.unsubscribe(); 54182 if (resource) { 54183 resource.unsubscribe(); 54184 } 54185 }; 54186 }); 54187} 54188//# sourceMappingURL=using.js.map 54189 54190/***/ }), 54191
vendor: 7,928 bytes, lines 54192-54410
54192/***/ "./node_modules/rxjs/_esm2015/internal/observable/zip.js": 54193/*!***************************************************************!*\ 54194 !*** ./node_modules/rxjs/_esm2015/internal/observable/zip.js ***! 54195 \***************************************************************/ 54196/*! exports provided: zip, ZipOperator, ZipSubscriber */ 54197/***/ (function(module, __webpack_exports__, __webpack_require__) { 54198 54199"use strict"; 54200__webpack_require__.r(__webpack_exports__); 54201/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; }); 54202/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipOperator", function() { return ZipOperator; }); 54203/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipSubscriber", function() { return ZipSubscriber; }); 54204/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fromArray */ "./node_modules/rxjs/_esm2015/internal/observable/fromArray.js"); 54205/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 54206/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 54207/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 54208/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 54209/* harmony import */ var _internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../internal/symbol/iterator */ "./node_modules/rxjs/_esm2015/internal/symbol/iterator.js"); 54210 54211 54212 54213 54214 54215 54216function zip(...observables) { 54217 const resultSelector = observables[observables.length - 1]; 54218 if (typeof resultSelector === 'function') { 54219 observables.pop(); 54220 } 54221 return Object(_fromArray__WEBPACK_IMPORTED_MODULE_0__["fromArray"])(observables, undefined).lift(new ZipOperator(resultSelector)); 54222} 54223class ZipOperator { 54224 constructor(resultSelector) { 54225 this.resultSelector = resultSelector; 54226 } 54227 call(subscriber, source) { 54228 return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector)); 54229 } 54230} 54231class ZipSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"] { 54232 constructor(destination, resultSelector, values = Object.create(null)) { 54233 super(destination); 54234 this.iterators = []; 54235 this.active = 0; 54236 this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null; 54237 this.values = values; 54238 } 54239 _next(value) { 54240 const iterators = this.iterators; 54241 if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(value)) { 54242 iterators.push(new StaticArrayIterator(value)); 54243 } 54244 else if (typeof value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_5__["iterator"]] === 'function') { 54245 iterators.push(new StaticIterator(value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_5__["iterator"]]())); 54246 } 54247 else { 54248 iterators.push(new ZipBufferIterator(this.destination, this, value)); 54249 } 54250 } 54251 _complete() { 54252 const iterators = this.iterators; 54253 const len = iterators.length; 54254 this.unsubscribe(); 54255 if (len === 0) { 54256 this.destination.complete(); 54257 return; 54258 } 54259 this.active = len; 54260 for (let i = 0; i < len; i++) { 54261 let iterator = iterators[i]; 54262 if (iterator.stillUnsubscribed) { 54263 const destination = this.destination; 54264 destination.add(iterator.subscribe(iterator, i)); 54265 } 54266 else { 54267 this.active--; 54268 } 54269 } 54270 } 54271 notifyInactive() { 54272 this.active--; 54273 if (this.active === 0) { 54274 this.destination.complete(); 54275 } 54276 } 54277 checkIterators() { 54278 const iterators = this.iterators; 54279 const len = iterators.length; 54280 const destination = this.destination; 54281 for (let i = 0; i < len; i++) { 54282 let iterator = iterators[i]; 54283 if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { 54284 return; 54285 } 54286 } 54287 let shouldComplete = false; 54288 const args = []; 54289 for (let i = 0; i < len; i++) { 54290 let iterator = iterators[i]; 54291 let result = iterator.next(); 54292 if (iterator.hasCompleted()) { 54293 shouldComplete = true; 54294 } 54295 if (result.done) { 54296 destination.complete(); 54297 return; 54298 } 54299 args.push(result.value); 54300 } 54301 if (this.resultSelector) { 54302 this._tryresultSelector(args); 54303 } 54304 else { 54305 destination.next(args); 54306 } 54307 if (shouldComplete) { 54308 destination.complete(); 54309 } 54310 } 54311 _tryresultSelector(args) { 54312 let result; 54313 try { 54314 result = this.resultSelector.apply(this, args); 54315 } 54316 catch (err) { 54317 this.destination.error(err); 54318 return; 54319 } 54320 this.destination.next(result); 54321 } 54322} 54323class StaticIterator { 54324 constructor(iterator) { 54325 this.iterator = iterator; 54326 this.nextResult = iterator.next(); 54327 } 54328 hasValue() { 54329 return true; 54330 } 54331 next() { 54332 const result = this.nextResult; 54333 this.nextResult = this.iterator.next(); 54334 return result; 54335 } 54336 hasCompleted() { 54337 const nextResult = this.nextResult; 54338 return nextResult && nextResult.done; 54339 } 54340} 54341class StaticArrayIterator { 54342 constructor(array) { 54343 this.array = array; 54344 this.index = 0; 54345 this.length = 0; 54346 this.length = array.length; 54347 } 54348 [_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_5__["iterator"]]() { 54349 return this; 54350 } 54351 next(value) { 54352 const i = this.index++; 54353 const array = this.array; 54354 return i < this.length ? { value: array[i], done: false } : { value: null, done: true }; 54355 } 54356 hasValue() { 54357 return this.array.length > this.index; 54358 } 54359 hasCompleted() { 54360 return this.array.length === this.index; 54361 } 54362} 54363class ZipBufferIterator extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"] { 54364 constructor(destination, parent, observable) { 54365 super(destination); 54366 this.parent = parent; 54367 this.observable = observable; 54368 this.stillUnsubscribed = true; 54369 this.buffer = []; 54370 this.isComplete = false; 54371 } 54372 [_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_5__["iterator"]]() { 54373 return this; 54374 } 54375 next() { 54376 const buffer = this.buffer; 54377 if (buffer.length === 0 && this.isComplete) { 54378 return { value: null, done: true }; 54379 } 54380 else { 54381 return { value: buffer.shift(), done: false }; 54382 } 54383 } 54384 hasValue() { 54385 return this.buffer.length > 0; 54386 } 54387 hasCompleted() { 54388 return this.buffer.length === 0 && this.isComplete; 54389 } 54390 notifyComplete() { 54391 if (this.buffer.length > 0) { 54392 this.isComplete = true; 54393 this.parent.notifyInactive(); 54394 } 54395 else { 54396 this.destination.complete(); 54397 } 54398 } 54399 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 54400 this.buffer.push(innerValue); 54401 this.parent.checkIterators(); 54402 } 54403 subscribe(value, index) { 54404 return Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, this.observable, this, index); 54405 } 54406} 54407//# sourceMappingURL=zip.js.map 54408 54409/***/ }), 54410
vendor: 2,895 bytes, lines 54411-54488
54411/***/ "./node_modules/rxjs/_esm2015/internal/operators/audit.js": 54412/*!****************************************************************!*\ 54413 !*** ./node_modules/rxjs/_esm2015/internal/operators/audit.js ***! 54414 \****************************************************************/ 54415/*! exports provided: audit */ 54416/***/ (function(module, __webpack_exports__, __webpack_require__) { 54417 54418"use strict"; 54419__webpack_require__.r(__webpack_exports__); 54420/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return audit; }); 54421/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 54422/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 54423 54424 54425function audit(durationSelector) { 54426 return function auditOperatorFunction(source) { 54427 return source.lift(new AuditOperator(durationSelector)); 54428 }; 54429} 54430class AuditOperator { 54431 constructor(durationSelector) { 54432 this.durationSelector = durationSelector; 54433 } 54434 call(subscriber, source) { 54435 return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector)); 54436 } 54437} 54438class AuditSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 54439 constructor(destination, durationSelector) { 54440 super(destination); 54441 this.durationSelector = durationSelector; 54442 this.hasValue = false; 54443 } 54444 _next(value) { 54445 this.value = value; 54446 this.hasValue = true; 54447 if (!this.throttled) { 54448 let duration; 54449 try { 54450 const { durationSelector } = this; 54451 duration = durationSelector(value); 54452 } 54453 catch (err) { 54454 return this.destination.error(err); 54455 } 54456 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, duration); 54457 if (!innerSubscription || innerSubscription.closed) { 54458 this.clearThrottle(); 54459 } 54460 else { 54461 this.add(this.throttled = innerSubscription); 54462 } 54463 } 54464 } 54465 clearThrottle() { 54466 const { value, hasValue, throttled } = this; 54467 if (throttled) { 54468 this.remove(throttled); 54469 this.throttled = null; 54470 throttled.unsubscribe(); 54471 } 54472 if (hasValue) { 54473 this.value = null; 54474 this.hasValue = false; 54475 this.destination.next(value); 54476 } 54477 } 54478 notifyNext(outerValue, innerValue, outerIndex, innerIndex) { 54479 this.clearThrottle(); 54480 } 54481 notifyComplete() { 54482 this.clearThrottle(); 54483 } 54484} 54485//# sourceMappingURL=audit.js.map 54486 54487/***/ }), 54488
vendor: 1,408 bytes, lines 54489-54511
54489/***/ "./node_modules/rxjs/_esm2015/internal/operators/auditTime.js": 54490/*!********************************************************************!*\ 54491 !*** ./node_modules/rxjs/_esm2015/internal/operators/auditTime.js ***! 54492 \********************************************************************/ 54493/*! exports provided: auditTime */ 54494/***/ (function(module, __webpack_exports__, __webpack_require__) { 54495 54496"use strict"; 54497__webpack_require__.r(__webpack_exports__); 54498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; }); 54499/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 54500/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./audit */ "./node_modules/rxjs/_esm2015/internal/operators/audit.js"); 54501/* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/timer */ "./node_modules/rxjs/_esm2015/internal/observable/timer.js"); 54502 54503 54504 54505function auditTime(duration, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) { 54506 return Object(_audit__WEBPACK_IMPORTED_MODULE_1__["audit"])(() => Object(_observable_timer__WEBPACK_IMPORTED_MODULE_2__["timer"])(duration, scheduler)); 54507} 54508//# sourceMappingURL=auditTime.js.map 54509 54510/***/ }), 54511
vendor: 1,958 bytes, lines 54512-54557
54512/***/ "./node_modules/rxjs/_esm2015/internal/operators/buffer.js": 54513/*!*****************************************************************!*\ 54514 !*** ./node_modules/rxjs/_esm2015/internal/operators/buffer.js ***! 54515 \*****************************************************************/ 54516/*! exports provided: buffer */ 54517/***/ (function(module, __webpack_exports__, __webpack_require__) { 54518 54519"use strict"; 54520__webpack_require__.r(__webpack_exports__); 54521/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return buffer; }); 54522/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 54523/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 54524 54525 54526function buffer(closingNotifier) { 54527 return function bufferOperatorFunction(source) { 54528 return source.lift(new BufferOperator(closingNotifier)); 54529 }; 54530} 54531class BufferOperator { 54532 constructor(closingNotifier) { 54533 this.closingNotifier = closingNotifier; 54534 } 54535 call(subscriber, source) { 54536 return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier)); 54537 } 54538} 54539class BufferSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 54540 constructor(destination, closingNotifier) { 54541 super(destination); 54542 this.buffer = []; 54543 this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, closingNotifier)); 54544 } 54545 _next(value) { 54546 this.buffer.push(value); 54547 } 54548 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 54549 const buffer = this.buffer; 54550 this.buffer = []; 54551 this.destination.next(buffer); 54552 } 54553} 54554//# sourceMappingURL=buffer.js.map 54555 54556/***/ }), 54557
vendor: 3,279 bytes, lines 54558-54649
54558/***/ "./node_modules/rxjs/_esm2015/internal/operators/bufferCount.js": 54559/*!**********************************************************************!*\ 54560 !*** ./node_modules/rxjs/_esm2015/internal/operators/bufferCount.js ***! 54561 \**********************************************************************/ 54562/*! exports provided: bufferCount */ 54563/***/ (function(module, __webpack_exports__, __webpack_require__) { 54564 54565"use strict"; 54566__webpack_require__.r(__webpack_exports__); 54567/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return bufferCount; }); 54568/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 54569 54570function bufferCount(bufferSize, startBufferEvery = null) { 54571 return function bufferCountOperatorFunction(source) { 54572 return source.lift(new BufferCountOperator(bufferSize, startBufferEvery)); 54573 }; 54574} 54575class BufferCountOperator { 54576 constructor(bufferSize, startBufferEvery) { 54577 this.bufferSize = bufferSize; 54578 this.startBufferEvery = startBufferEvery; 54579 if (!startBufferEvery || bufferSize === startBufferEvery) { 54580 this.subscriberClass = BufferCountSubscriber; 54581 } 54582 else { 54583 this.subscriberClass = BufferSkipCountSubscriber; 54584 } 54585 } 54586 call(subscriber, source) { 54587 return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery)); 54588 } 54589} 54590class BufferCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 54591 constructor(destination, bufferSize) { 54592 super(destination); 54593 this.bufferSize = bufferSize; 54594 this.buffer = []; 54595 } 54596 _next(value) { 54597 const buffer = this.buffer; 54598 buffer.push(value); 54599 if (buffer.length == this.bufferSize) { 54600 this.destination.next(buffer); 54601 this.buffer = []; 54602 } 54603 } 54604 _complete() { 54605 const buffer = this.buffer; 54606 if (buffer.length > 0) { 54607 this.destination.next(buffer); 54608 } 54609 super._complete(); 54610 } 54611} 54612class BufferSkipCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 54613 constructor(destination, bufferSize, startBufferEvery) { 54614 super(destination); 54615 this.bufferSize = bufferSize; 54616 this.startBufferEvery = startBufferEvery; 54617 this.buffers = []; 54618 this.count = 0; 54619 } 54620 _next(value) { 54621 const { bufferSize, startBufferEvery, buffers, count } = this; 54622 this.count++; 54623 if (count % startBufferEvery === 0) { 54624 buffers.push([]); 54625 } 54626 for (let i = buffers.length; i--;) { 54627 const buffer = buffers[i]; 54628 buffer.push(value); 54629 if (buffer.length === bufferSize) { 54630 buffers.splice(i, 1); 54631 this.destination.next(buffer); 54632 } 54633 } 54634 } 54635 _complete() { 54636 const { buffers, destination } = this; 54637 while (buffers.length > 0) { 54638 let buffer = buffers.shift(); 54639 if (buffer.length > 0) { 54640 destination.next(buffer); 54641 } 54642 } 54643 super._complete(); 54644 } 54645} 54646//# sourceMappingURL=bufferCount.js.map 54647 54648/***/ }), 54649
vendor: 6,513 bytes, lines 54650-54806
54650/***/ "./node_modules/rxjs/_esm2015/internal/operators/bufferTime.js": 54651/*!*********************************************************************!*\ 54652 !*** ./node_modules/rxjs/_esm2015/internal/operators/bufferTime.js ***! 54653 \*********************************************************************/ 54654/*! exports provided: bufferTime */ 54655/***/ (function(module, __webpack_exports__, __webpack_require__) { 54656 54657"use strict"; 54658__webpack_require__.r(__webpack_exports__); 54659/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return bufferTime; }); 54660/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 54661/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 54662/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 54663 54664 54665 54666function bufferTime(bufferTimeSpan) { 54667 let length = arguments.length; 54668 let scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]; 54669 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(arguments[arguments.length - 1])) { 54670 scheduler = arguments[arguments.length - 1]; 54671 length--; 54672 } 54673 let bufferCreationInterval = null; 54674 if (length >= 2) { 54675 bufferCreationInterval = arguments[1]; 54676 } 54677 let maxBufferSize = Number.POSITIVE_INFINITY; 54678 if (length >= 3) { 54679 maxBufferSize = arguments[2]; 54680 } 54681 return function bufferTimeOperatorFunction(source) { 54682 return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler)); 54683 }; 54684} 54685class BufferTimeOperator { 54686 constructor(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) { 54687 this.bufferTimeSpan = bufferTimeSpan; 54688 this.bufferCreationInterval = bufferCreationInterval; 54689 this.maxBufferSize = maxBufferSize; 54690 this.scheduler = scheduler; 54691 } 54692 call(subscriber, source) { 54693 return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler)); 54694 } 54695} 54696class Context { 54697 constructor() { 54698 this.buffer = []; 54699 } 54700} 54701class BufferTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"] { 54702 constructor(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) { 54703 super(destination); 54704 this.bufferTimeSpan = bufferTimeSpan; 54705 this.bufferCreationInterval = bufferCreationInterval; 54706 this.maxBufferSize = maxBufferSize; 54707 this.scheduler = scheduler; 54708 this.contexts = []; 54709 const context = this.openContext(); 54710 this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0; 54711 if (this.timespanOnly) { 54712 const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan }; 54713 this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); 54714 } 54715 else { 54716 const closeState = { subscriber: this, context }; 54717 const creationState = { bufferTimeSpan, bufferCreationInterval, subscriber: this, scheduler }; 54718 this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); 54719 this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); 54720 } 54721 } 54722 _next(value) { 54723 const contexts = this.contexts; 54724 const len = contexts.length; 54725 let filledBufferContext; 54726 for (let i = 0; i < len; i++) { 54727 const context = contexts[i]; 54728 const buffer = context.buffer; 54729 buffer.push(value); 54730 if (buffer.length == this.maxBufferSize) { 54731 filledBufferContext = context; 54732 } 54733 } 54734 if (filledBufferContext) { 54735 this.onBufferFull(filledBufferContext); 54736 } 54737 } 54738 _error(err) { 54739 this.contexts.length = 0; 54740 super._error(err); 54741 } 54742 _complete() { 54743 const { contexts, destination } = this; 54744 while (contexts.length > 0) { 54745 const context = contexts.shift(); 54746 destination.next(context.buffer); 54747 } 54748 super._complete(); 54749 } 54750 _unsubscribe() { 54751 this.contexts = null; 54752 } 54753 onBufferFull(context) { 54754 this.closeContext(context); 54755 const closeAction = context.closeAction; 54756 closeAction.unsubscribe(); 54757 this.remove(closeAction); 54758 if (!this.closed && this.timespanOnly) { 54759 context = this.openContext(); 54760 const bufferTimeSpan = this.bufferTimeSpan; 54761 const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan }; 54762 this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); 54763 } 54764 } 54765 openContext() { 54766 const context = new Context(); 54767 this.contexts.push(context); 54768 return context; 54769 } 54770 closeContext(context) { 54771 this.destination.next(context.buffer); 54772 const contexts = this.contexts; 54773 const spliceIndex = contexts ? contexts.indexOf(context) : -1; 54774 if (spliceIndex >= 0) { 54775 contexts.splice(contexts.indexOf(context), 1); 54776 } 54777 } 54778} 54779function dispatchBufferTimeSpanOnly(state) { 54780 const subscriber = state.subscriber; 54781 const prevContext = state.context; 54782 if (prevContext) { 54783 subscriber.closeContext(prevContext); 54784 } 54785 if (!subscriber.closed) { 54786 state.context = subscriber.openContext(); 54787 state.context.closeAction = this.schedule(state, state.bufferTimeSpan); 54788 } 54789} 54790function dispatchBufferCreation(state) { 54791 const { bufferCreationInterval, bufferTimeSpan, subscriber, scheduler } = state; 54792 const context = subscriber.openContext(); 54793 const action = this; 54794 if (!subscriber.closed) { 54795 subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber, context })); 54796 action.schedule(state, bufferCreationInterval); 54797 } 54798} 54799function dispatchBufferClose(arg) { 54800 const { subscriber, context } = arg; 54801 subscriber.closeContext(context); 54802} 54803//# sourceMappingURL=bufferTime.js.map 54804 54805/***/ }), 54806
vendor: 4,717 bytes, lines 54807-54923
54807/***/ "./node_modules/rxjs/_esm2015/internal/operators/bufferToggle.js": 54808/*!***********************************************************************!*\ 54809 !*** ./node_modules/rxjs/_esm2015/internal/operators/bufferToggle.js ***! 54810 \***********************************************************************/ 54811/*! exports provided: bufferToggle */ 54812/***/ (function(module, __webpack_exports__, __webpack_require__) { 54813 54814"use strict"; 54815__webpack_require__.r(__webpack_exports__); 54816/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return bufferToggle; }); 54817/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 54818/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 54819/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 54820 54821 54822 54823function bufferToggle(openings, closingSelector) { 54824 return function bufferToggleOperatorFunction(source) { 54825 return source.lift(new BufferToggleOperator(openings, closingSelector)); 54826 }; 54827} 54828class BufferToggleOperator { 54829 constructor(openings, closingSelector) { 54830 this.openings = openings; 54831 this.closingSelector = closingSelector; 54832 } 54833 call(subscriber, source) { 54834 return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector)); 54835 } 54836} 54837class BufferToggleSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] { 54838 constructor(destination, openings, closingSelector) { 54839 super(destination); 54840 this.openings = openings; 54841 this.closingSelector = closingSelector; 54842 this.contexts = []; 54843 this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, openings)); 54844 } 54845 _next(value) { 54846 const contexts = this.contexts; 54847 const len = contexts.length; 54848 for (let i = 0; i < len; i++) { 54849 contexts[i].buffer.push(value); 54850 } 54851 } 54852 _error(err) { 54853 const contexts = this.contexts; 54854 while (contexts.length > 0) { 54855 const context = contexts.shift(); 54856 context.subscription.unsubscribe(); 54857 context.buffer = null; 54858 context.subscription = null; 54859 } 54860 this.contexts = null; 54861 super._error(err); 54862 } 54863 _complete() { 54864 const contexts = this.contexts; 54865 while (contexts.length > 0) { 54866 const context = contexts.shift(); 54867 this.destination.next(context.buffer); 54868 context.subscription.unsubscribe(); 54869 context.buffer = null; 54870 context.subscription = null; 54871 } 54872 this.contexts = null; 54873 super._complete(); 54874 } 54875 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 54876 outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue); 54877 } 54878 notifyComplete(innerSub) { 54879 this.closeBuffer(innerSub.context); 54880 } 54881 openBuffer(value) { 54882 try { 54883 const closingSelector = this.closingSelector; 54884 const closingNotifier = closingSelector.call(this, value); 54885 if (closingNotifier) { 54886 this.trySubscribe(closingNotifier); 54887 } 54888 } 54889 catch (err) { 54890 this._error(err); 54891 } 54892 } 54893 closeBuffer(context) { 54894 const contexts = this.contexts; 54895 if (contexts && context) { 54896 const { buffer, subscription } = context; 54897 this.destination.next(buffer); 54898 contexts.splice(contexts.indexOf(context), 1); 54899 this.remove(subscription); 54900 subscription.unsubscribe(); 54901 } 54902 } 54903 trySubscribe(closingNotifier) { 54904 const contexts = this.contexts; 54905 const buffer = []; 54906 const subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_0__["Subscription"](); 54907 const context = { buffer, subscription }; 54908 contexts.push(context); 54909 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, closingNotifier, context); 54910 if (!innerSubscription || innerSubscription.closed) { 54911 this.closeBuffer(context); 54912 } 54913 else { 54914 innerSubscription.context = context; 54915 this.add(innerSubscription); 54916 subscription.add(innerSubscription); 54917 } 54918 } 54919} 54920//# sourceMappingURL=bufferToggle.js.map 54921 54922/***/ }), 54923
vendor: 3,414 bytes, lines 54924-55015
54924/***/ "./node_modules/rxjs/_esm2015/internal/operators/bufferWhen.js": 54925/*!*********************************************************************!*\ 54926 !*** ./node_modules/rxjs/_esm2015/internal/operators/bufferWhen.js ***! 54927 \*********************************************************************/ 54928/*! exports provided: bufferWhen */ 54929/***/ (function(module, __webpack_exports__, __webpack_require__) { 54930 54931"use strict"; 54932__webpack_require__.r(__webpack_exports__); 54933/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return bufferWhen; }); 54934/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 54935/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 54936/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 54937 54938 54939 54940function bufferWhen(closingSelector) { 54941 return function (source) { 54942 return source.lift(new BufferWhenOperator(closingSelector)); 54943 }; 54944} 54945class BufferWhenOperator { 54946 constructor(closingSelector) { 54947 this.closingSelector = closingSelector; 54948 } 54949 call(subscriber, source) { 54950 return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector)); 54951 } 54952} 54953class BufferWhenSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"] { 54954 constructor(destination, closingSelector) { 54955 super(destination); 54956 this.closingSelector = closingSelector; 54957 this.subscribing = false; 54958 this.openBuffer(); 54959 } 54960 _next(value) { 54961 this.buffer.push(value); 54962 } 54963 _complete() { 54964 const buffer = this.buffer; 54965 if (buffer) { 54966 this.destination.next(buffer); 54967 } 54968 super._complete(); 54969 } 54970 _unsubscribe() { 54971 this.buffer = null; 54972 this.subscribing = false; 54973 } 54974 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 54975 this.openBuffer(); 54976 } 54977 notifyComplete() { 54978 if (this.subscribing) { 54979 this.complete(); 54980 } 54981 else { 54982 this.openBuffer(); 54983 } 54984 } 54985 openBuffer() { 54986 let { closingSubscription } = this; 54987 if (closingSubscription) { 54988 this.remove(closingSubscription); 54989 closingSubscription.unsubscribe(); 54990 } 54991 const buffer = this.buffer; 54992 if (this.buffer) { 54993 this.destination.next(buffer); 54994 } 54995 this.buffer = []; 54996 let closingNotifier; 54997 try { 54998 const { closingSelector } = this; 54999 closingNotifier = closingSelector(); 55000 } 55001 catch (err) { 55002 return this.error(err); 55003 } 55004 closingSubscription = new _Subscription__WEBPACK_IMPORTED_MODULE_0__["Subscription"](); 55005 this.closingSubscription = closingSubscription; 55006 this.add(closingSubscription); 55007 this.subscribing = true; 55008 closingSubscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, closingNotifier)); 55009 this.subscribing = false; 55010 } 55011} 55012//# sourceMappingURL=bufferWhen.js.map 55013 55014/***/ }), 55015
vendor: 2,691 bytes, lines 55016-55076
55016/***/ "./node_modules/rxjs/_esm2015/internal/operators/catchError.js": 55017/*!*********************************************************************!*\ 55018 !*** ./node_modules/rxjs/_esm2015/internal/operators/catchError.js ***! 55019 \*********************************************************************/ 55020/*! exports provided: catchError */ 55021/***/ (function(module, __webpack_exports__, __webpack_require__) { 55022 55023"use strict"; 55024__webpack_require__.r(__webpack_exports__); 55025/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return catchError; }); 55026/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 55027/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js"); 55028/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 55029 55030 55031 55032function catchError(selector) { 55033 return function catchErrorOperatorFunction(source) { 55034 const operator = new CatchOperator(selector); 55035 const caught = source.lift(operator); 55036 return (operator.caught = caught); 55037 }; 55038} 55039class CatchOperator { 55040 constructor(selector) { 55041 this.selector = selector; 55042 } 55043 call(subscriber, source) { 55044 return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught)); 55045 } 55046} 55047class CatchSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 55048 constructor(destination, selector, caught) { 55049 super(destination); 55050 this.selector = selector; 55051 this.caught = caught; 55052 } 55053 error(err) { 55054 if (!this.isStopped) { 55055 let result; 55056 try { 55057 result = this.selector(err, this.caught); 55058 } 55059 catch (err2) { 55060 super.error(err2); 55061 return; 55062 } 55063 this._unsubscribeAndRecycle(); 55064 const innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_1__["InnerSubscriber"](this, undefined, undefined); 55065 this.add(innerSubscriber); 55066 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, undefined, undefined, innerSubscriber); 55067 if (innerSubscription !== innerSubscriber) { 55068 this.add(innerSubscription); 55069 } 55070 } 55071 } 55072} 55073//# sourceMappingURL=catchError.js.map 55074 55075/***/ }), 55076
vendor: 1,004 bytes, lines 55077-55095
55077/***/ "./node_modules/rxjs/_esm2015/internal/operators/combineAll.js": 55078/*!*********************************************************************!*\ 55079 !*** ./node_modules/rxjs/_esm2015/internal/operators/combineAll.js ***! 55080 \*********************************************************************/ 55081/*! exports provided: combineAll */ 55082/***/ (function(module, __webpack_exports__, __webpack_require__) { 55083 55084"use strict"; 55085__webpack_require__.r(__webpack_exports__); 55086/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return combineAll; }); 55087/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/combineLatest */ "./node_modules/rxjs/_esm2015/internal/observable/combineLatest.js"); 55088 55089function combineAll(project) { 55090 return (source) => source.lift(new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__["CombineLatestOperator"](project)); 55091} 55092//# sourceMappingURL=combineAll.js.map 55093 55094/***/ }), 55095
vendor: 1,807 bytes, lines 55096-55126
55096/***/ "./node_modules/rxjs/_esm2015/internal/operators/combineLatest.js": 55097/*!************************************************************************!*\ 55098 !*** ./node_modules/rxjs/_esm2015/internal/operators/combineLatest.js ***! 55099 \************************************************************************/ 55100/*! exports provided: combineLatest */ 55101/***/ (function(module, __webpack_exports__, __webpack_require__) { 55102 55103"use strict"; 55104__webpack_require__.r(__webpack_exports__); 55105/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; }); 55106/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 55107/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/combineLatest */ "./node_modules/rxjs/_esm2015/internal/observable/combineLatest.js"); 55108/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 55109 55110 55111 55112const none = {}; 55113function combineLatest(...observables) { 55114 let project = null; 55115 if (typeof observables[observables.length - 1] === 'function') { 55116 project = observables.pop(); 55117 } 55118 if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) { 55119 observables = observables[0].slice(); 55120 } 55121 return (source) => source.lift.call(Object(_observable_from__WEBPACK_IMPORTED_MODULE_2__["from"])([source, ...observables]), new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__["CombineLatestOperator"](project)); 55122} 55123//# sourceMappingURL=combineLatest.js.map 55124 55125/***/ }), 55126
vendor: 956 bytes, lines 55127-55145
55127/***/ "./node_modules/rxjs/_esm2015/internal/operators/concat.js": 55128/*!*****************************************************************!*\ 55129 !*** ./node_modules/rxjs/_esm2015/internal/operators/concat.js ***! 55130 \*****************************************************************/ 55131/*! exports provided: concat */ 55132/***/ (function(module, __webpack_exports__, __webpack_require__) { 55133 55134"use strict"; 55135__webpack_require__.r(__webpack_exports__); 55136/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; }); 55137/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/concat */ "./node_modules/rxjs/_esm2015/internal/observable/concat.js"); 55138 55139function concat(...observables) { 55140 return (source) => source.lift.call(Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(source, ...observables)); 55141} 55142//# sourceMappingURL=concat.js.map 55143 55144/***/ }), 55145
vendor: 893 bytes, lines 55146-55164
55146/***/ "./node_modules/rxjs/_esm2015/internal/operators/concatAll.js": 55147/*!********************************************************************!*\ 55148 !*** ./node_modules/rxjs/_esm2015/internal/operators/concatAll.js ***! 55149 \********************************************************************/ 55150/*! exports provided: concatAll */ 55151/***/ (function(module, __webpack_exports__, __webpack_require__) { 55152 55153"use strict"; 55154__webpack_require__.r(__webpack_exports__); 55155/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return concatAll; }); 55156/* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeAll */ "./node_modules/rxjs/_esm2015/internal/operators/mergeAll.js"); 55157 55158function concatAll() { 55159 return Object(_mergeAll__WEBPACK_IMPORTED_MODULE_0__["mergeAll"])(1); 55160} 55161//# sourceMappingURL=concatAll.js.map 55162 55163/***/ }), 55164
vendor: 941 bytes, lines 55165-55183
55165/***/ "./node_modules/rxjs/_esm2015/internal/operators/concatMap.js": 55166/*!********************************************************************!*\ 55167 !*** ./node_modules/rxjs/_esm2015/internal/operators/concatMap.js ***! 55168 \********************************************************************/ 55169/*! exports provided: concatMap */ 55170/***/ (function(module, __webpack_exports__, __webpack_require__) { 55171 55172"use strict"; 55173__webpack_require__.r(__webpack_exports__); 55174/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return concatMap; }); 55175/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "./node_modules/rxjs/_esm2015/internal/operators/mergeMap.js"); 55176 55177function concatMap(project, resultSelector) { 55178 return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(project, resultSelector, 1); 55179} 55180//# sourceMappingURL=concatMap.js.map 55181 55182/***/ }), 55183
vendor: 983 bytes, lines 55184-55202
55184/***/ "./node_modules/rxjs/_esm2015/internal/operators/concatMapTo.js": 55185/*!**********************************************************************!*\ 55186 !*** ./node_modules/rxjs/_esm2015/internal/operators/concatMapTo.js ***! 55187 \**********************************************************************/ 55188/*! exports provided: concatMapTo */ 55189/***/ (function(module, __webpack_exports__, __webpack_require__) { 55190 55191"use strict"; 55192__webpack_require__.r(__webpack_exports__); 55193/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; }); 55194/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./concatMap */ "./node_modules/rxjs/_esm2015/internal/operators/concatMap.js"); 55195 55196function concatMapTo(innerObservable, resultSelector) { 55197 return Object(_concatMap__WEBPACK_IMPORTED_MODULE_0__["concatMap"])(() => innerObservable, resultSelector); 55198} 55199//# sourceMappingURL=concatMapTo.js.map 55200 55201/***/ }), 55202
vendor: 1,973 bytes, lines 55203-55264
55203/***/ "./node_modules/rxjs/_esm2015/internal/operators/count.js": 55204/*!****************************************************************!*\ 55205 !*** ./node_modules/rxjs/_esm2015/internal/operators/count.js ***! 55206 \****************************************************************/ 55207/*! exports provided: count */ 55208/***/ (function(module, __webpack_exports__, __webpack_require__) { 55209 55210"use strict"; 55211__webpack_require__.r(__webpack_exports__); 55212/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return count; }); 55213/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 55214 55215function count(predicate) { 55216 return (source) => source.lift(new CountOperator(predicate, source)); 55217} 55218class CountOperator { 55219 constructor(predicate, source) { 55220 this.predicate = predicate; 55221 this.source = source; 55222 } 55223 call(subscriber, source) { 55224 return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source)); 55225 } 55226} 55227class CountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 55228 constructor(destination, predicate, source) { 55229 super(destination); 55230 this.predicate = predicate; 55231 this.source = source; 55232 this.count = 0; 55233 this.index = 0; 55234 } 55235 _next(value) { 55236 if (this.predicate) { 55237 this._tryPredicate(value); 55238 } 55239 else { 55240 this.count++; 55241 } 55242 } 55243 _tryPredicate(value) { 55244 let result; 55245 try { 55246 result = this.predicate(value, this.index++, this.source); 55247 } 55248 catch (err) { 55249 this.destination.error(err); 55250 return; 55251 } 55252 if (result) { 55253 this.count++; 55254 } 55255 } 55256 _complete() { 55257 this.destination.next(this.count); 55258 this.destination.complete(); 55259 } 55260} 55261//# sourceMappingURL=count.js.map 55262 55263/***/ }), 55264
vendor: 3,154 bytes, lines 55265-55349
55265/***/ "./node_modules/rxjs/_esm2015/internal/operators/debounce.js": 55266/*!*******************************************************************!*\ 55267 !*** ./node_modules/rxjs/_esm2015/internal/operators/debounce.js ***! 55268 \*******************************************************************/ 55269/*! exports provided: debounce */ 55270/***/ (function(module, __webpack_exports__, __webpack_require__) { 55271 55272"use strict"; 55273__webpack_require__.r(__webpack_exports__); 55274/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; }); 55275/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 55276/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 55277 55278 55279function debounce(durationSelector) { 55280 return (source) => source.lift(new DebounceOperator(durationSelector)); 55281} 55282class DebounceOperator { 55283 constructor(durationSelector) { 55284 this.durationSelector = durationSelector; 55285 } 55286 call(subscriber, source) { 55287 return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector)); 55288 } 55289} 55290class DebounceSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 55291 constructor(destination, durationSelector) { 55292 super(destination); 55293 this.durationSelector = durationSelector; 55294 this.hasValue = false; 55295 this.durationSubscription = null; 55296 } 55297 _next(value) { 55298 try { 55299 const result = this.durationSelector.call(this, value); 55300 if (result) { 55301 this._tryNext(value, result); 55302 } 55303 } 55304 catch (err) { 55305 this.destination.error(err); 55306 } 55307 } 55308 _complete() { 55309 this.emitValue(); 55310 this.destination.complete(); 55311 } 55312 _tryNext(value, duration) { 55313 let subscription = this.durationSubscription; 55314 this.value = value; 55315 this.hasValue = true; 55316 if (subscription) { 55317 subscription.unsubscribe(); 55318 this.remove(subscription); 55319 } 55320 subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, duration); 55321 if (subscription && !subscription.closed) { 55322 this.add(this.durationSubscription = subscription); 55323 } 55324 } 55325 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 55326 this.emitValue(); 55327 } 55328 notifyComplete() { 55329 this.emitValue(); 55330 } 55331 emitValue() { 55332 if (this.hasValue) { 55333 const value = this.value; 55334 const subscription = this.durationSubscription; 55335 if (subscription) { 55336 this.durationSubscription = null; 55337 subscription.unsubscribe(); 55338 this.remove(subscription); 55339 } 55340 this.value = null; 55341 this.hasValue = false; 55342 super._next(value); 55343 } 55344 } 55345} 55346//# sourceMappingURL=debounce.js.map 55347 55348/***/ }), 55349
vendor: 2,749 bytes, lines 55350-55419
55350/***/ "./node_modules/rxjs/_esm2015/internal/operators/debounceTime.js": 55351/*!***********************************************************************!*\ 55352 !*** ./node_modules/rxjs/_esm2015/internal/operators/debounceTime.js ***! 55353 \***********************************************************************/ 55354/*! exports provided: debounceTime */ 55355/***/ (function(module, __webpack_exports__, __webpack_require__) { 55356 55357"use strict"; 55358__webpack_require__.r(__webpack_exports__); 55359/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return debounceTime; }); 55360/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 55361/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 55362 55363 55364function debounceTime(dueTime, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]) { 55365 return (source) => source.lift(new DebounceTimeOperator(dueTime, scheduler)); 55366} 55367class DebounceTimeOperator { 55368 constructor(dueTime, scheduler) { 55369 this.dueTime = dueTime; 55370 this.scheduler = scheduler; 55371 } 55372 call(subscriber, source) { 55373 return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler)); 55374 } 55375} 55376class DebounceTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 55377 constructor(destination, dueTime, scheduler) { 55378 super(destination); 55379 this.dueTime = dueTime; 55380 this.scheduler = scheduler; 55381 this.debouncedSubscription = null; 55382 this.lastValue = null; 55383 this.hasValue = false; 55384 } 55385 _next(value) { 55386 this.clearDebounce(); 55387 this.lastValue = value; 55388 this.hasValue = true; 55389 this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); 55390 } 55391 _complete() { 55392 this.debouncedNext(); 55393 this.destination.complete(); 55394 } 55395 debouncedNext() { 55396 this.clearDebounce(); 55397 if (this.hasValue) { 55398 const { lastValue } = this; 55399 this.lastValue = null; 55400 this.hasValue = false; 55401 this.destination.next(lastValue); 55402 } 55403 } 55404 clearDebounce() { 55405 const debouncedSubscription = this.debouncedSubscription; 55406 if (debouncedSubscription !== null) { 55407 this.remove(debouncedSubscription); 55408 debouncedSubscription.unsubscribe(); 55409 this.debouncedSubscription = null; 55410 } 55411 } 55412} 55413function dispatchNext(subscriber) { 55414 subscriber.debouncedNext(); 55415} 55416//# sourceMappingURL=debounceTime.js.map 55417 55418/***/ }), 55419
vendor: 1,696 bytes, lines 55420-55463
55420/***/ "./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js": 55421/*!*************************************************************************!*\ 55422 !*** ./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js ***! 55423 \*************************************************************************/ 55424/*! exports provided: defaultIfEmpty */ 55425/***/ (function(module, __webpack_exports__, __webpack_require__) { 55426 55427"use strict"; 55428__webpack_require__.r(__webpack_exports__); 55429/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return defaultIfEmpty; }); 55430/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 55431 55432function defaultIfEmpty(defaultValue = null) { 55433 return (source) => source.lift(new DefaultIfEmptyOperator(defaultValue)); 55434} 55435class DefaultIfEmptyOperator { 55436 constructor(defaultValue) { 55437 this.defaultValue = defaultValue; 55438 } 55439 call(subscriber, source) { 55440 return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue)); 55441 } 55442} 55443class DefaultIfEmptySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 55444 constructor(destination, defaultValue) { 55445 super(destination); 55446 this.defaultValue = defaultValue; 55447 this.isEmpty = true; 55448 } 55449 _next(value) { 55450 this.isEmpty = false; 55451 this.destination.next(value); 55452 } 55453 _complete() { 55454 if (this.isEmpty) { 55455 this.destination.next(this.defaultValue); 55456 } 55457 this.destination.complete(); 55458 } 55459} 55460//# sourceMappingURL=defaultIfEmpty.js.map 55461 55462/***/ }), 55463
vendor: 4,025 bytes, lines 55464-55563
55464/***/ "./node_modules/rxjs/_esm2015/internal/operators/delay.js": 55465/*!****************************************************************!*\ 55466 !*** ./node_modules/rxjs/_esm2015/internal/operators/delay.js ***! 55467 \****************************************************************/ 55468/*! exports provided: delay */ 55469/***/ (function(module, __webpack_exports__, __webpack_require__) { 55470 55471"use strict"; 55472__webpack_require__.r(__webpack_exports__); 55473/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; }); 55474/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 55475/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isDate */ "./node_modules/rxjs/_esm2015/internal/util/isDate.js"); 55476/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 55477/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Notification */ "./node_modules/rxjs/_esm2015/internal/Notification.js"); 55478 55479 55480 55481 55482function delay(delay, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) { 55483 const absoluteDelay = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_1__["isDate"])(delay); 55484 const delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay); 55485 return (source) => source.lift(new DelayOperator(delayFor, scheduler)); 55486} 55487class DelayOperator { 55488 constructor(delay, scheduler) { 55489 this.delay = delay; 55490 this.scheduler = scheduler; 55491 } 55492 call(subscriber, source) { 55493 return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler)); 55494 } 55495} 55496class DelaySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"] { 55497 constructor(destination, delay, scheduler) { 55498 super(destination); 55499 this.delay = delay; 55500 this.scheduler = scheduler; 55501 this.queue = []; 55502 this.active = false; 55503 this.errored = false; 55504 } 55505 static dispatch(state) { 55506 const source = state.source; 55507 const queue = source.queue; 55508 const scheduler = state.scheduler; 55509 const destination = state.destination; 55510 while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) { 55511 queue.shift().notification.observe(destination); 55512 } 55513 if (queue.length > 0) { 55514 const delay = Math.max(0, queue[0].time - scheduler.now()); 55515 this.schedule(state, delay); 55516 } 55517 else { 55518 this.unsubscribe(); 55519 source.active = false; 55520 } 55521 } 55522 _schedule(scheduler) { 55523 this.active = true; 55524 const destination = this.destination; 55525 destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { 55526 source: this, destination: this.destination, scheduler: scheduler 55527 })); 55528 } 55529 scheduleNotification(notification) { 55530 if (this.errored === true) { 55531 return; 55532 } 55533 const scheduler = this.scheduler; 55534 const message = new DelayMessage(scheduler.now() + this.delay, notification); 55535 this.queue.push(message); 55536 if (this.active === false) { 55537 this._schedule(scheduler); 55538 } 55539 } 55540 _next(value) { 55541 this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_3__["Notification"].createNext(value)); 55542 } 55543 _error(err) { 55544 this.errored = true; 55545 this.queue = []; 55546 this.destination.error(err); 55547 this.unsubscribe(); 55548 } 55549 _complete() { 55550 this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_3__["Notification"].createComplete()); 55551 this.unsubscribe(); 55552 } 55553} 55554class DelayMessage { 55555 constructor(time, notification) { 55556 this.time = time; 55557 this.notification = notification; 55558 } 55559} 55560//# sourceMappingURL=delay.js.map 55561 55562/***/ }), 55563
vendor: 5,200 bytes, lines 55564-55698
55564/***/ "./node_modules/rxjs/_esm2015/internal/operators/delayWhen.js": 55565/*!********************************************************************!*\ 55566 !*** ./node_modules/rxjs/_esm2015/internal/operators/delayWhen.js ***! 55567 \********************************************************************/ 55568/*! exports provided: delayWhen */ 55569/***/ (function(module, __webpack_exports__, __webpack_require__) { 55570 55571"use strict"; 55572__webpack_require__.r(__webpack_exports__); 55573/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return delayWhen; }); 55574/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 55575/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 55576/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 55577/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 55578 55579 55580 55581 55582function delayWhen(delayDurationSelector, subscriptionDelay) { 55583 if (subscriptionDelay) { 55584 return (source) => new SubscriptionDelayObservable(source, subscriptionDelay) 55585 .lift(new DelayWhenOperator(delayDurationSelector)); 55586 } 55587 return (source) => source.lift(new DelayWhenOperator(delayDurationSelector)); 55588} 55589class DelayWhenOperator { 55590 constructor(delayDurationSelector) { 55591 this.delayDurationSelector = delayDurationSelector; 55592 } 55593 call(subscriber, source) { 55594 return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector)); 55595 } 55596} 55597class DelayWhenSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] { 55598 constructor(destination, delayDurationSelector) { 55599 super(destination); 55600 this.delayDurationSelector = delayDurationSelector; 55601 this.completed = false; 55602 this.delayNotifierSubscriptions = []; 55603 this.index = 0; 55604 } 55605 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 55606 this.destination.next(outerValue); 55607 this.removeSubscription(innerSub); 55608 this.tryComplete(); 55609 } 55610 notifyError(error, innerSub) { 55611 this._error(error); 55612 } 55613 notifyComplete(innerSub) { 55614 const value = this.removeSubscription(innerSub); 55615 if (value) { 55616 this.destination.next(value); 55617 } 55618 this.tryComplete(); 55619 } 55620 _next(value) { 55621 const index = this.index++; 55622 try { 55623 const delayNotifier = this.delayDurationSelector(value, index); 55624 if (delayNotifier) { 55625 this.tryDelay(delayNotifier, value); 55626 } 55627 } 55628 catch (err) { 55629 this.destination.error(err); 55630 } 55631 } 55632 _complete() { 55633 this.completed = true; 55634 this.tryComplete(); 55635 this.unsubscribe(); 55636 } 55637 removeSubscription(subscription) { 55638 subscription.unsubscribe(); 55639 const subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription); 55640 if (subscriptionIdx !== -1) { 55641 this.delayNotifierSubscriptions.splice(subscriptionIdx, 1); 55642 } 55643 return subscription.outerValue; 55644 } 55645 tryDelay(delayNotifier, value) { 55646 const notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, delayNotifier, value); 55647 if (notifierSubscription && !notifierSubscription.closed) { 55648 const destination = this.destination; 55649 destination.add(notifierSubscription); 55650 this.delayNotifierSubscriptions.push(notifierSubscription); 55651 } 55652 } 55653 tryComplete() { 55654 if (this.completed && this.delayNotifierSubscriptions.length === 0) { 55655 this.destination.complete(); 55656 } 55657 } 55658} 55659class SubscriptionDelayObservable extends _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"] { 55660 constructor(source, subscriptionDelay) { 55661 super(); 55662 this.source = source; 55663 this.subscriptionDelay = subscriptionDelay; 55664 } 55665 _subscribe(subscriber) { 55666 this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source)); 55667 } 55668} 55669class SubscriptionDelaySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 55670 constructor(parent, source) { 55671 super(); 55672 this.parent = parent; 55673 this.source = source; 55674 this.sourceSubscribed = false; 55675 } 55676 _next(unused) { 55677 this.subscribeToSource(); 55678 } 55679 _error(err) { 55680 this.unsubscribe(); 55681 this.parent.error(err); 55682 } 55683 _complete() { 55684 this.unsubscribe(); 55685 this.subscribeToSource(); 55686 } 55687 subscribeToSource() { 55688 if (!this.sourceSubscribed) { 55689 this.sourceSubscribed = true; 55690 this.unsubscribe(); 55691 this.source.subscribe(this.parent); 55692 } 55693 } 55694} 55695//# sourceMappingURL=delayWhen.js.map 55696 55697/***/ }), 55698
vendor: 1,347 bytes, lines 55699-55732
55699/***/ "./node_modules/rxjs/_esm2015/internal/operators/dematerialize.js": 55700/*!************************************************************************!*\ 55701 !*** ./node_modules/rxjs/_esm2015/internal/operators/dematerialize.js ***! 55702 \************************************************************************/ 55703/*! exports provided: dematerialize */ 55704/***/ (function(module, __webpack_exports__, __webpack_require__) { 55705 55706"use strict"; 55707__webpack_require__.r(__webpack_exports__); 55708/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return dematerialize; }); 55709/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 55710 55711function dematerialize() { 55712 return function dematerializeOperatorFunction(source) { 55713 return source.lift(new DeMaterializeOperator()); 55714 }; 55715} 55716class DeMaterializeOperator { 55717 call(subscriber, source) { 55718 return source.subscribe(new DeMaterializeSubscriber(subscriber)); 55719 } 55720} 55721class DeMaterializeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 55722 constructor(destination) { 55723 super(destination); 55724 } 55725 _next(value) { 55726 value.observe(this.destination); 55727 } 55728} 55729//# sourceMappingURL=dematerialize.js.map 55730 55731/***/ }), 55732
vendor: 2,809 bytes, lines 55733-55806
55733/***/ "./node_modules/rxjs/_esm2015/internal/operators/distinct.js": 55734/*!*******************************************************************!*\ 55735 !*** ./node_modules/rxjs/_esm2015/internal/operators/distinct.js ***! 55736 \*******************************************************************/ 55737/*! exports provided: distinct, DistinctSubscriber */ 55738/***/ (function(module, __webpack_exports__, __webpack_require__) { 55739 55740"use strict"; 55741__webpack_require__.r(__webpack_exports__); 55742/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); 55743/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DistinctSubscriber", function() { return DistinctSubscriber; }); 55744/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 55745/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 55746 55747 55748function distinct(keySelector, flushes) { 55749 return (source) => source.lift(new DistinctOperator(keySelector, flushes)); 55750} 55751class DistinctOperator { 55752 constructor(keySelector, flushes) { 55753 this.keySelector = keySelector; 55754 this.flushes = flushes; 55755 } 55756 call(subscriber, source) { 55757 return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes)); 55758 } 55759} 55760class DistinctSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 55761 constructor(destination, keySelector, flushes) { 55762 super(destination); 55763 this.keySelector = keySelector; 55764 this.values = new Set(); 55765 if (flushes) { 55766 this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, flushes)); 55767 } 55768 } 55769 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 55770 this.values.clear(); 55771 } 55772 notifyError(error, innerSub) { 55773 this._error(error); 55774 } 55775 _next(value) { 55776 if (this.keySelector) { 55777 this._useKeySelector(value); 55778 } 55779 else { 55780 this._finalizeNext(value, value); 55781 } 55782 } 55783 _useKeySelector(value) { 55784 let key; 55785 const { destination } = this; 55786 try { 55787 key = this.keySelector(value); 55788 } 55789 catch (err) { 55790 destination.error(err); 55791 return; 55792 } 55793 this._finalizeNext(key, value); 55794 } 55795 _finalizeNext(key, value) { 55796 const { values } = this; 55797 if (!values.has(key)) { 55798 values.add(key); 55799 this.destination.next(value); 55800 } 55801 } 55802} 55803//# sourceMappingURL=distinct.js.map 55804 55805/***/ }), 55806
vendor: 2,423 bytes, lines 55807-55874
55807/***/ "./node_modules/rxjs/_esm2015/internal/operators/distinctUntilChanged.js": 55808/*!*******************************************************************************!*\ 55809 !*** ./node_modules/rxjs/_esm2015/internal/operators/distinctUntilChanged.js ***! 55810 \*******************************************************************************/ 55811/*! exports provided: distinctUntilChanged */ 55812/***/ (function(module, __webpack_exports__, __webpack_require__) { 55813 55814"use strict"; 55815__webpack_require__.r(__webpack_exports__); 55816/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return distinctUntilChanged; }); 55817/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 55818 55819function distinctUntilChanged(compare, keySelector) { 55820 return (source) => source.lift(new DistinctUntilChangedOperator(compare, keySelector)); 55821} 55822class DistinctUntilChangedOperator { 55823 constructor(compare, keySelector) { 55824 this.compare = compare; 55825 this.keySelector = keySelector; 55826 } 55827 call(subscriber, source) { 55828 return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector)); 55829 } 55830} 55831class DistinctUntilChangedSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 55832 constructor(destination, compare, keySelector) { 55833 super(destination); 55834 this.keySelector = keySelector; 55835 this.hasKey = false; 55836 if (typeof compare === 'function') { 55837 this.compare = compare; 55838 } 55839 } 55840 compare(x, y) { 55841 return x === y; 55842 } 55843 _next(value) { 55844 let key; 55845 try { 55846 const { keySelector } = this; 55847 key = keySelector ? keySelector(value) : value; 55848 } 55849 catch (err) { 55850 return this.destination.error(err); 55851 } 55852 let result = false; 55853 if (this.hasKey) { 55854 try { 55855 const { compare } = this; 55856 result = compare(this.key, key); 55857 } 55858 catch (err) { 55859 return this.destination.error(err); 55860 } 55861 } 55862 else { 55863 this.hasKey = true; 55864 } 55865 if (!result) { 55866 this.key = key; 55867 this.destination.next(value); 55868 } 55869 } 55870} 55871//# sourceMappingURL=distinctUntilChanged.js.map 55872 55873/***/ }), 55874
vendor: 1,153 bytes, lines 55875-55893
55875/***/ "./node_modules/rxjs/_esm2015/internal/operators/distinctUntilKeyChanged.js": 55876/*!**********************************************************************************!*\ 55877 !*** ./node_modules/rxjs/_esm2015/internal/operators/distinctUntilKeyChanged.js ***! 55878 \**********************************************************************************/ 55879/*! exports provided: distinctUntilKeyChanged */ 55880/***/ (function(module, __webpack_exports__, __webpack_require__) { 55881 55882"use strict"; 55883__webpack_require__.r(__webpack_exports__); 55884/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; }); 55885/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distinctUntilChanged */ "./node_modules/rxjs/_esm2015/internal/operators/distinctUntilChanged.js"); 55886 55887function distinctUntilKeyChanged(key, compare) { 55888 return Object(_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__["distinctUntilChanged"])((x, y) => compare ? compare(x[key], y[key]) : x[key] === y[key]); 55889} 55890//# sourceMappingURL=distinctUntilKeyChanged.js.map 55891 55892/***/ }), 55893
vendor: 2,220 bytes, lines 55894-55926
55894/***/ "./node_modules/rxjs/_esm2015/internal/operators/elementAt.js": 55895/*!********************************************************************!*\ 55896 !*** ./node_modules/rxjs/_esm2015/internal/operators/elementAt.js ***! 55897 \********************************************************************/ 55898/*! exports provided: elementAt */ 55899/***/ (function(module, __webpack_exports__, __webpack_require__) { 55900 55901"use strict"; 55902__webpack_require__.r(__webpack_exports__); 55903/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; }); 55904/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js"); 55905/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "./node_modules/rxjs/_esm2015/internal/operators/filter.js"); 55906/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./throwIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js"); 55907/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js"); 55908/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./take */ "./node_modules/rxjs/_esm2015/internal/operators/take.js"); 55909 55910 55911 55912 55913 55914function elementAt(index, defaultValue) { 55915 if (index < 0) { 55916 throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"](); 55917 } 55918 const hasDefaultValue = arguments.length >= 2; 55919 return (source) => source.pipe(Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])((v, i) => i === index), Object(_take__WEBPACK_IMPORTED_MODULE_4__["take"])(1), hasDefaultValue 55920 ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue) 55921 : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__["throwIfEmpty"])(() => new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"]())); 55922} 55923//# sourceMappingURL=elementAt.js.map 55924 55925/***/ }), 55926
vendor: 1,169 bytes, lines 55927-55947
55927/***/ "./node_modules/rxjs/_esm2015/internal/operators/endWith.js": 55928/*!******************************************************************!*\ 55929 !*** ./node_modules/rxjs/_esm2015/internal/operators/endWith.js ***! 55930 \******************************************************************/ 55931/*! exports provided: endWith */ 55932/***/ (function(module, __webpack_exports__, __webpack_require__) { 55933 55934"use strict"; 55935__webpack_require__.r(__webpack_exports__); 55936/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return endWith; }); 55937/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/concat */ "./node_modules/rxjs/_esm2015/internal/observable/concat.js"); 55938/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/of */ "./node_modules/rxjs/_esm2015/internal/observable/of.js"); 55939 55940 55941function endWith(...array) { 55942 return (source) => Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(source, Object(_observable_of__WEBPACK_IMPORTED_MODULE_1__["of"])(...array)); 55943} 55944//# sourceMappingURL=endWith.js.map 55945 55946/***/ }), 55947
vendor: 2,062 bytes, lines 55948-56006
55948/***/ "./node_modules/rxjs/_esm2015/internal/operators/every.js": 55949/*!****************************************************************!*\ 55950 !*** ./node_modules/rxjs/_esm2015/internal/operators/every.js ***! 55951 \****************************************************************/ 55952/*! exports provided: every */ 55953/***/ (function(module, __webpack_exports__, __webpack_require__) { 55954 55955"use strict"; 55956__webpack_require__.r(__webpack_exports__); 55957/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return every; }); 55958/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 55959 55960function every(predicate, thisArg) { 55961 return (source) => source.lift(new EveryOperator(predicate, thisArg, source)); 55962} 55963class EveryOperator { 55964 constructor(predicate, thisArg, source) { 55965 this.predicate = predicate; 55966 this.thisArg = thisArg; 55967 this.source = source; 55968 } 55969 call(observer, source) { 55970 return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source)); 55971 } 55972} 55973class EverySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 55974 constructor(destination, predicate, thisArg, source) { 55975 super(destination); 55976 this.predicate = predicate; 55977 this.thisArg = thisArg; 55978 this.source = source; 55979 this.index = 0; 55980 this.thisArg = thisArg || this; 55981 } 55982 notifyComplete(everyValueMatch) { 55983 this.destination.next(everyValueMatch); 55984 this.destination.complete(); 55985 } 55986 _next(value) { 55987 let result = false; 55988 try { 55989 result = this.predicate.call(this.thisArg, value, this.index++, this.source); 55990 } 55991 catch (err) { 55992 this.destination.error(err); 55993 return; 55994 } 55995 if (!result) { 55996 this.notifyComplete(false); 55997 } 55998 } 55999 _complete() { 56000 this.notifyComplete(true); 56001 } 56002} 56003//# sourceMappingURL=every.js.map 56004 56005/***/ }), 56006
vendor: 2,027 bytes, lines 56007-56058
56007/***/ "./node_modules/rxjs/_esm2015/internal/operators/exhaust.js": 56008/*!******************************************************************!*\ 56009 !*** ./node_modules/rxjs/_esm2015/internal/operators/exhaust.js ***! 56010 \******************************************************************/ 56011/*! exports provided: exhaust */ 56012/***/ (function(module, __webpack_exports__, __webpack_require__) { 56013 56014"use strict"; 56015__webpack_require__.r(__webpack_exports__); 56016/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return exhaust; }); 56017/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 56018/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 56019 56020 56021function exhaust() { 56022 return (source) => source.lift(new SwitchFirstOperator()); 56023} 56024class SwitchFirstOperator { 56025 call(subscriber, source) { 56026 return source.subscribe(new SwitchFirstSubscriber(subscriber)); 56027 } 56028} 56029class SwitchFirstSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 56030 constructor(destination) { 56031 super(destination); 56032 this.hasCompleted = false; 56033 this.hasSubscription = false; 56034 } 56035 _next(value) { 56036 if (!this.hasSubscription) { 56037 this.hasSubscription = true; 56038 this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, value)); 56039 } 56040 } 56041 _complete() { 56042 this.hasCompleted = true; 56043 if (!this.hasSubscription) { 56044 this.destination.complete(); 56045 } 56046 } 56047 notifyComplete(innerSub) { 56048 this.remove(innerSub); 56049 this.hasSubscription = false; 56050 if (this.hasCompleted) { 56051 this.destination.complete(); 56052 } 56053 } 56054} 56055//# sourceMappingURL=exhaust.js.map 56056 56057/***/ }), 56058
vendor: 4,019 bytes, lines 56059-56153
56059/***/ "./node_modules/rxjs/_esm2015/internal/operators/exhaustMap.js": 56060/*!*********************************************************************!*\ 56061 !*** ./node_modules/rxjs/_esm2015/internal/operators/exhaustMap.js ***! 56062 \*********************************************************************/ 56063/*! exports provided: exhaustMap */ 56064/***/ (function(module, __webpack_exports__, __webpack_require__) { 56065 56066"use strict"; 56067__webpack_require__.r(__webpack_exports__); 56068/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return exhaustMap; }); 56069/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 56070/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js"); 56071/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 56072/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 56073/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 56074 56075 56076 56077 56078 56079function exhaustMap(project, resultSelector) { 56080 if (resultSelector) { 56081 return (source) => source.pipe(exhaustMap((a, i) => Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])((b, ii) => resultSelector(a, b, i, ii))))); 56082 } 56083 return (source) => source.lift(new ExhaustMapOperator(project)); 56084} 56085class ExhaustMapOperator { 56086 constructor(project) { 56087 this.project = project; 56088 } 56089 call(subscriber, source) { 56090 return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project)); 56091 } 56092} 56093class ExhaustMapSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 56094 constructor(destination, project) { 56095 super(destination); 56096 this.project = project; 56097 this.hasSubscription = false; 56098 this.hasCompleted = false; 56099 this.index = 0; 56100 } 56101 _next(value) { 56102 if (!this.hasSubscription) { 56103 this.tryNext(value); 56104 } 56105 } 56106 tryNext(value) { 56107 let result; 56108 const index = this.index++; 56109 try { 56110 result = this.project(value, index); 56111 } 56112 catch (err) { 56113 this.destination.error(err); 56114 return; 56115 } 56116 this.hasSubscription = true; 56117 this._innerSub(result, value, index); 56118 } 56119 _innerSub(result, value, index) { 56120 const innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_1__["InnerSubscriber"](this, value, index); 56121 const destination = this.destination; 56122 destination.add(innerSubscriber); 56123 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, undefined, undefined, innerSubscriber); 56124 if (innerSubscription !== innerSubscriber) { 56125 destination.add(innerSubscription); 56126 } 56127 } 56128 _complete() { 56129 this.hasCompleted = true; 56130 if (!this.hasSubscription) { 56131 this.destination.complete(); 56132 } 56133 this.unsubscribe(); 56134 } 56135 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 56136 this.destination.next(innerValue); 56137 } 56138 notifyError(err) { 56139 this.destination.error(err); 56140 } 56141 notifyComplete(innerSub) { 56142 const destination = this.destination; 56143 destination.remove(innerSub); 56144 this.hasSubscription = false; 56145 if (this.hasCompleted) { 56146 this.destination.complete(); 56147 } 56148 } 56149} 56150//# sourceMappingURL=exhaustMap.js.map 56151 56152/***/ }), 56153
vendor: 4,423 bytes, lines 56154-56261
56154/***/ "./node_modules/rxjs/_esm2015/internal/operators/expand.js": 56155/*!*****************************************************************!*\ 56156 !*** ./node_modules/rxjs/_esm2015/internal/operators/expand.js ***! 56157 \*****************************************************************/ 56158/*! exports provided: expand, ExpandOperator, ExpandSubscriber */ 56159/***/ (function(module, __webpack_exports__, __webpack_require__) { 56160 56161"use strict"; 56162__webpack_require__.r(__webpack_exports__); 56163/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return expand; }); 56164/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandOperator", function() { return ExpandOperator; }); 56165/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandSubscriber", function() { return ExpandSubscriber; }); 56166/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 56167/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 56168 56169 56170function expand(project, concurrent = Number.POSITIVE_INFINITY, scheduler = undefined) { 56171 concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent; 56172 return (source) => source.lift(new ExpandOperator(project, concurrent, scheduler)); 56173} 56174class ExpandOperator { 56175 constructor(project, concurrent, scheduler) { 56176 this.project = project; 56177 this.concurrent = concurrent; 56178 this.scheduler = scheduler; 56179 } 56180 call(subscriber, source) { 56181 return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler)); 56182 } 56183} 56184class ExpandSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 56185 constructor(destination, project, concurrent, scheduler) { 56186 super(destination); 56187 this.project = project; 56188 this.concurrent = concurrent; 56189 this.scheduler = scheduler; 56190 this.index = 0; 56191 this.active = 0; 56192 this.hasCompleted = false; 56193 if (concurrent < Number.POSITIVE_INFINITY) { 56194 this.buffer = []; 56195 } 56196 } 56197 static dispatch(arg) { 56198 const { subscriber, result, value, index } = arg; 56199 subscriber.subscribeToProjection(result, value, index); 56200 } 56201 _next(value) { 56202 const destination = this.destination; 56203 if (destination.closed) { 56204 this._complete(); 56205 return; 56206 } 56207 const index = this.index++; 56208 if (this.active < this.concurrent) { 56209 destination.next(value); 56210 try { 56211 const { project } = this; 56212 const result = project(value, index); 56213 if (!this.scheduler) { 56214 this.subscribeToProjection(result, value, index); 56215 } 56216 else { 56217 const state = { subscriber: this, result, value, index }; 56218 const destination = this.destination; 56219 destination.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state)); 56220 } 56221 } 56222 catch (e) { 56223 destination.error(e); 56224 } 56225 } 56226 else { 56227 this.buffer.push(value); 56228 } 56229 } 56230 subscribeToProjection(result, value, index) { 56231 this.active++; 56232 const destination = this.destination; 56233 destination.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, result, value, index)); 56234 } 56235 _complete() { 56236 this.hasCompleted = true; 56237 if (this.hasCompleted && this.active === 0) { 56238 this.destination.complete(); 56239 } 56240 this.unsubscribe(); 56241 } 56242 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 56243 this._next(innerValue); 56244 } 56245 notifyComplete(innerSub) { 56246 const buffer = this.buffer; 56247 const destination = this.destination; 56248 destination.remove(innerSub); 56249 this.active--; 56250 if (buffer && buffer.length > 0) { 56251 this._next(buffer.shift()); 56252 } 56253 if (this.hasCompleted && this.active === 0) { 56254 this.destination.complete(); 56255 } 56256 } 56257} 56258//# sourceMappingURL=expand.js.map 56259 56260/***/ }), 56261
vendor: 1,786 bytes, lines 56262-56312
56262/***/ "./node_modules/rxjs/_esm2015/internal/operators/filter.js": 56263/*!*****************************************************************!*\ 56264 !*** ./node_modules/rxjs/_esm2015/internal/operators/filter.js ***! 56265 \*****************************************************************/ 56266/*! exports provided: filter */ 56267/***/ (function(module, __webpack_exports__, __webpack_require__) { 56268 56269"use strict"; 56270__webpack_require__.r(__webpack_exports__); 56271/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; }); 56272/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56273 56274function filter(predicate, thisArg) { 56275 return function filterOperatorFunction(source) { 56276 return source.lift(new FilterOperator(predicate, thisArg)); 56277 }; 56278} 56279class FilterOperator { 56280 constructor(predicate, thisArg) { 56281 this.predicate = predicate; 56282 this.thisArg = thisArg; 56283 } 56284 call(subscriber, source) { 56285 return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg)); 56286 } 56287} 56288class FilterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56289 constructor(destination, predicate, thisArg) { 56290 super(destination); 56291 this.predicate = predicate; 56292 this.thisArg = thisArg; 56293 this.count = 0; 56294 } 56295 _next(value) { 56296 let result; 56297 try { 56298 result = this.predicate.call(this.thisArg, value, this.count++); 56299 } 56300 catch (err) { 56301 this.destination.error(err); 56302 return; 56303 } 56304 if (result) { 56305 this.destination.next(value); 56306 } 56307 } 56308} 56309//# sourceMappingURL=filter.js.map 56310 56311/***/ }), 56312
vendor: 1,526 bytes, lines 56313-56347
56313/***/ "./node_modules/rxjs/_esm2015/internal/operators/finalize.js": 56314/*!*******************************************************************!*\ 56315 !*** ./node_modules/rxjs/_esm2015/internal/operators/finalize.js ***! 56316 \*******************************************************************/ 56317/*! exports provided: finalize */ 56318/***/ (function(module, __webpack_exports__, __webpack_require__) { 56319 56320"use strict"; 56321__webpack_require__.r(__webpack_exports__); 56322/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return finalize; }); 56323/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56324/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 56325 56326 56327function finalize(callback) { 56328 return (source) => source.lift(new FinallyOperator(callback)); 56329} 56330class FinallyOperator { 56331 constructor(callback) { 56332 this.callback = callback; 56333 } 56334 call(subscriber, source) { 56335 return source.subscribe(new FinallySubscriber(subscriber, this.callback)); 56336 } 56337} 56338class FinallySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56339 constructor(destination, callback) { 56340 super(destination); 56341 this.add(new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](callback)); 56342 } 56343} 56344//# sourceMappingURL=finalize.js.map 56345 56346/***/ }), 56347
vendor: 2,721 bytes, lines 56348-56414
56348/***/ "./node_modules/rxjs/_esm2015/internal/operators/find.js": 56349/*!***************************************************************!*\ 56350 !*** ./node_modules/rxjs/_esm2015/internal/operators/find.js ***! 56351 \***************************************************************/ 56352/*! exports provided: find, FindValueOperator, FindValueSubscriber */ 56353/***/ (function(module, __webpack_exports__, __webpack_require__) { 56354 56355"use strict"; 56356__webpack_require__.r(__webpack_exports__); 56357/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; }); 56358/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueOperator", function() { return FindValueOperator; }); 56359/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueSubscriber", function() { return FindValueSubscriber; }); 56360/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56361 56362function find(predicate, thisArg) { 56363 if (typeof predicate !== 'function') { 56364 throw new TypeError('predicate is not a function'); 56365 } 56366 return (source) => source.lift(new FindValueOperator(predicate, source, false, thisArg)); 56367} 56368class FindValueOperator { 56369 constructor(predicate, source, yieldIndex, thisArg) { 56370 this.predicate = predicate; 56371 this.source = source; 56372 this.yieldIndex = yieldIndex; 56373 this.thisArg = thisArg; 56374 } 56375 call(observer, source) { 56376 return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg)); 56377 } 56378} 56379class FindValueSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56380 constructor(destination, predicate, source, yieldIndex, thisArg) { 56381 super(destination); 56382 this.predicate = predicate; 56383 this.source = source; 56384 this.yieldIndex = yieldIndex; 56385 this.thisArg = thisArg; 56386 this.index = 0; 56387 } 56388 notifyComplete(value) { 56389 const destination = this.destination; 56390 destination.next(value); 56391 destination.complete(); 56392 this.unsubscribe(); 56393 } 56394 _next(value) { 56395 const { predicate, thisArg } = this; 56396 const index = this.index++; 56397 try { 56398 const result = predicate.call(thisArg || this, value, index, this.source); 56399 if (result) { 56400 this.notifyComplete(this.yieldIndex ? index : value); 56401 } 56402 } 56403 catch (err) { 56404 this.destination.error(err); 56405 } 56406 } 56407 _complete() { 56408 this.notifyComplete(this.yieldIndex ? -1 : undefined); 56409 } 56410} 56411//# sourceMappingURL=find.js.map 56412 56413/***/ }), 56414
vendor: 987 bytes, lines 56415-56433
56415/***/ "./node_modules/rxjs/_esm2015/internal/operators/findIndex.js": 56416/*!********************************************************************!*\ 56417 !*** ./node_modules/rxjs/_esm2015/internal/operators/findIndex.js ***! 56418 \********************************************************************/ 56419/*! exports provided: findIndex */ 56420/***/ (function(module, __webpack_exports__, __webpack_require__) { 56421 56422"use strict"; 56423__webpack_require__.r(__webpack_exports__); 56424/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; }); 56425/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operators/find */ "./node_modules/rxjs/_esm2015/internal/operators/find.js"); 56426 56427function findIndex(predicate, thisArg) { 56428 return (source) => source.lift(new _operators_find__WEBPACK_IMPORTED_MODULE_0__["FindValueOperator"](predicate, source, true, thisArg)); 56429} 56430//# sourceMappingURL=findIndex.js.map 56431 56432/***/ }), 56433
vendor: 2,230 bytes, lines 56434-56463
56434/***/ "./node_modules/rxjs/_esm2015/internal/operators/first.js": 56435/*!****************************************************************!*\ 56436 !*** ./node_modules/rxjs/_esm2015/internal/operators/first.js ***! 56437 \****************************************************************/ 56438/*! exports provided: first */ 56439/***/ (function(module, __webpack_exports__, __webpack_require__) { 56440 56441"use strict"; 56442__webpack_require__.r(__webpack_exports__); 56443/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); 56444/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ "./node_modules/rxjs/_esm2015/internal/util/EmptyError.js"); 56445/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "./node_modules/rxjs/_esm2015/internal/operators/filter.js"); 56446/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./take */ "./node_modules/rxjs/_esm2015/internal/operators/take.js"); 56447/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js"); 56448/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throwIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js"); 56449/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm2015/internal/util/identity.js"); 56450 56451 56452 56453 56454 56455 56456function first(predicate, defaultValue) { 56457 const hasDefaultValue = arguments.length >= 2; 56458 return (source) => source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])((v, i) => predicate(v, i, source)) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_take__WEBPACK_IMPORTED_MODULE_2__["take"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__["throwIfEmpty"])(() => new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"]())); 56459} 56460//# sourceMappingURL=first.js.map 56461 56462/***/ }), 56463
vendor: 6,618 bytes, lines 56464-56645
56464/***/ "./node_modules/rxjs/_esm2015/internal/operators/groupBy.js": 56465/*!******************************************************************!*\ 56466 !*** ./node_modules/rxjs/_esm2015/internal/operators/groupBy.js ***! 56467 \******************************************************************/ 56468/*! exports provided: groupBy, GroupedObservable */ 56469/***/ (function(module, __webpack_exports__, __webpack_require__) { 56470 56471"use strict"; 56472__webpack_require__.r(__webpack_exports__); 56473/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); 56474/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return GroupedObservable; }); 56475/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56476/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 56477/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 56478/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 56479 56480 56481 56482 56483function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) { 56484 return (source) => source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector)); 56485} 56486class GroupByOperator { 56487 constructor(keySelector, elementSelector, durationSelector, subjectSelector) { 56488 this.keySelector = keySelector; 56489 this.elementSelector = elementSelector; 56490 this.durationSelector = durationSelector; 56491 this.subjectSelector = subjectSelector; 56492 } 56493 call(subscriber, source) { 56494 return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector)); 56495 } 56496} 56497class GroupBySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56498 constructor(destination, keySelector, elementSelector, durationSelector, subjectSelector) { 56499 super(destination); 56500 this.keySelector = keySelector; 56501 this.elementSelector = elementSelector; 56502 this.durationSelector = durationSelector; 56503 this.subjectSelector = subjectSelector; 56504 this.groups = null; 56505 this.attemptedToUnsubscribe = false; 56506 this.count = 0; 56507 } 56508 _next(value) { 56509 let key; 56510 try { 56511 key = this.keySelector(value); 56512 } 56513 catch (err) { 56514 this.error(err); 56515 return; 56516 } 56517 this._group(value, key); 56518 } 56519 _group(value, key) { 56520 let groups = this.groups; 56521 if (!groups) { 56522 groups = this.groups = new Map(); 56523 } 56524 let group = groups.get(key); 56525 let element; 56526 if (this.elementSelector) { 56527 try { 56528 element = this.elementSelector(value); 56529 } 56530 catch (err) { 56531 this.error(err); 56532 } 56533 } 56534 else { 56535 element = value; 56536 } 56537 if (!group) { 56538 group = (this.subjectSelector ? this.subjectSelector() : new _Subject__WEBPACK_IMPORTED_MODULE_3__["Subject"]()); 56539 groups.set(key, group); 56540 const groupedObservable = new GroupedObservable(key, group, this); 56541 this.destination.next(groupedObservable); 56542 if (this.durationSelector) { 56543 let duration; 56544 try { 56545 duration = this.durationSelector(new GroupedObservable(key, group)); 56546 } 56547 catch (err) { 56548 this.error(err); 56549 return; 56550 } 56551 this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this))); 56552 } 56553 } 56554 if (!group.closed) { 56555 group.next(element); 56556 } 56557 } 56558 _error(err) { 56559 const groups = this.groups; 56560 if (groups) { 56561 groups.forEach((group, key) => { 56562 group.error(err); 56563 }); 56564 groups.clear(); 56565 } 56566 this.destination.error(err); 56567 } 56568 _complete() { 56569 const groups = this.groups; 56570 if (groups) { 56571 groups.forEach((group, key) => { 56572 group.complete(); 56573 }); 56574 groups.clear(); 56575 } 56576 this.destination.complete(); 56577 } 56578 removeGroup(key) { 56579 this.groups.delete(key); 56580 } 56581 unsubscribe() { 56582 if (!this.closed) { 56583 this.attemptedToUnsubscribe = true; 56584 if (this.count === 0) { 56585 super.unsubscribe(); 56586 } 56587 } 56588 } 56589} 56590class GroupDurationSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56591 constructor(key, group, parent) { 56592 super(group); 56593 this.key = key; 56594 this.group = group; 56595 this.parent = parent; 56596 } 56597 _next(value) { 56598 this.complete(); 56599 } 56600 _unsubscribe() { 56601 const { parent, key } = this; 56602 this.key = this.parent = null; 56603 if (parent) { 56604 parent.removeGroup(key); 56605 } 56606 } 56607} 56608class GroupedObservable extends _Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"] { 56609 constructor(key, groupSubject, refCountSubscription) { 56610 super(); 56611 this.key = key; 56612 this.groupSubject = groupSubject; 56613 this.refCountSubscription = refCountSubscription; 56614 } 56615 _subscribe(subscriber) { 56616 const subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); 56617 const { refCountSubscription, groupSubject } = this; 56618 if (refCountSubscription && !refCountSubscription.closed) { 56619 subscription.add(new InnerRefCountSubscription(refCountSubscription)); 56620 } 56621 subscription.add(groupSubject.subscribe(subscriber)); 56622 return subscription; 56623 } 56624} 56625class InnerRefCountSubscription extends _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"] { 56626 constructor(parent) { 56627 super(); 56628 this.parent = parent; 56629 parent.count++; 56630 } 56631 unsubscribe() { 56632 const parent = this.parent; 56633 if (!parent.closed && !this.closed) { 56634 super.unsubscribe(); 56635 parent.count -= 1; 56636 if (parent.count === 0 && parent.attemptedToUnsubscribe) { 56637 parent.unsubscribe(); 56638 } 56639 } 56640 } 56641} 56642//# sourceMappingURL=groupBy.js.map 56643 56644/***/ }), 56645
vendor: 1,256 bytes, lines 56646-56675
56646/***/ "./node_modules/rxjs/_esm2015/internal/operators/ignoreElements.js": 56647/*!*************************************************************************!*\ 56648 !*** ./node_modules/rxjs/_esm2015/internal/operators/ignoreElements.js ***! 56649 \*************************************************************************/ 56650/*! exports provided: ignoreElements */ 56651/***/ (function(module, __webpack_exports__, __webpack_require__) { 56652 56653"use strict"; 56654__webpack_require__.r(__webpack_exports__); 56655/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return ignoreElements; }); 56656/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56657 56658function ignoreElements() { 56659 return function ignoreElementsOperatorFunction(source) { 56660 return source.lift(new IgnoreElementsOperator()); 56661 }; 56662} 56663class IgnoreElementsOperator { 56664 call(subscriber, source) { 56665 return source.subscribe(new IgnoreElementsSubscriber(subscriber)); 56666 } 56667} 56668class IgnoreElementsSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56669 _next(unused) { 56670 } 56671} 56672//# sourceMappingURL=ignoreElements.js.map 56673 56674/***/ }), 56675
vendor: 1,409 bytes, lines 56676-56715
56676/***/ "./node_modules/rxjs/_esm2015/internal/operators/isEmpty.js": 56677/*!******************************************************************!*\ 56678 !*** ./node_modules/rxjs/_esm2015/internal/operators/isEmpty.js ***! 56679 \******************************************************************/ 56680/*! exports provided: isEmpty */ 56681/***/ (function(module, __webpack_exports__, __webpack_require__) { 56682 56683"use strict"; 56684__webpack_require__.r(__webpack_exports__); 56685/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; }); 56686/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56687 56688function isEmpty() { 56689 return (source) => source.lift(new IsEmptyOperator()); 56690} 56691class IsEmptyOperator { 56692 call(observer, source) { 56693 return source.subscribe(new IsEmptySubscriber(observer)); 56694 } 56695} 56696class IsEmptySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56697 constructor(destination) { 56698 super(destination); 56699 } 56700 notifyComplete(isEmpty) { 56701 const destination = this.destination; 56702 destination.next(isEmpty); 56703 destination.complete(); 56704 } 56705 _next(value) { 56706 this.notifyComplete(false); 56707 } 56708 _complete() { 56709 this.notifyComplete(true); 56710 } 56711} 56712//# sourceMappingURL=isEmpty.js.map 56713 56714/***/ }), 56715
vendor: 2,241 bytes, lines 56716-56745
56716/***/ "./node_modules/rxjs/_esm2015/internal/operators/last.js": 56717/*!***************************************************************!*\ 56718 !*** ./node_modules/rxjs/_esm2015/internal/operators/last.js ***! 56719 \***************************************************************/ 56720/*! exports provided: last */ 56721/***/ (function(module, __webpack_exports__, __webpack_require__) { 56722 56723"use strict"; 56724__webpack_require__.r(__webpack_exports__); 56725/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; }); 56726/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ "./node_modules/rxjs/_esm2015/internal/util/EmptyError.js"); 56727/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "./node_modules/rxjs/_esm2015/internal/operators/filter.js"); 56728/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./takeLast */ "./node_modules/rxjs/_esm2015/internal/operators/takeLast.js"); 56729/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./throwIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js"); 56730/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaultIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js"); 56731/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm2015/internal/util/identity.js"); 56732 56733 56734 56735 56736 56737 56738function last(predicate, defaultValue) { 56739 const hasDefaultValue = arguments.length >= 2; 56740 return (source) => source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])((v, i) => predicate(v, i, source)) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_takeLast__WEBPACK_IMPORTED_MODULE_2__["takeLast"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__["throwIfEmpty"])(() => new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"]())); 56741} 56742//# sourceMappingURL=last.js.map 56743 56744/***/ }), 56745
vendor: 1,979 bytes, lines 56746-56798
56746/***/ "./node_modules/rxjs/_esm2015/internal/operators/map.js": 56747/*!**************************************************************!*\ 56748 !*** ./node_modules/rxjs/_esm2015/internal/operators/map.js ***! 56749 \**************************************************************/ 56750/*! exports provided: map, MapOperator */ 56751/***/ (function(module, __webpack_exports__, __webpack_require__) { 56752 56753"use strict"; 56754__webpack_require__.r(__webpack_exports__); 56755/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; }); 56756/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MapOperator", function() { return MapOperator; }); 56757/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56758 56759function map(project, thisArg) { 56760 return function mapOperation(source) { 56761 if (typeof project !== 'function') { 56762 throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); 56763 } 56764 return source.lift(new MapOperator(project, thisArg)); 56765 }; 56766} 56767class MapOperator { 56768 constructor(project, thisArg) { 56769 this.project = project; 56770 this.thisArg = thisArg; 56771 } 56772 call(subscriber, source) { 56773 return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg)); 56774 } 56775} 56776class MapSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56777 constructor(destination, project, thisArg) { 56778 super(destination); 56779 this.project = project; 56780 this.count = 0; 56781 this.thisArg = thisArg || this; 56782 } 56783 _next(value) { 56784 let result; 56785 try { 56786 result = this.project.call(this.thisArg, value, this.count++); 56787 } 56788 catch (err) { 56789 this.destination.error(err); 56790 return; 56791 } 56792 this.destination.next(result); 56793 } 56794} 56795//# sourceMappingURL=map.js.map 56796 56797/***/ }), 56798
vendor: 1,298 bytes, lines 56799-56834
56799/***/ "./node_modules/rxjs/_esm2015/internal/operators/mapTo.js": 56800/*!****************************************************************!*\ 56801 !*** ./node_modules/rxjs/_esm2015/internal/operators/mapTo.js ***! 56802 \****************************************************************/ 56803/*! exports provided: mapTo */ 56804/***/ (function(module, __webpack_exports__, __webpack_require__) { 56805 56806"use strict"; 56807__webpack_require__.r(__webpack_exports__); 56808/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return mapTo; }); 56809/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56810 56811function mapTo(value) { 56812 return (source) => source.lift(new MapToOperator(value)); 56813} 56814class MapToOperator { 56815 constructor(value) { 56816 this.value = value; 56817 } 56818 call(subscriber, source) { 56819 return source.subscribe(new MapToSubscriber(subscriber, this.value)); 56820 } 56821} 56822class MapToSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56823 constructor(destination, value) { 56824 super(destination); 56825 this.value = value; 56826 } 56827 _next(x) { 56828 this.destination.next(this.value); 56829 } 56830} 56831//# sourceMappingURL=mapTo.js.map 56832 56833/***/ }), 56834
vendor: 1,969 bytes, lines 56835-56880
56835/***/ "./node_modules/rxjs/_esm2015/internal/operators/materialize.js": 56836/*!**********************************************************************!*\ 56837 !*** ./node_modules/rxjs/_esm2015/internal/operators/materialize.js ***! 56838 \**********************************************************************/ 56839/*! exports provided: materialize */ 56840/***/ (function(module, __webpack_exports__, __webpack_require__) { 56841 56842"use strict"; 56843__webpack_require__.r(__webpack_exports__); 56844/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return materialize; }); 56845/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 56846/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Notification */ "./node_modules/rxjs/_esm2015/internal/Notification.js"); 56847 56848 56849function materialize() { 56850 return function materializeOperatorFunction(source) { 56851 return source.lift(new MaterializeOperator()); 56852 }; 56853} 56854class MaterializeOperator { 56855 call(subscriber, source) { 56856 return source.subscribe(new MaterializeSubscriber(subscriber)); 56857 } 56858} 56859class MaterializeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 56860 constructor(destination) { 56861 super(destination); 56862 } 56863 _next(value) { 56864 this.destination.next(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createNext(value)); 56865 } 56866 _error(err) { 56867 const destination = this.destination; 56868 destination.next(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createError(err)); 56869 destination.complete(); 56870 } 56871 _complete() { 56872 const destination = this.destination; 56873 destination.next(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createComplete()); 56874 destination.complete(); 56875 } 56876} 56877//# sourceMappingURL=materialize.js.map 56878 56879/***/ }), 56880
vendor: 970 bytes, lines 56881-56902
56881/***/ "./node_modules/rxjs/_esm2015/internal/operators/max.js": 56882/*!**************************************************************!*\ 56883 !*** ./node_modules/rxjs/_esm2015/internal/operators/max.js ***! 56884 \**************************************************************/ 56885/*! exports provided: max */ 56886/***/ (function(module, __webpack_exports__, __webpack_require__) { 56887 56888"use strict"; 56889__webpack_require__.r(__webpack_exports__); 56890/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; }); 56891/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "./node_modules/rxjs/_esm2015/internal/operators/reduce.js"); 56892 56893function max(comparer) { 56894 const max = (typeof comparer === 'function') 56895 ? (x, y) => comparer(x, y) > 0 ? x : y 56896 : (x, y) => x > y ? x : y; 56897 return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(max); 56898} 56899//# sourceMappingURL=max.js.map 56900 56901/***/ }), 56902
vendor: 942 bytes, lines 56903-56921
56903/***/ "./node_modules/rxjs/_esm2015/internal/operators/merge.js": 56904/*!****************************************************************!*\ 56905 !*** ./node_modules/rxjs/_esm2015/internal/operators/merge.js ***! 56906 \****************************************************************/ 56907/*! exports provided: merge */ 56908/***/ (function(module, __webpack_exports__, __webpack_require__) { 56909 56910"use strict"; 56911__webpack_require__.r(__webpack_exports__); 56912/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; }); 56913/* harmony import */ var _observable_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/merge */ "./node_modules/rxjs/_esm2015/internal/observable/merge.js"); 56914 56915function merge(...observables) { 56916 return (source) => source.lift.call(Object(_observable_merge__WEBPACK_IMPORTED_MODULE_0__["merge"])(source, ...observables)); 56917} 56918//# sourceMappingURL=merge.js.map 56919 56920/***/ }), 56921
vendor: 1,162 bytes, lines 56922-56942
56922/***/ "./node_modules/rxjs/_esm2015/internal/operators/mergeAll.js": 56923/*!*******************************************************************!*\ 56924 !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeAll.js ***! 56925 \*******************************************************************/ 56926/*! exports provided: mergeAll */ 56927/***/ (function(module, __webpack_exports__, __webpack_require__) { 56928 56929"use strict"; 56930__webpack_require__.r(__webpack_exports__); 56931/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return mergeAll; }); 56932/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "./node_modules/rxjs/_esm2015/internal/operators/mergeMap.js"); 56933/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm2015/internal/util/identity.js"); 56934 56935 56936function mergeAll(concurrent = Number.POSITIVE_INFINITY) { 56937 return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"], concurrent); 56938} 56939//# sourceMappingURL=mergeAll.js.map 56940 56941/***/ }), 56942
vendor: 4,751 bytes, lines 56943-57048
56943/***/ "./node_modules/rxjs/_esm2015/internal/operators/mergeMap.js": 56944/*!*******************************************************************!*\ 56945 !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeMap.js ***! 56946 \*******************************************************************/ 56947/*! exports provided: mergeMap, MergeMapOperator, MergeMapSubscriber */ 56948/***/ (function(module, __webpack_exports__, __webpack_require__) { 56949 56950"use strict"; 56951__webpack_require__.r(__webpack_exports__); 56952/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return mergeMap; }); 56953/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapOperator", function() { return MergeMapOperator; }); 56954/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapSubscriber", function() { return MergeMapSubscriber; }); 56955/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 56956/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 56957/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js"); 56958/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 56959/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 56960 56961 56962 56963 56964 56965function mergeMap(project, resultSelector, concurrent = Number.POSITIVE_INFINITY) { 56966 if (typeof resultSelector === 'function') { 56967 return (source) => source.pipe(mergeMap((a, i) => Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])((b, ii) => resultSelector(a, b, i, ii))), concurrent)); 56968 } 56969 else if (typeof resultSelector === 'number') { 56970 concurrent = resultSelector; 56971 } 56972 return (source) => source.lift(new MergeMapOperator(project, concurrent)); 56973} 56974class MergeMapOperator { 56975 constructor(project, concurrent = Number.POSITIVE_INFINITY) { 56976 this.project = project; 56977 this.concurrent = concurrent; 56978 } 56979 call(observer, source) { 56980 return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent)); 56981 } 56982} 56983class MergeMapSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"] { 56984 constructor(destination, project, concurrent = Number.POSITIVE_INFINITY) { 56985 super(destination); 56986 this.project = project; 56987 this.concurrent = concurrent; 56988 this.hasCompleted = false; 56989 this.buffer = []; 56990 this.active = 0; 56991 this.index = 0; 56992 } 56993 _next(value) { 56994 if (this.active < this.concurrent) { 56995 this._tryNext(value); 56996 } 56997 else { 56998 this.buffer.push(value); 56999 } 57000 } 57001 _tryNext(value) { 57002 let result; 57003 const index = this.index++; 57004 try { 57005 result = this.project(value, index); 57006 } 57007 catch (err) { 57008 this.destination.error(err); 57009 return; 57010 } 57011 this.active++; 57012 this._innerSub(result, value, index); 57013 } 57014 _innerSub(ish, value, index) { 57015 const innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](this, value, index); 57016 const destination = this.destination; 57017 destination.add(innerSubscriber); 57018 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_0__["subscribeToResult"])(this, ish, undefined, undefined, innerSubscriber); 57019 if (innerSubscription !== innerSubscriber) { 57020 destination.add(innerSubscription); 57021 } 57022 } 57023 _complete() { 57024 this.hasCompleted = true; 57025 if (this.active === 0 && this.buffer.length === 0) { 57026 this.destination.complete(); 57027 } 57028 this.unsubscribe(); 57029 } 57030 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 57031 this.destination.next(innerValue); 57032 } 57033 notifyComplete(innerSub) { 57034 const buffer = this.buffer; 57035 this.remove(innerSub); 57036 this.active--; 57037 if (buffer.length > 0) { 57038 this._next(buffer.shift()); 57039 } 57040 else if (this.active === 0 && this.hasCompleted) { 57041 this.destination.complete(); 57042 } 57043 } 57044} 57045//# sourceMappingURL=mergeMap.js.map 57046 57047/***/ }), 57048
vendor: 1,273 bytes, lines 57049-57073
57049/***/ "./node_modules/rxjs/_esm2015/internal/operators/mergeMapTo.js": 57050/*!*********************************************************************!*\ 57051 !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeMapTo.js ***! 57052 \*********************************************************************/ 57053/*! exports provided: mergeMapTo */ 57054/***/ (function(module, __webpack_exports__, __webpack_require__) { 57055 57056"use strict"; 57057__webpack_require__.r(__webpack_exports__); 57058/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return mergeMapTo; }); 57059/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "./node_modules/rxjs/_esm2015/internal/operators/mergeMap.js"); 57060 57061function mergeMapTo(innerObservable, resultSelector, concurrent = Number.POSITIVE_INFINITY) { 57062 if (typeof resultSelector === 'function') { 57063 return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(() => innerObservable, resultSelector, concurrent); 57064 } 57065 if (typeof resultSelector === 'number') { 57066 concurrent = resultSelector; 57067 } 57068 return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(() => innerObservable, concurrent); 57069} 57070//# sourceMappingURL=mergeMapTo.js.map 57071 57072/***/ }), 57073
vendor: 4,538 bytes, lines 57074-57180
57074/***/ "./node_modules/rxjs/_esm2015/internal/operators/mergeScan.js": 57075/*!********************************************************************!*\ 57076 !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeScan.js ***! 57077 \********************************************************************/ 57078/*! exports provided: mergeScan, MergeScanOperator, MergeScanSubscriber */ 57079/***/ (function(module, __webpack_exports__, __webpack_require__) { 57080 57081"use strict"; 57082__webpack_require__.r(__webpack_exports__); 57083/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return mergeScan; }); 57084/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanOperator", function() { return MergeScanOperator; }); 57085/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanSubscriber", function() { return MergeScanSubscriber; }); 57086/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 57087/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 57088/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js"); 57089 57090 57091 57092function mergeScan(accumulator, seed, concurrent = Number.POSITIVE_INFINITY) { 57093 return (source) => source.lift(new MergeScanOperator(accumulator, seed, concurrent)); 57094} 57095class MergeScanOperator { 57096 constructor(accumulator, seed, concurrent) { 57097 this.accumulator = accumulator; 57098 this.seed = seed; 57099 this.concurrent = concurrent; 57100 } 57101 call(subscriber, source) { 57102 return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent)); 57103 } 57104} 57105class MergeScanSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"] { 57106 constructor(destination, accumulator, acc, concurrent) { 57107 super(destination); 57108 this.accumulator = accumulator; 57109 this.acc = acc; 57110 this.concurrent = concurrent; 57111 this.hasValue = false; 57112 this.hasCompleted = false; 57113 this.buffer = []; 57114 this.active = 0; 57115 this.index = 0; 57116 } 57117 _next(value) { 57118 if (this.active < this.concurrent) { 57119 const index = this.index++; 57120 const destination = this.destination; 57121 let ish; 57122 try { 57123 const { accumulator } = this; 57124 ish = accumulator(this.acc, value, index); 57125 } 57126 catch (e) { 57127 return destination.error(e); 57128 } 57129 this.active++; 57130 this._innerSub(ish, value, index); 57131 } 57132 else { 57133 this.buffer.push(value); 57134 } 57135 } 57136 _innerSub(ish, value, index) { 57137 const innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](this, value, index); 57138 const destination = this.destination; 57139 destination.add(innerSubscriber); 57140 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_0__["subscribeToResult"])(this, ish, undefined, undefined, innerSubscriber); 57141 if (innerSubscription !== innerSubscriber) { 57142 destination.add(innerSubscription); 57143 } 57144 } 57145 _complete() { 57146 this.hasCompleted = true; 57147 if (this.active === 0 && this.buffer.length === 0) { 57148 if (this.hasValue === false) { 57149 this.destination.next(this.acc); 57150 } 57151 this.destination.complete(); 57152 } 57153 this.unsubscribe(); 57154 } 57155 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 57156 const { destination } = this; 57157 this.acc = innerValue; 57158 this.hasValue = true; 57159 destination.next(innerValue); 57160 } 57161 notifyComplete(innerSub) { 57162 const buffer = this.buffer; 57163 const destination = this.destination; 57164 destination.remove(innerSub); 57165 this.active--; 57166 if (buffer.length > 0) { 57167 this._next(buffer.shift()); 57168 } 57169 else if (this.active === 0 && this.hasCompleted) { 57170 if (this.hasValue === false) { 57171 this.destination.next(this.acc); 57172 } 57173 this.destination.complete(); 57174 } 57175 } 57176} 57177//# sourceMappingURL=mergeScan.js.map 57178 57179/***/ }), 57180
vendor: 970 bytes, lines 57181-57202
57181/***/ "./node_modules/rxjs/_esm2015/internal/operators/min.js": 57182/*!**************************************************************!*\ 57183 !*** ./node_modules/rxjs/_esm2015/internal/operators/min.js ***! 57184 \**************************************************************/ 57185/*! exports provided: min */ 57186/***/ (function(module, __webpack_exports__, __webpack_require__) { 57187 57188"use strict"; 57189__webpack_require__.r(__webpack_exports__); 57190/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; }); 57191/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "./node_modules/rxjs/_esm2015/internal/operators/reduce.js"); 57192 57193function min(comparer) { 57194 const min = (typeof comparer === 'function') 57195 ? (x, y) => comparer(x, y) < 0 ? x : y 57196 : (x, y) => x < y ? x : y; 57197 return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(min); 57198} 57199//# sourceMappingURL=min.js.map 57200 57201/***/ }), 57202
vendor: 2,267 bytes, lines 57203-57252
57203/***/ "./node_modules/rxjs/_esm2015/internal/operators/multicast.js": 57204/*!********************************************************************!*\ 57205 !*** ./node_modules/rxjs/_esm2015/internal/operators/multicast.js ***! 57206 \********************************************************************/ 57207/*! exports provided: multicast, MulticastOperator */ 57208/***/ (function(module, __webpack_exports__, __webpack_require__) { 57209 57210"use strict"; 57211__webpack_require__.r(__webpack_exports__); 57212/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return multicast; }); 57213/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MulticastOperator", function() { return MulticastOperator; }); 57214/* harmony import */ var _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/ConnectableObservable */ "./node_modules/rxjs/_esm2015/internal/observable/ConnectableObservable.js"); 57215 57216function multicast(subjectOrSubjectFactory, selector) { 57217 return function multicastOperatorFunction(source) { 57218 let subjectFactory; 57219 if (typeof subjectOrSubjectFactory === 'function') { 57220 subjectFactory = subjectOrSubjectFactory; 57221 } 57222 else { 57223 subjectFactory = function subjectFactory() { 57224 return subjectOrSubjectFactory; 57225 }; 57226 } 57227 if (typeof selector === 'function') { 57228 return source.lift(new MulticastOperator(subjectFactory, selector)); 57229 } 57230 const connectable = Object.create(source, _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__["connectableObservableDescriptor"]); 57231 connectable.source = source; 57232 connectable.subjectFactory = subjectFactory; 57233 return connectable; 57234 }; 57235} 57236class MulticastOperator { 57237 constructor(subjectFactory, selector) { 57238 this.subjectFactory = subjectFactory; 57239 this.selector = selector; 57240 } 57241 call(subscriber, source) { 57242 const { selector } = this; 57243 const subject = this.subjectFactory(); 57244 const subscription = selector(subject).subscribe(subscriber); 57245 subscription.add(source.subscribe(subject)); 57246 return subscription; 57247 } 57248} 57249//# sourceMappingURL=multicast.js.map 57250 57251/***/ }), 57252
vendor: 3,131 bytes, lines 57253-57320
57253/***/ "./node_modules/rxjs/_esm2015/internal/operators/observeOn.js": 57254/*!********************************************************************!*\ 57255 !*** ./node_modules/rxjs/_esm2015/internal/operators/observeOn.js ***! 57256 \********************************************************************/ 57257/*! exports provided: observeOn, ObserveOnOperator, ObserveOnSubscriber, ObserveOnMessage */ 57258/***/ (function(module, __webpack_exports__, __webpack_require__) { 57259 57260"use strict"; 57261__webpack_require__.r(__webpack_exports__); 57262/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return observeOn; }); 57263/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnOperator", function() { return ObserveOnOperator; }); 57264/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnSubscriber", function() { return ObserveOnSubscriber; }); 57265/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnMessage", function() { return ObserveOnMessage; }); 57266/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 57267/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Notification */ "./node_modules/rxjs/_esm2015/internal/Notification.js"); 57268 57269 57270function observeOn(scheduler, delay = 0) { 57271 return function observeOnOperatorFunction(source) { 57272 return source.lift(new ObserveOnOperator(scheduler, delay)); 57273 }; 57274} 57275class ObserveOnOperator { 57276 constructor(scheduler, delay = 0) { 57277 this.scheduler = scheduler; 57278 this.delay = delay; 57279 } 57280 call(subscriber, source) { 57281 return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay)); 57282 } 57283} 57284class ObserveOnSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 57285 constructor(destination, scheduler, delay = 0) { 57286 super(destination); 57287 this.scheduler = scheduler; 57288 this.delay = delay; 57289 } 57290 static dispatch(arg) { 57291 const { notification, destination } = arg; 57292 notification.observe(destination); 57293 this.unsubscribe(); 57294 } 57295 scheduleMessage(notification) { 57296 const destination = this.destination; 57297 destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination))); 57298 } 57299 _next(value) { 57300 this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createNext(value)); 57301 } 57302 _error(err) { 57303 this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createError(err)); 57304 this.unsubscribe(); 57305 } 57306 _complete() { 57307 this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createComplete()); 57308 this.unsubscribe(); 57309 } 57310} 57311class ObserveOnMessage { 57312 constructor(notification, destination) { 57313 this.notification = notification; 57314 this.destination = destination; 57315 } 57316} 57317//# sourceMappingURL=observeOn.js.map 57318 57319/***/ }), 57320
vendor: 4,032 bytes, lines 57321-57403
57321/***/ "./node_modules/rxjs/_esm2015/internal/operators/onErrorResumeNext.js": 57322/*!****************************************************************************!*\ 57323 !*** ./node_modules/rxjs/_esm2015/internal/operators/onErrorResumeNext.js ***! 57324 \****************************************************************************/ 57325/*! exports provided: onErrorResumeNext, onErrorResumeNextStatic */ 57326/***/ (function(module, __webpack_exports__, __webpack_require__) { 57327 57328"use strict"; 57329__webpack_require__.r(__webpack_exports__); 57330/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; }); 57331/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNextStatic", function() { return onErrorResumeNextStatic; }); 57332/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 57333/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 57334/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 57335/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js"); 57336/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 57337 57338 57339 57340 57341 57342function onErrorResumeNext(...nextSources) { 57343 if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(nextSources[0])) { 57344 nextSources = nextSources[0]; 57345 } 57346 return (source) => source.lift(new OnErrorResumeNextOperator(nextSources)); 57347} 57348function onErrorResumeNextStatic(...nextSources) { 57349 let source = null; 57350 if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(nextSources[0])) { 57351 nextSources = nextSources[0]; 57352 } 57353 source = nextSources.shift(); 57354 return Object(_observable_from__WEBPACK_IMPORTED_MODULE_0__["from"])(source, null).lift(new OnErrorResumeNextOperator(nextSources)); 57355} 57356class OnErrorResumeNextOperator { 57357 constructor(nextSources) { 57358 this.nextSources = nextSources; 57359 } 57360 call(subscriber, source) { 57361 return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources)); 57362 } 57363} 57364class OnErrorResumeNextSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] { 57365 constructor(destination, nextSources) { 57366 super(destination); 57367 this.destination = destination; 57368 this.nextSources = nextSources; 57369 } 57370 notifyError(error, innerSub) { 57371 this.subscribeToNextSource(); 57372 } 57373 notifyComplete(innerSub) { 57374 this.subscribeToNextSource(); 57375 } 57376 _error(err) { 57377 this.subscribeToNextSource(); 57378 this.unsubscribe(); 57379 } 57380 _complete() { 57381 this.subscribeToNextSource(); 57382 this.unsubscribe(); 57383 } 57384 subscribeToNextSource() { 57385 const next = this.nextSources.shift(); 57386 if (!!next) { 57387 const innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__["InnerSubscriber"](this, undefined, undefined); 57388 const destination = this.destination; 57389 destination.add(innerSubscriber); 57390 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, next, undefined, undefined, innerSubscriber); 57391 if (innerSubscription !== innerSubscriber) { 57392 destination.add(innerSubscription); 57393 } 57394 } 57395 else { 57396 this.destination.complete(); 57397 } 57398 } 57399} 57400//# sourceMappingURL=onErrorResumeNext.js.map 57401 57402/***/ }), 57403
vendor: 1,463 bytes, lines 57404-57446
57404/***/ "./node_modules/rxjs/_esm2015/internal/operators/pairwise.js": 57405/*!*******************************************************************!*\ 57406 !*** ./node_modules/rxjs/_esm2015/internal/operators/pairwise.js ***! 57407 \*******************************************************************/ 57408/*! exports provided: pairwise */ 57409/***/ (function(module, __webpack_exports__, __webpack_require__) { 57410 57411"use strict"; 57412__webpack_require__.r(__webpack_exports__); 57413/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return pairwise; }); 57414/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 57415 57416function pairwise() { 57417 return (source) => source.lift(new PairwiseOperator()); 57418} 57419class PairwiseOperator { 57420 call(subscriber, source) { 57421 return source.subscribe(new PairwiseSubscriber(subscriber)); 57422 } 57423} 57424class PairwiseSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 57425 constructor(destination) { 57426 super(destination); 57427 this.hasPrev = false; 57428 } 57429 _next(value) { 57430 let pair; 57431 if (this.hasPrev) { 57432 pair = [this.prev, value]; 57433 } 57434 else { 57435 this.hasPrev = true; 57436 } 57437 this.prev = value; 57438 if (pair) { 57439 this.destination.next(pair); 57440 } 57441 } 57442} 57443//# sourceMappingURL=pairwise.js.map 57444 57445/***/ }), 57446
vendor: 1,261 bytes, lines 57447-57470
57447/***/ "./node_modules/rxjs/_esm2015/internal/operators/partition.js": 57448/*!********************************************************************!*\ 57449 !*** ./node_modules/rxjs/_esm2015/internal/operators/partition.js ***! 57450 \********************************************************************/ 57451/*! exports provided: partition */ 57452/***/ (function(module, __webpack_exports__, __webpack_require__) { 57453 57454"use strict"; 57455__webpack_require__.r(__webpack_exports__); 57456/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; }); 57457/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/not */ "./node_modules/rxjs/_esm2015/internal/util/not.js"); 57458/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "./node_modules/rxjs/_esm2015/internal/operators/filter.js"); 57459 57460 57461function partition(predicate, thisArg) { 57462 return (source) => [ 57463 Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(predicate, thisArg)(source), 57464 Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(source) 57465 ]; 57466} 57467//# sourceMappingURL=partition.js.map 57468 57469/***/ }), 57470
vendor: 1,426 bytes, lines 57471-57509
57471/***/ "./node_modules/rxjs/_esm2015/internal/operators/pluck.js": 57472/*!****************************************************************!*\ 57473 !*** ./node_modules/rxjs/_esm2015/internal/operators/pluck.js ***! 57474 \****************************************************************/ 57475/*! exports provided: pluck */ 57476/***/ (function(module, __webpack_exports__, __webpack_require__) { 57477 57478"use strict"; 57479__webpack_require__.r(__webpack_exports__); 57480/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return pluck; }); 57481/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 57482 57483function pluck(...properties) { 57484 const length = properties.length; 57485 if (length === 0) { 57486 throw new Error('list of properties cannot be empty.'); 57487 } 57488 return (source) => Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])(plucker(properties, length))(source); 57489} 57490function plucker(props, length) { 57491 const mapper = (x) => { 57492 let currentProp = x; 57493 for (let i = 0; i < length; i++) { 57494 const p = currentProp[props[i]]; 57495 if (typeof p !== 'undefined') { 57496 currentProp = p; 57497 } 57498 else { 57499 return undefined; 57500 } 57501 } 57502 return currentProp; 57503 }; 57504 return mapper; 57505} 57506//# sourceMappingURL=pluck.js.map 57507 57508/***/ }), 57509
vendor: 1,260 bytes, lines 57510-57532
57510/***/ "./node_modules/rxjs/_esm2015/internal/operators/publish.js": 57511/*!******************************************************************!*\ 57512 !*** ./node_modules/rxjs/_esm2015/internal/operators/publish.js ***! 57513 \******************************************************************/ 57514/*! exports provided: publish */ 57515/***/ (function(module, __webpack_exports__, __webpack_require__) { 57516 57517"use strict"; 57518__webpack_require__.r(__webpack_exports__); 57519/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; }); 57520/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 57521/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm2015/internal/operators/multicast.js"); 57522 57523 57524function publish(selector) { 57525 return selector ? 57526 Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(() => new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](), selector) : 57527 Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]()); 57528} 57529//# sourceMappingURL=publish.js.map 57530 57531/***/ }), 57532
vendor: 1,232 bytes, lines 57533-57553
57533/***/ "./node_modules/rxjs/_esm2015/internal/operators/publishBehavior.js": 57534/*!**************************************************************************!*\ 57535 !*** ./node_modules/rxjs/_esm2015/internal/operators/publishBehavior.js ***! 57536 \**************************************************************************/ 57537/*! exports provided: publishBehavior */ 57538/***/ (function(module, __webpack_exports__, __webpack_require__) { 57539 57540"use strict"; 57541__webpack_require__.r(__webpack_exports__); 57542/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; }); 57543/* harmony import */ var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../BehaviorSubject */ "./node_modules/rxjs/_esm2015/internal/BehaviorSubject.js"); 57544/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm2015/internal/operators/multicast.js"); 57545 57546 57547function publishBehavior(value) { 57548 return (source) => Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__["BehaviorSubject"](value))(source); 57549} 57550//# sourceMappingURL=publishBehavior.js.map 57551 57552/***/ }), 57553
vendor: 1,171 bytes, lines 57554-57574
57554/***/ "./node_modules/rxjs/_esm2015/internal/operators/publishLast.js": 57555/*!**********************************************************************!*\ 57556 !*** ./node_modules/rxjs/_esm2015/internal/operators/publishLast.js ***! 57557 \**********************************************************************/ 57558/*! exports provided: publishLast */ 57559/***/ (function(module, __webpack_exports__, __webpack_require__) { 57560 57561"use strict"; 57562__webpack_require__.r(__webpack_exports__); 57563/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; }); 57564/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AsyncSubject */ "./node_modules/rxjs/_esm2015/internal/AsyncSubject.js"); 57565/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm2015/internal/operators/multicast.js"); 57566 57567 57568function publishLast() { 57569 return (source) => Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__["AsyncSubject"]())(source); 57570} 57571//# sourceMappingURL=publishLast.js.map 57572 57573/***/ }), 57574
vendor: 1,547 bytes, lines 57575-57600
57575/***/ "./node_modules/rxjs/_esm2015/internal/operators/publishReplay.js": 57576/*!************************************************************************!*\ 57577 !*** ./node_modules/rxjs/_esm2015/internal/operators/publishReplay.js ***! 57578 \************************************************************************/ 57579/*! exports provided: publishReplay */ 57580/***/ (function(module, __webpack_exports__, __webpack_require__) { 57581 57582"use strict"; 57583__webpack_require__.r(__webpack_exports__); 57584/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; }); 57585/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ReplaySubject */ "./node_modules/rxjs/_esm2015/internal/ReplaySubject.js"); 57586/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm2015/internal/operators/multicast.js"); 57587 57588 57589function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) { 57590 if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') { 57591 scheduler = selectorOrScheduler; 57592 } 57593 const selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined; 57594 const subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler); 57595 return (source) => Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(() => subject, selector)(source); 57596} 57597//# sourceMappingURL=publishReplay.js.map 57598 57599/***/ }), 57600
vendor: 1,323 bytes, lines 57601-57626
57601/***/ "./node_modules/rxjs/_esm2015/internal/operators/race.js": 57602/*!***************************************************************!*\ 57603 !*** ./node_modules/rxjs/_esm2015/internal/operators/race.js ***! 57604 \***************************************************************/ 57605/*! exports provided: race */ 57606/***/ (function(module, __webpack_exports__, __webpack_require__) { 57607 57608"use strict"; 57609__webpack_require__.r(__webpack_exports__); 57610/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; }); 57611/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 57612/* harmony import */ var _observable_race__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/race */ "./node_modules/rxjs/_esm2015/internal/observable/race.js"); 57613 57614 57615function race(...observables) { 57616 return function raceOperatorFunction(source) { 57617 if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) { 57618 observables = observables[0]; 57619 } 57620 return source.lift.call(Object(_observable_race__WEBPACK_IMPORTED_MODULE_1__["race"])(source, ...observables)); 57621 }; 57622} 57623//# sourceMappingURL=race.js.map 57624 57625/***/ }), 57626
vendor: 2,041 bytes, lines 57627-57658
57627/***/ "./node_modules/rxjs/_esm2015/internal/operators/reduce.js": 57628/*!*****************************************************************!*\ 57629 !*** ./node_modules/rxjs/_esm2015/internal/operators/reduce.js ***! 57630 \*****************************************************************/ 57631/*! exports provided: reduce */ 57632/***/ (function(module, __webpack_exports__, __webpack_require__) { 57633 57634"use strict"; 57635__webpack_require__.r(__webpack_exports__); 57636/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; }); 57637/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scan */ "./node_modules/rxjs/_esm2015/internal/operators/scan.js"); 57638/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./takeLast */ "./node_modules/rxjs/_esm2015/internal/operators/takeLast.js"); 57639/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./defaultIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js"); 57640/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/pipe */ "./node_modules/rxjs/_esm2015/internal/util/pipe.js"); 57641 57642 57643 57644 57645function reduce(accumulator, seed) { 57646 if (arguments.length >= 2) { 57647 return function reduceOperatorFunctionWithSeed(source) { 57648 return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(accumulator, seed), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1), Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__["defaultIfEmpty"])(seed))(source); 57649 }; 57650 } 57651 return function reduceOperatorFunction(source) { 57652 return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])((acc, value, index) => accumulator(acc, value, index + 1)), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1))(source); 57653 }; 57654} 57655//# sourceMappingURL=reduce.js.map 57656 57657/***/ }), 57658
vendor: 2,356 bytes, lines 57659-57724
57659/***/ "./node_modules/rxjs/_esm2015/internal/operators/refCount.js": 57660/*!*******************************************************************!*\ 57661 !*** ./node_modules/rxjs/_esm2015/internal/operators/refCount.js ***! 57662 \*******************************************************************/ 57663/*! exports provided: refCount */ 57664/***/ (function(module, __webpack_exports__, __webpack_require__) { 57665 57666"use strict"; 57667__webpack_require__.r(__webpack_exports__); 57668/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return refCount; }); 57669/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 57670 57671function refCount() { 57672 return function refCountOperatorFunction(source) { 57673 return source.lift(new RefCountOperator(source)); 57674 }; 57675} 57676class RefCountOperator { 57677 constructor(connectable) { 57678 this.connectable = connectable; 57679 } 57680 call(subscriber, source) { 57681 const { connectable } = this; 57682 connectable._refCount++; 57683 const refCounter = new RefCountSubscriber(subscriber, connectable); 57684 const subscription = source.subscribe(refCounter); 57685 if (!refCounter.closed) { 57686 refCounter.connection = connectable.connect(); 57687 } 57688 return subscription; 57689 } 57690} 57691class RefCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 57692 constructor(destination, connectable) { 57693 super(destination); 57694 this.connectable = connectable; 57695 } 57696 _unsubscribe() { 57697 const { connectable } = this; 57698 if (!connectable) { 57699 this.connection = null; 57700 return; 57701 } 57702 this.connectable = null; 57703 const refCount = connectable._refCount; 57704 if (refCount <= 0) { 57705 this.connection = null; 57706 return; 57707 } 57708 connectable._refCount = refCount - 1; 57709 if (refCount > 1) { 57710 this.connection = null; 57711 return; 57712 } 57713 const { connection } = this; 57714 const sharedConnection = connectable._connection; 57715 this.connection = null; 57716 if (sharedConnection && (!connection || sharedConnection === connection)) { 57717 sharedConnection.unsubscribe(); 57718 } 57719 } 57720} 57721//# sourceMappingURL=refCount.js.map 57722 57723/***/ }), 57724
vendor: 2,161 bytes, lines 57725-57783
57725/***/ "./node_modules/rxjs/_esm2015/internal/operators/repeat.js": 57726/*!*****************************************************************!*\ 57727 !*** ./node_modules/rxjs/_esm2015/internal/operators/repeat.js ***! 57728 \*****************************************************************/ 57729/*! exports provided: repeat */ 57730/***/ (function(module, __webpack_exports__, __webpack_require__) { 57731 57732"use strict"; 57733__webpack_require__.r(__webpack_exports__); 57734/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); 57735/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 57736/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 57737 57738 57739function repeat(count = -1) { 57740 return (source) => { 57741 if (count === 0) { 57742 return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_1__["empty"])(); 57743 } 57744 else if (count < 0) { 57745 return source.lift(new RepeatOperator(-1, source)); 57746 } 57747 else { 57748 return source.lift(new RepeatOperator(count - 1, source)); 57749 } 57750 }; 57751} 57752class RepeatOperator { 57753 constructor(count, source) { 57754 this.count = count; 57755 this.source = source; 57756 } 57757 call(subscriber, source) { 57758 return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source)); 57759 } 57760} 57761class RepeatSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 57762 constructor(destination, count, source) { 57763 super(destination); 57764 this.count = count; 57765 this.source = source; 57766 } 57767 complete() { 57768 if (!this.isStopped) { 57769 const { source, count } = this; 57770 if (count === 0) { 57771 return super.complete(); 57772 } 57773 else if (count > -1) { 57774 this.count = count - 1; 57775 } 57776 source.subscribe(this._unsubscribeAndRecycle()); 57777 } 57778 } 57779} 57780//# sourceMappingURL=repeat.js.map 57781 57782/***/ }), 57783
vendor: 3,599 bytes, lines 57784-57876
57784/***/ "./node_modules/rxjs/_esm2015/internal/operators/repeatWhen.js": 57785/*!*********************************************************************!*\ 57786 !*** ./node_modules/rxjs/_esm2015/internal/operators/repeatWhen.js ***! 57787 \*********************************************************************/ 57788/*! exports provided: repeatWhen */ 57789/***/ (function(module, __webpack_exports__, __webpack_require__) { 57790 57791"use strict"; 57792__webpack_require__.r(__webpack_exports__); 57793/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return repeatWhen; }); 57794/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 57795/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 57796/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 57797 57798 57799 57800function repeatWhen(notifier) { 57801 return (source) => source.lift(new RepeatWhenOperator(notifier)); 57802} 57803class RepeatWhenOperator { 57804 constructor(notifier) { 57805 this.notifier = notifier; 57806 } 57807 call(subscriber, source) { 57808 return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source)); 57809 } 57810} 57811class RepeatWhenSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"] { 57812 constructor(destination, notifier, source) { 57813 super(destination); 57814 this.notifier = notifier; 57815 this.source = source; 57816 this.sourceIsBeingSubscribedTo = true; 57817 } 57818 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 57819 this.sourceIsBeingSubscribedTo = true; 57820 this.source.subscribe(this); 57821 } 57822 notifyComplete(innerSub) { 57823 if (this.sourceIsBeingSubscribedTo === false) { 57824 return super.complete(); 57825 } 57826 } 57827 complete() { 57828 this.sourceIsBeingSubscribedTo = false; 57829 if (!this.isStopped) { 57830 if (!this.retries) { 57831 this.subscribeToRetries(); 57832 } 57833 if (!this.retriesSubscription || this.retriesSubscription.closed) { 57834 return super.complete(); 57835 } 57836 this._unsubscribeAndRecycle(); 57837 this.notifications.next(); 57838 } 57839 } 57840 _unsubscribe() { 57841 const { notifications, retriesSubscription } = this; 57842 if (notifications) { 57843 notifications.unsubscribe(); 57844 this.notifications = null; 57845 } 57846 if (retriesSubscription) { 57847 retriesSubscription.unsubscribe(); 57848 this.retriesSubscription = null; 57849 } 57850 this.retries = null; 57851 } 57852 _unsubscribeAndRecycle() { 57853 const { _unsubscribe } = this; 57854 this._unsubscribe = null; 57855 super._unsubscribeAndRecycle(); 57856 this._unsubscribe = _unsubscribe; 57857 return this; 57858 } 57859 subscribeToRetries() { 57860 this.notifications = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); 57861 let retries; 57862 try { 57863 const { notifier } = this; 57864 retries = notifier(this.notifications); 57865 } 57866 catch (e) { 57867 return super.complete(); 57868 } 57869 this.retries = retries; 57870 this.retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, retries); 57871 } 57872} 57873//# sourceMappingURL=repeatWhen.js.map 57874 57875/***/ }), 57876
vendor: 1,680 bytes, lines 57877-57923
57877/***/ "./node_modules/rxjs/_esm2015/internal/operators/retry.js": 57878/*!****************************************************************!*\ 57879 !*** ./node_modules/rxjs/_esm2015/internal/operators/retry.js ***! 57880 \****************************************************************/ 57881/*! exports provided: retry */ 57882/***/ (function(module, __webpack_exports__, __webpack_require__) { 57883 57884"use strict"; 57885__webpack_require__.r(__webpack_exports__); 57886/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; }); 57887/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 57888 57889function retry(count = -1) { 57890 return (source) => source.lift(new RetryOperator(count, source)); 57891} 57892class RetryOperator { 57893 constructor(count, source) { 57894 this.count = count; 57895 this.source = source; 57896 } 57897 call(subscriber, source) { 57898 return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source)); 57899 } 57900} 57901class RetrySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 57902 constructor(destination, count, source) { 57903 super(destination); 57904 this.count = count; 57905 this.source = source; 57906 } 57907 error(err) { 57908 if (!this.isStopped) { 57909 const { source, count } = this; 57910 if (count === 0) { 57911 return super.error(err); 57912 } 57913 else if (count > -1) { 57914 this.count = count - 1; 57915 } 57916 source.subscribe(this._unsubscribeAndRecycle()); 57917 } 57918 } 57919} 57920//# sourceMappingURL=retry.js.map 57921 57922/***/ }), 57923
vendor: 3,421 bytes, lines 57924-58008
57924/***/ "./node_modules/rxjs/_esm2015/internal/operators/retryWhen.js": 57925/*!********************************************************************!*\ 57926 !*** ./node_modules/rxjs/_esm2015/internal/operators/retryWhen.js ***! 57927 \********************************************************************/ 57928/*! exports provided: retryWhen */ 57929/***/ (function(module, __webpack_exports__, __webpack_require__) { 57930 57931"use strict"; 57932__webpack_require__.r(__webpack_exports__); 57933/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return retryWhen; }); 57934/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 57935/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 57936/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 57937 57938 57939 57940function retryWhen(notifier) { 57941 return (source) => source.lift(new RetryWhenOperator(notifier, source)); 57942} 57943class RetryWhenOperator { 57944 constructor(notifier, source) { 57945 this.notifier = notifier; 57946 this.source = source; 57947 } 57948 call(subscriber, source) { 57949 return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source)); 57950 } 57951} 57952class RetryWhenSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"] { 57953 constructor(destination, notifier, source) { 57954 super(destination); 57955 this.notifier = notifier; 57956 this.source = source; 57957 } 57958 error(err) { 57959 if (!this.isStopped) { 57960 let errors = this.errors; 57961 let retries = this.retries; 57962 let retriesSubscription = this.retriesSubscription; 57963 if (!retries) { 57964 errors = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); 57965 try { 57966 const { notifier } = this; 57967 retries = notifier(errors); 57968 } 57969 catch (e) { 57970 return super.error(e); 57971 } 57972 retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, retries); 57973 } 57974 else { 57975 this.errors = null; 57976 this.retriesSubscription = null; 57977 } 57978 this._unsubscribeAndRecycle(); 57979 this.errors = errors; 57980 this.retries = retries; 57981 this.retriesSubscription = retriesSubscription; 57982 errors.next(err); 57983 } 57984 } 57985 _unsubscribe() { 57986 const { errors, retriesSubscription } = this; 57987 if (errors) { 57988 errors.unsubscribe(); 57989 this.errors = null; 57990 } 57991 if (retriesSubscription) { 57992 retriesSubscription.unsubscribe(); 57993 this.retriesSubscription = null; 57994 } 57995 this.retries = null; 57996 } 57997 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 57998 const { _unsubscribe } = this; 57999 this._unsubscribe = null; 58000 this._unsubscribeAndRecycle(); 58001 this._unsubscribe = _unsubscribe; 58002 this.source.subscribe(this); 58003 } 58004} 58005//# sourceMappingURL=retryWhen.js.map 58006 58007/***/ }), 58008
vendor: 2,089 bytes, lines 58009-58062
58009/***/ "./node_modules/rxjs/_esm2015/internal/operators/sample.js": 58010/*!*****************************************************************!*\ 58011 !*** ./node_modules/rxjs/_esm2015/internal/operators/sample.js ***! 58012 \*****************************************************************/ 58013/*! exports provided: sample */ 58014/***/ (function(module, __webpack_exports__, __webpack_require__) { 58015 58016"use strict"; 58017__webpack_require__.r(__webpack_exports__); 58018/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return sample; }); 58019/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 58020/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 58021 58022 58023function sample(notifier) { 58024 return (source) => source.lift(new SampleOperator(notifier)); 58025} 58026class SampleOperator { 58027 constructor(notifier) { 58028 this.notifier = notifier; 58029 } 58030 call(subscriber, source) { 58031 const sampleSubscriber = new SampleSubscriber(subscriber); 58032 const subscription = source.subscribe(sampleSubscriber); 58033 subscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(sampleSubscriber, this.notifier)); 58034 return subscription; 58035 } 58036} 58037class SampleSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 58038 constructor() { 58039 super(...arguments); 58040 this.hasValue = false; 58041 } 58042 _next(value) { 58043 this.value = value; 58044 this.hasValue = true; 58045 } 58046 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 58047 this.emitValue(); 58048 } 58049 notifyComplete() { 58050 this.emitValue(); 58051 } 58052 emitValue() { 58053 if (this.hasValue) { 58054 this.hasValue = false; 58055 this.destination.next(this.value); 58056 } 58057 } 58058} 58059//# sourceMappingURL=sample.js.map 58060 58061/***/ }), 58062
vendor: 2,188 bytes, lines 58063-58116
58063/***/ "./node_modules/rxjs/_esm2015/internal/operators/sampleTime.js": 58064/*!*********************************************************************!*\ 58065 !*** ./node_modules/rxjs/_esm2015/internal/operators/sampleTime.js ***! 58066 \*********************************************************************/ 58067/*! exports provided: sampleTime */ 58068/***/ (function(module, __webpack_exports__, __webpack_require__) { 58069 58070"use strict"; 58071__webpack_require__.r(__webpack_exports__); 58072/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return sampleTime; }); 58073/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58074/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 58075 58076 58077function sampleTime(period, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]) { 58078 return (source) => source.lift(new SampleTimeOperator(period, scheduler)); 58079} 58080class SampleTimeOperator { 58081 constructor(period, scheduler) { 58082 this.period = period; 58083 this.scheduler = scheduler; 58084 } 58085 call(subscriber, source) { 58086 return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler)); 58087 } 58088} 58089class SampleTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58090 constructor(destination, period, scheduler) { 58091 super(destination); 58092 this.period = period; 58093 this.scheduler = scheduler; 58094 this.hasValue = false; 58095 this.add(scheduler.schedule(dispatchNotification, period, { subscriber: this, period })); 58096 } 58097 _next(value) { 58098 this.lastValue = value; 58099 this.hasValue = true; 58100 } 58101 notifyNext() { 58102 if (this.hasValue) { 58103 this.hasValue = false; 58104 this.destination.next(this.lastValue); 58105 } 58106 } 58107} 58108function dispatchNotification(state) { 58109 let { subscriber, period } = state; 58110 subscriber.notifyNext(); 58111 this.schedule(state, period); 58112} 58113//# sourceMappingURL=sampleTime.js.map 58114 58115/***/ }), 58116
vendor: 2,290 bytes, lines 58117-58188
58117/***/ "./node_modules/rxjs/_esm2015/internal/operators/scan.js": 58118/*!***************************************************************!*\ 58119 !*** ./node_modules/rxjs/_esm2015/internal/operators/scan.js ***! 58120 \***************************************************************/ 58121/*! exports provided: scan */ 58122/***/ (function(module, __webpack_exports__, __webpack_require__) { 58123 58124"use strict"; 58125__webpack_require__.r(__webpack_exports__); 58126/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return scan; }); 58127/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58128 58129function scan(accumulator, seed) { 58130 let hasSeed = false; 58131 if (arguments.length >= 2) { 58132 hasSeed = true; 58133 } 58134 return function scanOperatorFunction(source) { 58135 return source.lift(new ScanOperator(accumulator, seed, hasSeed)); 58136 }; 58137} 58138class ScanOperator { 58139 constructor(accumulator, seed, hasSeed = false) { 58140 this.accumulator = accumulator; 58141 this.seed = seed; 58142 this.hasSeed = hasSeed; 58143 } 58144 call(subscriber, source) { 58145 return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed)); 58146 } 58147} 58148class ScanSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58149 constructor(destination, accumulator, _seed, hasSeed) { 58150 super(destination); 58151 this.accumulator = accumulator; 58152 this._seed = _seed; 58153 this.hasSeed = hasSeed; 58154 this.index = 0; 58155 } 58156 get seed() { 58157 return this._seed; 58158 } 58159 set seed(value) { 58160 this.hasSeed = true; 58161 this._seed = value; 58162 } 58163 _next(value) { 58164 if (!this.hasSeed) { 58165 this.seed = value; 58166 this.destination.next(value); 58167 } 58168 else { 58169 return this._tryNext(value); 58170 } 58171 } 58172 _tryNext(value) { 58173 const index = this.index++; 58174 let result; 58175 try { 58176 result = this.accumulator(this.seed, value, index); 58177 } 58178 catch (err) { 58179 this.destination.error(err); 58180 } 58181 this.seed = result; 58182 this.destination.next(result); 58183 } 58184} 58185//# sourceMappingURL=scan.js.map 58186 58187/***/ }), 58188
vendor: 3,946 bytes, lines 58189-58303
58189/***/ "./node_modules/rxjs/_esm2015/internal/operators/sequenceEqual.js": 58190/*!************************************************************************!*\ 58191 !*** ./node_modules/rxjs/_esm2015/internal/operators/sequenceEqual.js ***! 58192 \************************************************************************/ 58193/*! exports provided: sequenceEqual, SequenceEqualOperator, SequenceEqualSubscriber */ 58194/***/ (function(module, __webpack_exports__, __webpack_require__) { 58195 58196"use strict"; 58197__webpack_require__.r(__webpack_exports__); 58198/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return sequenceEqual; }); 58199/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualOperator", function() { return SequenceEqualOperator; }); 58200/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualSubscriber", function() { return SequenceEqualSubscriber; }); 58201/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58202 58203function sequenceEqual(compareTo, comparator) { 58204 return (source) => source.lift(new SequenceEqualOperator(compareTo, comparator)); 58205} 58206class SequenceEqualOperator { 58207 constructor(compareTo, comparator) { 58208 this.compareTo = compareTo; 58209 this.comparator = comparator; 58210 } 58211 call(subscriber, source) { 58212 return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparator)); 58213 } 58214} 58215class SequenceEqualSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58216 constructor(destination, compareTo, comparator) { 58217 super(destination); 58218 this.compareTo = compareTo; 58219 this.comparator = comparator; 58220 this._a = []; 58221 this._b = []; 58222 this._oneComplete = false; 58223 this.destination.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, this))); 58224 } 58225 _next(value) { 58226 if (this._oneComplete && this._b.length === 0) { 58227 this.emit(false); 58228 } 58229 else { 58230 this._a.push(value); 58231 this.checkValues(); 58232 } 58233 } 58234 _complete() { 58235 if (this._oneComplete) { 58236 this.emit(this._a.length === 0 && this._b.length === 0); 58237 } 58238 else { 58239 this._oneComplete = true; 58240 } 58241 this.unsubscribe(); 58242 } 58243 checkValues() { 58244 const { _a, _b, comparator } = this; 58245 while (_a.length > 0 && _b.length > 0) { 58246 let a = _a.shift(); 58247 let b = _b.shift(); 58248 let areEqual = false; 58249 try { 58250 areEqual = comparator ? comparator(a, b) : a === b; 58251 } 58252 catch (e) { 58253 this.destination.error(e); 58254 } 58255 if (!areEqual) { 58256 this.emit(false); 58257 } 58258 } 58259 } 58260 emit(value) { 58261 const { destination } = this; 58262 destination.next(value); 58263 destination.complete(); 58264 } 58265 nextB(value) { 58266 if (this._oneComplete && this._a.length === 0) { 58267 this.emit(false); 58268 } 58269 else { 58270 this._b.push(value); 58271 this.checkValues(); 58272 } 58273 } 58274 completeB() { 58275 if (this._oneComplete) { 58276 this.emit(this._a.length === 0 && this._b.length === 0); 58277 } 58278 else { 58279 this._oneComplete = true; 58280 } 58281 } 58282} 58283class SequenceEqualCompareToSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58284 constructor(destination, parent) { 58285 super(destination); 58286 this.parent = parent; 58287 } 58288 _next(value) { 58289 this.parent.nextB(value); 58290 } 58291 _error(err) { 58292 this.parent.error(err); 58293 this.unsubscribe(); 58294 } 58295 _complete() { 58296 this.parent.completeB(); 58297 this.unsubscribe(); 58298 } 58299} 58300//# sourceMappingURL=sequenceEqual.js.map 58301 58302/***/ }), 58303
vendor: 1,390 bytes, lines 58304-58329
58304/***/ "./node_modules/rxjs/_esm2015/internal/operators/share.js": 58305/*!****************************************************************!*\ 58306 !*** ./node_modules/rxjs/_esm2015/internal/operators/share.js ***! 58307 \****************************************************************/ 58308/*! exports provided: share */ 58309/***/ (function(module, __webpack_exports__, __webpack_require__) { 58310 58311"use strict"; 58312__webpack_require__.r(__webpack_exports__); 58313/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return share; }); 58314/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./multicast */ "./node_modules/rxjs/_esm2015/internal/operators/multicast.js"); 58315/* harmony import */ var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./refCount */ "./node_modules/rxjs/_esm2015/internal/operators/refCount.js"); 58316/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 58317 58318 58319 58320function shareSubjectFactory() { 58321 return new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"](); 58322} 58323function share() { 58324 return (source) => Object(_refCount__WEBPACK_IMPORTED_MODULE_1__["refCount"])()(Object(_multicast__WEBPACK_IMPORTED_MODULE_0__["multicast"])(shareSubjectFactory)(source)); 58325} 58326//# sourceMappingURL=share.js.map 58327 58328/***/ }), 58329
vendor: 2,565 bytes, lines 58330-58396
58330/***/ "./node_modules/rxjs/_esm2015/internal/operators/shareReplay.js": 58331/*!**********************************************************************!*\ 58332 !*** ./node_modules/rxjs/_esm2015/internal/operators/shareReplay.js ***! 58333 \**********************************************************************/ 58334/*! exports provided: shareReplay */ 58335/***/ (function(module, __webpack_exports__, __webpack_require__) { 58336 58337"use strict"; 58338__webpack_require__.r(__webpack_exports__); 58339/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return shareReplay; }); 58340/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ReplaySubject */ "./node_modules/rxjs/_esm2015/internal/ReplaySubject.js"); 58341 58342function shareReplay(configOrBufferSize, windowTime, scheduler) { 58343 let config; 58344 if (configOrBufferSize && typeof configOrBufferSize === 'object') { 58345 config = configOrBufferSize; 58346 } 58347 else { 58348 config = { 58349 bufferSize: configOrBufferSize, 58350 windowTime, 58351 refCount: false, 58352 scheduler 58353 }; 58354 } 58355 return (source) => source.lift(shareReplayOperator(config)); 58356} 58357function shareReplayOperator({ bufferSize = Number.POSITIVE_INFINITY, windowTime = Number.POSITIVE_INFINITY, refCount: useRefCount, scheduler }) { 58358 let subject; 58359 let refCount = 0; 58360 let subscription; 58361 let hasError = false; 58362 let isComplete = false; 58363 return function shareReplayOperation(source) { 58364 refCount++; 58365 if (!subject || hasError) { 58366 hasError = false; 58367 subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler); 58368 subscription = source.subscribe({ 58369 next(value) { subject.next(value); }, 58370 error(err) { 58371 hasError = true; 58372 subject.error(err); 58373 }, 58374 complete() { 58375 isComplete = true; 58376 subscription = undefined; 58377 subject.complete(); 58378 }, 58379 }); 58380 } 58381 const innerSub = subject.subscribe(this); 58382 this.add(() => { 58383 refCount--; 58384 innerSub.unsubscribe(); 58385 if (subscription && !isComplete && useRefCount && refCount === 0) { 58386 subscription.unsubscribe(); 58387 subscription = undefined; 58388 subject = undefined; 58389 } 58390 }); 58391 }; 58392} 58393//# sourceMappingURL=shareReplay.js.map 58394 58395/***/ }), 58396
vendor: 2,674 bytes, lines 58397-58473
58397/***/ "./node_modules/rxjs/_esm2015/internal/operators/single.js": 58398/*!*****************************************************************!*\ 58399 !*** ./node_modules/rxjs/_esm2015/internal/operators/single.js ***! 58400 \*****************************************************************/ 58401/*! exports provided: single */ 58402/***/ (function(module, __webpack_exports__, __webpack_require__) { 58403 58404"use strict"; 58405__webpack_require__.r(__webpack_exports__); 58406/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "single", function() { return single; }); 58407/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58408/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/EmptyError */ "./node_modules/rxjs/_esm2015/internal/util/EmptyError.js"); 58409 58410 58411function single(predicate) { 58412 return (source) => source.lift(new SingleOperator(predicate, source)); 58413} 58414class SingleOperator { 58415 constructor(predicate, source) { 58416 this.predicate = predicate; 58417 this.source = source; 58418 } 58419 call(subscriber, source) { 58420 return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source)); 58421 } 58422} 58423class SingleSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58424 constructor(destination, predicate, source) { 58425 super(destination); 58426 this.predicate = predicate; 58427 this.source = source; 58428 this.seenValue = false; 58429 this.index = 0; 58430 } 58431 applySingleValue(value) { 58432 if (this.seenValue) { 58433 this.destination.error('Sequence contains more than one element'); 58434 } 58435 else { 58436 this.seenValue = true; 58437 this.singleValue = value; 58438 } 58439 } 58440 _next(value) { 58441 const index = this.index++; 58442 if (this.predicate) { 58443 this.tryNext(value, index); 58444 } 58445 else { 58446 this.applySingleValue(value); 58447 } 58448 } 58449 tryNext(value, index) { 58450 try { 58451 if (this.predicate(value, index, this.source)) { 58452 this.applySingleValue(value); 58453 } 58454 } 58455 catch (err) { 58456 this.destination.error(err); 58457 } 58458 } 58459 _complete() { 58460 const destination = this.destination; 58461 if (this.index > 0) { 58462 destination.next(this.seenValue ? this.singleValue : undefined); 58463 destination.complete(); 58464 } 58465 else { 58466 destination.error(new _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__["EmptyError"]); 58467 } 58468 } 58469} 58470//# sourceMappingURL=single.js.map 58471 58472/***/ }), 58473
vendor: 1,355 bytes, lines 58474-58512
58474/***/ "./node_modules/rxjs/_esm2015/internal/operators/skip.js": 58475/*!***************************************************************!*\ 58476 !*** ./node_modules/rxjs/_esm2015/internal/operators/skip.js ***! 58477 \***************************************************************/ 58478/*! exports provided: skip */ 58479/***/ (function(module, __webpack_exports__, __webpack_require__) { 58480 58481"use strict"; 58482__webpack_require__.r(__webpack_exports__); 58483/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return skip; }); 58484/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58485 58486function skip(count) { 58487 return (source) => source.lift(new SkipOperator(count)); 58488} 58489class SkipOperator { 58490 constructor(total) { 58491 this.total = total; 58492 } 58493 call(subscriber, source) { 58494 return source.subscribe(new SkipSubscriber(subscriber, this.total)); 58495 } 58496} 58497class SkipSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58498 constructor(destination, total) { 58499 super(destination); 58500 this.total = total; 58501 this.count = 0; 58502 } 58503 _next(x) { 58504 if (++this.count > this.total) { 58505 this.destination.next(x); 58506 } 58507 } 58508} 58509//# sourceMappingURL=skip.js.map 58510 58511/***/ }), 58512
vendor: 2,371 bytes, lines 58513-58571
58513/***/ "./node_modules/rxjs/_esm2015/internal/operators/skipLast.js": 58514/*!*******************************************************************!*\ 58515 !*** ./node_modules/rxjs/_esm2015/internal/operators/skipLast.js ***! 58516 \*******************************************************************/ 58517/*! exports provided: skipLast */ 58518/***/ (function(module, __webpack_exports__, __webpack_require__) { 58519 58520"use strict"; 58521__webpack_require__.r(__webpack_exports__); 58522/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return skipLast; }); 58523/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58524/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js"); 58525 58526 58527function skipLast(count) { 58528 return (source) => source.lift(new SkipLastOperator(count)); 58529} 58530class SkipLastOperator { 58531 constructor(_skipCount) { 58532 this._skipCount = _skipCount; 58533 if (this._skipCount < 0) { 58534 throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__["ArgumentOutOfRangeError"]; 58535 } 58536 } 58537 call(subscriber, source) { 58538 if (this._skipCount === 0) { 58539 return source.subscribe(new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](subscriber)); 58540 } 58541 else { 58542 return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount)); 58543 } 58544 } 58545} 58546class SkipLastSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58547 constructor(destination, _skipCount) { 58548 super(destination); 58549 this._skipCount = _skipCount; 58550 this._count = 0; 58551 this._ring = new Array(_skipCount); 58552 } 58553 _next(value) { 58554 const skipCount = this._skipCount; 58555 const count = this._count++; 58556 if (count < skipCount) { 58557 this._ring[count] = value; 58558 } 58559 else { 58560 const currentIndex = count % skipCount; 58561 const ring = this._ring; 58562 const oldValue = ring[currentIndex]; 58563 ring[currentIndex] = value; 58564 this.destination.next(oldValue); 58565 } 58566 } 58567} 58568//# sourceMappingURL=skipLast.js.map 58569 58570/***/ }), 58571
vendor: 2,601 bytes, lines 58572-58629
58572/***/ "./node_modules/rxjs/_esm2015/internal/operators/skipUntil.js": 58573/*!********************************************************************!*\ 58574 !*** ./node_modules/rxjs/_esm2015/internal/operators/skipUntil.js ***! 58575 \********************************************************************/ 58576/*! exports provided: skipUntil */ 58577/***/ (function(module, __webpack_exports__, __webpack_require__) { 58578 58579"use strict"; 58580__webpack_require__.r(__webpack_exports__); 58581/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return skipUntil; }); 58582/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 58583/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js"); 58584/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 58585 58586 58587 58588function skipUntil(notifier) { 58589 return (source) => source.lift(new SkipUntilOperator(notifier)); 58590} 58591class SkipUntilOperator { 58592 constructor(notifier) { 58593 this.notifier = notifier; 58594 } 58595 call(destination, source) { 58596 return source.subscribe(new SkipUntilSubscriber(destination, this.notifier)); 58597 } 58598} 58599class SkipUntilSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 58600 constructor(destination, notifier) { 58601 super(destination); 58602 this.hasValue = false; 58603 const innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_1__["InnerSubscriber"](this, undefined, undefined); 58604 this.add(innerSubscriber); 58605 this.innerSubscription = innerSubscriber; 58606 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, notifier, undefined, undefined, innerSubscriber); 58607 if (innerSubscription !== innerSubscriber) { 58608 this.add(innerSubscription); 58609 this.innerSubscription = innerSubscription; 58610 } 58611 } 58612 _next(value) { 58613 if (this.hasValue) { 58614 super._next(value); 58615 } 58616 } 58617 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 58618 this.hasValue = true; 58619 if (this.innerSubscription) { 58620 this.innerSubscription.unsubscribe(); 58621 } 58622 } 58623 notifyComplete() { 58624 } 58625} 58626//# sourceMappingURL=skipUntil.js.map 58627 58628/***/ }), 58629
vendor: 1,847 bytes, lines 58630-58682
58630/***/ "./node_modules/rxjs/_esm2015/internal/operators/skipWhile.js": 58631/*!********************************************************************!*\ 58632 !*** ./node_modules/rxjs/_esm2015/internal/operators/skipWhile.js ***! 58633 \********************************************************************/ 58634/*! exports provided: skipWhile */ 58635/***/ (function(module, __webpack_exports__, __webpack_require__) { 58636 58637"use strict"; 58638__webpack_require__.r(__webpack_exports__); 58639/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return skipWhile; }); 58640/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58641 58642function skipWhile(predicate) { 58643 return (source) => source.lift(new SkipWhileOperator(predicate)); 58644} 58645class SkipWhileOperator { 58646 constructor(predicate) { 58647 this.predicate = predicate; 58648 } 58649 call(subscriber, source) { 58650 return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate)); 58651 } 58652} 58653class SkipWhileSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58654 constructor(destination, predicate) { 58655 super(destination); 58656 this.predicate = predicate; 58657 this.skipping = true; 58658 this.index = 0; 58659 } 58660 _next(value) { 58661 const destination = this.destination; 58662 if (this.skipping) { 58663 this.tryCallPredicate(value); 58664 } 58665 if (!this.skipping) { 58666 destination.next(value); 58667 } 58668 } 58669 tryCallPredicate(value) { 58670 try { 58671 const result = this.predicate(value, this.index++); 58672 this.skipping = Boolean(result); 58673 } 58674 catch (err) { 58675 this.destination.error(err); 58676 } 58677 } 58678} 58679//# sourceMappingURL=skipWhile.js.map 58680 58681/***/ }), 58682
vendor: 1,441 bytes, lines 58683-58710
58683/***/ "./node_modules/rxjs/_esm2015/internal/operators/startWith.js": 58684/*!********************************************************************!*\ 58685 !*** ./node_modules/rxjs/_esm2015/internal/operators/startWith.js ***! 58686 \********************************************************************/ 58687/*! exports provided: startWith */ 58688/***/ (function(module, __webpack_exports__, __webpack_require__) { 58689 58690"use strict"; 58691__webpack_require__.r(__webpack_exports__); 58692/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return startWith; }); 58693/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/concat */ "./node_modules/rxjs/_esm2015/internal/observable/concat.js"); 58694/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 58695 58696 58697function startWith(...array) { 58698 const scheduler = array[array.length - 1]; 58699 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(scheduler)) { 58700 array.pop(); 58701 return (source) => Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(array, source, scheduler); 58702 } 58703 else { 58704 return (source) => Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(array, source); 58705 } 58706} 58707//# sourceMappingURL=startWith.js.map 58708 58709/***/ }), 58710
vendor: 1,395 bytes, lines 58711-58740
58711/***/ "./node_modules/rxjs/_esm2015/internal/operators/subscribeOn.js": 58712/*!**********************************************************************!*\ 58713 !*** ./node_modules/rxjs/_esm2015/internal/operators/subscribeOn.js ***! 58714 \**********************************************************************/ 58715/*! exports provided: subscribeOn */ 58716/***/ (function(module, __webpack_exports__, __webpack_require__) { 58717 58718"use strict"; 58719__webpack_require__.r(__webpack_exports__); 58720/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; }); 58721/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/SubscribeOnObservable */ "./node_modules/rxjs/_esm2015/internal/observable/SubscribeOnObservable.js"); 58722 58723function subscribeOn(scheduler, delay = 0) { 58724 return function subscribeOnOperatorFunction(source) { 58725 return source.lift(new SubscribeOnOperator(scheduler, delay)); 58726 }; 58727} 58728class SubscribeOnOperator { 58729 constructor(scheduler, delay) { 58730 this.scheduler = scheduler; 58731 this.delay = delay; 58732 } 58733 call(subscriber, source) { 58734 return new _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__["SubscribeOnObservable"](source, this.delay, this.scheduler).subscribe(subscriber); 58735 } 58736} 58737//# sourceMappingURL=subscribeOn.js.map 58738 58739/***/ }), 58740
vendor: 1,127 bytes, lines 58741-58761
58741/***/ "./node_modules/rxjs/_esm2015/internal/operators/switchAll.js": 58742/*!********************************************************************!*\ 58743 !*** ./node_modules/rxjs/_esm2015/internal/operators/switchAll.js ***! 58744 \********************************************************************/ 58745/*! exports provided: switchAll */ 58746/***/ (function(module, __webpack_exports__, __webpack_require__) { 58747 58748"use strict"; 58749__webpack_require__.r(__webpack_exports__); 58750/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; }); 58751/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./switchMap */ "./node_modules/rxjs/_esm2015/internal/operators/switchMap.js"); 58752/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "./node_modules/rxjs/_esm2015/internal/util/identity.js"); 58753 58754 58755function switchAll() { 58756 return Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]); 58757} 58758//# sourceMappingURL=switchAll.js.map 58759 58760/***/ }), 58761
vendor: 3,982 bytes, lines 58762-58852
58762/***/ "./node_modules/rxjs/_esm2015/internal/operators/switchMap.js": 58763/*!********************************************************************!*\ 58764 !*** ./node_modules/rxjs/_esm2015/internal/operators/switchMap.js ***! 58765 \********************************************************************/ 58766/*! exports provided: switchMap */ 58767/***/ (function(module, __webpack_exports__, __webpack_require__) { 58768 58769"use strict"; 58770__webpack_require__.r(__webpack_exports__); 58771/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return switchMap; }); 58772/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 58773/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js"); 58774/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 58775/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 58776/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../observable/from */ "./node_modules/rxjs/_esm2015/internal/observable/from.js"); 58777 58778 58779 58780 58781 58782function switchMap(project, resultSelector) { 58783 if (typeof resultSelector === 'function') { 58784 return (source) => source.pipe(switchMap((a, i) => Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])((b, ii) => resultSelector(a, b, i, ii))))); 58785 } 58786 return (source) => source.lift(new SwitchMapOperator(project)); 58787} 58788class SwitchMapOperator { 58789 constructor(project) { 58790 this.project = project; 58791 } 58792 call(subscriber, source) { 58793 return source.subscribe(new SwitchMapSubscriber(subscriber, this.project)); 58794 } 58795} 58796class SwitchMapSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 58797 constructor(destination, project) { 58798 super(destination); 58799 this.project = project; 58800 this.index = 0; 58801 } 58802 _next(value) { 58803 let result; 58804 const index = this.index++; 58805 try { 58806 result = this.project(value, index); 58807 } 58808 catch (error) { 58809 this.destination.error(error); 58810 return; 58811 } 58812 this._innerSub(result, value, index); 58813 } 58814 _innerSub(result, value, index) { 58815 const innerSubscription = this.innerSubscription; 58816 if (innerSubscription) { 58817 innerSubscription.unsubscribe(); 58818 } 58819 const innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_1__["InnerSubscriber"](this, value, index); 58820 const destination = this.destination; 58821 destination.add(innerSubscriber); 58822 this.innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, undefined, undefined, innerSubscriber); 58823 if (this.innerSubscription !== innerSubscriber) { 58824 destination.add(this.innerSubscription); 58825 } 58826 } 58827 _complete() { 58828 const { innerSubscription } = this; 58829 if (!innerSubscription || innerSubscription.closed) { 58830 super._complete(); 58831 } 58832 this.unsubscribe(); 58833 } 58834 _unsubscribe() { 58835 this.innerSubscription = null; 58836 } 58837 notifyComplete(innerSub) { 58838 const destination = this.destination; 58839 destination.remove(innerSub); 58840 this.innerSubscription = null; 58841 if (this.isStopped) { 58842 super._complete(); 58843 } 58844 } 58845 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 58846 this.destination.next(innerValue); 58847 } 58848} 58849//# sourceMappingURL=switchMap.js.map 58850 58851/***/ }), 58852
vendor: 1,086 bytes, lines 58853-58871
58853/***/ "./node_modules/rxjs/_esm2015/internal/operators/switchMapTo.js": 58854/*!**********************************************************************!*\ 58855 !*** ./node_modules/rxjs/_esm2015/internal/operators/switchMapTo.js ***! 58856 \**********************************************************************/ 58857/*! exports provided: switchMapTo */ 58858/***/ (function(module, __webpack_exports__, __webpack_require__) { 58859 58860"use strict"; 58861__webpack_require__.r(__webpack_exports__); 58862/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; }); 58863/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./switchMap */ "./node_modules/rxjs/_esm2015/internal/operators/switchMap.js"); 58864 58865function switchMapTo(innerObservable, resultSelector) { 58866 return resultSelector ? Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(() => innerObservable, resultSelector) : Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(() => innerObservable); 58867} 58868//# sourceMappingURL=switchMapTo.js.map 58869 58870/***/ }), 58871
vendor: 2,281 bytes, lines 58872-58930
58872/***/ "./node_modules/rxjs/_esm2015/internal/operators/take.js": 58873/*!***************************************************************!*\ 58874 !*** ./node_modules/rxjs/_esm2015/internal/operators/take.js ***! 58875 \***************************************************************/ 58876/*! exports provided: take */ 58877/***/ (function(module, __webpack_exports__, __webpack_require__) { 58878 58879"use strict"; 58880__webpack_require__.r(__webpack_exports__); 58881/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return take; }); 58882/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58883/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js"); 58884/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 58885 58886 58887 58888function take(count) { 58889 return (source) => { 58890 if (count === 0) { 58891 return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(); 58892 } 58893 else { 58894 return source.lift(new TakeOperator(count)); 58895 } 58896 }; 58897} 58898class TakeOperator { 58899 constructor(total) { 58900 this.total = total; 58901 if (this.total < 0) { 58902 throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__["ArgumentOutOfRangeError"]; 58903 } 58904 } 58905 call(subscriber, source) { 58906 return source.subscribe(new TakeSubscriber(subscriber, this.total)); 58907 } 58908} 58909class TakeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58910 constructor(destination, total) { 58911 super(destination); 58912 this.total = total; 58913 this.count = 0; 58914 } 58915 _next(value) { 58916 const total = this.total; 58917 const count = ++this.count; 58918 if (count <= total) { 58919 this.destination.next(value); 58920 if (count === total) { 58921 this.destination.complete(); 58922 this.unsubscribe(); 58923 } 58924 } 58925 } 58926} 58927//# sourceMappingURL=take.js.map 58928 58929/***/ }), 58930
vendor: 2,825 bytes, lines 58931-59004
58931/***/ "./node_modules/rxjs/_esm2015/internal/operators/takeLast.js": 58932/*!*******************************************************************!*\ 58933 !*** ./node_modules/rxjs/_esm2015/internal/operators/takeLast.js ***! 58934 \*******************************************************************/ 58935/*! exports provided: takeLast */ 58936/***/ (function(module, __webpack_exports__, __webpack_require__) { 58937 58938"use strict"; 58939__webpack_require__.r(__webpack_exports__); 58940/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return takeLast; }); 58941/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 58942/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js"); 58943/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/empty */ "./node_modules/rxjs/_esm2015/internal/observable/empty.js"); 58944 58945 58946 58947function takeLast(count) { 58948 return function takeLastOperatorFunction(source) { 58949 if (count === 0) { 58950 return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(); 58951 } 58952 else { 58953 return source.lift(new TakeLastOperator(count)); 58954 } 58955 }; 58956} 58957class TakeLastOperator { 58958 constructor(total) { 58959 this.total = total; 58960 if (this.total < 0) { 58961 throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__["ArgumentOutOfRangeError"]; 58962 } 58963 } 58964 call(subscriber, source) { 58965 return source.subscribe(new TakeLastSubscriber(subscriber, this.total)); 58966 } 58967} 58968class TakeLastSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 58969 constructor(destination, total) { 58970 super(destination); 58971 this.total = total; 58972 this.ring = new Array(); 58973 this.count = 0; 58974 } 58975 _next(value) { 58976 const ring = this.ring; 58977 const total = this.total; 58978 const count = this.count++; 58979 if (ring.length < total) { 58980 ring.push(value); 58981 } 58982 else { 58983 const index = count % total; 58984 ring[index] = value; 58985 } 58986 } 58987 _complete() { 58988 const destination = this.destination; 58989 let count = this.count; 58990 if (count > 0) { 58991 const total = this.count >= this.total ? this.total : this.count; 58992 const ring = this.ring; 58993 for (let i = 0; i < total; i++) { 58994 const idx = (count++) % total; 58995 destination.next(ring[idx]); 58996 } 58997 } 58998 destination.complete(); 58999 } 59000} 59001//# sourceMappingURL=takeLast.js.map 59002 59003/***/ }), 59004
vendor: 2,071 bytes, lines 59005-59051
59005/***/ "./node_modules/rxjs/_esm2015/internal/operators/takeUntil.js": 59006/*!********************************************************************!*\ 59007 !*** ./node_modules/rxjs/_esm2015/internal/operators/takeUntil.js ***! 59008 \********************************************************************/ 59009/*! exports provided: takeUntil */ 59010/***/ (function(module, __webpack_exports__, __webpack_require__) { 59011 59012"use strict"; 59013__webpack_require__.r(__webpack_exports__); 59014/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return takeUntil; }); 59015/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 59016/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 59017 59018 59019function takeUntil(notifier) { 59020 return (source) => source.lift(new TakeUntilOperator(notifier)); 59021} 59022class TakeUntilOperator { 59023 constructor(notifier) { 59024 this.notifier = notifier; 59025 } 59026 call(subscriber, source) { 59027 const takeUntilSubscriber = new TakeUntilSubscriber(subscriber); 59028 const notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(takeUntilSubscriber, this.notifier); 59029 if (notifierSubscription && !takeUntilSubscriber.seenValue) { 59030 takeUntilSubscriber.add(notifierSubscription); 59031 return source.subscribe(takeUntilSubscriber); 59032 } 59033 return takeUntilSubscriber; 59034 } 59035} 59036class TakeUntilSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 59037 constructor(destination) { 59038 super(destination); 59039 this.seenValue = false; 59040 } 59041 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 59042 this.seenValue = true; 59043 this.complete(); 59044 } 59045 notifyComplete() { 59046 } 59047} 59048//# sourceMappingURL=takeUntil.js.map 59049 59050/***/ }), 59051
vendor: 2,125 bytes, lines 59052-59111
59052/***/ "./node_modules/rxjs/_esm2015/internal/operators/takeWhile.js": 59053/*!********************************************************************!*\ 59054 !*** ./node_modules/rxjs/_esm2015/internal/operators/takeWhile.js ***! 59055 \********************************************************************/ 59056/*! exports provided: takeWhile */ 59057/***/ (function(module, __webpack_exports__, __webpack_require__) { 59058 59059"use strict"; 59060__webpack_require__.r(__webpack_exports__); 59061/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return takeWhile; }); 59062/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 59063 59064function takeWhile(predicate, inclusive = false) { 59065 return (source) => source.lift(new TakeWhileOperator(predicate, inclusive)); 59066} 59067class TakeWhileOperator { 59068 constructor(predicate, inclusive) { 59069 this.predicate = predicate; 59070 this.inclusive = inclusive; 59071 } 59072 call(subscriber, source) { 59073 return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive)); 59074 } 59075} 59076class TakeWhileSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 59077 constructor(destination, predicate, inclusive) { 59078 super(destination); 59079 this.predicate = predicate; 59080 this.inclusive = inclusive; 59081 this.index = 0; 59082 } 59083 _next(value) { 59084 const destination = this.destination; 59085 let result; 59086 try { 59087 result = this.predicate(value, this.index++); 59088 } 59089 catch (err) { 59090 destination.error(err); 59091 return; 59092 } 59093 this.nextOrComplete(value, result); 59094 } 59095 nextOrComplete(value, predicateResult) { 59096 const destination = this.destination; 59097 if (Boolean(predicateResult)) { 59098 destination.next(value); 59099 } 59100 else { 59101 if (this.inclusive) { 59102 destination.next(value); 59103 } 59104 destination.complete(); 59105 } 59106 } 59107} 59108//# sourceMappingURL=takeWhile.js.map 59109 59110/***/ }), 59111
vendor: 3,474 bytes, lines 59112-59196
59112/***/ "./node_modules/rxjs/_esm2015/internal/operators/tap.js": 59113/*!**************************************************************!*\ 59114 !*** ./node_modules/rxjs/_esm2015/internal/operators/tap.js ***! 59115 \**************************************************************/ 59116/*! exports provided: tap */ 59117/***/ (function(module, __webpack_exports__, __webpack_require__) { 59118 59119"use strict"; 59120__webpack_require__.r(__webpack_exports__); 59121/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return tap; }); 59122/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 59123/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/noop */ "./node_modules/rxjs/_esm2015/internal/util/noop.js"); 59124/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ "./node_modules/rxjs/_esm2015/internal/util/isFunction.js"); 59125 59126 59127 59128function tap(nextOrObserver, error, complete) { 59129 return function tapOperatorFunction(source) { 59130 return source.lift(new DoOperator(nextOrObserver, error, complete)); 59131 }; 59132} 59133class DoOperator { 59134 constructor(nextOrObserver, error, complete) { 59135 this.nextOrObserver = nextOrObserver; 59136 this.error = error; 59137 this.complete = complete; 59138 } 59139 call(subscriber, source) { 59140 return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete)); 59141 } 59142} 59143class TapSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 59144 constructor(destination, observerOrNext, error, complete) { 59145 super(destination); 59146 this._tapNext = _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]; 59147 this._tapError = _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]; 59148 this._tapComplete = _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]; 59149 this._tapError = error || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]; 59150 this._tapComplete = complete || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]; 59151 if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(observerOrNext)) { 59152 this._context = this; 59153 this._tapNext = observerOrNext; 59154 } 59155 else if (observerOrNext) { 59156 this._context = observerOrNext; 59157 this._tapNext = observerOrNext.next || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]; 59158 this._tapError = observerOrNext.error || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]; 59159 this._tapComplete = observerOrNext.complete || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]; 59160 } 59161 } 59162 _next(value) { 59163 try { 59164 this._tapNext.call(this._context, value); 59165 } 59166 catch (err) { 59167 this.destination.error(err); 59168 return; 59169 } 59170 this.destination.next(value); 59171 } 59172 _error(err) { 59173 try { 59174 this._tapError.call(this._context, err); 59175 } 59176 catch (err) { 59177 this.destination.error(err); 59178 return; 59179 } 59180 this.destination.error(err); 59181 } 59182 _complete() { 59183 try { 59184 this._tapComplete.call(this._context); 59185 } 59186 catch (err) { 59187 this.destination.error(err); 59188 return; 59189 } 59190 return this.destination.complete(); 59191 } 59192} 59193//# sourceMappingURL=tap.js.map 59194 59195/***/ }), 59196
vendor: 3,600 bytes, lines 59197-59294
59197/***/ "./node_modules/rxjs/_esm2015/internal/operators/throttle.js": 59198/*!*******************************************************************!*\ 59199 !*** ./node_modules/rxjs/_esm2015/internal/operators/throttle.js ***! 59200 \*******************************************************************/ 59201/*! exports provided: defaultThrottleConfig, throttle */ 59202/***/ (function(module, __webpack_exports__, __webpack_require__) { 59203 59204"use strict"; 59205__webpack_require__.r(__webpack_exports__); 59206/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultThrottleConfig", function() { return defaultThrottleConfig; }); 59207/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; }); 59208/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 59209/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 59210 59211 59212const defaultThrottleConfig = { 59213 leading: true, 59214 trailing: false 59215}; 59216function throttle(durationSelector, config = defaultThrottleConfig) { 59217 return (source) => source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); 59218} 59219class ThrottleOperator { 59220 constructor(durationSelector, leading, trailing) { 59221 this.durationSelector = durationSelector; 59222 this.leading = leading; 59223 this.trailing = trailing; 59224 } 59225 call(subscriber, source) { 59226 return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing)); 59227 } 59228} 59229class ThrottleSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 59230 constructor(destination, durationSelector, _leading, _trailing) { 59231 super(destination); 59232 this.destination = destination; 59233 this.durationSelector = durationSelector; 59234 this._leading = _leading; 59235 this._trailing = _trailing; 59236 this._hasValue = false; 59237 } 59238 _next(value) { 59239 this._hasValue = true; 59240 this._sendValue = value; 59241 if (!this._throttled) { 59242 if (this._leading) { 59243 this.send(); 59244 } 59245 else { 59246 this.throttle(value); 59247 } 59248 } 59249 } 59250 send() { 59251 const { _hasValue, _sendValue } = this; 59252 if (_hasValue) { 59253 this.destination.next(_sendValue); 59254 this.throttle(_sendValue); 59255 } 59256 this._hasValue = false; 59257 this._sendValue = null; 59258 } 59259 throttle(value) { 59260 const duration = this.tryDurationSelector(value); 59261 if (!!duration) { 59262 this.add(this._throttled = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, duration)); 59263 } 59264 } 59265 tryDurationSelector(value) { 59266 try { 59267 return this.durationSelector(value); 59268 } 59269 catch (err) { 59270 this.destination.error(err); 59271 return null; 59272 } 59273 } 59274 throttlingDone() { 59275 const { _throttled, _trailing } = this; 59276 if (_throttled) { 59277 _throttled.unsubscribe(); 59278 } 59279 this._throttled = null; 59280 if (_trailing) { 59281 this.send(); 59282 } 59283 } 59284 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 59285 this.throttlingDone(); 59286 } 59287 notifyComplete() { 59288 this.throttlingDone(); 59289 } 59290} 59291//# sourceMappingURL=throttle.js.map 59292 59293/***/ }), 59294
vendor: 3,621 bytes, lines 59295-59383
59295/***/ "./node_modules/rxjs/_esm2015/internal/operators/throttleTime.js": 59296/*!***********************************************************************!*\ 59297 !*** ./node_modules/rxjs/_esm2015/internal/operators/throttleTime.js ***! 59298 \***********************************************************************/ 59299/*! exports provided: throttleTime */ 59300/***/ (function(module, __webpack_exports__, __webpack_require__) { 59301 59302"use strict"; 59303__webpack_require__.r(__webpack_exports__); 59304/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return throttleTime; }); 59305/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 59306/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 59307/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./throttle */ "./node_modules/rxjs/_esm2015/internal/operators/throttle.js"); 59308 59309 59310 59311function throttleTime(duration, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"], config = _throttle__WEBPACK_IMPORTED_MODULE_2__["defaultThrottleConfig"]) { 59312 return (source) => source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing)); 59313} 59314class ThrottleTimeOperator { 59315 constructor(duration, scheduler, leading, trailing) { 59316 this.duration = duration; 59317 this.scheduler = scheduler; 59318 this.leading = leading; 59319 this.trailing = trailing; 59320 } 59321 call(subscriber, source) { 59322 return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing)); 59323 } 59324} 59325class ThrottleTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 59326 constructor(destination, duration, scheduler, leading, trailing) { 59327 super(destination); 59328 this.duration = duration; 59329 this.scheduler = scheduler; 59330 this.leading = leading; 59331 this.trailing = trailing; 59332 this._hasTrailingValue = false; 59333 this._trailingValue = null; 59334 } 59335 _next(value) { 59336 if (this.throttled) { 59337 if (this.trailing) { 59338 this._trailingValue = value; 59339 this._hasTrailingValue = true; 59340 } 59341 } 59342 else { 59343 this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this })); 59344 if (this.leading) { 59345 this.destination.next(value); 59346 } 59347 else if (this.trailing) { 59348 this._trailingValue = value; 59349 this._hasTrailingValue = true; 59350 } 59351 } 59352 } 59353 _complete() { 59354 if (this._hasTrailingValue) { 59355 this.destination.next(this._trailingValue); 59356 this.destination.complete(); 59357 } 59358 else { 59359 this.destination.complete(); 59360 } 59361 } 59362 clearThrottle() { 59363 const throttled = this.throttled; 59364 if (throttled) { 59365 if (this.trailing && this._hasTrailingValue) { 59366 this.destination.next(this._trailingValue); 59367 this._trailingValue = null; 59368 this._hasTrailingValue = false; 59369 } 59370 throttled.unsubscribe(); 59371 this.remove(throttled); 59372 this.throttled = null; 59373 } 59374 } 59375} 59376function dispatchNext(arg) { 59377 const { subscriber } = arg; 59378 subscriber.clearThrottle(); 59379} 59380//# sourceMappingURL=throttleTime.js.map 59381 59382/***/ }), 59383
vendor: 2,189 bytes, lines 59384-59443
59384/***/ "./node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js": 59385/*!***********************************************************************!*\ 59386 !*** ./node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js ***! 59387 \***********************************************************************/ 59388/*! exports provided: throwIfEmpty */ 59389/***/ (function(module, __webpack_exports__, __webpack_require__) { 59390 59391"use strict"; 59392__webpack_require__.r(__webpack_exports__); 59393/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return throwIfEmpty; }); 59394/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ "./node_modules/rxjs/_esm2015/internal/util/EmptyError.js"); 59395/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 59396 59397 59398function throwIfEmpty(errorFactory = defaultErrorFactory) { 59399 return (source) => { 59400 return source.lift(new ThrowIfEmptyOperator(errorFactory)); 59401 }; 59402} 59403class ThrowIfEmptyOperator { 59404 constructor(errorFactory) { 59405 this.errorFactory = errorFactory; 59406 } 59407 call(subscriber, source) { 59408 return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory)); 59409 } 59410} 59411class ThrowIfEmptySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"] { 59412 constructor(destination, errorFactory) { 59413 super(destination); 59414 this.errorFactory = errorFactory; 59415 this.hasValue = false; 59416 } 59417 _next(value) { 59418 this.hasValue = true; 59419 this.destination.next(value); 59420 } 59421 _complete() { 59422 if (!this.hasValue) { 59423 let err; 59424 try { 59425 err = this.errorFactory(); 59426 } 59427 catch (e) { 59428 err = e; 59429 } 59430 this.destination.error(err); 59431 } 59432 else { 59433 return this.destination.complete(); 59434 } 59435 } 59436} 59437function defaultErrorFactory() { 59438 return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); 59439} 59440//# sourceMappingURL=throwIfEmpty.js.map 59441 59442/***/ }), 59443
vendor: 2,134 bytes, lines 59444-59477
59444/***/ "./node_modules/rxjs/_esm2015/internal/operators/timeInterval.js": 59445/*!***********************************************************************!*\ 59446 !*** ./node_modules/rxjs/_esm2015/internal/operators/timeInterval.js ***! 59447 \***********************************************************************/ 59448/*! exports provided: timeInterval, TimeInterval */ 59449/***/ (function(module, __webpack_exports__, __webpack_require__) { 59450 59451"use strict"; 59452__webpack_require__.r(__webpack_exports__); 59453/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; }); 59454/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; }); 59455/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 59456/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scan */ "./node_modules/rxjs/_esm2015/internal/operators/scan.js"); 59457/* harmony import */ var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/defer */ "./node_modules/rxjs/_esm2015/internal/observable/defer.js"); 59458/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 59459 59460 59461 59462 59463function timeInterval(scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) { 59464 return (source) => Object(_observable_defer__WEBPACK_IMPORTED_MODULE_2__["defer"])(() => { 59465 return source.pipe(Object(_scan__WEBPACK_IMPORTED_MODULE_1__["scan"])(({ current }, value) => ({ value, current: scheduler.now(), last: current }), { current: scheduler.now(), value: undefined, last: undefined }), Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(({ current, last, value }) => new TimeInterval(value, current - last))); 59466 }); 59467} 59468class TimeInterval { 59469 constructor(value, interval) { 59470 this.value = value; 59471 this.interval = interval; 59472 } 59473} 59474//# sourceMappingURL=timeInterval.js.map 59475 59476/***/ }), 59477
vendor: 1,687 bytes, lines 59478-59502
59478/***/ "./node_modules/rxjs/_esm2015/internal/operators/timeout.js": 59479/*!******************************************************************!*\ 59480 !*** ./node_modules/rxjs/_esm2015/internal/operators/timeout.js ***! 59481 \******************************************************************/ 59482/*! exports provided: timeout */ 59483/***/ (function(module, __webpack_exports__, __webpack_require__) { 59484 59485"use strict"; 59486__webpack_require__.r(__webpack_exports__); 59487/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; }); 59488/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 59489/* harmony import */ var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/TimeoutError */ "./node_modules/rxjs/_esm2015/internal/util/TimeoutError.js"); 59490/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timeoutWith */ "./node_modules/rxjs/_esm2015/internal/operators/timeoutWith.js"); 59491/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/throwError */ "./node_modules/rxjs/_esm2015/internal/observable/throwError.js"); 59492 59493 59494 59495 59496function timeout(due, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) { 59497 return Object(_timeoutWith__WEBPACK_IMPORTED_MODULE_2__["timeoutWith"])(due, Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_3__["throwError"])(new _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"]()), scheduler); 59498} 59499//# sourceMappingURL=timeout.js.map 59500 59501/***/ }), 59502
vendor: 3,535 bytes, lines 59503-59578
59503/***/ "./node_modules/rxjs/_esm2015/internal/operators/timeoutWith.js": 59504/*!**********************************************************************!*\ 59505 !*** ./node_modules/rxjs/_esm2015/internal/operators/timeoutWith.js ***! 59506 \**********************************************************************/ 59507/*! exports provided: timeoutWith */ 59508/***/ (function(module, __webpack_exports__, __webpack_require__) { 59509 59510"use strict"; 59511__webpack_require__.r(__webpack_exports__); 59512/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; }); 59513/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 59514/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isDate */ "./node_modules/rxjs/_esm2015/internal/util/isDate.js"); 59515/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 59516/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 59517 59518 59519 59520 59521function timeoutWith(due, withObservable, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) { 59522 return (source) => { 59523 let absoluteTimeout = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_1__["isDate"])(due); 59524 let waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due); 59525 return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); 59526 }; 59527} 59528class TimeoutWithOperator { 59529 constructor(waitFor, absoluteTimeout, withObservable, scheduler) { 59530 this.waitFor = waitFor; 59531 this.absoluteTimeout = absoluteTimeout; 59532 this.withObservable = withObservable; 59533 this.scheduler = scheduler; 59534 } 59535 call(subscriber, source) { 59536 return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler)); 59537 } 59538} 59539class TimeoutWithSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] { 59540 constructor(destination, absoluteTimeout, waitFor, withObservable, scheduler) { 59541 super(destination); 59542 this.absoluteTimeout = absoluteTimeout; 59543 this.waitFor = waitFor; 59544 this.withObservable = withObservable; 59545 this.scheduler = scheduler; 59546 this.action = null; 59547 this.scheduleTimeout(); 59548 } 59549 static dispatchTimeout(subscriber) { 59550 const { withObservable } = subscriber; 59551 subscriber._unsubscribeAndRecycle(); 59552 subscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(subscriber, withObservable)); 59553 } 59554 scheduleTimeout() { 59555 const { action } = this; 59556 if (action) { 59557 this.action = action.schedule(this, this.waitFor); 59558 } 59559 else { 59560 this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this)); 59561 } 59562 } 59563 _next(value) { 59564 if (!this.absoluteTimeout) { 59565 this.scheduleTimeout(); 59566 } 59567 super._next(value); 59568 } 59569 _unsubscribe() { 59570 this.action = null; 59571 this.scheduler = null; 59572 this.withObservable = null; 59573 } 59574} 59575//# sourceMappingURL=timeoutWith.js.map 59576 59577/***/ }), 59578
vendor: 1,421 bytes, lines 59579-59606
59579/***/ "./node_modules/rxjs/_esm2015/internal/operators/timestamp.js": 59580/*!********************************************************************!*\ 59581 !*** ./node_modules/rxjs/_esm2015/internal/operators/timestamp.js ***! 59582 \********************************************************************/ 59583/*! exports provided: timestamp, Timestamp */ 59584/***/ (function(module, __webpack_exports__, __webpack_require__) { 59585 59586"use strict"; 59587__webpack_require__.r(__webpack_exports__); 59588/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return timestamp; }); 59589/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timestamp", function() { return Timestamp; }); 59590/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 59591/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 59592 59593 59594function timestamp(scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) { 59595 return Object(_map__WEBPACK_IMPORTED_MODULE_1__["map"])((value) => new Timestamp(value, scheduler.now())); 59596} 59597class Timestamp { 59598 constructor(value, timestamp) { 59599 this.value = value; 59600 this.timestamp = timestamp; 59601 } 59602} 59603//# sourceMappingURL=timestamp.js.map 59604 59605/***/ }), 59606
vendor: 1,016 bytes, lines 59607-59632
59607/***/ "./node_modules/rxjs/_esm2015/internal/operators/toArray.js": 59608/*!******************************************************************!*\ 59609 !*** ./node_modules/rxjs/_esm2015/internal/operators/toArray.js ***! 59610 \******************************************************************/ 59611/*! exports provided: toArray */ 59612/***/ (function(module, __webpack_exports__, __webpack_require__) { 59613 59614"use strict"; 59615__webpack_require__.r(__webpack_exports__); 59616/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; }); 59617/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "./node_modules/rxjs/_esm2015/internal/operators/reduce.js"); 59618 59619function toArrayReducer(arr, item, index) { 59620 if (index === 0) { 59621 return [item]; 59622 } 59623 arr.push(item); 59624 return arr; 59625} 59626function toArray() { 59627 return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(toArrayReducer, []); 59628} 59629//# sourceMappingURL=toArray.js.map 59630 59631/***/ }), 59632
vendor: 2,978 bytes, lines 59633-59709
59633/***/ "./node_modules/rxjs/_esm2015/internal/operators/window.js": 59634/*!*****************************************************************!*\ 59635 !*** ./node_modules/rxjs/_esm2015/internal/operators/window.js ***! 59636 \*****************************************************************/ 59637/*! exports provided: window */ 59638/***/ (function(module, __webpack_exports__, __webpack_require__) { 59639 59640"use strict"; 59641__webpack_require__.r(__webpack_exports__); 59642/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return window; }); 59643/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 59644/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 59645/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 59646 59647 59648 59649function window(windowBoundaries) { 59650 return function windowOperatorFunction(source) { 59651 return source.lift(new WindowOperator(windowBoundaries)); 59652 }; 59653} 59654class WindowOperator { 59655 constructor(windowBoundaries) { 59656 this.windowBoundaries = windowBoundaries; 59657 } 59658 call(subscriber, source) { 59659 const windowSubscriber = new WindowSubscriber(subscriber); 59660 const sourceSubscription = source.subscribe(windowSubscriber); 59661 if (!sourceSubscription.closed) { 59662 windowSubscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(windowSubscriber, this.windowBoundaries)); 59663 } 59664 return sourceSubscription; 59665 } 59666} 59667class WindowSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"] { 59668 constructor(destination) { 59669 super(destination); 59670 this.window = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); 59671 destination.next(this.window); 59672 } 59673 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 59674 this.openWindow(); 59675 } 59676 notifyError(error, innerSub) { 59677 this._error(error); 59678 } 59679 notifyComplete(innerSub) { 59680 this._complete(); 59681 } 59682 _next(value) { 59683 this.window.next(value); 59684 } 59685 _error(err) { 59686 this.window.error(err); 59687 this.destination.error(err); 59688 } 59689 _complete() { 59690 this.window.complete(); 59691 this.destination.complete(); 59692 } 59693 _unsubscribe() { 59694 this.window = null; 59695 } 59696 openWindow() { 59697 const prevWindow = this.window; 59698 if (prevWindow) { 59699 prevWindow.complete(); 59700 } 59701 const destination = this.destination; 59702 const newWindow = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); 59703 destination.next(newWindow); 59704 } 59705} 59706//# sourceMappingURL=window.js.map 59707 59708/***/ }), 59709
vendor: 3,326 bytes, lines 59710-59793
59710/***/ "./node_modules/rxjs/_esm2015/internal/operators/windowCount.js": 59711/*!**********************************************************************!*\ 59712 !*** ./node_modules/rxjs/_esm2015/internal/operators/windowCount.js ***! 59713 \**********************************************************************/ 59714/*! exports provided: windowCount */ 59715/***/ (function(module, __webpack_exports__, __webpack_require__) { 59716 59717"use strict"; 59718__webpack_require__.r(__webpack_exports__); 59719/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return windowCount; }); 59720/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 59721/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 59722 59723 59724function windowCount(windowSize, startWindowEvery = 0) { 59725 return function windowCountOperatorFunction(source) { 59726 return source.lift(new WindowCountOperator(windowSize, startWindowEvery)); 59727 }; 59728} 59729class WindowCountOperator { 59730 constructor(windowSize, startWindowEvery) { 59731 this.windowSize = windowSize; 59732 this.startWindowEvery = startWindowEvery; 59733 } 59734 call(subscriber, source) { 59735 return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery)); 59736 } 59737} 59738class WindowCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] { 59739 constructor(destination, windowSize, startWindowEvery) { 59740 super(destination); 59741 this.destination = destination; 59742 this.windowSize = windowSize; 59743 this.startWindowEvery = startWindowEvery; 59744 this.windows = [new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]()]; 59745 this.count = 0; 59746 destination.next(this.windows[0]); 59747 } 59748 _next(value) { 59749 const startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize; 59750 const destination = this.destination; 59751 const windowSize = this.windowSize; 59752 const windows = this.windows; 59753 const len = windows.length; 59754 for (let i = 0; i < len && !this.closed; i++) { 59755 windows[i].next(value); 59756 } 59757 const c = this.count - windowSize + 1; 59758 if (c >= 0 && c % startWindowEvery === 0 && !this.closed) { 59759 windows.shift().complete(); 59760 } 59761 if (++this.count % startWindowEvery === 0 && !this.closed) { 59762 const window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"](); 59763 windows.push(window); 59764 destination.next(window); 59765 } 59766 } 59767 _error(err) { 59768 const windows = this.windows; 59769 if (windows) { 59770 while (windows.length > 0 && !this.closed) { 59771 windows.shift().error(err); 59772 } 59773 } 59774 this.destination.error(err); 59775 } 59776 _complete() { 59777 const windows = this.windows; 59778 if (windows) { 59779 while (windows.length > 0 && !this.closed) { 59780 windows.shift().complete(); 59781 } 59782 } 59783 this.destination.complete(); 59784 } 59785 _unsubscribe() { 59786 this.count = 0; 59787 this.windows = null; 59788 } 59789} 59790//# sourceMappingURL=windowCount.js.map 59791 59792/***/ }), 59793
vendor: 6,854 bytes, lines 59794-59953
59794/***/ "./node_modules/rxjs/_esm2015/internal/operators/windowTime.js": 59795/*!*********************************************************************!*\ 59796 !*** ./node_modules/rxjs/_esm2015/internal/operators/windowTime.js ***! 59797 \*********************************************************************/ 59798/*! exports provided: windowTime */ 59799/***/ (function(module, __webpack_exports__, __webpack_require__) { 59800 59801"use strict"; 59802__webpack_require__.r(__webpack_exports__); 59803/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return windowTime; }); 59804/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 59805/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js"); 59806/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 59807/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isNumeric */ "./node_modules/rxjs/_esm2015/internal/util/isNumeric.js"); 59808/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isScheduler */ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js"); 59809 59810 59811 59812 59813 59814function windowTime(windowTimeSpan) { 59815 let scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; 59816 let windowCreationInterval = null; 59817 let maxWindowSize = Number.POSITIVE_INFINITY; 59818 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(arguments[3])) { 59819 scheduler = arguments[3]; 59820 } 59821 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(arguments[2])) { 59822 scheduler = arguments[2]; 59823 } 59824 else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_3__["isNumeric"])(arguments[2])) { 59825 maxWindowSize = arguments[2]; 59826 } 59827 if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(arguments[1])) { 59828 scheduler = arguments[1]; 59829 } 59830 else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_3__["isNumeric"])(arguments[1])) { 59831 windowCreationInterval = arguments[1]; 59832 } 59833 return function windowTimeOperatorFunction(source) { 59834 return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler)); 59835 }; 59836} 59837class WindowTimeOperator { 59838 constructor(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) { 59839 this.windowTimeSpan = windowTimeSpan; 59840 this.windowCreationInterval = windowCreationInterval; 59841 this.maxWindowSize = maxWindowSize; 59842 this.scheduler = scheduler; 59843 } 59844 call(subscriber, source) { 59845 return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler)); 59846 } 59847} 59848class CountedSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"] { 59849 constructor() { 59850 super(...arguments); 59851 this._numberOfNextedValues = 0; 59852 } 59853 next(value) { 59854 this._numberOfNextedValues++; 59855 super.next(value); 59856 } 59857 get numberOfNextedValues() { 59858 return this._numberOfNextedValues; 59859 } 59860} 59861class WindowTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"] { 59862 constructor(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) { 59863 super(destination); 59864 this.destination = destination; 59865 this.windowTimeSpan = windowTimeSpan; 59866 this.windowCreationInterval = windowCreationInterval; 59867 this.maxWindowSize = maxWindowSize; 59868 this.scheduler = scheduler; 59869 this.windows = []; 59870 const window = this.openWindow(); 59871 if (windowCreationInterval !== null && windowCreationInterval >= 0) { 59872 const closeState = { subscriber: this, window, context: null }; 59873 const creationState = { windowTimeSpan, windowCreationInterval, subscriber: this, scheduler }; 59874 this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); 59875 this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); 59876 } 59877 else { 59878 const timeSpanOnlyState = { subscriber: this, window, windowTimeSpan }; 59879 this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); 59880 } 59881 } 59882 _next(value) { 59883 const windows = this.windows; 59884 const len = windows.length; 59885 for (let i = 0; i < len; i++) { 59886 const window = windows[i]; 59887 if (!window.closed) { 59888 window.next(value); 59889 if (window.numberOfNextedValues >= this.maxWindowSize) { 59890 this.closeWindow(window); 59891 } 59892 } 59893 } 59894 } 59895 _error(err) { 59896 const windows = this.windows; 59897 while (windows.length > 0) { 59898 windows.shift().error(err); 59899 } 59900 this.destination.error(err); 59901 } 59902 _complete() { 59903 const windows = this.windows; 59904 while (windows.length > 0) { 59905 const window = windows.shift(); 59906 if (!window.closed) { 59907 window.complete(); 59908 } 59909 } 59910 this.destination.complete(); 59911 } 59912 openWindow() { 59913 const window = new CountedSubject(); 59914 this.windows.push(window); 59915 const destination = this.destination; 59916 destination.next(window); 59917 return window; 59918 } 59919 closeWindow(window) { 59920 window.complete(); 59921 const windows = this.windows; 59922 windows.splice(windows.indexOf(window), 1); 59923 } 59924} 59925function dispatchWindowTimeSpanOnly(state) { 59926 const { subscriber, windowTimeSpan, window } = state; 59927 if (window) { 59928 subscriber.closeWindow(window); 59929 } 59930 state.window = subscriber.openWindow(); 59931 this.schedule(state, windowTimeSpan); 59932} 59933function dispatchWindowCreation(state) { 59934 const { windowTimeSpan, subscriber, scheduler, windowCreationInterval } = state; 59935 const window = subscriber.openWindow(); 59936 const action = this; 59937 let context = { action, subscription: null }; 59938 const timeSpanState = { subscriber, window, context }; 59939 context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); 59940 action.add(context.subscription); 59941 action.schedule(state, windowCreationInterval); 59942} 59943function dispatchWindowClose(state) { 59944 const { subscriber, window, context } = state; 59945 if (context && context.action && context.subscription) { 59946 context.action.remove(context.subscription); 59947 } 59948 subscriber.closeWindow(window); 59949} 59950//# sourceMappingURL=windowTime.js.map 59951 59952/***/ }), 59953
vendor: 5,467 bytes, lines 59954-60093
59954/***/ "./node_modules/rxjs/_esm2015/internal/operators/windowToggle.js": 59955/*!***********************************************************************!*\ 59956 !*** ./node_modules/rxjs/_esm2015/internal/operators/windowToggle.js ***! 59957 \***********************************************************************/ 59958/*! exports provided: windowToggle */ 59959/***/ (function(module, __webpack_exports__, __webpack_require__) { 59960 59961"use strict"; 59962__webpack_require__.r(__webpack_exports__); 59963/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return windowToggle; }); 59964/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 59965/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 59966/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 59967/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 59968 59969 59970 59971 59972function windowToggle(openings, closingSelector) { 59973 return (source) => source.lift(new WindowToggleOperator(openings, closingSelector)); 59974} 59975class WindowToggleOperator { 59976 constructor(openings, closingSelector) { 59977 this.openings = openings; 59978 this.closingSelector = closingSelector; 59979 } 59980 call(subscriber, source) { 59981 return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector)); 59982 } 59983} 59984class WindowToggleSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] { 59985 constructor(destination, openings, closingSelector) { 59986 super(destination); 59987 this.openings = openings; 59988 this.closingSelector = closingSelector; 59989 this.contexts = []; 59990 this.add(this.openSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, openings, openings)); 59991 } 59992 _next(value) { 59993 const { contexts } = this; 59994 if (contexts) { 59995 const len = contexts.length; 59996 for (let i = 0; i < len; i++) { 59997 contexts[i].window.next(value); 59998 } 59999 } 60000 } 60001 _error(err) { 60002 const { contexts } = this; 60003 this.contexts = null; 60004 if (contexts) { 60005 const len = contexts.length; 60006 let index = -1; 60007 while (++index < len) { 60008 const context = contexts[index]; 60009 context.window.error(err); 60010 context.subscription.unsubscribe(); 60011 } 60012 } 60013 super._error(err); 60014 } 60015 _complete() { 60016 const { contexts } = this; 60017 this.contexts = null; 60018 if (contexts) { 60019 const len = contexts.length; 60020 let index = -1; 60021 while (++index < len) { 60022 const context = contexts[index]; 60023 context.window.complete(); 60024 context.subscription.unsubscribe(); 60025 } 60026 } 60027 super._complete(); 60028 } 60029 _unsubscribe() { 60030 const { contexts } = this; 60031 this.contexts = null; 60032 if (contexts) { 60033 const len = contexts.length; 60034 let index = -1; 60035 while (++index < len) { 60036 const context = contexts[index]; 60037 context.window.unsubscribe(); 60038 context.subscription.unsubscribe(); 60039 } 60040 } 60041 } 60042 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 60043 if (outerValue === this.openings) { 60044 let closingNotifier; 60045 try { 60046 const { closingSelector } = this; 60047 closingNotifier = closingSelector(innerValue); 60048 } 60049 catch (e) { 60050 return this.error(e); 60051 } 60052 const window = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); 60053 const subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); 60054 const context = { window, subscription }; 60055 this.contexts.push(context); 60056 const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, closingNotifier, context); 60057 if (innerSubscription.closed) { 60058 this.closeWindow(this.contexts.length - 1); 60059 } 60060 else { 60061 innerSubscription.context = context; 60062 subscription.add(innerSubscription); 60063 } 60064 this.destination.next(window); 60065 } 60066 else { 60067 this.closeWindow(this.contexts.indexOf(outerValue)); 60068 } 60069 } 60070 notifyError(err) { 60071 this.error(err); 60072 } 60073 notifyComplete(inner) { 60074 if (inner !== this.openSubscription) { 60075 this.closeWindow(this.contexts.indexOf(inner.context)); 60076 } 60077 } 60078 closeWindow(index) { 60079 if (index === -1) { 60080 return; 60081 } 60082 const { contexts } = this; 60083 const context = contexts[index]; 60084 const { window, subscription } = context; 60085 contexts.splice(index, 1); 60086 window.complete(); 60087 subscription.unsubscribe(); 60088 } 60089} 60090//# sourceMappingURL=windowToggle.js.map 60091 60092/***/ }), 60093
vendor: 3,432 bytes, lines 60094-60184
60094/***/ "./node_modules/rxjs/_esm2015/internal/operators/windowWhen.js": 60095/*!*********************************************************************!*\ 60096 !*** ./node_modules/rxjs/_esm2015/internal/operators/windowWhen.js ***! 60097 \*********************************************************************/ 60098/*! exports provided: windowWhen */ 60099/***/ (function(module, __webpack_exports__, __webpack_require__) { 60100 60101"use strict"; 60102__webpack_require__.r(__webpack_exports__); 60103/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return windowWhen; }); 60104/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "./node_modules/rxjs/_esm2015/internal/Subject.js"); 60105/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 60106/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 60107 60108 60109 60110function windowWhen(closingSelector) { 60111 return function windowWhenOperatorFunction(source) { 60112 return source.lift(new WindowOperator(closingSelector)); 60113 }; 60114} 60115class WindowOperator { 60116 constructor(closingSelector) { 60117 this.closingSelector = closingSelector; 60118 } 60119 call(subscriber, source) { 60120 return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector)); 60121 } 60122} 60123class WindowSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"] { 60124 constructor(destination, closingSelector) { 60125 super(destination); 60126 this.destination = destination; 60127 this.closingSelector = closingSelector; 60128 this.openWindow(); 60129 } 60130 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 60131 this.openWindow(innerSub); 60132 } 60133 notifyError(error, innerSub) { 60134 this._error(error); 60135 } 60136 notifyComplete(innerSub) { 60137 this.openWindow(innerSub); 60138 } 60139 _next(value) { 60140 this.window.next(value); 60141 } 60142 _error(err) { 60143 this.window.error(err); 60144 this.destination.error(err); 60145 this.unsubscribeClosingNotification(); 60146 } 60147 _complete() { 60148 this.window.complete(); 60149 this.destination.complete(); 60150 this.unsubscribeClosingNotification(); 60151 } 60152 unsubscribeClosingNotification() { 60153 if (this.closingNotification) { 60154 this.closingNotification.unsubscribe(); 60155 } 60156 } 60157 openWindow(innerSub = null) { 60158 if (innerSub) { 60159 this.remove(innerSub); 60160 innerSub.unsubscribe(); 60161 } 60162 const prevWindow = this.window; 60163 if (prevWindow) { 60164 prevWindow.complete(); 60165 } 60166 const window = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); 60167 this.destination.next(window); 60168 let closingNotifier; 60169 try { 60170 const { closingSelector } = this; 60171 closingNotifier = closingSelector(); 60172 } 60173 catch (e) { 60174 this.destination.error(e); 60175 this.window.error(e); 60176 return; 60177 } 60178 this.add(this.closingNotification = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, closingNotifier)); 60179 } 60180} 60181//# sourceMappingURL=windowWhen.js.map 60182 60183/***/ }), 60184
vendor: 3,283 bytes, lines 60185-60272
60185/***/ "./node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js": 60186/*!*************************************************************************!*\ 60187 !*** ./node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js ***! 60188 \*************************************************************************/ 60189/*! exports provided: withLatestFrom */ 60190/***/ (function(module, __webpack_exports__, __webpack_require__) { 60191 60192"use strict"; 60193__webpack_require__.r(__webpack_exports__); 60194/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return withLatestFrom; }); 60195/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js"); 60196/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js"); 60197 60198 60199function withLatestFrom(...args) { 60200 return (source) => { 60201 let project; 60202 if (typeof args[args.length - 1] === 'function') { 60203 project = args.pop(); 60204 } 60205 const observables = args; 60206 return source.lift(new WithLatestFromOperator(observables, project)); 60207 }; 60208} 60209class WithLatestFromOperator { 60210 constructor(observables, project) { 60211 this.observables = observables; 60212 this.project = project; 60213 } 60214 call(subscriber, source) { 60215 return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project)); 60216 } 60217} 60218class WithLatestFromSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] { 60219 constructor(destination, observables, project) { 60220 super(destination); 60221 this.observables = observables; 60222 this.project = project; 60223 this.toRespond = []; 60224 const len = observables.length; 60225 this.values = new Array(len); 60226 for (let i = 0; i < len; i++) { 60227 this.toRespond.push(i); 60228 } 60229 for (let i = 0; i < len; i++) { 60230 let observable = observables[i]; 60231 this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, observable, observable, i)); 60232 } 60233 } 60234 notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { 60235 this.values[outerIndex] = innerValue; 60236 const toRespond = this.toRespond; 60237 if (toRespond.length > 0) { 60238 const found = toRespond.indexOf(outerIndex); 60239 if (found !== -1) { 60240 toRespond.splice(found, 1); 60241 } 60242 } 60243 } 60244 notifyComplete() { 60245 } 60246 _next(value) { 60247 if (this.toRespond.length === 0) { 60248 const args = [value, ...this.values]; 60249 if (this.project) { 60250 this._tryProject(args); 60251 } 60252 else { 60253 this.destination.next(args); 60254 } 60255 } 60256 } 60257 _tryProject(args) { 60258 let result; 60259 try { 60260 result = this.project.apply(this, args); 60261 } 60262 catch (err) { 60263 this.destination.error(err); 60264 return; 60265 } 60266 this.destination.next(result); 60267 } 60268} 60269//# sourceMappingURL=withLatestFrom.js.map 60270 60271/***/ }), 60272
vendor: 963 bytes, lines 60273-60293
60273/***/ "./node_modules/rxjs/_esm2015/internal/operators/zip.js": 60274/*!**************************************************************!*\ 60275 !*** ./node_modules/rxjs/_esm2015/internal/operators/zip.js ***! 60276 \**************************************************************/ 60277/*! exports provided: zip */ 60278/***/ (function(module, __webpack_exports__, __webpack_require__) { 60279 60280"use strict"; 60281__webpack_require__.r(__webpack_exports__); 60282/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; }); 60283/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/zip */ "./node_modules/rxjs/_esm2015/internal/observable/zip.js"); 60284 60285function zip(...observables) { 60286 return function zipOperatorFunction(source) { 60287 return source.lift.call(Object(_observable_zip__WEBPACK_IMPORTED_MODULE_0__["zip"])(source, ...observables)); 60288 }; 60289} 60290//# sourceMappingURL=zip.js.map 60291 60292/***/ }), 60293
vendor: 918 bytes, lines 60294-60312
60294/***/ "./node_modules/rxjs/_esm2015/internal/operators/zipAll.js": 60295/*!*****************************************************************!*\ 60296 !*** ./node_modules/rxjs/_esm2015/internal/operators/zipAll.js ***! 60297 \*****************************************************************/ 60298/*! exports provided: zipAll */ 60299/***/ (function(module, __webpack_exports__, __webpack_require__) { 60300 60301"use strict"; 60302__webpack_require__.r(__webpack_exports__); 60303/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return zipAll; }); 60304/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/zip */ "./node_modules/rxjs/_esm2015/internal/observable/zip.js"); 60305 60306function zipAll(project) { 60307 return (source) => source.lift(new _observable_zip__WEBPACK_IMPORTED_MODULE_0__["ZipOperator"](project)); 60308} 60309//# sourceMappingURL=zipAll.js.map 60310 60311/***/ }), 60312
vendor: 1,571 bytes, lines 60313-60347
60313/***/ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js": 60314/*!************************************************************************!*\ 60315 !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js ***! 60316 \************************************************************************/ 60317/*! exports provided: scheduleArray */ 60318/***/ (function(module, __webpack_exports__, __webpack_require__) { 60319 60320"use strict"; 60321__webpack_require__.r(__webpack_exports__); 60322/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleArray", function() { return scheduleArray; }); 60323/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 60324/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 60325 60326 60327function scheduleArray(input, scheduler) { 60328 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 60329 const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); 60330 let i = 0; 60331 sub.add(scheduler.schedule(function () { 60332 if (i === input.length) { 60333 subscriber.complete(); 60334 return; 60335 } 60336 subscriber.next(input[i++]); 60337 if (!subscriber.closed) { 60338 sub.add(this.schedule()); 60339 } 60340 })); 60341 return sub; 60342 }); 60343} 60344//# sourceMappingURL=scheduleArray.js.map 60345 60346/***/ }), 60347
vendor: 2,561 bytes, lines 60348-60408
60348/***/ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduleIterable.js": 60349/*!***************************************************************************!*\ 60350 !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleIterable.js ***! 60351 \***************************************************************************/ 60352/*! exports provided: scheduleIterable */ 60353/***/ (function(module, __webpack_exports__, __webpack_require__) { 60354 60355"use strict"; 60356__webpack_require__.r(__webpack_exports__); 60357/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleIterable", function() { return scheduleIterable; }); 60358/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 60359/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 60360/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../symbol/iterator */ "./node_modules/rxjs/_esm2015/internal/symbol/iterator.js"); 60361 60362 60363 60364function scheduleIterable(input, scheduler) { 60365 if (!input) { 60366 throw new Error('Iterable cannot be null'); 60367 } 60368 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 60369 const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); 60370 let iterator; 60371 sub.add(() => { 60372 if (iterator && typeof iterator.return === 'function') { 60373 iterator.return(); 60374 } 60375 }); 60376 sub.add(scheduler.schedule(() => { 60377 iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__["iterator"]](); 60378 sub.add(scheduler.schedule(function () { 60379 if (subscriber.closed) { 60380 return; 60381 } 60382 let value; 60383 let done; 60384 try { 60385 const result = iterator.next(); 60386 value = result.value; 60387 done = result.done; 60388 } 60389 catch (err) { 60390 subscriber.error(err); 60391 return; 60392 } 60393 if (done) { 60394 subscriber.complete(); 60395 } 60396 else { 60397 subscriber.next(value); 60398 this.schedule(); 60399 } 60400 })); 60401 })); 60402 return sub; 60403 }); 60404} 60405//# sourceMappingURL=scheduleIterable.js.map 60406 60407/***/ }), 60408
vendor: 1,963 bytes, lines 60409-60442
60409/***/ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduleObservable.js": 60410/*!*****************************************************************************!*\ 60411 !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleObservable.js ***! 60412 \*****************************************************************************/ 60413/*! exports provided: scheduleObservable */ 60414/***/ (function(module, __webpack_exports__, __webpack_require__) { 60415 60416"use strict"; 60417__webpack_require__.r(__webpack_exports__); 60418/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleObservable", function() { return scheduleObservable; }); 60419/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 60420/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 60421/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../symbol/observable */ "./node_modules/rxjs/_esm2015/internal/symbol/observable.js"); 60422 60423 60424 60425function scheduleObservable(input, scheduler) { 60426 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 60427 const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); 60428 sub.add(scheduler.schedule(() => { 60429 const observable = input[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]](); 60430 sub.add(observable.subscribe({ 60431 next(value) { sub.add(scheduler.schedule(() => subscriber.next(value))); }, 60432 error(err) { sub.add(scheduler.schedule(() => subscriber.error(err))); }, 60433 complete() { sub.add(scheduler.schedule(() => subscriber.complete())); }, 60434 })); 60435 })); 60436 return sub; 60437 }); 60438} 60439//# sourceMappingURL=scheduleObservable.js.map 60440 60441/***/ }), 60442
vendor: 1,603 bytes, lines 60443-60474
60443/***/ "./node_modules/rxjs/_esm2015/internal/scheduled/schedulePromise.js": 60444/*!**************************************************************************!*\ 60445 !*** ./node_modules/rxjs/_esm2015/internal/scheduled/schedulePromise.js ***! 60446 \**************************************************************************/ 60447/*! exports provided: schedulePromise */ 60448/***/ (function(module, __webpack_exports__, __webpack_require__) { 60449 60450"use strict"; 60451__webpack_require__.r(__webpack_exports__); 60452/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "schedulePromise", function() { return schedulePromise; }); 60453/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 60454/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 60455 60456 60457function schedulePromise(input, scheduler) { 60458 return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => { 60459 const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); 60460 sub.add(scheduler.schedule(() => input.then(value => { 60461 sub.add(scheduler.schedule(() => { 60462 subscriber.next(value); 60463 sub.add(scheduler.schedule(() => subscriber.complete())); 60464 })); 60465 }, err => { 60466 sub.add(scheduler.schedule(() => subscriber.error(err))); 60467 }))); 60468 return sub; 60469 }); 60470} 60471//# sourceMappingURL=schedulePromise.js.map 60472 60473/***/ }), 60474
vendor: 3,215 bytes, lines 60475-60521
60475/***/ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduled.js": 60476/*!********************************************************************!*\ 60477 !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduled.js ***! 60478 \********************************************************************/ 60479/*! exports provided: scheduled */ 60480/***/ (function(module, __webpack_exports__, __webpack_require__) { 60481 60482"use strict"; 60483__webpack_require__.r(__webpack_exports__); 60484/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduled", function() { return scheduled; }); 60485/* harmony import */ var _scheduleObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scheduleObservable */ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduleObservable.js"); 60486/* harmony import */ var _schedulePromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./schedulePromise */ "./node_modules/rxjs/_esm2015/internal/scheduled/schedulePromise.js"); 60487/* harmony import */ var _scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scheduleArray */ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js"); 60488/* harmony import */ var _scheduleIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scheduleIterable */ "./node_modules/rxjs/_esm2015/internal/scheduled/scheduleIterable.js"); 60489/* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isInteropObservable */ "./node_modules/rxjs/_esm2015/internal/util/isInteropObservable.js"); 60490/* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isPromise */ "./node_modules/rxjs/_esm2015/internal/util/isPromise.js"); 60491/* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/isArrayLike */ "./node_modules/rxjs/_esm2015/internal/util/isArrayLike.js"); 60492/* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/isIterable */ "./node_modules/rxjs/_esm2015/internal/util/isIterable.js"); 60493 60494 60495 60496 60497 60498 60499 60500 60501function scheduled(input, scheduler) { 60502 if (input != null) { 60503 if (Object(_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__["isInteropObservable"])(input)) { 60504 return Object(_scheduleObservable__WEBPACK_IMPORTED_MODULE_0__["scheduleObservable"])(input, scheduler); 60505 } 60506 else if (Object(_util_isPromise__WEBPACK_IMPORTED_MODULE_5__["isPromise"])(input)) { 60507 return Object(_schedulePromise__WEBPACK_IMPORTED_MODULE_1__["schedulePromise"])(input, scheduler); 60508 } 60509 else if (Object(_util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__["isArrayLike"])(input)) { 60510 return Object(_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(input, scheduler); 60511 } 60512 else if (Object(_util_isIterable__WEBPACK_IMPORTED_MODULE_7__["isIterable"])(input) || typeof input === 'string') { 60513 return Object(_scheduleIterable__WEBPACK_IMPORTED_MODULE_3__["scheduleIterable"])(input, scheduler); 60514 } 60515 } 60516 throw new TypeError((input !== null && typeof input || input) + ' is not observable'); 60517} 60518//# sourceMappingURL=scheduled.js.map 60519 60520/***/ }), 60521
vendor: 975 bytes, lines 60522-60545
60522/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/Action.js": 60523/*!*****************************************************************!*\ 60524 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/Action.js ***! 60525 \*****************************************************************/ 60526/*! exports provided: Action */ 60527/***/ (function(module, __webpack_exports__, __webpack_require__) { 60528 60529"use strict"; 60530__webpack_require__.r(__webpack_exports__); 60531/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; }); 60532/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscription */ "./node_modules/rxjs/_esm2015/internal/Subscription.js"); 60533 60534class Action extends _Subscription__WEBPACK_IMPORTED_MODULE_0__["Subscription"] { 60535 constructor(scheduler, work) { 60536 super(); 60537 } 60538 schedule(state, delay = 0) { 60539 return this; 60540 } 60541} 60542//# sourceMappingURL=Action.js.map 60543 60544/***/ }), 60545
vendor: 1,817 bytes, lines 60546-60585
60546/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameAction.js": 60547/*!*******************************************************************************!*\ 60548 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameAction.js ***! 60549 \*******************************************************************************/ 60550/*! exports provided: AnimationFrameAction */ 60551/***/ (function(module, __webpack_exports__, __webpack_require__) { 60552 60553"use strict"; 60554__webpack_require__.r(__webpack_exports__); 60555/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameAction", function() { return AnimationFrameAction; }); 60556/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js"); 60557 60558class AnimationFrameAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"] { 60559 constructor(scheduler, work) { 60560 super(scheduler, work); 60561 this.scheduler = scheduler; 60562 this.work = work; 60563 } 60564 requestAsyncId(scheduler, id, delay = 0) { 60565 if (delay !== null && delay > 0) { 60566 return super.requestAsyncId(scheduler, id, delay); 60567 } 60568 scheduler.actions.push(this); 60569 return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(() => scheduler.flush(null))); 60570 } 60571 recycleAsyncId(scheduler, id, delay = 0) { 60572 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) { 60573 return super.recycleAsyncId(scheduler, id, delay); 60574 } 60575 if (scheduler.actions.length === 0) { 60576 cancelAnimationFrame(id); 60577 scheduler.scheduled = undefined; 60578 } 60579 return undefined; 60580 } 60581} 60582//# sourceMappingURL=AnimationFrameAction.js.map 60583 60584/***/ }), 60585
vendor: 1,666 bytes, lines 60586-60624
60586/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameScheduler.js": 60587/*!**********************************************************************************!*\ 60588 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameScheduler.js ***! 60589 \**********************************************************************************/ 60590/*! exports provided: AnimationFrameScheduler */ 60591/***/ (function(module, __webpack_exports__, __webpack_require__) { 60592 60593"use strict"; 60594__webpack_require__.r(__webpack_exports__); 60595/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameScheduler", function() { return AnimationFrameScheduler; }); 60596/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js"); 60597 60598class AnimationFrameScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__["AsyncScheduler"] { 60599 flush(action) { 60600 this.active = true; 60601 this.scheduled = undefined; 60602 const { actions } = this; 60603 let error; 60604 let index = -1; 60605 let count = actions.length; 60606 action = action || actions.shift(); 60607 do { 60608 if (error = action.execute(action.state, action.delay)) { 60609 break; 60610 } 60611 } while (++index < count && (action = actions.shift())); 60612 this.active = false; 60613 if (error) { 60614 while (++index < count && (action = actions.shift())) { 60615 action.unsubscribe(); 60616 } 60617 throw error; 60618 } 60619 } 60620} 60621//# sourceMappingURL=AnimationFrameScheduler.js.map 60622 60623/***/ }), 60624
vendor: 2,016 bytes, lines 60625-60666
60625/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/AsapAction.js": 60626/*!*********************************************************************!*\ 60627 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AsapAction.js ***! 60628 \*********************************************************************/ 60629/*! exports provided: AsapAction */ 60630/***/ (function(module, __webpack_exports__, __webpack_require__) { 60631 60632"use strict"; 60633__webpack_require__.r(__webpack_exports__); 60634/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapAction", function() { return AsapAction; }); 60635/* harmony import */ var _util_Immediate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/Immediate */ "./node_modules/rxjs/_esm2015/internal/util/Immediate.js"); 60636/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js"); 60637 60638 60639class AsapAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"] { 60640 constructor(scheduler, work) { 60641 super(scheduler, work); 60642 this.scheduler = scheduler; 60643 this.work = work; 60644 } 60645 requestAsyncId(scheduler, id, delay = 0) { 60646 if (delay !== null && delay > 0) { 60647 return super.requestAsyncId(scheduler, id, delay); 60648 } 60649 scheduler.actions.push(this); 60650 return scheduler.scheduled || (scheduler.scheduled = _util_Immediate__WEBPACK_IMPORTED_MODULE_0__["Immediate"].setImmediate(scheduler.flush.bind(scheduler, null))); 60651 } 60652 recycleAsyncId(scheduler, id, delay = 0) { 60653 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) { 60654 return super.recycleAsyncId(scheduler, id, delay); 60655 } 60656 if (scheduler.actions.length === 0) { 60657 _util_Immediate__WEBPACK_IMPORTED_MODULE_0__["Immediate"].clearImmediate(id); 60658 scheduler.scheduled = undefined; 60659 } 60660 return undefined; 60661 } 60662} 60663//# sourceMappingURL=AsapAction.js.map 60664 60665/***/ }), 60666
vendor: 1,576 bytes, lines 60667-60705
60667/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/AsapScheduler.js": 60668/*!************************************************************************!*\ 60669 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AsapScheduler.js ***! 60670 \************************************************************************/ 60671/*! exports provided: AsapScheduler */ 60672/***/ (function(module, __webpack_exports__, __webpack_require__) { 60673 60674"use strict"; 60675__webpack_require__.r(__webpack_exports__); 60676/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapScheduler", function() { return AsapScheduler; }); 60677/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js"); 60678 60679class AsapScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__["AsyncScheduler"] { 60680 flush(action) { 60681 this.active = true; 60682 this.scheduled = undefined; 60683 const { actions } = this; 60684 let error; 60685 let index = -1; 60686 let count = actions.length; 60687 action = action || actions.shift(); 60688 do { 60689 if (error = action.execute(action.state, action.delay)) { 60690 break; 60691 } 60692 } while (++index < count && (action = actions.shift())); 60693 this.active = false; 60694 if (error) { 60695 while (++index < count && (action = actions.shift())) { 60696 action.unsubscribe(); 60697 } 60698 throw error; 60699 } 60700 } 60701} 60702//# sourceMappingURL=AsapScheduler.js.map 60703 60704/***/ }), 60705
vendor: 3,125 bytes, lines 60706-60799
60706/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js": 60707/*!**********************************************************************!*\ 60708 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js ***! 60709 \**********************************************************************/ 60710/*! exports provided: AsyncAction */ 60711/***/ (function(module, __webpack_exports__, __webpack_require__) { 60712 60713"use strict"; 60714__webpack_require__.r(__webpack_exports__); 60715/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncAction", function() { return AsyncAction; }); 60716/* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Action */ "./node_modules/rxjs/_esm2015/internal/scheduler/Action.js"); 60717 60718class AsyncAction extends _Action__WEBPACK_IMPORTED_MODULE_0__["Action"] { 60719 constructor(scheduler, work) { 60720 super(scheduler, work); 60721 this.scheduler = scheduler; 60722 this.work = work; 60723 this.pending = false; 60724 } 60725 schedule(state, delay = 0) { 60726 if (this.closed) { 60727 return this; 60728 } 60729 this.state = state; 60730 const id = this.id; 60731 const scheduler = this.scheduler; 60732 if (id != null) { 60733 this.id = this.recycleAsyncId(scheduler, id, delay); 60734 } 60735 this.pending = true; 60736 this.delay = delay; 60737 this.id = this.id || this.requestAsyncId(scheduler, this.id, delay); 60738 return this; 60739 } 60740 requestAsyncId(scheduler, id, delay = 0) { 60741 return setInterval(scheduler.flush.bind(scheduler, this), delay); 60742 } 60743 recycleAsyncId(scheduler, id, delay = 0) { 60744 if (delay !== null && this.delay === delay && this.pending === false) { 60745 return id; 60746 } 60747 clearInterval(id); 60748 return undefined; 60749 } 60750 execute(state, delay) { 60751 if (this.closed) { 60752 return new Error('executing a cancelled action'); 60753 } 60754 this.pending = false; 60755 const error = this._execute(state, delay); 60756 if (error) { 60757 return error; 60758 } 60759 else if (this.pending === false && this.id != null) { 60760 this.id = this.recycleAsyncId(this.scheduler, this.id, null); 60761 } 60762 } 60763 _execute(state, delay) { 60764 let errored = false; 60765 let errorValue = undefined; 60766 try { 60767 this.work(state); 60768 } 60769 catch (e) { 60770 errored = true; 60771 errorValue = !!e && e || new Error(e); 60772 } 60773 if (errored) { 60774 this.unsubscribe(); 60775 return errorValue; 60776 } 60777 } 60778 _unsubscribe() { 60779 const id = this.id; 60780 const scheduler = this.scheduler; 60781 const actions = scheduler.actions; 60782 const index = actions.indexOf(this); 60783 this.work = null; 60784 this.state = null; 60785 this.pending = false; 60786 this.scheduler = null; 60787 if (index !== -1) { 60788 actions.splice(index, 1); 60789 } 60790 if (id != null) { 60791 this.id = this.recycleAsyncId(scheduler, id, null); 60792 } 60793 this.delay = null; 60794 } 60795} 60796//# sourceMappingURL=AsyncAction.js.map 60797 60798/***/ }), 60799
vendor: 2,201 bytes, lines 60800-60859
60800/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js": 60801/*!*************************************************************************!*\ 60802 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js ***! 60803 \*************************************************************************/ 60804/*! exports provided: AsyncScheduler */ 60805/***/ (function(module, __webpack_exports__, __webpack_require__) { 60806 60807"use strict"; 60808__webpack_require__.r(__webpack_exports__); 60809/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncScheduler", function() { return AsyncScheduler; }); 60810/* harmony import */ var _Scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Scheduler */ "./node_modules/rxjs/_esm2015/internal/Scheduler.js"); 60811 60812class AsyncScheduler extends _Scheduler__WEBPACK_IMPORTED_MODULE_0__["Scheduler"] { 60813 constructor(SchedulerAction, now = _Scheduler__WEBPACK_IMPORTED_MODULE_0__["Scheduler"].now) { 60814 super(SchedulerAction, () => { 60815 if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) { 60816 return AsyncScheduler.delegate.now(); 60817 } 60818 else { 60819 return now(); 60820 } 60821 }); 60822 this.actions = []; 60823 this.active = false; 60824 this.scheduled = undefined; 60825 } 60826 schedule(work, delay = 0, state) { 60827 if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) { 60828 return AsyncScheduler.delegate.schedule(work, delay, state); 60829 } 60830 else { 60831 return super.schedule(work, delay, state); 60832 } 60833 } 60834 flush(action) { 60835 const { actions } = this; 60836 if (this.active) { 60837 actions.push(action); 60838 return; 60839 } 60840 let error; 60841 this.active = true; 60842 do { 60843 if (error = action.execute(action.state, action.delay)) { 60844 break; 60845 } 60846 } while (action = actions.shift()); 60847 this.active = false; 60848 if (error) { 60849 while (action = actions.shift()) { 60850 action.unsubscribe(); 60851 } 60852 throw error; 60853 } 60854 } 60855} 60856//# sourceMappingURL=AsyncScheduler.js.map 60857 60858/***/ }), 60859
vendor: 1,685 bytes, lines 60860-60902
60860/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/QueueAction.js": 60861/*!**********************************************************************!*\ 60862 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/QueueAction.js ***! 60863 \**********************************************************************/ 60864/*! exports provided: QueueAction */ 60865/***/ (function(module, __webpack_exports__, __webpack_require__) { 60866 60867"use strict"; 60868__webpack_require__.r(__webpack_exports__); 60869/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueAction", function() { return QueueAction; }); 60870/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js"); 60871 60872class QueueAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"] { 60873 constructor(scheduler, work) { 60874 super(scheduler, work); 60875 this.scheduler = scheduler; 60876 this.work = work; 60877 } 60878 schedule(state, delay = 0) { 60879 if (delay > 0) { 60880 return super.schedule(state, delay); 60881 } 60882 this.delay = delay; 60883 this.state = state; 60884 this.scheduler.flush(this); 60885 return this; 60886 } 60887 execute(state, delay) { 60888 return (delay > 0 || this.closed) ? 60889 super.execute(state, delay) : 60890 this._execute(state, delay); 60891 } 60892 requestAsyncId(scheduler, id, delay = 0) { 60893 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) { 60894 return super.requestAsyncId(scheduler, id, delay); 60895 } 60896 return scheduler.flush(this); 60897 } 60898} 60899//# sourceMappingURL=QueueAction.js.map 60900 60901/***/ }), 60902
vendor: 948 bytes, lines 60903-60920
60903/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/QueueScheduler.js": 60904/*!*************************************************************************!*\ 60905 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/QueueScheduler.js ***! 60906 \*************************************************************************/ 60907/*! exports provided: QueueScheduler */ 60908/***/ (function(module, __webpack_exports__, __webpack_require__) { 60909 60910"use strict"; 60911__webpack_require__.r(__webpack_exports__); 60912/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueScheduler", function() { return QueueScheduler; }); 60913/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js"); 60914 60915class QueueScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__["AsyncScheduler"] { 60916} 60917//# sourceMappingURL=QueueScheduler.js.map 60918 60919/***/ }), 60920
vendor: 3,613 bytes, lines 60921-61018
60921/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/VirtualTimeScheduler.js": 60922/*!*******************************************************************************!*\ 60923 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/VirtualTimeScheduler.js ***! 60924 \*******************************************************************************/ 60925/*! exports provided: VirtualTimeScheduler, VirtualAction */ 60926/***/ (function(module, __webpack_exports__, __webpack_require__) { 60927 60928"use strict"; 60929__webpack_require__.r(__webpack_exports__); 60930/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return VirtualTimeScheduler; }); 60931/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return VirtualAction; }); 60932/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js"); 60933/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js"); 60934 60935 60936class VirtualTimeScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"] { 60937 constructor(SchedulerAction = VirtualAction, maxFrames = Number.POSITIVE_INFINITY) { 60938 super(SchedulerAction, () => this.frame); 60939 this.maxFrames = maxFrames; 60940 this.frame = 0; 60941 this.index = -1; 60942 } 60943 flush() { 60944 const { actions, maxFrames } = this; 60945 let error, action; 60946 while ((action = actions[0]) && action.delay <= maxFrames) { 60947 actions.shift(); 60948 this.frame = action.delay; 60949 if (error = action.execute(action.state, action.delay)) { 60950 break; 60951 } 60952 } 60953 if (error) { 60954 while (action = actions.shift()) { 60955 action.unsubscribe(); 60956 } 60957 throw error; 60958 } 60959 } 60960} 60961VirtualTimeScheduler.frameTimeFactor = 10; 60962class VirtualAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"] { 60963 constructor(scheduler, work, index = scheduler.index += 1) { 60964 super(scheduler, work); 60965 this.scheduler = scheduler; 60966 this.work = work; 60967 this.index = index; 60968 this.active = true; 60969 this.index = scheduler.index = index; 60970 } 60971 schedule(state, delay = 0) { 60972 if (!this.id) { 60973 return super.schedule(state, delay); 60974 } 60975 this.active = false; 60976 const action = new VirtualAction(this.scheduler, this.work); 60977 this.add(action); 60978 return action.schedule(state, delay); 60979 } 60980 requestAsyncId(scheduler, id, delay = 0) { 60981 this.delay = scheduler.frame + delay; 60982 const { actions } = scheduler; 60983 actions.push(this); 60984 actions.sort(VirtualAction.sortActions); 60985 return true; 60986 } 60987 recycleAsyncId(scheduler, id, delay = 0) { 60988 return undefined; 60989 } 60990 _execute(state, delay) { 60991 if (this.active === true) { 60992 return super._execute(state, delay); 60993 } 60994 } 60995 static sortActions(a, b) { 60996 if (a.delay === b.delay) { 60997 if (a.index === b.index) { 60998 return 0; 60999 } 61000 else if (a.index > b.index) { 61001 return 1; 61002 } 61003 else { 61004 return -1; 61005 } 61006 } 61007 else if (a.delay > b.delay) { 61008 return 1; 61009 } 61010 else { 61011 return -1; 61012 } 61013 } 61014} 61015//# sourceMappingURL=VirtualTimeScheduler.js.map 61016 61017/***/ }), 61018
vendor: 1,269 bytes, lines 61019-61037
61019/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/animationFrame.js": 61020/*!*************************************************************************!*\ 61021 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/animationFrame.js ***! 61022 \*************************************************************************/ 61023/*! exports provided: animationFrame */ 61024/***/ (function(module, __webpack_exports__, __webpack_require__) { 61025 61026"use strict"; 61027__webpack_require__.r(__webpack_exports__); 61028/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrame", function() { return animationFrame; }); 61029/* harmony import */ var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AnimationFrameAction */ "./node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameAction.js"); 61030/* harmony import */ var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AnimationFrameScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameScheduler.js"); 61031 61032 61033const animationFrame = new _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__["AnimationFrameScheduler"](_AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__["AnimationFrameAction"]); 61034//# sourceMappingURL=animationFrame.js.map 61035 61036/***/ }), 61037
vendor: 1,079 bytes, lines 61038-61056
61038/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/asap.js": 61039/*!***************************************************************!*\ 61040 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/asap.js ***! 61041 \***************************************************************/ 61042/*! exports provided: asap */ 61043/***/ (function(module, __webpack_exports__, __webpack_require__) { 61044 61045"use strict"; 61046__webpack_require__.r(__webpack_exports__); 61047/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asap", function() { return asap; }); 61048/* harmony import */ var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsapAction */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsapAction.js"); 61049/* harmony import */ var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsapScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsapScheduler.js"); 61050 61051 61052const asap = new _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__["AsapScheduler"](_AsapAction__WEBPACK_IMPORTED_MODULE_0__["AsapAction"]); 61053//# sourceMappingURL=asap.js.map 61054 61055/***/ }), 61056
vendor: 1,098 bytes, lines 61057-61075
61057/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/async.js": 61058/*!****************************************************************!*\ 61059 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/async.js ***! 61060 \****************************************************************/ 61061/*! exports provided: async */ 61062/***/ (function(module, __webpack_exports__, __webpack_require__) { 61063 61064"use strict"; 61065__webpack_require__.r(__webpack_exports__); 61066/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "async", function() { return async; }); 61067/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js"); 61068/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js"); 61069 61070 61071const async = new _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"](_AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"]); 61072//# sourceMappingURL=async.js.map 61073 61074/***/ }), 61075
vendor: 1,098 bytes, lines 61076-61094
61076/***/ "./node_modules/rxjs/_esm2015/internal/scheduler/queue.js": 61077/*!****************************************************************!*\ 61078 !*** ./node_modules/rxjs/_esm2015/internal/scheduler/queue.js ***! 61079 \****************************************************************/ 61080/*! exports provided: queue */ 61081/***/ (function(module, __webpack_exports__, __webpack_require__) { 61082 61083"use strict"; 61084__webpack_require__.r(__webpack_exports__); 61085/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "queue", function() { return queue; }); 61086/* harmony import */ var _QueueAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./QueueAction */ "./node_modules/rxjs/_esm2015/internal/scheduler/QueueAction.js"); 61087/* harmony import */ var _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./QueueScheduler */ "./node_modules/rxjs/_esm2015/internal/scheduler/QueueScheduler.js"); 61088 61089 61090const queue = new _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__["QueueScheduler"](_QueueAction__WEBPACK_IMPORTED_MODULE_0__["QueueAction"]); 61091//# sourceMappingURL=queue.js.map 61092 61093/***/ }), 61094
vendor: 1,121 bytes, lines 61095-61118
61095/***/ "./node_modules/rxjs/_esm2015/internal/symbol/iterator.js": 61096/*!****************************************************************!*\ 61097 !*** ./node_modules/rxjs/_esm2015/internal/symbol/iterator.js ***! 61098 \****************************************************************/ 61099/*! exports provided: getSymbolIterator, iterator, $$iterator */ 61100/***/ (function(module, __webpack_exports__, __webpack_require__) { 61101 61102"use strict"; 61103__webpack_require__.r(__webpack_exports__); 61104/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSymbolIterator", function() { return getSymbolIterator; }); 61105/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iterator", function() { return iterator; }); 61106/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$iterator", function() { return $$iterator; }); 61107function getSymbolIterator() { 61108 if (typeof Symbol !== 'function' || !Symbol.iterator) { 61109 return '@@iterator'; 61110 } 61111 return Symbol.iterator; 61112} 61113const iterator = getSymbolIterator(); 61114const $$iterator = iterator; 61115//# sourceMappingURL=iterator.js.map 61116 61117/***/ }), 61118
vendor: 719 bytes, lines 61119-61133
61119/***/ "./node_modules/rxjs/_esm2015/internal/symbol/observable.js": 61120/*!******************************************************************!*\ 61121 !*** ./node_modules/rxjs/_esm2015/internal/symbol/observable.js ***! 61122 \******************************************************************/ 61123/*! exports provided: observable */ 61124/***/ (function(module, __webpack_exports__, __webpack_require__) { 61125 61126"use strict"; 61127__webpack_require__.r(__webpack_exports__); 61128/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return observable; }); 61129const observable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')(); 61130//# sourceMappingURL=observable.js.map 61131 61132/***/ }), 61133
vendor: 952 bytes, lines 61134-61152
61134/***/ "./node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js": 61135/*!********************************************************************!*\ 61136 !*** ./node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js ***! 61137 \********************************************************************/ 61138/*! exports provided: rxSubscriber, $$rxSubscriber */ 61139/***/ (function(module, __webpack_exports__, __webpack_require__) { 61140 61141"use strict"; 61142__webpack_require__.r(__webpack_exports__); 61143/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rxSubscriber", function() { return rxSubscriber; }); 61144/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$rxSubscriber", function() { return $$rxSubscriber; }); 61145const rxSubscriber = (() => typeof Symbol === 'function' 61146 ? Symbol('rxSubscriber') 61147 : '@@rxSubscriber_' + Math.random())(); 61148const $$rxSubscriber = rxSubscriber; 61149//# sourceMappingURL=rxSubscriber.js.map 61150 61151/***/ }), 61152
vendor: 1,138 bytes, lines 61153-61177
61153/***/ "./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js": 61154/*!*****************************************************************************!*\ 61155 !*** ./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js ***! 61156 \*****************************************************************************/ 61157/*! exports provided: ArgumentOutOfRangeError */ 61158/***/ (function(module, __webpack_exports__, __webpack_require__) { 61159 61160"use strict"; 61161__webpack_require__.r(__webpack_exports__); 61162/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return ArgumentOutOfRangeError; }); 61163const ArgumentOutOfRangeErrorImpl = (() => { 61164 function ArgumentOutOfRangeErrorImpl() { 61165 Error.call(this); 61166 this.message = 'argument out of range'; 61167 this.name = 'ArgumentOutOfRangeError'; 61168 return this; 61169 } 61170 ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype); 61171 return ArgumentOutOfRangeErrorImpl; 61172})(); 61173const ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl; 61174//# sourceMappingURL=ArgumentOutOfRangeError.js.map 61175 61176/***/ }), 61177
vendor: 945 bytes, lines 61178-61202
61178/***/ "./node_modules/rxjs/_esm2015/internal/util/EmptyError.js": 61179/*!****************************************************************!*\ 61180 !*** ./node_modules/rxjs/_esm2015/internal/util/EmptyError.js ***! 61181 \****************************************************************/ 61182/*! exports provided: EmptyError */ 61183/***/ (function(module, __webpack_exports__, __webpack_require__) { 61184 61185"use strict"; 61186__webpack_require__.r(__webpack_exports__); 61187/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return EmptyError; }); 61188const EmptyErrorImpl = (() => { 61189 function EmptyErrorImpl() { 61190 Error.call(this); 61191 this.message = 'no elements in sequence'; 61192 this.name = 'EmptyError'; 61193 return this; 61194 } 61195 EmptyErrorImpl.prototype = Object.create(Error.prototype); 61196 return EmptyErrorImpl; 61197})(); 61198const EmptyError = EmptyErrorImpl; 61199//# sourceMappingURL=EmptyError.js.map 61200 61201/***/ }), 61202
vendor: 1,371 bytes, lines 61203-61243
61203/***/ "./node_modules/rxjs/_esm2015/internal/util/Immediate.js": 61204/*!***************************************************************!*\ 61205 !*** ./node_modules/rxjs/_esm2015/internal/util/Immediate.js ***! 61206 \***************************************************************/ 61207/*! exports provided: Immediate, TestTools */ 61208/***/ (function(module, __webpack_exports__, __webpack_require__) { 61209 61210"use strict"; 61211__webpack_require__.r(__webpack_exports__); 61212/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Immediate", function() { return Immediate; }); 61213/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestTools", function() { return TestTools; }); 61214let nextHandle = 1; 61215const RESOLVED = (() => Promise.resolve())(); 61216const activeHandles = {}; 61217function findAndClearHandle(handle) { 61218 if (handle in activeHandles) { 61219 delete activeHandles[handle]; 61220 return true; 61221 } 61222 return false; 61223} 61224const Immediate = { 61225 setImmediate(cb) { 61226 const handle = nextHandle++; 61227 activeHandles[handle] = true; 61228 RESOLVED.then(() => findAndClearHandle(handle) && cb()); 61229 return handle; 61230 }, 61231 clearImmediate(handle) { 61232 findAndClearHandle(handle); 61233 }, 61234}; 61235const TestTools = { 61236 pending() { 61237 return Object.keys(activeHandles).length; 61238 } 61239}; 61240//# sourceMappingURL=Immediate.js.map 61241 61242/***/ }), 61243
vendor: 1,136 bytes, lines 61244-61268
61244/***/ "./node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js": 61245/*!*****************************************************************************!*\ 61246 !*** ./node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js ***! 61247 \*****************************************************************************/ 61248/*! exports provided: ObjectUnsubscribedError */ 61249/***/ (function(module, __webpack_exports__, __webpack_require__) { 61250 61251"use strict"; 61252__webpack_require__.r(__webpack_exports__); 61253/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return ObjectUnsubscribedError; }); 61254const ObjectUnsubscribedErrorImpl = (() => { 61255 function ObjectUnsubscribedErrorImpl() { 61256 Error.call(this); 61257 this.message = 'object unsubscribed'; 61258 this.name = 'ObjectUnsubscribedError'; 61259 return this; 61260 } 61261 ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype); 61262 return ObjectUnsubscribedErrorImpl; 61263})(); 61264const ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl; 61265//# sourceMappingURL=ObjectUnsubscribedError.js.map 61266 61267/***/ }), 61268
vendor: 972 bytes, lines 61269-61293
61269/***/ "./node_modules/rxjs/_esm2015/internal/util/TimeoutError.js": 61270/*!******************************************************************!*\ 61271 !*** ./node_modules/rxjs/_esm2015/internal/util/TimeoutError.js ***! 61272 \******************************************************************/ 61273/*! exports provided: TimeoutError */ 61274/***/ (function(module, __webpack_exports__, __webpack_require__) { 61275 61276"use strict"; 61277__webpack_require__.r(__webpack_exports__); 61278/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return TimeoutError; }); 61279const TimeoutErrorImpl = (() => { 61280 function TimeoutErrorImpl() { 61281 Error.call(this); 61282 this.message = 'Timeout has occurred'; 61283 this.name = 'TimeoutError'; 61284 return this; 61285 } 61286 TimeoutErrorImpl.prototype = Object.create(Error.prototype); 61287 return TimeoutErrorImpl; 61288})(); 61289const TimeoutError = TimeoutErrorImpl; 61290//# sourceMappingURL=TimeoutError.js.map 61291 61292/***/ }), 61293
vendor: 1,244 bytes, lines 61294-61321
61294/***/ "./node_modules/rxjs/_esm2015/internal/util/UnsubscriptionError.js": 61295/*!*************************************************************************!*\ 61296 !*** ./node_modules/rxjs/_esm2015/internal/util/UnsubscriptionError.js ***! 61297 \*************************************************************************/ 61298/*! exports provided: UnsubscriptionError */ 61299/***/ (function(module, __webpack_exports__, __webpack_require__) { 61300 61301"use strict"; 61302__webpack_require__.r(__webpack_exports__); 61303/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return UnsubscriptionError; }); 61304const UnsubscriptionErrorImpl = (() => { 61305 function UnsubscriptionErrorImpl(errors) { 61306 Error.call(this); 61307 this.message = errors ? 61308 `${errors.length} errors occurred during unsubscription: 61309${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : ''; 61310 this.name = 'UnsubscriptionError'; 61311 this.errors = errors; 61312 return this; 61313 } 61314 UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype); 61315 return UnsubscriptionErrorImpl; 61316})(); 61317const UnsubscriptionError = UnsubscriptionErrorImpl; 61318//# sourceMappingURL=UnsubscriptionError.js.map 61319 61320/***/ }), 61321
vendor: 1,240 bytes, lines 61322-61352
61322/***/ "./node_modules/rxjs/_esm2015/internal/util/canReportError.js": 61323/*!********************************************************************!*\ 61324 !*** ./node_modules/rxjs/_esm2015/internal/util/canReportError.js ***! 61325 \********************************************************************/ 61326/*! exports provided: canReportError */ 61327/***/ (function(module, __webpack_exports__, __webpack_require__) { 61328 61329"use strict"; 61330__webpack_require__.r(__webpack_exports__); 61331/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canReportError", function() { return canReportError; }); 61332/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 61333 61334function canReportError(observer) { 61335 while (observer) { 61336 const { closed, destination, isStopped } = observer; 61337 if (closed || isStopped) { 61338 return false; 61339 } 61340 else if (destination && destination instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) { 61341 observer = destination; 61342 } 61343 else { 61344 observer = null; 61345 } 61346 } 61347 return true; 61348} 61349//# sourceMappingURL=canReportError.js.map 61350 61351/***/ }), 61352
vendor: 728 bytes, lines 61353-61369
61353/***/ "./node_modules/rxjs/_esm2015/internal/util/hostReportError.js": 61354/*!*********************************************************************!*\ 61355 !*** ./node_modules/rxjs/_esm2015/internal/util/hostReportError.js ***! 61356 \*********************************************************************/ 61357/*! exports provided: hostReportError */ 61358/***/ (function(module, __webpack_exports__, __webpack_require__) { 61359 61360"use strict"; 61361__webpack_require__.r(__webpack_exports__); 61362/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hostReportError", function() { return hostReportError; }); 61363function hostReportError(err) { 61364 setTimeout(() => { throw err; }, 0); 61365} 61366//# sourceMappingURL=hostReportError.js.map 61367 61368/***/ }), 61369
vendor: 636 bytes, lines 61370-61386
61370/***/ "./node_modules/rxjs/_esm2015/internal/util/identity.js": 61371/*!**************************************************************!*\ 61372 !*** ./node_modules/rxjs/_esm2015/internal/util/identity.js ***! 61373 \**************************************************************/ 61374/*! exports provided: identity */ 61375/***/ (function(module, __webpack_exports__, __webpack_require__) { 61376 61377"use strict"; 61378__webpack_require__.r(__webpack_exports__); 61379/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; }); 61380function identity(x) { 61381 return x; 61382} 61383//# sourceMappingURL=identity.js.map 61384 61385/***/ }), 61386
vendor: 676 bytes, lines 61387-61401
61387/***/ "./node_modules/rxjs/_esm2015/internal/util/isArray.js": 61388/*!*************************************************************!*\ 61389 !*** ./node_modules/rxjs/_esm2015/internal/util/isArray.js ***! 61390 \*************************************************************/ 61391/*! exports provided: isArray */ 61392/***/ (function(module, __webpack_exports__, __webpack_require__) { 61393 61394"use strict"; 61395__webpack_require__.r(__webpack_exports__); 61396/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); 61397const isArray = (() => Array.isArray || ((x) => x && typeof x.length === 'number'))(); 61398//# sourceMappingURL=isArray.js.map 61399 61400/***/ }), 61401
vendor: 712 bytes, lines 61402-61416
61402/***/ "./node_modules/rxjs/_esm2015/internal/util/isArrayLike.js": 61403/*!*****************************************************************!*\ 61404 !*** ./node_modules/rxjs/_esm2015/internal/util/isArrayLike.js ***! 61405 \*****************************************************************/ 61406/*! exports provided: isArrayLike */ 61407/***/ (function(module, __webpack_exports__, __webpack_require__) { 61408 61409"use strict"; 61410__webpack_require__.r(__webpack_exports__); 61411/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return isArrayLike; }); 61412const isArrayLike = ((x) => x && typeof x.length === 'number' && typeof x !== 'function'); 61413//# sourceMappingURL=isArrayLike.js.map 61414 61415/***/ }), 61416
vendor: 660 bytes, lines 61417-61433
61417/***/ "./node_modules/rxjs/_esm2015/internal/util/isDate.js": 61418/*!************************************************************!*\ 61419 !*** ./node_modules/rxjs/_esm2015/internal/util/isDate.js ***! 61420 \************************************************************/ 61421/*! exports provided: isDate */ 61422/***/ (function(module, __webpack_exports__, __webpack_require__) { 61423 61424"use strict"; 61425__webpack_require__.r(__webpack_exports__); 61426/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return isDate; }); 61427function isDate(value) { 61428 return value instanceof Date && !isNaN(+value); 61429} 61430//# sourceMappingURL=isDate.js.map 61431 61432/***/ }), 61433
vendor: 676 bytes, lines 61434-61450
61434/***/ "./node_modules/rxjs/_esm2015/internal/util/isFunction.js": 61435/*!****************************************************************!*\ 61436 !*** ./node_modules/rxjs/_esm2015/internal/util/isFunction.js ***! 61437 \****************************************************************/ 61438/*! exports provided: isFunction */ 61439/***/ (function(module, __webpack_exports__, __webpack_require__) { 61440 61441"use strict"; 61442__webpack_require__.r(__webpack_exports__); 61443/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); 61444function isFunction(x) { 61445 return typeof x === 'function'; 61446} 61447//# sourceMappingURL=isFunction.js.map 61448 61449/***/ }), 61450
vendor: 1,024 bytes, lines 61451-61469
61451/***/ "./node_modules/rxjs/_esm2015/internal/util/isInteropObservable.js": 61452/*!*************************************************************************!*\ 61453 !*** ./node_modules/rxjs/_esm2015/internal/util/isInteropObservable.js ***! 61454 \*************************************************************************/ 61455/*! exports provided: isInteropObservable */ 61456/***/ (function(module, __webpack_exports__, __webpack_require__) { 61457 61458"use strict"; 61459__webpack_require__.r(__webpack_exports__); 61460/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInteropObservable", function() { return isInteropObservable; }); 61461/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ "./node_modules/rxjs/_esm2015/internal/symbol/observable.js"); 61462 61463function isInteropObservable(input) { 61464 return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]] === 'function'; 61465} 61466//# sourceMappingURL=isInteropObservable.js.map 61467 61468/***/ }), 61469
vendor: 933 bytes, lines 61470-61488
61470/***/ "./node_modules/rxjs/_esm2015/internal/util/isIterable.js": 61471/*!****************************************************************!*\ 61472 !*** ./node_modules/rxjs/_esm2015/internal/util/isIterable.js ***! 61473 \****************************************************************/ 61474/*! exports provided: isIterable */ 61475/***/ (function(module, __webpack_exports__, __webpack_require__) { 61476 61477"use strict"; 61478__webpack_require__.r(__webpack_exports__); 61479/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIterable", function() { return isIterable; }); 61480/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ "./node_modules/rxjs/_esm2015/internal/symbol/iterator.js"); 61481 61482function isIterable(input) { 61483 return input && typeof input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]] === 'function'; 61484} 61485//# sourceMappingURL=isIterable.js.map 61486 61487/***/ }), 61488
vendor: 905 bytes, lines 61489-61507
61489/***/ "./node_modules/rxjs/_esm2015/internal/util/isNumeric.js": 61490/*!***************************************************************!*\ 61491 !*** ./node_modules/rxjs/_esm2015/internal/util/isNumeric.js ***! 61492 \***************************************************************/ 61493/*! exports provided: isNumeric */ 61494/***/ (function(module, __webpack_exports__, __webpack_require__) { 61495 61496"use strict"; 61497__webpack_require__.r(__webpack_exports__); 61498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; }); 61499/* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray */ "./node_modules/rxjs/_esm2015/internal/util/isArray.js"); 61500 61501function isNumeric(val) { 61502 return !Object(_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(val) && (val - parseFloat(val) + 1) >= 0; 61503} 61504//# sourceMappingURL=isNumeric.js.map 61505 61506/***/ }), 61507
vendor: 670 bytes, lines 61508-61524
61508/***/ "./node_modules/rxjs/_esm2015/internal/util/isObject.js": 61509/*!**************************************************************!*\ 61510 !*** ./node_modules/rxjs/_esm2015/internal/util/isObject.js ***! 61511 \**************************************************************/ 61512/*! exports provided: isObject */ 61513/***/ (function(module, __webpack_exports__, __webpack_require__) { 61514 61515"use strict"; 61516__webpack_require__.r(__webpack_exports__); 61517/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); 61518function isObject(x) { 61519 return x !== null && typeof x === 'object'; 61520} 61521//# sourceMappingURL=isObject.js.map 61522 61523/***/ }), 61524
vendor: 994 bytes, lines 61525-61543
61525/***/ "./node_modules/rxjs/_esm2015/internal/util/isObservable.js": 61526/*!******************************************************************!*\ 61527 !*** ./node_modules/rxjs/_esm2015/internal/util/isObservable.js ***! 61528 \******************************************************************/ 61529/*! exports provided: isObservable */ 61530/***/ (function(module, __webpack_exports__, __webpack_require__) { 61531 61532"use strict"; 61533__webpack_require__.r(__webpack_exports__); 61534/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return isObservable; }); 61535/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 61536 61537function isObservable(obj) { 61538 return !!obj && (obj instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function')); 61539} 61540//# sourceMappingURL=isObservable.js.map 61541 61542/***/ }), 61543
vendor: 732 bytes, lines 61544-61560
61544/***/ "./node_modules/rxjs/_esm2015/internal/util/isPromise.js": 61545/*!***************************************************************!*\ 61546 !*** ./node_modules/rxjs/_esm2015/internal/util/isPromise.js ***! 61547 \***************************************************************/ 61548/*! exports provided: isPromise */ 61549/***/ (function(module, __webpack_exports__, __webpack_require__) { 61550 61551"use strict"; 61552__webpack_require__.r(__webpack_exports__); 61553/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromise", function() { return isPromise; }); 61554function isPromise(value) { 61555 return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function'; 61556} 61557//# sourceMappingURL=isPromise.js.map 61558 61559/***/ }), 61560
vendor: 711 bytes, lines 61561-61577
61561/***/ "./node_modules/rxjs/_esm2015/internal/util/isScheduler.js": 61562/*!*****************************************************************!*\ 61563 !*** ./node_modules/rxjs/_esm2015/internal/util/isScheduler.js ***! 61564 \*****************************************************************/ 61565/*! exports provided: isScheduler */ 61566/***/ (function(module, __webpack_exports__, __webpack_require__) { 61567 61568"use strict"; 61569__webpack_require__.r(__webpack_exports__); 61570/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isScheduler", function() { return isScheduler; }); 61571function isScheduler(value) { 61572 return value && typeof value.schedule === 'function'; 61573} 61574//# sourceMappingURL=isScheduler.js.map 61575 61576/***/ }), 61577
vendor: 585 bytes, lines 61578-61592
61578/***/ "./node_modules/rxjs/_esm2015/internal/util/noop.js": 61579/*!**********************************************************!*\ 61580 !*** ./node_modules/rxjs/_esm2015/internal/util/noop.js ***! 61581 \**********************************************************/ 61582/*! exports provided: noop */ 61583/***/ (function(module, __webpack_exports__, __webpack_require__) { 61584 61585"use strict"; 61586__webpack_require__.r(__webpack_exports__); 61587/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return noop; }); 61588function noop() { } 61589//# sourceMappingURL=noop.js.map 61590 61591/***/ }), 61592
vendor: 762 bytes, lines 61593-61614
61593/***/ "./node_modules/rxjs/_esm2015/internal/util/not.js": 61594/*!*********************************************************!*\ 61595 !*** ./node_modules/rxjs/_esm2015/internal/util/not.js ***! 61596 \*********************************************************/ 61597/*! exports provided: not */ 61598/***/ (function(module, __webpack_exports__, __webpack_require__) { 61599 61600"use strict"; 61601__webpack_require__.r(__webpack_exports__); 61602/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "not", function() { return not; }); 61603function not(pred, thisArg) { 61604 function notPred() { 61605 return !(notPred.pred.apply(notPred.thisArg, arguments)); 61606 } 61607 notPred.pred = pred; 61608 notPred.thisArg = thisArg; 61609 return notPred; 61610} 61611//# sourceMappingURL=not.js.map 61612 61613/***/ }), 61614
vendor: 1,221 bytes, lines 61615-61645
61615/***/ "./node_modules/rxjs/_esm2015/internal/util/pipe.js": 61616/*!**********************************************************!*\ 61617 !*** ./node_modules/rxjs/_esm2015/internal/util/pipe.js ***! 61618 \**********************************************************/ 61619/*! exports provided: pipe, pipeFromArray */ 61620/***/ (function(module, __webpack_exports__, __webpack_require__) { 61621 61622"use strict"; 61623__webpack_require__.r(__webpack_exports__); 61624/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return pipe; }); 61625/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipeFromArray", function() { return pipeFromArray; }); 61626/* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity */ "./node_modules/rxjs/_esm2015/internal/util/identity.js"); 61627 61628function pipe(...fns) { 61629 return pipeFromArray(fns); 61630} 61631function pipeFromArray(fns) { 61632 if (fns.length === 0) { 61633 return _identity__WEBPACK_IMPORTED_MODULE_0__["identity"]; 61634 } 61635 if (fns.length === 1) { 61636 return fns[0]; 61637 } 61638 return function piped(input) { 61639 return fns.reduce((prev, fn) => fn(prev), input); 61640 }; 61641} 61642//# sourceMappingURL=pipe.js.map 61643 61644/***/ }), 61645
vendor: 3,487 bytes, lines 61646-61697
61646/***/ "./node_modules/rxjs/_esm2015/internal/util/subscribeTo.js": 61647/*!*****************************************************************!*\ 61648 !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeTo.js ***! 61649 \*****************************************************************/ 61650/*! exports provided: subscribeTo */ 61651/***/ (function(module, __webpack_exports__, __webpack_require__) { 61652 61653"use strict"; 61654__webpack_require__.r(__webpack_exports__); 61655/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeTo", function() { return subscribeTo; }); 61656/* harmony import */ var _subscribeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subscribeToArray */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToArray.js"); 61657/* harmony import */ var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscribeToPromise */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToPromise.js"); 61658/* harmony import */ var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscribeToIterable */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToIterable.js"); 61659/* harmony import */ var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./subscribeToObservable */ "./node_modules/rxjs/_esm2015/internal/util/subscribeToObservable.js"); 61660/* harmony import */ var _isArrayLike__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike */ "./node_modules/rxjs/_esm2015/internal/util/isArrayLike.js"); 61661/* harmony import */ var _isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isPromise */ "./node_modules/rxjs/_esm2015/internal/util/isPromise.js"); 61662/* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isObject */ "./node_modules/rxjs/_esm2015/internal/util/isObject.js"); 61663/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../symbol/iterator */ "./node_modules/rxjs/_esm2015/internal/symbol/iterator.js"); 61664/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../symbol/observable */ "./node_modules/rxjs/_esm2015/internal/symbol/observable.js"); 61665 61666 61667 61668 61669 61670 61671 61672 61673 61674const subscribeTo = (result) => { 61675 if (!!result && typeof result[_symbol_observable__WEBPACK_IMPORTED_MODULE_8__["observable"]] === 'function') { 61676 return Object(_subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__["subscribeToObservable"])(result); 61677 } 61678 else if (Object(_isArrayLike__WEBPACK_IMPORTED_MODULE_4__["isArrayLike"])(result)) { 61679 return Object(_subscribeToArray__WEBPACK_IMPORTED_MODULE_0__["subscribeToArray"])(result); 61680 } 61681 else if (Object(_isPromise__WEBPACK_IMPORTED_MODULE_5__["isPromise"])(result)) { 61682 return Object(_subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__["subscribeToPromise"])(result); 61683 } 61684 else if (!!result && typeof result[_symbol_iterator__WEBPACK_IMPORTED_MODULE_7__["iterator"]] === 'function') { 61685 return Object(_subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__["subscribeToIterable"])(result); 61686 } 61687 else { 61688 const value = Object(_isObject__WEBPACK_IMPORTED_MODULE_6__["isObject"])(result) ? 'an invalid object' : `'${result}'`; 61689 const msg = `You provided ${value} where a stream was expected.` 61690 + ' You can provide an Observable, Promise, Array, or Iterable.'; 61691 throw new TypeError(msg); 61692 } 61693}; 61694//# sourceMappingURL=subscribeTo.js.map 61695 61696/***/ }), 61697
vendor: 864 bytes, lines 61698-61717
61698/***/ "./node_modules/rxjs/_esm2015/internal/util/subscribeToArray.js": 61699/*!**********************************************************************!*\ 61700 !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToArray.js ***! 61701 \**********************************************************************/ 61702/*! exports provided: subscribeToArray */ 61703/***/ (function(module, __webpack_exports__, __webpack_require__) { 61704 61705"use strict"; 61706__webpack_require__.r(__webpack_exports__); 61707/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToArray", function() { return subscribeToArray; }); 61708const subscribeToArray = (array) => (subscriber) => { 61709 for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) { 61710 subscriber.next(array[i]); 61711 } 61712 subscriber.complete(); 61713}; 61714//# sourceMappingURL=subscribeToArray.js.map 61715 61716/***/ }), 61717
vendor: 1,481 bytes, lines 61718-61755
61718/***/ "./node_modules/rxjs/_esm2015/internal/util/subscribeToIterable.js": 61719/*!*************************************************************************!*\ 61720 !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToIterable.js ***! 61721 \*************************************************************************/ 61722/*! exports provided: subscribeToIterable */ 61723/***/ (function(module, __webpack_exports__, __webpack_require__) { 61724 61725"use strict"; 61726__webpack_require__.r(__webpack_exports__); 61727/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToIterable", function() { return subscribeToIterable; }); 61728/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ "./node_modules/rxjs/_esm2015/internal/symbol/iterator.js"); 61729 61730const subscribeToIterable = (iterable) => (subscriber) => { 61731 const iterator = iterable[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]](); 61732 do { 61733 const item = iterator.next(); 61734 if (item.done) { 61735 subscriber.complete(); 61736 break; 61737 } 61738 subscriber.next(item.value); 61739 if (subscriber.closed) { 61740 break; 61741 } 61742 } while (true); 61743 if (typeof iterator.return === 'function') { 61744 subscriber.add(() => { 61745 if (iterator.return) { 61746 iterator.return(); 61747 } 61748 }); 61749 } 61750 return subscriber; 61751}; 61752//# sourceMappingURL=subscribeToIterable.js.map 61753 61754/***/ }), 61755
vendor: 1,241 bytes, lines 61756-61780
61756/***/ "./node_modules/rxjs/_esm2015/internal/util/subscribeToObservable.js": 61757/*!***************************************************************************!*\ 61758 !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToObservable.js ***! 61759 \***************************************************************************/ 61760/*! exports provided: subscribeToObservable */ 61761/***/ (function(module, __webpack_exports__, __webpack_require__) { 61762 61763"use strict"; 61764__webpack_require__.r(__webpack_exports__); 61765/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToObservable", function() { return subscribeToObservable; }); 61766/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ "./node_modules/rxjs/_esm2015/internal/symbol/observable.js"); 61767 61768const subscribeToObservable = (obj) => (subscriber) => { 61769 const obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]](); 61770 if (typeof obs.subscribe !== 'function') { 61771 throw new TypeError('Provided object does not correctly implement Symbol.observable'); 61772 } 61773 else { 61774 return obs.subscribe(subscriber); 61775 } 61776}; 61777//# sourceMappingURL=subscribeToObservable.js.map 61778 61779/***/ }), 61780
vendor: 1,217 bytes, lines 61781-61806
61781/***/ "./node_modules/rxjs/_esm2015/internal/util/subscribeToPromise.js": 61782/*!************************************************************************!*\ 61783 !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToPromise.js ***! 61784 \************************************************************************/ 61785/*! exports provided: subscribeToPromise */ 61786/***/ (function(module, __webpack_exports__, __webpack_require__) { 61787 61788"use strict"; 61789__webpack_require__.r(__webpack_exports__); 61790/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToPromise", function() { return subscribeToPromise; }); 61791/* harmony import */ var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hostReportError */ "./node_modules/rxjs/_esm2015/internal/util/hostReportError.js"); 61792 61793const subscribeToPromise = (promise) => (subscriber) => { 61794 promise.then((value) => { 61795 if (!subscriber.closed) { 61796 subscriber.next(value); 61797 subscriber.complete(); 61798 } 61799 }, (err) => subscriber.error(err)) 61800 .then(null, _hostReportError__WEBPACK_IMPORTED_MODULE_0__["hostReportError"]); 61801 return subscriber; 61802}; 61803//# sourceMappingURL=subscribeToPromise.js.map 61804 61805/***/ }), 61806
vendor: 1,706 bytes, lines 61807-61835
61807/***/ "./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js": 61808/*!***********************************************************************!*\ 61809 !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js ***! 61810 \***********************************************************************/ 61811/*! exports provided: subscribeToResult */ 61812/***/ (function(module, __webpack_exports__, __webpack_require__) { 61813 61814"use strict"; 61815__webpack_require__.r(__webpack_exports__); 61816/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToResult", function() { return subscribeToResult; }); 61817/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../InnerSubscriber */ "./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js"); 61818/* harmony import */ var _subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscribeTo */ "./node_modules/rxjs/_esm2015/internal/util/subscribeTo.js"); 61819/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observable */ "./node_modules/rxjs/_esm2015/internal/Observable.js"); 61820 61821 61822 61823function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__["InnerSubscriber"](outerSubscriber, outerValue, outerIndex)) { 61824 if (innerSubscriber.closed) { 61825 return undefined; 61826 } 61827 if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]) { 61828 return result.subscribe(innerSubscriber); 61829 } 61830 return Object(_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(result)(innerSubscriber); 61831} 61832//# sourceMappingURL=subscribeToResult.js.map 61833 61834/***/ }), 61835
vendor: 1,875 bytes, lines 61836-61869
61836/***/ "./node_modules/rxjs/_esm2015/internal/util/toSubscriber.js": 61837/*!******************************************************************!*\ 61838 !*** ./node_modules/rxjs/_esm2015/internal/util/toSubscriber.js ***! 61839 \******************************************************************/ 61840/*! exports provided: toSubscriber */ 61841/***/ (function(module, __webpack_exports__, __webpack_require__) { 61842 61843"use strict"; 61844__webpack_require__.r(__webpack_exports__); 61845/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toSubscriber", function() { return toSubscriber; }); 61846/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm2015/internal/Subscriber.js"); 61847/* harmony import */ var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../symbol/rxSubscriber */ "./node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js"); 61848/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observer */ "./node_modules/rxjs/_esm2015/internal/Observer.js"); 61849 61850 61851 61852function toSubscriber(nextOrObserver, error, complete) { 61853 if (nextOrObserver) { 61854 if (nextOrObserver instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) { 61855 return nextOrObserver; 61856 } 61857 if (nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]) { 61858 return nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]](); 61859 } 61860 } 61861 if (!nextOrObserver && !error && !complete) { 61862 return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](_Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]); 61863 } 61864 return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](nextOrObserver, error, complete); 61865} 61866//# sourceMappingURL=toSubscriber.js.map 61867 61868/***/ }), 61869
vendor: 42,371 bytes, lines 61870-62297
61870/***/ "./node_modules/rxjs/_esm2015/operators/index.js": 61871/*!*******************************************************!*\ 61872 !*** ./node_modules/rxjs/_esm2015/operators/index.js ***! 61873 \*******************************************************/ 61874/*! exports provided: audit, auditTime, buffer, bufferCount, bufferTime, bufferToggle, bufferWhen, catchError, combineAll, combineLatest, concat, concatAll, concatMap, concatMapTo, count, debounce, debounceTime, defaultIfEmpty, delay, delayWhen, dematerialize, distinct, distinctUntilChanged, distinctUntilKeyChanged, elementAt, endWith, every, exhaust, exhaustMap, expand, filter, finalize, find, findIndex, first, groupBy, ignoreElements, isEmpty, last, map, mapTo, materialize, max, merge, mergeAll, mergeMap, flatMap, mergeMapTo, mergeScan, min, multicast, observeOn, onErrorResumeNext, pairwise, partition, pluck, publish, publishBehavior, publishLast, publishReplay, race, reduce, repeat, repeatWhen, retry, retryWhen, refCount, sample, sampleTime, scan, sequenceEqual, share, shareReplay, single, skip, skipLast, skipUntil, skipWhile, startWith, subscribeOn, switchAll, switchMap, switchMapTo, take, takeLast, takeUntil, takeWhile, tap, throttle, throttleTime, throwIfEmpty, timeInterval, timeout, timeoutWith, timestamp, toArray, window, windowCount, windowTime, windowToggle, windowWhen, withLatestFrom, zip, zipAll */ 61875/***/ (function(module, __webpack_exports__, __webpack_require__) { 61876 61877"use strict"; 61878__webpack_require__.r(__webpack_exports__); 61879/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../internal/operators/audit */ "./node_modules/rxjs/_esm2015/internal/operators/audit.js"); 61880/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; }); 61881 61882/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal/operators/auditTime */ "./node_modules/rxjs/_esm2015/internal/operators/auditTime.js"); 61883/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; }); 61884 61885/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal/operators/buffer */ "./node_modules/rxjs/_esm2015/internal/operators/buffer.js"); 61886/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; }); 61887 61888/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../internal/operators/bufferCount */ "./node_modules/rxjs/_esm2015/internal/operators/bufferCount.js"); 61889/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; }); 61890 61891/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../internal/operators/bufferTime */ "./node_modules/rxjs/_esm2015/internal/operators/bufferTime.js"); 61892/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; }); 61893 61894/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../internal/operators/bufferToggle */ "./node_modules/rxjs/_esm2015/internal/operators/bufferToggle.js"); 61895/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; }); 61896 61897/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../internal/operators/bufferWhen */ "./node_modules/rxjs/_esm2015/internal/operators/bufferWhen.js"); 61898/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; }); 61899 61900/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../internal/operators/catchError */ "./node_modules/rxjs/_esm2015/internal/operators/catchError.js"); 61901/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; }); 61902 61903/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../internal/operators/combineAll */ "./node_modules/rxjs/_esm2015/internal/operators/combineAll.js"); 61904/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; }); 61905 61906/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../internal/operators/combineLatest */ "./node_modules/rxjs/_esm2015/internal/operators/combineLatest.js"); 61907/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; }); 61908 61909/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../internal/operators/concat */ "./node_modules/rxjs/_esm2015/internal/operators/concat.js"); 61910/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; }); 61911 61912/* harmony import */ var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../internal/operators/concatAll */ "./node_modules/rxjs/_esm2015/internal/operators/concatAll.js"); 61913/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; }); 61914 61915/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../internal/operators/concatMap */ "./node_modules/rxjs/_esm2015/internal/operators/concatMap.js"); 61916/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; }); 61917 61918/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../internal/operators/concatMapTo */ "./node_modules/rxjs/_esm2015/internal/operators/concatMapTo.js"); 61919/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; }); 61920 61921/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../internal/operators/count */ "./node_modules/rxjs/_esm2015/internal/operators/count.js"); 61922/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; }); 61923 61924/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../internal/operators/debounce */ "./node_modules/rxjs/_esm2015/internal/operators/debounce.js"); 61925/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; }); 61926 61927/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../internal/operators/debounceTime */ "./node_modules/rxjs/_esm2015/internal/operators/debounceTime.js"); 61928/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; }); 61929 61930/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../internal/operators/defaultIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js"); 61931/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; }); 61932 61933/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../internal/operators/delay */ "./node_modules/rxjs/_esm2015/internal/operators/delay.js"); 61934/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; }); 61935 61936/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../internal/operators/delayWhen */ "./node_modules/rxjs/_esm2015/internal/operators/delayWhen.js"); 61937/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; }); 61938 61939/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../internal/operators/dematerialize */ "./node_modules/rxjs/_esm2015/internal/operators/dematerialize.js"); 61940/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; }); 61941 61942/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../internal/operators/distinct */ "./node_modules/rxjs/_esm2015/internal/operators/distinct.js"); 61943/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; }); 61944 61945/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../internal/operators/distinctUntilChanged */ "./node_modules/rxjs/_esm2015/internal/operators/distinctUntilChanged.js"); 61946/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; }); 61947 61948/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../internal/operators/distinctUntilKeyChanged */ "./node_modules/rxjs/_esm2015/internal/operators/distinctUntilKeyChanged.js"); 61949/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; }); 61950 61951/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../internal/operators/elementAt */ "./node_modules/rxjs/_esm2015/internal/operators/elementAt.js"); 61952/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; }); 61953 61954/* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../internal/operators/endWith */ "./node_modules/rxjs/_esm2015/internal/operators/endWith.js"); 61955/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__["endWith"]; }); 61956 61957/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../internal/operators/every */ "./node_modules/rxjs/_esm2015/internal/operators/every.js"); 61958/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__["every"]; }); 61959 61960/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../internal/operators/exhaust */ "./node_modules/rxjs/_esm2015/internal/operators/exhaust.js"); 61961/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__["exhaust"]; }); 61962 61963/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../internal/operators/exhaustMap */ "./node_modules/rxjs/_esm2015/internal/operators/exhaustMap.js"); 61964/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__["exhaustMap"]; }); 61965 61966/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../internal/operators/expand */ "./node_modules/rxjs/_esm2015/internal/operators/expand.js"); 61967/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__["expand"]; }); 61968 61969/* harmony import */ var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../internal/operators/filter */ "./node_modules/rxjs/_esm2015/internal/operators/filter.js"); 61970/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__["filter"]; }); 61971 61972/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../internal/operators/finalize */ "./node_modules/rxjs/_esm2015/internal/operators/finalize.js"); 61973/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__["finalize"]; }); 61974 61975/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../internal/operators/find */ "./node_modules/rxjs/_esm2015/internal/operators/find.js"); 61976/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__["find"]; }); 61977 61978/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../internal/operators/findIndex */ "./node_modules/rxjs/_esm2015/internal/operators/findIndex.js"); 61979/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__["findIndex"]; }); 61980 61981/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../internal/operators/first */ "./node_modules/rxjs/_esm2015/internal/operators/first.js"); 61982/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__["first"]; }); 61983 61984/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../internal/operators/groupBy */ "./node_modules/rxjs/_esm2015/internal/operators/groupBy.js"); 61985/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__["groupBy"]; }); 61986 61987/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../internal/operators/ignoreElements */ "./node_modules/rxjs/_esm2015/internal/operators/ignoreElements.js"); 61988/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__["ignoreElements"]; }); 61989 61990/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../internal/operators/isEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/isEmpty.js"); 61991/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__["isEmpty"]; }); 61992 61993/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../internal/operators/last */ "./node_modules/rxjs/_esm2015/internal/operators/last.js"); 61994/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__["last"]; }); 61995 61996/* harmony import */ var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../internal/operators/map */ "./node_modules/rxjs/_esm2015/internal/operators/map.js"); 61997/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__["map"]; }); 61998 61999/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../internal/operators/mapTo */ "./node_modules/rxjs/_esm2015/internal/operators/mapTo.js"); 62000/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__["mapTo"]; }); 62001 62002/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../internal/operators/materialize */ "./node_modules/rxjs/_esm2015/internal/operators/materialize.js"); 62003/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__["materialize"]; }); 62004 62005/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../internal/operators/max */ "./node_modules/rxjs/_esm2015/internal/operators/max.js"); 62006/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__["max"]; }); 62007 62008/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../internal/operators/merge */ "./node_modules/rxjs/_esm2015/internal/operators/merge.js"); 62009/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__["merge"]; }); 62010 62011/* harmony import */ var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../internal/operators/mergeAll */ "./node_modules/rxjs/_esm2015/internal/operators/mergeAll.js"); 62012/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__["mergeAll"]; }); 62013 62014/* harmony import */ var _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../internal/operators/mergeMap */ "./node_modules/rxjs/_esm2015/internal/operators/mergeMap.js"); 62015/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; }); 62016 62017/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; }); 62018 62019/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ../internal/operators/mergeMapTo */ "./node_modules/rxjs/_esm2015/internal/operators/mergeMapTo.js"); 62020/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__["mergeMapTo"]; }); 62021 62022/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../internal/operators/mergeScan */ "./node_modules/rxjs/_esm2015/internal/operators/mergeScan.js"); 62023/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__["mergeScan"]; }); 62024 62025/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../internal/operators/min */ "./node_modules/rxjs/_esm2015/internal/operators/min.js"); 62026/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__["min"]; }); 62027 62028/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ../internal/operators/multicast */ "./node_modules/rxjs/_esm2015/internal/operators/multicast.js"); 62029/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__["multicast"]; }); 62030 62031/* harmony import */ var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ../internal/operators/observeOn */ "./node_modules/rxjs/_esm2015/internal/operators/observeOn.js"); 62032/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__["observeOn"]; }); 62033 62034/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ../internal/operators/onErrorResumeNext */ "./node_modules/rxjs/_esm2015/internal/operators/onErrorResumeNext.js"); 62035/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__["onErrorResumeNext"]; }); 62036 62037/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ../internal/operators/pairwise */ "./node_modules/rxjs/_esm2015/internal/operators/pairwise.js"); 62038/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__["pairwise"]; }); 62039 62040/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ../internal/operators/partition */ "./node_modules/rxjs/_esm2015/internal/operators/partition.js"); 62041/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__["partition"]; }); 62042 62043/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ../internal/operators/pluck */ "./node_modules/rxjs/_esm2015/internal/operators/pluck.js"); 62044/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__["pluck"]; }); 62045 62046/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ../internal/operators/publish */ "./node_modules/rxjs/_esm2015/internal/operators/publish.js"); 62047/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__["publish"]; }); 62048 62049/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ../internal/operators/publishBehavior */ "./node_modules/rxjs/_esm2015/internal/operators/publishBehavior.js"); 62050/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__["publishBehavior"]; }); 62051 62052/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ../internal/operators/publishLast */ "./node_modules/rxjs/_esm2015/internal/operators/publishLast.js"); 62053/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__["publishLast"]; }); 62054 62055/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ../internal/operators/publishReplay */ "./node_modules/rxjs/_esm2015/internal/operators/publishReplay.js"); 62056/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__["publishReplay"]; }); 62057 62058/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ../internal/operators/race */ "./node_modules/rxjs/_esm2015/internal/operators/race.js"); 62059/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__["race"]; }); 62060 62061/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ../internal/operators/reduce */ "./node_modules/rxjs/_esm2015/internal/operators/reduce.js"); 62062/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__["reduce"]; }); 62063 62064/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ../internal/operators/repeat */ "./node_modules/rxjs/_esm2015/internal/operators/repeat.js"); 62065/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__["repeat"]; }); 62066 62067/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ../internal/operators/repeatWhen */ "./node_modules/rxjs/_esm2015/internal/operators/repeatWhen.js"); 62068/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__["repeatWhen"]; }); 62069 62070/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ../internal/operators/retry */ "./node_modules/rxjs/_esm2015/internal/operators/retry.js"); 62071/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__["retry"]; }); 62072 62073/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ../internal/operators/retryWhen */ "./node_modules/rxjs/_esm2015/internal/operators/retryWhen.js"); 62074/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__["retryWhen"]; }); 62075 62076/* harmony import */ var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ../internal/operators/refCount */ "./node_modules/rxjs/_esm2015/internal/operators/refCount.js"); 62077/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__["refCount"]; }); 62078 62079/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ../internal/operators/sample */ "./node_modules/rxjs/_esm2015/internal/operators/sample.js"); 62080/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__["sample"]; }); 62081 62082/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ../internal/operators/sampleTime */ "./node_modules/rxjs/_esm2015/internal/operators/sampleTime.js"); 62083/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__["sampleTime"]; }); 62084 62085/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ../internal/operators/scan */ "./node_modules/rxjs/_esm2015/internal/operators/scan.js"); 62086/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__["scan"]; }); 62087 62088/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ../internal/operators/sequenceEqual */ "./node_modules/rxjs/_esm2015/internal/operators/sequenceEqual.js"); 62089/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__["sequenceEqual"]; }); 62090 62091/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ../internal/operators/share */ "./node_modules/rxjs/_esm2015/internal/operators/share.js"); 62092/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__["share"]; }); 62093 62094/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ../internal/operators/shareReplay */ "./node_modules/rxjs/_esm2015/internal/operators/shareReplay.js"); 62095/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__["shareReplay"]; }); 62096 62097/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ../internal/operators/single */ "./node_modules/rxjs/_esm2015/internal/operators/single.js"); 62098/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__["single"]; }); 62099 62100/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ../internal/operators/skip */ "./node_modules/rxjs/_esm2015/internal/operators/skip.js"); 62101/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__["skip"]; }); 62102 62103/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ../internal/operators/skipLast */ "./node_modules/rxjs/_esm2015/internal/operators/skipLast.js"); 62104/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__["skipLast"]; }); 62105 62106/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ../internal/operators/skipUntil */ "./node_modules/rxjs/_esm2015/internal/operators/skipUntil.js"); 62107/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__["skipUntil"]; }); 62108 62109/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ../internal/operators/skipWhile */ "./node_modules/rxjs/_esm2015/internal/operators/skipWhile.js"); 62110/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__["skipWhile"]; }); 62111 62112/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ../internal/operators/startWith */ "./node_modules/rxjs/_esm2015/internal/operators/startWith.js"); 62113/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__["startWith"]; }); 62114 62115/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ../internal/operators/subscribeOn */ "./node_modules/rxjs/_esm2015/internal/operators/subscribeOn.js"); 62116/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__["subscribeOn"]; }); 62117 62118/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ../internal/operators/switchAll */ "./node_modules/rxjs/_esm2015/internal/operators/switchAll.js"); 62119/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__["switchAll"]; }); 62120 62121/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ../internal/operators/switchMap */ "./node_modules/rxjs/_esm2015/internal/operators/switchMap.js"); 62122/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__["switchMap"]; }); 62123 62124/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ../internal/operators/switchMapTo */ "./node_modules/rxjs/_esm2015/internal/operators/switchMapTo.js"); 62125/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__["switchMapTo"]; }); 62126 62127/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ../internal/operators/take */ "./node_modules/rxjs/_esm2015/internal/operators/take.js"); 62128/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__["take"]; }); 62129 62130/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ../internal/operators/takeLast */ "./node_modules/rxjs/_esm2015/internal/operators/takeLast.js"); 62131/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__["takeLast"]; }); 62132 62133/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ../internal/operators/takeUntil */ "./node_modules/rxjs/_esm2015/internal/operators/takeUntil.js"); 62134/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__["takeUntil"]; }); 62135 62136/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ../internal/operators/takeWhile */ "./node_modules/rxjs/_esm2015/internal/operators/takeWhile.js"); 62137/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__["takeWhile"]; }); 62138 62139/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ../internal/operators/tap */ "./node_modules/rxjs/_esm2015/internal/operators/tap.js"); 62140/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__["tap"]; }); 62141 62142/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ../internal/operators/throttle */ "./node_modules/rxjs/_esm2015/internal/operators/throttle.js"); 62143/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__["throttle"]; }); 62144 62145/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ../internal/operators/throttleTime */ "./node_modules/rxjs/_esm2015/internal/operators/throttleTime.js"); 62146/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__["throttleTime"]; }); 62147 62148/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ../internal/operators/throwIfEmpty */ "./node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js"); 62149/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__["throwIfEmpty"]; }); 62150 62151/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ../internal/operators/timeInterval */ "./node_modules/rxjs/_esm2015/internal/operators/timeInterval.js"); 62152/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__["timeInterval"]; }); 62153 62154/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ../internal/operators/timeout */ "./node_modules/rxjs/_esm2015/internal/operators/timeout.js"); 62155/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__["timeout"]; }); 62156 62157/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ../internal/operators/timeoutWith */ "./node_modules/rxjs/_esm2015/internal/operators/timeoutWith.js"); 62158/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__["timeoutWith"]; }); 62159 62160/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ../internal/operators/timestamp */ "./node_modules/rxjs/_esm2015/internal/operators/timestamp.js"); 62161/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__["timestamp"]; }); 62162 62163/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ../internal/operators/toArray */ "./node_modules/rxjs/_esm2015/internal/operators/toArray.js"); 62164/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__["toArray"]; }); 62165 62166/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ../internal/operators/window */ "./node_modules/rxjs/_esm2015/internal/operators/window.js"); 62167/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__["window"]; }); 62168 62169/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ../internal/operators/windowCount */ "./node_modules/rxjs/_esm2015/internal/operators/windowCount.js"); 62170/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__["windowCount"]; }); 62171 62172/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ../internal/operators/windowTime */ "./node_modules/rxjs/_esm2015/internal/operators/windowTime.js"); 62173/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__["windowTime"]; }); 62174 62175/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ../internal/operators/windowToggle */ "./node_modules/rxjs/_esm2015/internal/operators/windowToggle.js"); 62176/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__["windowToggle"]; }); 62177 62178/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ../internal/operators/windowWhen */ "./node_modules/rxjs/_esm2015/internal/operators/windowWhen.js"); 62179/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__["windowWhen"]; }); 62180 62181/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ../internal/operators/withLatestFrom */ "./node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js"); 62182/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__["withLatestFrom"]; }); 62183 62184/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ../internal/operators/zip */ "./node_modules/rxjs/_esm2015/internal/operators/zip.js"); 62185/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__["zip"]; }); 62186 62187/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ../internal/operators/zipAll */ "./node_modules/rxjs/_esm2015/internal/operators/zipAll.js"); 62188/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__["zipAll"]; }); 62189 62190 62191 62192 62193 62194 62195 62196 62197 62198 62199 62200 62201 62202 62203 62204 62205 62206 62207 62208 62209 62210 62211 62212 62213 62214 62215 62216 62217 62218 62219 62220 62221 62222 62223 62224 62225 62226 62227 62228 62229 62230 62231 62232 62233 62234 62235 62236 62237 62238 62239 62240 62241 62242 62243 62244 62245 62246 62247 62248 62249 62250 62251 62252 62253 62254 62255 62256 62257 62258 62259 62260 62261 62262 62263 62264 62265 62266 62267 62268 62269 62270 62271 62272 62273 62274 62275 62276 62277 62278 62279 62280 62281 62282 62283 62284 62285 62286 62287 62288 62289 62290 62291 62292 62293 62294//# sourceMappingURL=index.js.map 62295 62296/***/ }), 62297
vendor: 128,337 bytes, lines 62298-65486
62298/***/ "./node_modules/sweetalert2/dist/sweetalert2.all.js": 62299/*!**********************************************************!*\ 62300 !*** ./node_modules/sweetalert2/dist/sweetalert2.all.js ***! 62301 \**********************************************************/ 62302/*! no static exports found */ 62303/***/ (function(module, exports, __webpack_require__) { 62304 62305/*! 62306* sweetalert2 v9.17.1 62307* Released under the MIT License. 62308*/ 62309(function (global, factory) { 62310 true ? module.exports = factory() : 62311 undefined; 62312}(this, function () { 'use strict'; 62313 62314 function _typeof(obj) { 62315 "@babel/helpers - typeof"; 62316 62317 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 62318 _typeof = function (obj) { 62319 return typeof obj; 62320 }; 62321 } else { 62322 _typeof = function (obj) { 62323 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 62324 }; 62325 } 62326 62327 return _typeof(obj); 62328 } 62329 62330 function _classCallCheck(instance, Constructor) { 62331 if (!(instance instanceof Constructor)) { 62332 throw new TypeError("Cannot call a class as a function"); 62333 } 62334 } 62335 62336 function _defineProperties(target, props) { 62337 for (var i = 0; i < props.length; i++) { 62338 var descriptor = props[i]; 62339 descriptor.enumerable = descriptor.enumerable || false; 62340 descriptor.configurable = true; 62341 if ("value" in descriptor) descriptor.writable = true; 62342 Object.defineProperty(target, descriptor.key, descriptor); 62343 } 62344 } 62345 62346 function _createClass(Constructor, protoProps, staticProps) { 62347 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 62348 if (staticProps) _defineProperties(Constructor, staticProps); 62349 return Constructor; 62350 } 62351 62352 function _extends() { 62353 _extends = Object.assign || function (target) { 62354 for (var i = 1; i < arguments.length; i++) { 62355 var source = arguments[i]; 62356 62357 for (var key in source) { 62358 if (Object.prototype.hasOwnProperty.call(source, key)) { 62359 target[key] = source[key]; 62360 } 62361 } 62362 } 62363 62364 return target; 62365 }; 62366 62367 return _extends.apply(this, arguments); 62368 } 62369 62370 function _inherits(subClass, superClass) { 62371 if (typeof superClass !== "function" && superClass !== null) { 62372 throw new TypeError("Super expression must either be null or a function"); 62373 } 62374 62375 subClass.prototype = Object.create(superClass && superClass.prototype, { 62376 constructor: { 62377 value: subClass, 62378 writable: true, 62379 configurable: true 62380 } 62381 }); 62382 if (superClass) _setPrototypeOf(subClass, superClass); 62383 } 62384 62385 function _getPrototypeOf(o) { 62386 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { 62387 return o.__proto__ || Object.getPrototypeOf(o); 62388 }; 62389 return _getPrototypeOf(o); 62390 } 62391 62392 function _setPrototypeOf(o, p) { 62393 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 62394 o.__proto__ = p; 62395 return o; 62396 }; 62397 62398 return _setPrototypeOf(o, p); 62399 } 62400 62401 function _isNativeReflectConstruct() { 62402 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 62403 if (Reflect.construct.sham) return false; 62404 if (typeof Proxy === "function") return true; 62405 62406 try { 62407 Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); 62408 return true; 62409 } catch (e) { 62410 return false; 62411 } 62412 } 62413 62414 function _construct(Parent, args, Class) { 62415 if (_isNativeReflectConstruct()) { 62416 _construct = Reflect.construct; 62417 } else { 62418 _construct = function _construct(Parent, args, Class) { 62419 var a = [null]; 62420 a.push.apply(a, args); 62421 var Constructor = Function.bind.apply(Parent, a); 62422 var instance = new Constructor(); 62423 if (Class) _setPrototypeOf(instance, Class.prototype); 62424 return instance; 62425 }; 62426 } 62427 62428 return _construct.apply(null, arguments); 62429 } 62430 62431 function _assertThisInitialized(self) { 62432 if (self === void 0) { 62433 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 62434 } 62435 62436 return self; 62437 } 62438 62439 function _possibleConstructorReturn(self, call) { 62440 if (call && (typeof call === "object" || typeof call === "function")) { 62441 return call; 62442 } 62443 62444 return _assertThisInitialized(self); 62445 } 62446 62447 function _createSuper(Derived) { 62448 var hasNativeReflectConstruct = _isNativeReflectConstruct(); 62449 62450 return function _createSuperInternal() { 62451 var Super = _getPrototypeOf(Derived), 62452 result; 62453 62454 if (hasNativeReflectConstruct) { 62455 var NewTarget = _getPrototypeOf(this).constructor; 62456 62457 result = Reflect.construct(Super, arguments, NewTarget); 62458 } else { 62459 result = Super.apply(this, arguments); 62460 } 62461 62462 return _possibleConstructorReturn(this, result); 62463 }; 62464 } 62465 62466 function _superPropBase(object, property) { 62467 while (!Object.prototype.hasOwnProperty.call(object, property)) { 62468 object = _getPrototypeOf(object); 62469 if (object === null) break; 62470 } 62471 62472 return object; 62473 } 62474 62475 function _get(target, property, receiver) { 62476 if (typeof Reflect !== "undefined" && Reflect.get) { 62477 _get = Reflect.get; 62478 } else { 62479 _get = function _get(target, property, receiver) { 62480 var base = _superPropBase(target, property); 62481 62482 if (!base) return; 62483 var desc = Object.getOwnPropertyDescriptor(base, property); 62484 62485 if (desc.get) { 62486 return desc.get.call(receiver); 62487 } 62488 62489 return desc.value; 62490 }; 62491 } 62492 62493 return _get(target, property, receiver || target); 62494 } 62495 62496 var consolePrefix = 'SweetAlert2:'; 62497 /** 62498 * Filter the unique values into a new array 62499 * @param arr 62500 */ 62501 62502 var uniqueArray = function uniqueArray(arr) { 62503 var result = []; 62504 62505 for (var i = 0; i < arr.length; i++) { 62506 if (result.indexOf(arr[i]) === -1) { 62507 result.push(arr[i]); 62508 } 62509 } 62510 62511 return result; 62512 }; 62513 /** 62514 * Capitalize the first letter of a string 62515 * @param str 62516 */ 62517 62518 var capitalizeFirstLetter = function capitalizeFirstLetter(str) { 62519 return str.charAt(0).toUpperCase() + str.slice(1); 62520 }; 62521 /** 62522 * Returns the array of object values (Object.values isn't supported in IE11) 62523 * @param obj 62524 */ 62525 62526 var objectValues = function objectValues(obj) { 62527 return Object.keys(obj).map(function (key) { 62528 return obj[key]; 62529 }); 62530 }; 62531 /** 62532 * Convert NodeList to Array 62533 * @param nodeList 62534 */ 62535 62536 var toArray = function toArray(nodeList) { 62537 return Array.prototype.slice.call(nodeList); 62538 }; 62539 /** 62540 * Standardise console warnings 62541 * @param message 62542 */ 62543 62544 var warn = function warn(message) { 62545 console.warn("".concat(consolePrefix, " ").concat(message)); 62546 }; 62547 /** 62548 * Standardise console errors 62549 * @param message 62550 */ 62551 62552 var error = function error(message) { 62553 console.error("".concat(consolePrefix, " ").concat(message)); 62554 }; 62555 /** 62556 * Private global state for `warnOnce` 62557 * @type {Array} 62558 * @private 62559 */ 62560 62561 var previousWarnOnceMessages = []; 62562 /** 62563 * Show a console warning, but only if it hasn't already been shown 62564 * @param message 62565 */ 62566 62567 var warnOnce = function warnOnce(message) { 62568 if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { 62569 previousWarnOnceMessages.push(message); 62570 warn(message); 62571 } 62572 }; 62573 /** 62574 * Show a one-time console warning about deprecated params/methods 62575 */ 62576 62577 var warnAboutDepreation = function warnAboutDepreation(deprecatedParam, useInstead) { 62578 warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" instead.")); 62579 }; 62580 /** 62581 * If `arg` is a function, call it (with no arguments or context) and return the result. 62582 * Otherwise, just pass the value through 62583 * @param arg 62584 */ 62585 62586 var callIfFunction = function callIfFunction(arg) { 62587 return typeof arg === 'function' ? arg() : arg; 62588 }; 62589 var hasToPromiseFn = function hasToPromiseFn(arg) { 62590 return arg && typeof arg.toPromise === 'function'; 62591 }; 62592 var asPromise = function asPromise(arg) { 62593 return hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg); 62594 }; 62595 var isPromise = function isPromise(arg) { 62596 return arg && Promise.resolve(arg) === arg; 62597 }; 62598 62599 var DismissReason = Object.freeze({ 62600 cancel: 'cancel', 62601 backdrop: 'backdrop', 62602 close: 'close', 62603 esc: 'esc', 62604 timer: 'timer' 62605 }); 62606 62607 var isJqueryElement = function isJqueryElement(elem) { 62608 return _typeof(elem) === 'object' && elem.jquery; 62609 }; 62610 62611 var isElement = function isElement(elem) { 62612 return elem instanceof Element || isJqueryElement(elem); 62613 }; 62614 62615 var argsToParams = function argsToParams(args) { 62616 var params = {}; 62617 62618 if (_typeof(args[0]) === 'object' && !isElement(args[0])) { 62619 _extends(params, args[0]); 62620 } else { 62621 ['title', 'html', 'icon'].forEach(function (name, index) { 62622 var arg = args[index]; 62623 62624 if (typeof arg === 'string' || isElement(arg)) { 62625 params[name] = arg; 62626 } else if (arg !== undefined) { 62627 error("Unexpected type of ".concat(name, "! Expected \"string\" or \"Element\", got ").concat(_typeof(arg))); 62628 } 62629 }); 62630 } 62631 62632 return params; 62633 }; 62634 62635 var swalPrefix = 'swal2-'; 62636 var prefix = function prefix(items) { 62637 var result = {}; 62638 62639 for (var i in items) { 62640 result[items[i]] = swalPrefix + items[i]; 62641 } 62642 62643 return result; 62644 }; 62645 var swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'toast-column', 'show', 'hide', 'close', 'title', 'header', 'content', 'html-container', 'actions', 'confirm', 'cancel', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'timer-progress-bar-container', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error']); 62646 var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']); 62647 62648 var getContainer = function getContainer() { 62649 return document.body.querySelector(".".concat(swalClasses.container)); 62650 }; 62651 var elementBySelector = function elementBySelector(selectorString) { 62652 var container = getContainer(); 62653 return container ? container.querySelector(selectorString) : null; 62654 }; 62655 62656 var elementByClass = function elementByClass(className) { 62657 return elementBySelector(".".concat(className)); 62658 }; 62659 62660 var getPopup = function getPopup() { 62661 return elementByClass(swalClasses.popup); 62662 }; 62663 var getIcons = function getIcons() { 62664 var popup = getPopup(); 62665 return toArray(popup.querySelectorAll(".".concat(swalClasses.icon))); 62666 }; 62667 var getIcon = function getIcon() { 62668 var visibleIcon = getIcons().filter(function (icon) { 62669 return isVisible(icon); 62670 }); 62671 return visibleIcon.length ? visibleIcon[0] : null; 62672 }; 62673 var getTitle = function getTitle() { 62674 return elementByClass(swalClasses.title); 62675 }; 62676 var getContent = function getContent() { 62677 return elementByClass(swalClasses.content); 62678 }; 62679 var getHtmlContainer = function getHtmlContainer() { 62680 return elementByClass(swalClasses['html-container']); 62681 }; 62682 var getImage = function getImage() { 62683 return elementByClass(swalClasses.image); 62684 }; 62685 var getProgressSteps = function getProgressSteps() { 62686 return elementByClass(swalClasses['progress-steps']); 62687 }; 62688 var getValidationMessage = function getValidationMessage() { 62689 return elementByClass(swalClasses['validation-message']); 62690 }; 62691 var getConfirmButton = function getConfirmButton() { 62692 return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.confirm)); 62693 }; 62694 var getCancelButton = function getCancelButton() { 62695 return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.cancel)); 62696 }; 62697 var getActions = function getActions() { 62698 return elementByClass(swalClasses.actions); 62699 }; 62700 var getHeader = function getHeader() { 62701 return elementByClass(swalClasses.header); 62702 }; 62703 var getFooter = function getFooter() { 62704 return elementByClass(swalClasses.footer); 62705 }; 62706 var getTimerProgressBar = function getTimerProgressBar() { 62707 return elementByClass(swalClasses['timer-progress-bar']); 62708 }; 62709 var getCloseButton = function getCloseButton() { 62710 return elementByClass(swalClasses.close); 62711 }; // https://github.com/jkup/focusable/blob/master/index.js 62712 62713 var focusable = "\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n"; 62714 var getFocusableElements = function getFocusableElements() { 62715 var focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')) // sort according to tabindex 62716 .sort(function (a, b) { 62717 a = parseInt(a.getAttribute('tabindex')); 62718 b = parseInt(b.getAttribute('tabindex')); 62719 62720 if (a > b) { 62721 return 1; 62722 } else if (a < b) { 62723 return -1; 62724 } 62725 62726 return 0; 62727 }); 62728 var otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter(function (el) { 62729 return el.getAttribute('tabindex') !== '-1'; 62730 }); 62731 return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(function (el) { 62732 return isVisible(el); 62733 }); 62734 }; 62735 var isModal = function isModal() { 62736 return !isToast() && !document.body.classList.contains(swalClasses['no-backdrop']); 62737 }; 62738 var isToast = function isToast() { 62739 return document.body.classList.contains(swalClasses['toast-shown']); 62740 }; 62741 var isLoading = function isLoading() { 62742 return getPopup().hasAttribute('data-loading'); 62743 }; 62744 62745 var states = { 62746 previousBodyPadding: null 62747 }; 62748 var setInnerHtml = function setInnerHtml(elem, html) { 62749 // #1926 62750 elem.textContent = ''; 62751 62752 if (html) { 62753 var parser = new DOMParser(); 62754 var parsed = parser.parseFromString(html, "text/html"); 62755 toArray(parsed.querySelector('head').childNodes).forEach(function (child) { 62756 elem.appendChild(child); 62757 }); 62758 toArray(parsed.querySelector('body').childNodes).forEach(function (child) { 62759 elem.appendChild(child); 62760 }); 62761 } 62762 }; 62763 var hasClass = function hasClass(elem, className) { 62764 if (!className) { 62765 return false; 62766 } 62767 62768 var classList = className.split(/\s+/); 62769 62770 for (var i = 0; i < classList.length; i++) { 62771 if (!elem.classList.contains(classList[i])) { 62772 return false; 62773 } 62774 } 62775 62776 return true; 62777 }; 62778 62779 var removeCustomClasses = function removeCustomClasses(elem, params) { 62780 toArray(elem.classList).forEach(function (className) { 62781 if (!(objectValues(swalClasses).indexOf(className) !== -1) && !(objectValues(iconTypes).indexOf(className) !== -1) && !(objectValues(params.showClass).indexOf(className) !== -1)) { 62782 elem.classList.remove(className); 62783 } 62784 }); 62785 }; 62786 62787 var applyCustomClass = function applyCustomClass(elem, params, className) { 62788 removeCustomClasses(elem, params); 62789 62790 if (params.customClass && params.customClass[className]) { 62791 if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) { 62792 return warn("Invalid type of customClass.".concat(className, "! Expected string or iterable object, got \"").concat(_typeof(params.customClass[className]), "\"")); 62793 } 62794 62795 addClass(elem, params.customClass[className]); 62796 } 62797 }; 62798 function getInput(content, inputType) { 62799 if (!inputType) { 62800 return null; 62801 } 62802 62803 switch (inputType) { 62804 case 'select': 62805 case 'textarea': 62806 case 'file': 62807 return getChildByClass(content, swalClasses[inputType]); 62808 62809 case 'checkbox': 62810 return content.querySelector(".".concat(swalClasses.checkbox, " input")); 62811 62812 case 'radio': 62813 return content.querySelector(".".concat(swalClasses.radio, " input:checked")) || content.querySelector(".".concat(swalClasses.radio, " input:first-child")); 62814 62815 case 'range': 62816 return content.querySelector(".".concat(swalClasses.range, " input")); 62817 62818 default: 62819 return getChildByClass(content, swalClasses.input); 62820 } 62821 } 62822 var focusInput = function focusInput(input) { 62823 input.focus(); // place cursor at end of text in text input 62824 62825 if (input.type !== 'file') { 62826 // http://stackoverflow.com/a/2345915 62827 var val = input.value; 62828 input.value = ''; 62829 input.value = val; 62830 } 62831 }; 62832 var toggleClass = function toggleClass(target, classList, condition) { 62833 if (!target || !classList) { 62834 return; 62835 } 62836 62837 if (typeof classList === 'string') { 62838 classList = classList.split(/\s+/).filter(Boolean); 62839 } 62840 62841 classList.forEach(function (className) { 62842 if (target.forEach) { 62843 target.forEach(function (elem) { 62844 condition ? elem.classList.add(className) : elem.classList.remove(className); 62845 }); 62846 } else { 62847 condition ? target.classList.add(className) : target.classList.remove(className); 62848 } 62849 }); 62850 }; 62851 var addClass = function addClass(target, classList) { 62852 toggleClass(target, classList, true); 62853 }; 62854 var removeClass = function removeClass(target, classList) { 62855 toggleClass(target, classList, false); 62856 }; 62857 var getChildByClass = function getChildByClass(elem, className) { 62858 for (var i = 0; i < elem.childNodes.length; i++) { 62859 if (hasClass(elem.childNodes[i], className)) { 62860 return elem.childNodes[i]; 62861 } 62862 } 62863 }; 62864 var applyNumericalStyle = function applyNumericalStyle(elem, property, value) { 62865 if (value || parseInt(value) === 0) { 62866 elem.style[property] = typeof value === 'number' ? "".concat(value, "px") : value; 62867 } else { 62868 elem.style.removeProperty(property); 62869 } 62870 }; 62871 var show = function show(elem) { 62872 var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex'; 62873 elem.style.opacity = ''; 62874 elem.style.display = display; 62875 }; 62876 var hide = function hide(elem) { 62877 elem.style.opacity = ''; 62878 elem.style.display = 'none'; 62879 }; 62880 var toggle = function toggle(elem, condition, display) { 62881 condition ? show(elem, display) : hide(elem); 62882 }; // borrowed from jquery $(elem).is(':visible') implementation 62883 62884 var isVisible = function isVisible(elem) { 62885 return !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); 62886 }; 62887 /* istanbul ignore next */ 62888 62889 var isScrollable = function isScrollable(elem) { 62890 return !!(elem.scrollHeight > elem.clientHeight); 62891 }; // borrowed from https://stackoverflow.com/a/46352119 62892 62893 var hasCssAnimation = function hasCssAnimation(elem) { 62894 var style = window.getComputedStyle(elem); 62895 var animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0'); 62896 var transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0'); 62897 return animDuration > 0 || transDuration > 0; 62898 }; 62899 var contains = function contains(haystack, needle) { 62900 if (typeof haystack.contains === 'function') { 62901 return haystack.contains(needle); 62902 } 62903 }; 62904 var animateTimerProgressBar = function animateTimerProgressBar(timer) { 62905 var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 62906 var timerProgressBar = getTimerProgressBar(); 62907 62908 if (isVisible(timerProgressBar)) { 62909 if (reset) { 62910 timerProgressBar.style.transition = 'none'; 62911 timerProgressBar.style.width = '100%'; 62912 } 62913 62914 setTimeout(function () { 62915 timerProgressBar.style.transition = "width ".concat(timer / 1000, "s linear"); 62916 timerProgressBar.style.width = '0%'; 62917 }, 10); 62918 } 62919 }; 62920 var stopTimerProgressBar = function stopTimerProgressBar() { 62921 var timerProgressBar = getTimerProgressBar(); 62922 var timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width); 62923 timerProgressBar.style.removeProperty('transition'); 62924 timerProgressBar.style.width = '100%'; 62925 var timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width); 62926 var timerProgressBarPercent = parseInt(timerProgressBarWidth / timerProgressBarFullWidth * 100); 62927 timerProgressBar.style.removeProperty('transition'); 62928 timerProgressBar.style.width = "".concat(timerProgressBarPercent, "%"); 62929 }; 62930 62931 // Detect Node env 62932 var isNodeEnv = function isNodeEnv() { 62933 return typeof window === 'undefined' || typeof document === 'undefined'; 62934 }; 62935 62936 var sweetHTML = "\n <div aria-labelledby=\"".concat(swalClasses.title, "\" aria-describedby=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses.popup, "\" tabindex=\"-1\">\n <div class=\"").concat(swalClasses.header, "\">\n <ul class=\"").concat(swalClasses['progress-steps'], "\"></ul>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.error, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.question, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.warning, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.info, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.success, "\"></div>\n <img class=\"").concat(swalClasses.image, "\" />\n <h2 class=\"").concat(swalClasses.title, "\" id=\"").concat(swalClasses.title, "\"></h2>\n <button type=\"button\" class=\"").concat(swalClasses.close, "\"></button>\n </div>\n <div class=\"").concat(swalClasses.content, "\">\n <div id=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses['html-container'], "\"></div>\n <input class=\"").concat(swalClasses.input, "\" />\n <input type=\"file\" class=\"").concat(swalClasses.file, "\" />\n <div class=\"").concat(swalClasses.range, "\">\n <input type=\"range\" />\n <output></output>\n </div>\n <select class=\"").concat(swalClasses.select, "\"></select>\n <div class=\"").concat(swalClasses.radio, "\"></div>\n <label for=\"").concat(swalClasses.checkbox, "\" class=\"").concat(swalClasses.checkbox, "\">\n <input type=\"checkbox\" />\n <span class=\"").concat(swalClasses.label, "\"></span>\n </label>\n <textarea class=\"").concat(swalClasses.textarea, "\"></textarea>\n <div class=\"").concat(swalClasses['validation-message'], "\" id=\"").concat(swalClasses['validation-message'], "\"></div>\n </div>\n <div class=\"").concat(swalClasses.actions, "\">\n <button type=\"button\" class=\"").concat(swalClasses.confirm, "\">OK</button>\n <button type=\"button\" class=\"").concat(swalClasses.cancel, "\">Cancel</button>\n </div>\n <div class=\"").concat(swalClasses.footer, "\"></div>\n <div class=\"").concat(swalClasses['timer-progress-bar-container'], "\">\n <div class=\"").concat(swalClasses['timer-progress-bar'], "\"></div>\n </div>\n </div>\n").replace(/(^|\n)\s*/g, ''); 62937 62938 var resetOldContainer = function resetOldContainer() { 62939 var oldContainer = getContainer(); 62940 62941 if (!oldContainer) { 62942 return false; 62943 } 62944 62945 oldContainer.parentNode.removeChild(oldContainer); 62946 removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]); 62947 return true; 62948 }; 62949 62950 var oldInputVal; // IE11 workaround, see #1109 for details 62951 62952 var resetValidationMessage = function resetValidationMessage(e) { 62953 if (Swal.isVisible() && oldInputVal !== e.target.value) { 62954 Swal.resetValidationMessage(); 62955 } 62956 62957 oldInputVal = e.target.value; 62958 }; 62959 62960 var addInputChangeListeners = function addInputChangeListeners() { 62961 var content = getContent(); 62962 var input = getChildByClass(content, swalClasses.input); 62963 var file = getChildByClass(content, swalClasses.file); 62964 var range = content.querySelector(".".concat(swalClasses.range, " input")); 62965 var rangeOutput = content.querySelector(".".concat(swalClasses.range, " output")); 62966 var select = getChildByClass(content, swalClasses.select); 62967 var checkbox = content.querySelector(".".concat(swalClasses.checkbox, " input")); 62968 var textarea = getChildByClass(content, swalClasses.textarea); 62969 input.oninput = resetValidationMessage; 62970 file.onchange = resetValidationMessage; 62971 select.onchange = resetValidationMessage; 62972 checkbox.onchange = resetValidationMessage; 62973 textarea.oninput = resetValidationMessage; 62974 62975 range.oninput = function (e) { 62976 resetValidationMessage(e); 62977 rangeOutput.value = range.value; 62978 }; 62979 62980 range.onchange = function (e) { 62981 resetValidationMessage(e); 62982 range.nextSibling.value = range.value; 62983 }; 62984 }; 62985 62986 var getTarget = function getTarget(target) { 62987 return typeof target === 'string' ? document.querySelector(target) : target; 62988 }; 62989 62990 var setupAccessibility = function setupAccessibility(params) { 62991 var popup = getPopup(); 62992 popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); 62993 popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); 62994 62995 if (!params.toast) { 62996 popup.setAttribute('aria-modal', 'true'); 62997 } 62998 }; 62999 63000 var setupRTL = function setupRTL(targetElement) { 63001 if (window.getComputedStyle(targetElement).direction === 'rtl') { 63002 addClass(getContainer(), swalClasses.rtl); 63003 } 63004 }; 63005 /* 63006 * Add modal + backdrop to DOM 63007 */ 63008 63009 63010 var init = function init(params) { 63011 // Clean up the old popup container if it exists 63012 var oldContainerExisted = resetOldContainer(); 63013 /* istanbul ignore if */ 63014 63015 if (isNodeEnv()) { 63016 error('SweetAlert2 requires document to initialize'); 63017 return; 63018 } 63019 63020 var container = document.createElement('div'); 63021 container.className = swalClasses.container; 63022 63023 if (oldContainerExisted) { 63024 addClass(container, swalClasses['no-transition']); 63025 } 63026 63027 setInnerHtml(container, sweetHTML); 63028 var targetElement = getTarget(params.target); 63029 targetElement.appendChild(container); 63030 setupAccessibility(params); 63031 setupRTL(targetElement); 63032 addInputChangeListeners(); 63033 }; 63034 63035 var parseHtmlToContainer = function parseHtmlToContainer(param, target) { 63036 // DOM element 63037 if (param instanceof HTMLElement) { 63038 target.appendChild(param); // Object 63039 } else if (_typeof(param) === 'object') { 63040 handleObject(param, target); // Plain string 63041 } else if (param) { 63042 setInnerHtml(target, param); 63043 } 63044 }; 63045 63046 var handleObject = function handleObject(param, target) { 63047 // JQuery element(s) 63048 if (param.jquery) { 63049 handleJqueryElem(target, param); // For other objects use their string representation 63050 } else { 63051 setInnerHtml(target, param.toString()); 63052 } 63053 }; 63054 63055 var handleJqueryElem = function handleJqueryElem(target, elem) { 63056 target.textContent = ''; 63057 63058 if (0 in elem) { 63059 for (var i = 0; (i in elem); i++) { 63060 target.appendChild(elem[i].cloneNode(true)); 63061 } 63062 } else { 63063 target.appendChild(elem.cloneNode(true)); 63064 } 63065 }; 63066 63067 var animationEndEvent = function () { 63068 // Prevent run in Node env 63069 63070 /* istanbul ignore if */ 63071 if (isNodeEnv()) { 63072 return false; 63073 } 63074 63075 var testEl = document.createElement('div'); 63076 var transEndEventNames = { 63077 WebkitAnimation: 'webkitAnimationEnd', 63078 OAnimation: 'oAnimationEnd oanimationend', 63079 animation: 'animationend' 63080 }; 63081 63082 for (var i in transEndEventNames) { 63083 if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') { 63084 return transEndEventNames[i]; 63085 } 63086 } 63087 63088 return false; 63089 }(); 63090 63091 // https://github.com/twbs/bootstrap/blob/master/js/src/modal.js 63092 63093 var measureScrollbar = function measureScrollbar() { 63094 var scrollDiv = document.createElement('div'); 63095 scrollDiv.className = swalClasses['scrollbar-measure']; 63096 document.body.appendChild(scrollDiv); 63097 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 63098 document.body.removeChild(scrollDiv); 63099 return scrollbarWidth; 63100 }; 63101 63102 var renderActions = function renderActions(instance, params) { 63103 var actions = getActions(); 63104 var confirmButton = getConfirmButton(); 63105 var cancelButton = getCancelButton(); // Actions (buttons) wrapper 63106 63107 if (!params.showConfirmButton && !params.showCancelButton) { 63108 hide(actions); 63109 } // Custom class 63110 63111 63112 applyCustomClass(actions, params, 'actions'); // Render confirm button 63113 63114 renderButton(confirmButton, 'confirm', params); // render Cancel Button 63115 63116 renderButton(cancelButton, 'cancel', params); 63117 63118 if (params.buttonsStyling) { 63119 handleButtonsStyling(confirmButton, cancelButton, params); 63120 } else { 63121 removeClass([confirmButton, cancelButton], swalClasses.styled); 63122 confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = ''; 63123 cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = ''; 63124 } 63125 63126 if (params.reverseButtons) { 63127 confirmButton.parentNode.insertBefore(cancelButton, confirmButton); 63128 } 63129 }; 63130 63131 function handleButtonsStyling(confirmButton, cancelButton, params) { 63132 addClass([confirmButton, cancelButton], swalClasses.styled); // Buttons background colors 63133 63134 if (params.confirmButtonColor) { 63135 confirmButton.style.backgroundColor = params.confirmButtonColor; 63136 } 63137 63138 if (params.cancelButtonColor) { 63139 cancelButton.style.backgroundColor = params.cancelButtonColor; 63140 } // Loading state 63141 63142 63143 if (!isLoading()) { 63144 var confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color'); 63145 confirmButton.style.borderLeftColor = confirmButtonBackgroundColor; 63146 confirmButton.style.borderRightColor = confirmButtonBackgroundColor; 63147 } 63148 } 63149 63150 function renderButton(button, buttonType, params) { 63151 toggle(button, params["show".concat(capitalizeFirstLetter(buttonType), "Button")], 'inline-block'); 63152 setInnerHtml(button, params["".concat(buttonType, "ButtonText")]); // Set caption text 63153 63154 button.setAttribute('aria-label', params["".concat(buttonType, "ButtonAriaLabel")]); // ARIA label 63155 // Add buttons custom classes 63156 63157 button.className = swalClasses[buttonType]; 63158 applyCustomClass(button, params, "".concat(buttonType, "Button")); 63159 addClass(button, params["".concat(buttonType, "ButtonClass")]); 63160 } 63161 63162 function handleBackdropParam(container, backdrop) { 63163 if (typeof backdrop === 'string') { 63164 container.style.background = backdrop; 63165 } else if (!backdrop) { 63166 addClass([document.documentElement, document.body], swalClasses['no-backdrop']); 63167 } 63168 } 63169 63170 function handlePositionParam(container, position) { 63171 if (position in swalClasses) { 63172 addClass(container, swalClasses[position]); 63173 } else { 63174 warn('The "position" parameter is not valid, defaulting to "center"'); 63175 addClass(container, swalClasses.center); 63176 } 63177 } 63178 63179 function handleGrowParam(container, grow) { 63180 if (grow && typeof grow === 'string') { 63181 var growClass = "grow-".concat(grow); 63182 63183 if (growClass in swalClasses) { 63184 addClass(container, swalClasses[growClass]); 63185 } 63186 } 63187 } 63188 63189 var renderContainer = function renderContainer(instance, params) { 63190 var container = getContainer(); 63191 63192 if (!container) { 63193 return; 63194 } 63195 63196 handleBackdropParam(container, params.backdrop); 63197 63198 if (!params.backdrop && params.allowOutsideClick) { 63199 warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'); 63200 } 63201 63202 handlePositionParam(container, params.position); 63203 handleGrowParam(container, params.grow); // Custom class 63204 63205 applyCustomClass(container, params, 'container'); // Set queue step attribute for getQueueStep() method 63206 63207 var queueStep = document.body.getAttribute('data-swal2-queue-step'); 63208 63209 if (queueStep) { 63210 container.setAttribute('data-queue-step', queueStep); 63211 document.body.removeAttribute('data-swal2-queue-step'); 63212 } 63213 }; 63214 63215 /** 63216 * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. 63217 * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` 63218 * This is the approach that Babel will probably take to implement private methods/fields 63219 * https://github.com/tc39/proposal-private-methods 63220 * https://github.com/babel/babel/pull/7555 63221 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* 63222 * then we can use that language feature. 63223 */ 63224 var privateProps = { 63225 promise: new WeakMap(), 63226 innerParams: new WeakMap(), 63227 domCache: new WeakMap() 63228 }; 63229 63230 var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; 63231 var renderInput = function renderInput(instance, params) { 63232 var content = getContent(); 63233 var innerParams = privateProps.innerParams.get(instance); 63234 var rerender = !innerParams || params.input !== innerParams.input; 63235 inputTypes.forEach(function (inputType) { 63236 var inputClass = swalClasses[inputType]; 63237 var inputContainer = getChildByClass(content, inputClass); // set attributes 63238 63239 setAttributes(inputType, params.inputAttributes); // set class 63240 63241 inputContainer.className = inputClass; 63242 63243 if (rerender) { 63244 hide(inputContainer); 63245 } 63246 }); 63247 63248 if (params.input) { 63249 if (rerender) { 63250 showInput(params); 63251 } // set custom class 63252 63253 63254 setCustomClass(params); 63255 } 63256 }; 63257 63258 var showInput = function showInput(params) { 63259 if (!renderInputType[params.input]) { 63260 return error("Unexpected type of input! Expected \"text\", \"email\", \"password\", \"number\", \"tel\", \"select\", \"radio\", \"checkbox\", \"textarea\", \"file\" or \"url\", got \"".concat(params.input, "\"")); 63261 } 63262 63263 var inputContainer = getInputContainer(params.input); 63264 var input = renderInputType[params.input](inputContainer, params); 63265 show(input); // input autofocus 63266 63267 setTimeout(function () { 63268 focusInput(input); 63269 }); 63270 }; 63271 63272 var removeAttributes = function removeAttributes(input) { 63273 for (var i = 0; i < input.attributes.length; i++) { 63274 var attrName = input.attributes[i].name; 63275 63276 if (!(['type', 'value', 'style'].indexOf(attrName) !== -1)) { 63277 input.removeAttribute(attrName); 63278 } 63279 } 63280 }; 63281 63282 var setAttributes = function setAttributes(inputType, inputAttributes) { 63283 var input = getInput(getContent(), inputType); 63284 63285 if (!input) { 63286 return; 63287 } 63288 63289 removeAttributes(input); 63290 63291 for (var attr in inputAttributes) { 63292 // Do not set a placeholder for <input type="range"> 63293 // it'll crash Edge, #1298 63294 if (inputType === 'range' && attr === 'placeholder') { 63295 continue; 63296 } 63297 63298 input.setAttribute(attr, inputAttributes[attr]); 63299 } 63300 }; 63301 63302 var setCustomClass = function setCustomClass(params) { 63303 var inputContainer = getInputContainer(params.input); 63304 63305 if (params.customClass) { 63306 addClass(inputContainer, params.customClass.input); 63307 } 63308 }; 63309 63310 var setInputPlaceholder = function setInputPlaceholder(input, params) { 63311 if (!input.placeholder || params.inputPlaceholder) { 63312 input.placeholder = params.inputPlaceholder; 63313 } 63314 }; 63315 63316 var getInputContainer = function getInputContainer(inputType) { 63317 var inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input; 63318 return getChildByClass(getContent(), inputClass); 63319 }; 63320 63321 var renderInputType = {}; 63322 63323 renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = function (input, params) { 63324 if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { 63325 input.value = params.inputValue; 63326 } else if (!isPromise(params.inputValue)) { 63327 warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(_typeof(params.inputValue), "\"")); 63328 } 63329 63330 setInputPlaceholder(input, params); 63331 input.type = params.input; 63332 return input; 63333 }; 63334 63335 renderInputType.file = function (input, params) { 63336 setInputPlaceholder(input, params); 63337 return input; 63338 }; 63339 63340 renderInputType.range = function (range, params) { 63341 var rangeInput = range.querySelector('input'); 63342 var rangeOutput = range.querySelector('output'); 63343 rangeInput.value = params.inputValue; 63344 rangeInput.type = params.input; 63345 rangeOutput.value = params.inputValue; 63346 return range; 63347 }; 63348 63349 renderInputType.select = function (select, params) { 63350 select.textContent = ''; 63351 63352 if (params.inputPlaceholder) { 63353 var placeholder = document.createElement('option'); 63354 setInnerHtml(placeholder, params.inputPlaceholder); 63355 placeholder.value = ''; 63356 placeholder.disabled = true; 63357 placeholder.selected = true; 63358 select.appendChild(placeholder); 63359 } 63360 63361 return select; 63362 }; 63363 63364 renderInputType.radio = function (radio) { 63365 radio.textContent = ''; 63366 return radio; 63367 }; 63368 63369 renderInputType.checkbox = function (checkboxContainer, params) { 63370 var checkbox = getInput(getContent(), 'checkbox'); 63371 checkbox.value = 1; 63372 checkbox.id = swalClasses.checkbox; 63373 checkbox.checked = Boolean(params.inputValue); 63374 var label = checkboxContainer.querySelector('span'); 63375 setInnerHtml(label, params.inputPlaceholder); 63376 return checkboxContainer; 63377 }; 63378 63379 renderInputType.textarea = function (textarea, params) { 63380 textarea.value = params.inputValue; 63381 setInputPlaceholder(textarea, params); 63382 63383 if ('MutationObserver' in window) { 63384 // #1699 63385 var initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width); 63386 var popupPadding = parseInt(window.getComputedStyle(getPopup()).paddingLeft) + parseInt(window.getComputedStyle(getPopup()).paddingRight); 63387 63388 var outputsize = function outputsize() { 63389 var contentWidth = textarea.offsetWidth + popupPadding; 63390 63391 if (contentWidth > initialPopupWidth) { 63392 getPopup().style.width = "".concat(contentWidth, "px"); 63393 } else { 63394 getPopup().style.width = null; 63395 } 63396 }; 63397 63398 new MutationObserver(outputsize).observe(textarea, { 63399 attributes: true, 63400 attributeFilter: ['style'] 63401 }); 63402 } 63403 63404 return textarea; 63405 }; 63406 63407 var renderContent = function renderContent(instance, params) { 63408 var content = getContent().querySelector("#".concat(swalClasses.content)); // Content as HTML 63409 63410 if (params.html) { 63411 parseHtmlToContainer(params.html, content); 63412 show(content, 'block'); // Content as plain text 63413 } else if (params.text) { 63414 content.textContent = params.text; 63415 show(content, 'block'); // No content 63416 } else { 63417 hide(content); 63418 } 63419 63420 renderInput(instance, params); // Custom class 63421 63422 applyCustomClass(getContent(), params, 'content'); 63423 }; 63424 63425 var renderFooter = function renderFooter(instance, params) { 63426 var footer = getFooter(); 63427 toggle(footer, params.footer); 63428 63429 if (params.footer) { 63430 parseHtmlToContainer(params.footer, footer); 63431 } // Custom class 63432 63433 63434 applyCustomClass(footer, params, 'footer'); 63435 }; 63436 63437 var renderCloseButton = function renderCloseButton(instance, params) { 63438 var closeButton = getCloseButton(); 63439 setInnerHtml(closeButton, params.closeButtonHtml); // Custom class 63440 63441 applyCustomClass(closeButton, params, 'closeButton'); 63442 toggle(closeButton, params.showCloseButton); 63443 closeButton.setAttribute('aria-label', params.closeButtonAriaLabel); 63444 }; 63445 63446 var renderIcon = function renderIcon(instance, params) { 63447 var innerParams = privateProps.innerParams.get(instance); // if the give icon already rendered, apply the custom class without re-rendering the icon 63448 63449 if (innerParams && params.icon === innerParams.icon && getIcon()) { 63450 applyCustomClass(getIcon(), params, 'icon'); 63451 return; 63452 } 63453 63454 hideAllIcons(); 63455 63456 if (!params.icon) { 63457 return; 63458 } 63459 63460 if (Object.keys(iconTypes).indexOf(params.icon) !== -1) { 63461 var icon = elementBySelector(".".concat(swalClasses.icon, ".").concat(iconTypes[params.icon])); 63462 show(icon); // Custom or default content 63463 63464 setContent(icon, params); 63465 adjustSuccessIconBackgoundColor(); // Custom class 63466 63467 applyCustomClass(icon, params, 'icon'); // Animate icon 63468 63469 addClass(icon, params.showClass.icon); 63470 } else { 63471 error("Unknown icon! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.icon, "\"")); 63472 } 63473 }; 63474 63475 var hideAllIcons = function hideAllIcons() { 63476 var icons = getIcons(); 63477 63478 for (var i = 0; i < icons.length; i++) { 63479 hide(icons[i]); 63480 } 63481 }; // Adjust success icon background color to match the popup background color 63482 63483 63484 var adjustSuccessIconBackgoundColor = function adjustSuccessIconBackgoundColor() { 63485 var popup = getPopup(); 63486 var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); 63487 var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); 63488 63489 for (var i = 0; i < successIconParts.length; i++) { 63490 successIconParts[i].style.backgroundColor = popupBackgroundColor; 63491 } 63492 }; 63493 63494 var setContent = function setContent(icon, params) { 63495 icon.textContent = ''; 63496 63497 if (params.iconHtml) { 63498 setInnerHtml(icon, iconContent(params.iconHtml)); 63499 } else if (params.icon === 'success') { 63500 setInnerHtml(icon, "\n <div class=\"swal2-success-circular-line-left\"></div>\n <span class=\"swal2-success-line-tip\"></span> <span class=\"swal2-success-line-long\"></span>\n <div class=\"swal2-success-ring\"></div> <div class=\"swal2-success-fix\"></div>\n <div class=\"swal2-success-circular-line-right\"></div>\n "); 63501 } else if (params.icon === 'error') { 63502 setInnerHtml(icon, "\n <span class=\"swal2-x-mark\">\n <span class=\"swal2-x-mark-line-left\"></span>\n <span class=\"swal2-x-mark-line-right\"></span>\n </span>\n "); 63503 } else { 63504 var defaultIconHtml = { 63505 question: '?', 63506 warning: '!', 63507 info: 'i' 63508 }; 63509 setInnerHtml(icon, iconContent(defaultIconHtml[params.icon])); 63510 } 63511 }; 63512 63513 var iconContent = function iconContent(content) { 63514 return "<div class=\"".concat(swalClasses['icon-content'], "\">").concat(content, "</div>"); 63515 }; 63516 63517 var renderImage = function renderImage(instance, params) { 63518 var image = getImage(); 63519 63520 if (!params.imageUrl) { 63521 return hide(image); 63522 } 63523 63524 show(image, ''); // Src, alt 63525 63526 image.setAttribute('src', params.imageUrl); 63527 image.setAttribute('alt', params.imageAlt); // Width, height 63528 63529 applyNumericalStyle(image, 'width', params.imageWidth); 63530 applyNumericalStyle(image, 'height', params.imageHeight); // Class 63531 63532 image.className = swalClasses.image; 63533 applyCustomClass(image, params, 'image'); 63534 }; 63535 63536 var currentSteps = []; 63537 /* 63538 * Global function for chaining sweetAlert popups 63539 */ 63540 63541 var queue = function queue(steps) { 63542 var Swal = this; 63543 currentSteps = steps; 63544 63545 var resetAndResolve = function resetAndResolve(resolve, value) { 63546 currentSteps = []; 63547 resolve(value); 63548 }; 63549 63550 var queueResult = []; 63551 return new Promise(function (resolve) { 63552 (function step(i, callback) { 63553 if (i < currentSteps.length) { 63554 document.body.setAttribute('data-swal2-queue-step', i); 63555 Swal.fire(currentSteps[i]).then(function (result) { 63556 if (typeof result.value !== 'undefined') { 63557 queueResult.push(result.value); 63558 step(i + 1, callback); 63559 } else { 63560 resetAndResolve(resolve, { 63561 dismiss: result.dismiss 63562 }); 63563 } 63564 }); 63565 } else { 63566 resetAndResolve(resolve, { 63567 value: queueResult 63568 }); 63569 } 63570 })(0); 63571 }); 63572 }; 63573 /* 63574 * Global function for getting the index of current popup in queue 63575 */ 63576 63577 var getQueueStep = function getQueueStep() { 63578 return getContainer() && getContainer().getAttribute('data-queue-step'); 63579 }; 63580 /* 63581 * Global function for inserting a popup to the queue 63582 */ 63583 63584 var insertQueueStep = function insertQueueStep(step, index) { 63585 if (index && index < currentSteps.length) { 63586 return currentSteps.splice(index, 0, step); 63587 } 63588 63589 return currentSteps.push(step); 63590 }; 63591 /* 63592 * Global function for deleting a popup from the queue 63593 */ 63594 63595 var deleteQueueStep = function deleteQueueStep(index) { 63596 if (typeof currentSteps[index] !== 'undefined') { 63597 currentSteps.splice(index, 1); 63598 } 63599 }; 63600 63601 var createStepElement = function createStepElement(step) { 63602 var stepEl = document.createElement('li'); 63603 addClass(stepEl, swalClasses['progress-step']); 63604 setInnerHtml(stepEl, step); 63605 return stepEl; 63606 }; 63607 63608 var createLineElement = function createLineElement(params) { 63609 var lineEl = document.createElement('li'); 63610 addClass(lineEl, swalClasses['progress-step-line']); 63611 63612 if (params.progressStepsDistance) { 63613 lineEl.style.width = params.progressStepsDistance; 63614 } 63615 63616 return lineEl; 63617 }; 63618 63619 var renderProgressSteps = function renderProgressSteps(instance, params) { 63620 var progressStepsContainer = getProgressSteps(); 63621 63622 if (!params.progressSteps || params.progressSteps.length === 0) { 63623 return hide(progressStepsContainer); 63624 } 63625 63626 show(progressStepsContainer); 63627 progressStepsContainer.textContent = ''; 63628 var currentProgressStep = parseInt(params.currentProgressStep === undefined ? getQueueStep() : params.currentProgressStep); 63629 63630 if (currentProgressStep >= params.progressSteps.length) { 63631 warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); 63632 } 63633 63634 params.progressSteps.forEach(function (step, index) { 63635 var stepEl = createStepElement(step); 63636 progressStepsContainer.appendChild(stepEl); 63637 63638 if (index === currentProgressStep) { 63639 addClass(stepEl, swalClasses['active-progress-step']); 63640 } 63641 63642 if (index !== params.progressSteps.length - 1) { 63643 var lineEl = createLineElement(params); 63644 progressStepsContainer.appendChild(lineEl); 63645 } 63646 }); 63647 }; 63648 63649 var renderTitle = function renderTitle(instance, params) { 63650 var title = getTitle(); 63651 toggle(title, params.title || params.titleText); 63652 63653 if (params.title) { 63654 parseHtmlToContainer(params.title, title); 63655 } 63656 63657 if (params.titleText) { 63658 title.innerText = params.titleText; 63659 } // Custom class 63660 63661 63662 applyCustomClass(title, params, 'title'); 63663 }; 63664 63665 var renderHeader = function renderHeader(instance, params) { 63666 var header = getHeader(); // Custom class 63667 63668 applyCustomClass(header, params, 'header'); // Progress steps 63669 63670 renderProgressSteps(instance, params); // Icon 63671 63672 renderIcon(instance, params); // Image 63673 63674 renderImage(instance, params); // Title 63675 63676 renderTitle(instance, params); // Close button 63677 63678 renderCloseButton(instance, params); 63679 }; 63680 63681 var renderPopup = function renderPopup(instance, params) { 63682 var popup = getPopup(); // Width 63683 63684 applyNumericalStyle(popup, 'width', params.width); // Padding 63685 63686 applyNumericalStyle(popup, 'padding', params.padding); // Background 63687 63688 if (params.background) { 63689 popup.style.background = params.background; 63690 } // Classes 63691 63692 63693 addClasses(popup, params); 63694 }; 63695 63696 var addClasses = function addClasses(popup, params) { 63697 // Default Class + showClass when updating Swal.update({}) 63698 popup.className = "".concat(swalClasses.popup, " ").concat(isVisible(popup) ? params.showClass.popup : ''); 63699 63700 if (params.toast) { 63701 addClass([document.documentElement, document.body], swalClasses['toast-shown']); 63702 addClass(popup, swalClasses.toast); 63703 } else { 63704 addClass(popup, swalClasses.modal); 63705 } // Custom class 63706 63707 63708 applyCustomClass(popup, params, 'popup'); 63709 63710 if (typeof params.customClass === 'string') { 63711 addClass(popup, params.customClass); 63712 } // Icon class (#1842) 63713 63714 63715 if (params.icon) { 63716 addClass(popup, swalClasses["icon-".concat(params.icon)]); 63717 } 63718 }; 63719 63720 var render = function render(instance, params) { 63721 renderPopup(instance, params); 63722 renderContainer(instance, params); 63723 renderHeader(instance, params); 63724 renderContent(instance, params); 63725 renderActions(instance, params); 63726 renderFooter(instance, params); 63727 63728 if (typeof params.onRender === 'function') { 63729 params.onRender(getPopup()); 63730 } 63731 }; 63732 63733 /* 63734 * Global function to determine if SweetAlert2 popup is shown 63735 */ 63736 63737 var isVisible$1 = function isVisible$$1() { 63738 return isVisible(getPopup()); 63739 }; 63740 /* 63741 * Global function to click 'Confirm' button 63742 */ 63743 63744 var clickConfirm = function clickConfirm() { 63745 return getConfirmButton() && getConfirmButton().click(); 63746 }; 63747 /* 63748 * Global function to click 'Cancel' button 63749 */ 63750 63751 var clickCancel = function clickCancel() { 63752 return getCancelButton() && getCancelButton().click(); 63753 }; 63754 63755 function fire() { 63756 var Swal = this; 63757 63758 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 63759 args[_key] = arguments[_key]; 63760 } 63761 63762 return _construct(Swal, args); 63763 } 63764 63765 /** 63766 * Returns an extended version of `Swal` containing `params` as defaults. 63767 * Useful for reusing Swal configuration. 63768 * 63769 * For example: 63770 * 63771 * Before: 63772 * const textPromptOptions = { input: 'text', showCancelButton: true } 63773 * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' }) 63774 * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' }) 63775 * 63776 * After: 63777 * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) 63778 * const {value: firstName} = await TextPrompt('What is your first name?') 63779 * const {value: lastName} = await TextPrompt('What is your last name?') 63780 * 63781 * @param mixinParams 63782 */ 63783 function mixin(mixinParams) { 63784 var MixinSwal = /*#__PURE__*/function (_this) { 63785 _inherits(MixinSwal, _this); 63786 63787 var _super = _createSuper(MixinSwal); 63788 63789 function MixinSwal() { 63790 _classCallCheck(this, MixinSwal); 63791 63792 return _super.apply(this, arguments); 63793 } 63794 63795 _createClass(MixinSwal, [{ 63796 key: "_main", 63797 value: function _main(params) { 63798 return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, _extends({}, mixinParams, params)); 63799 } 63800 }]); 63801 63802 return MixinSwal; 63803 }(this); 63804 63805 return MixinSwal; 63806 } 63807 63808 /** 63809 * Show spinner instead of Confirm button 63810 */ 63811 63812 var showLoading = function showLoading() { 63813 var popup = getPopup(); 63814 63815 if (!popup) { 63816 Swal.fire(); 63817 } 63818 63819 popup = getPopup(); 63820 var actions = getActions(); 63821 var confirmButton = getConfirmButton(); 63822 show(actions); 63823 show(confirmButton, 'inline-block'); 63824 addClass([popup, actions], swalClasses.loading); 63825 confirmButton.disabled = true; 63826 popup.setAttribute('data-loading', true); 63827 popup.setAttribute('aria-busy', true); 63828 popup.focus(); 63829 }; 63830 63831 var RESTORE_FOCUS_TIMEOUT = 100; 63832 63833 var globalState = {}; 63834 63835 var focusPreviousActiveElement = function focusPreviousActiveElement() { 63836 if (globalState.previousActiveElement && globalState.previousActiveElement.focus) { 63837 globalState.previousActiveElement.focus(); 63838 globalState.previousActiveElement = null; 63839 } else if (document.body) { 63840 document.body.focus(); 63841 } 63842 }; // Restore previous active (focused) element 63843 63844 63845 var restoreActiveElement = function restoreActiveElement() { 63846 return new Promise(function (resolve) { 63847 var x = window.scrollX; 63848 var y = window.scrollY; 63849 globalState.restoreFocusTimeout = setTimeout(function () { 63850 focusPreviousActiveElement(); 63851 resolve(); 63852 }, RESTORE_FOCUS_TIMEOUT); // issues/900 63853 63854 /* istanbul ignore if */ 63855 63856 if (typeof x !== 'undefined' && typeof y !== 'undefined') { 63857 // IE doesn't have scrollX/scrollY support 63858 window.scrollTo(x, y); 63859 } 63860 }); 63861 }; 63862 63863 /** 63864 * If `timer` parameter is set, returns number of milliseconds of timer remained. 63865 * Otherwise, returns undefined. 63866 */ 63867 63868 var getTimerLeft = function getTimerLeft() { 63869 return globalState.timeout && globalState.timeout.getTimerLeft(); 63870 }; 63871 /** 63872 * Stop timer. Returns number of milliseconds of timer remained. 63873 * If `timer` parameter isn't set, returns undefined. 63874 */ 63875 63876 var stopTimer = function stopTimer() { 63877 if (globalState.timeout) { 63878 stopTimerProgressBar(); 63879 return globalState.timeout.stop(); 63880 } 63881 }; 63882 /** 63883 * Resume timer. Returns number of milliseconds of timer remained. 63884 * If `timer` parameter isn't set, returns undefined. 63885 */ 63886 63887 var resumeTimer = function resumeTimer() { 63888 if (globalState.timeout) { 63889 var remaining = globalState.timeout.start(); 63890 animateTimerProgressBar(remaining); 63891 return remaining; 63892 } 63893 }; 63894 /** 63895 * Resume timer. Returns number of milliseconds of timer remained. 63896 * If `timer` parameter isn't set, returns undefined. 63897 */ 63898 63899 var toggleTimer = function toggleTimer() { 63900 var timer = globalState.timeout; 63901 return timer && (timer.running ? stopTimer() : resumeTimer()); 63902 }; 63903 /** 63904 * Increase timer. Returns number of milliseconds of an updated timer. 63905 * If `timer` parameter isn't set, returns undefined. 63906 */ 63907 63908 var increaseTimer = function increaseTimer(n) { 63909 if (globalState.timeout) { 63910 var remaining = globalState.timeout.increase(n); 63911 animateTimerProgressBar(remaining, true); 63912 return remaining; 63913 } 63914 }; 63915 /** 63916 * Check if timer is running. Returns true if timer is running 63917 * or false if timer is paused or stopped. 63918 * If `timer` parameter isn't set, returns undefined 63919 */ 63920 63921 var isTimerRunning = function isTimerRunning() { 63922 return globalState.timeout && globalState.timeout.isRunning(); 63923 }; 63924 63925 var defaultParams = { 63926 title: '', 63927 titleText: '', 63928 text: '', 63929 html: '', 63930 footer: '', 63931 icon: undefined, 63932 iconHtml: undefined, 63933 toast: false, 63934 animation: true, 63935 showClass: { 63936 popup: 'swal2-show', 63937 backdrop: 'swal2-backdrop-show', 63938 icon: 'swal2-icon-show' 63939 }, 63940 hideClass: { 63941 popup: 'swal2-hide', 63942 backdrop: 'swal2-backdrop-hide', 63943 icon: 'swal2-icon-hide' 63944 }, 63945 customClass: undefined, 63946 target: 'body', 63947 backdrop: true, 63948 heightAuto: true, 63949 allowOutsideClick: true, 63950 allowEscapeKey: true, 63951 allowEnterKey: true, 63952 stopKeydownPropagation: true, 63953 keydownListenerCapture: false, 63954 showConfirmButton: true, 63955 showCancelButton: false, 63956 preConfirm: undefined, 63957 confirmButtonText: 'OK', 63958 confirmButtonAriaLabel: '', 63959 confirmButtonColor: undefined, 63960 cancelButtonText: 'Cancel', 63961 cancelButtonAriaLabel: '', 63962 cancelButtonColor: undefined, 63963 buttonsStyling: true, 63964 reverseButtons: false, 63965 focusConfirm: true, 63966 focusCancel: false, 63967 showCloseButton: false, 63968 closeButtonHtml: '×', 63969 closeButtonAriaLabel: 'Close this dialog', 63970 showLoaderOnConfirm: false, 63971 imageUrl: undefined, 63972 imageWidth: undefined, 63973 imageHeight: undefined, 63974 imageAlt: '', 63975 timer: undefined, 63976 timerProgressBar: false, 63977 width: undefined, 63978 padding: undefined, 63979 background: undefined, 63980 input: undefined, 63981 inputPlaceholder: '', 63982 inputValue: '', 63983 inputOptions: {}, 63984 inputAutoTrim: true, 63985 inputAttributes: {}, 63986 inputValidator: undefined, 63987 validationMessage: undefined, 63988 grow: false, 63989 position: 'center', 63990 progressSteps: [], 63991 currentProgressStep: undefined, 63992 progressStepsDistance: undefined, 63993 onBeforeOpen: undefined, 63994 onOpen: undefined, 63995 onRender: undefined, 63996 onClose: undefined, 63997 onAfterClose: undefined, 63998 onDestroy: undefined, 63999 scrollbarPadding: true 64000 }; 64001 var updatableParams = ['title', 'titleText', 'text', 'html', 'footer', 'icon', 'hideClass', 'customClass', 'allowOutsideClick', 'allowEscapeKey', 'showConfirmButton', 'showCancelButton', 'confirmButtonText', 'confirmButtonAriaLabel', 'confirmButtonColor', 'cancelButtonText', 'cancelButtonAriaLabel', 'cancelButtonColor', 'buttonsStyling', 'reverseButtons', 'showCloseButton', 'closeButtonHtml', 'closeButtonAriaLabel', 'imageUrl', 'imageWidth', 'imageHeight', 'imageAlt', 'progressSteps', 'currentProgressStep', 'onClose', 'onAfterClose', 'onDestroy']; 64002 var deprecatedParams = { 64003 animation: 'showClass" and "hideClass' 64004 }; 64005 var toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusCancel', 'heightAuto', 'keydownListenerCapture']; 64006 /** 64007 * Is valid parameter 64008 * @param {String} paramName 64009 */ 64010 64011 var isValidParameter = function isValidParameter(paramName) { 64012 return Object.prototype.hasOwnProperty.call(defaultParams, paramName); 64013 }; 64014 /** 64015 * Is valid parameter for Swal.update() method 64016 * @param {String} paramName 64017 */ 64018 64019 var isUpdatableParameter = function isUpdatableParameter(paramName) { 64020 return updatableParams.indexOf(paramName) !== -1; 64021 }; 64022 /** 64023 * Is deprecated parameter 64024 * @param {String} paramName 64025 */ 64026 64027 var isDeprecatedParameter = function isDeprecatedParameter(paramName) { 64028 return deprecatedParams[paramName]; 64029 }; 64030 64031 var checkIfParamIsValid = function checkIfParamIsValid(param) { 64032 if (!isValidParameter(param)) { 64033 warn("Unknown parameter \"".concat(param, "\"")); 64034 } 64035 }; 64036 64037 var checkIfToastParamIsValid = function checkIfToastParamIsValid(param) { 64038 if (toastIncompatibleParams.indexOf(param) !== -1) { 64039 warn("The parameter \"".concat(param, "\" is incompatible with toasts")); 64040 } 64041 }; 64042 64043 var checkIfParamIsDeprecated = function checkIfParamIsDeprecated(param) { 64044 if (isDeprecatedParameter(param)) { 64045 warnAboutDepreation(param, isDeprecatedParameter(param)); 64046 } 64047 }; 64048 /** 64049 * Show relevant warnings for given params 64050 * 64051 * @param params 64052 */ 64053 64054 64055 var showWarningsForParams = function showWarningsForParams(params) { 64056 for (var param in params) { 64057 checkIfParamIsValid(param); 64058 64059 if (params.toast) { 64060 checkIfToastParamIsValid(param); 64061 } 64062 64063 checkIfParamIsDeprecated(param); 64064 } 64065 }; 64066 64067 64068 64069 var staticMethods = /*#__PURE__*/Object.freeze({ 64070 isValidParameter: isValidParameter, 64071 isUpdatableParameter: isUpdatableParameter, 64072 isDeprecatedParameter: isDeprecatedParameter, 64073 argsToParams: argsToParams, 64074 isVisible: isVisible$1, 64075 clickConfirm: clickConfirm, 64076 clickCancel: clickCancel, 64077 getContainer: getContainer, 64078 getPopup: getPopup, 64079 getTitle: getTitle, 64080 getContent: getContent, 64081 getHtmlContainer: getHtmlContainer, 64082 getImage: getImage, 64083 getIcon: getIcon, 64084 getIcons: getIcons, 64085 getCloseButton: getCloseButton, 64086 getActions: getActions, 64087 getConfirmButton: getConfirmButton, 64088 getCancelButton: getCancelButton, 64089 getHeader: getHeader, 64090 getFooter: getFooter, 64091 getTimerProgressBar: getTimerProgressBar, 64092 getFocusableElements: getFocusableElements, 64093 getValidationMessage: getValidationMessage, 64094 isLoading: isLoading, 64095 fire: fire, 64096 mixin: mixin, 64097 queue: queue, 64098 getQueueStep: getQueueStep, 64099 insertQueueStep: insertQueueStep, 64100 deleteQueueStep: deleteQueueStep, 64101 showLoading: showLoading, 64102 enableLoading: showLoading, 64103 getTimerLeft: getTimerLeft, 64104 stopTimer: stopTimer, 64105 resumeTimer: resumeTimer, 64106 toggleTimer: toggleTimer, 64107 increaseTimer: increaseTimer, 64108 isTimerRunning: isTimerRunning 64109 }); 64110 64111 /** 64112 * Enables buttons and hide loader. 64113 */ 64114 64115 function hideLoading() { 64116 // do nothing if popup is closed 64117 var innerParams = privateProps.innerParams.get(this); 64118 64119 if (!innerParams) { 64120 return; 64121 } 64122 64123 var domCache = privateProps.domCache.get(this); 64124 64125 if (!innerParams.showConfirmButton) { 64126 hide(domCache.confirmButton); 64127 64128 if (!innerParams.showCancelButton) { 64129 hide(domCache.actions); 64130 } 64131 } 64132 64133 removeClass([domCache.popup, domCache.actions], swalClasses.loading); 64134 domCache.popup.removeAttribute('aria-busy'); 64135 domCache.popup.removeAttribute('data-loading'); 64136 domCache.confirmButton.disabled = false; 64137 domCache.cancelButton.disabled = false; 64138 } 64139 64140 function getInput$1(instance) { 64141 var innerParams = privateProps.innerParams.get(instance || this); 64142 var domCache = privateProps.domCache.get(instance || this); 64143 64144 if (!domCache) { 64145 return null; 64146 } 64147 64148 return getInput(domCache.content, innerParams.input); 64149 } 64150 64151 var fixScrollbar = function fixScrollbar() { 64152 // for queues, do not do this more than once 64153 if (states.previousBodyPadding !== null) { 64154 return; 64155 } // if the body has overflow 64156 64157 64158 if (document.body.scrollHeight > window.innerHeight) { 64159 // add padding so the content doesn't shift after removal of scrollbar 64160 states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); 64161 document.body.style.paddingRight = "".concat(states.previousBodyPadding + measureScrollbar(), "px"); 64162 } 64163 }; 64164 var undoScrollbar = function undoScrollbar() { 64165 if (states.previousBodyPadding !== null) { 64166 document.body.style.paddingRight = "".concat(states.previousBodyPadding, "px"); 64167 states.previousBodyPadding = null; 64168 } 64169 }; 64170 64171 /* istanbul ignore file */ 64172 64173 var iOSfix = function iOSfix() { 64174 var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1; 64175 64176 if (iOS && !hasClass(document.body, swalClasses.iosfix)) { 64177 var offset = document.body.scrollTop; 64178 document.body.style.top = "".concat(offset * -1, "px"); 64179 addClass(document.body, swalClasses.iosfix); 64180 lockBodyScroll(); 64181 addBottomPaddingForTallPopups(); // #1948 64182 } 64183 }; 64184 64185 var addBottomPaddingForTallPopups = function addBottomPaddingForTallPopups() { 64186 var safari = !navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i); 64187 64188 if (safari) { 64189 var bottomPanelHeight = 44; 64190 64191 if (getPopup().scrollHeight > window.innerHeight - bottomPanelHeight) { 64192 getContainer().style.paddingBottom = "".concat(bottomPanelHeight, "px"); 64193 } 64194 } 64195 }; 64196 64197 var lockBodyScroll = function lockBodyScroll() { 64198 // #1246 64199 var container = getContainer(); 64200 var preventTouchMove; 64201 64202 container.ontouchstart = function (e) { 64203 preventTouchMove = shouldPreventTouchMove(e.target); 64204 }; 64205 64206 container.ontouchmove = function (e) { 64207 if (preventTouchMove) { 64208 e.preventDefault(); 64209 e.stopPropagation(); 64210 } 64211 }; 64212 }; 64213 64214 var shouldPreventTouchMove = function shouldPreventTouchMove(target) { 64215 var container = getContainer(); 64216 64217 if (target === container) { 64218 return true; 64219 } 64220 64221 if (!isScrollable(container) && target.tagName !== 'INPUT' && // #1603 64222 !(isScrollable(getContent()) && // #1944 64223 getContent().contains(target))) { 64224 return true; 64225 } 64226 64227 return false; 64228 }; 64229 64230 var undoIOSfix = function undoIOSfix() { 64231 if (hasClass(document.body, swalClasses.iosfix)) { 64232 var offset = parseInt(document.body.style.top, 10); 64233 removeClass(document.body, swalClasses.iosfix); 64234 document.body.style.top = ''; 64235 document.body.scrollTop = offset * -1; 64236 } 64237 }; 64238 64239 /* istanbul ignore file */ 64240 64241 var isIE11 = function isIE11() { 64242 return !!window.MSInputMethodContext && !!document.documentMode; 64243 }; // Fix IE11 centering sweetalert2/issues/933 64244 64245 64246 var fixVerticalPositionIE = function fixVerticalPositionIE() { 64247 var container = getContainer(); 64248 var popup = getPopup(); 64249 container.style.removeProperty('align-items'); 64250 64251 if (popup.offsetTop < 0) { 64252 container.style.alignItems = 'flex-start'; 64253 } 64254 }; 64255 64256 var IEfix = function IEfix() { 64257 if (typeof window !== 'undefined' && isIE11()) { 64258 fixVerticalPositionIE(); 64259 window.addEventListener('resize', fixVerticalPositionIE); 64260 } 64261 }; 64262 var undoIEfix = function undoIEfix() { 64263 if (typeof window !== 'undefined' && isIE11()) { 64264 window.removeEventListener('resize', fixVerticalPositionIE); 64265 } 64266 }; 64267 64268 // Adding aria-hidden="true" to elements outside of the active modal dialog ensures that 64269 // elements not within the active modal dialog will not be surfaced if a user opens a screen 64270 // readerâs list of elements (headings, form controls, landmarks, etc.) in the document. 64271 64272 var setAriaHidden = function setAriaHidden() { 64273 var bodyChildren = toArray(document.body.children); 64274 bodyChildren.forEach(function (el) { 64275 if (el === getContainer() || contains(el, getContainer())) { 64276 return; 64277 } 64278 64279 if (el.hasAttribute('aria-hidden')) { 64280 el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden')); 64281 } 64282 64283 el.setAttribute('aria-hidden', 'true'); 64284 }); 64285 }; 64286 var unsetAriaHidden = function unsetAriaHidden() { 64287 var bodyChildren = toArray(document.body.children); 64288 bodyChildren.forEach(function (el) { 64289 if (el.hasAttribute('data-previous-aria-hidden')) { 64290 el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden')); 64291 el.removeAttribute('data-previous-aria-hidden'); 64292 } else { 64293 el.removeAttribute('aria-hidden'); 64294 } 64295 }); 64296 }; 64297 64298 /** 64299 * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. 64300 * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` 64301 * This is the approach that Babel will probably take to implement private methods/fields 64302 * https://github.com/tc39/proposal-private-methods 64303 * https://github.com/babel/babel/pull/7555 64304 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* 64305 * then we can use that language feature. 64306 */ 64307 var privateMethods = { 64308 swalPromiseResolve: new WeakMap() 64309 }; 64310 64311 /* 64312 * Instance method to close sweetAlert 64313 */ 64314 64315 function removePopupAndResetState(instance, container, isToast$$1, onAfterClose) { 64316 if (isToast$$1) { 64317 triggerOnAfterCloseAndDispose(instance, onAfterClose); 64318 } else { 64319 restoreActiveElement().then(function () { 64320 return triggerOnAfterCloseAndDispose(instance, onAfterClose); 64321 }); 64322 globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { 64323 capture: globalState.keydownListenerCapture 64324 }); 64325 globalState.keydownHandlerAdded = false; 64326 } 64327 64328 if (container.parentNode && !document.body.getAttribute('data-swal2-queue-step')) { 64329 container.parentNode.removeChild(container); 64330 } 64331 64332 if (isModal()) { 64333 undoScrollbar(); 64334 undoIOSfix(); 64335 undoIEfix(); 64336 unsetAriaHidden(); 64337 } 64338 64339 removeBodyClasses(); 64340 } 64341 64342 function removeBodyClasses() { 64343 removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['toast-column']]); 64344 } 64345 64346 function close(resolveValue) { 64347 var popup = getPopup(); 64348 64349 if (!popup) { 64350 return; 64351 } 64352 64353 var innerParams = privateProps.innerParams.get(this); 64354 64355 if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) { 64356 return; 64357 } 64358 64359 var swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); 64360 removeClass(popup, innerParams.showClass.popup); 64361 addClass(popup, innerParams.hideClass.popup); 64362 var backdrop = getContainer(); 64363 removeClass(backdrop, innerParams.showClass.backdrop); 64364 addClass(backdrop, innerParams.hideClass.backdrop); 64365 handlePopupAnimation(this, popup, innerParams); 64366 64367 if (typeof resolveValue !== 'undefined') { 64368 resolveValue.isDismissed = typeof resolveValue.dismiss !== 'undefined'; 64369 resolveValue.isConfirmed = typeof resolveValue.dismiss === 'undefined'; 64370 } else { 64371 resolveValue = { 64372 isDismissed: true, 64373 isConfirmed: false 64374 }; 64375 } // Resolve Swal promise 64376 64377 64378 swalPromiseResolve(resolveValue || {}); 64379 } 64380 64381 var handlePopupAnimation = function handlePopupAnimation(instance, popup, innerParams) { 64382 var container = getContainer(); // If animation is supported, animate 64383 64384 var animationIsSupported = animationEndEvent && hasCssAnimation(popup); 64385 var onClose = innerParams.onClose, 64386 onAfterClose = innerParams.onAfterClose; 64387 64388 if (onClose !== null && typeof onClose === 'function') { 64389 onClose(popup); 64390 } 64391 64392 if (animationIsSupported) { 64393 animatePopup(instance, popup, container, onAfterClose); 64394 } else { 64395 // Otherwise, remove immediately 64396 removePopupAndResetState(instance, container, isToast(), onAfterClose); 64397 } 64398 }; 64399 64400 var animatePopup = function animatePopup(instance, popup, container, onAfterClose) { 64401 globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, isToast(), onAfterClose); 64402 popup.addEventListener(animationEndEvent, function (e) { 64403 if (e.target === popup) { 64404 globalState.swalCloseEventFinishedCallback(); 64405 delete globalState.swalCloseEventFinishedCallback; 64406 } 64407 }); 64408 }; 64409 64410 var triggerOnAfterCloseAndDispose = function triggerOnAfterCloseAndDispose(instance, onAfterClose) { 64411 setTimeout(function () { 64412 if (typeof onAfterClose === 'function') { 64413 onAfterClose(); 64414 } 64415 64416 instance._destroy(); 64417 }); 64418 }; 64419 64420 function setButtonsDisabled(instance, buttons, disabled) { 64421 var domCache = privateProps.domCache.get(instance); 64422 buttons.forEach(function (button) { 64423 domCache[button].disabled = disabled; 64424 }); 64425 } 64426 64427 function setInputDisabled(input, disabled) { 64428 if (!input) { 64429 return false; 64430 } 64431 64432 if (input.type === 'radio') { 64433 var radiosContainer = input.parentNode.parentNode; 64434 var radios = radiosContainer.querySelectorAll('input'); 64435 64436 for (var i = 0; i < radios.length; i++) { 64437 radios[i].disabled = disabled; 64438 } 64439 } else { 64440 input.disabled = disabled; 64441 } 64442 } 64443 64444 function enableButtons() { 64445 setButtonsDisabled(this, ['confirmButton', 'cancelButton'], false); 64446 } 64447 function disableButtons() { 64448 setButtonsDisabled(this, ['confirmButton', 'cancelButton'], true); 64449 } 64450 function enableInput() { 64451 return setInputDisabled(this.getInput(), false); 64452 } 64453 function disableInput() { 64454 return setInputDisabled(this.getInput(), true); 64455 } 64456 64457 function showValidationMessage(error) { 64458 var domCache = privateProps.domCache.get(this); 64459 setInnerHtml(domCache.validationMessage, error); 64460 var popupComputedStyle = window.getComputedStyle(domCache.popup); 64461 domCache.validationMessage.style.marginLeft = "-".concat(popupComputedStyle.getPropertyValue('padding-left')); 64462 domCache.validationMessage.style.marginRight = "-".concat(popupComputedStyle.getPropertyValue('padding-right')); 64463 show(domCache.validationMessage); 64464 var input = this.getInput(); 64465 64466 if (input) { 64467 input.setAttribute('aria-invalid', true); 64468 input.setAttribute('aria-describedBy', swalClasses['validation-message']); 64469 focusInput(input); 64470 addClass(input, swalClasses.inputerror); 64471 } 64472 } // Hide block with validation message 64473 64474 function resetValidationMessage$1() { 64475 var domCache = privateProps.domCache.get(this); 64476 64477 if (domCache.validationMessage) { 64478 hide(domCache.validationMessage); 64479 } 64480 64481 var input = this.getInput(); 64482 64483 if (input) { 64484 input.removeAttribute('aria-invalid'); 64485 input.removeAttribute('aria-describedBy'); 64486 removeClass(input, swalClasses.inputerror); 64487 } 64488 } 64489 64490 function getProgressSteps$1() { 64491 var domCache = privateProps.domCache.get(this); 64492 return domCache.progressSteps; 64493 } 64494 64495 var Timer = /*#__PURE__*/function () { 64496 function Timer(callback, delay) { 64497 _classCallCheck(this, Timer); 64498 64499 this.callback = callback; 64500 this.remaining = delay; 64501 this.running = false; 64502 this.start(); 64503 } 64504 64505 _createClass(Timer, [{ 64506 key: "start", 64507 value: function start() { 64508 if (!this.running) { 64509 this.running = true; 64510 this.started = new Date(); 64511 this.id = setTimeout(this.callback, this.remaining); 64512 } 64513 64514 return this.remaining; 64515 } 64516 }, { 64517 key: "stop", 64518 value: function stop() { 64519 if (this.running) { 64520 this.running = false; 64521 clearTimeout(this.id); 64522 this.remaining -= new Date() - this.started; 64523 } 64524 64525 return this.remaining; 64526 } 64527 }, { 64528 key: "increase", 64529 value: function increase(n) { 64530 var running = this.running; 64531 64532 if (running) { 64533 this.stop(); 64534 } 64535 64536 this.remaining += n; 64537 64538 if (running) { 64539 this.start(); 64540 } 64541 64542 return this.remaining; 64543 } 64544 }, { 64545 key: "getTimerLeft", 64546 value: function getTimerLeft() { 64547 if (this.running) { 64548 this.stop(); 64549 this.start(); 64550 } 64551 64552 return this.remaining; 64553 } 64554 }, { 64555 key: "isRunning", 64556 value: function isRunning() { 64557 return this.running; 64558 } 64559 }]); 64560 64561 return Timer; 64562 }(); 64563 64564 var defaultInputValidators = { 64565 email: function email(string, validationMessage) { 64566 return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address'); 64567 }, 64568 url: function url(string, validationMessage) { 64569 // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 and #2013 64570 return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL'); 64571 } 64572 }; 64573 64574 function setDefaultInputValidators(params) { 64575 // Use default `inputValidator` for supported input types if not provided 64576 if (!params.inputValidator) { 64577 Object.keys(defaultInputValidators).forEach(function (key) { 64578 if (params.input === key) { 64579 params.inputValidator = defaultInputValidators[key]; 64580 } 64581 }); 64582 } 64583 } 64584 64585 function validateCustomTargetElement(params) { 64586 // Determine if the custom target element is valid 64587 if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) { 64588 warn('Target parameter is not valid, defaulting to "body"'); 64589 params.target = 'body'; 64590 } 64591 } 64592 /** 64593 * Set type, text and actions on popup 64594 * 64595 * @param params 64596 * @returns {boolean} 64597 */ 64598 64599 64600 function setParameters(params) { 64601 setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm 64602 64603 if (params.showLoaderOnConfirm && !params.preConfirm) { 64604 warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request'); 64605 } // params.animation will be actually used in renderPopup.js 64606 // but in case when params.animation is a function, we need to call that function 64607 // before popup (re)initialization, so it'll be possible to check Swal.isVisible() 64608 // inside the params.animation function 64609 64610 64611 params.animation = callIfFunction(params.animation); 64612 validateCustomTargetElement(params); // Replace newlines with <br> in title 64613 64614 if (typeof params.title === 'string') { 64615 params.title = params.title.split('\n').join('<br />'); 64616 } 64617 64618 init(params); 64619 } 64620 64621 /** 64622 * Open popup, add necessary classes and styles, fix scrollbar 64623 * 64624 * @param {Array} params 64625 */ 64626 64627 var openPopup = function openPopup(params) { 64628 var container = getContainer(); 64629 var popup = getPopup(); 64630 64631 if (typeof params.onBeforeOpen === 'function') { 64632 params.onBeforeOpen(popup); 64633 } 64634 64635 var bodyStyles = window.getComputedStyle(document.body); 64636 var initialBodyOverflow = bodyStyles.overflowY; 64637 addClasses$1(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto' 64638 64639 setScrollingVisibility(container, popup); 64640 64641 if (isModal()) { 64642 fixScrollContainer(container, params.scrollbarPadding, initialBodyOverflow); 64643 setAriaHidden(); 64644 } 64645 64646 if (!isToast() && !globalState.previousActiveElement) { 64647 globalState.previousActiveElement = document.activeElement; 64648 } 64649 64650 if (typeof params.onOpen === 'function') { 64651 setTimeout(function () { 64652 return params.onOpen(popup); 64653 }); 64654 } 64655 64656 removeClass(container, swalClasses['no-transition']); 64657 }; 64658 64659 function swalOpenAnimationFinished(event) { 64660 var popup = getPopup(); 64661 64662 if (event.target !== popup) { 64663 return; 64664 } 64665 64666 var container = getContainer(); 64667 popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished); 64668 container.style.overflowY = 'auto'; 64669 } 64670 64671 var setScrollingVisibility = function setScrollingVisibility(container, popup) { 64672 if (animationEndEvent && hasCssAnimation(popup)) { 64673 container.style.overflowY = 'hidden'; 64674 popup.addEventListener(animationEndEvent, swalOpenAnimationFinished); 64675 } else { 64676 container.style.overflowY = 'auto'; 64677 } 64678 }; 64679 64680 var fixScrollContainer = function fixScrollContainer(container, scrollbarPadding, initialBodyOverflow) { 64681 iOSfix(); 64682 IEfix(); 64683 64684 if (scrollbarPadding && initialBodyOverflow !== 'hidden') { 64685 fixScrollbar(); 64686 } // sweetalert2/issues/1247 64687 64688 64689 setTimeout(function () { 64690 container.scrollTop = 0; 64691 }); 64692 }; 64693 64694 var addClasses$1 = function addClasses(container, popup, params) { 64695 addClass(container, params.showClass.backdrop); 64696 show(popup); // Animate popup right after showing it 64697 64698 addClass(popup, params.showClass.popup); 64699 addClass([document.documentElement, document.body], swalClasses.shown); 64700 64701 if (params.heightAuto && params.backdrop && !params.toast) { 64702 addClass([document.documentElement, document.body], swalClasses['height-auto']); 64703 } 64704 }; 64705 64706 var handleInputOptionsAndValue = function handleInputOptionsAndValue(instance, params) { 64707 if (params.input === 'select' || params.input === 'radio') { 64708 handleInputOptions(instance, params); 64709 } else if (['text', 'email', 'number', 'tel', 'textarea'].indexOf(params.input) !== -1 && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) { 64710 handleInputValue(instance, params); 64711 } 64712 }; 64713 var getInputValue = function getInputValue(instance, innerParams) { 64714 var input = instance.getInput(); 64715 64716 if (!input) { 64717 return null; 64718 } 64719 64720 switch (innerParams.input) { 64721 case 'checkbox': 64722 return getCheckboxValue(input); 64723 64724 case 'radio': 64725 return getRadioValue(input); 64726 64727 case 'file': 64728 return getFileValue(input); 64729 64730 default: 64731 return innerParams.inputAutoTrim ? input.value.trim() : input.value; 64732 } 64733 }; 64734 64735 var getCheckboxValue = function getCheckboxValue(input) { 64736 return input.checked ? 1 : 0; 64737 }; 64738 64739 var getRadioValue = function getRadioValue(input) { 64740 return input.checked ? input.value : null; 64741 }; 64742 64743 var getFileValue = function getFileValue(input) { 64744 return input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null; 64745 }; 64746 64747 var handleInputOptions = function handleInputOptions(instance, params) { 64748 var content = getContent(); 64749 64750 var processInputOptions = function processInputOptions(inputOptions) { 64751 return populateInputOptions[params.input](content, formatInputOptions(inputOptions), params); 64752 }; 64753 64754 if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) { 64755 showLoading(); 64756 asPromise(params.inputOptions).then(function (inputOptions) { 64757 instance.hideLoading(); 64758 processInputOptions(inputOptions); 64759 }); 64760 } else if (_typeof(params.inputOptions) === 'object') { 64761 processInputOptions(params.inputOptions); 64762 } else { 64763 error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(_typeof(params.inputOptions))); 64764 } 64765 }; 64766 64767 var handleInputValue = function handleInputValue(instance, params) { 64768 var input = instance.getInput(); 64769 hide(input); 64770 asPromise(params.inputValue).then(function (inputValue) { 64771 input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : "".concat(inputValue); 64772 show(input); 64773 input.focus(); 64774 instance.hideLoading(); 64775 })["catch"](function (err) { 64776 error("Error in inputValue promise: ".concat(err)); 64777 input.value = ''; 64778 show(input); 64779 input.focus(); 64780 instance.hideLoading(); 64781 }); 64782 }; 64783 64784 var populateInputOptions = { 64785 select: function select(content, inputOptions, params) { 64786 var select = getChildByClass(content, swalClasses.select); 64787 64788 var renderOption = function renderOption(parent, optionLabel, optionValue) { 64789 var option = document.createElement('option'); 64790 option.value = optionValue; 64791 setInnerHtml(option, optionLabel); 64792 64793 if (params.inputValue.toString() === optionValue.toString()) { 64794 option.selected = true; 64795 } 64796 64797 parent.appendChild(option); 64798 }; 64799 64800 inputOptions.forEach(function (inputOption) { 64801 var optionValue = inputOption[0]; 64802 var optionLabel = inputOption[1]; // <optgroup> spec: 64803 // https://www.w3.org/TR/html401/interact/forms.html#h-17.6 64804 // "...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)..." 64805 // check whether this is a <optgroup> 64806 64807 if (Array.isArray(optionLabel)) { 64808 // if it is an array, then it is an <optgroup> 64809 var optgroup = document.createElement('optgroup'); 64810 optgroup.label = optionValue; 64811 optgroup.disabled = false; // not configurable for now 64812 64813 select.appendChild(optgroup); 64814 optionLabel.forEach(function (o) { 64815 return renderOption(optgroup, o[1], o[0]); 64816 }); 64817 } else { 64818 // case of <option> 64819 renderOption(select, optionLabel, optionValue); 64820 } 64821 }); 64822 select.focus(); 64823 }, 64824 radio: function radio(content, inputOptions, params) { 64825 var radio = getChildByClass(content, swalClasses.radio); 64826 inputOptions.forEach(function (inputOption) { 64827 var radioValue = inputOption[0]; 64828 var radioLabel = inputOption[1]; 64829 var radioInput = document.createElement('input'); 64830 var radioLabelElement = document.createElement('label'); 64831 radioInput.type = 'radio'; 64832 radioInput.name = swalClasses.radio; 64833 radioInput.value = radioValue; 64834 64835 if (params.inputValue.toString() === radioValue.toString()) { 64836 radioInput.checked = true; 64837 } 64838 64839 var label = document.createElement('span'); 64840 setInnerHtml(label, radioLabel); 64841 label.className = swalClasses.label; 64842 radioLabelElement.appendChild(radioInput); 64843 radioLabelElement.appendChild(label); 64844 radio.appendChild(radioLabelElement); 64845 }); 64846 var radios = radio.querySelectorAll('input'); 64847 64848 if (radios.length) { 64849 radios[0].focus(); 64850 } 64851 } 64852 }; 64853 /** 64854 * Converts `inputOptions` into an array of `[value, label]`s 64855 * @param inputOptions 64856 */ 64857 64858 var formatInputOptions = function formatInputOptions(inputOptions) { 64859 var result = []; 64860 64861 if (typeof Map !== 'undefined' && inputOptions instanceof Map) { 64862 inputOptions.forEach(function (value, key) { 64863 var valueFormatted = value; 64864 64865 if (_typeof(valueFormatted) === 'object') { 64866 // case of <optgroup> 64867 valueFormatted = formatInputOptions(valueFormatted); 64868 } 64869 64870 result.push([key, valueFormatted]); 64871 }); 64872 } else { 64873 Object.keys(inputOptions).forEach(function (key) { 64874 var valueFormatted = inputOptions[key]; 64875 64876 if (_typeof(valueFormatted) === 'object') { 64877 // case of <optgroup> 64878 valueFormatted = formatInputOptions(valueFormatted); 64879 } 64880 64881 result.push([key, valueFormatted]); 64882 }); 64883 } 64884 64885 return result; 64886 }; 64887 64888 var handleConfirmButtonClick = function handleConfirmButtonClick(instance, innerParams) { 64889 instance.disableButtons(); 64890 64891 if (innerParams.input) { 64892 handleConfirmWithInput(instance, innerParams); 64893 } else { 64894 confirm(instance, innerParams, true); 64895 } 64896 }; 64897 var handleCancelButtonClick = function handleCancelButtonClick(instance, dismissWith) { 64898 instance.disableButtons(); 64899 dismissWith(DismissReason.cancel); 64900 }; 64901 64902 var handleConfirmWithInput = function handleConfirmWithInput(instance, innerParams) { 64903 var inputValue = getInputValue(instance, innerParams); 64904 64905 if (innerParams.inputValidator) { 64906 instance.disableInput(); 64907 var validationPromise = Promise.resolve().then(function () { 64908 return asPromise(innerParams.inputValidator(inputValue, innerParams.validationMessage)); 64909 }); 64910 validationPromise.then(function (validationMessage) { 64911 instance.enableButtons(); 64912 instance.enableInput(); 64913 64914 if (validationMessage) { 64915 instance.showValidationMessage(validationMessage); 64916 } else { 64917 confirm(instance, innerParams, inputValue); 64918 } 64919 }); 64920 } else if (!instance.getInput().checkValidity()) { 64921 instance.enableButtons(); 64922 instance.showValidationMessage(innerParams.validationMessage); 64923 } else { 64924 confirm(instance, innerParams, inputValue); 64925 } 64926 }; 64927 64928 var succeedWith = function succeedWith(instance, value) { 64929 instance.closePopup({ 64930 value: value 64931 }); 64932 }; 64933 64934 var confirm = function confirm(instance, innerParams, value) { 64935 if (innerParams.showLoaderOnConfirm) { 64936 showLoading(); // TODO: make showLoading an *instance* method 64937 } 64938 64939 if (innerParams.preConfirm) { 64940 instance.resetValidationMessage(); 64941 var preConfirmPromise = Promise.resolve().then(function () { 64942 return asPromise(innerParams.preConfirm(value, innerParams.validationMessage)); 64943 }); 64944 preConfirmPromise.then(function (preConfirmValue) { 64945 if (isVisible(getValidationMessage()) || preConfirmValue === false) { 64946 instance.hideLoading(); 64947 } else { 64948 succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue); 64949 } 64950 }); 64951 } else { 64952 succeedWith(instance, value); 64953 } 64954 }; 64955 64956 var addKeydownHandler = function addKeydownHandler(instance, globalState, innerParams, dismissWith) { 64957 if (globalState.keydownTarget && globalState.keydownHandlerAdded) { 64958 globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { 64959 capture: globalState.keydownListenerCapture 64960 }); 64961 globalState.keydownHandlerAdded = false; 64962 } 64963 64964 if (!innerParams.toast) { 64965 globalState.keydownHandler = function (e) { 64966 return keydownHandler(instance, e, dismissWith); 64967 }; 64968 64969 globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup(); 64970 globalState.keydownListenerCapture = innerParams.keydownListenerCapture; 64971 globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { 64972 capture: globalState.keydownListenerCapture 64973 }); 64974 globalState.keydownHandlerAdded = true; 64975 } 64976 }; // Focus handling 64977 64978 var setFocus = function setFocus(innerParams, index, increment) { 64979 var focusableElements = getFocusableElements(); // search for visible elements and select the next possible match 64980 64981 for (var i = 0; i < focusableElements.length; i++) { 64982 index = index + increment; // rollover to first item 64983 64984 if (index === focusableElements.length) { 64985 index = 0; // go to last item 64986 } else if (index === -1) { 64987 index = focusableElements.length - 1; 64988 } 64989 64990 return focusableElements[index].focus(); 64991 } // no visible focusable elements, focus the popup 64992 64993 64994 getPopup().focus(); 64995 }; 64996 var arrowKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Left', 'Right', 'Up', 'Down' // IE11 64997 ]; 64998 var escKeys = ['Escape', 'Esc' // IE11 64999 ]; 65000 65001 var keydownHandler = function keydownHandler(instance, e, dismissWith) { 65002 var innerParams = privateProps.innerParams.get(instance); 65003 65004 if (innerParams.stopKeydownPropagation) { 65005 e.stopPropagation(); 65006 } // ENTER 65007 65008 65009 if (e.key === 'Enter') { 65010 handleEnter(instance, e, innerParams); // TAB 65011 } else if (e.key === 'Tab') { 65012 handleTab(e, innerParams); // ARROWS - switch focus between buttons 65013 } else if (arrowKeys.indexOf(e.key) !== -1) { 65014 handleArrows(); // ESC 65015 } else if (escKeys.indexOf(e.key) !== -1) { 65016 handleEsc(e, innerParams, dismissWith); 65017 } 65018 }; 65019 65020 var handleEnter = function handleEnter(instance, e, innerParams) { 65021 // #720 #721 65022 if (e.isComposing) { 65023 return; 65024 } 65025 65026 if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) { 65027 if (['textarea', 'file'].indexOf(innerParams.input) !== -1) { 65028 return; // do not submit 65029 } 65030 65031 clickConfirm(); 65032 e.preventDefault(); 65033 } 65034 }; 65035 65036 var handleTab = function handleTab(e, innerParams) { 65037 var targetElement = e.target; 65038 var focusableElements = getFocusableElements(); 65039 var btnIndex = -1; 65040 65041 for (var i = 0; i < focusableElements.length; i++) { 65042 if (targetElement === focusableElements[i]) { 65043 btnIndex = i; 65044 break; 65045 } 65046 } 65047 65048 if (!e.shiftKey) { 65049 // Cycle to the next button 65050 setFocus(innerParams, btnIndex, 1); 65051 } else { 65052 // Cycle to the prev button 65053 setFocus(innerParams, btnIndex, -1); 65054 } 65055 65056 e.stopPropagation(); 65057 e.preventDefault(); 65058 }; 65059 65060 var handleArrows = function handleArrows() { 65061 var confirmButton = getConfirmButton(); 65062 var cancelButton = getCancelButton(); // focus Cancel button if Confirm button is currently focused 65063 65064 if (document.activeElement === confirmButton && isVisible(cancelButton)) { 65065 cancelButton.focus(); // and vice versa 65066 } else if (document.activeElement === cancelButton && isVisible(confirmButton)) { 65067 confirmButton.focus(); 65068 } 65069 }; 65070 65071 var handleEsc = function handleEsc(e, innerParams, dismissWith) { 65072 if (callIfFunction(innerParams.allowEscapeKey)) { 65073 e.preventDefault(); 65074 dismissWith(DismissReason.esc); 65075 } 65076 }; 65077 65078 var handlePopupClick = function handlePopupClick(instance, domCache, dismissWith) { 65079 var innerParams = privateProps.innerParams.get(instance); 65080 65081 if (innerParams.toast) { 65082 handleToastClick(instance, domCache, dismissWith); 65083 } else { 65084 // Ignore click events that had mousedown on the popup but mouseup on the container 65085 // This can happen when the user drags a slider 65086 handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup 65087 65088 handleContainerMousedown(domCache); 65089 handleModalClick(instance, domCache, dismissWith); 65090 } 65091 }; 65092 65093 var handleToastClick = function handleToastClick(instance, domCache, dismissWith) { 65094 // Closing toast by internal click 65095 domCache.popup.onclick = function () { 65096 var innerParams = privateProps.innerParams.get(instance); 65097 65098 if (innerParams.showConfirmButton || innerParams.showCancelButton || innerParams.showCloseButton || innerParams.input) { 65099 return; 65100 } 65101 65102 dismissWith(DismissReason.close); 65103 }; 65104 }; 65105 65106 var ignoreOutsideClick = false; 65107 65108 var handleModalMousedown = function handleModalMousedown(domCache) { 65109 domCache.popup.onmousedown = function () { 65110 domCache.container.onmouseup = function (e) { 65111 domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't 65112 // have any other direct children aside of the popup 65113 65114 if (e.target === domCache.container) { 65115 ignoreOutsideClick = true; 65116 } 65117 }; 65118 }; 65119 }; 65120 65121 var handleContainerMousedown = function handleContainerMousedown(domCache) { 65122 domCache.container.onmousedown = function () { 65123 domCache.popup.onmouseup = function (e) { 65124 domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup 65125 65126 if (e.target === domCache.popup || domCache.popup.contains(e.target)) { 65127 ignoreOutsideClick = true; 65128 } 65129 }; 65130 }; 65131 }; 65132 65133 var handleModalClick = function handleModalClick(instance, domCache, dismissWith) { 65134 domCache.container.onclick = function (e) { 65135 var innerParams = privateProps.innerParams.get(instance); 65136 65137 if (ignoreOutsideClick) { 65138 ignoreOutsideClick = false; 65139 return; 65140 } 65141 65142 if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) { 65143 dismissWith(DismissReason.backdrop); 65144 } 65145 }; 65146 }; 65147 65148 function _main(userParams) { 65149 showWarningsForParams(userParams); 65150 65151 if (globalState.currentInstance) { 65152 globalState.currentInstance._destroy(); 65153 } 65154 65155 globalState.currentInstance = this; 65156 var innerParams = prepareParams(userParams); 65157 setParameters(innerParams); 65158 Object.freeze(innerParams); // clear the previous timer 65159 65160 if (globalState.timeout) { 65161 globalState.timeout.stop(); 65162 delete globalState.timeout; 65163 } // clear the restore focus timeout 65164 65165 65166 clearTimeout(globalState.restoreFocusTimeout); 65167 var domCache = populateDomCache(this); 65168 render(this, innerParams); 65169 privateProps.innerParams.set(this, innerParams); 65170 return swalPromise(this, domCache, innerParams); 65171 } 65172 65173 var prepareParams = function prepareParams(userParams) { 65174 var showClass = _extends({}, defaultParams.showClass, userParams.showClass); 65175 65176 var hideClass = _extends({}, defaultParams.hideClass, userParams.hideClass); 65177 65178 var params = _extends({}, defaultParams, userParams); 65179 65180 params.showClass = showClass; 65181 params.hideClass = hideClass; // @deprecated 65182 65183 if (userParams.animation === false) { 65184 params.showClass = { 65185 popup: 'swal2-noanimation', 65186 backdrop: 'swal2-noanimation' 65187 }; 65188 params.hideClass = {}; 65189 } 65190 65191 return params; 65192 }; 65193 65194 var swalPromise = function swalPromise(instance, domCache, innerParams) { 65195 return new Promise(function (resolve) { 65196 // functions to handle all closings/dismissals 65197 var dismissWith = function dismissWith(dismiss) { 65198 instance.closePopup({ 65199 dismiss: dismiss 65200 }); 65201 }; 65202 65203 privateMethods.swalPromiseResolve.set(instance, resolve); 65204 65205 domCache.confirmButton.onclick = function () { 65206 return handleConfirmButtonClick(instance, innerParams); 65207 }; 65208 65209 domCache.cancelButton.onclick = function () { 65210 return handleCancelButtonClick(instance, dismissWith); 65211 }; 65212 65213 domCache.closeButton.onclick = function () { 65214 return dismissWith(DismissReason.close); 65215 }; 65216 65217 handlePopupClick(instance, domCache, dismissWith); 65218 addKeydownHandler(instance, globalState, innerParams, dismissWith); 65219 65220 if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) { 65221 addClass(document.body, swalClasses['toast-column']); 65222 } else { 65223 removeClass(document.body, swalClasses['toast-column']); 65224 } 65225 65226 handleInputOptionsAndValue(instance, innerParams); 65227 openPopup(innerParams); 65228 setupTimer(globalState, innerParams, dismissWith); 65229 initFocus(domCache, innerParams); // Scroll container to top on open (#1247, #1946) 65230 65231 setTimeout(function () { 65232 domCache.container.scrollTop = 0; 65233 }); 65234 }); 65235 }; 65236 65237 var populateDomCache = function populateDomCache(instance) { 65238 var domCache = { 65239 popup: getPopup(), 65240 container: getContainer(), 65241 content: getContent(), 65242 actions: getActions(), 65243 confirmButton: getConfirmButton(), 65244 cancelButton: getCancelButton(), 65245 closeButton: getCloseButton(), 65246 validationMessage: getValidationMessage(), 65247 progressSteps: getProgressSteps() 65248 }; 65249 privateProps.domCache.set(instance, domCache); 65250 return domCache; 65251 }; 65252 65253 var setupTimer = function setupTimer(globalState$$1, innerParams, dismissWith) { 65254 var timerProgressBar = getTimerProgressBar(); 65255 hide(timerProgressBar); 65256 65257 if (innerParams.timer) { 65258 globalState$$1.timeout = new Timer(function () { 65259 dismissWith('timer'); 65260 delete globalState$$1.timeout; 65261 }, innerParams.timer); 65262 65263 if (innerParams.timerProgressBar) { 65264 show(timerProgressBar); 65265 setTimeout(function () { 65266 if (globalState$$1.timeout.running) { 65267 // timer can be already stopped at this point 65268 animateTimerProgressBar(innerParams.timer); 65269 } 65270 }); 65271 } 65272 } 65273 }; 65274 65275 var initFocus = function initFocus(domCache, innerParams) { 65276 if (innerParams.toast) { 65277 return; 65278 } 65279 65280 if (!callIfFunction(innerParams.allowEnterKey)) { 65281 return blurActiveElement(); 65282 } 65283 65284 if (innerParams.focusCancel && isVisible(domCache.cancelButton)) { 65285 return domCache.cancelButton.focus(); 65286 } 65287 65288 if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) { 65289 return domCache.confirmButton.focus(); 65290 } 65291 65292 setFocus(innerParams, -1, 1); 65293 }; 65294 65295 var blurActiveElement = function blurActiveElement() { 65296 if (document.activeElement && typeof document.activeElement.blur === 'function') { 65297 document.activeElement.blur(); 65298 } 65299 }; 65300 65301 /** 65302 * Updates popup parameters. 65303 */ 65304 65305 function update(params) { 65306 var popup = getPopup(); 65307 var innerParams = privateProps.innerParams.get(this); 65308 65309 if (!popup || hasClass(popup, innerParams.hideClass.popup)) { 65310 return warn("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup."); 65311 } 65312 65313 var validUpdatableParams = {}; // assign valid params from `params` to `defaults` 65314 65315 Object.keys(params).forEach(function (param) { 65316 if (Swal.isUpdatableParameter(param)) { 65317 validUpdatableParams[param] = params[param]; 65318 } else { 65319 warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js")); 65320 } 65321 }); 65322 65323 var updatedParams = _extends({}, innerParams, validUpdatableParams); 65324 65325 render(this, updatedParams); 65326 privateProps.innerParams.set(this, updatedParams); 65327 Object.defineProperties(this, { 65328 params: { 65329 value: _extends({}, this.params, params), 65330 writable: false, 65331 enumerable: true 65332 } 65333 }); 65334 } 65335 65336 function _destroy() { 65337 var domCache = privateProps.domCache.get(this); 65338 var innerParams = privateProps.innerParams.get(this); 65339 65340 if (!innerParams) { 65341 return; // This instance has already been destroyed 65342 } // Check if there is another Swal closing 65343 65344 65345 if (domCache.popup && globalState.swalCloseEventFinishedCallback) { 65346 globalState.swalCloseEventFinishedCallback(); 65347 delete globalState.swalCloseEventFinishedCallback; 65348 } // Check if there is a swal disposal defer timer 65349 65350 65351 if (globalState.deferDisposalTimer) { 65352 clearTimeout(globalState.deferDisposalTimer); 65353 delete globalState.deferDisposalTimer; 65354 } 65355 65356 if (typeof innerParams.onDestroy === 'function') { 65357 innerParams.onDestroy(); 65358 } 65359 65360 disposeSwal(this); 65361 } 65362 65363 var disposeSwal = function disposeSwal(instance) { 65364 // Unset this.params so GC will dispose it (#1569) 65365 delete instance.params; // Unset globalState props so GC will dispose globalState (#1569) 65366 65367 delete globalState.keydownHandler; 65368 delete globalState.keydownTarget; // Unset WeakMaps so GC will be able to dispose them (#1569) 65369 65370 unsetWeakMaps(privateProps); 65371 unsetWeakMaps(privateMethods); 65372 }; 65373 65374 var unsetWeakMaps = function unsetWeakMaps(obj) { 65375 for (var i in obj) { 65376 obj[i] = new WeakMap(); 65377 } 65378 }; 65379 65380 65381 65382 var instanceMethods = /*#__PURE__*/Object.freeze({ 65383 hideLoading: hideLoading, 65384 disableLoading: hideLoading, 65385 getInput: getInput$1, 65386 close: close, 65387 closePopup: close, 65388 closeModal: close, 65389 closeToast: close, 65390 enableButtons: enableButtons, 65391 disableButtons: disableButtons, 65392 enableInput: enableInput, 65393 disableInput: disableInput, 65394 showValidationMessage: showValidationMessage, 65395 resetValidationMessage: resetValidationMessage$1, 65396 getProgressSteps: getProgressSteps$1, 65397 _main: _main, 65398 update: update, 65399 _destroy: _destroy 65400 }); 65401 65402 var currentInstance; 65403 65404 var SweetAlert = /*#__PURE__*/function () { 65405 function SweetAlert() { 65406 _classCallCheck(this, SweetAlert); 65407 65408 // Prevent run in Node env 65409 if (typeof window === 'undefined') { 65410 return; 65411 } // Check for the existence of Promise 65412 65413 65414 if (typeof Promise === 'undefined') { 65415 error('This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)'); 65416 } 65417 65418 currentInstance = this; 65419 65420 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 65421 args[_key] = arguments[_key]; 65422 } 65423 65424 var outerParams = Object.freeze(this.constructor.argsToParams(args)); 65425 Object.defineProperties(this, { 65426 params: { 65427 value: outerParams, 65428 writable: false, 65429 enumerable: true, 65430 configurable: true 65431 } 65432 }); 65433 65434 var promise = this._main(this.params); 65435 65436 privateProps.promise.set(this, promise); 65437 } // `catch` cannot be the name of a module export, so we define our thenable methods here instead 65438 65439 65440 _createClass(SweetAlert, [{ 65441 key: "then", 65442 value: function then(onFulfilled) { 65443 var promise = privateProps.promise.get(this); 65444 return promise.then(onFulfilled); 65445 } 65446 }, { 65447 key: "finally", 65448 value: function _finally(onFinally) { 65449 var promise = privateProps.promise.get(this); 65450 return promise["finally"](onFinally); 65451 } 65452 }]); 65453 65454 return SweetAlert; 65455 }(); // Assign instance methods from src/instanceMethods/*.js to prototype 65456 65457 65458 _extends(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor 65459 65460 65461 _extends(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility 65462 65463 65464 Object.keys(instanceMethods).forEach(function (key) { 65465 SweetAlert[key] = function () { 65466 if (currentInstance) { 65467 var _currentInstance; 65468 65469 return (_currentInstance = currentInstance)[key].apply(_currentInstance, arguments); 65470 } 65471 }; 65472 }); 65473 SweetAlert.DismissReason = DismissReason; 65474 SweetAlert.version = '9.17.1'; 65475 65476 var Swal = SweetAlert; 65477 Swal["default"] = Swal; 65478 65479 return Swal; 65480 65481})); 65482if (typeof this !== 'undefined' && this.Sweetalert2){ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2} 65483 65484"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,".swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;overflow-y:hidden;background:#fff;box-shadow:0 0 .625em #d9d9d9}.swal2-popup.swal2-toast .swal2-header{flex-direction:row;padding:0}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:static;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;padding:0;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{font-size:.25em}}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{flex-basis:auto!important;width:auto;height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:flex;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-bottom-end>:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-no-transition{transition:none!important}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center;padding:0 1.8em}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-actions.swal2-loading .swal2-styled.swal2-confirm{box-sizing:border-box;width:2.5em;height:2.5em;margin:.46875em;padding:0;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent!important;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{content:\"\";display:inline-block;width:15px;height:15px;margin-left:5px;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;height:.25em;overflow:hidden;border-bottom-right-radius:.3125em;border-bottom-left-radius:.3125em}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;align-items:center;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close::-moz-focus-inner{border:0}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0 1.6em;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{align-items:center;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent!important}body.swal2-no-backdrop .swal2-container>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-container.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-top-left,body.swal2-no-backdrop .swal2-container.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-top-end,body.swal2-no-backdrop .swal2-container.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-container.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-left,body.swal2-no-backdrop .swal2-container.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-end,body.swal2-no-backdrop .swal2-container.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom-left,body.swal2-no-backdrop .swal2-container.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-bottom-end,body.swal2-no-backdrop .swal2-container.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}"); 65485 65486/***/ })
65486 65487 65488}]); 65489//# sourceMappingURL=vendor.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.