text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/http"),require("rxjs"),require("@angular/core"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@covalent/http",["exports","@angular/http","rxjs","@angular/core","rxjs/operators"],e):e((t.covalent=t.covalent||{},t.covalent.http={}),t.ng.http,t.rxjs,t.ng.core,t.Rx.Observable.prototype)}(this,function(t,u,s,e,i){"use strict";var n=function(){function t(t,e,r,n){var o=this;this._http=t,this._injector=e,this._httpInterceptorMatcher=r,this._requestInterceptors=[],n.forEach(function(t){o._requestInterceptors.push({interceptor:e.get(t.interceptor),paths:t.paths})})}return t.prototype["delete"]=function(t,e){return void 0===e&&(e={}),e.url=t,e.method=u.RequestMethod.Delete,this.request(t,e)},t.prototype.get=function(t,e){return void 0===e&&(e={}),e.url=t,e.method=u.RequestMethod.Get,this.request(t,e)},t.prototype.head=function(t,e){return void 0===e&&(e={}),e.url=t,e.method=u.RequestMethod.Head,this.request(t,e)},t.prototype.patch=function(t,e,r){return void 0===r&&(r={}),r.url=t,r.method=u.RequestMethod.Patch,r.body=e,this.request(t,r)},t.prototype.post=function(t,e,r){return void 0===r&&(r={}),r.url=t,r.method=u.RequestMethod.Post,r.body=e,this.request(t,r)},t.prototype.put=function(t,e,r){return void 0===r&&(r={}),r.url=t,r.method=u.RequestMethod.Put,r.body=e,this.request(t,r)},t.prototype.request=function(t,e){var r,n=this;void 0===e&&(e={}),r=t instanceof u.Request?t.url?t.url:e.url:t,e.url||(e.url=r);var o=this._requestInterceptors.filter(function(t){return n._httpInterceptorMatcher.matches(e,t)}).map(function(t){return t.interceptor});return this._setupRequest(t,e,o)},t.prototype._setupRequest=function(t,r,n){var o=this;try{r=this._requestResolve(r,n)}catch(e){return new s.Observable(function(t){t.error(e)})}return new s.Observable(function(e){o._http.request(t,r).subscribe(function(t){e.next(o._responseResolve(t,n)),e.complete()},function(t){e.error(o._responseErrorResolve(t,n))})})},t.prototype._requestResolve=function(r,t){return t.forEach(function(t){if(t.onRequest)try{r=t.onRequest(r)}catch(e){if(!t.onRequestError)throw e;if(!(r=t.onRequestError(r)))throw e}}),r},t.prototype._responseResolve=function(e,t){return t.forEach(function(t){t.onResponse&&(e=t.onResponse(e))}),e},t.prototype._responseErrorResolve=function(e,t){return t.forEach(function(t){t.onResponseError&&(e=t.onResponseError(e))}),e},t}(),o=function(){function t(){}return t.prototype.matches=function(e,t){return 0<t.paths.filter(function(t){return!!(t=t.replace(/\*\*/gi,"<>").replace(/\*/gi,"[a-zA-Z0-9\\-_]+").replace(/<>/gi,"[a-zA-Z0-9\\-_/]*"))&&(t+="(\\?{1}.*)?$",new RegExp(t).test(e.url))}).length},t}(),r=new e.InjectionToken("HTTP_CONFIG");function c(t,e,r){return new n(t,e,new o,r.interceptors)}var p={provide:n,useFactory:c,deps:[u.Http,e.Injector,r]},a=function(){function e(){}return e.forRoot=function(t){return void 0===t&&(t={interceptors:[]}),{ngModule:e,providers:[{provide:r,useValue:t},p]}},e}();a.decorators=[{type:e.NgModule,args:[{imports:[u.HttpModule]}]}],a.ctorParameters=function(){return[]};var h=function(){function t(t,e){this.http=t,this._base=e.baseUrl.replace(/\/$/,""),this._path=e.path.replace(/^\//,""),this._baseHeaders=e.baseHeaders?e.baseHeaders:new u.Headers,this._dynamicHeaders=e.dynamicHeaders?e.dynamicHeaders:function(){return new u.Headers},this.transform=e.transform?e.transform:function(t){return t.json()}}return t.prototype.query=function(t,e){var n=this;return this.http.get(this.buildUrl(undefined,t),this.buildRequestOptions()).pipe(i.catchError(function(r){return new s.Observable(function(t){try{t.error(n.transform(r))}catch(e){t.error(r)}})}),i.map(function(t){return e?e(t):n.transform(t)}))},t.prototype.get=function(t,e){var n=this;return this.http.get(this.buildUrl(t),this.buildRequestOptions()).pipe(i.catchError(function(r){return new s.Observable(function(t){try{t.error(n.transform(r))}catch(e){t.error(r)}})}),i.map(function(t){return e?e(t):n.transform(t)}))},t.prototype.create=function(t,e){var n=this,r=this.buildRequestOptions();return this.http.post(this.buildUrl(),t,r).pipe(i.catchError(function(r){return new s.Observable(function(t){try{t.error(n.transform(r))}catch(e){t.error(r)}})}),i.map(function(t){return 201===t.status?e?e(t):n.transform(t):t}))},t.prototype.update=function(t,e,r){var n=this,o=this.buildRequestOptions();return this.http.patch(this.buildUrl(t),e,o).pipe(i.catchError(function(r){return new s.Observable(function(t){try{t.error(n.transform(r))}catch(e){t.error(r)}})}),i.map(function(t){return 200===t.status?r?r(t):n.transform(t):t}))},t.prototype["delete"]=function(t,e){var n=this;return this.http["delete"](this.buildUrl(t),this.buildRequestOptions()).pipe(i.catchError(function(r){return new s.Observable(function(t){try{t.error(n.transform(r))}catch(e){t.error(r)}})}),i.map(function(t){return 200===t.status?e?e(t):n.transform(t):t}))},t.prototype.buildRequestOptions=function(){var r=new u.Headers;return this._baseHeaders.forEach(function(t,e){r.set(e,t)}),this._dynamicHeaders().forEach(function(t,e){r.set(e,t)}),{headers:r}},t.prototype.buildUrl=function(t,e){var r=this._path?this._path:"";return t&&(r+="/"+t),e&&(r+=this.buildQuery(e)),r=this._base+"/"+r},t.prototype.buildQuery=function(t){var e="";if(t){e+="?";var r=[];for(var n in t){var o=t[n];o!==undefined&&r.push(n+"="+o)}e+=r.join("&")}return e},t}();t.HTTP_CONFIG=r,t.httpFactory=c,t.HTTP_INTERCEPTOR_PROVIDER=p,t.CovalentHttpModule=a,t.RESTService=h,t.URLRegExpInterceptorMatcher=o,t.HttpInterceptorService=n,Object.defineProperty(t,"__esModule",{value:!0})});
  //# sourceMappingURL=covalent-http.umd.min.js.map
  