@angular/common 19.1.0-rc.0 → 19.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.1.0-rc.0
2
+ * @license Angular v19.1.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -315,10 +315,10 @@ class HttpClientTestingBackend {
315
315
  return `Match by function: ${matcher.name}`;
316
316
  }
317
317
  }
318
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
319
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientTestingBackend });
318
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
319
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientTestingBackend });
320
320
  }
321
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
322
322
  type: Injectable
323
323
  }] });
324
324
  function describeRequest(testRequest) {
@@ -346,11 +346,11 @@ function provideHttpClientTesting() {
346
346
  * @deprecated Add `provideHttpClientTesting()` to your providers instead.
347
347
  */
348
348
  class HttpClientTestingModule {
349
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
350
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] });
351
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientTestingModule, providers: [provideHttpClientTesting()], imports: [HttpClientModule] });
349
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
350
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] });
351
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientTestingModule, providers: [provideHttpClientTesting()], imports: [HttpClientModule] });
352
352
  }
353
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientTestingModule, decorators: [{
353
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientTestingModule, decorators: [{
354
354
  type: NgModule,
355
355
  args: [{
356
356
  imports: [HttpClientModule],
package/fesm2022/http.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Angular v19.1.0-rc.0
2
+ * @license Angular v19.1.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import * as i0 from '@angular/core';
8
- import { Injectable, inject, NgZone, runInInjectionContext, InjectionToken, ɵPendingTasksInternal, PLATFORM_ID, ɵConsole, ɵformatRuntimeError, Inject, ɵRuntimeError, makeEnvironmentProviders, NgModule, TransferState, makeStateKey, ɵperformanceMarkFeature, APP_BOOTSTRAP_LISTENER, ApplicationRef, ɵtruncateMiddle } from '@angular/core';
8
+ import { ɵRuntimeError, Injectable, InjectionToken, inject, NgZone, runInInjectionContext, ɵPendingTasksInternal, PLATFORM_ID, ɵConsole, ɵformatRuntimeError, Inject, makeEnvironmentProviders, NgModule, TransferState, makeStateKey, ɵperformanceMarkFeature, APP_BOOTSTRAP_LISTENER, ApplicationRef, ɵtruncateMiddle } from '@angular/core';
9
9
  import { of, Observable, from } from 'rxjs';
10
10
  import { concatMap, filter, map, finalize, switchMap, tap } from 'rxjs/operators';
11
11
  import * as i1 from '@angular/common';
@@ -388,9 +388,9 @@ class HttpParams {
388
388
  cloneFrom = null;
389
389
  constructor(options = {}) {
390
390
  this.encoder = options.encoder || new HttpUrlEncodingCodec();
391
- if (!!options.fromString) {
392
- if (!!options.fromObject) {
393
- throw new Error(`Cannot specify both fromString and fromObject.`);
391
+ if (options.fromString) {
392
+ if (options.fromObject) {
393
+ throw new ɵRuntimeError(2805 /* RuntimeErrorCode.CANNOT_SPECIFY_BOTH_FROM_STRING_AND_FROM_OBJECT */, ngDevMode && 'Cannot specify both fromString and fromObject.');
394
394
  }
395
395
  this.map = paramParser(options.fromString, this.encoder);
396
396
  }
@@ -708,6 +708,30 @@ function isFormData(value) {
708
708
  function isUrlSearchParams(value) {
709
709
  return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams;
710
710
  }
711
+ /**
712
+ * `X-Request-URL` is a custom HTTP header used in older browser versions,
713
+ * including Firefox (< 32), Chrome (< 37), Safari (< 8), and Internet Explorer,
714
+ * to include the full URL of the request in cross-origin requests.
715
+ */
716
+ const X_REQUEST_URL_HEADER = 'X-Request-URL';
717
+ /**
718
+ * `text/plain` is a content type used to indicate that the content being
719
+ * sent is plain text with no special formatting or structured data
720
+ * like HTML, XML, or JSON.
721
+ */
722
+ const TEXT_CONTENT_TYPE = 'text/plain';
723
+ /**
724
+ * `application/json` is a content type used to indicate that the content
725
+ * being sent is in the JSON format.
726
+ */
727
+ const JSON_CONTENT_TYPE = 'application/json';
728
+ /**
729
+ * `application/json, text/plain, *\/*` is a content negotiation string often seen in the
730
+ * Accept header of HTTP requests. It indicates the types of content the client is willing
731
+ * to accept from the server, with a preference for `application/json` and `text/plain`,
732
+ * but also accepting any other type (*\/*).
733
+ */
734
+ const ACCEPT_HEADER = `${JSON_CONTENT_TYPE}, ${TEXT_CONTENT_TYPE}, */*`;
711
735
  /**
712
736
  * An outgoing HTTP request with an optional typed body.
713
737
  *
@@ -767,7 +791,7 @@ class HttpRequest {
767
791
  * To pass a string representation of HTTP parameters in the URL-query-string format,
768
792
  * the `HttpParamsOptions`' `fromString` may be used. For example:
769
793
  *
770
- * ```
794
+ * ```ts
771
795
  * new HttpParams({fromString: 'angular=awesome'})
772
796
  * ```
773
797
  */
@@ -909,7 +933,7 @@ class HttpRequest {
909
933
  // Technically, strings could be a form of JSON data, but it's safe enough
910
934
  // to assume they're plain strings.
911
935
  if (typeof this.body === 'string') {
912
- return 'text/plain';
936
+ return TEXT_CONTENT_TYPE;
913
937
  }
914
938
  // `HttpUrlEncodedParams` has its own content-type.
915
939
  if (this.body instanceof HttpParams) {
@@ -919,7 +943,7 @@ class HttpRequest {
919
943
  if (typeof this.body === 'object' ||
920
944
  typeof this.body === 'number' ||
921
945
  typeof this.body === 'boolean') {
922
- return 'application/json';
946
+ return JSON_CONTENT_TYPE;
923
947
  }
924
948
  // No type could be inferred.
925
949
  return null;
@@ -1535,15 +1559,14 @@ class HttpClient {
1535
1559
  put(url, body, options = {}) {
1536
1560
  return this.request('PUT', url, addBody(options, body));
1537
1561
  }
1538
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
1539
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClient });
1562
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
1563
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClient });
1540
1564
  }
1541
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClient, decorators: [{
1565
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClient, decorators: [{
1542
1566
  type: Injectable
1543
1567
  }], ctorParameters: () => [{ type: HttpHandler }] });
1544
1568
 
1545
1569
  const XSSI_PREFIX$1 = /^\)\]\}',?\n/;
1546
- const REQUEST_URL_HEADER = `X-Request-URL`;
1547
1570
  /**
1548
1571
  * Determine an appropriate URL for the response, by checking either
1549
1572
  * response url or the X-Request-URL header.
@@ -1553,9 +1576,14 @@ function getResponseUrl$1(response) {
1553
1576
  return response.url;
1554
1577
  }
1555
1578
  // stored as lowercase in the map
1556
- const xRequestUrl = REQUEST_URL_HEADER.toLocaleLowerCase();
1579
+ const xRequestUrl = X_REQUEST_URL_HEADER.toLocaleLowerCase();
1557
1580
  return response.headers.get(xRequestUrl);
1558
1581
  }
1582
+ /**
1583
+ * An internal injection token to reference `FetchBackend` implementation
1584
+ * in a tree-shakable way.
1585
+ */
1586
+ const FETCH_BACKEND = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'FETCH_BACKEND' : '');
1559
1587
  /**
1560
1588
  * Uses `fetch` to send requests to a backend server.
1561
1589
  *
@@ -1723,7 +1751,7 @@ class FetchBackend {
1723
1751
  req.headers.forEach((name, values) => (headers[name] = values.join(',')));
1724
1752
  // Add an Accept header if one isn't present already.
1725
1753
  if (!req.headers.has('Accept')) {
1726
- headers['Accept'] = 'application/json, text/plain, */*';
1754
+ headers['Accept'] = ACCEPT_HEADER;
1727
1755
  }
1728
1756
  // Auto-detect the Content-Type header if one isn't present already.
1729
1757
  if (!req.headers.has('Content-Type')) {
@@ -1749,10 +1777,10 @@ class FetchBackend {
1749
1777
  }
1750
1778
  return chunksAll;
1751
1779
  }
1752
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1753
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FetchBackend });
1780
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1781
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FetchBackend });
1754
1782
  }
