text: /**
   * API Bound Models for AngularJS
   * @version v1.0.3 - 2014-09-16
   * @link https://github.com/angular-platanus/restmod
   * @author Ignacio Baixas <ignacio@platan.us>
   * @license MIT License, http://www.opensource.org/licenses/MIT
   */
  !function(a,b){"use strict";var c=a.module("restmod",["ng","platanus.inflector"]);c.provider("restmod",[function(){function b(a){return function(b){b.invoke(a,this,{$builder:this})}}var c=["RMBuilderExt","RMBuilderRelations"];return{rebase:function(){var d,e,f=arguments.length;for(e=0;f>e;e++)d=arguments[e],(a.isArray(d)||a.isFunction(d))&&(d=b(d)),c.push(d);return this},$get:["RMModelFactory","$log",function(a,b){var d=Array.prototype.slice,e={model:function(e){var f=a(e,c);return arguments.length>1&&(f.$mix(d.call(arguments,1)),b.warn("Passing mixins and difinitions in the model method will be deprecated in restmod 1.1, use restmod.model().$mix() instead.")),f},mixin:function(){return{$isAbstract:!0,$$chain:d.call(arguments,0)}},singleton:function(a){return e.model.apply(this,arguments).$single(a)}};return e}]}}]).factory("model",["restmod",function(a){return a.model}]).factory("mixin",["restmod",function(a){return a.mixin}]),c.factory("RMCollectionApi",["RMUtils",function(c){var d=a.extend;return{$isCollection:!0,$initialize:function(){this.$dispatch("after-collection-init")},$url:function(){return this.$scope.$url()},$urlFor:function(a){var b=this.$type.$url();return c.joinUrl(b?b:this.$url(),a)},$decode:function(b,d){c.assert(b&&a.isArray(b),"Collection $decode expected array");for(var e=0,f=b.length;f>e;e++)this.$buildRaw(b[e],d).$reveal();return this.$dispatch("after-feed-many",[b]),this},$encode:function(a){for(var b=[],c=0,d=this.length;d>c;c++)b.push(this[c].$encode(a));return this.$dispatch("before-render-many",[b]),b},$clear:function(){return this.length=0,this},$fetch:function(a){var b={method:"GET",url:this.$url(),params:this.$params};return a&&(b.params=b.params?d(b.params,a):a),this.$dispatch("before-fetch-many",[b]),this.$send(b,function(a){this.$unwrap(a.data),this.$dispatch("after-fetch-many",[a])},function(a){this.$dispatch("after-fetch-many-error",[a])})},$add:function(a,d){return c.assert(a.$type&&a.$type===this.$type,"Collection $add expects record of the same $type"),a.$position===b&&(d!==b?this.splice(d,0,a):this.push(a),a.$position=!0,this.$dispatch("after-add",[a])),this},$remove:function(a){var c=this.$indexOf(a);return-1!==c&&(this.splice(c,1),a.$position=b,this.$dispatch("after-remove",[a])),this},$indexOf:function(a){for(var b="function"==typeof a?a:!1,c=0,d=this.length;d>c;c++)if(b?b(this[c]):this[c]===a)return c;return-1}}}]),c.factory("RMCommonApi",["$http","$q","$log","RMPackerCache",function(c,d,e,f){function g(a,c){var d=a.$dispatcher();return function(e){var f=a.$promise;a.$promise=b;try{a.$last=e;var g=d?a.$decorate(d,c,[a]):c.call(a,a);return g===b?a.$promise:g}finally{a.$promise=f}}}var h=[],i={$dispatch:function(a,c,d){var e,f,g,i=this.$$dsp;if(d||(d=this),i&&(this.$$dsp=b,i(a,c,d)),this.$$cb&&(e=this.$$cb[a]))for(f=0;g=e[f];f++)g.apply(d,c||h);return this.$scope&&this.$scope.$dispatch?this.$scope.$dispatch(a,c,d):this.$type&&this.$type.$dispatch(a,c,d),this.$$dsp=i,this},$on:function(a,b){var c=(this.$$cb||(this.$$cb={}))[a]||(this.$$cb[a]=[]);return c.push(b),this},$decorate:function(a,b,c){var d=this.$$dsp;this.$$dsp="function"!=typeof a&&a?function(b,c,e){d&&d.apply(null,arguments);var f=a[b];f&&f.apply(e,c||h)}:a;try{return b.apply(this,c)}finally{this.$$dsp=d}},$dispatcher:function(){return this.$$dsp},$asPromise:function(){var a=this;return this.$promise?this.$promise.then(function(){return a},function(){return d.reject(a)}):d.when(this)},$then:function(a,c){if(this.$promise)this.$promise=this.$promise.then(a?g(this,a):a,c?g(this,c):c);else{this.$last=null;var e=a.call(this,this);e!==b&&(this.$promise=d.when(e))}return this},$always:function(a){return this.$then(a,a)},$finally:function(a){return this.$promise=this.$asPromise()["finally"](a),this},$send:function(a,b,f){return this.$getProperty("style")||e.warn("No API style base was selected, see the Api Integration FAQ for more information on this warning"),this.$pending=this.$pending||[],this.$pending.push(a),this.$always(function(){if(a.canceled)return this.$pending.splice(0,1),void(this.$status="canceled");this.$response=null,this.$status="pending",this.$dispatch("before-request",[a]);var e=this.$dispatcher(),g=this;return c(a).then(function(c){return g.$decorate(e,function(){this.$pending.splice(0,1),a.canceled?this.$status="canceled":(this.$status="ok",this.$response=c,this.$dispatch("after-request",[c]),b&&b.call(this,c))})},function(b){return g.$decorate(e,function(){return this.$pending.splice(0,1),a.canceled?(this.$status="canceled",this):(this.$status="error",this.$response=b,this.$dispatch("after-request-error",[b]),f&&f.call(this,b),d.reject(this))})})})},$cancel:function(){return this.$pending&&a.forEach(this.$pending,function(a){a.canceled=!0}),this},$hasPendingRequests:function(){var b=0;return this.$pending&&a.forEach(this.$pending,function(a){a.canceled||b++}),b>0},$unwrap:function(a,b){try{return f.prepare(),a=this.$$unpack(a),this.$decode(a,b)}finally{f.clear()}},$wrap:function(a){var b=this.$encode(a);return b=this.$$pack(b)}};return i}]),c.factory("RMExtendedApi",["$q",function(){return{$decode:function(a,b){return this.$resolved===!1&&this.$clear&&this.$clear(),this.$super(a,b),this.$resolved=!0,this},$reset:function(){return this.$cancel(),this.$resolved=!1,this},$resolve:function(a){return this.$then(function(){this.$dispatch("before-resolve",[]),this.$resolved||this.$fetch(a)})},$refresh:function(a){return this.$reset().$fetch(a)}}}]),c.factory("RMRecordApi",["RMUtils",function(a){var c=function(b,c,d){this.$scope=b,this.$target=c,this.$partial=a.cleanUrl(d)};return c.prototype={$url:function(){return a.joinUrl(this.$scope.$url(),this.$partial)},$urlFor:function(a){return this.$target.$isNested()?this.$fetchUrlFor():this.$target.$urlFor(a)},$fetchUrlFor:function(){return a.joinUrl(this.$scope.$url(),this.$partial)},$createUrlFor:function(){return null}},{$initialize:function(){this.$super(),this.$dispatch("after-init")},$url:function(){return this.$scope.$urlFor(this.$pk)},$buildScope:function(a,b){return a.$buildOwnScope?void 0:new c(this,a,b)},$extend:function(a){for(var b in a)a.hasOwnProperty(b)&&"$"!==b[0]&&(this[b]=a[b]);return this},$each:function(a,b){for(var c in this)this.hasOwnProperty(c)&&"$"!==c[0]&&a.call(b||this[c],this[c],c);return this},$decode:function(b,c){return this.$super(b,c||a.READ_MASK),this.$pk||(this.$pk=this.$$inferKey(b)),this.$dispatch("after-feed",[b]),this},$encode:function(b){var c=this.$super(b||a.CREATE_MASK);return this.$dispatch("before-render",[c]),c},$fetch:function(b){var c=this.$scope.$fetchUrlFor?this.$scope.$fetchUrlFor(this.$pk):this.$url();a.assert(!!c,"Cant $fetch if resource is not bound");var d={method:"GET",url:c,params:b};return this.$dispatch("before-fetch",[d]),this.$send(d,function(a){this.$unwrap(a.data),this.$dispatch("after-fetch",[a])},function(a){this.$dispatch("after-fetch-error",[a])}),this},$save:function(){var c,d=this.$scope.$updateUrlFor?this.$scope.$updateUrlFor(this.$pk):this.$url();return d?(c={method:"PUT",url:d,data:this.$wrap(a.UPDATE_MASK)},this.$dispatch("before-update",[c]),this.$dispatch("before-save",[c]),this.$send(c,function(a){this.$unwrap(a.data),this.$dispatch("after-update",[a]),this.$dispatch("after-save",[a])},function(a){this.$dispatch("after-update-error",[a]),this.$dispatch("after-save-error",[a])})):(d=this.$scope.$createUrlFor?this.$scope.$createUrlFor(this.$pk):this.$scope.$url&&this.$scope.$url(),a.assert(!!d,"Cant $create if parent scope is not bound"),c={method:"POST",url:d,data:this.$wrap(a.CREATE_MASK)},this.$dispatch("before-save",[c]),this.$dispatch("before-create",[c]),this.$send(c,function(a){this.$unwrap(a.data),this.$scope.$isCollection&&this.$position===b&&!this.$preventReveal&&this.$scope.$add(this,this.$revealAt),this.$dispatch("after-create",[a]),this.$dispatch("after-save",[a])},function(a){this.$dispatch("after-create-error",[a]),this.$dispatch("after-save-error",[a])}))},$destroy:function(){var b=this.$scope.$destroyUrlFor?this.$scope.$destroyUrlFor(this.$pk):this.$url();a.assert(!!b,"Cant $destroy if resource is not bound");var c={method:"DELETE",url:b};return this.$dispatch("before-destroy",[c]),this.$send(c,function(a){this.$scope.$remove&&this.$scope.$remove(this),this.$dispatch("after-destroy",[a])},function(a){this.$dispatch("after-destroy-error",[a])})},$moveTo:function(a){return this.$position!==b||(this.$revealAt=a),this},$reveal:function(a){return a===b||a?this.$scope.$add(this,this.$revealAt):this.$preventReveal=!0,this}}}]),c.factory("RMScopeApi",[function(){return{$new:function(a,b){return this.$super(a,b)},$build:function(a){return this.$new().$extend(a)},$buildRaw:function(a,b){var c=this.$new(this.$$inferKey(a));return c.$decode(a,b),c},$find:function(a,b){return this.$new(a).$resolve(b)},$create:function(a){return this.$build(a).$save()},$collection:function(a,b){return this.$super(a,b)},$search:function(a){return this.$collection(a).$fetch()}}}]),c.factory("RMBuilder",["$injector","inflector","RMUtils",function(b,c,d){function e(a){var b={init:["attrDefault"],mask:["attrMask"],ignore:["attrMask"],map:["attrMap","force"],decode:["attrDecoder","param","chain"],encode:["attrEncoder","param","chain"]};this.dsl=j(a,{describe:function(a){return f(a,function(a,b){switch(b.charAt(0)){case"@":b=b.substring(1),i(a)?this.classDefine(b,a):this.define(b,a);break;case"~":b=c.parameterize(b.substring(1)),this.on(b,a);break;default:k.test(b)?(b=c.camelize(b.toLowerCase()),"packer"===b?this.setPacker(a):"renamer"===b?this.setRenamer(a):this.setProperty(b,a)):g(a)?this.attribute(b,a):i(a)?this.define(b,a):this.attrDefault(b,a)}},this),this},extend:function(a,c,e){return"string"==typeof a?(this[a]=d.override(this[name],c),e&&(b[e[0]]=e,e[0]=a)):d.extendOverriden(this,a),this},attribute:function(a,c){var d,e,f,g;for(d in c)if(c.hasOwnProperty(d)&&(e=b[d])){for(f=[a,c[d]],g=1;g<e.length;g++)f.push(c[e[g]]);f.push(c),this[e[0]].apply(this,f)}return this}})}var f=a.forEach,g=a.isObject,h=a.isArray,i=a.isFunction,j=a.extend,k=/^[A-Z]+[A-Z_0-9]*$/;return e.prototype={chain:function(a){for(var b=0,c=a.length;c>b;b++)this.mixin(a[b])},mixin:function(a){a.$$chain?this.chain(a.$$chain):"string"==typeof a?this.mixin(b.get(a)):h(a)?this.chain(a):i(a)?a.call(this.dsl,b):this.dsl.describe(a)}},e}]),c.factory("RMBuilderExt",["$injector","$parse","inflector","$log","restmod",function(b,c,d,e,f){var g=a.bind,h=a.isFunction,i={setUrlPrefix:function(a){return this.setProperty("urlPrefix",a)},setPrimaryKey:function(a){return this.setProperty("primaryKey",a)},attrSerializer:function(a,c,e){return"string"==typeof c&&(c=b.get(d.camelize(c,!0)+"Serializer")),h(c)&&(c=c(e)),c.decode&&this.attrDecoder(a,g(c,c.decode)),c.encode&&this.attrEncoder(a,g(c,c.encode)),this},attrExpression:function(a,b){var d=c(b);return this.on("after-feed",function(){this[a]=d(this)})}};return f.mixin(function(){this.extend("setUrlPrefix",i.setUrlPrefix).extend("setPrimaryKey",i.setPrimaryKey).extend("attrSerializer",i.attrSerializer,["serialize"])})}]),c.factory("RMBuilderRelations",["$injector","inflector","$log","RMUtils","restmod","RMPackerCache",function(a,c,d,e,f,g){var h={attrAsCollection:function(b,f,g,h,i){return this.attrDefault(b,function(){if("string"==typeof f&&(f=a.get(f),i)){var e=f.$$getDescription(i);e&&"belongs_to"===e.relation||(d.warn("Must define an inverse belongsTo relation for inverseOf to work"),i=!1)}var h=this,j=this.$buildScope(f,g||c.parameterize(b)),k=f.$collection(null,j);return i&&k.$on("after-add",function(a){a[i]=h}),k}),(h||g)&&this.attrMap(b,h||g),this.attrDecoder(b,function(a){this[b].$reset().$decode(a)}).attrMask(b,e.WRITE_MASK).attrMeta(b,{relation:"has_many"}),this},attrAsResource:function(b,f,g,h,i){return this.attrDefault(b,function(){if("string"==typeof f&&(f=a.get(f),i)){var e=f.$$getDescription(i);e&&"belongs_to"===e.relation||(d.warn("Must define an inverse belongsTo relation for inverseOf to work"),i=!1)}var h=this.$buildScope(f,g||c.parameterize(b)),j=f.$new(null,h);return i&&(j[i]=this),j}),(h||g)&&this.attrMap(b,h||g),this.attrDecoder(b,function(a){this[b].$decode(a)}).attrMask(b,e.WRITE_MASK).attrMeta(b,{relation:"has_one"}),this},attrAsReference:function(c,d,f,h){function i(){"string"==typeof d&&(d=a.get(d))}return this.attrDefault(c,null).attrMask(c,e.WRITE_MASK).attrMeta(c,{relation:"belongs_to"}),this.attrDecoder(c,function(a){return null===a?null:(i(),void(this[c]&&this[c].$pk===d.$$inferKey(a)?this[c].$decode(a):this[c]=d.$buildRaw(a)))}),f!==!1&&this.attrMap(c+"Id",f||"*",!0).attrDecoder(c+"Id",function(a){a!==b&&(this[c]&&this[c].$pk===a||(null!==a&&a!==!1?(i(),this[c]=g.resolve(d.$new(a)),h&&this[c].$fetch()):this[c]=null))}).attrEncoder(c+"Id",function(){return this[c]?this[c].$pk:null}),this},attrAsReferenceToMany:function(b,d,f){function h(){"string"==typeof d&&(d=a.get(d))}function i(a,b){h(),b.length=0;for(var c=0,e=a.length;e>c;c++)b.push("object"==typeof a[c]?d.$buildRaw(a[c]):g.resolve(d.$new(a[c])))}if(this.attrDefault(b,function(){return[]}).attrMask(b,e.WRITE_MASK).attrMeta(b,{relation:"belongs_to_many"}),this.attrDecoder(b,function(a){a&&i(a,this[b])}),f!==!1){var j=c.singularize(b)+"Ids";this.attrMap(j,f||"*",!0).attrDecoder(j,function(a){a&&i(a,this[b])}).attrEncoder(j,function(){for(var a=[],c=this[b],d=0,e=c.length;e>d;d++)a.push(c[d].$pk);return a})}return this}};return f.mixin(function(){this.extend("attrAsCollection",h.attrAsCollection,["hasMany","path","source","inverseOf"]).extend("attrAsResource",h.attrAsResource,["hasOne","path","source","inverseOf"]).extend("attrAsReference",h.attrAsReference,["belongsTo","key","prefetch"]).extend("attrAsReferenceToMany",h.attrAsReferenceToMany,["belongsToMany","keys"])})}]),c.factory("RMModelFactory",["$injector","inflector","RMUtils","RMScopeApi","RMCommonApi","RMRecordApi","RMCollectionApi","RMExtendedApi","RMSerializer","RMBuilder",function(c,d,e,f,g,h,i,j,k,l){var m=/(.*?)([^\/]+)\/?$/,n=e.extendOverriden;return function(o,p){function q(a,b){this.$type=q,this.$scope=a||q,this.$pk=b,this.$initialize()}function r(a,b){var c=new C;return c.$type=q,c.$scope=a,c.$params=b,c.$initialize(),c}function s(a){return function(b){if(y){var c="function"==typeof y?new y(q):y;return c[a](b,this)}return b}}function t(){return q.$inferKey.apply(q,arguments)}function u(){return q.$getProperty.apply(q,arguments)}o=e.cleanUrl(o);var v,w={primaryKey:"id",urlPrefix:null},x=new k,y=null,z=[],A={},B={};!w.name&&o&&(w.name=d.singularize(o.replace(m,"$2"))),!w.plural&&w.name&&(w.plural=d.pluralize(w.name));var C=e.buildArrayType();return n(q,{$$chain:[],$$inferKey:t,$new:function(a,b){return new q(b||q,a)},$collection:function(a,b){return r(b||q,a)},$$getDescription:function(a){return A[a]},$inferKey:function(a){return a&&"undefined"!=typeof a[w.primaryKey]?a[w.primaryKey]:null},$getProperty:function(a,c){var d=w[a];return d!==b?d:c},$isNested:function(){return!o},$single:function(a){return new q({$urlFor:function(){return w.urlPrefix?e.joinUrl(w.urlPrefix,a):a}},"")},$url:function(){return w.urlPrefix?e.joinUrl(w.urlPrefix,o):o},$name:function(a){return a?w.plural:w.name},$urlFor:function(a){return e.joinUrl(this.$url(),a)},$mix:function(){return v.chain(arguments),this.$$chain.push.apply(this.$$chain,arguments),this},$dispatch:function(a,b,c){var d,e,f=B[a];if(f)for(d=0;e=f[d];d++)e.apply(c||this,b||[]);return this}},f),n(q.prototype,{$$inferKey:t,$initialize:function(){for(var a,b=0;a=z[b];b++)this[a[0]]="function"==typeof a[1]?a[1].apply(this):a[1]},$$pack:s("pack"),$$unpack:s("unpack"),$decode:function(a,b){x.decode(this,a,b)},$encode:function(a){return x.encode(this,a)},$getProperty:u},g,h,j),n(C.prototype,{$$inferKey:t,$new:function(a,b){return new q(b||this,a)},$collection:function(b,c){return b=this.$params?a.extend({},this.$params,b):b,r(c||this.$scope,b)},$$pack:s("packMany"),$$unpack:s("unpackMany"),$getProperty:u},f,g,i,j),v=new l(a.extend(x.dsl(),{setProperty:function(a,b){return w[a]=b,this},attrDefault:function(a,b){return z.push([a,b]),this},attrMeta:function(a,b){return A[a]=n(A[a]||{},b),this},setPacker:function(a){return"string"==typeof a&&(a=c.get(d.camelize(a,!0)+"Packer")),y=a,this},define:function(a,b){return"function"==typeof b?q.prototype[a]=e.override(q.prototype[a],b):(b.type&&(q[a]=e.override(q[a],b.type)),b.collection&&(C.prototype[a]=e.override(C.prototype[a],b.collection)),b.record&&(q.prototype[a]=e.override(q.prototype[a],b.record))),this},classDefine:function(a,b){this.define(a,{type:b,collection:b})},on:function(a,b){return(B[a]||(B[a]=[])).push(b),this}})),v.chain(p),q}}]),c.factory("RMPackerCache",[function(){var a;return{feed:function(b,c){a[b]=c},resolve:function(b){if(a){var c=b.$type,d=a[c.$name(!0)];if(d&&b.$pk)for(var e=0,f=d.length;f>e;e++)if(b.$pk===c.$$inferKey(d[e])){b.$decode(d[e]);break}}return b},prepare:function(){a={}},clear:function(){a=null}}}]),c.factory("RMSerializer",["$injector","inflector","$filter","RMUtils",function(c,d,e,f){function g(a,b){for(var c,d=0;a&&(c=b[d]);d++)a=a[c];return a}function h(a,b,c){for(var d=0,e=b.length-1;e>d;d++){var f=b[d];a=a[f]||(a[f]={})}a[b[b.length-1]]=c}return function(){function i(a,b){var c=o[a];return c&&(c===!0||-1!==c.indexOf(b))}function j(a,c,d,e,f){var h,j,l,m,n,o,p,q,u=d?d+".":"";if(n=s[d])for(p=0,q=n.length;q>p;p++)l=u+n[p].path,i(l,e)||(m=n[p].map?g(a,n[p].map):a[t?t.encode(n[p].path):n[p].path],(n[p].forced||m!==b)&&(m=k(m,l,e,f),m!==b&&(c[n[p].path]=m)));for(h in a)if(a.hasOwnProperty(h)){if(j=t?t.decode(h):h,"$"===j[0])continue;if(n){for(o=!1,p=0,q=n.length;q>p&&!(o=n[p].mapPath===h);p++);if(o)continue}if(l=u+j,r[l]||i(l,e))continue;m=k(a[h],l,e,f),m!==b&&(c[j]=m)}}function k(a,b,c,d){var e=p[b],f=a;if(e)f=e.call(d,a);else if("object"==typeof a)if(n(a)){f=[];for(var g=0,h=a.length;h>g;g++)f.push(k(a[g],b+"[]",c,d))}else a&&(f={},j(a,f,b,c,d));return f}function l(a,c,d,e,f){var g,j,k,l,n,o=d?d+".":"";for(g in a)if(a.hasOwnProperty(g)&&"$"!==g[0]){if(j=o+g,r[j]||i(j,e))continue;l=m(a[g],j,e,f),l!==b&&(k=t?t.encode(g):g,c[k]=l)}if(n=s[d])for(var p=0,q=n.length;q>p;p++)j=o+n[p].path,i(j,e)||(l=a[n[p].path],(n[p].forced||l!==b)&&(l=m(l,j,e,f),l!==b&&(n[p].map?h(c,n[p].map,l):c[t?t.encode(n[p].path):n[p].path]=l)))}function m(a,b,c,d){var e=q[b],f=a;if(e)f=e.call(d,a);else if(null!==a&&"object"==typeof a&&"function"!=typeof a.toJSON)if(n(a)){f=[];for(var g=0,h=a.length;h>g;g++)f.push(m(a[g],b+"[]",c,d))}else a&&(f={},l(a,f,b,c,d));return f}var n=a.isArray,o={},p={},q={},r={},s={},t=null;return{decode:function(a,b,c){j(b,a,"",c,a)},encode:function(a,b){var c={};return l(a,c,"",b,a),c},dsl:function(){return{setRenamer:function(a){return"string"==typeof _packer&&(a=c.get(d.camelize(a,!0)+"Renamer")),t=a,this},attrMap:function(a,b,c){var d=a.lastIndexOf("."),e=-1!==d?a.substr(0,d):"",f=-1!==d?a.substr(d+1):a;r[a]=!0;var g=s[e]||(s[e]=[]);return g.push({path:f,map:"*"===b?null:b.split("."),mapPath:b,forced:c}),this},attrMask:function(a,b){return b?o[a]=b:delete o[a],this},attrDecoder:function(a,b,c,d){if("string"==typeof b){var g=e(b);b=function(a){return g(a,c)}}return p[a]=d?f.chain(p[a],b):b,this},attrEncoder:function(a,b,c,d){if("string"==typeof b){var g=e(b);b=function(a){return g(a,c)}}return q[a]=d?f.chain(q[a],b):b,this}}}}}}]),c.factory("DefaultPacker",["inflector","RMPackerCache",function(a,b){function c(a){this.single=a.$getProperty("jsonRootSingle")||a.$getProperty("jsonRoot")||a.$getProperty("name"),this.plural=a.$getProperty("jsonRootMany")||a.$getProperty("jsonRoot")||a.$getProperty("plural"),this.links=a.$getProperty("jsonLinks","linked"),this.meta=a.$getProperty("jsonMeta","meta")}function d(a,b,c){var d=a.meta;if("string"==typeof d){if("."===d){var e={};for(var f in b)b.hasOwnProperty(f)&&f!==c&&f!==a.links&&(e[f]=b[f]);return e}return b[d]}return"function"==typeof d?d(b):void 0}function e(a,c,d){var e="."===a.links?c:c[a.links];if(e)for(var f in e)if(e.hasOwnProperty(f)&&f!==d){var g=e[f];b.feed(f,g)}}return c.prototype={unpack:function(a,b){return this.meta&&(b.$metadata=d(this,a,this.single)),this.links&&e(this,a,this.single),a[this.single]},unpackMany:function(a,b){return this.meta&&(b.$metadata=d(this,a,this.plural)),this.links&&e(this,a,this.plural),a[this.plural]},pack:function(a){return a},packMany:function(a){return a}},c}]),c.factory("RMUtils",["$log",function(a){var b=[],c=function(){var a=function(){};return Object.setPrototypeOf?function(a,b){Object.setPrototypeOf(a,b)}:(new a).__proto__===a.prototype?function(a,b){a.__proto__=b}:void 0}(),d={CREATE_MASK:"C",UPDATE_MASK:"U",READ_MASK:"R",WRITE_MASK:"CU",FULL_MASK:"CRU",format:function(a,b){for(var c=0;b&&c<b.length;c++)a=a.replace("$"+(c+1),b[c]);return a},assert:function(b,c){if(!b){var e=Array.prototype.slice.call(arguments,2);throw c=d.format(c,e),a.error(c),new Error(c)}},joinUrl:function(a,b){return a&&b?(a+"").replace(/\/$/,"")+"/"+(b+"").replace(/^\//,""):null},cleanUrl:function(a){return a?a.replace(/\/$/,""):a},chain:function(a,b){return a?function(c){return b.call(this,a.call(this,c))}:b},override:function(a,b){return a&&"function"==typeof b?function(){var c=this.$super;try{return this.$super=a,b.apply(this,arguments)}finally{this.$super=c}}:b},extendOverriden:function(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var e in c)c.hasOwnProperty(e)&&(a[e]=a[e]&&"function"==typeof a[e]?d.override(a[e],c[e]):c[e])}return a},buildArrayType:function(a){var d;if(c&&!a){var e=function(){var a=[];return a.push.apply(a,arguments),c(a,e.prototype),a};e.prototype=[],e.prototype.last=function(){return this[this.length-1]},d=e}else{var f=document.createElement("iframe");f.style.display="none",f.height=0,f.width=0,f.border=0,document.body.appendChild(f),window.frames[window.frames.length-1].document.write("<script>parent.RestmodArray = Array;</script>"),d=window.RestmodArray,delete window.RestmodArray;for(var g in Array.prototype)"function"!=typeof Array.prototype[g]||d.prototype[g]||(d.prototype[g]=Array.prototype[g]);document.body.removeChild(f),b.push(f)}return d}};return d}])}(angular);