@angular/http
Advanced tools
Comparing version 2.0.1 to 2.0.2
/** | ||
* @license Angular v2.0.1 | ||
* @license Angular v2.0.2 | ||
* (c) 2010-2016 Google, Inc. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* @license Angular v2.0.1 | ||
* @license Angular v2.0.2 | ||
* (c) 2010-2016 Google, Inc. https://angular.io/ | ||
* License: MIT | ||
*/ | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("rxjs/Observable"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs/Observable","@angular/platform-browser"],factory):factory((global.ng=global.ng||{},global.ng.http=global.ng.http||{}),global.ng.core,global.Rx,global.ng.platformBrowser)}(this,function(exports,_angular_core,rxjs_Observable,_angular_platformBrowser){"use strict";function isPresent(obj){return void 0!==obj&&null!==obj}function isBlank(obj){return void 0===obj||null===obj}function isString(obj){return"string"==typeof obj}function isArray(obj){return Array.isArray(obj)}function isJsObject(o){return null!==o&&("function"==typeof o||"object"==typeof o)}function getSymbolIterator(){if(isBlank(_symbolIterator))if(isPresent(globalScope.Symbol)&&isPresent(Symbol.iterator))_symbolIterator=Symbol.iterator;else for(var keys=Object.getOwnPropertyNames(Map.prototype),i=0;i<keys.length;++i){var key=keys[i];"entries"!==key&&"size"!==key&&Map.prototype[key]===Map.prototype.entries&&(_symbolIterator=key)}return _symbolIterator}function _flattenArray(source,target){if(isPresent(source))for(var i=0;i<source.length;i++){var item=source[i];isArray(item)?_flattenArray(item,target):target.push(item)}return target}function isListLikeIterable(obj){return!!isJsObject(obj)&&(isArray(obj)||!(obj instanceof Map)&&getSymbolIterator()in obj)}function iterateListLike(obj,fn){if(isArray(obj))for(var i=0;i<obj.length;i++)fn(obj[i]);else for(var item,iterator=obj[getSymbolIterator()]();!(item=iterator.next()).done;)fn(item.value)}function normalize(name){return name.toLowerCase()}function normalizeMethodName(method){if(isString(method)){var originalMethod=method;if(method=method.replace(/(\w)(\w*)/g,function(g0,g1,g2){return g1.toUpperCase()+g2.toLowerCase()}),method=exports.RequestMethod[method],"number"!=typeof method)throw new Error('Invalid request method. The method "'+originalMethod+'" is not supported.')}return method}function getResponseURL(xhr){return"responseURL"in xhr?xhr.responseURL:/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())?xhr.getResponseHeader("X-Request-URL"):void 0}function stringToArrayBuffer(input){for(var view=new Uint16Array(input.length),i=0,strLen=input.length;i<strLen;i++)view[i]=input.charCodeAt(i);return view.buffer}/** | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("rxjs/Observable"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs/Observable","@angular/platform-browser"],factory):factory((global.ng=global.ng||{},global.ng.http=global.ng.http||{}),global.ng.core,global.Rx,global.ng.platformBrowser)}(this,function(exports,_angular_core,rxjs_Observable,_angular_platformBrowser){"use strict";function isPresent(obj){return void 0!==obj&&null!==obj}function isString(obj){return"string"==typeof obj}function isJsObject(o){return null!==o&&("function"==typeof o||"object"==typeof o)}function normalizeMethodName(method){if(isString(method)){var originalMethod=method;if(method=method.replace(/(\w)(\w*)/g,function(g0,g1,g2){return g1.toUpperCase()+g2.toLowerCase()}),method=exports.RequestMethod[method],"number"!=typeof method)throw new Error('Invalid request method. The method "'+originalMethod+'" is not supported.')}return method}function getResponseURL(xhr){return"responseURL"in xhr?xhr.responseURL:/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())?xhr.getResponseHeader("X-Request-URL"):void 0}function stringToArrayBuffer(input){for(var view=new Uint16Array(input.length),i=0,strLen=input.length;i<strLen;i++)view[i]=input.charCodeAt(i);return view.buffer}/** | ||
* @license | ||
@@ -13,3 +13,3 @@ * Copyright Google Inc. All Rights Reserved. | ||
*/ | ||
function paramParser(rawParams){void 0===rawParams&&(rawParams="");var map=new Map;if(rawParams.length>0){var params=rawParams.split("&");params.forEach(function(param){var eqIdx=param.indexOf("="),_a=eqIdx==-1?[param,""]:[param.slice(0,eqIdx),param.slice(eqIdx+1)],key=_a[0],val=_a[1],list=map.get(key)||[];list.push(val),map.set(key,list)})}return map}function standardEncoding(v){return encodeURIComponent(v).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}function _getJsonpConnections(){return null===_jsonpConnections&&(_jsonpConnections=global$1[JSONP_HOME]={}),_jsonpConnections}function httpRequest(backend,request){return backend.createConnection(request).response}function mergeOptions(defaultOpts,providedOpts,method,url){var newOptions=defaultOpts;return isPresent(providedOpts)?newOptions.merge(new RequestOptions({method:providedOpts.method||method,url:providedOpts.url||url,search:providedOpts.search,headers:providedOpts.headers,body:providedOpts.body,withCredentials:providedOpts.withCredentials,responseType:providedOpts.responseType})):isPresent(method)?newOptions.merge(new RequestOptions({method:method,url:url})):newOptions.merge(new RequestOptions({url:url}))}function _createDefaultCookieXSRFStrategy(){return new CookieXSRFStrategy}function httpFactory(xhrBackend,requestOptions){return new Http(xhrBackend,requestOptions)}function jsonpFactory(jsonpBackend,requestOptions){return new Jsonp(jsonpBackend,requestOptions)}var globalScope,BrowserXhr=function(){function BrowserXhr(){}return BrowserXhr.prototype.build=function(){return new XMLHttpRequest},BrowserXhr.decorators=[{type:_angular_core.Injectable}],BrowserXhr.ctorParameters=[],BrowserXhr}();globalScope="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:global:window;var global$1=globalScope;global$1.assert=function(condition){};var StringWrapper=function(){function StringWrapper(){}return StringWrapper.fromCharCode=function(code){return String.fromCharCode(code)},StringWrapper.charCodeAt=function(s,index){return s.charCodeAt(index)},StringWrapper.split=function(s,regExp){return s.split(regExp)},StringWrapper.equals=function(s,s2){return s===s2},StringWrapper.stripLeft=function(s,charVal){if(s&&s.length){for(var pos=0,i=0;i<s.length&&s[i]==charVal;i++)pos++;s=s.substring(pos)}return s},StringWrapper.stripRight=function(s,charVal){if(s&&s.length){for(var pos=s.length,i=s.length-1;i>=0&&s[i]==charVal;i--)pos--;s=s.substring(0,pos)}return s},StringWrapper.replace=function(s,from,replace){return s.replace(from,replace)},StringWrapper.replaceAll=function(s,from,replace){return s.replace(from,replace)},StringWrapper.slice=function(s,from,to){return void 0===from&&(from=0),void 0===to&&(to=null),s.slice(from,null===to?void 0:to)},StringWrapper.replaceAllMapped=function(s,from,cb){return s.replace(from,function(){for(var matches=[],_i=0;_i<arguments.length;_i++)matches[_i-0]=arguments[_i];return matches.splice(-2,2),cb(matches)})},StringWrapper.contains=function(s,substr){return s.indexOf(substr)!=-1},StringWrapper.compare=function(a,b){return a<b?-1:a>b?1:0},StringWrapper}(),Json=(function(){function NumberWrapper(){}return NumberWrapper.toFixed=function(n,fractionDigits){return n.toFixed(fractionDigits)},NumberWrapper.equal=function(a,b){return a===b},NumberWrapper.parseIntAutoRadix=function(text){var result=parseInt(text);if(isNaN(result))throw new Error("Invalid integer literal when parsing "+text);return result},NumberWrapper.parseInt=function(text,radix){if(10==radix){if(/^(\-|\+)?[0-9]+$/.test(text))return parseInt(text,radix)}else if(16==radix){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text))return parseInt(text,radix)}else{var result=parseInt(text,radix);if(!isNaN(result))return result}throw new Error("Invalid integer literal when parsing "+text+" in base "+radix)},Object.defineProperty(NumberWrapper,"NaN",{get:function(){return NaN},enumerable:!0,configurable:!0}),NumberWrapper.isNumeric=function(value){return!isNaN(value-parseFloat(value))},NumberWrapper.isNaN=function(value){return isNaN(value)},NumberWrapper.isInteger=function(value){return Number.isInteger(value)},NumberWrapper}(),function(){function Json(){}return Json.parse=function(s){return global$1.JSON.parse(s)},Json.stringify=function(data){return global$1.JSON.stringify(data,null,2)},Json}()),_symbolIterator=null;/** | ||
function paramParser(rawParams){void 0===rawParams&&(rawParams="");var map=new Map;if(rawParams.length>0){var params=rawParams.split("&");params.forEach(function(param){var eqIdx=param.indexOf("="),_a=eqIdx==-1?[param,""]:[param.slice(0,eqIdx),param.slice(eqIdx+1)],key=_a[0],val=_a[1],list=map.get(key)||[];list.push(val),map.set(key,list)})}return map}function standardEncoding(v){return encodeURIComponent(v).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}function _getJsonpConnections(){return null===_jsonpConnections&&(_jsonpConnections=global$1[JSONP_HOME]={}),_jsonpConnections}function httpRequest(backend,request){return backend.createConnection(request).response}function mergeOptions(defaultOpts,providedOpts,method,url){var newOptions=defaultOpts;return isPresent(providedOpts)?newOptions.merge(new RequestOptions({method:providedOpts.method||method,url:providedOpts.url||url,search:providedOpts.search,headers:providedOpts.headers,body:providedOpts.body,withCredentials:providedOpts.withCredentials,responseType:providedOpts.responseType})):isPresent(method)?newOptions.merge(new RequestOptions({method:method,url:url})):newOptions.merge(new RequestOptions({url:url}))}function _createDefaultCookieXSRFStrategy(){return new CookieXSRFStrategy}function httpFactory(xhrBackend,requestOptions){return new Http(xhrBackend,requestOptions)}function jsonpFactory(jsonpBackend,requestOptions){return new Jsonp(jsonpBackend,requestOptions)}var globalScope,BrowserXhr=function(){function BrowserXhr(){}return BrowserXhr.prototype.build=function(){return new XMLHttpRequest},BrowserXhr.decorators=[{type:_angular_core.Injectable}],BrowserXhr.ctorParameters=[],BrowserXhr}();globalScope="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:global:window;var global$1=globalScope;global$1.assert=function(condition){};var StringWrapper=function(){function StringWrapper(){}return StringWrapper.fromCharCode=function(code){return String.fromCharCode(code)},StringWrapper.charCodeAt=function(s,index){return s.charCodeAt(index)},StringWrapper.split=function(s,regExp){return s.split(regExp)},StringWrapper.equals=function(s,s2){return s===s2},StringWrapper.stripLeft=function(s,charVal){if(s&&s.length){for(var pos=0,i=0;i<s.length&&s[i]==charVal;i++)pos++;s=s.substring(pos)}return s},StringWrapper.stripRight=function(s,charVal){if(s&&s.length){for(var pos=s.length,i=s.length-1;i>=0&&s[i]==charVal;i--)pos--;s=s.substring(0,pos)}return s},StringWrapper.replace=function(s,from,replace){return s.replace(from,replace)},StringWrapper.replaceAll=function(s,from,replace){return s.replace(from,replace)},StringWrapper.slice=function(s,from,to){return void 0===from&&(from=0),void 0===to&&(to=null),s.slice(from,null===to?void 0:to)},StringWrapper.replaceAllMapped=function(s,from,cb){return s.replace(from,function(){for(var matches=[],_i=0;_i<arguments.length;_i++)matches[_i-0]=arguments[_i];return matches.splice(-2,2),cb(matches)})},StringWrapper.contains=function(s,substr){return s.indexOf(substr)!=-1},StringWrapper.compare=function(a,b){return a<b?-1:a>b?1:0},StringWrapper}(),Json=(function(){function NumberWrapper(){}return NumberWrapper.toFixed=function(n,fractionDigits){return n.toFixed(fractionDigits)},NumberWrapper.equal=function(a,b){return a===b},NumberWrapper.parseIntAutoRadix=function(text){var result=parseInt(text);if(isNaN(result))throw new Error("Invalid integer literal when parsing "+text);return result},NumberWrapper.parseInt=function(text,radix){if(10==radix){if(/^(\-|\+)?[0-9]+$/.test(text))return parseInt(text,radix)}else if(16==radix){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text))return parseInt(text,radix)}else{var result=parseInt(text,radix);if(!isNaN(result))return result}throw new Error("Invalid integer literal when parsing "+text+" in base "+radix)},Object.defineProperty(NumberWrapper,"NaN",{get:function(){return NaN},enumerable:!0,configurable:!0}),NumberWrapper.isNumeric=function(value){return!isNaN(value-parseFloat(value))},NumberWrapper.isNaN=function(value){return isNaN(value)},NumberWrapper.isInteger=function(value){return Number.isInteger(value)},NumberWrapper}(),function(){function Json(){}return Json.parse=function(s){return global$1.JSON.parse(s)},Json.stringify=function(data){return global$1.JSON.stringify(data,null,2)},Json}());/** | ||
* @license | ||
@@ -21,2 +21,2 @@ * Copyright Google Inc. All Rights Reserved. | ||
*/ | ||
exports.RequestMethod,function(RequestMethod){RequestMethod[RequestMethod.Get=0]="Get",RequestMethod[RequestMethod.Post=1]="Post",RequestMethod[RequestMethod.Put=2]="Put",RequestMethod[RequestMethod.Delete=3]="Delete",RequestMethod[RequestMethod.Options=4]="Options",RequestMethod[RequestMethod.Head=5]="Head",RequestMethod[RequestMethod.Patch=6]="Patch"}(exports.RequestMethod||(exports.RequestMethod={})),exports.ReadyState,function(ReadyState){ReadyState[ReadyState.Unsent=0]="Unsent",ReadyState[ReadyState.Open=1]="Open",ReadyState[ReadyState.HeadersReceived=2]="HeadersReceived",ReadyState[ReadyState.Loading=3]="Loading",ReadyState[ReadyState.Done=4]="Done",ReadyState[ReadyState.Cancelled=5]="Cancelled"}(exports.ReadyState||(exports.ReadyState={})),exports.ResponseType,function(ResponseType){ResponseType[ResponseType.Basic=0]="Basic",ResponseType[ResponseType.Cors=1]="Cors",ResponseType[ResponseType.Default=2]="Default",ResponseType[ResponseType.Error=3]="Error",ResponseType[ResponseType.Opaque=4]="Opaque"}(exports.ResponseType||(exports.ResponseType={}));var ContentType;!function(ContentType){ContentType[ContentType.NONE=0]="NONE",ContentType[ContentType.JSON=1]="JSON",ContentType[ContentType.FORM=2]="FORM",ContentType[ContentType.FORM_DATA=3]="FORM_DATA",ContentType[ContentType.TEXT=4]="TEXT",ContentType[ContentType.BLOB=5]="BLOB",ContentType[ContentType.ARRAY_BUFFER=6]="ARRAY_BUFFER"}(ContentType||(ContentType={})),exports.ResponseContentType,function(ResponseContentType){ResponseContentType[ResponseContentType.Text=0]="Text",ResponseContentType[ResponseContentType.Json=1]="Json",ResponseContentType[ResponseContentType.ArrayBuffer=2]="ArrayBuffer",ResponseContentType[ResponseContentType.Blob=3]="Blob"}(exports.ResponseContentType||(exports.ResponseContentType={}));var createMapFromPairs=function(){try{if(1===new Map([[1,2]]).size)return function(pairs){return new Map(pairs)}}catch(e){}return function(pairs){for(var map=new Map,i=0;i<pairs.length;i++){var pair=pairs[i];map.set(pair[0],pair[1])}return map}}(),_arrayFromMap=(function(){return(new Map).keys().next?function(m){for(var k,keyIterator=m.keys();!(k=keyIterator.next()).done;)m.set(k.value,null)}:function(m){m.forEach(function(v,k){m.set(k,null)})}}(),function(){try{if((new Map).values().next)return function(m,getValues){return getValues?Array.from(m.values()):Array.from(m.keys())}}catch(e){}return function(m,getValues){var res=new Array(m.size),i=0;return m.forEach(function(v,k){res[i]=getValues?v:k,i++}),res}}()),MapWrapper=function(){function MapWrapper(){}return MapWrapper.createFromStringMap=function(stringMap){var result=new Map;for(var prop in stringMap)result.set(prop,stringMap[prop]);return result},MapWrapper.toStringMap=function(m){var r={};return m.forEach(function(v,k){return r[k]=v}),r},MapWrapper.createFromPairs=function(pairs){return createMapFromPairs(pairs)},MapWrapper.iterable=function(m){return m},MapWrapper.keys=function(m){return _arrayFromMap(m,!1)},MapWrapper.values=function(m){return _arrayFromMap(m,!0)},MapWrapper}(),StringMapWrapper=function(){function StringMapWrapper(){}return StringMapWrapper.get=function(map,key){return map.hasOwnProperty(key)?map[key]:void 0},StringMapWrapper.set=function(map,key,value){map[key]=value},StringMapWrapper.keys=function(map){return Object.keys(map)},StringMapWrapper.values=function(map){return Object.keys(map).map(function(k){return map[k]})},StringMapWrapper.isEmpty=function(map){for(var prop in map)return!1;return!0},StringMapWrapper.forEach=function(map,callback){for(var _i=0,_a=Object.keys(map);_i<_a.length;_i++){var k=_a[_i];callback(map[k],k)}},StringMapWrapper.merge=function(m1,m2){for(var m={},_i=0,_a=Object.keys(m1);_i<_a.length;_i++){var k=_a[_i];m[k]=m1[k]}for(var _b=0,_c=Object.keys(m2);_b<_c.length;_b++){var k=_c[_b];m[k]=m2[k]}return m},StringMapWrapper.equals=function(m1,m2){var k1=Object.keys(m1),k2=Object.keys(m2);if(k1.length!=k2.length)return!1;for(var i=0;i<k1.length;i++){var key=k1[i];if(m1[key]!==m2[key])return!1}return!0},StringMapWrapper}(),ListWrapper=function(){function ListWrapper(){}return ListWrapper.createFixedSize=function(size){return new Array(size)},ListWrapper.createGrowableSize=function(size){return new Array(size)},ListWrapper.clone=function(array){return array.slice(0)},ListWrapper.forEachWithIndex=function(array,fn){for(var i=0;i<array.length;i++)fn(array[i],i)},ListWrapper.first=function(array){return array?array[0]:null},ListWrapper.last=function(array){return array&&0!=array.length?array[array.length-1]:null},ListWrapper.indexOf=function(array,value,startIndex){return void 0===startIndex&&(startIndex=0),array.indexOf(value,startIndex)},ListWrapper.contains=function(list,el){return list.indexOf(el)!==-1},ListWrapper.reversed=function(array){var a=ListWrapper.clone(array);return a.reverse()},ListWrapper.concat=function(a,b){return a.concat(b)},ListWrapper.insert=function(list,index,value){list.splice(index,0,value)},ListWrapper.removeAt=function(list,index){var res=list[index];return list.splice(index,1),res},ListWrapper.removeAll=function(list,items){for(var i=0;i<items.length;++i){var index=list.indexOf(items[i]);list.splice(index,1)}},ListWrapper.remove=function(list,el){var index=list.indexOf(el);return index>-1&&(list.splice(index,1),!0)},ListWrapper.clear=function(list){list.length=0},ListWrapper.isEmpty=function(list){return 0==list.length},ListWrapper.fill=function(list,value,start,end){void 0===start&&(start=0),void 0===end&&(end=null),list.fill(value,start,null===end?list.length:end)},ListWrapper.equals=function(a,b){if(a.length!=b.length)return!1;for(var i=0;i<a.length;++i)if(a[i]!==b[i])return!1;return!0},ListWrapper.slice=function(l,from,to){return void 0===from&&(from=0),void 0===to&&(to=null),l.slice(from,null===to?void 0:to)},ListWrapper.splice=function(l,from,length){return l.splice(from,length)},ListWrapper.sort=function(l,compareFn){isPresent(compareFn)?l.sort(compareFn):l.sort()},ListWrapper.toString=function(l){return l.toString()},ListWrapper.toJSON=function(l){return JSON.stringify(l)},ListWrapper.maximum=function(list,predicate){if(0==list.length)return null;for(var solution=null,maxValue=-(1/0),index=0;index<list.length;index++){var candidate=list[index];if(!isBlank(candidate)){var candidateValue=predicate(candidate);candidateValue>maxValue&&(solution=candidate,maxValue=candidateValue)}}return solution},ListWrapper.flatten=function(list){var target=[];return _flattenArray(list,target),target},ListWrapper.addAll=function(list,source){for(var i=0;i<source.length;i++)list.push(source[i])},ListWrapper}(),Headers=function(){function Headers(headers){var _this=this;return headers instanceof Headers?void(this._headersMap=new Map(headers._headersMap)):(this._headersMap=new Map,void(isBlank(headers)||StringMapWrapper.forEach(headers,function(v,k){_this._headersMap.set(normalize(k),isListLikeIterable(v)?v:[v])})))}return Headers.fromResponseHeaderString=function(headersString){var headers=new Headers;return headersString.split("\n").forEach(function(line){var index=line.indexOf(":");if(index>0){var key=line.substring(0,index),value=line.substring(index+1).trim();headers.set(key,value)}}),headers},Headers.prototype.append=function(name,value){name=normalize(name);var mapName=this._headersMap.get(name),list=isListLikeIterable(mapName)?mapName:[];list.push(value),this._headersMap.set(name,list)},Headers.prototype.delete=function(name){this._headersMap.delete(normalize(name))},Headers.prototype.forEach=function(fn){this._headersMap.forEach(fn)},Headers.prototype.get=function(header){return ListWrapper.first(this._headersMap.get(normalize(header)))},Headers.prototype.has=function(header){return this._headersMap.has(normalize(header))},Headers.prototype.keys=function(){return MapWrapper.keys(this._headersMap)},Headers.prototype.set=function(header,value){var list=[];if(isListLikeIterable(value)){var pushValue=value.join(",");list.push(pushValue)}else list.push(value);this._headersMap.set(normalize(header),list)},Headers.prototype.values=function(){return MapWrapper.values(this._headersMap)},Headers.prototype.toJSON=function(){var serializableHeaders={};return this._headersMap.forEach(function(values,name){var list=[];iterateListLike(values,function(val){return list=ListWrapper.concat(list,val.split(","))}),serializableHeaders[normalize(name)]=list}),serializableHeaders},Headers.prototype.getAll=function(header){var headers=this._headersMap.get(normalize(header));return isListLikeIterable(headers)?headers:[]},Headers.prototype.entries=function(){throw new Error('"entries" method is not implemented on Headers class')},Headers}(),__extends$1=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},ResponseOptions=function(){function ResponseOptions(_a){var _b=void 0===_a?{}:_a,body=_b.body,status=_b.status,headers=_b.headers,statusText=_b.statusText,type=_b.type,url=_b.url;this.body=isPresent(body)?body:null,this.status=isPresent(status)?status:null,this.headers=isPresent(headers)?headers:null,this.statusText=isPresent(statusText)?statusText:null,this.type=isPresent(type)?type:null,this.url=isPresent(url)?url:null}return ResponseOptions.prototype.merge=function(options){return new ResponseOptions({body:isPresent(options)&&isPresent(options.body)?options.body:this.body,status:isPresent(options)&&isPresent(options.status)?options.status:this.status,headers:isPresent(options)&&isPresent(options.headers)?options.headers:this.headers,statusText:isPresent(options)&&isPresent(options.statusText)?options.statusText:this.statusText,type:isPresent(options)&&isPresent(options.type)?options.type:this.type,url:isPresent(options)&&isPresent(options.url)?options.url:this.url})},ResponseOptions}(),BaseResponseOptions=function(_super){function BaseResponseOptions(){_super.call(this,{status:200,statusText:"Ok",type:exports.ResponseType.Default,headers:new Headers})}return __extends$1(BaseResponseOptions,_super),BaseResponseOptions.decorators=[{type:_angular_core.Injectable}],BaseResponseOptions.ctorParameters=[],BaseResponseOptions}(ResponseOptions),ConnectionBackend=function(){function ConnectionBackend(){}return ConnectionBackend}(),Connection=function(){function Connection(){}return Connection}(),XSRFStrategy=function(){function XSRFStrategy(){}return XSRFStrategy}(),isSuccess=function(status){return status>=200&&status<300},QueryEncoder=function(){function QueryEncoder(){}return QueryEncoder.prototype.encodeKey=function(k){return standardEncoding(k)},QueryEncoder.prototype.encodeValue=function(v){return standardEncoding(v)},QueryEncoder}(),URLSearchParams=function(){function URLSearchParams(rawParams,queryEncoder){void 0===rawParams&&(rawParams=""),void 0===queryEncoder&&(queryEncoder=new QueryEncoder),this.rawParams=rawParams,this.queryEncoder=queryEncoder,this.paramsMap=paramParser(rawParams)}return URLSearchParams.prototype.clone=function(){var clone=new URLSearchParams("",this.queryEncoder);return clone.appendAll(this),clone},URLSearchParams.prototype.has=function(param){return this.paramsMap.has(param)},URLSearchParams.prototype.get=function(param){var storedParam=this.paramsMap.get(param);return Array.isArray(storedParam)?storedParam[0]:null},URLSearchParams.prototype.getAll=function(param){return this.paramsMap.get(param)||[]},URLSearchParams.prototype.set=function(param,val){var list=this.paramsMap.get(param)||[];list.length=0,list.push(val),this.paramsMap.set(param,list)},URLSearchParams.prototype.setAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0,list.push(value[0]),_this.paramsMap.set(param,list)})},URLSearchParams.prototype.append=function(param,val){var list=this.paramsMap.get(param)||[];list.push(val),this.paramsMap.set(param,list)},URLSearchParams.prototype.appendAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){for(var list=_this.paramsMap.get(param)||[],i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.replaceAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0;for(var i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.toString=function(){var _this=this,paramsList=[];return this.paramsMap.forEach(function(values,k){values.forEach(function(v){return paramsList.push(_this.queryEncoder.encodeKey(k)+"="+_this.queryEncoder.encodeValue(v))})}),paramsList.join("&")},URLSearchParams.prototype.delete=function(param){this.paramsMap.delete(param)},URLSearchParams}(),Body=function(){function Body(){}return Body.prototype.json=function(){return isString(this._body)?Json.parse(this._body):this._body instanceof ArrayBuffer?Json.parse(this.text()):this._body},Body.prototype.text=function(){return this._body instanceof URLSearchParams?this._body.toString():this._body instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(this._body)):null===this._body?"":isJsObject(this._body)?Json.stringify(this._body):this._body.toString()},Body.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:stringToArrayBuffer(this.text())},Body.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},Body}(),__extends$2=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Response=function(_super){function Response(responseOptions){_super.call(this),this._body=responseOptions.body,this.status=responseOptions.status,this.ok=this.status>=200&&this.status<=299,this.statusText=responseOptions.statusText,this.headers=responseOptions.headers,this.type=responseOptions.type,this.url=responseOptions.url}return __extends$2(Response,_super),Response.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},Response}(Body),_nextRequestId=0,JSONP_HOME="__ng_jsonp__",_jsonpConnections=null,BrowserJsonp=function(){function BrowserJsonp(){}return BrowserJsonp.prototype.build=function(url){var node=document.createElement("script");return node.src=url,node},BrowserJsonp.prototype.nextRequestID=function(){return"__req"+_nextRequestId++},BrowserJsonp.prototype.requestCallback=function(id){return JSONP_HOME+"."+id+".finished"},BrowserJsonp.prototype.exposeConnection=function(id,connection){var connections=_getJsonpConnections();connections[id]=connection},BrowserJsonp.prototype.removeConnection=function(id){var connections=_getJsonpConnections();connections[id]=null},BrowserJsonp.prototype.send=function(node){document.body.appendChild(node)},BrowserJsonp.prototype.cleanup=function(node){node.parentNode&&node.parentNode.removeChild(node)},BrowserJsonp.decorators=[{type:_angular_core.Injectable}],BrowserJsonp.ctorParameters=[],BrowserJsonp}(),__extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},JSONP_ERR_NO_CALLBACK="JSONP injected script did not invoke callback.",JSONP_ERR_WRONG_METHOD="JSONP requests must use GET request method.",JSONPConnection=function(){function JSONPConnection(){}return JSONPConnection}(),JSONPConnection_=function(_super){function JSONPConnection_(req,_dom,baseResponseOptions){var _this=this;if(_super.call(this),this._dom=_dom,this.baseResponseOptions=baseResponseOptions,this._finished=!1,req.method!==exports.RequestMethod.Get)throw new TypeError(JSONP_ERR_WRONG_METHOD);this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){_this.readyState=exports.ReadyState.Loading;var id=_this._id=_dom.nextRequestID();_dom.exposeConnection(id,_this);var callback=_dom.requestCallback(_this._id),url=req.url;url.indexOf("=JSONP_CALLBACK&")>-1?url=StringWrapper.replace(url,"=JSONP_CALLBACK&","="+callback+"&"):url.lastIndexOf("=JSONP_CALLBACK")===url.length-"=JSONP_CALLBACK".length&&(url=url.substring(0,url.length-"=JSONP_CALLBACK".length)+("="+callback));var script=_this._script=_dom.build(url),onLoad=function(event){if(_this.readyState!==exports.ReadyState.Cancelled){if(_this.readyState=exports.ReadyState.Done,_dom.cleanup(script),!_this._finished){var responseOptions_1=new ResponseOptions({body:JSONP_ERR_NO_CALLBACK,type:exports.ResponseType.Error,url:url});return isPresent(baseResponseOptions)&&(responseOptions_1=baseResponseOptions.merge(responseOptions_1)),void responseObserver.error(new Response(responseOptions_1))}var responseOptions=new ResponseOptions({body:_this._responseData,url:url});isPresent(_this.baseResponseOptions)&&(responseOptions=_this.baseResponseOptions.merge(responseOptions)),responseObserver.next(new Response(responseOptions)),responseObserver.complete()}},onError=function(error){if(_this.readyState!==exports.ReadyState.Cancelled){_this.readyState=exports.ReadyState.Done,_dom.cleanup(script);var responseOptions=new ResponseOptions({body:error.message,type:exports.ResponseType.Error});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))}};return script.addEventListener("load",onLoad),script.addEventListener("error",onError),_dom.send(script),function(){_this.readyState=exports.ReadyState.Cancelled,script.removeEventListener("load",onLoad),script.removeEventListener("error",onError),isPresent(script)&&_this._dom.cleanup(script)}})}return __extends(JSONPConnection_,_super),JSONPConnection_.prototype.finished=function(data){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==exports.ReadyState.Cancelled&&(this._responseData=data)},JSONPConnection_}(JSONPConnection),JSONPBackend=function(_super){function JSONPBackend(){_super.apply(this,arguments)}return __extends(JSONPBackend,_super),JSONPBackend}(ConnectionBackend),JSONPBackend_=function(_super){function JSONPBackend_(_browserJSONP,_baseResponseOptions){_super.call(this),this._browserJSONP=_browserJSONP,this._baseResponseOptions=_baseResponseOptions}return __extends(JSONPBackend_,_super),JSONPBackend_.prototype.createConnection=function(request){return new JSONPConnection_(request,this._browserJSONP,this._baseResponseOptions)},JSONPBackend_.decorators=[{type:_angular_core.Injectable}],JSONPBackend_.ctorParameters=[{type:BrowserJsonp},{type:ResponseOptions}],JSONPBackend_}(JSONPBackend),XSSI_PREFIX=/^\)\]\}',?\n/,XHRConnection=function(){function XHRConnection(req,browserXHR,baseResponseOptions){var _this=this;this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){var _xhr=browserXHR.build();_xhr.open(exports.RequestMethod[req.method].toUpperCase(),req.url),isPresent(req.withCredentials)&&(_xhr.withCredentials=req.withCredentials);var onLoad=function(){var body=isPresent(_xhr.response)?_xhr.response:_xhr.responseText;isString(body)&&(body=body.replace(XSSI_PREFIX,""));var headers=Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders()),url=getResponseURL(_xhr),status=1223===_xhr.status?204:_xhr.status;0===status&&(status=body?200:0);var statusText=_xhr.statusText||"OK",responseOptions=new ResponseOptions({body:body,status:status,headers:headers,statusText:statusText,url:url});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions));var response=new Response(responseOptions);return response.ok=isSuccess(status),response.ok?(responseObserver.next(response),void responseObserver.complete()):void responseObserver.error(response)},onError=function(err){var responseOptions=new ResponseOptions({body:err,type:exports.ResponseType.Error,status:_xhr.status,statusText:_xhr.statusText});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))};if(_this.setDetectedContentType(req,_xhr),isPresent(req.headers)&&req.headers.forEach(function(values,name){return _xhr.setRequestHeader(name,values.join(","))}),isPresent(req.responseType)&&isPresent(_xhr.responseType))switch(req.responseType){case exports.ResponseContentType.ArrayBuffer:_xhr.responseType="arraybuffer";break;case exports.ResponseContentType.Json:_xhr.responseType="json";break;case exports.ResponseContentType.Text:_xhr.responseType="text";break;case exports.ResponseContentType.Blob:_xhr.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return _xhr.addEventListener("load",onLoad),_xhr.addEventListener("error",onError),_xhr.send(_this.request.getBody()),function(){_xhr.removeEventListener("load",onLoad),_xhr.removeEventListener("error",onError),_xhr.abort()}})}return XHRConnection.prototype.setDetectedContentType=function(req,_xhr){if(!isPresent(req.headers)||!isPresent(req.headers.get("Content-Type")))switch(req.contentType){case ContentType.NONE:break;case ContentType.JSON:_xhr.setRequestHeader("content-type","application/json");break;case ContentType.FORM:_xhr.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case ContentType.TEXT:_xhr.setRequestHeader("content-type","text/plain");break;case ContentType.BLOB:var blob=req.blob();blob.type&&_xhr.setRequestHeader("content-type",blob.type)}},XHRConnection}(),CookieXSRFStrategy=function(){function CookieXSRFStrategy(_cookieName,_headerName){void 0===_cookieName&&(_cookieName="XSRF-TOKEN"),void 0===_headerName&&(_headerName="X-XSRF-TOKEN"),this._cookieName=_cookieName,this._headerName=_headerName}return CookieXSRFStrategy.prototype.configureRequest=function(req){var xsrfToken=_angular_platformBrowser.__platform_browser_private__.getDOM().getCookie(this._cookieName);xsrfToken&&!req.headers.has(this._headerName)&&req.headers.set(this._headerName,xsrfToken)},CookieXSRFStrategy}(),XHRBackend=function(){function XHRBackend(_browserXHR,_baseResponseOptions,_xsrfStrategy){this._browserXHR=_browserXHR,this._baseResponseOptions=_baseResponseOptions,this._xsrfStrategy=_xsrfStrategy}return XHRBackend.prototype.createConnection=function(request){return this._xsrfStrategy.configureRequest(request),new XHRConnection(request,this._browserXHR,this._baseResponseOptions)},XHRBackend.decorators=[{type:_angular_core.Injectable}],XHRBackend.ctorParameters=[{type:BrowserXhr},{type:ResponseOptions},{type:XSRFStrategy}],XHRBackend}(),__extends$3=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},RequestOptions=function(){function RequestOptions(_a){var _b=void 0===_a?{}:_a,method=_b.method,headers=_b.headers,body=_b.body,url=_b.url,search=_b.search,withCredentials=_b.withCredentials,responseType=_b.responseType;this.method=isPresent(method)?normalizeMethodName(method):null,this.headers=isPresent(headers)?headers:null,this.body=isPresent(body)?body:null,this.url=isPresent(url)?url:null,this.search=isPresent(search)?isString(search)?new URLSearchParams(search):search:null,this.withCredentials=isPresent(withCredentials)?withCredentials:null,this.responseType=isPresent(responseType)?responseType:null}return RequestOptions.prototype.merge=function(options){return new RequestOptions({method:isPresent(options)&&isPresent(options.method)?options.method:this.method,headers:isPresent(options)&&isPresent(options.headers)?options.headers:this.headers,body:isPresent(options)&&isPresent(options.body)?options.body:this.body,url:isPresent(options)&&isPresent(options.url)?options.url:this.url,search:isPresent(options)&&isPresent(options.search)?isString(options.search)?new URLSearchParams(options.search):options.search.clone():this.search,withCredentials:isPresent(options)&&isPresent(options.withCredentials)?options.withCredentials:this.withCredentials,responseType:isPresent(options)&&isPresent(options.responseType)?options.responseType:this.responseType})},RequestOptions}(),BaseRequestOptions=function(_super){function BaseRequestOptions(){_super.call(this,{method:exports.RequestMethod.Get,headers:new Headers})}return __extends$3(BaseRequestOptions,_super),BaseRequestOptions.decorators=[{type:_angular_core.Injectable}],BaseRequestOptions.ctorParameters=[],BaseRequestOptions}(RequestOptions),__extends$5=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Request=function(_super){function Request(requestOptions){_super.call(this);var url=requestOptions.url;if(this.url=requestOptions.url,isPresent(requestOptions.search)){var search=requestOptions.search.toString();if(search.length>0){var prefix="?";StringWrapper.contains(this.url,"?")&&(prefix="&"==this.url[this.url.length-1]?"":"&"),this.url=url+prefix+search}}this._body=requestOptions.body,this.method=normalizeMethodName(requestOptions.method),this.headers=new Headers(requestOptions.headers),this.contentType=this.detectContentType(),this.withCredentials=requestOptions.withCredentials,this.responseType=requestOptions.responseType}return __extends$5(Request,_super),Request.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return ContentType.JSON;case"application/x-www-form-urlencoded":return ContentType.FORM;case"multipart/form-data":return ContentType.FORM_DATA;case"text/plain":case"text/html":return ContentType.TEXT;case"application/octet-stream":return ContentType.BLOB;default:return this.detectContentTypeFromBody()}},Request.prototype.detectContentTypeFromBody=function(){return null==this._body?ContentType.NONE:this._body instanceof URLSearchParams?ContentType.FORM:this._body instanceof FormData?ContentType.FORM_DATA:this._body instanceof Blob$1?ContentType.BLOB:this._body instanceof ArrayBuffer$1?ContentType.ARRAY_BUFFER:this._body&&"object"==typeof this._body?ContentType.JSON:ContentType.TEXT},Request.prototype.getBody=function(){switch(this.contentType){case ContentType.JSON:return this.text();case ContentType.FORM:return this.text();case ContentType.FORM_DATA:return this._body;case ContentType.TEXT:return this.text();case ContentType.BLOB:return this.blob();case ContentType.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},Request}(Body),noop$1=function(){},w="object"==typeof window?window:noop$1,FormData=w.FormData||noop$1,Blob$1=w.Blob||noop$1,ArrayBuffer$1=w.ArrayBuffer||noop$1,__extends$4=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Http=function(){function Http(_backend,_defaultOptions){this._backend=_backend,this._defaultOptions=_defaultOptions}return Http.prototype.request=function(url,options){var responseObservable;if(isString(url))responseObservable=httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url)));else{if(!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");responseObservable=httpRequest(this._backend,url)}return responseObservable},Http.prototype.get=function(url,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url)))},Http.prototype.post=function(url,body,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Post,url)))},Http.prototype.put=function(url,body,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Put,url)))},Http.prototype.delete=function(url,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Delete,url)))},Http.prototype.patch=function(url,body,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Patch,url)))},Http.prototype.head=function(url,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Head,url)))},Http.prototype.options=function(url,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Options,url)))},Http.decorators=[{type:_angular_core.Injectable}],Http.ctorParameters=[{type:ConnectionBackend},{type:RequestOptions}],Http}(),Jsonp=function(_super){function Jsonp(backend,defaultOptions){_super.call(this,backend,defaultOptions)}return __extends$4(Jsonp,_super),Jsonp.prototype.request=function(url,options){var responseObservable;if(isString(url)&&(url=new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url))),!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");if(url.method!==exports.RequestMethod.Get)throw new Error("JSONP requests must use GET request method.");return responseObservable=httpRequest(this._backend,url)},Jsonp.decorators=[{type:_angular_core.Injectable}],Jsonp.ctorParameters=[{type:ConnectionBackend},{type:RequestOptions}],Jsonp}(Http),HttpModule=function(){function HttpModule(){}return HttpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Http,useFactory:httpFactory,deps:[XHRBackend,RequestOptions]},BrowserXhr,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},XHRBackend,{provide:XSRFStrategy,useFactory:_createDefaultCookieXSRFStrategy}]}]}],HttpModule.ctorParameters=[],HttpModule}(),JsonpModule=function(){function JsonpModule(){}return JsonpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Jsonp,useFactory:jsonpFactory,deps:[JSONPBackend,RequestOptions]},BrowserJsonp,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},{provide:JSONPBackend,useClass:JSONPBackend_}]}]}],JsonpModule.ctorParameters=[],JsonpModule}();exports.BrowserXhr=BrowserXhr,exports.JSONPBackend=JSONPBackend,exports.JSONPConnection=JSONPConnection,exports.CookieXSRFStrategy=CookieXSRFStrategy,exports.XHRBackend=XHRBackend,exports.XHRConnection=XHRConnection,exports.BaseRequestOptions=BaseRequestOptions,exports.RequestOptions=RequestOptions,exports.BaseResponseOptions=BaseResponseOptions,exports.ResponseOptions=ResponseOptions,exports.Headers=Headers,exports.Http=Http,exports.Jsonp=Jsonp,exports.HttpModule=HttpModule,exports.JsonpModule=JsonpModule,exports.Connection=Connection,exports.ConnectionBackend=ConnectionBackend,exports.XSRFStrategy=XSRFStrategy,exports.Request=Request,exports.Response=Response,exports.QueryEncoder=QueryEncoder,exports.URLSearchParams=URLSearchParams}); | ||
exports.RequestMethod,function(RequestMethod){RequestMethod[RequestMethod.Get=0]="Get",RequestMethod[RequestMethod.Post=1]="Post",RequestMethod[RequestMethod.Put=2]="Put",RequestMethod[RequestMethod.Delete=3]="Delete",RequestMethod[RequestMethod.Options=4]="Options",RequestMethod[RequestMethod.Head=5]="Head",RequestMethod[RequestMethod.Patch=6]="Patch"}(exports.RequestMethod||(exports.RequestMethod={})),exports.ReadyState,function(ReadyState){ReadyState[ReadyState.Unsent=0]="Unsent",ReadyState[ReadyState.Open=1]="Open",ReadyState[ReadyState.HeadersReceived=2]="HeadersReceived",ReadyState[ReadyState.Loading=3]="Loading",ReadyState[ReadyState.Done=4]="Done",ReadyState[ReadyState.Cancelled=5]="Cancelled"}(exports.ReadyState||(exports.ReadyState={})),exports.ResponseType,function(ResponseType){ResponseType[ResponseType.Basic=0]="Basic",ResponseType[ResponseType.Cors=1]="Cors",ResponseType[ResponseType.Default=2]="Default",ResponseType[ResponseType.Error=3]="Error",ResponseType[ResponseType.Opaque=4]="Opaque"}(exports.ResponseType||(exports.ResponseType={}));var ContentType;!function(ContentType){ContentType[ContentType.NONE=0]="NONE",ContentType[ContentType.JSON=1]="JSON",ContentType[ContentType.FORM=2]="FORM",ContentType[ContentType.FORM_DATA=3]="FORM_DATA",ContentType[ContentType.TEXT=4]="TEXT",ContentType[ContentType.BLOB=5]="BLOB",ContentType[ContentType.ARRAY_BUFFER=6]="ARRAY_BUFFER"}(ContentType||(ContentType={})),exports.ResponseContentType,function(ResponseContentType){ResponseContentType[ResponseContentType.Text=0]="Text",ResponseContentType[ResponseContentType.Json=1]="Json",ResponseContentType[ResponseContentType.ArrayBuffer=2]="ArrayBuffer",ResponseContentType[ResponseContentType.Blob=3]="Blob"}(exports.ResponseContentType||(exports.ResponseContentType={}));var createMapFromPairs=function(){try{if(1===new Map([[1,2]]).size)return function(pairs){return new Map(pairs)}}catch(e){}return function(pairs){for(var map=new Map,i=0;i<pairs.length;i++){var pair=pairs[i];map.set(pair[0],pair[1])}return map}}(),_arrayFromMap=(function(){return(new Map).keys().next?function(m){for(var k,keyIterator=m.keys();!(k=keyIterator.next()).done;)m.set(k.value,null)}:function(m){m.forEach(function(v,k){m.set(k,null)})}}(),function(){try{if((new Map).values().next)return function(m,getValues){return getValues?Array.from(m.values()):Array.from(m.keys())}}catch(e){}return function(m,getValues){var res=new Array(m.size),i=0;return m.forEach(function(v,k){res[i]=getValues?v:k,i++}),res}}()),MapWrapper=function(){function MapWrapper(){}return MapWrapper.createFromStringMap=function(stringMap){var result=new Map;for(var prop in stringMap)result.set(prop,stringMap[prop]);return result},MapWrapper.toStringMap=function(m){var r={};return m.forEach(function(v,k){return r[k]=v}),r},MapWrapper.createFromPairs=function(pairs){return createMapFromPairs(pairs)},MapWrapper.iterable=function(m){return m},MapWrapper.keys=function(m){return _arrayFromMap(m,!1)},MapWrapper.values=function(m){return _arrayFromMap(m,!0)},MapWrapper}(),Headers=function(){function Headers(headers){var _this=this;if(this._headers=new Map,this._normalizedNames=new Map,headers)return headers instanceof Headers?void headers._headers.forEach(function(value,name){var lcName=name.toLowerCase();_this._headers.set(lcName,value),_this.mayBeSetNormalizedName(name)}):void Object.keys(headers).forEach(function(name){var value=headers[name],lcName=name.toLowerCase();_this._headers.set(lcName,Array.isArray(value)?value:[value]),_this.mayBeSetNormalizedName(name)})}return Headers.fromResponseHeaderString=function(headersString){var headers=new Headers;return headersString.split("\n").forEach(function(line){var index=line.indexOf(":");if(index>0){var name_1=line.slice(0,index),value=line.slice(index+1).trim();headers.set(name_1,value)}}),headers},Headers.prototype.append=function(name,value){var values=this.getAll(name);this.set(name,null===values?[value]:values.concat([value]))},Headers.prototype.delete=function(name){var lcName=name.toLowerCase();this._normalizedNames.delete(lcName),this._headers.delete(lcName)},Headers.prototype.forEach=function(fn){var _this=this;this._headers.forEach(function(values,lcName){return fn(values,_this._normalizedNames.get(lcName),_this._headers)})},Headers.prototype.get=function(name){var values=this.getAll(name);return null===values?null:values.length>0?values[0]:null},Headers.prototype.has=function(name){return this._headers.has(name.toLowerCase())},Headers.prototype.keys=function(){return MapWrapper.values(this._normalizedNames)},Headers.prototype.set=function(name,value){var strValue=Array.isArray(value)?value.join(","):value;this._headers.set(name.toLowerCase(),[strValue]),this.mayBeSetNormalizedName(name)},Headers.prototype.values=function(){return MapWrapper.values(this._headers)},Headers.prototype.toJSON=function(){var _this=this,serialized={};return this._headers.forEach(function(values,name){var split=[];values.forEach(function(v){return split.push.apply(split,v.split(","))}),serialized[_this._normalizedNames.get(name)]=split}),serialized},Headers.prototype.getAll=function(name){return this.has(name)?this._headers.get(name.toLowerCase()):null},Headers.prototype.entries=function(){throw new Error('"entries" method is not implemented on Headers class')},Headers.prototype.mayBeSetNormalizedName=function(name){var lcName=name.toLowerCase();this._normalizedNames.has(lcName)||this._normalizedNames.set(lcName,name)},Headers}(),__extends$1=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},ResponseOptions=function(){function ResponseOptions(_a){var _b=void 0===_a?{}:_a,body=_b.body,status=_b.status,headers=_b.headers,statusText=_b.statusText,type=_b.type,url=_b.url;this.body=isPresent(body)?body:null,this.status=isPresent(status)?status:null,this.headers=isPresent(headers)?headers:null,this.statusText=isPresent(statusText)?statusText:null,this.type=isPresent(type)?type:null,this.url=isPresent(url)?url:null}return ResponseOptions.prototype.merge=function(options){return new ResponseOptions({body:isPresent(options)&&isPresent(options.body)?options.body:this.body,status:isPresent(options)&&isPresent(options.status)?options.status:this.status,headers:isPresent(options)&&isPresent(options.headers)?options.headers:this.headers,statusText:isPresent(options)&&isPresent(options.statusText)?options.statusText:this.statusText,type:isPresent(options)&&isPresent(options.type)?options.type:this.type,url:isPresent(options)&&isPresent(options.url)?options.url:this.url})},ResponseOptions}(),BaseResponseOptions=function(_super){function BaseResponseOptions(){_super.call(this,{status:200,statusText:"Ok",type:exports.ResponseType.Default,headers:new Headers})}return __extends$1(BaseResponseOptions,_super),BaseResponseOptions.decorators=[{type:_angular_core.Injectable}],BaseResponseOptions.ctorParameters=[],BaseResponseOptions}(ResponseOptions),ConnectionBackend=function(){function ConnectionBackend(){}return ConnectionBackend}(),Connection=function(){function Connection(){}return Connection}(),XSRFStrategy=function(){function XSRFStrategy(){}return XSRFStrategy}(),isSuccess=function(status){return status>=200&&status<300},QueryEncoder=function(){function QueryEncoder(){}return QueryEncoder.prototype.encodeKey=function(k){return standardEncoding(k)},QueryEncoder.prototype.encodeValue=function(v){return standardEncoding(v)},QueryEncoder}(),URLSearchParams=function(){function URLSearchParams(rawParams,queryEncoder){void 0===rawParams&&(rawParams=""),void 0===queryEncoder&&(queryEncoder=new QueryEncoder),this.rawParams=rawParams,this.queryEncoder=queryEncoder,this.paramsMap=paramParser(rawParams)}return URLSearchParams.prototype.clone=function(){var clone=new URLSearchParams("",this.queryEncoder);return clone.appendAll(this),clone},URLSearchParams.prototype.has=function(param){return this.paramsMap.has(param)},URLSearchParams.prototype.get=function(param){var storedParam=this.paramsMap.get(param);return Array.isArray(storedParam)?storedParam[0]:null},URLSearchParams.prototype.getAll=function(param){return this.paramsMap.get(param)||[]},URLSearchParams.prototype.set=function(param,val){if(void 0===val||null===val)return void this.delete(param);var list=this.paramsMap.get(param)||[];list.length=0,list.push(val),this.paramsMap.set(param,list)},URLSearchParams.prototype.setAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0,list.push(value[0]),_this.paramsMap.set(param,list)})},URLSearchParams.prototype.append=function(param,val){if(void 0!==val&&null!==val){var list=this.paramsMap.get(param)||[];list.push(val),this.paramsMap.set(param,list)}},URLSearchParams.prototype.appendAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){for(var list=_this.paramsMap.get(param)||[],i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.replaceAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0;for(var i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.toString=function(){var _this=this,paramsList=[];return this.paramsMap.forEach(function(values,k){values.forEach(function(v){return paramsList.push(_this.queryEncoder.encodeKey(k)+"="+_this.queryEncoder.encodeValue(v))})}),paramsList.join("&")},URLSearchParams.prototype.delete=function(param){this.paramsMap.delete(param)},URLSearchParams}(),Body=function(){function Body(){}return Body.prototype.json=function(){return isString(this._body)?Json.parse(this._body):this._body instanceof ArrayBuffer?Json.parse(this.text()):this._body},Body.prototype.text=function(){return this._body instanceof URLSearchParams?this._body.toString():this._body instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(this._body)):null===this._body?"":isJsObject(this._body)?Json.stringify(this._body):this._body.toString()},Body.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:stringToArrayBuffer(this.text())},Body.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},Body}(),__extends$2=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Response=function(_super){function Response(responseOptions){_super.call(this),this._body=responseOptions.body,this.status=responseOptions.status,this.ok=this.status>=200&&this.status<=299,this.statusText=responseOptions.statusText,this.headers=responseOptions.headers,this.type=responseOptions.type,this.url=responseOptions.url}return __extends$2(Response,_super),Response.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},Response}(Body),_nextRequestId=0,JSONP_HOME="__ng_jsonp__",_jsonpConnections=null,BrowserJsonp=function(){function BrowserJsonp(){}return BrowserJsonp.prototype.build=function(url){var node=document.createElement("script");return node.src=url,node},BrowserJsonp.prototype.nextRequestID=function(){return"__req"+_nextRequestId++},BrowserJsonp.prototype.requestCallback=function(id){return JSONP_HOME+"."+id+".finished"},BrowserJsonp.prototype.exposeConnection=function(id,connection){var connections=_getJsonpConnections();connections[id]=connection},BrowserJsonp.prototype.removeConnection=function(id){var connections=_getJsonpConnections();connections[id]=null},BrowserJsonp.prototype.send=function(node){document.body.appendChild(node)},BrowserJsonp.prototype.cleanup=function(node){node.parentNode&&node.parentNode.removeChild(node)},BrowserJsonp.decorators=[{type:_angular_core.Injectable}],BrowserJsonp.ctorParameters=[],BrowserJsonp}(),__extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},JSONP_ERR_NO_CALLBACK="JSONP injected script did not invoke callback.",JSONP_ERR_WRONG_METHOD="JSONP requests must use GET request method.",JSONPConnection=function(){function JSONPConnection(){}return JSONPConnection}(),JSONPConnection_=function(_super){function JSONPConnection_(req,_dom,baseResponseOptions){var _this=this;if(_super.call(this),this._dom=_dom,this.baseResponseOptions=baseResponseOptions,this._finished=!1,req.method!==exports.RequestMethod.Get)throw new TypeError(JSONP_ERR_WRONG_METHOD);this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){_this.readyState=exports.ReadyState.Loading;var id=_this._id=_dom.nextRequestID();_dom.exposeConnection(id,_this);var callback=_dom.requestCallback(_this._id),url=req.url;url.indexOf("=JSONP_CALLBACK&")>-1?url=StringWrapper.replace(url,"=JSONP_CALLBACK&","="+callback+"&"):url.lastIndexOf("=JSONP_CALLBACK")===url.length-"=JSONP_CALLBACK".length&&(url=url.substring(0,url.length-"=JSONP_CALLBACK".length)+("="+callback));var script=_this._script=_dom.build(url),onLoad=function(event){if(_this.readyState!==exports.ReadyState.Cancelled){if(_this.readyState=exports.ReadyState.Done,_dom.cleanup(script),!_this._finished){var responseOptions_1=new ResponseOptions({body:JSONP_ERR_NO_CALLBACK,type:exports.ResponseType.Error,url:url});return isPresent(baseResponseOptions)&&(responseOptions_1=baseResponseOptions.merge(responseOptions_1)),void responseObserver.error(new Response(responseOptions_1))}var responseOptions=new ResponseOptions({body:_this._responseData,url:url});isPresent(_this.baseResponseOptions)&&(responseOptions=_this.baseResponseOptions.merge(responseOptions)),responseObserver.next(new Response(responseOptions)),responseObserver.complete()}},onError=function(error){if(_this.readyState!==exports.ReadyState.Cancelled){_this.readyState=exports.ReadyState.Done,_dom.cleanup(script);var responseOptions=new ResponseOptions({body:error.message,type:exports.ResponseType.Error});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))}};return script.addEventListener("load",onLoad),script.addEventListener("error",onError),_dom.send(script),function(){_this.readyState=exports.ReadyState.Cancelled,script.removeEventListener("load",onLoad),script.removeEventListener("error",onError),isPresent(script)&&_this._dom.cleanup(script)}})}return __extends(JSONPConnection_,_super),JSONPConnection_.prototype.finished=function(data){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==exports.ReadyState.Cancelled&&(this._responseData=data)},JSONPConnection_}(JSONPConnection),JSONPBackend=function(_super){function JSONPBackend(){_super.apply(this,arguments)}return __extends(JSONPBackend,_super),JSONPBackend}(ConnectionBackend),JSONPBackend_=function(_super){function JSONPBackend_(_browserJSONP,_baseResponseOptions){_super.call(this),this._browserJSONP=_browserJSONP,this._baseResponseOptions=_baseResponseOptions}return __extends(JSONPBackend_,_super),JSONPBackend_.prototype.createConnection=function(request){return new JSONPConnection_(request,this._browserJSONP,this._baseResponseOptions)},JSONPBackend_.decorators=[{type:_angular_core.Injectable}],JSONPBackend_.ctorParameters=[{type:BrowserJsonp},{type:ResponseOptions}],JSONPBackend_}(JSONPBackend),XSSI_PREFIX=/^\)\]\}',?\n/,XHRConnection=function(){function XHRConnection(req,browserXHR,baseResponseOptions){var _this=this;this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){var _xhr=browserXHR.build();_xhr.open(exports.RequestMethod[req.method].toUpperCase(),req.url),isPresent(req.withCredentials)&&(_xhr.withCredentials=req.withCredentials);var onLoad=function(){var body=void 0===_xhr.response?_xhr.responseText:_xhr.response;isString(body)&&(body=body.replace(XSSI_PREFIX,""));var headers=Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders()),url=getResponseURL(_xhr),status=1223===_xhr.status?204:_xhr.status;0===status&&(status=body?200:0);var statusText=_xhr.statusText||"OK",responseOptions=new ResponseOptions({body:body,status:status,headers:headers,statusText:statusText,url:url});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions));var response=new Response(responseOptions);return response.ok=isSuccess(status),response.ok?(responseObserver.next(response),void responseObserver.complete()):void responseObserver.error(response)},onError=function(err){var responseOptions=new ResponseOptions({body:err,type:exports.ResponseType.Error,status:_xhr.status,statusText:_xhr.statusText});isPresent(baseResponseOptions)&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))};if(_this.setDetectedContentType(req,_xhr),isPresent(req.headers)&&req.headers.forEach(function(values,name){return _xhr.setRequestHeader(name,values.join(","))}),isPresent(req.responseType)&&isPresent(_xhr.responseType))switch(req.responseType){case exports.ResponseContentType.ArrayBuffer:_xhr.responseType="arraybuffer";break;case exports.ResponseContentType.Json:_xhr.responseType="json";break;case exports.ResponseContentType.Text:_xhr.responseType="text";break;case exports.ResponseContentType.Blob:_xhr.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return _xhr.addEventListener("load",onLoad),_xhr.addEventListener("error",onError),_xhr.send(_this.request.getBody()),function(){_xhr.removeEventListener("load",onLoad),_xhr.removeEventListener("error",onError),_xhr.abort()}})}return XHRConnection.prototype.setDetectedContentType=function(req,_xhr){if(!isPresent(req.headers)||!isPresent(req.headers.get("Content-Type")))switch(req.contentType){case ContentType.NONE:break;case ContentType.JSON:_xhr.setRequestHeader("content-type","application/json");break;case ContentType.FORM:_xhr.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case ContentType.TEXT:_xhr.setRequestHeader("content-type","text/plain");break;case ContentType.BLOB:var blob=req.blob();blob.type&&_xhr.setRequestHeader("content-type",blob.type)}},XHRConnection}(),CookieXSRFStrategy=function(){function CookieXSRFStrategy(_cookieName,_headerName){void 0===_cookieName&&(_cookieName="XSRF-TOKEN"),void 0===_headerName&&(_headerName="X-XSRF-TOKEN"),this._cookieName=_cookieName,this._headerName=_headerName}return CookieXSRFStrategy.prototype.configureRequest=function(req){var xsrfToken=_angular_platformBrowser.__platform_browser_private__.getDOM().getCookie(this._cookieName);xsrfToken&&!req.headers.has(this._headerName)&&req.headers.set(this._headerName,xsrfToken)},CookieXSRFStrategy}(),XHRBackend=function(){function XHRBackend(_browserXHR,_baseResponseOptions,_xsrfStrategy){this._browserXHR=_browserXHR,this._baseResponseOptions=_baseResponseOptions,this._xsrfStrategy=_xsrfStrategy}return XHRBackend.prototype.createConnection=function(request){return this._xsrfStrategy.configureRequest(request),new XHRConnection(request,this._browserXHR,this._baseResponseOptions)},XHRBackend.decorators=[{type:_angular_core.Injectable}],XHRBackend.ctorParameters=[{type:BrowserXhr},{type:ResponseOptions},{type:XSRFStrategy}],XHRBackend}(),__extends$3=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},RequestOptions=function(){function RequestOptions(_a){var _b=void 0===_a?{}:_a,method=_b.method,headers=_b.headers,body=_b.body,url=_b.url,search=_b.search,withCredentials=_b.withCredentials,responseType=_b.responseType;this.method=isPresent(method)?normalizeMethodName(method):null,this.headers=isPresent(headers)?headers:null,this.body=isPresent(body)?body:null,this.url=isPresent(url)?url:null,this.search=isPresent(search)?isString(search)?new URLSearchParams(search):search:null,this.withCredentials=isPresent(withCredentials)?withCredentials:null,this.responseType=isPresent(responseType)?responseType:null}return RequestOptions.prototype.merge=function(options){return new RequestOptions({method:isPresent(options)&&isPresent(options.method)?options.method:this.method,headers:isPresent(options)&&isPresent(options.headers)?options.headers:this.headers,body:isPresent(options)&&isPresent(options.body)?options.body:this.body,url:isPresent(options)&&isPresent(options.url)?options.url:this.url,search:isPresent(options)&&isPresent(options.search)?isString(options.search)?new URLSearchParams(options.search):options.search.clone():this.search,withCredentials:isPresent(options)&&isPresent(options.withCredentials)?options.withCredentials:this.withCredentials,responseType:isPresent(options)&&isPresent(options.responseType)?options.responseType:this.responseType})},RequestOptions}(),BaseRequestOptions=function(_super){function BaseRequestOptions(){_super.call(this,{method:exports.RequestMethod.Get,headers:new Headers})}return __extends$3(BaseRequestOptions,_super),BaseRequestOptions.decorators=[{type:_angular_core.Injectable}],BaseRequestOptions.ctorParameters=[],BaseRequestOptions}(RequestOptions),__extends$5=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Request=function(_super){function Request(requestOptions){_super.call(this);var url=requestOptions.url;if(this.url=requestOptions.url,isPresent(requestOptions.search)){var search=requestOptions.search.toString();if(search.length>0){var prefix="?";StringWrapper.contains(this.url,"?")&&(prefix="&"==this.url[this.url.length-1]?"":"&"),this.url=url+prefix+search}}this._body=requestOptions.body,this.method=normalizeMethodName(requestOptions.method),this.headers=new Headers(requestOptions.headers),this.contentType=this.detectContentType(),this.withCredentials=requestOptions.withCredentials,this.responseType=requestOptions.responseType}return __extends$5(Request,_super),Request.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return ContentType.JSON;case"application/x-www-form-urlencoded":return ContentType.FORM;case"multipart/form-data":return ContentType.FORM_DATA;case"text/plain":case"text/html":return ContentType.TEXT;case"application/octet-stream":return ContentType.BLOB;default:return this.detectContentTypeFromBody()}},Request.prototype.detectContentTypeFromBody=function(){return null==this._body?ContentType.NONE:this._body instanceof URLSearchParams?ContentType.FORM:this._body instanceof FormData?ContentType.FORM_DATA:this._body instanceof Blob$1?ContentType.BLOB:this._body instanceof ArrayBuffer$1?ContentType.ARRAY_BUFFER:this._body&&"object"==typeof this._body?ContentType.JSON:ContentType.TEXT},Request.prototype.getBody=function(){switch(this.contentType){case ContentType.JSON:return this.text();case ContentType.FORM:return this.text();case ContentType.FORM_DATA:return this._body;case ContentType.TEXT:return this.text();case ContentType.BLOB:return this.blob();case ContentType.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},Request}(Body),noop$1=function(){},w="object"==typeof window?window:noop$1,FormData=w.FormData||noop$1,Blob$1=w.Blob||noop$1,ArrayBuffer$1=w.ArrayBuffer||noop$1,__extends$4=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Http=function(){function Http(_backend,_defaultOptions){this._backend=_backend,this._defaultOptions=_defaultOptions}return Http.prototype.request=function(url,options){var responseObservable;if(isString(url))responseObservable=httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url)));else{if(!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");responseObservable=httpRequest(this._backend,url)}return responseObservable},Http.prototype.get=function(url,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url)))},Http.prototype.post=function(url,body,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Post,url)))},Http.prototype.put=function(url,body,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Put,url)))},Http.prototype.delete=function(url,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Delete,url)))},Http.prototype.patch=function(url,body,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,exports.RequestMethod.Patch,url)))},Http.prototype.head=function(url,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Head,url)))},Http.prototype.options=function(url,options){return httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Options,url)))},Http.decorators=[{type:_angular_core.Injectable}],Http.ctorParameters=[{type:ConnectionBackend},{type:RequestOptions}],Http}(),Jsonp=function(_super){function Jsonp(backend,defaultOptions){_super.call(this,backend,defaultOptions)}return __extends$4(Jsonp,_super),Jsonp.prototype.request=function(url,options){var responseObservable;if(isString(url)&&(url=new Request(mergeOptions(this._defaultOptions,options,exports.RequestMethod.Get,url))),!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");if(url.method!==exports.RequestMethod.Get)throw new Error("JSONP requests must use GET request method.");return responseObservable=httpRequest(this._backend,url)},Jsonp.decorators=[{type:_angular_core.Injectable}],Jsonp.ctorParameters=[{type:ConnectionBackend},{type:RequestOptions}],Jsonp}(Http),HttpModule=function(){function HttpModule(){}return HttpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Http,useFactory:httpFactory,deps:[XHRBackend,RequestOptions]},BrowserXhr,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},XHRBackend,{provide:XSRFStrategy,useFactory:_createDefaultCookieXSRFStrategy}]}]}],HttpModule.ctorParameters=[],HttpModule}(),JsonpModule=function(){function JsonpModule(){}return JsonpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Jsonp,useFactory:jsonpFactory,deps:[JSONPBackend,RequestOptions]},BrowserJsonp,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},{provide:JSONPBackend,useClass:JSONPBackend_}]}]}],JsonpModule.ctorParameters=[],JsonpModule}();exports.BrowserXhr=BrowserXhr,exports.JSONPBackend=JSONPBackend,exports.JSONPConnection=JSONPConnection,exports.CookieXSRFStrategy=CookieXSRFStrategy,exports.XHRBackend=XHRBackend,exports.XHRConnection=XHRConnection,exports.BaseRequestOptions=BaseRequestOptions,exports.RequestOptions=RequestOptions,exports.BaseResponseOptions=BaseResponseOptions,exports.ResponseOptions=ResponseOptions,exports.Headers=Headers,exports.Http=Http,exports.Jsonp=Jsonp,exports.HttpModule=HttpModule,exports.JsonpModule=JsonpModule,exports.Connection=Connection,exports.ConnectionBackend=ConnectionBackend,exports.XSRFStrategy=XSRFStrategy,exports.Request=Request,exports.Response=Response,exports.QueryEncoder=QueryEncoder,exports.URLSearchParams=URLSearchParams}); |
{ | ||
"name": "@angular/http", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Angular - the http service", | ||
@@ -12,4 +12,4 @@ "main": "bundles/http.umd.js", | ||
"rxjs": "5.0.0-beta.12", | ||
"@angular/core": "2.0.1", | ||
"@angular/platform-browser": "2.0.1" | ||
"@angular/core": "2.0.2", | ||
"@angular/platform-browser": "2.0.2" | ||
}, | ||
@@ -16,0 +16,0 @@ "repository": { |
@@ -44,5 +44,4 @@ /** | ||
// response/responseType properties were introduced in ResourceLoader Level2 spec (supported | ||
// by | ||
// IE10) | ||
var body = isPresent(_xhr.response) ? _xhr.response : _xhr.responseText; | ||
// by IE10) | ||
var body = _xhr.response === undefined ? _xhr.responseText : _xhr.response; | ||
// Implicitly strip a potential XSSI prefix. | ||
@@ -49,0 +48,0 @@ if (isString(body)) |
@@ -17,20 +17,2 @@ export declare class MapWrapper { | ||
export declare class StringMapWrapper { | ||
static get<V>(map: { | ||
[key: string]: V; | ||
}, key: string): V; | ||
static set<V>(map: { | ||
[key: string]: V; | ||
}, key: string, value: V): void; | ||
static keys(map: { | ||
[key: string]: any; | ||
}): string[]; | ||
static values<T>(map: { | ||
[key: string]: T; | ||
}): T[]; | ||
static isEmpty(map: { | ||
[key: string]: any; | ||
}): boolean; | ||
static forEach<K, V>(map: { | ||
[key: string]: V; | ||
}, callback: (v: V, K: string) => void): void; | ||
static merge<V>(m1: { | ||
@@ -87,6 +69,1 @@ [key: string]: V; | ||
export declare function iterateListLike(obj: any, fn: Function): void; | ||
export declare class SetWrapper { | ||
static createFromList<T>(lst: T[]): Set<T>; | ||
static has<T>(s: Set<T>, key: T): boolean; | ||
static delete<K>(m: Set<K>, k: K): void; | ||
} |
@@ -106,22 +106,2 @@ /** | ||
} | ||
StringMapWrapper.get = function (map, key) { | ||
return map.hasOwnProperty(key) ? map[key] : undefined; | ||
}; | ||
StringMapWrapper.set = function (map, key, value) { map[key] = value; }; | ||
StringMapWrapper.keys = function (map) { return Object.keys(map); }; | ||
StringMapWrapper.values = function (map) { | ||
return Object.keys(map).map(function (k) { return map[k]; }); | ||
}; | ||
StringMapWrapper.isEmpty = function (map) { | ||
for (var prop in map) { | ||
return false; | ||
} | ||
return true; | ||
}; | ||
StringMapWrapper.forEach = function (map, callback) { | ||
for (var _i = 0, _a = Object.keys(map); _i < _a.length; _i++) { | ||
var k = _a[_i]; | ||
callback(map[k], k); | ||
} | ||
}; | ||
StringMapWrapper.merge = function (m1, m2) { | ||
@@ -320,29 +300,2 @@ var m = {}; | ||
} | ||
// Safari and Internet Explorer do not support the iterable parameter to the | ||
// Set constructor. We work around that by manually adding the items. | ||
var createSetFromList = (function () { | ||
var test = new Set([1, 2, 3]); | ||
if (test.size === 3) { | ||
return function createSetFromList(lst) { return new Set(lst); }; | ||
} | ||
else { | ||
return function createSetAndPopulateFromList(lst) { | ||
var res = new Set(lst); | ||
if (res.size !== lst.length) { | ||
for (var i = 0; i < lst.length; i++) { | ||
res.add(lst[i]); | ||
} | ||
} | ||
return res; | ||
}; | ||
} | ||
})(); | ||
export var SetWrapper = (function () { | ||
function SetWrapper() { | ||
} | ||
SetWrapper.createFromList = function (lst) { return createSetFromList(lst); }; | ||
SetWrapper.has = function (s, key) { return s.has(key); }; | ||
SetWrapper.delete = function (m, k) { m.delete(k); }; | ||
return SetWrapper; | ||
}()); | ||
//# sourceMappingURL=collection.js.map |
@@ -34,4 +34,2 @@ | ||
export declare function getTypeNameForDebugging(type: any): string; | ||
export declare var Math: any; | ||
export declare var Date: DateConstructor; | ||
export declare function isPresent(obj: any): boolean; | ||
@@ -50,5 +48,2 @@ export declare function isBlank(obj: any): boolean; | ||
export declare function stringify(token: any): string; | ||
export declare function serializeEnum(val: any): number; | ||
export declare function deserializeEnum(val: any, values: Map<number, any>): any; | ||
export declare function resolveEnumToken(enumValue: any, val: any): string; | ||
export declare class StringWrapper { | ||
@@ -100,10 +95,2 @@ static fromCharCode(code: number): string; | ||
} | ||
export declare class DateWrapper { | ||
static create(year: number, month?: number, day?: number, hour?: number, minutes?: number, seconds?: number, milliseconds?: number): Date; | ||
static fromISOString(str: string): Date; | ||
static fromMillis(ms: number): Date; | ||
static toMillis(date: Date): number; | ||
static now(): Date; | ||
static toJson(date: Date): string; | ||
} | ||
export declare function setValueOnPath(global: any, path: string, value: any): void; | ||
@@ -110,0 +97,0 @@ export declare function getSymbolIterator(): string | symbol; |
@@ -29,9 +29,4 @@ /** | ||
export function getTypeNameForDebugging(type) { | ||
if (type['name']) { | ||
return type['name']; | ||
} | ||
return typeof type; | ||
return type['name'] || typeof type; | ||
} | ||
export var Math = _global.Math; | ||
export var Date = _global.Date; | ||
// TODO: remove calls to assert in production environment | ||
@@ -93,15 +88,4 @@ // Note: Can't just export this and import in in other files | ||
var newLineIndex = res.indexOf('\n'); | ||
return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); | ||
return newLineIndex === -1 ? res : res.substring(0, newLineIndex); | ||
} | ||
// serialize / deserialize enum exist only for consistency with dart API | ||
// enums in typescript don't need to be serialized | ||
export function serializeEnum(val) { | ||
return val; | ||
} | ||
export function deserializeEnum(val, values) { | ||
return val; | ||
} | ||
export function resolveEnumToken(enumValue, val) { | ||
return enumValue[val]; | ||
} | ||
export var StringWrapper = (function () { | ||
@@ -268,21 +252,2 @@ function StringWrapper() { | ||
}()); | ||
export var DateWrapper = (function () { | ||
function DateWrapper() { | ||
} | ||
DateWrapper.create = function (year, month, day, hour, minutes, seconds, milliseconds) { | ||
if (month === void 0) { month = 1; } | ||
if (day === void 0) { day = 1; } | ||
if (hour === void 0) { hour = 0; } | ||
if (minutes === void 0) { minutes = 0; } | ||
if (seconds === void 0) { seconds = 0; } | ||
if (milliseconds === void 0) { milliseconds = 0; } | ||
return new Date(year, month - 1, day, hour, minutes, seconds, milliseconds); | ||
}; | ||
DateWrapper.fromISOString = function (str) { return new Date(str); }; | ||
DateWrapper.fromMillis = function (ms) { return new Date(ms); }; | ||
DateWrapper.toMillis = function (date) { return date.getTime(); }; | ||
DateWrapper.now = function () { return new Date(); }; | ||
DateWrapper.toJson = function (date) { return date.toJSON(); }; | ||
return DateWrapper; | ||
}()); | ||
export function setValueOnPath(global, path, value) { | ||
@@ -289,0 +254,0 @@ var parts = path.split('.'); |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"Math":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"Date":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBoolean":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":87,"character":9},"right":"boolean"}},"isNumber":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":91,"character":9},"right":"number"}},"isString":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":95,"character":9},"right":"string"}},"isFunction":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":99,"character":9},"right":"function"}},"isType":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isFunction"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":107,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isStringMap"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isArray":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"serializeEnum":{"__symbolic":"function","parameters":["val"],"value":{"__symbolic":"reference","name":"val"}},"deserializeEnum":{"__symbolic":"function","parameters":["val","values"],"value":{"__symbolic":"reference","name":"val"}},"resolveEnumToken":{"__symbolic":"function","parameters":["enumValue","val"],"value":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"enumValue"},"index":{"__symbolic":"reference","name":"val"}}},"RegExp":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":287,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":287,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"getMapKey":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"reference","name":"value"}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":null,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":false,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":305,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":305,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"hasConstructor":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"constructor"},"right":{"__symbolic":"reference","name":"type"}}},"escape":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":402,"character":19}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":61,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBoolean":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"boolean"}},"isNumber":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":84,"character":9},"right":"number"}},"isString":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":88,"character":9},"right":"string"}},"isFunction":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":92,"character":9},"right":"function"}},"isType":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isFunction"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":100,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isStringMap"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isArray":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"RegExp":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":265,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":265,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"getMapKey":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"reference","name":"value"}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":null,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":false,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":283,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":283,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"hasConstructor":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"constructor"},"right":{"__symbolic":"reference","name":"type"}}},"escape":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":367,"character":19}}}} |
@@ -8,3 +8,3 @@ /** | ||
* | ||
* ### Example ([live demo](http://plnkr.co/edit/MTdwT6?p=preview)) | ||
* ### Example | ||
* | ||
@@ -32,3 +32,3 @@ * ``` | ||
constructor(headers?: Headers | { | ||
[key: string]: any; | ||
[name: string]: any; | ||
}); | ||
@@ -51,9 +51,9 @@ /** | ||
*/ | ||
get(header: string): string; | ||
get(name: string): string; | ||
/** | ||
* Check for existence of header by given name. | ||
* Checks for existence of header by given name. | ||
*/ | ||
has(header: string): boolean; | ||
has(name: string): boolean; | ||
/** | ||
* Provides names of set headers | ||
* Returns the names of the headers | ||
*/ | ||
@@ -64,3 +64,3 @@ keys(): string[]; | ||
*/ | ||
set(header: string, value: string | string[]): void; | ||
set(name: string, value: string | string[]): void; | ||
/** | ||
@@ -74,3 +74,3 @@ * Returns values of all headers. | ||
toJSON(): { | ||
[key: string]: any; | ||
[name: string]: any; | ||
}; | ||
@@ -80,3 +80,3 @@ /** | ||
*/ | ||
getAll(header: string): string[]; | ||
getAll(name: string): string[]; | ||
/** | ||
@@ -86,2 +86,3 @@ * This method is not implemented. | ||
entries(): void; | ||
private mayBeSetNormalizedName(name); | ||
} |
@@ -8,4 +8,3 @@ /** | ||
*/ | ||
import { ListWrapper, MapWrapper, StringMapWrapper, isListLikeIterable, iterateListLike } from '../src/facade/collection'; | ||
import { isBlank } from '../src/facade/lang'; | ||
import { MapWrapper } from '../src/facade/collection'; | ||
/** | ||
@@ -18,3 +17,3 @@ * Polyfill for [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers/Headers), as | ||
* | ||
* ### Example ([live demo](http://plnkr.co/edit/MTdwT6?p=preview)) | ||
* ### Example | ||
* | ||
@@ -41,15 +40,25 @@ * ``` | ||
export var Headers = (function () { | ||
// TODO(vicb): any -> string|string[] | ||
function Headers(headers) { | ||
var _this = this; | ||
if (headers instanceof Headers) { | ||
this._headersMap = new Map(headers._headersMap); | ||
/** @internal header names are lower case */ | ||
this._headers = new Map(); | ||
/** @internal map lower case names to actual names */ | ||
this._normalizedNames = new Map(); | ||
if (!headers) { | ||
return; | ||
} | ||
this._headersMap = new Map(); | ||
if (isBlank(headers)) { | ||
if (headers instanceof Headers) { | ||
headers._headers.forEach(function (value, name) { | ||
var lcName = name.toLowerCase(); | ||
_this._headers.set(lcName, value); | ||
_this.mayBeSetNormalizedName(name); | ||
}); | ||
return; | ||
} | ||
// headers instanceof StringMap | ||
StringMapWrapper.forEach(headers, function (v, k) { | ||
_this._headersMap.set(normalize(k), isListLikeIterable(v) ? v : [v]); | ||
Object.keys(headers).forEach(function (name) { | ||
var value = headers[name]; | ||
var lcName = name.toLowerCase(); | ||
_this._headers.set(lcName, Array.isArray(value) ? value : [value]); | ||
_this.mayBeSetNormalizedName(name); | ||
}); | ||
@@ -65,5 +74,5 @@ } | ||
if (index > 0) { | ||
var key = line.substring(0, index); | ||
var value = line.substring(index + 1).trim(); | ||
headers.set(key, value); | ||
var name_1 = line.slice(0, index); | ||
var value = line.slice(index + 1).trim(); | ||
headers.set(name_1, value); | ||
} | ||
@@ -77,7 +86,4 @@ }); | ||
Headers.prototype.append = function (name, value) { | ||
name = normalize(name); | ||
var mapName = this._headersMap.get(name); | ||
var list = isListLikeIterable(mapName) ? mapName : []; | ||
list.push(value); | ||
this._headersMap.set(name, list); | ||
var values = this.getAll(name); | ||
this.set(name, values === null ? [value] : values.concat([value])); | ||
}; | ||
@@ -87,5 +93,10 @@ /** | ||
*/ | ||
Headers.prototype.delete = function (name) { this._headersMap.delete(normalize(name)); }; | ||
Headers.prototype.delete = function (name) { | ||
var lcName = name.toLowerCase(); | ||
this._normalizedNames.delete(lcName); | ||
this._headers.delete(lcName); | ||
}; | ||
Headers.prototype.forEach = function (fn) { | ||
this._headersMap.forEach(fn); | ||
var _this = this; | ||
this._headers.forEach(function (values, lcName) { return fn(values, _this._normalizedNames.get(lcName), _this._headers); }); | ||
}; | ||
@@ -95,24 +106,24 @@ /** | ||
*/ | ||
Headers.prototype.get = function (header) { return ListWrapper.first(this._headersMap.get(normalize(header))); }; | ||
Headers.prototype.get = function (name) { | ||
var values = this.getAll(name); | ||
if (values === null) { | ||
return null; | ||
} | ||
return values.length > 0 ? values[0] : null; | ||
}; | ||
/** | ||
* Check for existence of header by given name. | ||
* Checks for existence of header by given name. | ||
*/ | ||
Headers.prototype.has = function (header) { return this._headersMap.has(normalize(header)); }; | ||
Headers.prototype.has = function (name) { return this._headers.has(name.toLowerCase()); }; | ||
/** | ||
* Provides names of set headers | ||
* Returns the names of the headers | ||
*/ | ||
Headers.prototype.keys = function () { return MapWrapper.keys(this._headersMap); }; | ||
Headers.prototype.keys = function () { return MapWrapper.values(this._normalizedNames); }; | ||
/** | ||
* Sets or overrides header value for given name. | ||
*/ | ||
Headers.prototype.set = function (header, value) { | ||
var list = []; | ||
if (isListLikeIterable(value)) { | ||
var pushValue = value.join(','); | ||
list.push(pushValue); | ||
} | ||
else { | ||
list.push(value); | ||
} | ||
this._headersMap.set(normalize(header), list); | ||
Headers.prototype.set = function (name, value) { | ||
var strValue = Array.isArray(value) ? value.join(',') : value; | ||
this._headers.set(name.toLowerCase(), [strValue]); | ||
this.mayBeSetNormalizedName(name); | ||
}; | ||
@@ -122,14 +133,16 @@ /** | ||
*/ | ||
Headers.prototype.values = function () { return MapWrapper.values(this._headersMap); }; | ||
Headers.prototype.values = function () { return MapWrapper.values(this._headers); }; | ||
/** | ||
* Returns string of all headers. | ||
*/ | ||
// TODO(vicb): returns {[name: string]: string[]} | ||
Headers.prototype.toJSON = function () { | ||
var serializableHeaders = {}; | ||
this._headersMap.forEach(function (values, name) { | ||
var list = []; | ||
iterateListLike(values, function (val /** TODO #9100 */) { return list = ListWrapper.concat(list, val.split(',')); }); | ||
serializableHeaders[normalize(name)] = list; | ||
var _this = this; | ||
var serialized = {}; | ||
this._headers.forEach(function (values, name) { | ||
var split = []; | ||
values.forEach(function (v) { return split.push.apply(split, v.split(',')); }); | ||
serialized[_this._normalizedNames.get(name)] = split; | ||
}); | ||
return serializableHeaders; | ||
return serialized; | ||
}; | ||
@@ -139,5 +152,4 @@ /** | ||
*/ | ||
Headers.prototype.getAll = function (header) { | ||
var headers = this._headersMap.get(normalize(header)); | ||
return isListLikeIterable(headers) ? headers : []; | ||
Headers.prototype.getAll = function (name) { | ||
return this.has(name) ? this._headers.get(name.toLowerCase()) : null; | ||
}; | ||
@@ -148,11 +160,10 @@ /** | ||
Headers.prototype.entries = function () { throw new Error('"entries" method is not implemented on Headers class'); }; | ||
Headers.prototype.mayBeSetNormalizedName = function (name) { | ||
var lcName = name.toLowerCase(); | ||
if (!this._normalizedNames.has(lcName)) { | ||
this._normalizedNames.set(lcName, name); | ||
} | ||
}; | ||
return Headers; | ||
}()); | ||
// "HTTP character sets are identified by case-insensitive tokens" | ||
// Spec at https://tools.ietf.org/html/rfc2616 | ||
// This implementation is same as NodeJS. | ||
// see https://nodejs.org/dist/latest-v6.x/docs/api/http.html#http_message_headers | ||
function normalize(name) { | ||
return name.toLowerCase(); | ||
} | ||
//# sourceMappingURL=headers.js.map |
@@ -0,1 +1,8 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
import { ResponseOptions } from './base_response_options'; | ||
@@ -2,0 +9,0 @@ import { Body } from './body'; |
@@ -100,2 +100,6 @@ /** | ||
URLSearchParams.prototype.set = function (param, val) { | ||
if (val === void 0 || val === null) { | ||
this.delete(param); | ||
return; | ||
} | ||
var list = this.paramsMap.get(param) || []; | ||
@@ -122,2 +126,4 @@ list.length = 0; | ||
URLSearchParams.prototype.append = function (param, val) { | ||
if (val === void 0 || val === null) | ||
return; | ||
var list = this.paramsMap.get(param) || []; | ||
@@ -124,0 +130,0 @@ list.push(val); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
455880
6342