{"version":3,"file":"http.js","sources":["../../../packages/common/esm5/http/src/backend.js","../../../packages/common/esm5/http/src/headers.js","../../../packages/common/esm5/http/src/params.js","../../../packages/common/esm5/http/src/request.js","../../../packages/common/esm5/http/src/response.js","../../../packages/common/esm5/http/src/client.js","../../../packages/common/esm5/http/src/interceptor.js","../../../packages/common/esm5/http/src/jsonp.js","../../../packages/common/esm5/http/src/xhr.js","../../../packages/common/esm5/http/src/xsrf.js","../../../packages/common/esm5/http/src/module.js","../../../packages/common/esm5/http/public_api.js","../../../packages/common/esm5/http/http.js"],"sourcesContent":["/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a\n * `HttpResponse`.\n *\n * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the\n * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the\n * `HttpBackend`.\n *\n * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.\n *\n * \\@stable\n * @abstract\n */\nvar /**\n * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a\n * `HttpResponse`.\n *\n * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the\n * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the\n * `HttpBackend`.\n *\n * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.\n *\n * \\@stable\n * @abstract\n */\nHttpHandler = /** @class */ (function () {\n function HttpHandler() {\n }\n return HttpHandler;\n}());\n/**\n * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a\n * `HttpResponse`.\n *\n * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the\n * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the\n * `HttpBackend`.\n *\n * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.\n *\n * \\@stable\n * @abstract\n */\nexport { HttpHandler };\nfunction HttpHandler_tsickle_Closure_declarations() {\n /**\n * @abstract\n * @param {?} req\n * @return {?}\n */\n HttpHandler.prototype.handle = function (req) { };\n}\n/**\n * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.\n *\n * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.\n *\n * When injected, `HttpBackend` dispatches requests directly to the backend, without going\n * through the interceptor chain.\n *\n * \\@stable\n * @abstract\n */\nvar /**\n * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.\n *\n * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.\n *\n * When injected, `HttpBackend` dispatches requests directly to the backend, without going\n * through the interceptor chain.\n *\n * \\@stable\n * @abstract\n */\nHttpBackend = /** @class */ (function () {\n function HttpBackend() {\n }\n return HttpBackend;\n}());\n/**\n * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.\n *\n * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.\n *\n * When injected, `HttpBackend` dispatches requests directly to the backend, without going\n * through the interceptor chain.\n *\n * \\@stable\n * @abstract\n */\nexport { HttpBackend };\nfunction HttpBackend_tsickle_Closure_declarations() {\n /**\n * @abstract\n * @param {?} req\n * @return {?}\n */\n HttpBackend.prototype.handle = function (req) { };\n}\n//# sourceMappingURL=backend.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @record\n */\nfunction Update() { }\nfunction Update_tsickle_Closure_declarations() {\n /** @type {?} */\n Update.prototype.name;\n /** @type {?|undefined} */\n Update.prototype.value;\n /** @type {?} */\n Update.prototype.op;\n}\n/**\n * Immutable set of Http headers, with lazy parsing.\n * \\@stable\n */\nvar /**\n * Immutable set of Http headers, with lazy parsing.\n * \\@stable\n */\nHttpHeaders = /** @class */ (function () {\n function HttpHeaders(headers) {\n var _this = this;\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n this.normalizedNames = new Map();\n /**\n * Queued updates to be materialized the next initialization.\n */\n this.lazyUpdate = null;\n if (!headers) {\n this.headers = new Map();\n }\n else if (typeof headers === 'string') {\n this.lazyInit = function () {\n _this.headers = new Map();\n headers.split('\\n').forEach(function (line) {\n var /** @type {?} */ index = line.indexOf(':');\n if (index > 0) {\n var /** @type {?} */ name_1 = line.slice(0, index);\n var /** @type {?} */ key = name_1.toLowerCase();\n var /** @type {?} */ value = line.slice(index + 1).trim();\n _this.maybeSetNormalizedName(name_1, key);\n if (_this.headers.has(key)) {\n /** @type {?} */ ((_this.headers.get(key))).push(value);\n }\n else {\n _this.headers.set(key, [value]);\n }\n }\n });\n };\n }\n else {\n this.lazyInit = function () {\n _this.headers = new Map();\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = headers[name];\n var /** @type {?} */ key = name.toLowerCase();\n if (typeof values === 'string') {\n values = [values];\n }\n if (values.length > 0) {\n _this.headers.set(key, values);\n _this.maybeSetNormalizedName(name, key);\n }\n });\n };\n }\n }\n /**\n * Checks for existence of header by given name.\n */\n /**\n * Checks for existence of header by given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.has = /**\n * Checks for existence of header by given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n };\n /**\n * Returns first header that matches given name.\n */\n /**\n * Returns first header that matches given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.get = /**\n * Returns first header that matches given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n var /** @type {?} */ values = this.headers.get(name.toLowerCase());\n return values && values.length > 0 ? values[0] : null;\n };\n /**\n * Returns the names of the headers\n */\n /**\n * Returns the names of the headers\n * @return {?}\n */\n HttpHeaders.prototype.keys = /**\n * Returns the names of the headers\n * @return {?}\n */\n function () {\n this.init();\n return Array.from(this.normalizedNames.values());\n };\n /**\n * Returns list of header values for a given name.\n */\n /**\n * Returns list of header values for a given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.getAll = /**\n * Returns list of header values for a given name.\n * @param {?} name\n * @return {?}\n */\n function (name) {\n this.init();\n return this.headers.get(name.toLowerCase()) || null;\n };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n HttpHeaders.prototype.append = /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 'a' });\n };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n HttpHeaders.prototype.set = /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 's' });\n };\n /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n HttpHeaders.prototype.delete = /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n function (name, value) {\n return this.clone({ name: name, value: value, op: 'd' });\n };\n /**\n * @param {?} name\n * @param {?} lcName\n * @return {?}\n */\n HttpHeaders.prototype.maybeSetNormalizedName = /**\n * @param {?} name\n * @param {?} lcName\n * @return {?}\n */\n function (name, lcName) {\n if (!this.normalizedNames.has(lcName)) {\n this.normalizedNames.set(lcName, name);\n }\n };\n /**\n * @return {?}\n */\n HttpHeaders.prototype.init = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (!!this.lazyInit) {\n if (this.lazyInit instanceof HttpHeaders) {\n this.copyFrom(this.lazyInit);\n }\n else {\n this.lazyInit();\n }\n this.lazyInit = null;\n if (!!this.lazyUpdate) {\n this.lazyUpdate.forEach(function (update) { return _this.applyUpdate(update); });\n this.lazyUpdate = null;\n }\n }\n };\n /**\n * @param {?} other\n * @return {?}\n */\n HttpHeaders.prototype.copyFrom = /**\n * @param {?} other\n * @return {?}\n */\n function (other) {\n var _this = this;\n other.init();\n Array.from(other.headers.keys()).forEach(function (key) {\n _this.headers.set(key, /** @type {?} */ ((other.headers.get(key))));\n _this.normalizedNames.set(key, /** @type {?} */ ((other.normalizedNames.get(key))));\n });\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpHeaders.prototype.clone = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ clone = new HttpHeaders();\n clone.lazyInit =\n (!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this;\n clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);\n return clone;\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpHeaders.prototype.applyUpdate = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ key = update.name.toLowerCase();\n switch (update.op) {\n case 'a':\n case 's':\n var /** @type {?} */ value = /** @type {?} */ ((update.value));\n if (typeof value === 'string') {\n value = [value];\n }\n if (value.length === 0) {\n return;\n }\n this.maybeSetNormalizedName(update.name, key);\n var /** @type {?} */ base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];\n base.push.apply(base, value);\n this.headers.set(key, base);\n break;\n case 'd':\n var /** @type {?} */ toDelete_1 = /** @type {?} */ (update.value);\n if (!toDelete_1) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n var /** @type {?} */ existing = this.headers.get(key);\n if (!existing) {\n return;\n }\n existing = existing.filter(function (value) { return toDelete_1.indexOf(value) === -1; });\n if (existing.length === 0) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n this.headers.set(key, existing);\n }\n }\n break;\n }\n };\n /**\n * @internal\n */\n /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n HttpHeaders.prototype.forEach = /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n function (fn) {\n var _this = this;\n this.init();\n Array.from(this.normalizedNames.keys())\n .forEach(function (key) { return fn(/** @type {?} */ ((_this.normalizedNames.get(key))), /** @type {?} */ ((_this.headers.get(key)))); });\n };\n return HttpHeaders;\n}());\n/**\n * Immutable set of Http headers, with lazy parsing.\n * \\@stable\n */\nexport { HttpHeaders };\nfunction HttpHeaders_tsickle_Closure_declarations() {\n /**\n * Internal map of lowercase header names to values.\n * @type {?}\n */\n HttpHeaders.prototype.headers;\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n * @type {?}\n */\n HttpHeaders.prototype.normalizedNames;\n /**\n * Complete the lazy initialization of this object (needed before reading).\n * @type {?}\n */\n HttpHeaders.prototype.lazyInit;\n /**\n * Queued updates to be materialized the next initialization.\n * @type {?}\n */\n HttpHeaders.prototype.lazyUpdate;\n}\n//# sourceMappingURL=headers.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A codec for encoding and decoding parameters in URLs.\n *\n * Used by `HttpParams`.\n *\n * \\@stable\n *\n * @record\n */\nexport function HttpParameterCodec() { }\nfunction HttpParameterCodec_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpParameterCodec.prototype.encodeKey;\n /** @type {?} */\n HttpParameterCodec.prototype.encodeValue;\n /** @type {?} */\n HttpParameterCodec.prototype.decodeKey;\n /** @type {?} */\n HttpParameterCodec.prototype.decodeValue;\n}\n/**\n * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to\n * serialize and parse URL parameter keys and values.\n *\n * \\@stable\n */\nvar /**\n * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to\n * serialize and parse URL parameter keys and values.\n *\n * \\@stable\n */\nHttpUrlEncodingCodec = /** @class */ (function () {\n function HttpUrlEncodingCodec() {\n }\n /**\n * @param {?} k\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.encodeKey = /**\n * @param {?} k\n * @return {?}\n */\n function (k) { return standardEncoding(k); };\n /**\n * @param {?} v\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.encodeValue = /**\n * @param {?} v\n * @return {?}\n */\n function (v) { return standardEncoding(v); };\n /**\n * @param {?} k\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.decodeKey = /**\n * @param {?} k\n * @return {?}\n */\n function (k) { return decodeURIComponent(k); };\n /**\n * @param {?} v\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.decodeValue = /**\n * @param {?} v\n * @return {?}\n */\n function (v) { return decodeURIComponent(v); };\n return HttpUrlEncodingCodec;\n}());\n/**\n * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to\n * serialize and parse URL parameter keys and values.\n *\n * \\@stable\n */\nexport { HttpUrlEncodingCodec };\n/**\n * @param {?} rawParams\n * @param {?} codec\n * @return {?}\n */\nfunction paramParser(rawParams, codec) {\n var /** @type {?} */ map = new Map();\n if (rawParams.length > 0) {\n var /** @type {?} */ params = rawParams.split('&');\n params.forEach(function (param) {\n var /** @type {?} */ eqIdx = param.indexOf('=');\n var _a = eqIdx == -1 ?\n [codec.decodeKey(param), ''] :\n [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))], key = _a[0], val = _a[1];\n var /** @type {?} */ list = map.get(key) || [];\n list.push(val);\n map.set(key, list);\n });\n }\n return map;\n}\n/**\n * @param {?} v\n * @return {?}\n */\nfunction standardEncoding(v) {\n return encodeURIComponent(v)\n .replace(/%40/gi, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/gi, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';')\n .replace(/%2B/gi, '+')\n .replace(/%3D/gi, '=')\n .replace(/%3F/gi, '?')\n .replace(/%2F/gi, '/');\n}\n/**\n * @record\n */\nfunction Update() { }\nfunction Update_tsickle_Closure_declarations() {\n /** @type {?} */\n Update.prototype.param;\n /** @type {?|undefined} */\n Update.prototype.value;\n /** @type {?} */\n Update.prototype.op;\n}\n/**\n * An HTTP request/response body that represents serialized parameters,\n * per the MIME type `application/x-www-form-urlencoded`.\n *\n * This class is immutable - all mutation operations return a new instance.\n *\n * \\@stable\n */\nvar /**\n * An HTTP request/response body that represents serialized parameters,\n * per the MIME type `application/x-www-form-urlencoded`.\n *\n * This class is immutable - all mutation operations return a new instance.\n *\n * \\@stable\n */\nHttpParams = /** @class */ (function () {\n function HttpParams(options) {\n if (options === void 0) { options = /** @type {?} */ ({}); }\n var _this = this;\n this.updates = null;\n this.cloneFrom = null;\n this.encoder = options.encoder || new HttpUrlEncodingCodec();\n if (!!options.fromString) {\n if (!!options.fromObject) {\n throw new Error(\"Cannot specify both fromString and fromObject.\");\n }\n this.map = paramParser(options.fromString, this.encoder);\n }\n else if (!!options.fromObject) {\n this.map = new Map();\n Object.keys(options.fromObject).forEach(function (key) {\n var /** @type {?} */ value = (/** @type {?} */ (options.fromObject))[key]; /** @type {?} */\n ((_this.map)).set(key, Array.isArray(value) ? value : [value]);\n });\n }\n else {\n this.map = null;\n }\n }\n /**\n * Check whether the body has one or more values for the given parameter name.\n */\n /**\n * Check whether the body has one or more values for the given parameter name.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.has = /**\n * Check whether the body has one or more values for the given parameter name.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n return /** @type {?} */ ((this.map)).has(param);\n };\n /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n */\n /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.get = /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n var /** @type {?} */ res = /** @type {?} */ ((this.map)).get(param);\n return !!res ? res[0] : null;\n };\n /**\n * Get all values for the given parameter name, or `null` if it's not present.\n */\n /**\n * Get all values for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.getAll = /**\n * Get all values for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n function (param) {\n this.init();\n return /** @type {?} */ ((this.map)).get(param) || null;\n };\n /**\n * Get all the parameter names for this body.\n */\n /**\n * Get all the parameter names for this body.\n * @return {?}\n */\n HttpParams.prototype.keys = /**\n * Get all the parameter names for this body.\n * @return {?}\n */\n function () {\n this.init();\n return Array.from(/** @type {?} */ ((this.map)).keys());\n };\n /**\n * Construct a new body with an appended value for the given parameter name.\n */\n /**\n * Construct a new body with an appended value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n HttpParams.prototype.append = /**\n * Construct a new body with an appended value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 'a' }); };\n /**\n * Construct a new body with a new value for the given parameter name.\n */\n /**\n * Construct a new body with a new value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n HttpParams.prototype.set = /**\n * Construct a new body with a new value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 's' }); };\n /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n */\n /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n * @param {?} param\n * @param {?=} value\n * @return {?}\n */\n HttpParams.prototype.delete = /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n * @param {?} param\n * @param {?=} value\n * @return {?}\n */\n function (param, value) { return this.clone({ param: param, value: value, op: 'd' }); };\n /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n */\n /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n * @return {?}\n */\n HttpParams.prototype.toString = /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n * @return {?}\n */\n function () {\n var _this = this;\n this.init();\n return this.keys()\n .map(function (key) {\n var /** @type {?} */ eKey = _this.encoder.encodeKey(key);\n return /** @type {?} */ ((/** @type {?} */ ((_this.map)).get(key))).map(function (value) { return eKey + '=' + _this.encoder.encodeValue(value); }).join('&');\n })\n .join('&');\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpParams.prototype.clone = /**\n * @param {?} update\n * @return {?}\n */\n function (update) {\n var /** @type {?} */ clone = new HttpParams({ encoder: this.encoder });\n clone.cloneFrom = this.cloneFrom || this;\n clone.updates = (this.updates || []).concat([update]);\n return clone;\n };\n /**\n * @return {?}\n */\n HttpParams.prototype.init = /**\n * @return {?}\n */\n function () {\n var _this = this;\n if (this.map === null) {\n this.map = new Map();\n }\n if (this.cloneFrom !== null) {\n this.cloneFrom.init();\n this.cloneFrom.keys().forEach(function (key) { return ((_this.map)).set(key, /** @type {?} */ ((/** @type {?} */ ((/** @type {?} */ ((_this.cloneFrom)).map)).get(key)))); }); /** @type {?} */\n ((this.updates)).forEach(function (update) {\n switch (update.op) {\n case 'a':\n case 's':\n var /** @type {?} */ base = (update.op === 'a' ? /** @type {?} */ ((_this.map)).get(update.param) : undefined) || [];\n base.push(/** @type {?} */ ((update.value))); /** @type {?} */\n ((_this.map)).set(update.param, base);\n break;\n case 'd':\n if (update.value !== undefined) {\n var /** @type {?} */ base_1 = /** @type {?} */ ((_this.map)).get(update.param) || [];\n var /** @type {?} */ idx = base_1.indexOf(update.value);\n if (idx !== -1) {\n base_1.splice(idx, 1);\n }\n if (base_1.length > 0) {\n /** @type {?} */ ((_this.map)).set(update.param, base_1);\n }\n else {\n /** @type {?} */ ((_this.map)).delete(update.param);\n }\n }\n else {\n /** @type {?} */ ((_this.map)).delete(update.param);\n break;\n }\n }\n });\n this.cloneFrom = null;\n }\n };\n return HttpParams;\n}());\n/**\n * An HTTP request/response body that represents serialized parameters,\n * per the MIME type `application/x-www-form-urlencoded`.\n *\n * This class is immutable - all mutation operations return a new instance.\n *\n * \\@stable\n */\nexport { HttpParams };\nfunction HttpParams_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpParams.prototype.map;\n /** @type {?} */\n HttpParams.prototype.encoder;\n /** @type {?} */\n HttpParams.prototype.updates;\n /** @type {?} */\n HttpParams.prototype.cloneFrom;\n}\n//# sourceMappingURL=params.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { HttpHeaders } from './headers';\nimport { HttpParams } from './params';\n/**\n * Construction interface for `HttpRequest`s.\n *\n * All values are optional and will override default values if provided.\n * @record\n */\nfunction HttpRequestInit() { }\nfunction HttpRequestInit_tsickle_Closure_declarations() {\n /** @type {?|undefined} */\n HttpRequestInit.prototype.headers;\n /** @type {?|undefined} */\n HttpRequestInit.prototype.reportProgress;\n /** @type {?|undefined} */\n HttpRequestInit.prototype.params;\n /** @type {?|undefined} */\n HttpRequestInit.prototype.responseType;\n /** @type {?|undefined} */\n HttpRequestInit.prototype.withCredentials;\n}\n/**\n * Determine whether the given HTTP method may include a body.\n * @param {?} method\n * @return {?}\n */\nfunction mightHaveBody(method) {\n switch (method) {\n case 'DELETE':\n case 'GET':\n case 'HEAD':\n case 'OPTIONS':\n case 'JSONP':\n return false;\n default:\n return true;\n }\n}\n/**\n * Safely assert whether the given value is an ArrayBuffer.\n *\n * In some execution environments ArrayBuffer is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isArrayBuffer(value) {\n return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;\n}\n/**\n * Safely assert whether the given value is a Blob.\n *\n * In some execution environments Blob is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}\n/**\n * Safely assert whether the given value is a FormData instance.\n *\n * In some execution environments FormData is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isFormData(value) {\n return typeof FormData !== 'undefined' && value instanceof FormData;\n}\n/**\n * An outgoing HTTP request with an optional typed body.\n *\n * `HttpRequest` represents an outgoing request, including URL, method,\n * headers, body, and other request configuration options. Instances should be\n * assumed to be immutable. To modify a `HttpRequest`, the `clone`\n * method should be used.\n *\n * \\@stable\n * @template T\n */\nvar /**\n * An outgoing HTTP request with an optional typed body.\n *\n * `HttpRequest` represents an outgoing request, including URL, method,\n * headers, body, and other request configuration options. Instances should be\n * assumed to be immutable. To modify a `HttpRequest`, the `clone`\n * method should be used.\n *\n * \\@stable\n * @template T\n */\nHttpRequest = /** @class */ (function () {\n function HttpRequest(method, url, third, fourth) {\n this.url = url;\n /**\n * The request body, or `null` if one isn't set.\n *\n * Bodies are not enforced to be immutable, as they can include a reference to any\n * user-defined data type. However, interceptors should take care to preserve\n * idempotence by treating them as such.\n */\n this.body = null;\n /**\n * Whether this request should be made in a way that exposes progress events.\n *\n * Progress events are expensive (change detection runs on each event) and so\n * they should only be requested if the consumer intends to monitor them.\n */\n this.reportProgress = false;\n /**\n * Whether this request should be sent with outgoing credentials (cookies).\n */\n this.withCredentials = false;\n /**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n */\n this.responseType = 'json';\n this.method = method.toUpperCase();\n // Next, need to figure out which argument holds the HttpRequestInit\n // options, if any.\n var /** @type {?} */ options;\n // Check whether a body argument is expected. The only valid way to omit\n // the body argument is to use a known no-body method like GET.\n if (mightHaveBody(this.method) || !!fourth) {\n // Body is the third argument, options are the fourth.\n this.body = (third !== undefined) ? /** @type {?} */ (third) : null;\n options = fourth;\n }\n else {\n // No body required, options are the third argument. The body stays null.\n options = /** @type {?} */ (third);\n }\n // If options have been passed, interpret them.\n if (options) {\n // Normalize reportProgress and withCredentials.\n this.reportProgress = !!options.reportProgress;\n this.withCredentials = !!options.withCredentials;\n // Override default response type of 'json' if one is provided.\n if (!!options.responseType) {\n this.responseType = options.responseType;\n }\n // Override headers if they're provided.\n if (!!options.headers) {\n this.headers = options.headers;\n }\n if (!!options.params) {\n this.params = options.params;\n }\n }\n // If no headers have been passed in, construct a new HttpHeaders instance.\n if (!this.headers) {\n this.headers = new HttpHeaders();\n }\n // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.\n if (!this.params) {\n this.params = new HttpParams();\n this.urlWithParams = url;\n }\n else {\n // Encode the parameters to a string in preparation for inclusion in the URL.\n var /** @type {?} */ params = this.params.toString();\n if (params.length === 0) {\n // No parameters, the visible URL is just the URL given at creation time.\n this.urlWithParams = url;\n }\n else {\n // Does the URL already have query parameters? Look for '?'.\n var /** @type {?} */ qIdx = url.indexOf('?');\n // There are 3 cases to handle:\n // 1) No existing parameters -> append '?' followed by params.\n // 2) '?' exists and is followed by existing query string ->\n // append '&' followed by params.\n // 3) '?' exists at the end of the url -> append params directly.\n // This basically amounts to determining the character, if any, with\n // which to join the URL and parameters.\n var /** @type {?} */ sep = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : '');\n this.urlWithParams = url + sep + params;\n }\n }\n }\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n */\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n * @return {?}\n */\n HttpRequest.prototype.serializeBody = /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n * @return {?}\n */\n function () {\n // If no body is present, no need to serialize it.\n if (this.body === null) {\n return null;\n }\n // Check whether the body is already in a serialized form. If so,\n // it can just be returned directly.\n if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) ||\n typeof this.body === 'string') {\n return this.body;\n }\n // Check whether the body is an instance of HttpUrlEncodedParams.\n if (this.body instanceof HttpParams) {\n return this.body.toString();\n }\n // Check whether the body is an object or array, and serialize with JSON if so.\n if (typeof this.body === 'object' || typeof this.body === 'boolean' ||\n Array.isArray(this.body)) {\n return JSON.stringify(this.body);\n }\n // Fall back on toString() for everything else.\n return (/** @type {?} */ (this.body)).toString();\n };\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n */\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n * @return {?}\n */\n HttpRequest.prototype.detectContentTypeHeader = /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n * @return {?}\n */\n function () {\n // An empty body has no content type.\n if (this.body === null) {\n return null;\n }\n // FormData bodies rely on the browser's content type assignment.\n if (isFormData(this.body)) {\n return null;\n }\n // Blobs usually have their own content type. If it doesn't, then\n // no type can be inferred.\n if (isBlob(this.body)) {\n return this.body.type || null;\n }\n // Array buffers have unknown contents and thus no type can be inferred.\n if (isArrayBuffer(this.body)) {\n return null;\n }\n // Technically, strings could be a form of JSON data, but it's safe enough\n // to assume they're plain strings.\n if (typeof this.body === 'string') {\n return 'text/plain';\n }\n // `HttpUrlEncodedParams` has its own content-type.\n if (this.body instanceof HttpParams) {\n return 'application/x-www-form-urlencoded;charset=UTF-8';\n }\n // Arrays, objects, and numbers will be encoded as JSON.\n if (typeof this.body === 'object' || typeof this.body === 'number' ||\n Array.isArray(this.body)) {\n return 'application/json';\n }\n // No type could be inferred.\n return null;\n };\n /**\n * @param {?=} update\n * @return {?}\n */\n HttpRequest.prototype.clone = /**\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n // For method, url, and responseType, take the current value unless\n // it is overridden in the update hash.\n var /** @type {?} */ method = update.method || this.method;\n var /** @type {?} */ url = update.url || this.url;\n var /** @type {?} */ responseType = update.responseType || this.responseType;\n // The body is somewhat special - a `null` value in update.body means\n // whatever current body is present is being overridden with an empty\n // body, whereas an `undefined` value in update.body implies no\n // override.\n var /** @type {?} */ body = (update.body !== undefined) ? update.body : this.body;\n // Carefully handle the boolean options to differentiate between\n // `false` and `undefined` in the update args.\n var /** @type {?} */ withCredentials = (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials;\n var /** @type {?} */ reportProgress = (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress;\n // Headers and params may be appended to if `setHeaders` or\n // `setParams` are used.\n var /** @type {?} */ headers = update.headers || this.headers;\n var /** @type {?} */ params = update.params || this.params;\n // Check whether the caller has asked to add headers.\n if (update.setHeaders !== undefined) {\n // Set every requested header.\n headers =\n Object.keys(update.setHeaders)\n .reduce(function (headers, name) { return headers.set(name, /** @type {?} */ ((update.setHeaders))[name]); }, headers);\n }\n // Check whether the caller has asked to set params.\n if (update.setParams) {\n // Set every requested param.\n params = Object.keys(update.setParams)\n .reduce(function (params, param) { return params.set(param, /** @type {?} */ ((update.setParams))[param]); }, params);\n }\n // Finally, construct the new HttpRequest using the pieces from above.\n return new HttpRequest(method, url, body, {\n params: params, headers: headers, reportProgress: reportProgress, responseType: responseType, withCredentials: withCredentials,\n });\n };\n return HttpRequest;\n}());\n/**\n * An outgoing HTTP request with an optional typed body.\n *\n * `HttpRequest` represents an outgoing request, including URL, method,\n * headers, body, and other request configuration options. Instances should be\n * assumed to be immutable. To modify a `HttpRequest`, the `clone`\n * method should be used.\n *\n * \\@stable\n * @template T\n */\nexport { HttpRequest };\nfunction HttpRequest_tsickle_Closure_declarations() {\n /**\n * The request body, or `null` if one isn't set.\n *\n * Bodies are not enforced to be immutable, as they can include a reference to any\n * user-defined data type. However, interceptors should take care to preserve\n * idempotence by treating them as such.\n * @type {?}\n */\n HttpRequest.prototype.body;\n /**\n * Outgoing headers for this request.\n * @type {?}\n */\n HttpRequest.prototype.headers;\n /**\n * Whether this request should be made in a way that exposes progress events.\n *\n * Progress events are expensive (change detection runs on each event) and so\n * they should only be requested if the consumer intends to monitor them.\n * @type {?}\n */\n HttpRequest.prototype.reportProgress;\n /**\n * Whether this request should be sent with outgoing credentials (cookies).\n * @type {?}\n */\n HttpRequest.prototype.withCredentials;\n /**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n * @type {?}\n */\n HttpRequest.prototype.responseType;\n /**\n * The outgoing HTTP request method.\n * @type {?}\n */\n HttpRequest.prototype.method;\n /**\n * Outgoing URL parameters.\n * @type {?}\n */\n HttpRequest.prototype.params;\n /**\n * The outgoing URL with all URL parameters set.\n * @type {?}\n */\n HttpRequest.prototype.urlWithParams;\n}\n//# sourceMappingURL=request.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as tslib_1 from \"tslib\";\nimport { HttpHeaders } from './headers';\n/** @enum {number} */\nvar HttpEventType = {\n /**\n * The request was sent out over the wire.\n */\n Sent: 0,\n /**\n * An upload progress event was received.\n */\n UploadProgress: 1,\n /**\n * The response status code and headers were received.\n */\n ResponseHeader: 2,\n /**\n * A download progress event was received.\n */\n DownloadProgress: 3,\n /**\n * The full response including the body was received.\n */\n Response: 4,\n /**\n * A custom event from an interceptor or a backend.\n */\n User: 5,\n};\nexport { HttpEventType };\nHttpEventType[HttpEventType.Sent] = \"Sent\";\nHttpEventType[HttpEventType.UploadProgress] = \"UploadProgress\";\nHttpEventType[HttpEventType.ResponseHeader] = \"ResponseHeader\";\nHttpEventType[HttpEventType.DownloadProgress] = \"DownloadProgress\";\nHttpEventType[HttpEventType.Response] = \"Response\";\nHttpEventType[HttpEventType.User] = \"User\";\n/**\n * Base interface for progress events.\n *\n * \\@stable\n * @record\n */\nexport function HttpProgressEvent() { }\nfunction HttpProgressEvent_tsickle_Closure_declarations() {\n /**\n * Progress event type is either upload or download.\n * @type {?}\n */\n HttpProgressEvent.prototype.type;\n /**\n * Number of bytes uploaded or downloaded.\n * @type {?}\n */\n HttpProgressEvent.prototype.loaded;\n /**\n * Total number of bytes to upload or download. Depending on the request or\n * response, this may not be computable and thus may not be present.\n * @type {?|undefined}\n */\n HttpProgressEvent.prototype.total;\n}\n/**\n * A download progress event.\n *\n * \\@stable\n * @record\n */\nexport function HttpDownloadProgressEvent() { }\nfunction HttpDownloadProgressEvent_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpDownloadProgressEvent.prototype.type;\n /**\n * The partial response body as downloaded so far.\n *\n * Only present if the responseType was `text`.\n * @type {?|undefined}\n */\n HttpDownloadProgressEvent.prototype.partialText;\n}\n/**\n * An upload progress event.\n *\n * \\@stable\n * @record\n */\nexport function HttpUploadProgressEvent() { }\nfunction HttpUploadProgressEvent_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpUploadProgressEvent.prototype.type;\n}\n/**\n * An event indicating that the request was sent to the server. Useful\n * when a request may be retried multiple times, to distinguish between\n * retries on the final event stream.\n *\n * \\@stable\n * @record\n */\nexport function HttpSentEvent() { }\nfunction HttpSentEvent_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpSentEvent.prototype.type;\n}\n/**\n * A user-defined event.\n *\n * Grouping all custom events under this type ensures they will be handled\n * and forwarded by all implementations of interceptors.\n *\n * \\@stable\n * @record\n * @template T\n */\nexport function HttpUserEvent() { }\nfunction HttpUserEvent_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpUserEvent.prototype.type;\n}\n/**\n * An error that represents a failed attempt to JSON.parse text coming back\n * from the server.\n *\n * It bundles the Error object with the actual response body that failed to parse.\n *\n * \\@stable\n * @record\n */\nexport function HttpJsonParseError() { }\nfunction HttpJsonParseError_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpJsonParseError.prototype.error;\n /** @type {?} */\n HttpJsonParseError.prototype.text;\n}\n/**\n * Base class for both `HttpResponse` and `HttpHeaderResponse`.\n *\n * \\@stable\n * @abstract\n */\nvar /**\n * Base class for both `HttpResponse` and `HttpHeaderResponse`.\n *\n * \\@stable\n * @abstract\n */\nHttpResponseBase = /** @class */ (function () {\n /**\n * Super-constructor for all responses.\n *\n * The single parameter accepted is an initialization hash. Any properties\n * of the response passed there will override the default values.\n */\n function HttpResponseBase(init, defaultStatus, defaultStatusText) {\n if (defaultStatus === void 0) { defaultStatus = 200; }\n if (defaultStatusText === void 0) { defaultStatusText = 'OK'; }\n // If the hash has values passed, use them to initialize the response.\n // Otherwise use the default values.\n this.headers = init.headers || new HttpHeaders();\n this.status = init.status !== undefined ? init.status : defaultStatus;\n this.statusText = init.statusText || defaultStatusText;\n this.url = init.url || null;\n // Cache the ok value to avoid defining a getter.\n this.ok = this.status >= 200 && this.status < 300;\n }\n return HttpResponseBase;\n}());\n/**\n * Base class for both `HttpResponse` and `HttpHeaderResponse`.\n *\n * \\@stable\n * @abstract\n */\nexport { HttpResponseBase };\nfunction HttpResponseBase_tsickle_Closure_declarations() {\n /**\n * All response headers.\n * @type {?}\n */\n HttpResponseBase.prototype.headers;\n /**\n * Response status code.\n * @type {?}\n */\n HttpResponseBase.prototype.status;\n /**\n * Textual description of response status code.\n *\n * Do not depend on this.\n * @type {?}\n */\n HttpResponseBase.prototype.statusText;\n /**\n * URL of the resource retrieved, or null if not available.\n * @type {?}\n */\n HttpResponseBase.prototype.url;\n /**\n * Whether the status code falls in the 2xx range.\n * @type {?}\n */\n HttpResponseBase.prototype.ok;\n /**\n * Type of the response, narrowed to either the full response or the header.\n * @type {?}\n */\n HttpResponseBase.prototype.type;\n}\n/**\n * A partial HTTP response which only includes the status and header data,\n * but no response body.\n *\n * `HttpHeaderResponse` is a `HttpEvent` available on the response\n * event stream, only when progress events are requested.\n *\n * \\@stable\n */\nvar /**\n * A partial HTTP response which only includes the status and header data,\n * but no response body.\n *\n * `HttpHeaderResponse` is a `HttpEvent` available on the response\n * event stream, only when progress events are requested.\n *\n * \\@stable\n */\nHttpHeaderResponse = /** @class */ (function (_super) {\n tslib_1.__extends(HttpHeaderResponse, _super);\n /**\n * Create a new `HttpHeaderResponse` with the given parameters.\n */\n function HttpHeaderResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.ResponseHeader;\n return _this;\n }\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n */\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n * @param {?=} update\n * @return {?}\n */\n HttpHeaderResponse.prototype.clone = /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n // Perform a straightforward initialization of the new HttpHeaderResponse,\n // overriding the current parameters with new ones if given.\n return new HttpHeaderResponse({\n headers: update.headers || this.headers,\n status: update.status !== undefined ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpHeaderResponse;\n}(HttpResponseBase));\n/**\n * A partial HTTP response which only includes the status and header data,\n * but no response body.\n *\n * `HttpHeaderResponse` is a `HttpEvent` available on the response\n * event stream, only when progress events are requested.\n *\n * \\@stable\n */\nexport { HttpHeaderResponse };\nfunction HttpHeaderResponse_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpHeaderResponse.prototype.type;\n}\n/**\n * A full HTTP response, including a typed response body (which may be `null`\n * if one was not returned).\n *\n * `HttpResponse` is a `HttpEvent` available on the response event\n * stream.\n *\n * \\@stable\n * @template T\n */\nvar /**\n * A full HTTP response, including a typed response body (which may be `null`\n * if one was not returned).\n *\n * `HttpResponse` is a `HttpEvent` available on the response event\n * stream.\n *\n * \\@stable\n * @template T\n */\nHttpResponse = /** @class */ (function (_super) {\n tslib_1.__extends(HttpResponse, _super);\n /**\n * Construct a new `HttpResponse`.\n */\n function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }\n /**\n * @param {?=} update\n * @return {?}\n */\n HttpResponse.prototype.clone = /**\n * @param {?=} update\n * @return {?}\n */\n function (update) {\n if (update === void 0) { update = {}; }\n return new HttpResponse({\n body: (update.body !== undefined) ? update.body : this.body,\n headers: update.headers || this.headers,\n status: (update.status !== undefined) ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpResponse;\n}(HttpResponseBase));\n/**\n * A full HTTP response, including a typed response body (which may be `null`\n * if one was not returned).\n *\n * `HttpResponse` is a `HttpEvent` available on the response event\n * stream.\n *\n * \\@stable\n * @template T\n */\nexport { HttpResponse };\nfunction HttpResponse_tsickle_Closure_declarations() {\n /**\n * The response body, or `null` if one was not returned.\n * @type {?}\n */\n HttpResponse.prototype.body;\n /** @type {?} */\n HttpResponse.prototype.type;\n}\n/**\n * A response that represents an error or failure, either from a\n * non-successful HTTP status, an error while executing the request,\n * or some other failure which occurred during the parsing of the response.\n *\n * Any error returned on the `Observable` response stream will be\n * wrapped in an `HttpErrorResponse` to provide additional context about\n * the state of the HTTP layer when the error occurred. The error property\n * will contain either a wrapped Error object or the error response returned\n * from the server.\n *\n * \\@stable\n */\nvar /**\n * A response that represents an error or failure, either from a\n * non-successful HTTP status, an error while executing the request,\n * or some other failure which occurred during the parsing of the response.\n *\n * Any error returned on the `Observable` response stream will be\n * wrapped in an `HttpErrorResponse` to provide additional context about\n * the state of the HTTP layer when the error occurred. The error property\n * will contain either a wrapped Error object or the error response returned\n * from the server.\n *\n * \\@stable\n */\nHttpErrorResponse = /** @class */ (function (_super) {\n tslib_1.__extends(HttpErrorResponse, _super);\n function HttpErrorResponse(init) {\n var _this = \n // Initialize with a default status of 0 / Unknown Error.\n _super.call(this, init, 0, 'Unknown Error') || this;\n _this.name = 'HttpErrorResponse';\n /**\n * Errors are never okay, even when the status code is in the 2xx success range.\n */\n _this.ok = false;\n // If the response was successful, then this was a parse error. Otherwise, it was\n // a protocol-level failure of some sort. Either the request failed in transit\n // or the server returned an unsuccessful status code.\n if (_this.status >= 200 && _this.status < 300) {\n _this.message = \"Http failure during parsing for \" + (init.url || '(unknown url)');\n }\n else {\n _this.message =\n \"Http failure response for \" + (init.url || '(unknown url)') + \": \" + init.status + \" \" + init.statusText;\n }\n _this.error = init.error || null;\n return _this;\n }\n return HttpErrorResponse;\n}(HttpResponseBase));\n/**\n * A response that represents an error or failure, either from a\n * non-successful HTTP status, an error while executing the request,\n * or some other failure which occurred during the parsing of the response.\n *\n * Any error returned on the `Observable` response stream will be\n * wrapped in an `HttpErrorResponse` to provide additional context about\n * the state of the HTTP layer when the error occurred. The error property\n * will contain either a wrapped Error object or the error response returned\n * from the server.\n *\n * \\@stable\n */\nexport { HttpErrorResponse };\nfunction HttpErrorResponse_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpErrorResponse.prototype.name;\n /** @type {?} */\n HttpErrorResponse.prototype.message;\n /** @type {?} */\n HttpErrorResponse.prototype.error;\n /**\n * Errors are never okay, even when the status code is in the 2xx success range.\n * @type {?}\n */\n HttpErrorResponse.prototype.ok;\n}\n//# sourceMappingURL=response.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable } from '@angular/core';\nimport { of } from 'rxjs/observable/of';\nimport { concatMap } from 'rxjs/operator/concatMap';\nimport { filter } from 'rxjs/operator/filter';\nimport { map } from 'rxjs/operator/map';\nimport { HttpHandler } from './backend';\nimport { HttpHeaders } from './headers';\nimport { HttpParams } from './params';\nimport { HttpRequest } from './request';\nimport { HttpResponse } from './response';\n/**\n * Construct an instance of `HttpRequestOptions` from a source `HttpMethodOptions` and\n * the given `body`. Basically, this clones the object and adds the body.\n * @template T\n * @param {?} options\n * @param {?} body\n * @return {?}\n */\nfunction addBody(options, body) {\n return {\n body: body,\n headers: options.headers,\n observe: options.observe,\n params: options.params,\n reportProgress: options.reportProgress,\n responseType: options.responseType,\n withCredentials: options.withCredentials,\n };\n}\n/**\n * Perform HTTP requests.\n *\n * `HttpClient` is available as an injectable class, with methods to perform HTTP requests.\n * Each request method has multiple signatures, and the return type varies according to which\n * signature is called (mainly the values of `observe` and `responseType`).\n *\n * \\@stable\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient(handler) {\n this.handler = handler;\n }\n /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable` with the same `T` body type.\n */\n /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable` with the same `T` body type.\n * @param {?} first\n * @param {?=} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.request = /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable` with the same `T` body type.\n * @param {?} first\n * @param {?=} url\n * @param {?=} options\n * @return {?}\n */\n function (first, url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var /** @type {?} */ req;\n // Firstly, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = /** @type {?} */ (first);\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming GET unless a method is\n // provided.\n // Figure out the headers.\n var /** @type {?} */ headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n var /** @type {?} */ params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, /** @type {?} */ ((url)), (options.body !== undefined ? options.body : null), {\n headers: headers,\n params: params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n var /** @type {?} */ events$ = concatMap.call(of(req), function (req) { return _this.handler.handle(req); });\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n var /** @type {?} */ res$ = filter.call(events$, function (event) { return event instanceof HttpResponse; });\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return map.call(res$, function (res) {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n });\n case 'blob':\n return map.call(res$, function (res) {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n });\n case 'text':\n return map.call(res$, function (res) {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n });\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return map.call(res$, function (res) { return res.body; });\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(\"Unreachable: unhandled observe type \" + options.observe + \"}\");\n }\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.delete = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('DELETE', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.get = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('GET', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.head = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('HEAD', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n * @template T\n * @param {?} url\n * @param {?} callbackParam\n * @return {?}\n */\n HttpClient.prototype.jsonp = /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n * @template T\n * @param {?} url\n * @param {?} callbackParam\n * @return {?}\n */\n function (url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.options = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('OPTIONS', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.patch = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PATCH', url, addBody(options, body));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.post = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('POST', url, addBody(options, body));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n */\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.put = /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PUT', url, addBody(options, body));\n };\n HttpClient.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n HttpClient.ctorParameters = function () { return [\n { type: HttpHandler, },\n ]; };\n return HttpClient;\n}());\nexport { HttpClient };\nfunction HttpClient_tsickle_Closure_declarations() {\n /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */\n HttpClient.decorators;\n /**\n * @nocollapse\n * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>}\n */\n HttpClient.ctorParameters;\n /** @type {?} */\n HttpClient.prototype.handler;\n}\n//# sourceMappingURL=client.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable, InjectionToken } from '@angular/core';\n/**\n * Intercepts `HttpRequest` and handles them.\n *\n * Most interceptors will transform the outgoing request before passing it to the\n * next interceptor in the chain, by calling `next.handle(transformedReq)`.\n *\n * In rare cases, interceptors may wish to completely handle a request themselves,\n * and not delegate to the remainder of the chain. This behavior is allowed.\n *\n * \\@stable\n * @record\n */\nexport function HttpInterceptor() { }\nfunction HttpInterceptor_tsickle_Closure_declarations() {\n /**\n * Intercept an outgoing `HttpRequest` and optionally transform it or the\n * response.\n *\n * Typically an interceptor will transform the outgoing request before returning\n * `next.handle(transformedReq)`. An interceptor may choose to transform the\n * response event stream as well, by applying additional Rx operators on the stream\n * returned by `next.handle()`.\n *\n * More rarely, an interceptor may choose to completely handle the request itself,\n * and compose a new event stream instead of invoking `next.handle()`. This is\n * acceptable behavior, but keep in mind further interceptors will be skipped entirely.\n *\n * It is also rare but valid for an interceptor to return multiple responses on the\n * event stream for a single request.\n * @type {?}\n */\n HttpInterceptor.prototype.intercept;\n}\n/**\n * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.\n *\n * \\@stable\n */\nvar /**\n * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.\n *\n * \\@stable\n */\nHttpInterceptorHandler = /** @class */ (function () {\n function HttpInterceptorHandler(next, interceptor) {\n this.next = next;\n this.interceptor = interceptor;\n }\n /**\n * @param {?} req\n * @return {?}\n */\n HttpInterceptorHandler.prototype.handle = /**\n * @param {?} req\n * @return {?}\n */\n function (req) {\n return this.interceptor.intercept(req, this.next);\n };\n return HttpInterceptorHandler;\n}());\n/**\n * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.\n *\n * \\@stable\n */\nexport { HttpInterceptorHandler };\nfunction HttpInterceptorHandler_tsickle_Closure_declarations() {\n /** @type {?} */\n HttpInterceptorHandler.prototype.next;\n /** @type {?} */\n HttpInterceptorHandler.prototype.interceptor;\n}\n/**\n * A multi-provider token which represents the array of `HttpInterceptor`s that\n * are registered.\n *\n * \\@stable\n */\nexport var /** @type {?} */ HTTP_INTERCEPTORS = new InjectionToken('HTTP_INTERCEPTORS');\nvar NoopInterceptor = /** @class */ (function () {\n function NoopInterceptor() {\n }\n /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n NoopInterceptor.prototype.intercept = /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n function (req, next) {\n return next.handle(req);\n };\n NoopInterceptor.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n NoopInterceptor.ctorParameters = function () { return []; };\n return NoopInterceptor;\n}());\nexport { NoopInterceptor };\nfunction NoopInterceptor_tsickle_Closure_declarations() {\n /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */\n NoopInterceptor.decorators;\n /**\n * @nocollapse\n * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>}\n */\n NoopInterceptor.ctorParameters;\n}\n//# sourceMappingURL=interceptor.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { DOCUMENT } from '@angular/common';\nimport { Inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs/Observable';\nimport { HttpErrorResponse, HttpEventType, HttpResponse } from './response';\n// Every request made through JSONP needs a callback name that's unique across the\n// whole page. Each request is assigned an id and the callback name is constructed\n// from that. The next id to be assigned is tracked in a global variable here that\n// is shared among all applications on the page.\nvar /** @type {?} */ nextRequestId = 0;\n// Error text given when a JSONP script is injected, but doesn't invoke the callback\n// passed in its URL.\nexport var /** @type {?} */ JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';\n// Error text given when a request is passed to the JsonpClientBackend that doesn't\n// have a request method JSONP.\nexport var /** @type {?} */ JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';\nexport var /** @type {?} */ JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';\n/**\n * DI token/abstract type representing a map of JSONP callbacks.\n *\n * In the browser, this should always be the `window` object.\n *\n * \\@stable\n * @abstract\n */\nvar /**\n * DI token/abstract type representing a map of JSONP callbacks.\n *\n * In the browser, this should always be the `window` object.\n *\n * \\@stable\n * @abstract\n */\nJsonpCallbackContext = /** @class */ (function () {\n function JsonpCallbackContext() {\n }\n return JsonpCallbackContext;\n}());\n/**\n * DI token/abstract type representing a map of JSONP callbacks.\n *\n * In the browser, this should always be the `window` object.\n *\n * \\@stable\n * @abstract\n */\nexport { JsonpCallbackContext };\n/**\n * `HttpBackend` that only processes `HttpRequest` with the JSONP method,\n * by performing JSONP style requests.\n *\n * \\@stable\n */\nvar JsonpClientBackend = /** @class */ (function () {\n function JsonpClientBackend(callbackMap, document) {\n this.callbackMap = callbackMap;\n this.document = document;\n }\n /**\n * Get the name of the next callback method, by incrementing the global `nextRequestId`.\n * @return {?}\n */\n JsonpClientBackend.prototype.nextCallback = /**\n * Get the name of the next callback method, by incrementing the global `nextRequestId`.\n * @return {?}\n */\n function () { return \"ng_jsonp_callback_\" + nextRequestId++; };\n /**\n * Process a JSONP request and return an event stream of the results.\n */\n /**\n * Process a JSONP request and return an event stream of the results.\n * @param {?} req\n * @return {?}\n */\n JsonpClientBackend.prototype.handle = /**\n * Process a JSONP request and return an event stream of the results.\n * @param {?} req\n * @return {?}\n */\n function (req) {\n var _this = this;\n // Firstly, check both the method and response type. If either doesn't match\n // then the request was improperly routed here and cannot be handled.\n if (req.method !== 'JSONP') {\n throw new Error(JSONP_ERR_WRONG_METHOD);\n }\n else if (req.responseType !== 'json') {\n throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);\n }\n // Everything else happens inside the Observable boundary.\n return new Observable(function (observer) {\n // The first step to make a request is to generate the callback name, and replace the\n // callback placeholder in the URL with the name. Care has to be taken here to ensure\n // a trailing &, if matched, gets inserted back into the URL in the correct place.\n var /** @type {?} */ callback = _this.nextCallback();\n var /** @type {?} */ url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, \"=\" + callback + \"$1\");\n // Construct the