(function(n,t){"use strict";function r(n,i){i=i||{};t.forEach(i,function(n,t){delete i[t]});for(var r in n)n.hasOwnProperty(r)&&("$"!==r.charAt(0)||"$"!==r.charAt(1))&&(i[r]=n[r]);return i}var i=t.$$minErr("$resource"),u=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;t.module("ngResource",["ng"]).info({angularVersion:"1.6.6"}).provider("$resource",function(){var f=/^https?:\/\/\[[^\]]*][^/]*/,n=this;this.defaults={stripTrailingSlashes:!0,cancellable:!1,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};this.$get=["$http","$log","$q","$timeout",function(e,o,s,h){function y(t,i){this.template=t;this.defaults=l({},n.defaults,i);this.urlParams={}}function p(f,g,nt,tt){function ut(n,r){var f={};return r=l({},g,r),c(r,function(r,e){var s,o,c;if(a(r)&&(r=r(n)),r&&r.charAt&&"@"===r.charAt(0)){if(s=n,o=r.substr(1),null==o||""===o||"hasOwnProperty"===o||!u.test("."+o))throw i("badmember",o);for(var o=o.split("."),h=0,l=o.length;h<l&&t.isDefined(s);h++)c=o[h],s=null!==s?s[c]:void 0}else s=r;f[e]=s}),f}function ft(n){return n.resource}function it(n){r(n||{},this)}var rt=new y(f,tt);return nt=l({},n.defaults.actions,nt),it.prototype.toJSON=function(){var n=l({},this);return delete n.$promise,delete n.$resolved,delete n.$cancelRequest,n},c(nt,function(n,t){var y=!0===n.hasBody||!1!==n.hasBody&&/^(POST|PUT|PATCH)$/i.test(n.method),u=n.timeout,f=b(n.cancellable)?n.cancellable:rt.defaults.cancellable;u&&!d(u)&&(o.debug("ngResource:\n  Only numeric values are allowed as `timeout`.\n  Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."),delete n.timeout,u=null);it[t]=function(o,p,b,d){function wt(n){st.catch(v);null!==ot&&ot.resolve(n)}var lt={},tt,et,ht;switch(arguments.length){case 4:ht=d;et=b;case 3:case 2:if(a(p)){if(a(o)){et=o;ht=p;break}et=p;ht=b}else{lt=o;tt=p;et=b;break}case 1:a(o)?et=o:y?tt=o:lt=o;break;case 0:break;default:throw i("badargs",arguments.length);}var ct=this instanceof it,g=ct?tt:n.isArray?[]:new it(tt),nt={},bt=n.interceptor&&n.interceptor.response||ft,pt=n.interceptor&&n.interceptor.responseError||void 0,at=!!ht,vt=!!pt,ot,yt;c(n,function(n,t){switch(t){default:nt[t]=k(n);case"params":case"isArray":case"interceptor":case"cancellable":}});!ct&&f&&(ot=s.defer(),nt.timeout=ot.promise,u&&(yt=h(ot.resolve,u)));y&&(nt.data=tt);rt.setUrlParams(nt,l({},ut(tt,n.params||{}),lt),n.url);var st=e(nt).then(function(u){var f=u.data,e;if(f){if(w(f)!==!!n.isArray)throw i("badcfg",t,n.isArray?"array":"object",w(f)?"array":"object",nt.method,nt.url);n.isArray?(g.length=0,c(f,function(n){"object"==typeof n?g.push(new it(n)):g.push(n)})):(e=g.$promise,r(f,g),g.$promise=e)}return u.resource=g,u},function(n){return n.resource=g,s.reject(n)}),st=st["finally"](function(){g.$resolved=!0;!ct&&f&&(g.$cancelRequest=v,h.cancel(yt),ot=yt=nt.timeout=null)}),st=st.then(function(n){var t=bt(n);return(et||v)(t,n.headers,n.status,n.statusText),t},at||vt?function(n){return at&&!vt&&st.catch(v),at&&ht(n),vt?pt(n):s.reject(n)}:void 0);return ct?st:(g.$promise=st,g.$resolved=!1,f&&(g.$cancelRequest=wt),g)};it.prototype["$"+t]=function(n,i,r){return a(n)&&(r=i,i=n,n={}),n=it[t].call(this,n,this,i,r),n.$promise||n}}),it.bind=function(n){return n=l({},g,n),p(f,n,nt,tt)},it}var v=t.noop,c=t.forEach,l=t.extend,k=t.copy,w=t.isArray,b=t.isDefined,a=t.isFunction,d=t.isNumber,g=t.$$encodeUriQuery,nt=t.$$encodeUriSegment;return y.prototype={setUrlParams:function(n,t,r){var e=this,u=r||e.template,o,s,h="",l=e.urlParams=Object.create(null);c(u.split(/\W/),function(n){if("hasOwnProperty"===n)throw i("badname");!/^\d+$/.test(n)&&n&&new RegExp("(^|[^\\\\]):"+n+"(\\W|$)").test(u)&&(l[n]={isQueryParamValue:new RegExp("\\?.*=:"+n+"(?:\\W|$)").test(u)})});u=u.replace(/\\:/g,":");u=u.replace(f,function(n){return h=n,""});t=t||{};c(e.urlParams,function(n,i){o=t.hasOwnProperty(i)?t[i]:e.defaults[i];b(o)&&null!==o?(s=n.isQueryParamValue?g(o,!0):nt(o),u=u.replace(new RegExp(":"+i+"(\\W|$)","g"),function(n,t){return s+t})):u=u.replace(new RegExp("(/?):"+i+"(\\W|$)","g"),function(n,t,i){return"/"===i.charAt(0)?i:t+i})});e.defaults.stripTrailingSlashes&&(u=u.replace(/\/+$/,"")||"/");u=u.replace(/\/\.(?=\w+($|\?))/,".");n.url=h+u.replace(/\/(\\|%5C)\./,"/.");c(t,function(t,i){e.urlParams[i]||(n.params=n.params||{},n.params[i]=t)})}},p}]})})(window,window.angular)