1755
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FetchBackend, decorators: [{
1783
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FetchBackend, decorators: [{
1756
1784
  type: Injectable
1757
1785
  }] });
1758
1786
  /**
@@ -1893,10 +1921,10 @@ class HttpInterceptorHandler extends HttpHandler {
1893
1921
  return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
1894
1922
  }
1895
1923
  }
1896
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
1897
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpInterceptorHandler });
1924
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
1925
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpInterceptorHandler });
1898
1926
  }
1899
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
1927
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
1900
1928
  type: Injectable
1901
1929
  }], ctorParameters: () => [{ type: HttpBackend }, { type: i0.EnvironmentInjector }] });
1902
1930
 
@@ -2098,10 +2126,10 @@ class JsonpClientBackend {
2098
2126
  foreignDocument ??= this.document.implementation.createHTMLDocument();
2099
2127
  foreignDocument.adoptNode(script);
2100
2128
  }
2101
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2102
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: JsonpClientBackend });
2129
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2130
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: JsonpClientBackend });
2103
2131
  }
2104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: JsonpClientBackend, decorators: [{
2132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: JsonpClientBackend, decorators: [{
2105
2133
  type: Injectable
2106
2134
  }], ctorParameters: () => [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
2107
2135
  type: Inject,
@@ -2140,14 +2168,15 @@ class JsonpInterceptor {
2140
2168
  intercept(initialRequest, next) {
2141
2169
  return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
2142
2170
  }
2143
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2144
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: JsonpInterceptor });
2171
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2172
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: JsonpInterceptor });
2145
2173
  }
2146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: JsonpInterceptor, decorators: [{
2174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: JsonpInterceptor, decorators: [{
2147
2175
  type: Injectable
2148
2176
  }], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
2149
2177
 
2150
2178
  const XSSI_PREFIX = /^\)\]\}',?\n/;
2179
+ const X_REQUEST_URL_REGEXP = RegExp(`^${X_REQUEST_URL_HEADER}:`, 'm');
2151
2180
  /**
2152
2181
  * Determine an appropriate URL for the response, by checking either
2153
2182
  * XMLHttpRequest.responseURL or the X-Request-URL header.
@@ -2156,8 +2185,8 @@ function getResponseUrl(xhr) {
2156
2185
  if ('responseURL' in xhr && xhr.responseURL) {
2157
2186
  return xhr.responseURL;
2158
2187
  }
2159
- if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
2160
- return xhr.getResponseHeader('X-Request-URL');
2188
+ if (X_REQUEST_URL_REGEXP.test(xhr.getAllResponseHeaders())) {
2189
+ return xhr.getResponseHeader(X_REQUEST_URL_HEADER);
2161
2190
  }
2162
2191
  return null;
2163
2192
  }
@@ -2206,7 +2235,7 @@ class HttpXhrBackend {
2206
2235
  req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(',')));
2207
2236
  // Add an Accept header if one isn't present already.
2208
2237
  if (!req.headers.has('Accept')) {
2209
- xhr.setRequestHeader('Accept', 'application/json, text/plain, */*');
2238
+ xhr.setRequestHeader('Accept', ACCEPT_HEADER);
2210
2239
  }
