@absolutejs/absolute 0.19.0-beta.213 → 0.19.0-beta.214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/.absolutejs/cache/angular-linker/03f269392dcdbe53b0482927caa1ff17.js +33 -0
  2. package/.absolutejs/cache/angular-linker/341d75bd709b8e3da5e0191e3ae7ff34.js +2029 -0
  3. package/.absolutejs/cache/angular-linker/54161bce55bb149350556317e341619b.js +2872 -0
  4. package/.absolutejs/cache/angular-linker/58ef0a50d4370cda2b180a0e28ccc9a0.js +381 -0
  5. package/.absolutejs/cache/angular-linker/6d5602e0777a6bf3dc286d1418e37eeb.js +593 -0
  6. package/.absolutejs/cache/angular-linker/73f3352125fe12196d76075dab653b06.js +2836 -0
  7. package/.absolutejs/cache/angular-linker/8d0343b38de78de9075d2b7aaef4a0d6.js +693 -0
  8. package/.absolutejs/cache/angular-linker/cd4015dfcb0e8b06d279f929ba472d70.js +122 -0
  9. package/.absolutejs/cache/angular-linker/d7949b8b530e790ee1d7c5f4d9f4e561.js +314 -0
  10. package/.absolutejs/cache/angular-linker/e1bf85e34581dfb0ed6555e030c158e2.js +1351 -0
  11. package/build/.cache/images/47f6059ee156360b7a041933b4978cbcb2011a1c9a67d833558d233472be079b.data +0 -0
  12. package/build/.cache/images/47f6059ee156360b7a041933b4978cbcb2011a1c9a67d833558d233472be079b.meta +1 -0
  13. package/build/.cache/images/5099ad2f32e4636aa812b97dd0dff1d1b439e24b5e97b2d55fe4f77367f461a4.data +0 -0
  14. package/build/.cache/images/5099ad2f32e4636aa812b97dd0dff1d1b439e24b5e97b2d55fe4f77367f461a4.meta +1 -0
  15. package/build/.cache/images/6ee00034d791ddd8b7f3ec800a222632adaf1e8c9fcedc480c773466fc10d1d5.data +0 -0
  16. package/build/.cache/images/6ee00034d791ddd8b7f3ec800a222632adaf1e8c9fcedc480c773466fc10d1d5.meta +1 -0
  17. package/build/.cache/images/70714161d457f1df2ede250334bd6060a38a652f10f043791c77d853f3005930.data +0 -0
  18. package/build/.cache/images/70714161d457f1df2ede250334bd6060a38a652f10f043791c77d853f3005930.meta +1 -0
  19. package/build/.cache/images/7eda684ed9d49b20bd3f8a52c1d2567c7c01a8b73fd7f880a103c0ec3c14f475.data +0 -0
  20. package/build/.cache/images/7eda684ed9d49b20bd3f8a52c1d2567c7c01a8b73fd7f880a103c0ec3c14f475.meta +1 -0
  21. package/build/.cache/images/926071f8d8f974eb91ccf882b478526c5926bc6693d663cdd304c57e7b3e0746.data +0 -0
  22. package/build/.cache/images/926071f8d8f974eb91ccf882b478526c5926bc6693d663cdd304c57e7b3e0746.meta +1 -0
  23. package/build/.cache/images/99fa4c4518e49ec0b205f2c67f9d535672053b80c8637540f9ce759ae5f6bbce.data +0 -0
  24. package/build/.cache/images/99fa4c4518e49ec0b205f2c67f9d535672053b80c8637540f9ce759ae5f6bbce.meta +1 -0
  25. package/build/.cache/images/d6ecd32c804dc52e56da07bd7d05876ff7f02e2e193baa94e15d1cf9022404d7.data +0 -0
  26. package/build/.cache/images/d6ecd32c804dc52e56da07bd7d05876ff7f02e2e193baa94e15d1cf9022404d7.meta +1 -0
  27. package/build/.cache/images/e68219762a1b21ec08ddaf67023cbd689c7f23ab406efa076007b36e4d5844d4.data +0 -0
  28. package/build/.cache/images/e68219762a1b21ec08ddaf67023cbd689c7f23ab406efa076007b36e4d5844d4.meta +1 -0
  29. package/build/.cache/images/e6c1d2e1ea4f97ba38de446e595eb7e0a54f50e282f4d3e02d94d9fd17057066.data +0 -0
  30. package/build/.cache/images/e6c1d2e1ea4f97ba38de446e595eb7e0a54f50e282f4d3e02d94d9fd17057066.meta +1 -0
  31. package/build/.cache/images/f422de3006871f116d1e262ada57671fd9a77d6922b565de81cdc7c574fdccb2.data +0 -0
  32. package/build/.cache/images/f422de3006871f116d1e262ada57671fd9a77d6922b565de81cdc7c574fdccb2.meta +1 -0
  33. package/build/assets/jpg/test.jpg +0 -0
  34. package/build/sitemap.xml +3 -0
  35. package/dist/angular/components/image.component.js +16 -16
  36. package/package.json +1 -1
