text: /*!
   * angular-spring-data-rest 0.4.6
   * Copyright 2017 Guy Brand (@guy_labs)
   * https://github.com/guylabs/angular-spring-data-rest
   */
  !function(){"use strict";function a(b){return angular.forEach(arguments,function(c){c!==b&&angular.forEach(c,function(c,d){b[d]&&b[d].constructor&&b[d].constructor===Object?a(b[d],c):b[d]=c})}),angular.copy(b)}function b(a,b,c,d){var e=a[b];if(e){var f={};if(f[c]={},d===!0)angular.forEach(Object.keys(e),function(a){f[c][a]=e[a]});else{var g=Object.keys(e)[0];f[c]=e[g]}a=angular.extend(a,f),delete a[b]}return a}function c(a,b){return b&&(a=e(a)),a}function d(a,b,c){if(void 0==a||!a)throw new Error("The provided resource name '"+b+"' has no valid URL in the '"+c+"' property.");return a}function e(a){return a.replace(/{.*}/g,"")}function f(a){var b={},c=/{\?(.*)}/g,d=c.exec(a)[1].split(",");return angular.forEach(d,function(a){b[a]=""}),b}angular.module("spring-data-rest",["ngResource"]),angular.module("spring-data-rest").provider("SpringDataRestAdapter",function(){var e={linksKey:"_links",linksHrefKey:"href",linksSelfLinkName:"self",embeddedKey:"_embedded",embeddedNewKey:"_embeddedItems",embeddedNamedResources:!1,resourcesKey:"_resources",resourcesFunction:void 0,fetchFunction:void 0,fetchAllKey:"_allLinks"};return{config:function(b){if("undefined"!=typeof b){if(!angular.isObject(b))throw new Error("The given configuration '"+b+"' is not an object.");if(void 0!=b.resourcesFunction&&"function"!=typeof b.resourcesFunction)throw new Error("The given resource function '"+b.resourcesFunction+"' is not of type function.");if(void 0!=b.fetchFunction&&"function"!=typeof b.fetchFunction)throw new Error("The given fetch function '"+b.fetchFunction+"' is not of type function.");e=a(e,b)}return e},$get:["$injector",function(a){function g(b,c,d,f){return void 0==e.resourcesFunction?a.get("$resource")(b,c,d,f):e.resourcesFunction(b,c,d,f)}function h(b,c,d,f,g,h){if(void 0==e.fetchFunction){var i=[];return i.push(a.get("$http").get(b).then(function(a){return g?j(a.data,f,!0,h).then(function(a){d[c]=a}):j(a.data).then(function(a){d[c]=a})},function(b){if(404!=b.status)return a.get("$q").reject(b)})),a.get("$q").all(i)}return e.fetchFunction(b,c,d,f,g,h)}var i={},j=function j(k,l,m,n){function o(a,b){var f=d(a[e.linksKey][b][e.linksHrefKey],b,e.linksHrefKey);return c(f,a[e.linksKey][b].templated)}function p(a){return"string"==typeof a&&a.indexOf("/")>0}function q(a){if(p(a)){var b=a.indexOf("/");return[a.substr(0,b),a.substr(b,a.length)]}}return a.get("$q").when(k).then(function(c){var d=function(a,b,d,h){var i=this[e.linksKey],j=b,k="";if(p(a)){var l=q(a);a=l[0],k=l[1]}if(angular.isObject(a)){if(!a.name)throw new Error("The provided resource object must contain a name property.");var m=a.parameters;return b&&angular.isObject(b)?j=m&&angular.isObject(m)?angular.extend(angular.copy(b),angular.copy(m)):angular.copy(b):m&&angular.isObject(m)&&(j=angular.copy(m)),angular.forEach(j,function(a,b){""===a&&delete j[b]}),g(o(c,a.name),j,d,h)}if(a in i)return g(o(c,a)+k,j,d,h);var n=[];return angular.forEach(i,function(a,b){if(a.templated){var c=f(a[e.linksHrefKey]);n.push({name:b,parameters:c})}else n.push({name:b})}),n};if(c&&c.data&&(c=c.data),!angular.isObject(c)||c instanceof Array)return a.get("$q").reject("Given data '"+c+"' is not of type object.");if(l&&!(l instanceof Array||"string"==typeof l))return a.get("$q").reject("Given fetch links '"+l+"' is not of type array or string.");var k=void 0,r=[];if(e.linksKey in c){var s={};if(s[e.resourcesKey]=d,k=angular.extend(angular.copy(c),s),void 0!=l){var t=c[e.linksKey][e.linksSelfLinkName][e.linksHrefKey];i[t]||(i[t]=[]),angular.forEach(c[e.linksKey],function(a,b){b!=e.linksSelfLinkName&&(n||i[t].indexOf(b)<0)&&(l==e.fetchAllKey||"string"==typeof l&&b==l||l instanceof Array&&l.indexOf(b)>=0)&&(r.push(h(o(c,b),b,k,l,m,n)),i[t].push(b))})}}return e.embeddedKey in c&&(k||(k=angular.copy(c)),k=b(k,e.embeddedKey,e.embeddedNewKey,e.embeddedNamedResources),angular.forEach(k[e.embeddedNewKey],function(a,b){if(a instanceof Array){var c,d=[];angular.forEach(a,function(a,b){angular.isObject(a)?(c=j({data:a},l,m,n).then(function(a){d[b]=a}),r.push(c)):d[b]=a}),c&&c.then(function(){k[e.embeddedNewKey][b]=d})}else angular.isObject(a)&&r.push(j({data:a},l,m,n).then(function(a){k[e.embeddedNewKey][b]=a}))})),a.get("$q").all(r).then(function(){return k?k:c})})};return{process:function(a,b,c,d){return i={},j(a,b,c,d)}}}]}}),angular.module("spring-data-rest").provider("SpringDataRestInterceptor",["$httpProvider","SpringDataRestAdapterProvider",function(a){return{apply:function(){a.interceptors.push("SpringDataRestInterceptor")},$get:["SpringDataRestAdapter","$q",function(a,b){return{response:function(b){return!angular.isObject(b.data)||b.data instanceof Array?b:a.process(b.data).then(function(a){return b.data=a,b})}}}]}}])}();