2211
2240
  // Auto-detect the Content-Type header if one isn't present already.
2212
2241
  if (!req.headers.has('Content-Type')) {
@@ -2424,10 +2453,10 @@ class HttpXhrBackend {
2424
2453
  });
2425
2454
  }));
2426
2455
  }
2427
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
2428
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXhrBackend });
2456
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
2457
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXhrBackend });
2429
2458
  }
2430
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXhrBackend, decorators: [{
2459
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXhrBackend, decorators: [{
2431
2460
  type: Injectable
2432
2461
  }], ctorParameters: () => [{ type: i1.XhrFactory }] });
2433
2462
 
@@ -2479,10 +2508,10 @@ class HttpXsrfCookieExtractor {
2479
2508
  }
2480
2509
  return this.lastToken;
2481
2510
  }
2482
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
2483
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor });
2511
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
2512
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXsrfCookieExtractor });
2484
2513
  }
2485
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
2514
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
2486
2515
  type: Injectable
2487
2516
  }], ctorParameters: () => [{ type: undefined, decorators: [{
2488
2517
  type: Inject,
@@ -2526,10 +2555,10 @@ class HttpXsrfInterceptor {
2526
2555
  intercept(initialRequest, next) {
2527
2556
  return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
2528
2557
  }
2529
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2530
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor });
2558
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2559
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXsrfInterceptor });
2531
2560
  }
2532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
2561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
2533
2562
  type: Injectable
2534
2563
  }], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
2535
2564
 