@@ -0,0 +1,2029 @@
1
+ /**
2
+ * @license Angular v21.2.6
3
+ * (c) 2010-2026 Google LLC. https://angular.dev/
4
+ * License: MIT
5
+ */
6
+
7
+ import * as i0 from '@angular/core';
8
+ import { ɵRuntimeError as _RuntimeError, inject, NgZone, DestroyRef, ɵformatRuntimeError as _formatRuntimeError, InjectionToken, Injectable, ɵTracingService as _TracingService, runInInjectionContext, PendingTasks, ɵConsole as _Console, DOCUMENT, Inject, EnvironmentInjector, makeEnvironmentProviders, NgModule } from '@angular/core';
9
+ import { switchMap, finalize, concatMap, filter, map } from 'rxjs/operators';
10
+ import { Observable, from, of } from 'rxjs';
11
+ import { XhrFactory, parseCookieValue } from './_xhr-chunk.mjs';
12
+ import { PlatformLocation } from './_platform_location-chunk.mjs';
13
+ class HttpHeaders {
14
+ headers;
15
+ normalizedNames = new Map();
16
+ lazyInit;
17
+ lazyUpdate = null;
18
+ constructor(headers) {
19
+ if (!headers) {
20
+ this.headers = new Map();
21
+ } else if (typeof headers === 'string') {
22
+ this.lazyInit = () => {
23
+ this.headers = new Map();
24
+ headers.split('\n').forEach(line => {
25
+ const index = line.indexOf(':');
26
+ if (index > 0) {
27
+ const name = line.slice(0, index);
28
+ const value = line.slice(index + 1).trim();
29
+ this.addHeaderEntry(name, value);
30
+ }
31
+ });
32
+ };
33
+ } else if (typeof Headers !== 'undefined' && headers instanceof Headers) {
34
+ this.headers = new Map();
35
+ headers.forEach((value, name) => {
36
+ this.addHeaderEntry(name, value);
37
+ });
38
+ } else {
39
+ this.lazyInit = () => {
40
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
41
+ assertValidHeaders(headers);
42
+ }
43
+ this.headers = new Map();
44
+ Object.entries(headers).forEach(([name, values]) => {
45
+ this.setHeaderEntries(name, values);
46
+ });
47
+ };
48
+ }
49
+ }
50
+ has(name) {
51
+ this.init();
52
+ return this.headers.has(name.toLowerCase());
53
+ }
54
+ get(name) {
55
+ this.init();
56
+ const values = this.headers.get(name.toLowerCase());
57
+ return values && values.length > 0 ? values[0] : null;
58
+ }
59
+ keys() {
60
+ this.init();
61
+ return Array.from(this.normalizedNames.values());
62
+ }
63
+ getAll(name) {
64
+ this.init();
65
+ return this.headers.get(name.toLowerCase()) || null;
66
+ }
67
+ append(name, value) {
68
+ return this.clone({
69
+ name,
70
+ value,
71
+ op: 'a'
72
+ });
73
+ }
74
+ set(name, value) {
75
+ return this.clone({
76
+ name,
77
+ value,
78
+ op: 's'
79
+ });
80
+ }
81
+ delete(name, value) {
82
+ return this.clone({
83
+ name,
84
+ value,
85
+ op: 'd'
86
+ });
87
+ }
88
+ maybeSetNormalizedName(name, lcName) {
89
+ if (!this.normalizedNames.has(lcName)) {
90
+ this.normalizedNames.set(lcName, name);
91
+ }
92
+ }
93
+ init() {
94
+ if (!!this.lazyInit) {
95
+ if (this.lazyInit instanceof HttpHeaders) {
96
+ this.copyFrom(this.lazyInit);
97
+ } else {
98
+ this.lazyInit();
99
+ }
100
+ this.lazyInit = null;
101
+ if (!!this.lazyUpdate) {
102
+ this.lazyUpdate.forEach(update => this.applyUpdate(update));
103
+ this.lazyUpdate = null;
104
+ }
105
+ }
106
+ }
107
+ copyFrom(other) {
108
+ other.init();
109
+ Array.from(other.headers.keys()).forEach(key => {
110
+ this.headers.set(key, other.headers.get(key));
111
+ this.normalizedNames.set(key, other.normalizedNames.get(key));
112
+ });
113
+ }
114
+ clone(update) {
115
+ const clone = new HttpHeaders();
116
+ clone.lazyInit = !!this.lazyInit && this.lazyInit instanceof HttpHeaders ? this.lazyInit : this;
117
+ clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);
118
+ return clone;
119
+ }
120
+ applyUpdate(update) {
121
+ const key = update.name.toLowerCase();
122
+ switch (update.op) {
123
+ case 'a':
124
+ case 's':
125
+ let value = update.value;
126
+ if (typeof value === 'string') {
127
+ value = [value];
128
+ }
129
+ if (value.length === 0) {
130
+ return;
131
+ }
132
+ this.maybeSetNormalizedName(update.name, key);
133
+ const base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];
134
+ base.push(...value);
135
+ this.headers.set(key, base);
136
+ break;
137
+ case 'd':
138
+ const toDelete = update.value;
139
+ if (!toDelete) {
140
+ this.headers.delete(key);
141
+ this.normalizedNames.delete(key);
142
+ } else {
143
+ let existing = this.headers.get(key);
144
+ if (!existing) {
145
+ return;
146
+ }
147
+ existing = existing.filter(value => toDelete.indexOf(value) === -1);
148
+ if (existing.length === 0) {
149
+ this.headers.delete(key);
150
+ this.normalizedNames.delete(key);
151
+ } else {
152
+ this.headers.set(key, existing);
153
+ }
154
+ }
155
+ break;
156
+ }
157
+ }
158
+ addHeaderEntry(name, value) {
159
+ const key = name.toLowerCase();
160
+ this.maybeSetNormalizedName(name, key);
161
+ if (this.headers.has(key)) {
162
+ this.headers.get(key).push(value);
163
+ } else {
164
+ this.headers.set(key, [value]);
165
+ }
166
+ }
167
+ setHeaderEntries(name, values) {
168
+ const headerValues = (Array.isArray(values) ? values : [values]).map(value => value.toString());
169
+ const key = name.toLowerCase();
170
+ this.headers.set(key, headerValues);
171
+ this.maybeSetNormalizedName(name, key);
172
+ }
173
+ forEach(fn) {
174
+ this.init();
175
+ Array.from(this.normalizedNames.keys()).forEach(key => fn(this.normalizedNames.get(key), this.headers.get(key)));
176
+ }
177
+ }
178
+ function assertValidHeaders(headers) {
179
+ for (const [key, value] of Object.entries(headers)) {
180
+ if (!(typeof value === 'string' || typeof value === 'number') && !Array.isArray(value)) {
181
+ throw new Error(`Unexpected value of the \`${key}\` header provided. ` + `Expecting either a string, a number or an array, but got: \`${value}\`.`);
182
+ }
183
+ }
184
+ }
185
+ class HttpContextToken {
186
+ defaultValue;
187
+ constructor(defaultValue) {
188
+ this.defaultValue = defaultValue;
189
+ }
190
+ }
191
+ class HttpContext {
192
+ map = new Map();
193
+ set(token, value) {
194
+ this.map.set(token, value);
195
+ return this;
196
+ }
197
+ get(token) {
198
+ if (!this.map.has(token)) {
199
+ this.map.set(token, token.defaultValue());
200
+ }
201
+ return this.map.get(token);
202
+ }
203
+ delete(token) {
204
+ this.map.delete(token);
205
+ return this;
206
+ }
207
+ has(token) {
208
+ return this.map.has(token);
209
+ }
210
+ keys() {
211
+ return this.map.keys();
212
+ }
213
+ }
214
+ class HttpUrlEncodingCodec {
215
+ encodeKey(key) {
216
+ return standardEncoding(key);
217
+ }
218
+ encodeValue(value) {
219
+ return standardEncoding(value);
220
+ }
221
+ decodeKey(key) {
222
+ return decodeURIComponent(key);
223
+ }
224
+ decodeValue(value) {
225
+ return decodeURIComponent(value);
226
+ }
227
+ }
228
+ function paramParser(rawParams, codec) {
229
+ const map = new Map();
230
+ if (rawParams.length > 0) {
231
+ const params = rawParams.replace(/^\?/, '').split('&');
232
+ params.forEach(param => {
233
+ const eqIdx = param.indexOf('=');
234
+ const [key, val] = eqIdx == -1 ? [codec.decodeKey(param), ''] : [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))];
235
+ const list = map.get(key) || [];
236
+ list.push(val);
237
+ map.set(key, list);
238
+ });
239
+ }
240
+ return map;
241
+ }
242
+ const STANDARD_ENCODING_REGEX = /%(\d[a-f0-9])/gi;
243
+ const STANDARD_ENCODING_REPLACEMENTS = {
244
+ '40': '@',
245
+ '3A': ':',
246
+ '24': '$',
247
+ '2C': ',',
248
+ '3B': ';',
249
+ '3D': '=',
250
+ '3F': '?',
251
+ '2F': '/'
252
+ };
253
+ function standardEncoding(v) {
254
+ return encodeURIComponent(v).replace(STANDARD_ENCODING_REGEX, (s, t) => STANDARD_ENCODING_REPLACEMENTS[t] ?? s);
255
+ }
256
+ function valueToString(value) {
257
+ return `${value}`;
258
+ }
259
+ class HttpParams {
260
+ map;
261
+ encoder;
262
+ updates = null;
263
+ cloneFrom = null;
264
+ constructor(options = {}) {
265
+ this.encoder = options.encoder || new HttpUrlEncodingCodec();
266
+ if (options.fromString) {
267
+ if (options.fromObject) {
268
+ throw new _RuntimeError(2805, ngDevMode && 'Cannot specify both fromString and fromObject.');
269
+ }
270
+ this.map = paramParser(options.fromString, this.encoder);
271
+ } else if (!!options.fromObject) {
272
+ this.map = new Map();
273
+ Object.keys(options.fromObject).forEach(key => {
274
+ const value = options.fromObject[key];
275
+ const values = Array.isArray(value) ? value.map(valueToString) : [valueToString(value)];
276
+ this.map.set(key, values);
277
+ });
278
+ } else {
279
+ this.map = null;
280
+ }
281
+ }
282
+ has(param) {
283
+ this.init();
284
+ return this.map.has(param);
285
+ }
286
+ get(param) {
287
+ this.init();
288
+ const res = this.map.get(param);
289
+ return !!res ? res[0] : null;
290
+ }
291
+ getAll(param) {
292
+ this.init();
293
+ return this.map.get(param) || null;
294
+ }
295
+ keys() {
296
+ this.init();
297
+ return Array.from(this.map.keys());
298
+ }
299
+ append(param, value) {
300
+ return this.clone({
301
+ param,
302
+ value,
303
+ op: 'a'
304
+ });
305
+ }
306
+ appendAll(params) {
307
+ const updates = [];
308
+ Object.keys(params).forEach(param => {
309
+ const value = params[param];
310
+ if (Array.isArray(value)) {
311
+ value.forEach(_value => {
312
+ updates.push({
313
+ param,
314
+ value: _value,
315
+ op: 'a'
316
+ });
317
+ });
318
+ } else {
319
+ updates.push({
320
+ param,
321
+ value: value,
322
+ op: 'a'
323
+ });
324
+ }
325
+ });
326
+ return this.clone(updates);
327
+ }
328
+ set(param, value) {
329
+ return this.clone({
330
+ param,
331
+ value,
332
+ op: 's'
333
+ });
334
+ }
335
+ delete(param, value) {
336
+ return this.clone({
337
+ param,
338
+ value,
339
+ op: 'd'
340
+ });
341
+ }
342
+ toString() {
343
+ this.init();
344
+ return this.keys().map(key => {
345
+ const eKey = this.encoder.encodeKey(key);
346
+ return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value)).join('&');
347
+ }).filter(param => param !== '').join('&');
348
+ }
349
+ clone(update) {
350
+ const clone = new HttpParams({
351
+ encoder: this.encoder
352
+ });
353
+ clone.cloneFrom = this.cloneFrom || this;
354
+ clone.updates = (this.updates || []).concat(update);
355
+ return clone;
356
+ }
357
+ init() {
358
+ if (this.map === null) {
359
+ this.map = new Map();
360
+ }
361
+ if (this.cloneFrom !== null) {
362
+ this.cloneFrom.init();
363
+ this.cloneFrom.keys().forEach(key => this.map.set(key, this.cloneFrom.map.get(key)));
364
+ this.updates.forEach(update => {
365
+ switch (update.op) {
366
+ case 'a':
367
+ case 's':
368
+ const base = (update.op === 'a' ? this.map.get(update.param) : undefined) || [];
369
+ base.push(valueToString(update.value));
370
+ this.map.set(update.param, base);
371
+ break;
372
+ case 'd':
373
+ if (update.value !== undefined) {
374
+ let base = this.map.get(update.param) || [];
375
+ const idx = base.indexOf(valueToString(update.value));
376
+ if (idx !== -1) {
377
+ base.splice(idx, 1);
378
+ }
379
+ if (base.length > 0) {
380
+ this.map.set(update.param, base);
381
+ } else {
382
+ this.map.delete(update.param);
383
+ }
384
+ } else {
385
+ this.map.delete(update.param);
386
+ break;
387
+ }
388
+ }
389
+ });
390
+ this.cloneFrom = this.updates = null;
391
+ }
392
+ }
393
+ }
394
+ function mightHaveBody(method) {
395
+ switch (method) {
396
+ case 'DELETE':
397
+ case 'GET':
398
+ case 'HEAD':
399
+ case 'OPTIONS':
400
+ case 'JSONP':
401
+ return false;
402
+ default:
403
+ return true;
404
+ }
405
+ }
406
+ function isArrayBuffer(value) {
407
+ return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;
408
+ }
409
+ function isBlob(value) {
410
+ return typeof Blob !== 'undefined' && value instanceof Blob;
411
+ }
412
+ function isFormData(value) {
413
+ return typeof FormData !== 'undefined' && value instanceof FormData;
414
+ }
415
+ function isUrlSearchParams(value) {
416
+ return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams;
417
+ }
418
+ const CONTENT_TYPE_HEADER = 'Content-Type';
419
+ const ACCEPT_HEADER = 'Accept';
420
+ const TEXT_CONTENT_TYPE = 'text/plain';
421
+ const JSON_CONTENT_TYPE = 'application/json';
422
+ const ACCEPT_HEADER_VALUE = `${JSON_CONTENT_TYPE}, ${TEXT_CONTENT_TYPE}, */*`;
423
+ class HttpRequest {
424
+ url;
425
+ body = null;
426
+ headers;
427
+ context;
428
+ reportProgress = false;
429
+ withCredentials = false;
430
+ credentials;
431
+ keepalive = false;
432
+ cache;
433
+ priority;
434
+ mode;
435
+ redirect;
436
+ referrer;
437
+ integrity;
438
+ referrerPolicy;
439
+ responseType = 'json';
440
+ method;
441
+ params;
442
+ urlWithParams;
443
+ transferCache;
444
+ timeout;
445
+ constructor(method, url, third, fourth) {
446
+ this.url = url;
447
+ this.method = method.toUpperCase();
448
+ let options;
449
+ if (mightHaveBody(this.method) || !!fourth) {
450
+ this.body = third !== undefined ? third : null;
451
+ options = fourth;
452
+ } else {
453
+ options = third;
454
+ }
455
+ if (options) {
456
+ this.reportProgress = !!options.reportProgress;
457
+ this.withCredentials = !!options.withCredentials;
458
+ this.keepalive = !!options.keepalive;
459
+ if (!!options.responseType) {
460
+ this.responseType = options.responseType;
461
+ }
462
+ if (options.headers) {
463
+ this.headers = options.headers;
464
+ }
465
+ if (options.context) {
466
+ this.context = options.context;
467
+ }
468
+ if (options.params) {
469
+ this.params = options.params;
470
+ }
471
+ if (options.priority) {
472
+ this.priority = options.priority;
473
+ }
474
+ if (options.cache) {
475
+ this.cache = options.cache;
476
+ }
477
+ if (options.credentials) {
478
+ this.credentials = options.credentials;
479
+ }
480
+ if (typeof options.timeout === 'number') {
481
+ if (options.timeout < 1 || !Number.isInteger(options.timeout)) {
482
+ throw new _RuntimeError(2822, ngDevMode ? '`timeout` must be a positive integer value' : '');
483
+ }
484
+ this.timeout = options.timeout;
485
+ }
486
+ if (options.mode) {
487
+ this.mode = options.mode;
488
+ }
489
+ if (options.redirect) {
490
+ this.redirect = options.redirect;
491
+ }
492
+ if (options.integrity) {
493
+ this.integrity = options.integrity;
494
+ }
495
+ if (options.referrer) {
496
+ this.referrer = options.referrer;
497
+ }
498
+ if (options.referrerPolicy) {
499
+ this.referrerPolicy = options.referrerPolicy;
500
+ }
501
+ this.transferCache = options.transferCache;
502
+ }
503
+ this.headers ??= new HttpHeaders();
504
+ this.context ??= new HttpContext();
505
+ if (!this.params) {
506
+ this.params = new HttpParams();
507
+ this.urlWithParams = url;
508
+ } else {
509
+ const params = this.params.toString();
510
+ if (params.length === 0) {
511
+ this.urlWithParams = url;
512
+ } else {
513
+ const qIdx = url.indexOf('?');
514
+ const sep = qIdx === -1 ? '?' : qIdx < url.length - 1 ? '&' : '';
515
+ this.urlWithParams = url + sep + params;
516
+ }
517
+ }
518
+ }
519
+ serializeBody() {
520
+ if (this.body === null) {
521
+ return null;
522
+ }
523
+ if (typeof this.body === 'string' || isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) || isUrlSearchParams(this.body)) {
524
+ return this.body;
525
+ }
526
+ if (this.body instanceof HttpParams) {
527
+ return this.body.toString();
528
+ }
529
+ if (typeof this.body === 'object' || typeof this.body === 'boolean' || Array.isArray(this.body)) {
530
+ return JSON.stringify(this.body);
531
+ }
532
+ return this.body.toString();
533
+ }
534
+ detectContentTypeHeader() {
535
+ if (this.body === null) {
536
+ return null;
537
+ }
538
+ if (isFormData(this.body)) {
539
+ return null;
540
+ }
541
+ if (isBlob(this.body)) {
542
+ return this.body.type || null;
543
+ }
544
+ if (isArrayBuffer(this.body)) {
545
+ return null;
546
+ }
547
+ if (typeof this.body === 'string') {
548
+ return TEXT_CONTENT_TYPE;
549
+ }
550
+ if (this.body instanceof HttpParams) {
551
+ return 'application/x-www-form-urlencoded;charset=UTF-8';
552
+ }
553
+ if (typeof this.body === 'object' || typeof this.body === 'number' || typeof this.body === 'boolean') {
554
+ return JSON_CONTENT_TYPE;
555
+ }
556
+ return null;
557
+ }
558
+ clone(update = {}) {
559
+ const method = update.method || this.method;
560
+ const url = update.url || this.url;
561
+ const responseType = update.responseType || this.responseType;
562
+ const keepalive = update.keepalive ?? this.keepalive;
563
+ const priority = update.priority || this.priority;
564
+ const cache = update.cache || this.cache;
565
+ const mode = update.mode || this.mode;
566
+ const redirect = update.redirect || this.redirect;
567
+ const credentials = update.credentials || this.credentials;
568
+ const referrer = update.referrer || this.referrer;
569
+ const integrity = update.integrity || this.integrity;
570
+ const referrerPolicy = update.referrerPolicy || this.referrerPolicy;
571
+ const transferCache = update.transferCache ?? this.transferCache;
572
+ const timeout = update.timeout ?? this.timeout;
573
+ const body = update.body !== undefined ? update.body : this.body;
574
+ const withCredentials = update.withCredentials ?? this.withCredentials;
575
+ const reportProgress = update.reportProgress ?? this.reportProgress;
576
+ let headers = update.headers || this.headers;
577
+ let params = update.params || this.params;
578
+ const context = update.context ?? this.context;
579
+ if (update.setHeaders !== undefined) {
580
+ headers = Object.keys(update.setHeaders).reduce((headers, name) => headers.set(name, update.setHeaders[name]), headers);
581
+ }
582
+ if (update.setParams) {
583
+ params = Object.keys(update.setParams).reduce((params, param) => params.set(param, update.setParams[param]), params);
584
+ }
585
+ return new HttpRequest(method, url, body, {
586
+ params,
587
+ headers,
588
+ context,
589
+ reportProgress,
590
+ responseType,
591
+ withCredentials,
592
+ transferCache,
593
+ keepalive,
594
+ cache,
595
+ priority,
596
+ timeout,
597
+ mode,
598
+ redirect,
599
+ credentials,
600
+ referrer,
601
+ integrity,
602
+ referrerPolicy
603
+ });
604
+ }
605
+ }
606
+ var HttpEventType;
607
+ (function (HttpEventType) {
608
+ HttpEventType[HttpEventType["Sent"] = 0] = "Sent";
609
+ HttpEventType[HttpEventType["UploadProgress"] = 1] = "UploadProgress";
610
+ HttpEventType[HttpEventType["ResponseHeader"] = 2] = "ResponseHeader";
611
+ HttpEventType[HttpEventType["DownloadProgress"] = 3] = "DownloadProgress";
612
+ HttpEventType[HttpEventType["Response"] = 4] = "Response";
613
+ HttpEventType[HttpEventType["User"] = 5] = "User";
614
+ })(HttpEventType || (HttpEventType = {}));
615
+ class HttpResponseBase {
616
+ headers;
617
+ status;
618
+ statusText;
619
+ url;
620
+ ok;
621
+ type;
622
+ redirected;
623
+ responseType;
624
+ constructor(init, defaultStatus = 200, defaultStatusText = 'OK') {
625
+ this.headers = init.headers || new HttpHeaders();
626
+ this.status = init.status !== undefined ? init.status : defaultStatus;
627
+ this.statusText = init.statusText || defaultStatusText;
628
+ this.url = init.url || null;
629
+ this.redirected = init.redirected;
630
+ this.responseType = init.responseType;
631
+ this.ok = this.status >= 200 && this.status < 300;
632
+ }
633
+ }
634
+ class HttpHeaderResponse extends HttpResponseBase {
635
+ constructor(init = {}) {
636
+ super(init);
637
+ }
638
+ type = HttpEventType.ResponseHeader;
639
+ clone(update = {}) {
640
+ return new HttpHeaderResponse({
641
+ headers: update.headers || this.headers,
642
+ status: update.status !== undefined ? update.status : this.status,
643
+ statusText: update.statusText || this.statusText,
644
+ url: update.url || this.url || undefined
645
+ });
646
+ }
647
+ }
648
+ class HttpResponse extends HttpResponseBase {
649
+ body;
650
+ constructor(init = {}) {
651
+ super(init);
652
+ this.body = init.body !== undefined ? init.body : null;
653
+ }
654
+ type = HttpEventType.Response;
655
+ clone(update = {}) {
656
+ return new HttpResponse({
657
+ body: update.body !== undefined ? update.body : this.body,
658
+ headers: update.headers || this.headers,
659
+ status: update.status !== undefined ? update.status : this.status,
660
+ statusText: update.statusText || this.statusText,
661
+ url: update.url || this.url || undefined,
662
+ redirected: update.redirected ?? this.redirected,
663
+ responseType: update.responseType ?? this.responseType
664
+ });
665
+ }
666
+ }
667
+ class HttpErrorResponse extends HttpResponseBase {
668
+ name = 'HttpErrorResponse';
669
+ message;
670
+ error;
671
+ ok = false;
672
+ constructor(init) {
673
+ super(init, 0, 'Unknown Error');
674
+ if (this.status >= 200 && this.status < 300) {
675
+ this.message = `Http failure during parsing for ${init.url || '(unknown url)'}`;
676
+ } else {
677
+ this.message = `Http failure response for ${init.url || '(unknown url)'}: ${init.status} ${init.statusText}`;
678
+ }
679
+ this.error = init.error || null;
680
+ }
681
+ }
682
+ const HTTP_STATUS_CODE_OK = 200;
683
+ const HTTP_STATUS_CODE_NO_CONTENT = 204;
684
+ var HttpStatusCode;
685
+ (function (HttpStatusCode) {
686
+ HttpStatusCode[HttpStatusCode["Continue"] = 100] = "Continue";
687
+ HttpStatusCode[HttpStatusCode["SwitchingProtocols"] = 101] = "SwitchingProtocols";
688
+ HttpStatusCode[HttpStatusCode["Processing"] = 102] = "Processing";
689
+ HttpStatusCode[HttpStatusCode["EarlyHints"] = 103] = "EarlyHints";
690
+ HttpStatusCode[HttpStatusCode["Ok"] = 200] = "Ok";
691
+ HttpStatusCode[HttpStatusCode["Created"] = 201] = "Created";
692
+ HttpStatusCode[HttpStatusCode["Accepted"] = 202] = "Accepted";
693
+ HttpStatusCode[HttpStatusCode["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
694
+ HttpStatusCode[HttpStatusCode["NoContent"] = 204] = "NoContent";
695
+ HttpStatusCode[HttpStatusCode["ResetContent"] = 205] = "ResetContent";
696
+ HttpStatusCode[HttpStatusCode["PartialContent"] = 206] = "PartialContent";
697
+ HttpStatusCode[HttpStatusCode["MultiStatus"] = 207] = "MultiStatus";
698
+ HttpStatusCode[HttpStatusCode["AlreadyReported"] = 208] = "AlreadyReported";
699
+ HttpStatusCode[HttpStatusCode["ImUsed"] = 226] = "ImUsed";
700
+ HttpStatusCode[HttpStatusCode["MultipleChoices"] = 300] = "MultipleChoices";
701
+ HttpStatusCode[HttpStatusCode["MovedPermanently"] = 301] = "MovedPermanently";
702
+ HttpStatusCode[HttpStatusCode["Found"] = 302] = "Found";
703
+ HttpStatusCode[HttpStatusCode["SeeOther"] = 303] = "SeeOther";
704
+ HttpStatusCode[HttpStatusCode["NotModified"] = 304] = "NotModified";
705
+ HttpStatusCode[HttpStatusCode["UseProxy"] = 305] = "UseProxy";
706
+ HttpStatusCode[HttpStatusCode["Unused"] = 306] = "Unused";
707
+ HttpStatusCode[HttpStatusCode["TemporaryRedirect"] = 307] = "TemporaryRedirect";
708
+ HttpStatusCode[HttpStatusCode["PermanentRedirect"] = 308] = "PermanentRedirect";
709
+ HttpStatusCode[HttpStatusCode["BadRequest"] = 400] = "BadRequest";
710
+ HttpStatusCode[HttpStatusCode["Unauthorized"] = 401] = "Unauthorized";
711
+ HttpStatusCode[HttpStatusCode["PaymentRequired"] = 402] = "PaymentRequired";
712
+ HttpStatusCode[HttpStatusCode["Forbidden"] = 403] = "Forbidden";
713
+ HttpStatusCode[HttpStatusCode["NotFound"] = 404] = "NotFound";
714
+ HttpStatusCode[HttpStatusCode["MethodNotAllowed"] = 405] = "MethodNotAllowed";
715
+ HttpStatusCode[HttpStatusCode["NotAcceptable"] = 406] = "NotAcceptable";
716
+ HttpStatusCode[HttpStatusCode["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
717
+ HttpStatusCode[HttpStatusCode["RequestTimeout"] = 408] = "RequestTimeout";
718
+ HttpStatusCode[HttpStatusCode["Conflict"] = 409] = "Conflict";
719
+ HttpStatusCode[HttpStatusCode["Gone"] = 410] = "Gone";
720
+ HttpStatusCode[HttpStatusCode["LengthRequired"] = 411] = "LengthRequired";
721
+ HttpStatusCode[HttpStatusCode["PreconditionFailed"] = 412] = "PreconditionFailed";
722
+ HttpStatusCode[HttpStatusCode["PayloadTooLarge"] = 413] = "PayloadTooLarge";
723
+ HttpStatusCode[HttpStatusCode["UriTooLong"] = 414] = "UriTooLong";
724
+ HttpStatusCode[HttpStatusCode["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
725
+ HttpStatusCode[HttpStatusCode["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
726
+ HttpStatusCode[HttpStatusCode["ExpectationFailed"] = 417] = "ExpectationFailed";
727
+ HttpStatusCode[HttpStatusCode["ImATeapot"] = 418] = "ImATeapot";
728
+ HttpStatusCode[HttpStatusCode["MisdirectedRequest"] = 421] = "MisdirectedRequest";
729
+ HttpStatusCode[HttpStatusCode["UnprocessableEntity"] = 422] = "UnprocessableEntity";
730
+ HttpStatusCode[HttpStatusCode["Locked"] = 423] = "Locked";
731
+ HttpStatusCode[HttpStatusCode["FailedDependency"] = 424] = "FailedDependency";
732
+ HttpStatusCode[HttpStatusCode["TooEarly"] = 425] = "TooEarly";
733
+ HttpStatusCode[HttpStatusCode["UpgradeRequired"] = 426] = "UpgradeRequired";
734
+ HttpStatusCode[HttpStatusCode["PreconditionRequired"] = 428] = "PreconditionRequired";
735
+ HttpStatusCode[HttpStatusCode["TooManyRequests"] = 429] = "TooManyRequests";
736
+ HttpStatusCode[HttpStatusCode["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
737
+ HttpStatusCode[HttpStatusCode["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
738
+ HttpStatusCode[HttpStatusCode["InternalServerError"] = 500] = "InternalServerError";
739
+ HttpStatusCode[HttpStatusCode["NotImplemented"] = 501] = "NotImplemented";
740
+ HttpStatusCode[HttpStatusCode["BadGateway"] = 502] = "BadGateway";
741
+ HttpStatusCode[HttpStatusCode["ServiceUnavailable"] = 503] = "ServiceUnavailable";
742
+ HttpStatusCode[HttpStatusCode["GatewayTimeout"] = 504] = "GatewayTimeout";
743
+ HttpStatusCode[HttpStatusCode["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
744
+ HttpStatusCode[HttpStatusCode["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
745
+ HttpStatusCode[HttpStatusCode["InsufficientStorage"] = 507] = "InsufficientStorage";
746
+ HttpStatusCode[HttpStatusCode["LoopDetected"] = 508] = "LoopDetected";
747
+ HttpStatusCode[HttpStatusCode["NotExtended"] = 510] = "NotExtended";
748
+ HttpStatusCode[HttpStatusCode["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
749
+ })(HttpStatusCode || (HttpStatusCode = {}));
750
+ const XSSI_PREFIX$1 = /^\)\]\}',?\n/;
751
+ const FETCH_BACKEND = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'FETCH_BACKEND' : '');
752
+ class FetchBackend {
753
+ fetchImpl = inject(FetchFactory, {
754
+ optional: true
755
+ })?.fetch ?? ((...args) => globalThis.fetch(...args));
756
+ ngZone = inject(NgZone);
757
+ destroyRef = inject(DestroyRef);
758
+ handle(request) {
759
+ return new Observable(observer => {
760
+ const aborter = new AbortController();
761
+ this.doRequest(request, aborter.signal, observer).then(noop, error => observer.error(new HttpErrorResponse({
762
+ error
763
+ })));
764
+ let timeoutId;
765
+ if (request.timeout) {
766
+ timeoutId = this.ngZone.runOutsideAngular(() => setTimeout(() => {
767
+ if (!aborter.signal.aborted) {
768
+ aborter.abort(new DOMException('signal timed out', 'TimeoutError'));
769
+ }
770
+ }, request.timeout));
771
+ }
772
+ return () => {
773
+ if (timeoutId !== undefined) {
774
+ clearTimeout(timeoutId);
775
+ }
776
+ aborter.abort();
777
+ };
778
+ });
779
+ }
780
+ async doRequest(request, signal, observer) {
781
+ const init = this.createRequestInit(request);
782
+ let response;
783
+ try {
784
+ const fetchPromise = this.ngZone.runOutsideAngular(() => this.fetchImpl(request.urlWithParams, {
785
+ signal,
786
+ ...init
787
+ }));
788
+ silenceSuperfluousUnhandledPromiseRejection(fetchPromise);
789
+ observer.next({
790
+ type: HttpEventType.Sent
791
+ });
792
+ response = await fetchPromise;
793
+ } catch (error) {
794
+ observer.error(new HttpErrorResponse({
795
+ error,
796
+ status: error.status ?? 0,
797
+ statusText: error.statusText,
798
+ url: request.urlWithParams,
799
+ headers: error.headers
800
+ }));
801
+ return;
802
+ }
803
+ const headers = new HttpHeaders(response.headers);
804
+ const statusText = response.statusText;
805
+ const url = response.url || request.urlWithParams;
806
+ let status = response.status;
807
+ let body = null;
808
+ if (request.reportProgress) {
809
+ observer.next(new HttpHeaderResponse({
810
+ headers,
811
+ status,
812
+ statusText,
813
+ url
814
+ }));
815
+ }
816
+ if (response.body) {
817
+ const contentLength = response.headers.get('content-length');
818
+ const chunks = [];
819
+ const reader = response.body.getReader();
820
+ let receivedLength = 0;
821
+ let decoder;
822
+ let partialText;
823
+ const reqZone = typeof Zone !== 'undefined' && Zone.current;
824
+ let canceled = false;
825
+ await this.ngZone.runOutsideAngular(async () => {
826
+ while (true) {
827
+ if (this.destroyRef.destroyed) {
828
+ await reader.cancel();
829
+ canceled = true;
830
+ break;
831
+ }
832
+ const {
833
+ done,
834
+ value
835
+ } = await reader.read();
836
+ if (done) {
837
+ break;
838
+ }
839
+ chunks.push(value);
840
+ receivedLength += value.length;
841
+ if (request.reportProgress) {
842
+ partialText = request.responseType === 'text' ? (partialText ?? '') + (decoder ??= new TextDecoder()).decode(value, {
843
+ stream: true
844
+ }) : undefined;
845
+ const reportProgress = () => observer.next({
846
+ type: HttpEventType.DownloadProgress,
847
+ total: contentLength ? +contentLength : undefined,
848
+ loaded: receivedLength,
849
+ partialText
850
+ });
851
+ reqZone ? reqZone.run(reportProgress) : reportProgress();
852
+ }
853
+ }
854
+ });
855
+ if (canceled) {
856
+ observer.complete();
857
+ return;
858
+ }
859
+ const chunksAll = this.concatChunks(chunks, receivedLength);
860
+ try {
861
+ const contentType = response.headers.get(CONTENT_TYPE_HEADER) ?? '';
862
+ body = this.parseBody(request, chunksAll, contentType, status);
863
+ } catch (error) {
864
+ observer.error(new HttpErrorResponse({
865
+ error,
866
+ headers: new HttpHeaders(response.headers),
867
+ status: response.status,
868
+ statusText: response.statusText,
869
+ url: response.url || request.urlWithParams
870
+ }));
871
+ return;
872
+ }
873
+ }
874
+ if (status === 0) {
875
+ status = body ? HTTP_STATUS_CODE_OK : 0;
876
+ }
877
+ const ok = status >= 200 && status < 300;
878
+ const redirected = response.redirected;
879
+ const responseType = response.type;
880
+ if (ok) {
881
+ observer.next(new HttpResponse({
882
+ body,
883
+ headers,
884
+ status,
885
+ statusText,
886
+ url,
887
+ redirected,
888
+ responseType
889
+ }));
890
+ observer.complete();
891
+ } else {
892
+ observer.error(new HttpErrorResponse({
893
+ error: body,
894
+ headers,
895
+ status,
896
+ statusText,
897
+ url,
898
+ redirected,
899
+ responseType
900
+ }));
901
+ }
902
+ }
903
+ parseBody(request, binContent, contentType, status) {
904
+ switch (request.responseType) {
905
+ case 'json':
906
+ const text = new TextDecoder().decode(binContent).replace(XSSI_PREFIX$1, '');
907
+ if (text === '') {
908
+ return null;
909
+ }
910
+ try {
911
+ return JSON.parse(text);
912
+ } catch (e) {
913
+ if (status < 200 || status >= 300) {
914
+ return text;
915
+ }
916
+ throw e;
917
+ }
918
+ case 'text':
919
+ return new TextDecoder().decode(binContent);
920
+ case 'blob':
921
+ return new Blob([binContent], {
922
+ type: contentType
923
+ });
924
+ case 'arraybuffer':
925
+ return binContent.buffer;
926
+ }
927
+ }
928
+ createRequestInit(req) {
929
+ const headers = {};
930
+ let credentials;
931
+ credentials = req.credentials;
932
+ if (req.withCredentials) {
933
+ (typeof ngDevMode === 'undefined' || ngDevMode) && warningOptionsMessage(req);
934
+ credentials = 'include';
935
+ }
936
+ req.headers.forEach((name, values) => headers[name] = values.join(','));
937
+ if (!req.headers.has(ACCEPT_HEADER)) {
938
+ headers[ACCEPT_HEADER] = ACCEPT_HEADER_VALUE;
939
+ }
940
+ if (!req.headers.has(CONTENT_TYPE_HEADER)) {
941
+ const detectedType = req.detectContentTypeHeader();
942
+ if (detectedType !== null) {
943
+ headers[CONTENT_TYPE_HEADER] = detectedType;
944
+ }
945
+ }
946
+ return {
947
+ body: req.serializeBody(),
948
+ method: req.method,
949
+ headers,
950
+ credentials,
951
+ keepalive: req.keepalive,
952
+ cache: req.cache,
953
+ priority: req.priority,
954
+ mode: req.mode,
955
+ redirect: req.redirect,
956
+ referrer: req.referrer,
957
+ integrity: req.integrity,
958
+ referrerPolicy: req.referrerPolicy
959
+ };
960
+ }
961
+ concatChunks(chunks, totalLength) {
962
+ const chunksAll = new Uint8Array(totalLength);
963
+ let position = 0;
964
+ for (const chunk of chunks) {
965
+ chunksAll.set(chunk, position);
966
+ position += chunk.length;
967
+ }
968
+ return chunksAll;
969
+ }
970
+ static ɵfac = function FetchBackend_Factory(__ngFactoryType__) {
971
+ return new (__ngFactoryType__ || FetchBackend)();
972
+ };
973
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
974
+ token: FetchBackend,
975
+ factory: FetchBackend.ɵfac
976
+ });
977
+ }
978
+ (() => {
979
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FetchBackend, [{
980
+ type: Injectable
981
+ }], null, null);
982
+ })();
983
+ class FetchFactory {}
984
+ function noop() {}
985
+ function warningOptionsMessage(req) {
986
+ if (req.credentials && req.withCredentials) {
987
+ console.warn(_formatRuntimeError(2819, `Angular detected that a \`HttpClient\` request has both \`withCredentials: true\` and \`credentials: '${req.credentials}'\` options. The \`withCredentials\` option is overriding the explicit \`credentials\` setting to 'include'. Consider removing \`withCredentials\` and using \`credentials: '${req.credentials}'\` directly for clarity.`));
988
+ }
989
+ }
990
+ function silenceSuperfluousUnhandledPromiseRejection(promise) {
991
+ promise.then(noop, noop);
992
+ }
993
+ const XSSI_PREFIX = /^\)\]\}',?\n/;
994
+ function validateXhrCompatibility(req) {
995
+ const unsupportedOptions = [{
996
+ property: 'keepalive',
997
+ errorCode: 2813
998
+ }, {
999
+ property: 'cache',
1000
+ errorCode: 2814
1001
+ }, {
1002
+ property: 'priority',
1003
+ errorCode: 2815
1004
+ }, {
1005
+ property: 'mode',
1006
+ errorCode: 2816
1007
+ }, {
1008
+ property: 'redirect',
1009
+ errorCode: 2817
1010
+ }, {
1011
+ property: 'credentials',
1012
+ errorCode: 2818
1013
+ }, {
1014
+ property: 'integrity',
1015
+ errorCode: 2820
1016
+ }, {
1017
+ property: 'referrer',
1018
+ errorCode: 2821
1019
+ }, {
1020
+ property: 'referrerPolicy',
1021
+ errorCode: 2823
1022
+ }];
1023
+ for (const {
1024
+ property,
1025
+ errorCode
1026
+ } of unsupportedOptions) {
1027
+ if (req[property]) {
1028
+ console.warn(_formatRuntimeError(errorCode, `Angular detected that a \`HttpClient\` request with the \`${property}\` option was sent using XHR, which does not support it. To use the \`${property}\` option, enable Fetch API support by passing \`withFetch()\` as an argument to \`provideHttpClient()\`.`));
1029
+ }
1030
+ }
1031
+ }
1032
+ class HttpXhrBackend {
1033
+ xhrFactory;
1034
+ tracingService = inject(_TracingService, {
1035
+ optional: true
1036
+ });
1037
+ constructor(xhrFactory) {
1038
+ this.xhrFactory = xhrFactory;
1039
+ }
1040
+ maybePropagateTrace(fn) {
1041
+ return this.tracingService?.propagate ? this.tracingService.propagate(fn) : fn;
1042
+ }
1043
+ handle(req) {
1044
+ if (req.method === 'JSONP') {
1045
+ throw new _RuntimeError(-2800, (typeof ngDevMode === 'undefined' || ngDevMode) && `Cannot make a JSONP request without JSONP support. To fix the problem, either add the \`withJsonpSupport()\` call (if \`provideHttpClient()\` is used) or import the \`HttpClientJsonpModule\` in the root NgModule.`);
1046
+ }
1047
+ ngDevMode && validateXhrCompatibility(req);
1048
+ const xhrFactory = this.xhrFactory;
1049
+ const source = typeof ngServerMode !== 'undefined' && ngServerMode && xhrFactory.ɵloadImpl ? from(xhrFactory.ɵloadImpl()) : of(null);
1050
+ return source.pipe(switchMap(() => {
1051
+ return new Observable(observer => {
1052
+ const xhr = xhrFactory.build();
1053
+ xhr.open(req.method, req.urlWithParams);
1054
+ if (req.withCredentials) {
1055
+ xhr.withCredentials = true;
1056
+ }
1057
+ req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(',')));
1058
+ if (!req.headers.has(ACCEPT_HEADER)) {
1059
+ xhr.setRequestHeader(ACCEPT_HEADER, ACCEPT_HEADER_VALUE);
1060
+ }
1061
+ if (!req.headers.has(CONTENT_TYPE_HEADER)) {
1062
+ const detectedType = req.detectContentTypeHeader();
1063
+ if (detectedType !== null) {
1064
+ xhr.setRequestHeader(CONTENT_TYPE_HEADER, detectedType);
1065
+ }
1066
+ }
1067
+ if (req.timeout) {
1068
+ xhr.timeout = req.timeout;
1069
+ }
1070
+ if (req.responseType) {
1071
+ const responseType = req.responseType.toLowerCase();
1072
+ xhr.responseType = responseType !== 'json' ? responseType : 'text';
1073
+ }
1074
+ const reqBody = req.serializeBody();
1075
+ let headerResponse = null;
1076
+ const partialFromXhr = () => {
1077
+ if (headerResponse !== null) {
1078
+ return headerResponse;
1079
+ }
1080
+ const statusText = xhr.statusText || 'OK';
1081
+ const headers = new HttpHeaders(xhr.getAllResponseHeaders());
1082
+ const url = xhr.responseURL || req.url;
1083
+ headerResponse = new HttpHeaderResponse({
1084
+ headers,
1085
+ status: xhr.status,
1086
+ statusText,
1087
+ url
1088
+ });
1089
+ return headerResponse;
1090
+ };
1091
+ const onLoad = this.maybePropagateTrace(() => {
1092
+ let {
1093
+ headers,
1094
+ status,
1095
+ statusText,
1096
+ url
1097
+ } = partialFromXhr();
1098
+ let body = null;
1099
+ if (status !== HTTP_STATUS_CODE_NO_CONTENT) {
1100
+ body = typeof xhr.response === 'undefined' ? xhr.responseText : xhr.response;
1101
+ }
1102
+ if (status === 0) {
1103
+ status = !!body ? HTTP_STATUS_CODE_OK : 0;
1104
+ }
1105
+ let ok = status >= 200 && status < 300;
1106
+ if (req.responseType === 'json' && typeof body === 'string') {
1107
+ const originalBody = body;
1108
+ body = body.replace(XSSI_PREFIX, '');
1109
+ try {
1110
+ body = body !== '' ? JSON.parse(body) : null;
1111
+ } catch (error) {
1112
+ body = originalBody;
1113
+ if (ok) {
1114
+ ok = false;
1115
+ body = {
1116
+ error,
1117
+ text: body
1118
+ };
1119
+ }
1120
+ }
1121
+ }
1122
+ if (ok) {
1123
+ observer.next(new HttpResponse({
1124
+ body,
1125
+ headers,
1126
+ status,
1127
+ statusText,
1128
+ url: url || undefined
1129
+ }));
1130
+ observer.complete();
1131
+ } else {
1132
+ observer.error(new HttpErrorResponse({
1133
+ error: body,
1134
+ headers,
1135
+ status,
1136
+ statusText,
1137
+ url: url || undefined
1138
+ }));
1139
+ }
1140
+ });
1141
+ const onError = this.maybePropagateTrace(error => {
1142
+ const {
1143
+ url
1144
+ } = partialFromXhr();
1145
+ const res = new HttpErrorResponse({
1146
+ error,
1147
+ status: xhr.status || 0,
1148
+ statusText: xhr.statusText || 'Unknown Error',
1149
+ url: url || undefined
1150
+ });
1151
+ observer.error(res);
1152
+ });
1153
+ let onTimeout = onError;
1154
+ if (req.timeout) {
1155
+ onTimeout = this.maybePropagateTrace(_ => {
1156
+ const {
1157
+ url
1158
+ } = partialFromXhr();
1159
+ const res = new HttpErrorResponse({
1160
+ error: new DOMException('Request timed out', 'TimeoutError'),
1161
+ status: xhr.status || 0,
1162
+ statusText: xhr.statusText || 'Request timeout',
1163
+ url: url || undefined
1164
+ });
1165
+ observer.error(res);
1166
+ });
1167
+ }
1168
+ let sentHeaders = false;
1169
+ const onDownProgress = this.maybePropagateTrace(event => {
1170
+ if (!sentHeaders) {
1171
+ observer.next(partialFromXhr());
1172
+ sentHeaders = true;
1173
+ }
1174
+ let progressEvent = {
1175
+ type: HttpEventType.DownloadProgress,
1176
+ loaded: event.loaded
1177
+ };
1178
+ if (event.lengthComputable) {
1179
+ progressEvent.total = event.total;
1180
+ }
1181
+ if (req.responseType === 'text' && !!xhr.responseText) {
1182
+ progressEvent.partialText = xhr.responseText;
1183
+ }
1184
+ observer.next(progressEvent);
1185
+ });
1186
+ const onUpProgress = this.maybePropagateTrace(event => {
1187
+ let progress = {
1188
+ type: HttpEventType.UploadProgress,
1189
+ loaded: event.loaded
1190
+ };
1191
+ if (event.lengthComputable) {
1192
+ progress.total = event.total;
1193
+ }
1194
+ observer.next(progress);
1195
+ });
1196
+ xhr.addEventListener('load', onLoad);
1197
+ xhr.addEventListener('error', onError);
1198
+ xhr.addEventListener('timeout', onTimeout);
1199
+ xhr.addEventListener('abort', onError);
1200
+ if (req.reportProgress) {
1201
+ xhr.addEventListener('progress', onDownProgress);
1202
+ if (reqBody !== null && xhr.upload) {
1203
+ xhr.upload.addEventListener('progress', onUpProgress);
1204
+ }
1205
+ }
1206
+ xhr.send(reqBody);
1207
+ observer.next({
1208
+ type: HttpEventType.Sent
1209
+ });
1210
+ return () => {
1211
+ xhr.removeEventListener('error', onError);
1212
+ xhr.removeEventListener('abort', onError);
1213
+ xhr.removeEventListener('load', onLoad);
1214
+ xhr.removeEventListener('timeout', onTimeout);
1215
+ if (req.reportProgress) {
1216
+ xhr.removeEventListener('progress', onDownProgress);
1217
+ if (reqBody !== null && xhr.upload) {
1218
+ xhr.upload.removeEventListener('progress', onUpProgress);
1219
+ }
1220
+ }
1221
+ if (xhr.readyState !== xhr.DONE) {
1222
+ xhr.abort();
1223
+ }
1224
+ };
1225
+ });
1226
+ }));
1227
+ }
1228
+ static ɵfac = function HttpXhrBackend_Factory(__ngFactoryType__) {
1229
+ return new (__ngFactoryType__ || HttpXhrBackend)(i0.ɵɵinject(XhrFactory));
1230
+ };
1231
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1232
+ token: HttpXhrBackend,
1233
+ factory: HttpXhrBackend.ɵfac,
1234
+ providedIn: 'root'
1235
+ });
1236
+ }
1237
+ (() => {
1238
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpXhrBackend, [{
1239
+ type: Injectable,
1240
+ args: [{
1241
+ providedIn: 'root'
1242
+ }]
1243
+ }], () => [{
1244
+ type: XhrFactory
1245
+ }], null);
1246
+ })();
1247
+ function interceptorChainEndFn(req, finalHandlerFn) {
1248
+ return finalHandlerFn(req);
1249
+ }
1250
+ function adaptLegacyInterceptorToChain(chainTailFn, interceptor) {
1251
+ return (initialRequest, finalHandlerFn) => interceptor.intercept(initialRequest, {
1252
+ handle: downstreamRequest => chainTailFn(downstreamRequest, finalHandlerFn)
1253
+ });
1254
+ }
1255
+ function chainedInterceptorFn(chainTailFn, interceptorFn, injector) {
1256
+ return (initialRequest, finalHandlerFn) => runInInjectionContext(injector, () => interceptorFn(initialRequest, downstreamRequest => chainTailFn(downstreamRequest, finalHandlerFn)));
1257
+ }
1258
+ const HTTP_INTERCEPTORS = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_INTERCEPTORS' : '');
1259
+ const HTTP_INTERCEPTOR_FNS = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_INTERCEPTOR_FNS' : '', {
1260
+ factory: () => []
1261
+ });
1262
+ const HTTP_ROOT_INTERCEPTOR_FNS = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_ROOT_INTERCEPTOR_FNS' : '');
1263
+ const REQUESTS_CONTRIBUTE_TO_STABILITY = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'REQUESTS_CONTRIBUTE_TO_STABILITY' : '', {
1264
+ factory: () => true
1265
+ });
1266
+ function legacyInterceptorFnFactory() {
1267
+ let chain = null;
1268
+ return (req, handler) => {
1269
+ if (chain === null) {
1270
+ const interceptors = inject(HTTP_INTERCEPTORS, {
1271
+ optional: true
1272
+ }) ?? [];
1273
+ chain = interceptors.reduceRight(adaptLegacyInterceptorToChain, interceptorChainEndFn);
1274
+ }
1275
+ const pendingTasks = inject(PendingTasks);
1276
+ const contributeToStability = inject(REQUESTS_CONTRIBUTE_TO_STABILITY);
1277
+ if (contributeToStability) {
1278
+ const removeTask = pendingTasks.add();
1279
+ return chain(req, handler).pipe(finalize(removeTask));
1280
+ } else {
1281
+ return chain(req, handler);
1282
+ }
1283
+ };
1284
+ }
1285
+ class HttpBackend {
1286
+ static ɵfac = function HttpBackend_Factory(__ngFactoryType__) {
1287
+ return new (__ngFactoryType__ || HttpBackend)();
1288
+ };
1289
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1290
+ token: HttpBackend,
1291
+ factory: function HttpBackend_Factory(__ngFactoryType__) {
1292
+ let __ngConditionalFactory__ = null;
1293
+ if (__ngFactoryType__) {
1294
+ __ngConditionalFactory__ = new (__ngFactoryType__ || HttpBackend)();
1295
+ } else {
1296
+ __ngConditionalFactory__ = i0.ɵɵinject(HttpXhrBackend);
1297
+ }
1298
+ return __ngConditionalFactory__;
1299
+ },
1300
+ providedIn: 'root'
1301
+ });
1302
+ }
1303
+ (() => {
1304
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpBackend, [{
1305
+ type: Injectable,
1306
+ args: [{
1307
+ providedIn: 'root',
1308
+ useExisting: HttpXhrBackend
1309
+ }]
1310
+ }], null, null);
1311
+ })();
1312
+ let fetchBackendWarningDisplayed = false;
1313
+ class HttpInterceptorHandler {
1314
+ backend;
1315
+ injector;
1316
+ chain = null;
1317
+ pendingTasks = inject(PendingTasks);
1318
+ contributeToStability = inject(REQUESTS_CONTRIBUTE_TO_STABILITY);
1319
+ constructor(backend, injector) {
1320
+ this.backend = backend;
1321
+ this.injector = injector;
1322
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !fetchBackendWarningDisplayed) {
1323
+ const isTestingBackend = this.backend.isTestingBackend;
1324
+ if (typeof ngServerMode !== 'undefined' && ngServerMode && !(this.backend instanceof FetchBackend) && !isTestingBackend) {
1325
+ fetchBackendWarningDisplayed = true;
1326
+ injector.get(_Console).warn(_formatRuntimeError(2801, 'Angular detected that `HttpClient` is not configured ' + "to use `fetch` APIs. It's strongly recommended to " + 'enable `fetch` for applications that use Server-Side Rendering ' + 'for better performance and compatibility. ' + 'To enable `fetch`, add the `withFetch()` to the `provideHttpClient()` ' + 'call at the root of the application.'));
1327
+ }
1328
+ }
1329
+ }
1330
+ handle(initialRequest) {
1331
+ if (this.chain === null) {
1332
+ const dedupedInterceptorFns = Array.from(new Set([...this.injector.get(HTTP_INTERCEPTOR_FNS), ...this.injector.get(HTTP_ROOT_INTERCEPTOR_FNS, [])]));
1333
+ this.chain = dedupedInterceptorFns.reduceRight((nextSequencedFn, interceptorFn) => chainedInterceptorFn(nextSequencedFn, interceptorFn, this.injector), interceptorChainEndFn);
1334
+ }
1335
+ if (this.contributeToStability) {
1336
+ const removeTask = this.pendingTasks.add();
1337
+ return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest)).pipe(finalize(removeTask));
1338
+ } else {
1339
+ return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest));
1340
+ }
1341
+ }
1342
+ static ɵfac = function HttpInterceptorHandler_Factory(__ngFactoryType__) {
1343
+ return new (__ngFactoryType__ || HttpInterceptorHandler)(i0.ɵɵinject(HttpBackend), i0.ɵɵinject(i0.EnvironmentInjector));
1344
+ };
1345
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1346
+ token: HttpInterceptorHandler,
1347
+ factory: HttpInterceptorHandler.ɵfac,
1348
+ providedIn: 'root'
1349
+ });
1350
+ }
1351
+ (() => {
1352
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpInterceptorHandler, [{
1353
+ type: Injectable,
1354
+ args: [{
1355
+ providedIn: 'root'
1356
+ }]
1357
+ }], () => [{
1358
+ type: HttpBackend
1359
+ }, {
1360
+ type: i0.EnvironmentInjector
1361
+ }], null);
1362
+ })();
1363
+ class HttpHandler {
1364
+ static ɵfac = function HttpHandler_Factory(__ngFactoryType__) {
1365
+ return new (__ngFactoryType__ || HttpHandler)();
1366
+ };
1367
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1368
+ token: HttpHandler,
1369
+ factory: function HttpHandler_Factory(__ngFactoryType__) {
1370
+ let __ngConditionalFactory__ = null;
1371
+ if (__ngFactoryType__) {
1372
+ __ngConditionalFactory__ = new (__ngFactoryType__ || HttpHandler)();
1373
+ } else {
1374
+ __ngConditionalFactory__ = i0.ɵɵinject(HttpInterceptorHandler);
1375
+ }
1376
+ return __ngConditionalFactory__;
1377
+ },
1378
+ providedIn: 'root'
1379
+ });
1380
+ }
1381
+ (() => {
1382
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpHandler, [{
1383
+ type: Injectable,
1384
+ args: [{
1385
+ providedIn: 'root',
1386
+ useExisting: HttpInterceptorHandler
1387
+ }]
1388
+ }], null, null);
1389
+ })();
1390
+ function addBody(options, body) {
1391
+ return {
1392
+ body,
1393
+ headers: options.headers,
1394
+ context: options.context,
1395
+ observe: options.observe,
1396
+ params: options.params,
1397
+ reportProgress: options.reportProgress,
1398
+ responseType: options.responseType,
1399
+ withCredentials: options.withCredentials,
1400
+ credentials: options.credentials,
1401
+ transferCache: options.transferCache,
1402
+ timeout: options.timeout,
1403
+ keepalive: options.keepalive,
1404
+ priority: options.priority,
1405
+ cache: options.cache,
1406
+ mode: options.mode,
1407
+ redirect: options.redirect,
1408
+ integrity: options.integrity,
1409
+ referrer: options.referrer,
1410
+ referrerPolicy: options.referrerPolicy
1411
+ };
1412
+ }
1413
+ class HttpClient {
1414
+ handler;
1415
+ constructor(handler) {
1416
+ this.handler = handler;
1417
+ }
1418
+ request(first, url, options = {}) {
1419
+ let req;
1420
+ if (first instanceof HttpRequest) {
1421
+ req = first;
1422
+ } else {
1423
+ let headers = undefined;
1424
+ if (options.headers instanceof HttpHeaders) {
1425
+ headers = options.headers;
1426
+ } else {
1427
+ headers = new HttpHeaders(options.headers);
1428
+ }
1429
+ let params = undefined;
1430
+ if (!!options.params) {
1431
+ if (options.params instanceof HttpParams) {
1432
+ params = options.params;
1433
+ } else {
1434
+ params = new HttpParams({
1435
+ fromObject: options.params
1436
+ });
1437
+ }
1438
+ }
1439
+ req = new HttpRequest(first, url, options.body !== undefined ? options.body : null, {
1440
+ headers,
1441
+ context: options.context,
1442
+ params,
1443
+ reportProgress: options.reportProgress,
1444
+ responseType: options.responseType || 'json',
1445
+ withCredentials: options.withCredentials,
1446
+ transferCache: options.transferCache,
1447
+ keepalive: options.keepalive,
1448
+ priority: options.priority,
1449
+ cache: options.cache,
1450
+ mode: options.mode,
1451
+ redirect: options.redirect,
1452
+ credentials: options.credentials,
1453
+ referrer: options.referrer,
1454
+ referrerPolicy: options.referrerPolicy,
1455
+ integrity: options.integrity,
1456
+ timeout: options.timeout
1457
+ });
1458
+ }
1459
+ const events$ = of(req).pipe(concatMap(req => this.handler.handle(req)));
1460
+ if (first instanceof HttpRequest || options.observe === 'events') {
1461
+ return events$;
1462
+ }
1463
+ const res$ = events$.pipe(filter(event => event instanceof HttpResponse));
1464
+ switch (options.observe || 'body') {
1465
+ case 'body':
1466
+ switch (req.responseType) {
1467
+ case 'arraybuffer':
1468
+ return res$.pipe(map(res => {
1469
+ if (res.body !== null && !(res.body instanceof ArrayBuffer)) {
1470
+ throw new _RuntimeError(2806, ngDevMode && 'Response is not an ArrayBuffer.');
1471
+ }
1472
+ return res.body;
1473
+ }));
1474
+ case 'blob':
1475
+ return res$.pipe(map(res => {
1476
+ if (res.body !== null && !(res.body instanceof Blob)) {
1477
+ throw new _RuntimeError(2807, ngDevMode && 'Response is not a Blob.');
1478
+ }
1479
+ return res.body;
1480
+ }));
1481
+ case 'text':
1482
+ return res$.pipe(map(res => {
1483
+ if (res.body !== null && typeof res.body !== 'string') {
1484
+ throw new _RuntimeError(2808, ngDevMode && 'Response is not a string.');
1485
+ }
1486
+ return res.body;
1487
+ }));
1488
+ case 'json':
1489
+ default:
1490
+ return res$.pipe(map(res => res.body));
1491
+ }
1492
+ case 'response':
1493
+ return res$;
1494
+ default:
1495
+ throw new _RuntimeError(2809, ngDevMode && `Unreachable: unhandled observe type ${options.observe}}`);
1496
+ }
1497
+ }
1498
+ delete(url, options = {}) {
1499
+ return this.request('DELETE', url, options);
1500
+ }
1501
+ get(url, options = {}) {
1502
+ return this.request('GET', url, options);
1503
+ }
1504
+ head(url, options = {}) {
1505
+ return this.request('HEAD', url, options);
1506
+ }
1507
+ jsonp(url, callbackParam) {
1508
+ return this.request('JSONP', url, {
1509
+ params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),
1510
+ observe: 'body',
1511
+ responseType: 'json'
1512
+ });
1513
+ }
1514
+ options(url, options = {}) {
1515
+ return this.request('OPTIONS', url, options);
1516
+ }
1517
+ patch(url, body, options = {}) {
1518
+ return this.request('PATCH', url, addBody(options, body));
1519
+ }
1520
+ post(url, body, options = {}) {
1521
+ return this.request('POST', url, addBody(options, body));
1522
+ }
1523
+ put(url, body, options = {}) {
1524
+ return this.request('PUT', url, addBody(options, body));
1525
+ }
1526
+ static ɵfac = function HttpClient_Factory(__ngFactoryType__) {
1527
+ return new (__ngFactoryType__ || HttpClient)(i0.ɵɵinject(HttpHandler));
1528
+ };
1529
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1530
+ token: HttpClient,
1531
+ factory: HttpClient.ɵfac,
1532
+ providedIn: 'root'
1533
+ });
1534
+ }
1535
+ (() => {
1536
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpClient, [{
1537
+ type: Injectable,
1538
+ args: [{
1539
+ providedIn: 'root'
1540
+ }]
1541
+ }], () => [{
1542
+ type: HttpHandler
1543
+ }], null);
1544
+ })();
1545
+ let nextRequestId = 0;
1546
+ let foreignDocument;
1547
+ const JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';
1548
+ const JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';
1549
+ const JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';
1550
+ const JSONP_ERR_HEADERS_NOT_SUPPORTED = 'JSONP requests do not support headers.';
1551
+ class JsonpCallbackContext {}
1552
+ function jsonpCallbackContext() {
1553
+ if (typeof window === 'object') {
1554
+ return window;
1555
+ }
1556
+ return {};
1557
+ }
1558
+ class JsonpClientBackend {
1559
+ callbackMap;
1560
+ document;
1561
+ resolvedPromise = Promise.resolve();
1562
+ constructor(callbackMap, document) {
1563
+ this.callbackMap = callbackMap;
1564
+ this.document = document;
1565
+ }
1566
+ nextCallback() {
1567
+ return `ng_jsonp_callback_${nextRequestId++}`;
1568
+ }
1569
+ handle(req) {
1570
+ if (req.method !== 'JSONP') {
1571
+ throw new _RuntimeError(2810, ngDevMode && JSONP_ERR_WRONG_METHOD);
1572
+ } else if (req.responseType !== 'json') {
1573
+ throw new _RuntimeError(2811, ngDevMode && JSONP_ERR_WRONG_RESPONSE_TYPE);
1574
+ }
1575
+ if (req.headers.keys().length > 0) {
1576
+ throw new _RuntimeError(2812, ngDevMode && JSONP_ERR_HEADERS_NOT_SUPPORTED);
1577
+ }
1578
+ return new Observable(observer => {
1579
+ const callback = this.nextCallback();
1580
+ const url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, `=${callback}$1`);
1581
+ const node = this.document.createElement('script');
1582
+ node.src = url;
1583
+ let body = null;
1584
+ let finished = false;
1585
+ this.callbackMap[callback] = data => {
1586
+ delete this.callbackMap[callback];
1587
+ body = data;
1588
+ finished = true;
1589
+ };
1590
+ const cleanup = () => {
1591
+ node.removeEventListener('load', onLoad);
1592
+ node.removeEventListener('error', onError);
1593
+ node.remove();
1594
+ delete this.callbackMap[callback];
1595
+ };
1596
+ const onLoad = () => {
1597
+ this.resolvedPromise.then(() => {
1598
+ cleanup();
1599
+ if (!finished) {
1600
+ observer.error(new HttpErrorResponse({
1601
+ url,
1602
+ status: 0,
1603
+ statusText: 'JSONP Error',
1604
+ error: new Error(JSONP_ERR_NO_CALLBACK)
1605
+ }));
1606
+ return;
1607
+ }
1608
+ observer.next(new HttpResponse({
1609
+ body,
1610
+ status: HTTP_STATUS_CODE_OK,
1611
+ statusText: 'OK',
1612
+ url
1613
+ }));
1614
+ observer.complete();
1615
+ });
1616
+ };
1617
+ const onError = error => {
1618
+ cleanup();
1619
+ observer.error(new HttpErrorResponse({
1620
+ error,
1621
+ status: 0,
1622
+ statusText: 'JSONP Error',
1623
+ url
1624
+ }));
1625
+ };
1626
+ node.addEventListener('load', onLoad);
1627
+ node.addEventListener('error', onError);
1628
+ this.document.body.appendChild(node);
1629
+ observer.next({
1630
+ type: HttpEventType.Sent
1631
+ });
1632
+ return () => {
1633
+ if (!finished) {
1634
+ this.removeListeners(node);
1635
+ }
1636
+ cleanup();
1637
+ };
1638
+ });
1639
+ }
1640
+ removeListeners(script) {
1641
+ foreignDocument ??= this.document.implementation.createHTMLDocument();
1642
+ foreignDocument.adoptNode(script);
1643
+ }
1644
+ static ɵfac = function JsonpClientBackend_Factory(__ngFactoryType__) {
1645
+ return new (__ngFactoryType__ || JsonpClientBackend)(i0.ɵɵinject(JsonpCallbackContext), i0.ɵɵinject(DOCUMENT));
1646
+ };
1647
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1648
+ token: JsonpClientBackend,
1649
+ factory: JsonpClientBackend.ɵfac
1650
+ });
1651
+ }
1652
+ (() => {
1653
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JsonpClientBackend, [{
1654
+ type: Injectable
1655
+ }], () => [{
1656
+ type: JsonpCallbackContext
1657
+ }, {
1658
+ type: undefined,
1659
+ decorators: [{
1660
+ type: Inject,
1661
+ args: [DOCUMENT]
1662
+ }]
1663
+ }], null);
1664
+ })();
1665
+ function jsonpInterceptorFn(req, next) {
1666
+ if (req.method === 'JSONP') {
1667
+ return inject(JsonpClientBackend).handle(req);
1668
+ }
1669
+ return next(req);
1670
+ }
1671
+ class JsonpInterceptor {
1672
+ injector;
1673
+ constructor(injector) {
1674
+ this.injector = injector;
1675
+ }
1676
+ intercept(initialRequest, next) {
1677
+ return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));
1678
+ }
1679
+ static ɵfac = function JsonpInterceptor_Factory(__ngFactoryType__) {
1680
+ return new (__ngFactoryType__ || JsonpInterceptor)(i0.ɵɵinject(i0.EnvironmentInjector));
1681
+ };
1682
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1683
+ token: JsonpInterceptor,
1684
+ factory: JsonpInterceptor.ɵfac
1685
+ });
1686
+ }
1687
+ (() => {
1688
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JsonpInterceptor, [{
1689
+ type: Injectable
1690
+ }], () => [{
1691
+ type: i0.EnvironmentInjector
1692
+ }], null);
1693
+ })();
1694
+ const XSRF_ENABLED = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_ENABLED' : '', {
1695
+ factory: () => true
1696
+ });
1697
+ const XSRF_DEFAULT_COOKIE_NAME = 'XSRF-TOKEN';
1698
+ const XSRF_COOKIE_NAME = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_COOKIE_NAME' : '', {
1699
+ factory: () => XSRF_DEFAULT_COOKIE_NAME
1700
+ });
1701
+ const XSRF_DEFAULT_HEADER_NAME = 'X-XSRF-TOKEN';
1702
+ const XSRF_HEADER_NAME = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_HEADER_NAME' : '', {
1703
+ factory: () => XSRF_DEFAULT_HEADER_NAME
1704
+ });
1705
+ class HttpXsrfCookieExtractor {
1706
+ cookieName = inject(XSRF_COOKIE_NAME);
1707
+ doc = inject(DOCUMENT);
1708
+ lastCookieString = '';
1709
+ lastToken = null;
1710
+ parseCount = 0;
1711
+ getToken() {
1712
+ if (typeof ngServerMode !== 'undefined' && ngServerMode) {
1713
+ return null;
1714
+ }
1715
+ const cookieString = this.doc.cookie || '';
1716
+ if (cookieString !== this.lastCookieString) {
1717
+ this.parseCount++;
1718
+ this.lastToken = parseCookieValue(cookieString, this.cookieName);
1719
+ this.lastCookieString = cookieString;
1720
+ }
1721
+ return this.lastToken;
1722
+ }
1723
+ static ɵfac = function HttpXsrfCookieExtractor_Factory(__ngFactoryType__) {
1724
+ return new (__ngFactoryType__ || HttpXsrfCookieExtractor)();
1725
+ };
1726
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1727
+ token: HttpXsrfCookieExtractor,
1728
+ factory: HttpXsrfCookieExtractor.ɵfac,
1729
+ providedIn: 'root'
1730
+ });
1731
+ }
1732
+ (() => {
1733
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpXsrfCookieExtractor, [{
1734
+ type: Injectable,
1735
+ args: [{
1736
+ providedIn: 'root'
1737
+ }]
1738
+ }], null, null);
1739
+ })();
1740
+ class HttpXsrfTokenExtractor {
1741
+ static ɵfac = function HttpXsrfTokenExtractor_Factory(__ngFactoryType__) {
1742
+ return new (__ngFactoryType__ || HttpXsrfTokenExtractor)();
1743
+ };
1744
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1745
+ token: HttpXsrfTokenExtractor,
1746
+ factory: function HttpXsrfTokenExtractor_Factory(__ngFactoryType__) {
1747
+ let __ngConditionalFactory__ = null;
1748
+ if (__ngFactoryType__) {
1749
+ __ngConditionalFactory__ = new (__ngFactoryType__ || HttpXsrfTokenExtractor)();
1750
+ } else {
1751
+ __ngConditionalFactory__ = i0.ɵɵinject(HttpXsrfCookieExtractor);
1752
+ }
1753
+ return __ngConditionalFactory__;
1754
+ },
1755
+ providedIn: 'root'
1756
+ });
1757
+ }
1758
+ (() => {
1759
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpXsrfTokenExtractor, [{
1760
+ type: Injectable,
1761
+ args: [{
1762
+ providedIn: 'root',
1763
+ useExisting: HttpXsrfCookieExtractor
1764
+ }]
1765
+ }], null, null);
1766
+ })();
1767
+ function xsrfInterceptorFn(req, next) {
1768
+ if (!inject(XSRF_ENABLED) || req.method === 'GET' || req.method === 'HEAD') {
1769
+ return next(req);
1770
+ }
1771
+ try {
1772
+ const locationHref = inject(PlatformLocation).href;
1773
+ const {
1774
+ origin: locationOrigin
1775
+ } = new URL(locationHref);
1776
+ const {
1777
+ origin: requestOrigin
1778
+ } = new URL(req.url, locationOrigin);
1779
+ if (locationOrigin !== requestOrigin) {
1780
+ return next(req);
1781
+ }
1782
+ } catch {
1783
+ return next(req);
1784
+ }
1785
+ const token = inject(HttpXsrfTokenExtractor).getToken();
1786
+ const headerName = inject(XSRF_HEADER_NAME);
1787
+ if (token != null && !req.headers.has(headerName)) {
1788
+ req = req.clone({
1789
+ headers: req.headers.set(headerName, token)
1790
+ });
1791
+ }
1792
+ return next(req);
1793
+ }
1794
+ class HttpXsrfInterceptor {
1795
+ injector = inject(EnvironmentInjector);
1796
+ intercept(initialRequest, next) {
1797
+ return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));
1798
+ }
1799
+ static ɵfac = function HttpXsrfInterceptor_Factory(__ngFactoryType__) {
1800
+ return new (__ngFactoryType__ || HttpXsrfInterceptor)();
1801
+ };
1802
+ static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1803
+ token: HttpXsrfInterceptor,
1804
+ factory: HttpXsrfInterceptor.ɵfac
1805
+ });
1806
+ }
1807
+ (() => {
1808
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpXsrfInterceptor, [{
1809
+ type: Injectable
1810
+ }], null, null);
1811
+ })();
1812
+ var HttpFeatureKind;
1813
+ (function (HttpFeatureKind) {
1814
+ HttpFeatureKind[HttpFeatureKind["Interceptors"] = 0] = "Interceptors";
1815
+ HttpFeatureKind[HttpFeatureKind["LegacyInterceptors"] = 1] = "LegacyInterceptors";
1816
+ HttpFeatureKind[HttpFeatureKind["CustomXsrfConfiguration"] = 2] = "CustomXsrfConfiguration";
1817
+ HttpFeatureKind[HttpFeatureKind["NoXsrfProtection"] = 3] = "NoXsrfProtection";
1818
+ HttpFeatureKind[HttpFeatureKind["JsonpSupport"] = 4] = "JsonpSupport";
1819
+ HttpFeatureKind[HttpFeatureKind["RequestsMadeViaParent"] = 5] = "RequestsMadeViaParent";
1820
+ HttpFeatureKind[HttpFeatureKind["Fetch"] = 6] = "Fetch";
1821
+ })(HttpFeatureKind || (HttpFeatureKind = {}));
1822
+ function makeHttpFeature(kind, providers) {
1823
+ return {
1824
+ ɵkind: kind,
1825
+ ɵproviders: providers
1826
+ };
1827
+ }
1828
+ function provideHttpClient(...features) {
1829
+ if (ngDevMode) {
1830
+ const featureKinds = new Set(features.map(f => f.ɵkind));
1831
+ if (featureKinds.has(HttpFeatureKind.NoXsrfProtection) && featureKinds.has(HttpFeatureKind.CustomXsrfConfiguration)) {
1832
+ throw new Error(ngDevMode ? `Configuration error: found both withXsrfConfiguration() and withNoXsrfProtection() in the same call to provideHttpClient(), which is a contradiction.` : '');
1833
+ }
1834
+ }
1835
+ const providers = [HttpClient, HttpInterceptorHandler, {
1836
+ provide: HttpHandler,
1837
+ useExisting: HttpInterceptorHandler
1838
+ }, {
1839
+ provide: HttpBackend,
1840
+ useFactory: () => {
1841
+ return inject(FETCH_BACKEND, {
1842
+ optional: true
1843
+ }) ?? inject(HttpXhrBackend);
1844
+ }
1845
+ }, {
1846
+ provide: HTTP_INTERCEPTOR_FNS,
1847
+ useValue: xsrfInterceptorFn,
1848
+ multi: true
1849
+ }];
1850
+ for (const feature of features) {
1851
+ providers.push(...feature.ɵproviders);
1852
+ }
1853
+ return makeEnvironmentProviders(providers);
1854
+ }
1855
+ function withInterceptors(interceptorFns) {
1856
+ return makeHttpFeature(HttpFeatureKind.Interceptors, interceptorFns.map(interceptorFn => {
1857
+ return {
1858
+ provide: HTTP_INTERCEPTOR_FNS,
1859
+ useValue: interceptorFn,
1860
+ multi: true
1861
+ };
1862
+ }));
1863
+ }
1864
+ const LEGACY_INTERCEPTOR_FN = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'LEGACY_INTERCEPTOR_FN' : '');
1865
+ function withInterceptorsFromDi() {
1866
+ return makeHttpFeature(HttpFeatureKind.LegacyInterceptors, [{
1867
+ provide: LEGACY_INTERCEPTOR_FN,
1868
+ useFactory: legacyInterceptorFnFactory
1869
+ }, {
1870
+ provide: HTTP_INTERCEPTOR_FNS,
1871
+ useExisting: LEGACY_INTERCEPTOR_FN,
1872
+ multi: true
1873
+ }]);
1874
+ }
1875
+ function withXsrfConfiguration({
1876
+ cookieName,
1877
+ headerName
1878
+ }) {
1879
+ const providers = [];
1880
+ if (cookieName !== undefined) {
1881
+ providers.push({
1882
+ provide: XSRF_COOKIE_NAME,
1883
+ useValue: cookieName
1884
+ });
1885
+ }
1886
+ if (headerName !== undefined) {
1887
+ providers.push({
1888
+ provide: XSRF_HEADER_NAME,
1889
+ useValue: headerName
1890
+ });
1891
+ }
1892
+ return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers);
1893
+ }
1894
+ function withNoXsrfProtection() {
1895
+ return makeHttpFeature(HttpFeatureKind.NoXsrfProtection, [{
1896
+ provide: XSRF_ENABLED,
1897
+ useValue: false
1898
+ }]);
1899
+ }
1900
+ function withJsonpSupport() {
1901
+ return makeHttpFeature(HttpFeatureKind.JsonpSupport, [JsonpClientBackend, {
1902
+ provide: JsonpCallbackContext,
1903
+ useFactory: jsonpCallbackContext
1904
+ }, {
1905
+ provide: HTTP_INTERCEPTOR_FNS,
1906
+ useValue: jsonpInterceptorFn,
1907
+ multi: true
1908
+ }]);
1909
+ }
1910
+ function withRequestsMadeViaParent() {
1911
+ return makeHttpFeature(HttpFeatureKind.RequestsMadeViaParent, [{
1912
+ provide: HttpBackend,
1913
+ useFactory: () => {
1914
+ const handlerFromParent = inject(HttpHandler, {
1915
+ skipSelf: true,
1916
+ optional: true
1917
+ });
1918
+ if (ngDevMode && handlerFromParent === null) {
1919
+ throw new Error('withRequestsMadeViaParent() can only be used when the parent injector also configures HttpClient');
1920
+ }
1921
+ return handlerFromParent;
1922
+ }
1923
+ }]);
1924
+ }
1925
+ function withFetch() {
1926
+ return makeHttpFeature(HttpFeatureKind.Fetch, [FetchBackend, {
1927
+ provide: FETCH_BACKEND,
1928
+ useExisting: FetchBackend
1929
+ }, {
1930
+ provide: HttpBackend,
1931
+ useExisting: FetchBackend
1932
+ }]);
1933
+ }
1934
+ class HttpClientXsrfModule {
1935
+ static disable() {
1936
+ return {
1937
+ ngModule: HttpClientXsrfModule,
1938
+ providers: [withNoXsrfProtection().ɵproviders]
1939
+ };
1940
+ }
1941
+ static withOptions(options = {}) {
1942
+ return {
1943
+ ngModule: HttpClientXsrfModule,
1944
+ providers: withXsrfConfiguration(options).ɵproviders
1945
+ };
1946
+ }
1947
+ static ɵfac = function HttpClientXsrfModule_Factory(__ngFactoryType__) {
1948
+ return new (__ngFactoryType__ || HttpClientXsrfModule)();
1949
+ };
1950
+ static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({
1951
+ type: HttpClientXsrfModule
1952
+ });
1953
+ static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({
1954
+ providers: [HttpXsrfInterceptor, {
1955
+ provide: HTTP_INTERCEPTORS,
1956
+ useExisting: HttpXsrfInterceptor,
1957
+ multi: true
1958
+ }, {
1959
+ provide: HttpXsrfTokenExtractor,
1960
+ useClass: HttpXsrfCookieExtractor
1961
+ }, withXsrfConfiguration({
1962
+ cookieName: XSRF_DEFAULT_COOKIE_NAME,
1963
+ headerName: XSRF_DEFAULT_HEADER_NAME
1964
+ }).ɵproviders, {
1965
+ provide: XSRF_ENABLED,
1966
+ useValue: true
1967
+ }]
1968
+ });
1969
+ }
1970
+ (() => {
1971
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpClientXsrfModule, [{
1972
+ type: NgModule,
1973
+ args: [{
1974
+ providers: [HttpXsrfInterceptor, {
1975
+ provide: HTTP_INTERCEPTORS,
1976
+ useExisting: HttpXsrfInterceptor,
1977
+ multi: true
1978
+ }, {
1979
+ provide: HttpXsrfTokenExtractor,
1980
+ useClass: HttpXsrfCookieExtractor
1981
+ }, withXsrfConfiguration({
1982
+ cookieName: XSRF_DEFAULT_COOKIE_NAME,
1983
+ headerName: XSRF_DEFAULT_HEADER_NAME
1984
+ }).ɵproviders, {
1985
+ provide: XSRF_ENABLED,
1986
+ useValue: true
1987
+ }]
1988
+ }]
1989
+ }], null, null);
1990
+ })();
1991
+ class HttpClientModule {
1992
+ static ɵfac = function HttpClientModule_Factory(__ngFactoryType__) {
1993
+ return new (__ngFactoryType__ || HttpClientModule)();
1994
+ };
1995
+ static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({
1996
+ type: HttpClientModule
1997
+ });
1998
+ static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({
1999
+ providers: [provideHttpClient(withInterceptorsFromDi())]
2000
+ });
2001
+ }
2002
+ (() => {
2003
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpClientModule, [{
2004
+ type: NgModule,
2005
+ args: [{
2006
+ providers: [provideHttpClient(withInterceptorsFromDi())]
2007
+ }]
2008
+ }], null, null);
2009
+ })();
2010
+ class HttpClientJsonpModule {
2011
+ static ɵfac = function HttpClientJsonpModule_Factory(__ngFactoryType__) {
2012
+ return new (__ngFactoryType__ || HttpClientJsonpModule)();
2013
+ };
2014
+ static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({
2015
+ type: HttpClientJsonpModule
2016
+ });
2017
+ static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({
2018
+ providers: [withJsonpSupport().ɵproviders]
2019
+ });
2020
+ }
2021
+ (() => {
2022
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpClientJsonpModule, [{
2023
+ type: NgModule,
2024
+ args: [{
2025
+ providers: [withJsonpSupport().ɵproviders]
2026
+ }]
2027
+ }], null, null);
2028
+ })();
2029
+ export { FetchBackend, HTTP_INTERCEPTORS, HTTP_ROOT_INTERCEPTOR_FNS, HttpBackend, HttpClient, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpErrorResponse, HttpEventType, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpHeaders, HttpInterceptorHandler, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpStatusCode, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, REQUESTS_CONTRIBUTE_TO_STABILITY, provideHttpClient, withFetch, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration };