-
Notifications
You must be signed in to change notification settings - Fork 76
/
angular-data.min.js
11 lines (11 loc) · 41.3 KB
/
angular-data.min.js
1
2
3
4
5
6
7
8
9
10
11
/**
* @author Jason Dobry <jason.dobry@gmail.com>
* @file angular-data.min.js
* @version 0.5.0 - Homepage <http://jmdobry.github.io/angular-data/>
* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/angular-data>
* @license MIT <https://github.com/jmdobry/angular-data/blob/master/LICENSE>
*
* @overview Data store for Angular.js.
*/
require=function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){function c(a,b){return-1!==d(a,b)}var d=a("./indexOf");b.exports=c},{"./indexOf":3}],2:[function(a,b){function c(a,b,c){b=d(b,c);var e=[];if(null==a)return e;for(var f,g=-1,h=a.length;++g<h;)f=a[g],b(f,g,a)&&e.push(f);return e}var d=a("../function/makeIterator_");b.exports=c},{"../function/makeIterator_":9}],3:[function(a,b){function c(a,b,c){if(c=c||0,null==a)return-1;for(var d=a.length,e=0>c?d+c:c;d>e;){if(a[e]===b)return e;e++}return-1}b.exports=c},{}],4:[function(a,b){function c(a){return null!=a&&""!==a}function d(a,b){return b=b||"",e(a,c).join(b)}var e=a("./filter");b.exports=d},{"./filter":2}],5:[function(a,b){function c(a,b,c){return d.call(a,b,c)}var d=Array.prototype.slice;b.exports=c},{}],6:[function(a,b){function c(a,b){if(null==a)return[];if(a.length<2)return a;null==b&&(b=d);var f,g,h;return f=~~(a.length/2),g=c(a.slice(0,f),b),h=c(a.slice(f,a.length),b),e(g,h,b)}function d(a,b){return b>a?-1:a>b?1:0}function e(a,b,c){for(var d=[];a.length&&b.length;)c(a[0],b[0])<=0?d.push(a.shift()):d.push(b.shift());return a.length&&d.push.apply(d,a),b.length&&d.push.apply(d,b),d}b.exports=c},{}],7:[function(a,b){function c(a,b){var c={};if(null==a)return c;var e,f=-1,g=a.length;if(d(b))for(;++f<g;)e=a[f],c[b(e)]=e;else for(;++f<g;)e=a[f],c[e[b]]=e;return c}var d=a("../lang/isFunction");b.exports=c},{"../lang/isFunction":13}],8:[function(a,b){function c(a){return a}b.exports=c},{}],9:[function(a,b){function c(a,b){if(null==a)return d;switch(typeof a){case"function":return"undefined"!=typeof b?function(c,d,e){return a.call(b,c,d,e)}:a;case"object":return function(b){return f(b,a)};case"string":case"number":return e(a)}}var d=a("./identity"),e=a("./prop"),f=a("../object/deepMatches");b.exports=c},{"../object/deepMatches":18,"./identity":8,"./prop":10}],10:[function(a,b){function c(a){return function(b){return b[a]}}b.exports=c},{}],11:[function(a,b){var c=a("./isKind"),d=Array.isArray||function(a){return c(a,"Array")};b.exports=d},{"./isKind":14}],12:[function(a,b){function c(a){if(null==a)return!1;if("string"==typeof a||e(a))return!a.length;if("object"==typeof a||"function"==typeof a){var b=!0;return d(a,function(){return b=!1,!1}),b}return!1}var d=a("../object/forOwn"),e=a("./isArray");b.exports=c},{"../object/forOwn":21,"./isArray":11}],13:[function(a,b){function c(a){return d(a,"Function")}var d=a("./isKind");b.exports=c},{"./isKind":14}],14:[function(a,b){function c(a,b){return d(a)===b}var d=a("./kindOf");b.exports=c},{"./kindOf":16}],15:[function(a,b){function c(a){return!!a&&"object"==typeof a&&a.constructor===Object}b.exports=c},{}],16:[function(a,b){function c(a){return null===a?"Null":a===d?"Undefined":e.exec(f.call(a))[1]}var d,e=/^\[object (.*)\]$/,f=Object.prototype.toString;b.exports=c},{}],17:[function(a,b){function c(a){return null==a?"":a.toString()}b.exports=c},{}],18:[function(a,b){function c(a,b){for(var c=-1,d=a.length;++c<d;)if(f(a[c],b))return!0;return!1}function d(a,b){for(var d=-1,e=b.length;++d<e;)if(!c(a,b[d]))return!1;return!0}function e(a,b){var c=!0;return g(b,function(b,d){return f(a[d],b)?void 0:c=!1}),c}function f(a,b){return a&&"object"==typeof a?h(a)&&h(b)?d(a,b):e(a,b):a===b}var g=a("./forOwn"),h=a("../lang/isArray");b.exports=f},{"../lang/isArray":11,"./forOwn":21}],19:[function(a,b){function c(a){for(var b,c=0,f=arguments.length;++c<f;)b=arguments[c],b&&e(b,d,a);return a}function d(a,b){var d=this[b];f(a)&&f(d)?c(d,a):this[b]=a}var e=a("./forOwn"),f=a("../lang/isPlainObject");b.exports=c},{"../lang/isPlainObject":15,"./forOwn":21}],20:[function(a,b){function c(){g=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=!0;for(var a in{toString:null})f=!1}function d(a,b,d){var h,i=0;null==f&&c();for(h in a)if(e(b,a,h,d)===!1)break;if(f)for(;(h=g[i++])&&(a[h]===Object.prototype[h]||e(b,a,h,d)!==!1););}function e(a,b,c,d){return a.call(d,b[c],c,b)}var f,g;b.exports=d},{}],21:[function(a,b){function c(a,b,c){e(a,function(e,f){return d(a,f)?b.call(c,a[f],f,a):void 0})}var d=a("./hasOwn"),e=a("./forIn");b.exports=c},{"./forIn":20,"./hasOwn":22}],22:[function(a,b){function c(a,b){return Object.prototype.hasOwnProperty.call(a,b)}b.exports=c},{}],23:[function(a,b){function c(){var a=d(e(arguments),"/");return a.replace(/([^:\/]|^)\/{2,}/g,"$1/")}var d=a("../array/join"),e=a("../array/slice");b.exports=c},{"../array/join":4,"../array/slice":5}],24:[function(a,b){function c(a){return a=d(a),a.toUpperCase()}var d=a("../lang/toString");b.exports=c},{"../lang/toString":17}],observejs:[function(a,b){b.exports=a("q+M0EE")},{}],"q+M0EE":[function(a,b,c){!function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:K(a)&&K(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:S.test(a))}function h(a){var b=T[a];if(b)return b;if(g(a)){var b=new i(a);return T[a]=b,b}}function i(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),H&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn()),void 0)}function j(a){for(var b=0;U>b&&a.check();)a.report(),b++}function k(a){for(var b in a)return!1;return!0}function l(a){return k(a.added)&&k(a.removed)&&k(a.changed)}function m(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function n(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function o(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,G){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}p(this),this.connect(),this.sync(!0)}function p(a){W&&(V.push(a),o._allObserversCount++)}function q(a,b,c,d){o.call(this,a,b,c,d)}function r(a,b,c,d){if(!Array.isArray(a))throw Error("Provided object is not an Array");o.call(this,a,b,c,d)}function s(a){this.arr=[],this.callback=a,this.isObserved=!0}function t(a,b,c,d,f){this.value=void 0;var g=h(b);return g?g.length?e(a)?(this.path=g,o.call(this,a,c,d,f),void 0):(this.closed=!0,this.value=void 0,void 0):(this.closed=!0,this.value=a,void 0):(this.closed=!0,this.value=void 0,void 0)}function u(a,b){if("function"==typeof Object.observe){var c=Object.getNotifier(a);return function(d,e){var f={object:a,type:d,name:b};2===arguments.length&&(f.oldValue=e),c.notify(f)}}}function v(a,b,c){for(var d={},e={},f=0;f<b.length;f++){var g=b[f];_[g.type]?(g.name in c||(c[g.name]=g.oldValue),"updated"!=g.type&&("new"!=g.type?g.name in d?(delete d[g.name],delete c[g.name]):e[g.name]=!0:g.name in e?delete e[g.name]:d[g.name]=!0)):(console.error("Unknown changeRecord type: "+g.type),console.error(g))}for(var h in d)d[h]=a[h];for(var h in e)e[h]=void 0;var i={};for(var h in c)if(!(h in d||h in e)){var j=a[h];c[h]!==j&&(i[h]=j)}return{added:d,removed:e,changed:i}}function w(a,b,c,d,e,f){for(var g=f-e+1,h=c-b+1,i=new Array(g),j=0;g>j;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function x(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ab):(e.push(bb),d=g),b--,c--):f==h?(e.push(db),b--,d=h):(e.push(cb),c--,d=i)}else e.push(db),b--;else e.push(cb),c--;return e.reverse(),e}function y(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function z(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function A(a,b,c){return{index:a,removed:b,addedCount:c}}function B(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=y(a,d,i)),c==a.length&&f==d.length&&(h=z(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,c-b==0&&f-e==0)return[];if(b==c){for(var j=A(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[A(b,[],c-b)];for(var k=x(w(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;o<k.length;o++)switch(k[o]){case ab:j&&(l.push(j),j=void 0),m++,n++;break;case bb:j||(j=A(m,[],0)),j.addedCount++,m++,j.removed.push(d[n]),n++;break;case cb:j||(j=A(m,[],0)),j.addedCount++,m++;break;case db:j||(j=A(m,[],0)),j.removed.push(d[n]),n++}return j&&l.push(j),l}function C(a,b,c,d){return c>b||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function D(a,b,c,d){for(var e=A(b,c,d),f=!1,g=0,h=0;h<a.length;h++){var i=a[h];if(i.index+=g,!f){var j=C(e.index,e.index+e.removed.length,i.index,i.index+i.addedCount);if(j>=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.index<i.index){var l=e.removed.slice(0,i.index-e.index);Array.prototype.push.apply(l,c),c=l}if(e.index+e.removed.length>i.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.index<e.index&&(e.index=i.index)}else f=!0}else if(e.index<i.index){f=!0,a.splice(h,0,e),h++;var n=e.addedCount-e.removed.length;i.index+=n,g+=n}}}f||a.push(e)}function E(a,b){for(var e=[],f=0;f<b.length;f++){var g=b[f];switch(g.type){case"splice":D(e,g.index,g.removed.slice(),g.addedCount);break;case"new":case"updated":case"deleted":if(!c(g.name))continue;var h=d(g.name);if(0>h)continue;D(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function F(a,b){var c=[];return E(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(B(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var G=b(),H=!1;try{var I=new Function("","return true;");H=I()}catch(J){}var K=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},L="__proto__"in{}?function(a){return a}:function(a){var b=a.__proto__;if(!b)return a;var c=Object.create(b);return Object.getOwnPropertyNames(a).forEach(function(b){Object.defineProperty(c,b,Object.getOwnPropertyDescriptor(a,b))}),c},M="[$_a-zA-Z]",N="[$_a-zA-Z0-9]",O=M+"+"+N+"*",P="(?:[0-9]|[1-9]+[0-9]+)",Q="(?:"+O+"|"+P+")",R="(?:"+Q+")(?:\\."+Q+")*",S=new RegExp("^"+R+"$"),T={};i.prototype=L({__proto__:[],toString:function(){return this.join(".")},getValueFrom:function(a){for(var b=0;b<this.length;b++){if(void 0===a||null===a)return;a=a[this[b]]}return a},getValueFromObserved:function(a,b){b.reset();for(var c=0;c<this.length;c++){if(void 0===a||null===a)return b.cleanup(),void 0;b.observe(a),a=a[this[c]]}return a},compiledGetValueFromFn:function(){var a=this.map(function(a){return c(a)?'["'+a+'"]':"."+a}),b="",d="obj";b+="if (obj !== null && obj !== undefined";for(var e=0;e<this.length-1;e++){{this[e]}d+=a[e],b+=" &&\n "+d+" !== null && "+d+" !== undefined"}return b+=")\n",d+=a[e],b+=" return "+d+";\nelse\n return undefined;",new Function("obj",b)},setValueFrom:function(a,b){if(!this.length)return!1;for(var c=0;c<this.length-1;c++){if(void 0===a||null===a)return!1;a=a[this[c]]}return void 0===a||null===a?!1:(a[this[this.length-1]]=b,!0)}});var U=1e3;o.prototype={internalCallback:function(a){this.closed||this.reporting&&this.check(a)&&(this.report(),this.testingResults&&(this.testingResults.anyChanged=!0))},close:function(){this.closed||(this.object&&"function"==typeof this.object.unobserved&&this.object.unobserved(),this.disconnect(),this.object=void 0,this.closed=!0)},deliver:function(a){this.closed||(G?(this.testingResults=a,Object.deliverChangeRecords(this.boundInternalCallback),this.testingResults=void 0):j(this))},report:function(){this.reporting&&(this.sync(!1),this.reportArgs.push(this.token),this.invokeCallback(this.reportArgs),this.reportArgs=void 0)},invokeCallback:function(a){try{this.callback.apply(this.target,a)}catch(b){o._errorThrownDuringCallback=!0,console.error("Exception caught during observer callback: "+b)}},reset:function(){this.closed||(G&&(this.reporting=!1,Object.deliverChangeRecords(this.boundInternalCallback),this.reporting=!0),this.sync(!0))}};var V,W=!G||a.forceCollectObservers;o._allObserversCount=0,W&&(V=[]);var X=!1,Y="function"==typeof Object.deliverAllChangeRecords;a.Platform=a.Platform||{},a.Platform.performMicrotaskCheckpoint=function(){if(!X){if(Y)return Object.deliverAllChangeRecords(),void 0;if(W){X=!0;var a=0,b={};do{a++;var c=V;V=[],b.anyChanged=!1;for(var d=0;d<c.length;d++){var e=c[d];e.closed||(G?e.deliver(b):e.check()&&(b.anyChanged=!0,e.report()),V.push(e))}}while(U>a&&b.anyChanged);o._allObserversCount=V.length,X=!1}}},W&&(a.Platform.clearObservers=function(){V=[]}),q.prototype=L({__proto__:o.prototype,connect:function(){G&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=n(this.object))},check:function(a){var b,c;if(G){if(!a)return!1;c={},b=v(this.object,a,c)}else c=this.oldObject,b=m(this.object,this.oldObject);return l(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){G?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}}),r.prototype=L({__proto__:q.prototype,connect:function(){G&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=this.object.slice())},check:function(a){var b;if(G){if(!a)return!1;b=F(this.object,a)}else b=B(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e<c.index+c.addedCount;)d.push(b[e]),e++;Array.prototype.splice.apply(a,d)})};var Z=Object.getPrototypeOf({}),$=Object.getPrototypeOf([]);s.prototype={reset:function(){this.isObserved=!this.isObserved},observe:function(a){if(e(a)&&a!==Z&&a!==$){var b=this.arr.indexOf(a);b>=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;b<this.arr.length;){var d=this.arr[b];this.arr[b+1]==c?(b>a&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}},t.prototype=L({__proto__:o.prototype,connect:function(){G&&(this.observedSet=new s(this.boundInternalCallback))},disconnect:function(){this.value=void 0,G&&(this.observedSet.reset(),this.observedSet.cleanup(),this.observedSet=void 0)},check:function(){return this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object),f(this.value,this.oldValue)?!1:(this.reportArgs=[this.value,this.oldValue],!0)},sync:function(a){a&&(this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object)),this.oldValue=this.value}}),t.getValueAtPath=function(a,b){var c=h(b);if(c)return c.getValueFrom(a)},t.setValueAtPath=function(a,b,c){var d=h(b);d&&d.setValueFrom(a,c)};var _={"new":!0,updated:!0,deleted:!0};t.defineProperty=function(a,b,c){var d=c.object,e=h(c.path),f=u(a,b),g=new t(d,c.path,function(a,b){f&&f("updated",b)});return Object.defineProperty(a,b,{get:function(){return e.getValueFrom(d)},set:function(a){e.setValueFrom(d,a)},configurable:!0}),{close:function(){var c=e.getValueFrom(d);f&&g.deliver(),g.close(),Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}}};var ab=0,bb=1,cb=2,db=3;a.Observer=o,a.Observer.hasObjectObserve=G,a.ArrayObserver=r,a.ArrayObserver.calculateSplices=function(a,b){return B(a,0,a.length,b,0,b.length)},a.ObjectObserver=q,a.PathObserver=t,a.Path=i}((c.Number={isNaN:window.isNaN})?c:c)},{}],27:[function(a,b){function c(a,b){var c=f.$q.defer(),h=c.promise;if(f.store[a])if(d.isObject(b))try{var i=f.store[a],j=this;h=h.then(function(b){return f.$q.promisify(i.beforeValidate)(a,b)}).then(function(b){return f.$q.promisify(i.validate)(a,b)}).then(function(b){return f.$q.promisify(i.afterValidate)(a,b)}).then(function(b){return f.$q.promisify(i.beforeCreate)(a,b)}).then(function(a){return j.POST(d.makePath(i.baseUrl,i.endpoint),a,null)}).then(function(b){return f.$q.promisify(i.afterCreate)(a,b)}).then(function(a){return j.inject(i.name,a)}),c.resolve(b)}catch(k){c.reject(new e.UnhandledError(k))}else c.reject(new e.IllegalArgumentError(g+"attrs: Must be an object!",{attrs:{actual:typeof b,expected:"object"}}));else c.reject(new e.RuntimeError(g+a+" is not a registered resource!"));return h}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.create(resourceName, attrs): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],28:[function(a,b){function c(a,b){var c=f.$q.defer(),h=c.promise;if(f.store[a])if(d.isString(b)||d.isNumber(b)){var i=f.store[a],j=this;h=h.then(function(b){return f.$q.promisify(i.beforeDestroy)(a,b)}).then(function(){return j.DEL(d.makePath(i.baseUrl,i.endpoint,b),null)}).then(function(){return f.$q.promisify(i.afterDestroy)(a,i.index[b])}).then(function(){return j.eject(a,b),b}),c.resolve(i.index[b])}else c.reject(new e.IllegalArgumentError(g+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}}));else c.reject(new e.RuntimeError(g+a+" is not a registered resource!"));return h}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.destroy(resourceName, id): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],29:[function(a,b){function c(a,b,c){var h=f.$q.defer(),i=h.promise;if(c=c||{},f.store[a])if(d.isString(b)||d.isNumber(b))if(d.isObject(c))try{var j=f.store[a],k=this;if(c.bypassCache&&delete j.completedQueries[b],!(b in j.completedQueries))return b in j.pendingQueries||(i=j.pendingQueries[b]=k.GET(d.makePath(j.baseUrl,j.endpoint,b),null).then(function(c){return delete j.pendingQueries[b],j.completedQueries[b]=(new Date).getTime(),k.inject(a,c)})),j.pendingQueries[b];h.resolve(k.get(a,b))}catch(l){h.reject(l)}else h.reject(new e.IllegalArgumentError(g+"options: Must be an object!",{options:{actual:typeof c,expected:"object"}}));else h.reject(new e.IllegalArgumentError(g+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}}));else h.reject(new e.RuntimeError(g+a+" is not a registered resource!"));return i}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.find(resourceName, id[, options]): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],30:[function(a,b){function c(a,b,c){var d=h.store[b];a=a||[],delete d.pendingQueries[c],d.completedQueries[c]=(new Date).getTime();for(var e=0;e<a.length;e++)this.inject(b,a[e]);return d.index=f.toLookup(d.collection,d.idAttribute),d.collectionModified=f.updateTimestamp(d.collectionModified),a}function d(a,b,d){var e=h.store[a],i=this,j=f.toJson(b);return d.bypassCache&&delete e.completedQueries[j],j in e.completedQueries?this.filter(a,b,d):(j in e.pendingQueries||(e.pendingQueries[j]=i.GET(f.makePath(e.baseUrl,e.endpoint),{params:b}).then(function(b){try{return c.apply(i,[b,a,j])}catch(d){throw new g.UnhandledError(d)}})),e.pendingQueries[j])}function e(a,b,c){var e=h.$q.defer(),j=e.promise,k=this;if(c=c||{},h.store[a])if(f.isObject(b))if(f.isObject(c))try{j=j.then(function(){return d.apply(k,[a,b,c])}),e.resolve()}catch(l){e.reject(new g.UnhandledError(l))}else e.reject(new g.IllegalArgumentError(i+"options: Must be an object!",{options:{actual:typeof c,expected:"object"}}));else e.reject(new g.IllegalArgumentError(i+"params: Must be an object!",{params:{actual:typeof b,expected:"object"}}));else e.reject(new g.RuntimeError(i+a+" is not a registered resource!"));return j}var f=a("utils"),g=a("errors"),h=a("services"),i="DS.findAll(resourceName, params[, options]): ";b.exports=e},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],31:[function(a,b){b.exports={create:a("./create"),destroy:a("./destroy"),find:a("./find"),findAll:a("./findAll"),refresh:a("./refresh"),save:a("./save")}},{"./create":27,"./destroy":28,"./find":29,"./findAll":30,"./refresh":32,"./save":33}],32:[function(a,b){function c(a,b,c){if(c=c||{},f.store[a]){if(d.isString(b)||d.isNumber(b)){if(d.isObject(c))return c.bypassCache=!0,b in f.store[a].index?this.find(a,b,c):!1;throw new e.IllegalArgumentError(g+"options: Must be an object!",{options:{actual:typeof c,expected:"object"}})}throw new e.IllegalArgumentError(g+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}})}throw new e.RuntimeError(g+a+" is not a registered resource!")}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.refresh(resourceName, id[, options]): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],33:[function(a,b){function c(a,b,c){var h=f.$q.defer(),i=h.promise;if(c=c||{},f.store[a])if(d.isString(b)||d.isNumber(b))if(d.isObject(c))if(b in f.store[a].index){var j=f.store[a],k=this;i=i.then(function(b){return f.$q.promisify(j.beforeValidate)(a,b)}).then(function(b){return f.$q.promisify(j.validate)(a,b)}).then(function(b){return f.$q.promisify(j.afterValidate)(a,b)}).then(function(b){return f.$q.promisify(j.beforeUpdate)(a,b)}).then(function(a){return k.PUT(d.makePath(j.baseUrl,j.endpoint,b),a,null)}).then(function(b){return f.$q.promisify(j.afterUpdate)(a,b)}).then(function(a){var e=k.inject(j.name,a,c);return j.saved[b]=d.updateTimestamp(j.saved[b]),e}),h.resolve(j.index[b])}else h.reject(new e.RuntimeError(g+'id: "'+b+'" not found!'));else h.reject(new e.IllegalArgumentError(g+"options: Must be an object!",{options:{actual:typeof c,expected:"object"}}));else h.reject(new e.IllegalArgumentError(g+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}}));else h.reject(new e.RuntimeError(g+a+" is not a registered resource!"));return i}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.save(resourceName, id[, options]): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],34:[function(a,b){function c(a,b){var c=(new Date).getTime();k.$http(b).success(function(b,d,e,f){k.$log.debug(f.method+" request:"+f.url+" Time taken: "+((new Date).getTime()-c)+"ms",arguments),a.resolve(b)}).error(function(b){k.$log.error(arguments),a.reject(b)})}function d(a){var b=k.$q.defer();try{k.$rootScope.$$phase?c(b,a):k.$rootScope.$apply(function(){c(b,a)})}catch(d){b.reject(new j.UnhandledError(d))}return b.promise}function e(a,b){return b=b||{},d(i.deepMixIn(b,{url:a,method:"GET"}))}function f(a,b,c){return c=c||{},d(i.deepMixIn(c,{url:a,data:b,method:"PUT"}))}function g(a,b,c){return c=c||{},d(i.deepMixIn(c,{url:a,data:b,method:"POST"}))}function h(a,b){return b=b||{},d(i.deepMixIn(b,{url:a,method:"DELETE"}))}var i=a("utils"),j=a("errors"),k=a("services");b.exports={HTTP:d,GET:e,POST:g,PUT:f,DEL:h}},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],35:[function(a,b){function c(a){if(a=a||{},!e.isObject(a))throw new f.IllegalArgumentError(h+"options: Must be an object!",{actual:typeof a,expected:"object"});if("baseUrl"in a&&!e.isString(a.baseUrl))throw new f.IllegalArgumentError(h+"options.baseUrl: Must be a string!",{baseUrl:{actual:typeof a.baseUrl,expected:"string"}});if("idAttribute"in a&&!e.isString(a.idAttribute))throw new f.IllegalArgumentError(h+"options.idAttribute: Must be a string!",{idAttribute:{actual:typeof a.idAttribute,expected:"string"}});if("mergeStrategy"in a&&!e.isString(a.mergeStrategy))throw new f.IllegalArgumentError(h+"options.mergeStrategy: Must be a string!",{mergeStrategy:{actual:typeof a.mergeStrategy,expected:"string"}});if("beforeValidate"in a&&!e.isFunction(a.beforeValidate))throw new f.IllegalArgumentError(h+"options.beforeValidate: Must be a function!",{beforeValidate:{actual:typeof a.beforeValidate,expected:"function"}});if("validate"in a&&!e.isFunction(a.validate))throw new f.IllegalArgumentError(h+"options.validate: Must be a function!",{validate:{actual:typeof a.validate,expected:"function"}});if("afterValidate"in a&&!e.isFunction(a.afterValidate))throw new f.IllegalArgumentError(h+"options.afterValidate: Must be a function!",{afterValidate:{actual:typeof a.afterValidate,expected:"function"}});if("beforeCreate"in a&&!e.isFunction(a.beforeCreate))throw new f.IllegalArgumentError(h+"options.beforeCreate: Must be a function!",{beforeCreate:{actual:typeof a.beforeCreate,expected:"function"}});if("afterCreate"in a&&!e.isFunction(a.afterCreate))throw new f.IllegalArgumentError(h+"options.afterCreate: Must be a function!",{afterCreate:{actual:typeof a.afterCreate,expected:"function"}});if("beforeUpdate"in a&&!e.isFunction(a.beforeUpdate))throw new f.IllegalArgumentError(h+"options.beforeUpdate: Must be a function!",{beforeUpdate:{actual:typeof a.beforeUpdate,expected:"function"}});if("afterUpdate"in a&&!e.isFunction(a.afterUpdate))throw new f.IllegalArgumentError(h+"options.afterUpdate: Must be a function!",{afterUpdate:{actual:typeof a.afterUpdate,expected:"function"}});if("beforeDestroy"in a&&!e.isFunction(a.beforeDestroy))throw new f.IllegalArgumentError(h+"options.beforeDestroy: Must be a function!",{beforeDestroy:{actual:typeof a.beforeDestroy,expected:"function"}});if("afterDestroy"in a&&!e.isFunction(a.afterDestroy))throw new f.IllegalArgumentError(h+"options.afterDestroy: Must be a function!",{afterDestroy:{actual:typeof a.afterDestroy,expected:"function"}});g.config=new g.BaseConfig(a)}function d(){this.config=c,this.$get=["$rootScope","$log","$http","$q",function(b,c,d,h){g.$rootScope=b,g.$log=c,g.$http=d,g.$q=h,g.store={};var i={};e.deepMixIn(i,a("./http")),e.deepMixIn(i,a("./sync_methods")),e.deepMixIn(i,a("./async_methods")),i.errors=f,e.deepFreeze(i);var j=b.$new();return j.$watch(function(){return(new Date).getTime()/100|0},function(){i.digest()}),i}]}var e=a("utils"),f=a("errors"),g=a("services"),h="DSProvider.config(options): ";b.exports=d},{"./async_methods":31,"./http":34,"./sync_methods":45,errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],"cX8q+p":[function(a,b){function c(a,b,c){c(null,b)}var d=b.exports={config:{idAttribute:"id"},store:{},BaseConfig:function(a){"idAttribute"in a&&(this.idAttribute=a.idAttribute),"baseUrl"in a&&(this.baseUrl=a.baseUrl),"beforeValidate"in a&&(this.beforeValidate=a.beforeValidate),"validate"in a&&(this.validate=a.validate),"afterValidate"in a&&(this.afterValidate=a.afterValidate),"beforeCreate"in a&&(this.beforeCreate=a.beforeCreate),"afterCreate"in a&&(this.afterCreate=a.afterCreate),"beforeUpdate"in a&&(this.beforeUpdate=a.beforeUpdate),"afterUpdate"in a&&(this.afterUpdate=a.afterUpdate),"beforeDestroy"in a&&(this.beforeDestroy=a.beforeDestroy),"afterDestroy"in a&&(this.afterDestroy=a.afterDestroy)}};d.BaseConfig.prototype.idAttribute="id",d.BaseConfig.prototype.baseUrl="",d.BaseConfig.prototype.endpoint="",d.BaseConfig.prototype.beforeValidate=c,d.BaseConfig.prototype.validate=c,d.BaseConfig.prototype.afterValidate=c,d.BaseConfig.prototype.beforeCreate=c,d.BaseConfig.prototype.afterCreate=c,d.BaseConfig.prototype.beforeUpdate=c,d.BaseConfig.prototype.afterUpdate=c,d.BaseConfig.prototype.beforeDestroy=c,d.BaseConfig.prototype.afterDestroy=c},{}],services:[function(a,b){b.exports=a("cX8q+p")},{}],38:[function(a,b){function c(a,b){if(!f.store[a])throw new e.RuntimeError(g+a+" is not a registered resource!");if(!d.isString(b)&&!d.isNumber(b))throw new e.IllegalArgumentError(g+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}});try{return d.deepMixIn({},f.store[a].changes[b])}catch(c){throw new e.UnhandledError(c)}}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.changes(resourceName, id): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],39:[function(a,b){function c(a){g.BaseConfig.apply(this,[a]),"name"in a&&(this.name=a.name),this.endpoint="endpoint"in a?a.endpoint:this.name,this.collection=[],this.completedQueries={},this.pendingQueries={},this.index={},this.modified={},this.changes={},this.previous_attributes={},this.saved={},this.observers={},this.collectionModified=0}function d(a){if(e.isString(a)&&(a={name:a}),!e.isObject(a))throw new f.IllegalArgumentError(h+"definition: Must be an object!",{definition:{actual:typeof a,expected:"object"}});if(!e.isString(a.name))throw new f.IllegalArgumentError(h+"definition.name: Must be a string!",{definition:{name:{actual:typeof a.name,expected:"string"}}});if(a.idAttribute&&!e.isString(a.idAttribute))throw new f.IllegalArgumentError(h+"definition.idAttribute: Must be a string!",{definition:{idAttribute:{actual:typeof a.idAttribute,expected:"string"}}});if(g.store[a.name])throw new f.RuntimeError(h+a.name+" is already registered!");try{g.store[a.name]=new c(a)}catch(b){throw delete g.store[a.name],new f.UnhandledError(b)}}var e=a("utils"),f=a("errors"),g=a("services"),h="DS.defineResource(definition): ";c.prototype=g.config,b.exports=d},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],40:[function(a,b){function c(){try{e.$rootScope.$$phase?f.Platform.performMicrotaskCheckpoint():e.$rootScope.$apply(function(){f.Platform.performMicrotaskCheckpoint()})}catch(a){throw new d.UnhandledError(a)}}var d=(a("utils"),a("errors")),e=a("services"),f=a("observejs");b.exports=c},{errors:"hIh4e1",observejs:"q+M0EE",services:"cX8q+p",utils:"uE/lJt"}],41:[function(a,b){function c(a,b){if(b){for(var c=0;c<a.collection.length&&a.collection[c][a.idAttribute||"id"]!=b;c++);a.collection.splice(c,1),a.observers[b].close(),delete a.observers[b],delete a.index[b],delete a.changes[b],delete a.previous_attributes[b],delete a.modified[b],delete a.saved[b]}else a.collection=[],a.index={},a.modified={};a.collectionModified=e.updateTimestamp(a.collectionModified)}function d(a,b){if(!g.store[a])throw new f.RuntimeError(h+a+" is not a registered resource!");if(b&&!e.isString(b)&&!e.isNumber(b))throw new f.IllegalArgumentError(h+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}});try{g.$rootScope.$$phase?c(g.store[a],b):g.$rootScope.$apply(function(){c(g.store[a],b)})}catch(d){throw new f.UnhandledError(d)}}var e=a("utils"),f=a("errors"),g=a("services"),h="DS.eject(resourceName, id): ";b.exports=d},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],42:[function(a,b){function c(a,b,c){if(c=c||{},!f.store[a])throw new e.RuntimeError(g+a+" is not a registered resource!");if(!d.isObject(b))throw new e.IllegalArgumentError(g+"params: Must be an object!",{params:{actual:typeof b,expected:"object"}});if(!d.isObject(c))throw new e.IllegalArgumentError(g+"options: Must be an object!",{options:{actual:typeof c,expected:"object"}});try{var h=f.store[a];b.query=b.query||{};var i=d.toJson(b);i in h.completedQueries||!c.loadFromServer||h.pendingQueries[i]||this.findAll(a,b,c);var j=d.filter(h.collection,function(a){var c=!0;if(b.query.where){if(!d.isObject(b.query.where))throw new e.IllegalArgumentError(g+"params.query.where: Must be an object!",{params:{query:{where:{actual:typeof b.query.where,expected:"object"}}}});d.forOwn(b.query.where,function(b,e){d.isString(b)&&(b={"===":b}),"=="in b?c=c&&a[e]==b["=="]:"==="in b?c=c&&a[e]===b["==="]:"!="in b?c=c&&a[e]!=b["!="]:">"in b?c=c&&a[e]>b[">"]:">="in b?c=c&&a[e]>=b[">="]:"<"in b?c=c&&a[e]<b["<"]:"<="in b?c=c&&a[e]<=b["<="]:"in"in b&&(c=c&&d.contains(b["in"],a[e]))
})}return c});if(b.query.orderBy){if(d.isString(b.query.orderBy)&&(b.query.orderBy=[[b.query.orderBy,"ASC"]]),!d.isArray(b.query.orderBy))throw new e.IllegalArgumentError(g+"params.query.orderBy: Must be a string or an array!",{params:{query:{orderBy:{actual:typeof b.query.orderBy,expected:"string|array"}}}});for(var k=0;k<b.query.orderBy.length;k++){if(d.isString(b.query.orderBy[k]))b.query.orderBy[k]=[b.query.orderBy[k],"ASC"];else if(!d.isArray(b.query.orderBy[k]))throw new e.IllegalArgumentError(g+"params.query.orderBy["+k+"]: Must be a string or an array!",{params:{query:{"orderBy[i]":{actual:typeof b.query.orderBy[k],expected:"string|array"}}}});j=d.sort(j,function(a,c){var e=a[b.query.orderBy[k][0]],f=c[b.query.orderBy[k][0]];return d.isString(e)&&(e=d.upperCase(e)),d.isString(f)&&(f=d.upperCase(f)),"DESC"===b.query.orderBy[k][1]?e>f?-1:f>e?1:0:f>e?-1:e>f?1:0})}}return d.isNumber(b.query.limit)&&d.isNumber(b.query.skip)?j=d.slice(j,b.query.skip,b.query.skip+b.query.limit):d.isNumber(b.query.limit)?j=d.slice(j,0,b.query.limit):d.isNumber(b.query.skip)&&(j=d.slice(j,b.query.skip)),j}catch(l){throw l instanceof e.IllegalArgumentError?l:new e.UnhandledError(l)}}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.filter(resourceName, params[, options]): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],43:[function(a,b){function c(a,b,c){if(c=c||{},!f.store[a])throw new e.RuntimeError(g+a+" is not a registered resource!");if(!d.isString(b)&&!d.isNumber(b))throw new e.IllegalArgumentError(g+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}});if(!d.isObject(c))throw new e.IllegalArgumentError(g+"options: Must be an object!",{options:{actual:typeof c,expected:"object"}});try{return b in f.store[a].index||!c.loadFromServer||this.find(a,b).then(null,function(a){throw a}),f.store[a].index[b]}catch(h){throw new e.UnhandledError(h)}}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.get(resourceName, id[, options]): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],44:[function(a,b){function c(a){return e.isEmpty(a.added)&&e.isEmpty(a.removed)&&e.isEmpty(a.changed)}function d(a,b){if(!g.store[a])throw new f.RuntimeError(h+a+" is not a registered resource!");if(!e.isString(b)&&!e.isNumber(b))throw new f.IllegalArgumentError(h+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}});try{return c(g.store[a].changes[b])}catch(d){throw new f.UnhandledError(d)}}var e=a("utils"),f=a("errors"),g=a("services"),h="DS.hasChanges(resourceName, id): ";b.exports=d},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],45:[function(a,b){b.exports={defineResource:a("./defineResource"),eject:a("./eject"),filter:a("./filter"),get:a("./get"),inject:a("./inject"),lastModified:a("./lastModified"),lastSaved:a("./lastSaved"),digest:a("./digest"),changes:a("./changes"),previous:a("./previous"),hasChanges:a("./hasChanges")}},{"./changes":38,"./defineResource":39,"./digest":40,"./eject":41,"./filter":42,"./get":43,"./hasChanges":44,"./inject":46,"./lastModified":47,"./lastSaved":48,"./previous":49}],46:[function(a,b){function c(a,b){var d=this;if(e.isArray(b))for(var i=0;i<b.length;i++)c.call(d,a,b[i]);else{var j=b[a.idAttribute||"id"];j in a.index?(e.deepMixIn(a.index[j],b),a.observers[j].deliver()):(a.index[j]={},a.previous_attributes[j]={},e.deepMixIn(a.index[j],b),e.deepMixIn(a.previous_attributes[j],b),a.collection.push(a.index[j]),a.observers[j]=new h.ObjectObserver(a.index[j],function(b,c,d,h){try{var i=h(a.idAttribute||"id");a.index[i][a.idAttribute||"id"]!=i&&(a.index[i][a.idAttribute||"id"]=i,g.$log.error("You cannot change the primary key of an object! Reverting change to primary key.")),a.changes[i]=e.diffObjectFromOldObject(a.index[i],a.previous_attributes[i]),a.modified[i]=e.updateTimestamp(a.modified[i]),a.collectionModified=e.updateTimestamp(a.collectionModified)}catch(j){throw new f.UnhandledError(j)}}),a.observers[j].deliver())}}function d(a,b,d){if(d=d||{},!g.store[a])throw new f.RuntimeError(i+a+" is not a registered resource!");if(!e.isObject(b)&&!e.isArray(b))throw new f.IllegalArgumentError(i+"attrs: Must be an object or an array!",{attrs:{actual:typeof b,expected:"object|array"}});if(!e.isObject(d))throw new f.IllegalArgumentError(i+"options: Must be an object!",{options:{actual:typeof d,expected:"object"}});var h=g.store[a],j=this,k=h.idAttribute||"id";if(b[k]){try{g.$rootScope.$$phase?c.apply(j,[g.store[a],b]):g.$rootScope.$apply(function(){c.apply(j,[g.store[a],b])})}catch(l){throw new f.UnhandledError(l)}return h.index[b[k]]}throw new f.RuntimeError(i+"attrs: Must contain the property specified by `idAttribute` in the resource definition!")}var e=a("utils"),f=a("errors"),g=a("services"),h=a("observejs"),i="DS.inject(resourceName, attrs[, options]): ";b.exports=d},{errors:"hIh4e1",observejs:"q+M0EE",services:"cX8q+p",utils:"uE/lJt"}],47:[function(a,b){function c(a,b){if(!f.store[a])throw new e.RuntimeError(g+a+" is not a registered resource!");if(b&&!d.isString(b)&&!d.isNumber(b))throw new e.IllegalArgumentError(g+"id: Must be a string or number!",{id:{actual:typeof b,expected:"string|number"}});try{return b?(b in f.store[a].modified||(f.store[a].modified[b]=0),f.store[a].modified[b]):f.store[a].collectionModified}catch(c){throw new e.UnhandledError(c)}}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.lastModified(resourceName[, id]): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],48:[function(a,b){function c(a,b){if(!f.store[a])throw new e.RuntimeError(g+a+" is not a registered resource!");if(b&&!d.isString(b)&&!d.isNumber(b))throw new e.IllegalArgumentError(g+"id: Must be a string or number!",{id:{actual:typeof b,expected:"string|number"}});try{return b?(b in f.store[a].saved||(f.store[a].saved[b]=0),f.store[a].saved[b]):f.store[a].collectionModified}catch(c){throw new e.UnhandledError(c)}}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.lastSaved(resourceName[, id]): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],49:[function(a,b){function c(a,b){if(!f.store[a])throw new e.RuntimeError(g+a+" is not a registered resource!");if(!d.isString(b)&&!d.isNumber(b))throw new e.IllegalArgumentError(g+"id: Must be a string or a number!",{id:{actual:typeof b,expected:"string|number"}});try{return angular.copy(f.store[a].previous_attributes[b])}catch(c){throw new e.UnhandledError(c)}}var d=a("utils"),e=a("errors"),f=a("services"),g="DS.previous(resourceName, id): ";b.exports=c},{errors:"hIh4e1",services:"cX8q+p",utils:"uE/lJt"}],errors:[function(a,b){b.exports=a("hIh4e1")},{}],hIh4e1:[function(a,b){function c(a){Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),a=a||{},this.type=this.constructor.name,this.originalError=a,this.message="UnhandledError: This is an uncaught exception. Please consider submitting an issue at https://github.com/jmdobry/angular-data/issues.\n\nOriginal Uncaught Exception:\n"+(a.stack?a.stack.toString():a.stack),this.stack=this.message}function d(a,b){Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.errors=b||{},this.message=a||"Illegal Argument!"}function e(a,b){Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.errors=b||{},this.message=a||"Validation Error!"}function f(a,b){Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.errors=b||{},this.message=a||"RuntimeError Error!"}c.prototype=Object.create(Error.prototype),c.prototype.constructor=c,d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,b.exports={UnhandledError:c,IllegalArgumentError:d,ValidationError:e,RuntimeError:f}},{}],52:[function(a){!function(b,c){"use strict";c.module("jmdobry.angular-data",["ng"]).config(["$provide",function(a){a.decorator("$q",function(a){return a.promisify=function(a,b){var c=this;return function(){var d=c.defer(),e=Array.prototype.slice.apply(arguments);e.push(function(a,b){a?d.reject(a):d.resolve(b)});try{a.apply(b||this,e)}catch(f){d.reject(f)}return d.promise}},a})}]),c.module("jmdobry.angular-data").provider("DS",a("./datastore"))}(window,window.angular)},{"./datastore":35}],"uE/lJt":[function(a,b){b.exports={isString:angular.isString,isArray:angular.isArray,isObject:angular.isObject,isNumber:angular.isNumber,isFunction:angular.isFunction,isEmpty:a("mout/lang/isEmpty"),toJson:angular.toJson,makePath:a("mout/string/makePath"),upperCase:a("mout/string/upperCase"),deepMixIn:a("mout/object/deepMixIn"),forOwn:a("mout/object/forOwn"),contains:a("mout/array/contains"),filter:a("mout/array/filter"),toLookup:a("mout/array/toLookup"),slice:a("mout/array/slice"),sort:a("mout/array/sort"),updateTimestamp:function(a){var b="function"==typeof Date.now?Date.now():(new Date).getTime();return a&&a>=b?a+1:b},deepFreeze:function c(a){if("function"==typeof Object.freeze){var b,d;Object.freeze(a);for(d in a)b=a[d],a.hasOwnProperty(d)&&"object"==typeof b&&!Object.isFrozen(b)&&c(b)}},diffObjectFromOldObject:function(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var h in a)h in b||(c[h]=a[h]);return{added:c,removed:d,changed:e}}}},{"mout/array/contains":1,"mout/array/filter":2,"mout/array/slice":5,"mout/array/sort":6,"mout/array/toLookup":7,"mout/lang/isEmpty":12,"mout/object/deepMixIn":19,"mout/object/forOwn":21,"mout/string/makePath":23,"mout/string/upperCase":24}],utils:[function(a,b){b.exports=a("uE/lJt")},{}]},{},[52]);