@@ -2601,7 +2630,7 @@ function provideHttpClient(...features) {
2601
2630
  {
2602
2631
  provide: HttpBackend,
2603
2632
  useFactory: () => {
2604
- return inject(FetchBackend, { optional: true }) ?? inject(HttpXhrBackend);
2633
+ return inject(FETCH_BACKEND, { optional: true }) ?? inject(HttpXhrBackend);
2605
2634
  },
2606
2635
  },
2607
2636
  {
@@ -2752,6 +2781,7 @@ function withRequestsMadeViaParent() {
2752
2781
  function withFetch() {
2753
2782
  return makeHttpFeature(HttpFeatureKind.Fetch, [
2754
2783
  FetchBackend,
2784
+ { provide: FETCH_BACKEND, useExisting: FetchBackend },
2755
2785
  { provide: HttpBackend, useExisting: FetchBackend },
2756
2786
  ]);
2757
2787
  }
@@ -2794,9 +2824,9 @@ class HttpClientXsrfModule {
2794
2824
  providers: withXsrfConfiguration(options).ɵproviders,
2795
2825
  };
2796
2826
  }
2797
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2798
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientXsrfModule });
2799
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, providers: [
2827
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2828
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0", ngImport: i0, type: HttpClientXsrfModule });
2829
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientXsrfModule, providers: [
2800
2830
  HttpXsrfInterceptor,
2801
2831
  { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
2802
2832
  { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
@@ -2807,7 +2837,7 @@ class HttpClientXsrfModule {
2807
2837
  { provide: XSRF_ENABLED, useValue: true },
2808
2838
  ] });
2809
2839
  }
2810
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
2840
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
2811
2841
  type: NgModule,
2812
2842
  args: [{
2813
2843
  providers: [
@@ -2833,11 +2863,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ng
2833
2863
  * @deprecated use `provideHttpClient(withInterceptorsFromDi())` as providers instead
2834
2864
  */
2835
2865
  class HttpClientModule {
2836
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2837
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientModule });
2838
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] });
2866
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2867
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0", ngImport: i0, type: HttpClientModule });
2868
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] });
2839
2869
  }
2840
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientModule, decorators: [{
2870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientModule, decorators: [{
2841
2871
  type: NgModule,
2842
2872
  args: [{
2843
2873
  /**
@@ -2857,11 +2887,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ng
2857
2887
  * @deprecated `withJsonpSupport()` as providers instead
2858
2888
  */
2859
2889
  class HttpClientJsonpModule {
2860
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2861
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientJsonpModule });
2862
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] });
2890
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2891
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0", ngImport: i0, type: HttpClientJsonpModule });
2892
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] });
2863
2893
  }
2864
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
2894
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
2865
2895
  type: NgModule,
2866
2896
  args: [{
2867
2897
  providers: [withJsonpSupport().ɵproviders],
@@ -2927,14 +2957,15 @@ function transferCacheInterceptorFn(req, next) {
2927
2957
  const originMap = inject(HTTP_TRANSFER_CACHE_ORIGIN_MAP, {
2928
2958
  optional: true,
2929
2959
  });
2930
- const isServer = isPlatformServer(inject(PLATFORM_ID));
2931
- if (originMap && !isServer) {
2960
+ if (typeof ngServerMode !== 'undefined' && !ngServerMode && originMap) {
2932
2961
  throw new ɵRuntimeError(2803 /* RuntimeErrorCode.HTTP_ORIGIN_MAP_USED_IN_CLIENT */, ngDevMode &&
2933
2962
  'Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and ' +
2934
2963
  'present in the client side code. Please ensure that this token is only provided in the ' +
2935
2964
  'server code of the application.');
2936
2965
  }
2937
- const requestUrl = isServer && originMap ? mapRequestOriginUrl(req.url, originMap) : req.url;
2966
+ const requestUrl = typeof ngServerMode !== 'undefined' && ngServerMode && originMap
2967
+ ? mapRequestOriginUrl(req.url, originMap)
2968
+ : req.url;
2938
2969
  const storeKey = makeCacheKey(req, requestUrl);
2939
2970
  const response = transferState.get(storeKey, null);
2940
2971
  let headersToInclude = globalOptions.includeHeaders;
@@ -2974,7 +3005,7 @@ function transferCacheInterceptorFn(req, next) {
2974
3005
  }
2975
3006
  // Request not found in cache. Make the request and cache it if on the server.
2976
3007
  return next(req).pipe(tap((event) => {
2977
- if (event instanceof HttpResponse && isServer) {
3008
+ if (event instanceof HttpResponse && typeof ngServerMode !== 'undefined' && ngServerMode) {
2978
3009
  transferState.set(storeKey, {
2979
3010
  [BODY]: event.body,
2980
3011
  [HEADERS]: getFilteredHeaders(event.headers, headersToInclude),