Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-data

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-data - npm Package Compare versions

Comparing version 2.6.1 to 2.7.0

scripts/banner.js

11

CHANGELOG.md

@@ -0,1 +1,12 @@

##### 2.7.0 - 22 October 2015
###### Backwards compatible API changes
- #205 - DS#revert should ignore omitted fields
- #243 - DS#commit
- #245 - Closes #205 by @internalfx
- #248 - Fix `belongsTo` relation with zero value by @Pencroff
###### Other
- Dropped Grunt
##### 2.6.1 - 12 October 2015

@@ -2,0 +13,0 @@

9

dist/js-data.min.js
/*!
* js-data
* @version 2.6.1 - Homepage <http://www.js-data.io/>
* @version 2.7.0 - Homepage <http://www.js-data.io/>
* @author Jason Dobry <jason.dobry@gmail.com>

@@ -10,5 +10,4 @@ * @copyright (c) 2014-2015 Jason Dobry

*/
!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.JSData=b():a.JSData=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){var d=c(1),e=c(2),f=c(3);a.exports={DS:d["default"],DSUtils:e["default"],DSErrors:f["default"],createStore:function(a){return new d["default"](a)},version:{full:"2.6.1",major:parseInt("2",10),minor:parseInt("6",10),patch:parseInt("1",10),alpha:"false",beta:"false"}}},function(a,b,c){function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c){c(null,b)}function f(a,b){return b}function g(a,b,c,d){var e=!0;a:for(;e;){var f=a,g=b,h=c,i=d;k=l=m=void 0,e=!1;var k=f[g],l=j["default"].get(h,k[0]),m=j["default"].get(i,k[0]);if(j["default"]._s(l)&&(l=j["default"].upperCase(l)),j["default"]._s(m)&&(m=j["default"].upperCase(m)),"DESC"===k[1]){if(l>m)return-1;if(m>l)return 1;if(g<f.length-1){a=f,b=g+1,c=h,d=i,e=!0;continue a}return 0}if(m>l)return-1;if(l>m)return 1;if(!(g<f.length-1))return 0;a=f,b=g+1,c=h,d=i,e=!0}}function h(a,b){j["default"].forOwn(b,function(b,c){a[c]=b,a[c].before=function(b){var d=a[c];a[c]=function(){for(var a=arguments.length,c=Array(a),e=0;a>e;e++)c[e]=arguments[e];return d.apply(this,b.apply(this,c)||c)}}})}var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(2),k=c(3),l=c(30),m=c(36),n=function(){function a(){d(this,a)}return i(a,[{key:"errorFn",value:function(a,b){if(this.error&&"function"==typeof this.error){try{throw"string"==typeof a?new Error(a):a}catch(c){a=c}this.error(this.name||null,a||null,b||null)}}}]),a}(),o=n.prototype;o.actions={},o.afterCreate=e,o.afterCreateCollection=f,o.afterCreateInstance=f,o.afterDestroy=e,o.afterEject=f,o.afterFind=e,o.afterFindAll=e,o.afterInject=f,o.afterLoadRelations=e,o.afterReap=f,o.afterUpdate=e,o.afterValidate=e,o.allowSimpleWhere=!0,o.basePath="",o.beforeCreate=e,o.beforeCreateCollection=f,o.beforeCreateInstance=f,o.beforeDestroy=e,o.beforeEject=f,o.beforeInject=f,o.beforeReap=f,o.beforeUpdate=e,o.beforeValidate=e,o.bypassCache=!1,o.cacheResponse=!!j["default"].w,o.clearEmptyQueries=!0,o.computed={},o.defaultAdapter="http",o.debug=!1,o.defaultValues={},o.eagerEject=!1,o.eagerInject=!1,o.endpoint="",o.error=console?function(a,b,c){return console["function"==typeof console.error?"error":"log"](a,b,c)}:!1,o.errorHandler=function(){return j["default"].Promise.reject(arguments[0])},o.fallbackAdapters=["http"],o.findStrictCache=!1,o.idAttribute="id",o.ignoredChanges=[/\$/],o.instanceEvents=!!j["default"].w,o.keepChangeHistory=!1,o.linkRelations=!!j["default"].w,o.log=console?function(a,b,c,d,e){return console["function"==typeof console.info?"info":"log"](a,b,c,d,e)}:!1,o.logFn=function(a,b,c,d){var e=this;e.debug&&e.log&&"function"==typeof e.log&&e.log(e.name||null,a||null,b||null,c||null,d||null)},o.maxAge=!1,o.methods={},o.notify=!!j["default"].w,o.omit=[],o.onConflict="merge",o.reapAction=j["default"].w?"inject":"none",o.reapInterval=j["default"].w?3e4:!1,o.relationsEnumerable=!1,o.resetHistoryOnInject=!0,o.returnMeta=!1,o.scopes={},o.strategy="single",o.upsert=!!j["default"].w,o.useClass=!0,o.useFilter=!1,o.validate=e,o.watchChanges=!!j["default"].w,o.defaultFilter=function(a,b,c,d){var e=a,f=null,h={skip:"",offset:"",where:"",limit:"",orderBy:"",sort:""};c=c||{},d=d||{},f=j["default"]._o(c.where)?c.where:{},d.allowSimpleWhere&&j["default"].forOwn(c,function(a,b){b in h||b in f||(f[b]={"==":a})}),j["default"].isEmpty(f)&&(f=null),f&&(e=j["default"].filter(e,function(a){var b=!0,c=!0;return j["default"].forOwn(f,function(d,e){j["default"]._o(d)||(d={"==":d}),j["default"].forOwn(d,function(d,f){var g=void 0,h="|"===f[0],i=j["default"].get(a,e);f=h?f.substr(1):f,"=="===f?g=i==d:"==="===f?g=i===d:"!="===f?g=i!=d:"!=="===f?g=i!==d:">"===f?g=i>d:">="===f?g=i>=d:"<"===f?g=d>i:"<="===f?g=d>=i:"isectEmpty"===f?g=!j["default"].intersection(i||[],d||[]).length:"isectNotEmpty"===f?g=j["default"].intersection(i||[],d||[]).length:"in"===f?g=j["default"]._s(d)?-1!==d.indexOf(i):j["default"].contains(d,i):"notIn"===f?g=j["default"]._s(d)?-1===d.indexOf(i):!j["default"].contains(d,i):"contains"===f?g=j["default"]._s(i)?-1!==i.indexOf(d):j["default"].contains(i,d):"notContains"===f&&(g=j["default"]._s(i)?-1===i.indexOf(d):!j["default"].contains(i,d)),void 0!==g&&(c=b?g:h?c||g:c&&g),b=!1})}),c}));var i=null;j["default"]._s(c.orderBy)?i=[[c.orderBy,"ASC"]]:j["default"]._a(c.orderBy)&&(i=c.orderBy),!i&&j["default"]._s(c.sort)?i=[[c.sort,"ASC"]]:!i&&j["default"]._a(c.sort)&&(i=c.sort),i&&!function(){var a=0;j["default"].forEach(i,function(a,c){if(j["default"]._s(a))i[c]=[a,"ASC"];else if(!j["default"]._a(a))throw new k["default"].IA('DS.filter("'+b+'"[, params][, options]): '+j["default"].toJson(a)+": Must be a string or an array!",{params:{"orderBy[i]":{actual:typeof a,expected:"string|array"}}})}),e=j["default"].sort(e,function(b,c){return g(i,a,b,c)})}();var l=j["default"]._n(c.limit)?c.limit:null,m=null;return j["default"]._n(c.skip)?m=c.skip:j["default"]._n(c.offset)&&(m=c.offset),l&&m?e=j["default"].slice(e,m,Math.min(e.length,m+l)):j["default"]._n(l)?e=j["default"].slice(e,0,Math.min(e.length,l)):j["default"]._n(m)&&(e=m<e.length?j["default"].slice(e,m):[]),e===a?e.slice():e};var p=function(){function a(b){d(this,a);var c=this;b=b||{},c.store={},c.definitions={},c.adapters={},c.defaults=new n,c.observe=j["default"].observe,j["default"].forOwn(b,function(a,b){"omit"===b?c.defaults.omit=a.concat(n.prototype.omit):c.defaults[b]=a});var e=j["default"].Promise;e&&!e.prototype.spread&&(e.prototype.spread=function(a){return this.then(function(b){return a.apply(this,b)})}),j["default"].Events(c)}return i(a,[{key:"getAdapterName",value:function(a){var b=!1;if(a=a||{},j["default"]._s(a)&&(b=!0,a={adapter:a}),this.adapters[a.adapter])return a.adapter;if(b)throw new Error(a.adapter+" is not a registered adapter!");return a.defaultAdapter}},{key:"getAdapter",value:function(a){return a=a||{},this.adapters[this.getAdapterName(a)]}},{key:"registerAdapter",value:function(a,b,c){var d=this;c=c||{},j["default"].isFunction(b)?d.adapters[a]=new b(c):d.adapters[a]=b,c["default"]&&(d.defaults.defaultAdapter=a)}},{key:"is",value:function(a,b){var c=this.definitions[a];if(!c)throw new k["default"].NER(a);return b instanceof c[c["class"]]}},{key:"clear",value:function(){var a=this,b={};return j["default"].forOwn(this.definitions,function(c){var d=c.name;b[d]=c.ejectAll(),a.store[d].completedQueries={},a.store[d].queryData={}}),b}},{key:"errorFn",value:function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b[b.length-1],e=this.defaults.errorHandler,f=d?d.errorHandler:e;return f=f||e,function(a){return f.apply(void 0,[a].concat(b))}}}]),a}(),q=p.prototype;q.getAdapterName.shorthand=!1,q.getAdapter.shorthand=!1,q.registerAdapter.shorthand=!1,q.errors=k["default"],q.utils=j["default"],h(q,l["default"]),h(q,m["default"]),b["default"]=p},function(a,b,c){function d(a){return"[object Array]"===T.call(a)||!1}function e(a){return"[object RegExp]"===T.call(a)||!1}function f(a){return"string"==typeof a||a&&"object"==typeof a&&"[object String]"===T.call(a)||!1}function g(a){return"[object Object]"===T.call(a)||!1}function h(a){return a&&"object"==typeof a&&"[object Date]"===T.call(a)||!1}function i(a){var b=typeof a;return"number"===b||a&&"object"===b&&"[object Number]"===T.call(a)||!1}function j(a){return"function"==typeof a||a&&"[object Function]"===T.call(a)||!1}function k(a){return f(a)||i(a)}function l(a){return new z["default"].IA('"'+a+'" must be a string or a number!')}function m(a){return new z["default"].IA('"'+a+'" must be an object!')}function n(a){return new z["default"].IA('"'+a+'" must be an array!')}function o(a){if(null==a)return!0;if("string"==typeof a||V(a))return!a.length;if("object"==typeof a){var b=!0;return D(a,function(){return b=!1,!1}),b}return!0}function p(a,b){if(!a||!b)return[];for(var c=[],d=void 0,e=0,f=a.length;f>e;e++)d=a[e],E(c,d)||E(b,d)&&c.push(d);return c}function q(a,b,c){var d=[];return B(a,function(a,c,e){b(a,c,e)&&d.push(a)},c),d}function r(a){var b={};a=a||this,Object.defineProperties(a,{on:{value:function(a,c,d){b[a]=b[a]||[],b[a].push({f:c,c:d})}},off:{value:function(a,c){var d=b[a];if(d)if(c){for(var e=0;e<d.length;e++)if(d[e].f===c){d.splice(e,1);break}}else d.splice(0,d.length);else b={}}},emit:{value:function(){for(var a=arguments.length,c=Array(a),d=0;a>d;d++)c[d]=arguments[d];var e=b[c.shift()]||[];if(e)for(var f=0;f<e.length;f++)e[f].f.apply(e[f].c,c)}}})}function s(a,b,c,d,f){if(b){if(a===b)throw new Error("Cannot copy! Source and destination are identical.");if(c=c||[],d=d||[],g(a)){var i=c.indexOf(a);if(-1!==i)return d[i];c.push(a),d.push(b)}var j=void 0;if(V(a)){var k=void 0;for(b.length=0,k=0;k<a.length;k++)j=s(a[k],null,c,d,f),g(a[k])&&(c.push(a[k]),d.push(j)),b.push(j)}else{V(b)?b.length=0:B(b,function(a,c){delete b[c]});for(var l in a)if(a.hasOwnProperty(l)){if(X(l,f))continue;j=s(a[l],null,c,d,f),g(a[l])&&(c.push(a[l]),d.push(j)),b[l]=j}}}else b=a,a&&(V(a)?b=s(a,[],c,d,f):h(a)?b=new Date(a.getTime()):e(a)?(b=new RegExp(a.source,a.toString().match(/[^\/]*$/)[0]),b.lastIndex=a.lastIndex):g(a)&&(b=s(a,Object.create(Object.getPrototypeOf(a)),c,d,f)));return b}function t(a,b){var c=!0;a:for(;c;){var d=a,f=b;if(l=m=g=i=k=void 0,c=!1,d===f)return!0;if(null===d||null===f)return!1;if(d!==d&&f!==f)return!0;var g,i,k,l=typeof d,m=typeof f;if(l==m&&"object"==l){if(!V(d)){if(h(d)){if(!h(f))return!1;a=d.getTime(),b=f.getTime(),c=!0;continue a}if(e(d)&&e(f))return d.toString()==f.toString();if(V(f))return!1;k={};for(i in d)if("$"!==i.charAt(0)&&!j(d[i])){if(!t(d[i],f[i]))return!1;k[i]=!0}for(i in f)if(!k.hasOwnProperty(i)&&"$"!==i.charAt(0)&&void 0!==f[i]&&!j(f[i]))return!1;return!0}if(!V(f))return!1;if((g=d.length)===f.length){for(i=0;g>i;i++)if(!t(d[i],f[i]))return!1;return!0}}return!1}}function u(a,b){return f(b)||i(b)?b:b&&a?b[a.idAttribute]||b:b}function v(a,b){return a&&(f(b)||i(b))?a.index[b]||b:b}function w(a){return null!=a&&""!==a}function x(a,b){return b=b||"",q(a,w).join(b)}function y(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=x(b,"/");return d.replace(/([^:\/]|^)\/{2,}/g,"$1/")}var z=c(3),A=c(4),B=c(5),C=c(6),D=c(7),E=c(10),F=c(12),G=c(14),H=c(21),I=c(22),J=c(23),K=c(24),L=c(19),M=c(25),N=c(27),O=c(29),P=void 0,Q=void 0,R=void 0,S=Object.prototype,T=S.toString;try{Q=Promise}catch(U){console.error("js-data requires a global Promise constructor!")}try{R=window.File}catch(U){R=function(){}}var V=Array.isArray||d;try{P=window,P={}}catch(U){P=null}var W=["beforeValidate","validate","afterValidate","beforeCreate","afterCreate","beforeUpdate","afterUpdate","beforeDestroy","afterDestroy"],X=O.isBlacklisted;b["default"]={Promise:Q,_:function(a,b){var c=this;if(a=a||{},b=b||{},b&&b.constructor===a.constructor)return b;if(!g(b))throw new z["default"].IA('"options" must be an object!');B(W,function(a){"function"==typeof b[a]&&-1===b[a].toString().indexOf("for (var _len = arg")&&(b[a]=c.promisify(b[a]))});var d=function(a){var b=this;D(a,function(a,c){b[c]=a})};return d.prototype=a,d.prototype.orig=function(){var a={};return D(this,function(b,c){a[c]=b}),a},new d(b)},_n:i,_s:f,_sn:k,_snErr:l,_o:g,_oErr:m,_a:V,_aErr:n,applyScope:function(a,b,c){var d=c.scope,e=s(b);d?f(d)&&(d=[d]):d=[],d.unshift("defaultScope"),B(d,function(d){var e=c.scopes[d];"function"==typeof e?F(b,e(a)):e&&F(b,e)}),F(b,e)},compute:function(a,b){var c=this,d=[];g(a)||(B(a.deps,function(a){d.push(M(c,a))}),N(c,b,a[a.length-1].apply(c,d)))},contains:E,copy:s,deepMixIn:F,diffObjectFromOldObject:O.diffObjectFromOldObject,BinaryHeap:A,equals:t,Events:r,filter:q,fillIn:function(a,b){return D(b,function(b,c){c in a||(a[c]=b)}),a},forEach:B,forOwn:D,fromJson:function(a){return f(a)?JSON.parse(a):a},get:M,intersection:p,isArray:V,isBlacklisted:X,isEmpty:o,isFunction:j,isObject:g,isNumber:i,isString:f,keys:J,makePath:y,observe:O,omit:function(a,b){var c=[];return D(a,function(a,d){X(d,b)&&c.push(d)}),B(c,function(b){delete a[b]}),a},pascalCase:G,pick:I,promisify:function(a,b){var c=this;if(a){if("function"!=typeof a)throw new Error("Can only promisify functions!");return function(){for(var d=arguments.length,e=Array(d),f=0;d>f;f++)e[f]=arguments[f];return new c.Promise(function(c,d){e.push(function(a,b){a?d(a):c(b)});try{var f=a.apply(b||this,e);f&&f.then&&f.then(c,d)}catch(g){d(g)}})}}},remove:H,set:N,slice:C,sort:K,toJson:JSON.stringify,updateTimestamp:function(a){var b="function"==typeof Date.now?Date.now():(new Date).getTime();return a&&a>=b?a+1:b},upperCase:L,removeCircular:function(a){return function b(a,c){var d=void 0,e=void 0;if(!("object"!=typeof a||null===a||a instanceof Boolean||a instanceof Date||a instanceof Number||a instanceof RegExp||a instanceof String||a instanceof R)){for(var f=c.cur,g=c.ctx;g;){if(g.cur===f)return void 0;g=g.ctx}if(V(a))for(e=[],d=0;d<a.length;d+=1)e[d]=b(a[d],{ctx:c,cur:a[d]});else e={},D(a,function(d,f){e[f]=b(a[f],{ctx:c,cur:a[f]})});return e}return a}(a,{ctx:null,cur:a})},resolveItem:v,resolveId:u,respond:function(a,b,c){return"array"===c.returnMeta?[a,b]:"object"===c.returnMeta?{response:a,meta:b}:a},w:P,applyRelationGettersToTarget:function(a,b,c){this.forEach(b.relationList,function(d){var e=d.relation,f=d.localField,g=d.localKey,h=d.foreignKey,i=d.localKeys,j=d.foreignKeys,k="boolean"==typeof d.enumerable?d.enumerable:!!b.relationsEnumerable;if("boolean"==typeof d.link?d.link:!!b.linkRelations){delete c[f];var l={enumerable:k};"belongsTo"===d.type?(l.get=function(){return M(this,g)?b.getResource(e).get(M(this,g)):void 0},l.set=function(a){return a&&N(this,g,M(a,b.getResource(e).idAttribute)),M(this,f)}):"hasMany"===d.type?(l.get=function(){var c={};if(h)return c[h]=this[b.idAttribute],b.getResource(e).defaultFilter.call(a,a.store[e].collection,e,c,{allowSimpleWhere:!0});if(i){var d=M(this,i)||[];return b.getResource(e).getAll(V(d)?d:J(d))}return j?(N(c,"where."+j+".contains",this[b.idAttribute]),b.getResource(e).defaultFilter.call(a,a.store[e].collection,e,c)):void 0},l.set=function(a){var c=this;return a&&a.length&&!function(){var d=M(c,b.idAttribute);h?B(a,function(a){N(a,h,d)}):i?!function(){var d=[];B(a,function(a){d.push(M(a,b.getResource(e).idAttribute))}),N(c,i,d)}():j&&B(a,function(a){var b=M(a,j);b?E(b,d)||b.push(d):N(a,j,[d])})}(),M(this,f)}):"hasOne"===d.type&&(g?(l.get=function(){var a=M(this,g),c=!(!a&&0!==a);return c?b.getResource(e).get(a):void 0},l.set=function(a){return a&&N(this,g,M(a,b.getResource(e).idAttribute)),M(this,f)}):(l.get=function(){var c={};c[h]=this[b.idAttribute];var d=c[h]?b.getResource(e).defaultFilter.call(a,a.store[e].collection,e,c,{allowSimpleWhere:!0}):[];return d.length?d[0]:void 0},l.set=function(a){return a&&N(a,h,M(this,b.idAttribute)),M(this,f)})),d.get&&!function(){var a=l.get;l.get=function(){var c=this;return d.get(b,d,this,function(){for(var b=arguments.length,d=Array(b),e=0;b>e;e++)d[e]=arguments[e];return a.apply(c,d)})}}(),Object.defineProperty(c,f,l)}})}}},function(a,b){function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var e=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},f=function(a){function b(a){c(this,b),e(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.message=a}return d(b,a),b}(Error),g=function(a){function b(a){c(this,b),e(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.message=a}return d(b,a),b}(Error),h=function(a){function b(a){c(this,b),e(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.message=a+" is not a registered resource!"}return d(b,a),b}(Error);b["default"]={IllegalArgumentError:f,IA:f,RuntimeError:g,R:g,NonexistentResourceError:h,NER:h}},function(a,b,c){!function(b,c){a.exports=c()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a,b,c){for(var d=a[c],e=b(d);c>0;){var f=Math.floor((c+1)/2)-1,g=a[f];if(e>=b(g))break;a[f]=d,a[c]=g,c=f}}function e(a,b){if(a||(a=function(a){return a}),b||(b=function(a,b){return a===b}),"function"!=typeof a)throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');if("function"!=typeof b)throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');this.weightFunc=a,this.compareFunc=b,this.heap=[]}var f=function(a,b,c){for(var d=a.length,e=a[c],f=b(e);;){var g=2*(c+1),h=g-1,i=null;if(d>h){var j=a[h],k=b(j);f>k&&(i=h)}if(d>g){var l=a[g],m=b(l);m<(null===i?f:b(a[h]))&&(i=g)}if(null===i)break;a[c]=a[i],a[i]=e,c=i}},g=e.prototype;g.push=function(a){this.heap.push(a),d(this.heap,this.weightFunc,this.heap.length-1)},g.peek=function(){return this.heap[0]},g.pop=function(){var a=this.heap[0],b=this.heap.pop();return this.heap.length>0&&(this.heap[0]=b,f(this.heap,this.weightFunc,0)),a},g.remove=function(a){for(var b=this.heap.length,c=0;b>c;c++)if(this.compareFunc(this.heap[c],a)){var e=this.heap[c],g=this.heap.pop();return c!==b-1&&(this.heap[c]=g,d(this.heap,this.weightFunc,c),f(this.heap,this.weightFunc,c)),e}return null},g.removeAll=function(){this.heap=[]},g.size=function(){return this.heap.length},a.exports=e}])})},function(a,b){function c(a,b,c){if(null!=a)for(var d=-1,e=a.length;++d<e&&b.call(c,a[d],d,a)!==!1;);}a.exports=c},function(a,b){function c(a,b,c){var d=a.length;b=null==b?0:0>b?Math.max(d+b,0):Math.min(b,d),c=null==c?d:0>c?Math.max(d+c,0):Math.min(c,d);for(var e=[];c>b;)e.push(a[b++]);return e}a.exports=c},function(a,b,c){function d(a,b,c){f(a,function(d,f){return e(a,f)?b.call(c,a[f],f,a):void 0})}var e=c(8),f=c(9);a.exports=d},function(a,b){function c(a,b){return Object.prototype.hasOwnProperty.call(a,b)}a.exports=c},function(a,b,c){function d(){h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],g=!0;for(var a in{toString:null})g=!1}function e(a,b,c){var e,j=0;null==g&&d();for(e in a)if(f(b,a,e,c)===!1)break;if(g)for(var k=a.constructor,l=!!k&&a===k.prototype;(e=h[j++])&&("constructor"===e&&(l||!i(a,e))||a[e]===Object.prototype[e]||f(b,a,e,c)!==!1););}function f(a,b,c,d){return a.call(d,b[c],c,b)}var g,h,i=c(8);a.exports=e},function(a,b,c){function d(a,b){return-1!==e(a,b)}var e=c(11);a.exports=d},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}a.exports=c},function(a,b,c){function d(a,b){for(var c,d=0,g=arguments.length;++d<g;)c=arguments[d],c&&f(c,e,a);return a}function e(a,b){var c=this[b];g(a)&&g(c)?d(c,a):this[b]=a}var f=c(7),g=c(13);a.exports=d},function(a,b){function c(a){return!!a&&"object"==typeof a&&a.constructor===Object}a.exports=c},function(a,b,c){function d(a){return a=e(a),f(a).replace(/^[a-z]/,g)}var e=c(15),f=c(16),g=c(19);a.exports=d},function(a,b){function c(a){return null==a?"":a.toString()}a.exports=c},function(a,b,c){function d(a){return a=e(a),a=f(a),a=g(a).replace(/[\-_]/g," ").replace(/\s[a-z]/g,h).replace(/\s+/g,"").replace(/^[A-Z]/g,i)}var e=c(15),f=c(17),g=c(18),h=c(19),i=c(20);a.exports=d},function(a,b,c){function d(a){return a=e(a),a.search(/[\xC0-\xFF]/g)>-1&&(a=a.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),a}var e=c(15);a.exports=d},function(a,b,c){function d(a){return a=e(a),a.replace(f,"")}var e=c(15),f=/[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;a.exports=d},function(a,b,c){function d(a){return a=e(a),a.toUpperCase()}var e=c(15);a.exports=d},function(a,b,c){function d(a){return a=e(a),a.toLowerCase()}var e=c(15);a.exports=d},function(a,b,c){function d(a,b){var c=e(a,b);-1!==c&&a.splice(c,1)}var e=c(11);a.exports=d},function(a,b,c){function d(a,b){for(var c,d="string"!=typeof arguments[1]?arguments[1]:e(arguments,1),f={},g=0;c=d[g++];)f[c]=a[c];return f}var e=c(6);a.exports=d},function(a,b,c){var d=c(7),e=Object.keys||function(a){var b=[];return d(a,function(a,c){b.push(c)}),b};a.exports=e},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}a.exports=c},function(a,b,c){function d(a,b){for(var c=b.split("."),d=c.pop();b=c.shift();)if(a=a[b],null==a)return;return a[d]}c(26);a.exports=d},function(a,b){function c(a){switch(typeof a){case"string":case"number":case"boolean":return!0}return null==a}a.exports=c},function(a,b,c){function d(a,b,c){var d=/^(.+)\.(.+)$/.exec(b);d?e(a,d[1])[d[2]]=c:a[b]=c}var e=c(28);a.exports=d},function(a,b,c){function d(a,b){return b?(e(b.split("."),function(b){a[b]||(a[b]={}),a=a[b]}),a):a}var e=c(5);a.exports=d},function(a,b){!function(a){function b(){function a(a){b=a}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=[],c={},d=[];return Object.observe(c,a),Array.observe(d,a),c.id=1,c.id=2,delete c.id,d.push(1,2),d.length=0,Object.deliverChangeRecords(a),5!==b.length?!1:"add"!=b[0].type||"update"!=b[1].type||"delete"!=b[2].type||"splice"!=b[3].type||"splice"!=b[4].type?!1:(Object.unobserve(c,a),Array.unobserve(d,a),!0)}function c(b){for(var c=0;s>c&&b.check_();)c++;return p&&(a.dirtyCheckCycleCount=c),c>0}function d(a){for(var b in a)return!1;return!0}function e(a){return d(a.added)&&d(a.removed)&&d(a.changed)}function f(a,b){if(!b||!b.length)return!1;for(var c,d=0;d<b.length;d++)if("[object RegExp]"===Object.prototype.toString.call(b[d])&&b[d].test(a)||b[d]===a)return c=a;return!!c}function g(a,b,c,d){var e={},g={},h={};for(var i in b){var j=a[i];f(i,d)||void 0!==j&&(c?c(j,b[i]):j===b[i])||(i in a?(c?c(j,b[i]):j===b[i])||(h[i]=j):g[i]=void 0)}for(var i in a)i in b||f(i,d)||(e[i]=a[i]);return Array.isArray(a)&&a.length!==b.length&&(h.length=a.length),{added:e,removed:g,changed:h}}function h(){if(!t.length)return!1;for(var a=0;a<t.length;a++)t[a]();return t.length=0,!0}function i(){function a(a){b&&b.state_===x&&!d&&b.check_(a)}var b,c,d=!1,e=!0;return{open:function(c){if(b)throw Error("ObservedObject in use");e||Object.deliverChangeRecords(a),b=c,e=!1},observe:function(b,d){c=b,d?Array.observe(c,a):Object.observe(c,a)},deliver:function(b){d=b,Object.deliverChangeRecords(a),d=!1},close:function(){b=void 0,Object.unobserve(c,a),v.push(this)}}}function j(a,b,c){var d=v.pop()||i();return d.open(a),d.observe(b,c),d}function k(){this.state_=w,this.callback_=void 0,this.target_=void 0,this.directObserver_=void 0,this.value_=void 0,this.id_=z++}function l(a){k._allObserversCount++,B&&A.push(a)}function m(a){k._allObserversCount--}function n(a){k.call(this),this.value_=a,this.oldObject_=void 0}function o(a,b,c){for(var d={},e={},f=0;f<b.length;f++){var g=b[f];E[g.type]?(g.name in c||(c[g.name]=g.oldValue),"update"!=g.type&&("add"!=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}}var p=a.testingExposeCycleCount,q=b(),r="__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},s=1e3,t=[],u=q?function(){return function(a){return Promise.resolve().then(a)}}():function(){return function(a){t.push(a)}}(),v=[],w=0,x=1,y=2,z=1;k.prototype={open:function(a,b){if(this.state_!=w)throw Error("Observer has already been opened.");return l(this),this.callback_=a,this.target_=b,this.connect_(),this.state_=x,this.value_},close:function(){this.state_==x&&(m(this),this.disconnect_(),this.value_=void 0,this.callback_=void 0,this.target_=void 0,this.state_=y)},deliver:function(){this.state_==x&&c(this)},report_:function(a){try{this.callback_.apply(this.target_,a)}catch(b){k._errorThrownDuringCallback=!0,console.error("Exception caught during observer callback: "+(b.stack||b))}},discardChanges:function(){return this.check_(void 0,!0),this.value_}};var A,B=!q;k._allObserversCount=0,B&&(A=[]);var C=!1;a.Platform=a.Platform||{},a.Platform.performMicrotaskCheckpoint=function(){if(!C&&B){C=!0;var b,c,d=0;do{d++,c=A,A=[],b=!1;for(var e=0;e<c.length;e++){var f=c[e];f.state_==x&&(f.check_()&&(b=!0),A.push(f))}h()&&(b=!0)}while(s>d&&b);p&&(a.dirtyCheckCycleCount=d),C=!1}},B&&(a.Platform.clearObservers=function(){A=[]}),n.prototype=r({__proto__:k.prototype,arrayObserve:!1,connect_:function(a,b){q?this.directObserver_=j(this,this.value_,this.arrayObserve):this.oldObject_=this.copyObject(this.value_)},copyObject:function(a){var b=Array.isArray(a)?[]:{};for(var c in a)b[c]=a[c];return Array.isArray(a)&&(b.length=a.length),b},check_:function(a,b){var c,d;if(q){if(!a)return!1;d={},c=o(this.value_,a,d)}else d=this.oldObject_,c=g(this.value_,this.oldObject_);return e(c)?!1:(q||(this.oldObject_=this.copyObject(this.value_)),this.report_([c.added||{},c.removed||{},c.changed||{},function(a){return d[a]}]),!0)},disconnect_:function(){q?(this.directObserver_.close(),this.directObserver_=void 0):this.oldObject_=void 0},deliver:function(){this.state_==x&&(q?this.directObserver_.deliver(!1):c(this))},discardChanges:function(){return this.directObserver_?this.directObserver_.deliver(!0):this.oldObject_=this.copyObject(this.value_),this.value_}});var D={},E={add:!0,update:!0,"delete":!0};a.Observer=k,a.isBlacklisted=f,a.Observer.runEOM_=u,a.Observer.observerSentinel_=D,a.Observer.hasObjectObserve=q,a.diffObjectFromOldObject=g,a.ObjectObserver=n}(b)},function(a,b,c){function d(a){return!(f["default"].isEmpty(a.added)&&f["default"].isEmpty(a.removed)&&f["default"].isEmpty(a.changed))}function e(a,b,c,d){var e=this,g=e.definitions[b];if(d=d||{},c=f["default"].resolveId(g,c),!g)throw new h(b);if(!f["default"]._sn(c))throw f["default"]._snErr("id");return c=c===k?void 0:c,d=f["default"]._(g,d),{_this:e,definition:g,_resourceName:b,_id:c,_options:d}}var f=c(2),g=c(3),h=g["default"].NER,i=g["default"].IA,j=g["default"].R,k="DS_"+(new Date).getTime();b["default"]={changes:function(a,b,c){var d=e.call(this,"changes",a,b,c),g=d._this,h=d.definition,i=d._resourceName,j=d._id,k=d._options,l=h.get(j);if(l){var m=function(){var a=g.store[i].observers[j];a&&"function"==typeof a&&a.deliver();var b=k.ignoredChanges||[];f["default"].forEach(h.relationFields,function(a){f["default"].contains(b,a)||b.push(a)});var c=f["default"].diffObjectFromOldObject(l,g.store[i].previousAttributes[j],f["default"].equals,b);return f["default"].forOwn(c,function(a,b){var d=[];f["default"].forOwn(a,function(a,b){f["default"].isFunction(a)||d.push(b)}),c[b]=f["default"].pick(c[b],d)}),f["default"].forEach(h.relationFields,function(a){delete c.added[a],delete c.removed[a],delete c.changed[a]}),{v:c}}();if("object"==typeof m)return m.v}},changeHistory:function(a,b){var c=e.call(this,"changeHistory",a,b||k),d=c._this,f=c.definition,g=c._resourceName,h=c._id,i=d.store[g];if(f.keepChangeHistory){if(!g)return i.changeHistory;var j=f.get(h);if(j)return i.changeHistories[h]}else f.errorFn("changeHistory is disabled for this resource!")},compute:function(a,b){var c=this,d=c.definitions[a];if(b=f["default"].resolveItem(c.store[a],b),!d)throw new h(a);if(!b)throw new j("Item not in the store!");if(!f["default"]._o(b)&&!f["default"]._sn(b))throw new i('"instance" must be an object, string or number!');return f["default"].forOwn(d.computed,function(a,c){f["default"].compute.call(b,a,c)}),b},createInstance:function(a,b,c){var d=this.definitions[a],e=void 0;if(b=b||{},!d)throw new h(a);if(b&&!f["default"].isObject(b))throw new i('"attrs" must be an object!');c=f["default"]._(d,c),c.beforeCreateInstance(c,b);var g=d[d["class"]];return e=new g,d.instanceEvents&&f["default"].Events(e),c.defaultValues&&f["default"].deepMixIn(e,c.defaultValues),f["default"].deepMixIn(e,b),d.computed&&d.compute(e),c.afterCreateInstance(c,e),e},createCollection:function(a,b,c,d){var e=this,g=e.definitions[a];if(b=b||[],c=c||{},!g)throw new h(a);if(b&&!f["default"].isArray(b))throw new i('"arr" must be an array!');return d=f["default"]._(g,d),d.beforeCreateCollection(d,b),Object.defineProperties(b,{fetch:{value:function(b,c){var d=this;return d.params=b||d.params,g.findAll(d.params,c).then(function(b){return b===d?d:(b.unshift(d.length),b.unshift(0),d.splice.apply(d,b),b.shift(),b.shift(),b.$$injected&&(e.store[a].queryData[f["default"].toJson(d.params)]=d,d.$$injected=!0),d)})}},params:{value:c,writable:!0},resourceName:{value:a}}),d.afterCreateCollection(d,b),b},defineResource:c(31),digest:function(){this.observe.Platform.performMicrotaskCheckpoint()},eject:c(32),ejectAll:c(33),filter:c(34),get:function(a,b){var c=e.call(this,"get",a,b),d=c._this,f=c._resourceName,g=c._id;return d.store[f].index[g]},getAll:function(a,b){var c=this,d=c.definitions[a],e=c.store[a],g=[];if(!d)throw new h(a);if(b&&!f["default"]._a(b))throw f["default"]._aErr("ids");if(f["default"]._a(b))for(var i=b.length,j=0;i>j;j++)e.index[b[j]]&&g.push(e.index[b[j]]);else g=e.collection.slice();return g},hasChanges:function(a,b){var c=e.call(this,"hasChanges",a,b),f=c.definition,g=c._id;return f.get(g)?d(f.changes(g)):!1},inject:c(35),lastModified:function(a,b){var c=e.call(this,"lastModified",a,b||k),d=c._this,f=c._resourceName,g=c._id,h=d.store[f];return g?(g in h.modified||(h.modified[g]=0),h.modified[g]):h.collectionModified},lastSaved:function(a,b){var c=e.call(this,"lastSaved",a,b||k),d=c._this,f=c._resourceName,g=c._id,h=d.store[f];return g in h.saved||(h.saved[g]=0),h.saved[g]},previous:function(a,b){var c=e.call(this,"previous",a,b),d=c._this,g=c._resourceName,h=c._id,i=d.store[g];return i.previousAttributes[h]?f["default"].copy(i.previousAttributes[h]):void 0;
},revert:function(a,b){var c=e.call(this,"revert",a,b),d=c._this,f=c.definition,g=c._resourceName,h=c._id;return f.inject(d.previous(g,h))}}},function(a,b,c){var d=c(2),e=c(3),f=["compute","eject","refresh","save","update","destroy","loadRelations","changeHistory","changes","hasChanges","lastModified","lastSaved","previous","revert"];a.exports=function(a){function b(b){this.defaultValues={},this.methods={},this.computed={},this.scopes={},this.actions={},d["default"].deepMixIn(this,b);var e=c.defaults;a["extends"]&&g[a["extends"]]&&(e=g[a["extends"]]),d["default"].fillIn(this.defaultValues,e.defaultValues),d["default"].fillIn(this.methods,e.methods),d["default"].fillIn(this.computed,e.computed),d["default"].fillIn(this.scopes,e.scopes),d["default"].fillIn(this.actions,e.actions),this.endpoint="endpoint"in b?b.endpoint:this.name}var c=this,g=c.definitions;if(d["default"]._s(a)&&(a={name:a.replace(/\s/gi,"")}),!d["default"]._o(a))throw d["default"]._oErr("definition");if(!d["default"]._s(a.name))throw new e["default"].IA('"name" must be a string!');if(g[a.name])throw new e["default"].R(a.name+" is already registered!");try{var h,i,j=function(){if(a["extends"]&&g[a["extends"]]?b.prototype=g[a["extends"]]:b.prototype=c.defaults,g[a.name]=new b(a),h=g[a.name],h.getResource=function(a){return c.definitions[a]},!d["default"]._s(h.idAttribute))throw new e["default"].IA('"idAttribute" must be a string!');h.relations&&(h.relationList=[],h.relationFields=[],d["default"].forOwn(h.relations,function(a,b){d["default"].forOwn(a,function(c,e){d["default"]._a(c)||(a[e]=[c]),d["default"].forEach(a[e],function(a){a.type=b,a.relation=e,a.name=h.name,h.relationList.push(a),a.localField&&h.relationFields.push(a.localField)})})}),h.relations.belongsTo&&d["default"].forOwn(h.relations.belongsTo,function(a,b){d["default"].forEach(a,function(a){a.parent&&(h.parent=b,h.parentKey=a.localKey,h.parentField=a.localField)})}),"function"==typeof Object.freeze&&(Object.freeze(h.relations),Object.freeze(h.relationList))),i=h["class"]=d["default"].pascalCase(h.name);try{"function"==typeof h.useClass?(h[i]=new Function("def","return function "+i+"() { def.useClass.call(this); }")(h),h[i].prototype=function(a){function b(){}return b.prototype=a,new b}(h.useClass.prototype)):h[i]=new Function("return function "+i+"() {}")()}catch(j){h[i]=function(){}}d["default"].forOwn(h.methods,function(a,b){h[i].prototype[b]=a}),h[i].prototype.set=function(a,b){var c=this;return d["default"].set(this,a,b),h.compute(this),h.instanceEvents&&setTimeout(function(){c.emit("DS.change",h,c)},0),h.handleChange(this),this},h[i].prototype.get=function(a){return d["default"].get(this,a)},d["default"].applyRelationGettersToTarget(c,h,h[i].prototype);var k=null;h.hasOwnProperty("omit")?k=c.defaults.omit:(k=h.omit,h.omit=[]),h.omit=h.omit.concat(k||[]),d["default"].forOwn(h.computed,function(a,b){if(d["default"].isFunction(a)&&(h.computed[b]=[a],a=h.computed[b]),h.methods&&b in h.methods&&h.errorFn('Computed property "'+b+'" conflicts with previously defined prototype method!'),h.omit.push(b),d["default"].isArray(a)){var c;if(1===a.length){var e=a[0].toString().match(/function.*?\(([\s\S]*?)\)/);c=e[1].split(","),c=d["default"].filter(c,function(a){return a}),h.computed[b]=c.concat(a),a=h.computed[b],c.length&&h.errorFn("Use the computed property array syntax for compatibility with minified code!")}c=a.slice(0,a.length-1),d["default"].forEach(c,function(a,b){c[b]=a.trim()}),a.deps=d["default"].filter(c,function(a){return!!a})}else d["default"].isObject(a)&&Object.defineProperty(h[i].prototype,b,a)}),d["default"].forEach(f,function(a){h[i].prototype["DS"+d["default"].pascalCase(a)]=function(){for(var b=arguments.length,d=Array(b),e=0;b>e;e++)d[e]=arguments[e];return d.unshift(this[h.idAttribute]||this),d.unshift(h.name),c[a].apply(c,d)}}),h[i].prototype.DSCreate=function(){for(var a=arguments.length,b=Array(a),d=0;a>d;d++)b[d]=arguments[d];return b.unshift(this),b.unshift(h.name),c.create.apply(c,b)},c.store[h.name]={collection:[],expiresHeap:new d["default"].BinaryHeap(function(a){return a.expires},function(a,b){return a.item===b}),completedQueries:{},queryData:{},pendingQueries:{},index:{},modified:{},saved:{},previousAttributes:{},observers:{},changeHistories:{},changeHistory:[],collectionModified:0};var l=c.store[h.name];h.reapInterval&&setInterval(function(){return h.reap()},h.reapInterval);var m=["registerAdapter","getAdapterName","getAdapter","is","!clear"];for(var n in c)"function"==typeof c[n]&&m.push(n);d["default"].forEach(m,function(a){var b=a;"!"!==b[0]&&(c[b].shorthand!==!1?(h[b]=function(){for(var a=arguments.length,d=Array(a),e=0;a>e;e++)d[e]=arguments[e];return d.unshift(h.name),c[b].apply(c,d)},h[b].before=function(a){var c=h[b];h[b]=function(){for(var b=arguments.length,d=Array(b),e=0;b>e;e++)d[e]=arguments[e];return c.apply(h,a.apply(h,d)||d)}}):h[b]=function(){for(var a=arguments.length,d=Array(a),e=0;a>e;e++)d[e]=arguments[e];return c[b].apply(c,d)})}),h.beforeValidate=d["default"].promisify(h.beforeValidate),h.validate=d["default"].promisify(h.validate),h.afterValidate=d["default"].promisify(h.afterValidate),h.beforeCreate=d["default"].promisify(h.beforeCreate),h.afterCreate=d["default"].promisify(h.afterCreate),h.afterFind=d["default"].promisify(h.afterFind),h.afterFindAll=d["default"].promisify(h.afterFindAll),h.afterLoadRelations=d["default"].promisify(h.afterLoadRelations),h.beforeUpdate=d["default"].promisify(h.beforeUpdate),h.afterUpdate=d["default"].promisify(h.afterUpdate),h.beforeDestroy=d["default"].promisify(h.beforeDestroy),h.afterDestroy=d["default"].promisify(h.afterDestroy);var o=void 0;return h.hasOwnProperty("defaultAdapter")&&(o=h.defaultAdapter),d["default"].forOwn(h.actions,function(a,b){if(h[b]&&!h.actions[b])throw new Error('Cannot override existing method "'+b+'"!');a.request=a.request||function(a){return a},a.response=a.response||function(a){return a},a.responseError=a.responseError||function(a){return d["default"].Promise.reject(a)},h[b]=function(c,e){d["default"]._o(c)&&(e=c),e=e||{};var f=h.getAdapter(a.adapter||o||"http"),g=d["default"].deepMixIn({},a);if(!e.hasOwnProperty("endpoint")&&g.endpoint&&(e.endpoint=g.endpoint),"function"==typeof e.getEndpoint)g.url=e.getEndpoint(h,e);else{var i=[e.basePath||h.basePath||f.defaults.basePath,f.getEndpoint(h,d["default"]._sn(c)?c:null,e)];d["default"]._sn(c)&&i.push(c),i.push(a.pathname||b),g.url=d["default"].makePath.apply(null,i)}return g.method=g.method||"GET",g.resourceName=h.name,d["default"].deepMixIn(g,e),new d["default"].Promise(function(a){return a(g)}).then(e.request||a.request).then(function(a){return f.HTTP(a)}).then(function(a){return a&&a.config&&(a.config.resourceName=h.name),a}).then(e.response||a.response,e.responseError||a.responseError)}}),d["default"].Events(h),h.handleChange=function(a){l.collectionModified=d["default"].updateTimestamp(l.collectionModified),h.notify&&setTimeout(function(){h.emit("DS.change",h,a)},0)},{v:h}}();if("object"==typeof j)return j.v}catch(k){throw c.defaults.errorFn(k),delete g[a.name],delete c.store[a.name],k}}},function(a,b){a.exports=function(a,b,c){var d=this,e=d.utils,f=d.definitions[a],g=d.store[a],h=void 0,i=!1;if(b=e.resolveId(f,b),!f)throw new d.errors.NER(a);if(!e._sn(b))throw e._snErr("id");c=e._(f,c);for(var j=0;j<g.collection.length;j++)if(g.collection[j][f.idAttribute]==b){h=g.collection[j],g.expiresHeap.remove(h),i=!0;break}if(i){var k=function(){f.beforeEject(c,h),c.notify&&f.emit("DS.beforeEject",f,h);var a=[];return e.forOwn(g.queryData,function(b,d){b.$$injected&&e.remove(b,h),!b.length&&c.clearEmptyQueries&&a.push(d)}),e.forEach(g.changeHistories[b],function(a){e.remove(g.changeHistory,a)}),e.forEach(a,function(a){delete g.completedQueries[a],delete g.queryData[a]}),g.observers[b]&&"function"==typeof g.observers[b].close&&g.observers[b].close(),delete g.observers[b],delete g.index[b],delete g.previousAttributes[b],delete g.completedQueries[b],delete g.pendingQueries[b],delete g.changeHistories[b],delete g.modified[b],delete g.saved[b],f.instanceEvents&&h.off&&h.off(),g.collection.splice(j,1),f.handleChange(h),f.afterEject(c,h),c.notify&&f.emit("DS.afterEject",f,h),{v:h}}();if("object"==typeof k)return k.v}}},function(a,b){a.exports=function(a,b,c){var d=this,e=d.utils,f=d.definitions[a];if(b=b||{},!f)throw new d.errors.NER(a);if(!e._o(b))throw e._oErr("params");c=e._(f,c),e.applyScope(f,b,c);var g=d.store[a],h=e.toJson(b),i=f.filter(b);return e.isEmpty(b)?g.completedQueries={}:delete g.completedQueries[h],e.forEach(i,function(a){a&&a[f.idAttribute]&&f.eject(a[f.idAttribute],c)}),f.handleChange(i),i}},function(a,b){a.exports=function(a,b,c){var d=this,e=d.utils,f=d.definitions[a];if(!f)throw new d.errors.NER(a);if(b&&!e._o(b))throw e._oErr("params");return b=b||{},c=e._(f,c),e.applyScope(f,b,c),f.defaultFilter.call(d,d.store[a].collection,a,b,c)}},function(a,b,c){function d(a,b){var c=this,d=a.name;return function(e,g,h,i,j){var k=this,l=void 0,m=i&&i(a.idAttribute)?i(a.idAttribute):k[a.idAttribute];if(f["default"].forEach(a.relationFields,function(a){delete e[a],delete g[a],delete h[a]}),(!f["default"].isEmpty(e)||!f["default"].isEmpty(g)||!f["default"].isEmpty(h)||j)&&(l=c.get(d,m),b.modified[m]=f["default"].updateTimestamp(b.modified[m]),l&&a.instanceEvents&&setTimeout(function(){l.emit("DS.change",a,l)},0),a.handleChange(l),a.keepChangeHistory)){var n={resourceName:d,target:l,added:e,removed:g,changed:h,timestamp:b.modified[m]};b.changeHistories[m].push(n),b.changeHistory.push(n)}a.computed&&(l=l||c.get(d,m),f["default"].forOwn(a.computed,function(a,b){if(!f["default"]._o(a)){var c=!1;f["default"].forEach(a.deps,function(a){(a in e||a in g||a in h||!(b in l))&&(c=!0)}),c=c||!a.deps.length,c&&f["default"].compute.call(l,a,b)}})),a.idAttribute in h&&a.errorFn('Doh! You just changed the primary key of an object! Your data for the "'+d+'" resource is now in an undefined (probably broken) state.')}}function e(a,b,c,h){var i=this,j=void 0;if(f["default"]._a(c)){j=[];for(var k=0;k<c.length;k++)j.push(e.call(i,a,b,c[k],h))}else{var l=a.computed,m=a.idAttribute;if(l&&l[m]&&!function(){var a=[];f["default"].forEach(l[m].deps,function(b){a.push(c[b])}),c[m]=l[m][l[m].length-1].apply(c,a)}(),!(m in c)){var n=new g["default"].R(a.name+'.inject: "attrs" must contain the property specified by "idAttribute"!');throw h.errorFn(n),n}try{!function(){f["default"].forEach(a.relationList,function(b){var d=b.relation,e=i.definitions[d],j=c[b.localField];if("function"==typeof b.inject)b.inject(a,b,c);else if(j&&b.inject!==!1){if(!e)throw new g["default"].R(a.name+" relation is defined but the resource is not!");if(f["default"]._a(j))!function(){var g=[];f["default"].forEach(j,function(j){if(j!==i.store[d].index[j[e.idAttribute]])try{var k=e.inject(j,h.orig());b.foreignKey&&f["default"].set(k,b.foreignKey,c[a.idAttribute]),g.push(k)}catch(l){h.errorFn(l,"Failed to inject "+b.type+' relation: "'+d+'"!')}})}();else if(j!==i.store[d].index[j[e.idAttribute]])try{var k=e.inject(c[b.localField],h.orig());b.foreignKey&&f["default"].set(k,b.foreignKey,c[a.idAttribute])}catch(l){h.errorFn(l,"Failed to inject "+b.type+' relation: "'+d+'"!')}}});var e=c[m],k=a.get(e),l=k?b.modified[e]:0;if(k)"merge"===h.onConflict?f["default"].deepMixIn(k,c):"replace"===h.onConflict&&(f["default"].forOwn(k,function(b,d){d!==a.idAttribute&&(c.hasOwnProperty(d)||delete k[d])}),f["default"].forOwn(c,function(b,c){c!==a.idAttribute&&(k[c]=b)})),a.resetHistoryOnInject&&(b.previousAttributes[e]=f["default"].copy(k,null,null,null,a.relationFields),b.changeHistories[e].length&&(f["default"].forEach(b.changeHistories[e],function(a){f["default"].remove(b.changeHistory,a)}),b.changeHistories[e].splice(0,b.changeHistories[e].length))),b.observers[e]&&"function"==typeof b.observers[e]&&b.observers[e].deliver();else{k=c instanceof a[a["class"]]?c:new a[a["class"]],a.instanceEvents&&"function"!=typeof k.emit&&f["default"].Events(k),f["default"].forEach(a.relationList,function(b){("boolean"==typeof b.link?b.link:!!a.linkRelations)&&delete c[b.localField]}),f["default"].deepMixIn(k,c),b.collection.push(k),b.changeHistories[e]=[];var n=d.call(i,a,b);a.watchChanges&&(b.observers[e]=new i.observe.ObjectObserver(k),b.observers[e].open(n,k)),b.index[e]=k,n.call(k,{},{},{},null,!0),b.previousAttributes[e]=f["default"].copy(k,null,null,null,a.relationFields)}b.modified[e]=l&&b.modified[e]===l?f["default"].updateTimestamp(b.modified[e]):b.modified[e],b.expiresHeap.remove(k);var o=(new Date).getTime();b.expiresHeap.push({item:k,timestamp:o,expires:a.maxAge?o+a.maxAge:Number.MAX_VALUE}),j=k}()}catch(o){h.errorFn(o,c)}}return j}var f=c(2),g=c(3);a.exports=function(a,b,c){var d=this,h=d.definitions[a],i=d.store[a],j=void 0;if(!h)throw new g["default"].NER(a);if(!f["default"]._o(b)&&!f["default"]._a(b))throw new g["default"].IA(a+'.inject: "attrs" must be an object or an array!');return c=f["default"]._(h,c),c.beforeInject(c,b),c.notify&&h.emit("DS.beforeInject",h,b),j=e.call(d,h,i,b,c),h.handleChange(j),c.afterInject(c,j),c.notify&&h.emit("DS.afterInject",h,j),j}},function(a,b,c){b["default"]={create:c(37),destroy:c(38),destroyAll:c(39),find:c(40),findAll:c(41),loadRelations:c(42),reap:c(43),refresh:function(a,b,c){var d=this,e=d.utils;return new e.Promise(function(f,g){var h=d.definitions[a];b=e.resolveId(d.definitions[a],b),h?e._sn(b)?(c=e._(h,c),c.bypassCache=!0,f(d.get(a,b))):g(e._snErr("id")):g(new d.errors.NER(a))}).then(function(e){return e?d.find(a,b,c):e})["catch"](d.errorFn("refresh",a,b,c))},refreshAll:function(a,b,c){var d=this,e=d.utils,f=d.definitions[a];return b=b||{},new e.Promise(function(g,h){f?e._o(b)?(c=e._(f,c),c.bypassCache=!0,g(d.filter(a,b,c))):h(e._oErr("params")):h(new d.errors.NER(a))}).then(function(g){return c.bypassCache=!0,d.findAll(a,b,c).then(function(a){return e.forEach(g,function(b){-1===a.indexOf(b)&&f.eject(b)}),a})})["catch"](d.errorFn("refreshAll",a,b,c))},save:c(44),update:c(45),updateAll:c(46)}},function(a,b){a.exports=function(a,b,c){var d=this,e=d.utils,f=d.definitions[a],g=void 0;c=c||{},b=b||{};var h=void 0;if(f)if(e._o(b)){if(c=e._(f,c),c.upsert&&e._sn(b[f.idAttribute]))return d.update(a,b[f.idAttribute],b,c)}else h=e._oErr("attrs");else h=new d.errors.NER(a);return new e.Promise(function(a,c){h?c(h):a(b)}).then(function(a){return c.beforeValidate.call(a,c,a)}).then(function(a){return c.validate.call(a,c,a)}).then(function(a){return c.afterValidate.call(a,c,a)}).then(function(a){return c.beforeCreate.call(a,c,a)}).then(function(a){return c.notify&&f.emit("DS.beforeCreate",f,a),g=d.getAdapterName(c),d.adapters[g].create(f,e.omit(a,c.omit),c)}).then(function(a){return c.afterCreate.call(a,c,a)}).then(function(b){if(c.notify&&f.emit("DS.afterCreate",f,b),c.cacheResponse){var g=d.inject(f.name,b,c.orig()),h=g[f.idAttribute],i=d.store[a];return i.completedQueries[h]=(new Date).getTime(),i.saved[h]=e.updateTimestamp(i.saved[h]),g}return d.createInstance(a,b,c)}).then(function(a){return e.respond(a,{adapter:g},c)})["catch"](d.errorFn("create",a,b,c))}},function(a,b){a.exports=function(a,b,c){var d=this,e=d.utils,f=d.definitions[a],g=void 0,h=void 0;return new e.Promise(function(h,i){b=e.resolveId(f,b),f?e._sn(b)?(g=f.get(b)||{id:b},c=e._(f,c),h(g)):i(e._snErr("id")):i(new d.errors.NER(a))}).then(function(a){return c.beforeDestroy.call(a,c,a)}).then(function(a){return c.notify&&f.emit("DS.beforeDestroy",f,a),c.eagerEject&&f.eject(b),h=f.getAdapter(c),h.destroy(f,b,c)}).then(function(){return c.afterDestroy.call(g,c,g)}).then(function(a){return c.notify&&f.emit("DS.afterDestroy",f,a),f.eject(b),e.respond(b,{adapter:h},c)})["catch"](function(e){return c&&c.eagerEject&&g&&f.inject(g,{notify:!1}),d.errorFn("destroy",a,b,c)(e)})}},function(a,b){a.exports=function(a,b,c){var d=this,e=d.utils,f=d.definitions[a],g=void 0,h=void 0,i=void 0;return b=b||{},new e.Promise(function(g,h){f?e._o(b)?(c=e._(f,c),e.applyScope(f,b,c),g()):h(e._oErr("attrs")):h(new d.errors.NER(a))}).then(function(){return h=f.defaultFilter.call(d,a,b),c.beforeDestroy(c,h)}).then(function(){return c.notify&&f.emit("DS.beforeDestroy",f,h),c.eagerEject&&(g=f.ejectAll(b)),i=f.getAdapterName(c),d.adapters[i].destroyAll(f,b,c)}).then(function(){return c.afterDestroy(c,h)}).then(function(){return c.notify&&f.emit("DS.afterDestroy",f,h),g||f.ejectAll(b)}).then(function(a){return e.respond(a,{adapter:i},c)})["catch"](function(e){return c&&c.eagerEject&&g&&f.inject(g,{notify:!1}),d.errorFn("destroyAll",a,b,c)(e)})}},function(a,b){a.exports=function(a,b,c){var d=this,e=d.utils,f=d.definitions[a],g=d.store[a],h=void 0;return new e.Promise(function(h,i){if(f)if(e._sn(b)){c=e._(f,c),c.params&&(c.params=e.copy(c.params)),(c.bypassCache||!c.cacheResponse)&&delete g.completedQueries[b];var j=c.maxAge&&b in g.completedQueries&&g.completedQueries[b]+c.maxAge<(new Date).getTime();c.findStrictCache&&!(b in g.completedQueries)||!f.get(b)||c.bypassCache||j?(delete g.completedQueries[b],h()):h(f.get(b))}else i(e._snErr("id"));else i(new d.errors.NER(a))}).then(function(a){if(a)return a;if(!(b in g.pendingQueries)){var i=void 0,j=c.findStrategy||c.strategy;if("fallback"===j){var k=function l(a){return h=f.getAdapterName((c.findFallbackAdapters||c.fallbackAdapters)[a]),d.adapters[h].find(f,b,c)["catch"](function(b){return a++,a<c.fallbackAdapters.length?l(a):e.Promise.reject(b)})};i=k(0)}else h=f.getAdapterName(c),i=d.adapters[h].find(f,b,c);g.pendingQueries[b]=i.then(function(a){return c.afterFind.call(a,c,a)}).then(function(a){if(delete g.pendingQueries[b],c.cacheResponse){var d=f.inject(a,c.orig());return g.completedQueries[b]=(new Date).getTime(),g.saved[b]=e.updateTimestamp(g.saved[b]),d}return f.createInstance(a,c.orig())})}return g.pendingQueries[b]}).then(function(a){return e.respond(a,{adapter:h},c)})["catch"](function(e){return g&&delete g.pendingQueries[b],d.errorFn("find",a,b,c)(e)})}},function(a,b){function c(a,b,c,d){var e=this,f=e.utils,g=e.definitions[b],h=e.store[b],i=e.definitions[b].idAttribute,j=(new Date).getTime();a=a||[],delete h.pendingQueries[c],h.completedQueries[c]=j;var k=g.inject(a,d.orig());return f._a(k)?f.forEach(k,function(a){if(a){var b=a[i];b&&(h.completedQueries[b]=j,h.saved[b]=f.updateTimestamp(h.saved[b]))}}):(d.errorFn("response is expected to be an array!"),h.completedQueries[k[i]]=j),k}a.exports=function(a,b,d){var e=this,f=e.utils,g=e.definitions[a],h=e.store[a],i=void 0,j=void 0;return new f.Promise(function(c,j){if(b=b||{},e.definitions[a])if(f._o(b)){d=f._(g,d),i=f.toJson(b),d.params&&(d.params=f.copy(d.params)),f.applyScope(g,b,d),(d.bypassCache||!d.cacheResponse)&&(delete h.completedQueries[i],delete h.queryData[i]);var k=d.maxAge&&i in h.completedQueries&&h.completedQueries[i]+d.maxAge<(new Date).getTime();i in h.completedQueries&&!k?c(d.useFilter?d.localKeys?g.getAll(d.localKeys,d.orig()):g.filter(b,d.orig()):h.queryData[i]):c()}else j(f._oErr("params"));else j(new e.errors.NER(a))}).then(function(k){if(k)return k;if(!(i in h.pendingQueries)){var l=void 0,m=d.findAllStrategy||d.strategy;if("fallback"===m){var n=function o(a){return j=g.getAdapterName((d.findAllFallbackAdapters||d.fallbackAdapters)[a]),e.adapters[j].findAll(g,b,d)["catch"](function(b){return a++,a<d.fallbackAdapters.length?o(a):f.Promise.reject(b)})};l=n(0)}else j=g.getAdapterName(d),l=e.adapters[j].findAll(g,b,d);h.pendingQueries[i]=l.then(function(a){return d.afterFindAll.call(a,d,a)}).then(function(b){return delete h.pendingQueries[i],d.cacheResponse?(h.queryData[i]=c.call(e,b,a,i,d),h.queryData[i].$$injected=!0,h.queryData[i]):(f.forEach(b,function(a,c){b[c]=g.createInstance(a,d.orig())}),b)})}return h.pendingQueries[i]}).then(function(a){return f.respond(a,{adapter:j},d)})["catch"](function(c){return h&&delete h.pendingQueries[i],e.errorFn("findAll",a,b,d)(c)})}},function(a,b){function c(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}a.exports=function(a,b,d,e){var f=this,g=f.utils,h=f.errors,i=f.definitions[a],j=void 0;return new g.Promise(function(f,k){g._sn(b)&&(b=i.get(b)),g._s(d)&&(d=[d]),d=d||[],i?g._o(b)?g._a(d)?!function(){j=g._(i,e);var a=[];g.forEach(i.relationList,function(f){var h=f.relation,j=i.getResource(h),k=g._(j,e);if(!d.length||g.contains(d,h)||g.contains(d,f.localField)){var l=void 0,m={};k.allowSimpleWhere?m[f.foreignKey]=b[i.idAttribute]:(m.where={},m.where[f.foreignKey]={"==":b[i.idAttribute]});var n=k.orig(),o=f.localKey?g.get(b,f.localKey):null,p=!(!o&&0!==o);if("function"==typeof f.load)l=f.load(i,f,b,n);else if("hasMany"===f.type){if(f.localKeys){delete m[f.foreignKey];var q=g.get(b,f.localKeys)||[];q=g._a(q)?q:g.keys(q),m.where=c({},j.idAttribute,{"in":q}),n.localKeys=q}else f.foreignKeys&&(delete m[f.foreignKey],m.where=c({},f.foreignKeys,{contains:b[i.idAttribute]}));l=j.findAll(m,n)}else"hasOne"===f.type?f.localKey&&p?l=j.find(o,n):f.foreignKey&&(l=j.findAll(m,n).then(function(a){return a.length?a[0]:null})):p&&(l=j.find(o,n));l&&a.push(l)}}),f(a)}():k(new h.IA('"relations" must be a string or an array!')):k(new h.IA('"instance(id)" must be a string, number or object!')):k(new h.NER(a))}).then(function(a){return g.Promise.all(a)}).then(function(){return j.afterLoadRelations.call(b,j,b)})["catch"](f.errorFn("loadRelations",a,b,d,e))}},function(a,b){a.exports=function(a,b){var c=this,d=c.utils,e=c.definitions[a],f=c.store[a];return new d.Promise(function(g,h){if(e){b=d._(e,b),b.hasOwnProperty("notify")||(b.notify=!1);for(var i=[],j=(new Date).getTime(),k=void 0;(k=f.expiresHeap.peek())&&k.expires<j;)i.push(k.item),delete k.item,f.expiresHeap.pop();g(i)}else h(new c.errors.NER(a))}).then(function(a){if(a.length&&(e.beforeReap(b,a),b.notify&&e.emit("DS.beforeReap",e,a)),"inject"===b.reapAction)!function(){var b=(new Date).getTime();d.forEach(a,function(a){f.expiresHeap.push({item:a,timestamp:b,expires:e.maxAge?b+e.maxAge:Number.MAX_VALUE})})}();else if("eject"===b.reapAction)d.forEach(a,function(a){e.eject(a[e.idAttribute])});else if("refresh"===b.reapAction){var c=function(){var b=[];return d.forEach(a,function(a){b.push(e.refresh(a[e.idAttribute]))}),{v:d.Promise.all(b)}}();if("object"==typeof c)return c.v}return a}).then(function(a){return a.length&&(e.afterReap(b,a),b.notify&&e.emit("DS.afterReap",e,a)),a})["catch"](c.errorFn("reap",a,b))}},function(a,b){a.exports=function(a,b,c){var d=this,e=d.utils,f=d.errors,g=d.definitions[a],h=d.store[a],i=void 0,j=void 0,k=void 0;return new e.Promise(function(d,h){b=e.resolveId(g,b),g?e._sn(b)?g.get(b)?(i=g.get(b),c=e._(g,c),d(i)):h(new f.R('id "'+b+'" not found in cache!')):h(e._snErr("id")):h(new f.NER(a))}).then(function(a){return c.beforeValidate.call(a,c,a)}).then(function(a){return c.validate.call(a,c,a)}).then(function(a){return c.afterValidate.call(a,c,a)}).then(function(a){return c.beforeUpdate.call(a,c,a)}).then(function(a){if(c.notify&&g.emit("DS.beforeUpdate",g,a),c.changesOnly){h.observers[b]&&"function"==typeof h.observers[b]&&h.observers[b].deliver();var f=[],i=g.changes(b);for(var l in i.added)f.push(l);for(l in i.changed)f.push(l);if(i=e.pick(a,f),e.isEmpty(i))return j=!0,a;a=i}return k=g.getAdapterName(c),d.adapters[k].update(g,b,e.omit(a,c.omit),c)}).then(function(a){return c.afterUpdate.call(a,c,a)}).then(function(a){if(c.notify&&g.emit("DS.afterUpdate",g,a),j)return a;if(c.cacheResponse){var b=g.inject(a,c.orig()),d=b[g.idAttribute];return h.saved[d]=e.updateTimestamp(h.saved[d]),g.resetHistoryOnInject||(h.previousAttributes[d]=e.copy(b,null,null,null,g.relationFields)),b}return g.createInstance(a,c.orig())}).then(function(a){return e.respond(a,{adapter:k},c)})["catch"](d.errorFn("save",a,b,c))}},function(a,b){a.exports=function(a,b,c,d){var e=this,f=e.utils,g=e.errors,h=e.definitions[a],i=void 0;return new f.Promise(function(e,i){b=f.resolveId(h,b),h?f._sn(b)?(d=f._(h,d),e(c)):i(f._snErr("id")):i(new g.NER(a))}).then(function(a){return d.beforeValidate.call(a,d,a)}).then(function(a){return d.validate.call(a,d,a)}).then(function(a){return d.afterValidate.call(a,d,a)}).then(function(a){return d.beforeUpdate.call(a,d,a)}).then(function(a){return d.notify&&h.emit("DS.beforeUpdate",h,a),i=h.getAdapterName(d),e.adapters[i].update(h,b,f.omit(a,d.omit),d)}).then(function(a){return d.afterUpdate.call(a,d,a)}).then(function(b){if(d.notify&&h.emit("DS.afterUpdate",h,b),d.cacheResponse){var c=h.inject(b,d.orig()),g=e.store[a],i=c[h.idAttribute];return g.saved[i]=f.updateTimestamp(g.saved[i]),h.resetHistoryOnInject||(g.previousAttributes[i]=f.copy(c,null,null,null,h.relationFields)),c}return h.createInstance(b,d.orig())}).then(function(a){return f.respond(a,{adapter:i},d)})["catch"](e.errorFn("update",a,b,c,d))}},function(a,b){a.exports=function(a,b,c,d){var e=this,f=e.utils,g=e.errors,h=e.definitions[a],i=void 0;return new f.Promise(function(e,i){h?(d=f._(h,d),f.applyScope(h,c,d),e(b)):i(new g.NER(a))}).then(function(a){return d.beforeValidate.call(a,d,a)}).then(function(a){return d.validate.call(a,d,a)}).then(function(a){return d.afterValidate.call(a,d,a)}).then(function(a){return d.beforeUpdate.call(a,d,a)}).then(function(a){return d.notify&&h.emit("DS.beforeUpdate",h,a),i=h.getAdapterName(d),e.adapters[i].updateAll(h,f.omit(a,d.omit),c,d)}).then(function(a){return d.afterUpdate.call(a,d,a)}).then(function(c){d.notify&&h.emit("DS.afterUpdate",h,b);var g=d.orig();if(d.cacheResponse){var i=function(){var b=h.inject(c,g),d=e.store[a];return f.forEach(b,function(a){var b=a[h.idAttribute];d.saved[b]=f.updateTimestamp(d.saved[b]),h.resetHistoryOnInject||(d.previousAttributes[b]=f.copy(a,null,null,null,h.relationFields))}),{v:b}}();if("object"==typeof i)return i.v}else{var j=function(){var a=[];return f.forEach(c,function(b){a.push(h.createInstance(b,g))}),{v:a}}();if("object"==typeof j)return j.v}}).then(function(a){return f.respond(a,{adapter:i},d)})["catch"](e.errorFn("updateAll",a,b,c,d))}}])});
//# sourceMappingURL=js-data.min.map
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSData=t():e.JSData=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){var n=r(1),i=r(2),o=r(3);e.exports={DS:n.default,DSUtils:i.default,DSErrors:o.default,createStore:function(e){return new n.default(e)},version:{full:"<%= pkg.version %>",major:parseInt("<%= major %>",10),minor:parseInt("<%= minor %>",10),patch:parseInt("<%= patch %>",10),alpha:"<%= alpha %>",beta:"<%= beta %>"}}},function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r){r(null,t)}function o(e,t){return t}function a(e,t,r,n){var i=!0;e:for(;i;){var o=e,a=t,u=r,s=n;c=l=d=void 0,i=!1;var c=o[a],l=f.default.get(u,c[0]),d=f.default.get(s,c[0]);if(f.default._s(l)&&(l=f.default.upperCase(l)),f.default._s(d)&&(d=f.default.upperCase(d)),"DESC"===c[1]){if(l>d)return-1;if(d>l)return 1;if(a<o.length-1){e=o,t=a+1,r=u,n=s,i=!0;continue e}return 0}if(d>l)return-1;if(l>d)return 1;if(!(a<o.length-1))return 0;e=o,t=a+1,r=u,n=s,i=!0}}function u(e,t){f.default.forOwn(t,function(t,r){e[r]=t,e[r].before=function(t){var n=e[r];e[r]=function(){for(var e=arguments.length,r=Array(e),i=0;e>i;i++)r[i]=arguments[i];return n.apply(this,t.apply(this,r)||r)}}})}var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r(2),c=r(3),l=r(30),d=r(36),p=function(){function e(){n(this,e)}return s(e,[{key:"errorFn",value:function(e,t){if(this.error&&"function"==typeof this.error){try{throw"string"==typeof e?new Error(e):e}catch(t){e=t}this.error(this.name||null,e||null,t||null)}}}]),e}(),h=p.prototype;h.actions={},h.afterCreate=i,h.afterCreateCollection=o,h.afterCreateInstance=o,h.afterDestroy=i,h.afterEject=o,h.afterFind=i,h.afterFindAll=i,h.afterInject=o,h.afterLoadRelations=i,h.afterReap=o,h.afterUpdate=i,h.afterValidate=i,h.allowSimpleWhere=!0,h.basePath="",h.beforeCreate=i,h.beforeCreateCollection=o,h.beforeCreateInstance=o,h.beforeDestroy=i,h.beforeEject=o,h.beforeInject=o,h.beforeReap=o,h.beforeUpdate=i,h.beforeValidate=i,h.bypassCache=!1,h.cacheResponse=!!f.default.w,h.clearEmptyQueries=!0,h.computed={},h.defaultAdapter="http",h.debug=!1,h.defaultValues={},h.eagerEject=!1,h.eagerInject=!1,h.endpoint="",h.error=console?function(e,t,r){return console["function"==typeof console.error?"error":"log"](e,t,r)}:!1,h.errorHandler=function(){return f.default.Promise.reject(arguments[0])},h.fallbackAdapters=["http"],h.findStrictCache=!1,h.idAttribute="id",h.ignoredChanges=[/\$/],h.instanceEvents=!!f.default.w,h.keepChangeHistory=!1,h.linkRelations=!!f.default.w,h.log=console?function(e,t,r,n,i){return console["function"==typeof console.info?"info":"log"](e,t,r,n,i)}:!1,h.logFn=function(e,t,r,n){var i=this;i.debug&&i.log&&"function"==typeof i.log&&i.log(i.name||null,e||null,t||null,r||null,n||null)},h.maxAge=!1,h.methods={},h.notify=!!f.default.w,h.omit=[],h.onConflict="merge",h.reapAction=f.default.w?"inject":"none",h.reapInterval=f.default.w?3e4:!1,h.relationsEnumerable=!1,h.resetHistoryOnInject=!0,h.returnMeta=!1,h.scopes={},h.strategy="single",h.upsert=!!f.default.w,h.useClass=!0,h.useFilter=!1,h.validate=i,h.watchChanges=!!f.default.w,h.defaultFilter=function(e,t,r,n){var i=e,o=null,u={skip:"",offset:"",where:"",limit:"",orderBy:"",sort:""};r=r||{},n=n||{},o=f.default._o(r.where)?r.where:{},n.allowSimpleWhere&&f.default.forOwn(r,function(e,t){t in u||t in o||(o[t]={"==":e})}),f.default.isEmpty(o)&&(o=null),o&&(i=f.default.filter(i,function(e){var t=!0,r=!0;return f.default.forOwn(o,function(n,i){f.default._o(n)||(n={"==":n}),f.default.forOwn(n,function(n,o){var a=void 0,u="|"===o[0],s=f.default.get(e,i);o=u?o.substr(1):o,"=="===o?a=s==n:"==="===o?a=s===n:"!="===o?a=s!=n:"!=="===o?a=s!==n:">"===o?a=s>n:">="===o?a=s>=n:"<"===o?a=n>s:"<="===o?a=n>=s:"isectEmpty"===o?a=!f.default.intersection(s||[],n||[]).length:"isectNotEmpty"===o?a=f.default.intersection(s||[],n||[]).length:"in"===o?a=f.default._s(n)?-1!==n.indexOf(s):f.default.contains(n,s):"notIn"===o?a=f.default._s(n)?-1===n.indexOf(s):!f.default.contains(n,s):"contains"===o?a=f.default._s(s)?-1!==s.indexOf(n):f.default.contains(s,n):"notContains"===o&&(a=f.default._s(s)?-1===s.indexOf(n):!f.default.contains(s,n)),void 0!==a&&(r=t?a:u?r||a:r&&a),t=!1})}),r}));var s=null;f.default._s(r.orderBy)?s=[[r.orderBy,"ASC"]]:f.default._a(r.orderBy)&&(s=r.orderBy),!s&&f.default._s(r.sort)?s=[[r.sort,"ASC"]]:!s&&f.default._a(r.sort)&&(s=r.sort),s&&!function(){var e=0;f.default.forEach(s,function(e,r){if(f.default._s(e))s[r]=[e,"ASC"];else if(!f.default._a(e))throw new c.default.IA('DS.filter("'+t+'"[, params][, options]): '+f.default.toJson(e)+": Must be a string or an array!",{params:{"orderBy[i]":{actual:typeof e,expected:"string|array"}}})}),i=f.default.sort(i,function(t,r){return a(s,e,t,r)})}();var l=f.default._n(r.limit)?r.limit:null,d=null;return f.default._n(r.skip)?d=r.skip:f.default._n(r.offset)&&(d=r.offset),l&&d?i=f.default.slice(i,d,Math.min(i.length,d+l)):f.default._n(l)?i=f.default.slice(i,0,Math.min(i.length,l)):f.default._n(d)&&(i=d<i.length?f.default.slice(i,d):[]),i===e?i.slice():i};var v=function(){function e(t){n(this,e);var r=this;t=t||{},r.store={},r.definitions={},r.adapters={},r.defaults=new p,r.observe=f.default.observe,f.default.forOwn(t,function(e,t){"omit"===t?r.defaults.omit=e.concat(p.prototype.omit):r.defaults[t]=e});var i=f.default.Promise;i&&!i.prototype.spread&&(i.prototype.spread=function(e){return this.then(function(t){return e.apply(this,t)})}),f.default.Events(r)}return s(e,[{key:"getAdapterName",value:function(e){var t=!1;if(e=e||{},f.default._s(e)&&(t=!0,e={adapter:e}),this.adapters[e.adapter])return e.adapter;if(t)throw new Error(e.adapter+" is not a registered adapter!");return e.defaultAdapter}},{key:"getAdapter",value:function(e){return e=e||{},this.adapters[this.getAdapterName(e)]}},{key:"registerAdapter",value:function(e,t,r){var n=this;r=r||{},f.default.isFunction(t)?n.adapters[e]=new t(r):n.adapters[e]=t,r.default&&(n.defaults.defaultAdapter=e)}},{key:"is",value:function(e,t){var r=this.definitions[e];if(!r)throw new c.default.NER(e);return t instanceof r[r.class]}},{key:"clear",value:function(){var e=this,t={};return f.default.forOwn(this.definitions,function(r){var n=r.name;t[n]=r.ejectAll(),e.store[n].completedQueries={},e.store[n].queryData={}}),t}},{key:"errorFn",value:function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t[t.length-1],i=this.defaults.errorHandler,o=n?n.errorHandler:i;return o=o||i,function(e){return o.apply(void 0,[e].concat(t))}}}]),e}(),m=v.prototype;m.getAdapterName.shorthand=!1,m.getAdapter.shorthand=!1,m.registerAdapter.shorthand=!1,m.errors=c.default,m.utils=f.default,u(m,l.default),u(m,d.default),t.default=v},function(e,t,r){function n(e){return"[object Array]"===L.call(e)||!1}function i(e){return"[object RegExp]"===L.call(e)||!1}function o(e){return"string"==typeof e||e&&"object"==typeof e&&"[object String]"===L.call(e)||!1}function a(e){return"[object Object]"===L.call(e)||!1}function u(e){return e&&"object"==typeof e&&"[object Date]"===L.call(e)||!1}function s(e){var t=typeof e;return"number"===t||e&&"object"===t&&"[object Number]"===L.call(e)||!1}function f(e){return"function"==typeof e||e&&"[object Function]"===L.call(e)||!1}function c(e){return o(e)||s(e)}function l(e){return new E.default.IA('"'+e+'" must be a string or a number!')}function d(e){return new E.default.IA('"'+e+'" must be an object!')}function p(e){return new E.default.IA('"'+e+'" must be an array!')}function h(e){if(null==e)return!0;if("string"==typeof e||$(e))return!e.length;if("object"==typeof e){var t=!0;return D(e,function(){return t=!1,!1}),t}return!0}function v(e,t){if(!e||!t)return[];for(var r=[],n=void 0,i=0,o=e.length;o>i;i++)n=e[i],S(r,n)||S(t,n)&&r.push(n);return r}function m(e,t,r){var n=[];return C(e,function(e,r,i){t(e,r,i)&&n.push(e)},r),n}function g(e){var t={};e=e||this,Object.defineProperties(e,{on:{value:function(e,r,n){t[e]=t[e]||[],t[e].push({f:r,c:n})}},off:{value:function(e,r){var n=t[e];if(n)if(r){for(var i=0;i<n.length;i++)if(n[i].f===r){n.splice(i,1);break}}else n.splice(0,n.length);else t={}}},emit:{value:function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];var i=t[r.shift()]||[];if(i)for(var o=0;o<i.length;o++)i[o].f.apply(i[o].c,r)}}})}function y(e,t,r,n,o){if(t){if(e===t)throw new Error("Cannot copy! Source and destination are identical.");if(r=r||[],n=n||[],a(e)){var s=r.indexOf(e);if(-1!==s)return n[s];r.push(e),n.push(t)}var f=void 0;if($(e)){var c=void 0;for(t.length=0,c=0;c<e.length;c++)f=y(e[c],null,r,n,o),a(e[c])&&(r.push(e[c]),n.push(f)),t.push(f)}else{$(t)?t.length=0:C(t,function(e,r){delete t[r]});for(var l in e)if(e.hasOwnProperty(l)){if(z(l,o))continue;f=y(e[l],null,r,n,o),a(e[l])&&(r.push(e[l]),n.push(f)),t[l]=f}}}else t=e,e&&($(e)?t=y(e,[],r,n,o):u(e)?t=new Date(e.getTime()):i(e)?(t=new RegExp(e.source,e.toString().match(/[^\/]*$/)[0]),t.lastIndex=e.lastIndex):a(e)&&(t=y(e,Object.create(Object.getPrototypeOf(e)),r,n,o)));return t}function b(e,t){var r=!0;e:for(;r;){var n=e,o=t;if(l=d=a=s=c=void 0,r=!1,n===o)return!0;if(null===n||null===o)return!1;if(n!==n&&o!==o)return!0;var a,s,c,l=typeof n,d=typeof o;if(l==d&&"object"==l){if(!$(n)){if(u(n)){if(!u(o))return!1;e=n.getTime(),t=o.getTime(),r=!0;continue e}if(i(n)&&i(o))return n.toString()==o.toString();if($(o))return!1;c={};for(s in n)if("$"!==s.charAt(0)&&!f(n[s])){if(!b(n[s],o[s]))return!1;c[s]=!0}for(s in o)if(!c.hasOwnProperty(s)&&"$"!==s.charAt(0)&&void 0!==o[s]&&!f(o[s]))return!1;return!0}if(!$(o))return!1;if((a=n.length)===o.length){for(s=0;a>s;s++)if(!b(n[s],o[s]))return!1;return!0}}return!1}}function _(e,t){return o(t)||s(t)?t:t&&e?t[e.idAttribute]||t:t}function w(e,t){return e&&(o(t)||s(t))?e.index[t]||t:t}function A(e){return null!=e&&""!==e}function x(e,t){return t=t||"",m(e,A).join(t)}function j(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=x(t,"/");return n.replace(/([^:\/]|^)\/{2,}/g,"$1/")}var E=r(3),O=r(4),C=r(5),F=r(6),D=r(7),S=r(10),k=r(12),R=r(14),I=r(21),P=r(22),N=r(23),T=r(24),H=r(19),Q=r(25),M=r(27),U=r(29),K=void 0,V=void 0,q=void 0,B=Object.prototype,L=B.toString;try{V=Promise}catch(e){console.error("js-data requires a global Promise constructor!")}try{q=window.File}catch(e){q=function(){}}var $=Array.isArray||n;try{K=window,K={}}catch(e){K=null}var J=["beforeValidate","validate","afterValidate","beforeCreate","afterCreate","beforeUpdate","afterUpdate","beforeDestroy","afterDestroy"],z=U.isBlacklisted;t.default={Promise:V,_:function(e,t){var r=this;if(e=e||{},t=t||{},t&&t.constructor===e.constructor)return t;if(!a(t))throw new E.default.IA('"options" must be an object!');C(J,function(e){"function"==typeof t[e]&&-1===t[e].toString().indexOf("for (var _len = arg")&&(t[e]=r.promisify(t[e]))});var n=function(e){var t=this;D(e,function(e,r){t[r]=e})};return n.prototype=e,n.prototype.orig=function(){var e={};return D(this,function(t,r){e[r]=t}),e},new n(t)},_n:s,_s:o,_sn:c,_snErr:l,_o:a,_oErr:d,_a:$,_aErr:p,applyScope:function(e,t,r){var n=r.scope,i=y(t);n?o(n)&&(n=[n]):n=[],n.unshift("defaultScope"),C(n,function(n){var i=r.scopes[n];"function"==typeof i?k(t,i(e)):i&&k(t,i)}),k(t,i)},compute:function(e,t){var r=this,n=[];a(e)||(C(e.deps,function(e){n.push(Q(r,e))}),M(r,t,e[e.length-1].apply(r,n)))},contains:S,copy:y,deepMixIn:k,diffObjectFromOldObject:U.diffObjectFromOldObject,BinaryHeap:O,equals:b,Events:g,filter:m,fillIn:function(e,t){return D(t,function(t,r){r in e||(e[r]=t)}),e},forEach:C,forOwn:D,fromJson:function(e){return o(e)?JSON.parse(e):e},get:Q,intersection:v,isArray:$,isBlacklisted:z,isEmpty:h,isFunction:f,isObject:a,isNumber:s,isString:o,keys:N,makePath:j,observe:U,omit:function(e,t){var r=[];return D(e,function(e,n){z(n,t)&&r.push(n)}),C(r,function(t){delete e[t]}),e},pascalCase:R,pick:P,promisify:function(e,t){var r=this;if(e){if("function"!=typeof e)throw new Error("Can only promisify functions!");return function(){for(var n=arguments.length,i=Array(n),o=0;n>o;o++)i[o]=arguments[o];return new r.Promise(function(r,n){i.push(function(e,t){e?n(e):r(t)});try{var o=e.apply(t||this,i);o&&o.then&&o.then(r,n)}catch(e){n(e)}})}}},remove:I,set:M,slice:F,sort:T,toJson:JSON.stringify,updateTimestamp:function(e){var t="function"==typeof Date.now?Date.now():(new Date).getTime();return e&&e>=t?e+1:t},upperCase:H,removeCircular:function(e){return function e(t,r){var n=void 0,i=void 0;if(!("object"!=typeof t||null===t||t instanceof Boolean||t instanceof Date||t instanceof Number||t instanceof RegExp||t instanceof String||t instanceof q)){for(var o=r.cur,a=r.ctx;a;){if(a.cur===o)return void 0;a=a.ctx}if($(t))for(i=[],n=0;n<t.length;n+=1)i[n]=e(t[n],{ctx:r,cur:t[n]});else i={},D(t,function(n,o){i[o]=e(t[o],{ctx:r,cur:t[o]})});return i}return t}(e,{ctx:null,cur:e})},resolveItem:w,resolveId:_,respond:function(e,t,r){return"array"===r.returnMeta?[e,t]:"object"===r.returnMeta?{response:e,meta:t}:e},w:K,applyRelationGettersToTarget:function(e,t,r){this.forEach(t.relationList,function(n){var i=n.relation,o=n.localField,a=n.localKey,u=n.foreignKey,s=n.localKeys,f=n.foreignKeys,c="boolean"==typeof n.enumerable?n.enumerable:!!t.relationsEnumerable;if("boolean"==typeof n.link?n.link:!!t.linkRelations){delete r[o];var l={enumerable:c};"belongsTo"===n.type?(l.get=function(){var e=Q(this,a),r=!(!e&&0!==e);return r?t.getResource(i).get(e):void 0},l.set=function(e){return e&&M(this,a,Q(e,t.getResource(i).idAttribute)),Q(this,o)}):"hasMany"===n.type?(l.get=function(){var r={};if(u)return r[u]=this[t.idAttribute],t.getResource(i).defaultFilter.call(e,e.store[i].collection,i,r,{allowSimpleWhere:!0});if(s){var n=Q(this,s)||[];return t.getResource(i).getAll($(n)?n:N(n))}return f?(M(r,"where."+f+".contains",this[t.idAttribute]),t.getResource(i).defaultFilter.call(e,e.store[i].collection,i,r)):void 0},l.set=function(e){var r=this;return e&&e.length&&!function(){var n=Q(r,t.idAttribute);u?C(e,function(e){M(e,u,n)}):s?!function(){var n=[];C(e,function(e){n.push(Q(e,t.getResource(i).idAttribute))}),M(r,s,n)}():f&&C(e,function(e){var t=Q(e,f);t?S(t,n)||t.push(n):M(e,f,[n])})}(),Q(this,o)}):"hasOne"===n.type&&(a?(l.get=function(){var e=Q(this,a),r=!(!e&&0!==e);return r?t.getResource(i).get(e):void 0},l.set=function(e){return e&&M(this,a,Q(e,t.getResource(i).idAttribute)),Q(this,o)}):(l.get=function(){var r={};r[u]=this[t.idAttribute];var n=r[u]?t.getResource(i).defaultFilter.call(e,e.store[i].collection,i,r,{allowSimpleWhere:!0}):[];return n.length?n[0]:void 0},l.set=function(e){return e&&M(e,u,Q(this,t.idAttribute)),Q(this,o)})),n.get&&!function(){var e=l.get;l.get=function(){var r=this;return n.get(t,n,this,function(){for(var t=arguments.length,n=Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(r,n)})}}(),Object.defineProperty(r,o,l)}})}}},function(e,t){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;u=f=s=void 0,n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;return void 0===s?void 0:s.call(a)}var f=Object.getPrototypeOf(i);if(null===f)return void 0;e=f,t=o,r=a,n=!0}},o=function(e){function t(e){r(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.message=e}return n(t,e),t}(Error),a=function(e){function t(e){r(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.message=e}return n(t,e),t}(Error),u=function(e){function t(e){r(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.type=this.constructor.name,this.message=e+" is not a registered resource!"}return n(t,e),t}(Error);t.default={IllegalArgumentError:o,IA:o,RuntimeError:a,R:a,NonexistentResourceError:u,NER:u}},function(e,t,r){!function(t,r){e.exports=r()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){function n(e,t,r){for(var n=e[r],i=t(n);r>0;){var o=Math.floor((r+1)/2)-1,a=e[o];if(i>=t(a))break;e[o]=n,e[r]=a,r=o}}function i(e,t){if(e||(e=function(e){return e}),t||(t=function(e,t){return e===t}),"function"!=typeof e)throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');if("function"!=typeof t)throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');this.weightFunc=e,this.compareFunc=t,this.heap=[]}var o=function(e,t,r){for(var n=e.length,i=e[r],o=t(i);;){var a=2*(r+1),u=a-1,s=null;if(n>u){var f=e[u],c=t(f);o>c&&(s=u)}if(n>a){var l=e[a],d=t(l);d<(null===s?o:t(e[u]))&&(s=a)}if(null===s)break;e[r]=e[s],e[s]=i,r=s}},a=i.prototype;a.push=function(e){this.heap.push(e),n(this.heap,this.weightFunc,this.heap.length-1)},a.peek=function(){return this.heap[0]},a.pop=function(){var e=this.heap[0],t=this.heap.pop();return this.heap.length>0&&(this.heap[0]=t,o(this.heap,this.weightFunc,0)),e},a.remove=function(e){for(var t=this.heap.length,r=0;t>r;r++)if(this.compareFunc(this.heap[r],e)){var i=this.heap[r],a=this.heap.pop();return r!==t-1&&(this.heap[r]=a,n(this.heap,this.weightFunc,r),o(this.heap,this.weightFunc,r)),i}return null},a.removeAll=function(){this.heap=[]},a.size=function(){return this.heap.length},e.exports=i}])})},function(e,t){function r(e,t,r){if(null!=e)for(var n=-1,i=e.length;++n<i&&t.call(r,e[n],n,e)!==!1;);}e.exports=r},function(e,t){function r(e,t,r){var n=e.length;t=null==t?0:0>t?Math.max(n+t,0):Math.min(t,n),r=null==r?n:0>r?Math.max(n+r,0):Math.min(r,n);for(var i=[];r>t;)i.push(e[t++]);return i}e.exports=r},function(e,t,r){function n(e,t,r){o(e,function(n,o){return i(e,o)?t.call(r,e[o],o,e):void 0})}var i=r(8),o=r(9);e.exports=n},function(e,t){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=r},function(e,t,r){function n(){u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=!0;for(var e in{toString:null})a=!1}function i(e,t,r){var i,f=0;null==a&&n();for(i in e)if(o(t,e,i,r)===!1)break;if(a)for(var c=e.constructor,l=!!c&&e===c.prototype;(i=u[f++])&&("constructor"===i&&(l||!s(e,i))||e[i]===Object.prototype[i]||o(t,e,i,r)!==!1););}function o(e,t,r,n){return e.call(n,t[r],r,t)}var a,u,s=r(8);e.exports=i},function(e,t,r){function n(e,t){return-1!==i(e,t)}var i=r(11);e.exports=n},function(e,t){function r(e,t,r){if(r=r||0,null==e)return-1;for(var n=e.length,i=0>r?n+r:r;n>i;){if(e[i]===t)return i;i++}return-1}e.exports=r},function(e,t,r){function n(e,t){for(var r,n=0,a=arguments.length;++n<a;)r=arguments[n],r&&o(r,i,e);return e}function i(e,t){var r=this[t];a(e)&&a(r)?n(r,e):this[t]=e}var o=r(7),a=r(13);e.exports=n},function(e,t){function r(e){return!!e&&"object"==typeof e&&e.constructor===Object}e.exports=r},function(e,t,r){function n(e){return e=i(e),o(e).replace(/^[a-z]/,a)}var i=r(15),o=r(16),a=r(19);e.exports=n},function(e,t){function r(e){return null==e?"":e.toString()}e.exports=r},function(e,t,r){function n(e){return e=i(e),e=o(e),e=a(e).replace(/[\-_]/g," ").replace(/\s[a-z]/g,u).replace(/\s+/g,"").replace(/^[A-Z]/g,s)}var i=r(15),o=r(17),a=r(18),u=r(19),s=r(20);e.exports=n},function(e,t,r){function n(e){return e=i(e),e.search(/[\xC0-\xFF]/g)>-1&&(e=e.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),e}var i=r(15);e.exports=n},function(e,t,r){function n(e){return e=i(e),e.replace(o,"")}var i=r(15),o=/[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;e.exports=n},function(e,t,r){function n(e){return e=i(e),e.toUpperCase()}var i=r(15);e.exports=n},function(e,t,r){function n(e){return e=i(e),e.toLowerCase()}var i=r(15);e.exports=n},function(e,t,r){function n(e,t){var r=i(e,t);-1!==r&&e.splice(r,1)}var i=r(11);e.exports=n},function(e,t,r){function n(e,t){for(var r,n="string"!=typeof arguments[1]?arguments[1]:i(arguments,1),o={},a=0;r=n[a++];)o[r]=e[r];return o}var i=r(6);e.exports=n},function(e,t,r){var n=r(7),i=Object.keys||function(e){var t=[];return n(e,function(e,r){t.push(r)}),t};e.exports=i},function(e,t){function r(e,t){if(null==e)return[];if(e.length<2)return e;null==t&&(t=n);var o,a,u;return o=~~(e.length/2),a=r(e.slice(0,o),t),u=r(e.slice(o,e.length),t),i(a,u,t)}function n(e,t){return t>e?-1:e>t?1:0}function i(e,t,r){for(var n=[];e.length&&t.length;)r(e[0],t[0])<=0?n.push(e.shift()):n.push(t.shift());return e.length&&n.push.apply(n,e),t.length&&n.push.apply(n,t),n}e.exports=r},function(e,t,r){function n(e,t){for(var r=t.split("."),n=r.pop();t=r.shift();)if(e=e[t],null==e)return;return e[n]}r(26);e.exports=n},function(e,t){function r(e){switch(typeof e){case"string":case"number":case"boolean":return!0}return null==e}e.exports=r},function(e,t,r){function n(e,t,r){var n=/^(.+)\.(.+)$/.exec(t);n?i(e,n[1])[n[2]]=r:e[t]=r}var i=r(28);e.exports=n},function(e,t,r){function n(e,t){return t?(i(t.split("."),function(t){e[t]||(e[t]={}),e=e[t]}),e):e}var i=r(5);e.exports=n},function(e,t){!function(e){function t(){function e(e){t=e}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var t=[],r={},n=[];return Object.observe(r,e),Array.observe(n,e),r.id=1,r.id=2,delete r.id,n.push(1,2),n.length=0,Object.deliverChangeRecords(e),5!==t.length?!1:"add"!=t[0].type||"update"!=t[1].type||"delete"!=t[2].type||"splice"!=t[3].type||"splice"!=t[4].type?!1:(Object.unobserve(r,e),Array.unobserve(n,e),!0)}function r(t){for(var r=0;y>r&&t.check_();)r++;return v&&(e.dirtyCheckCycleCount=r),r>0}function n(e){for(var t in e)return!1;return!0}function i(e){return n(e.added)&&n(e.removed)&&n(e.changed)}function o(e,t){if(!t||!t.length)return!1;for(var r,n=0;n<t.length;n++)if("[object RegExp]"===Object.prototype.toString.call(t[n])&&t[n].test(e)||t[n]===e)return r=e;return!!r}function a(e,t,r,n){var i={},a={},u={};for(var s in t){var f=e[s];o(s,n)||void 0!==f&&(r?r(f,t[s]):f===t[s])||(s in e?(r?r(f,t[s]):f===t[s])||(u[s]=f):a[s]=void 0)}for(var s in e)s in t||o(s,n)||(i[s]=e[s]);return Array.isArray(e)&&e.length!==t.length&&(u.length=e.length),{added:i,removed:a,changed:u}}function u(){if(!b.length)return!1;for(var e=0;e<b.length;e++)b[e]();return b.length=0,!0}function s(){function e(e){t&&t.state_===x&&!n&&t.check_(e)}var t,r,n=!1,i=!0;return{open:function(r){if(t)throw Error("ObservedObject in use");i||Object.deliverChangeRecords(e),t=r,i=!1},observe:function(t,n){r=t,n?Array.observe(r,e):Object.observe(r,e)},deliver:function(t){n=t,Object.deliverChangeRecords(e),n=!1},close:function(){t=void 0,Object.unobserve(r,e),w.push(this)}}}function f(e,t,r){var n=w.pop()||s();return n.open(e),n.observe(t,r),n}function c(){this.state_=A,this.callback_=void 0,this.target_=void 0,this.directObserver_=void 0,this.value_=void 0,this.id_=E++}function l(e){c._allObserversCount++,C&&O.push(e)}function d(e){c._allObserversCount--}function p(e){c.call(this),this.value_=e,this.oldObject_=void 0}function h(e,t,r){for(var n={},i={},o=0;o<t.length;o++){var a=t[o];S[a.type]?(a.name in r||(r[a.name]=a.oldValue),"update"!=a.type&&("add"!=a.type?a.name in n?(delete n[a.name],delete r[a.name]):i[a.name]=!0:a.name in i?delete i[a.name]:n[a.name]=!0)):(console.error("Unknown changeRecord type: "+a.type),console.error(a))}for(var u in n)n[u]=e[u];for(var u in i)i[u]=void 0;var s={};for(var u in r)if(!(u in n||u in i)){var f=e[u];r[u]!==f&&(s[u]=f)}return{added:n,removed:i,changed:s}}var v=e.testingExposeCycleCount,m=t(),g="__proto__"in{}?function(e){return e}:function(e){var t=e.__proto__;if(!t)return e;var r=Object.create(t);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r},y=1e3,b=[],_=m?function(){return function(e){return Promise.resolve().then(e)}}():function(){return function(e){b.push(e)}}(),w=[],A=0,x=1,j=2,E=1;c.prototype={open:function(e,t){if(this.state_!=A)throw Error("Observer has already been opened.");return l(this),this.callback_=e,this.target_=t,this.connect_(),this.state_=x,this.value_},close:function(){this.state_==x&&(d(this),this.disconnect_(),this.value_=void 0,this.callback_=void 0,this.target_=void 0,this.state_=j)},deliver:function(){this.state_==x&&r(this)},report_:function(e){try{this.callback_.apply(this.target_,e)}catch(e){c._errorThrownDuringCallback=!0,console.error("Exception caught during observer callback: "+(e.stack||e))}},discardChanges:function(){return this.check_(void 0,!0),this.value_}};var O,C=!m;c._allObserversCount=0,C&&(O=[]);var F=!1;e.Platform=e.Platform||{},e.Platform.performMicrotaskCheckpoint=function(){if(!F&&C){F=!0;var t,r,n=0;do{n++,r=O,O=[],t=!1;for(var i=0;i<r.length;i++){var o=r[i];o.state_==x&&(o.check_()&&(t=!0),O.push(o))}u()&&(t=!0)}while(y>n&&t);v&&(e.dirtyCheckCycleCount=n),F=!1}},C&&(e.Platform.clearObservers=function(){O=[]}),p.prototype=g({__proto__:c.prototype,arrayObserve:!1,connect_:function(e,t){m?this.directObserver_=f(this,this.value_,this.arrayObserve):this.oldObject_=this.copyObject(this.value_)},copyObject:function(e){var t=Array.isArray(e)?[]:{};for(var r in e)t[r]=e[r];return Array.isArray(e)&&(t.length=e.length),t},check_:function(e,t){var r,n;if(m){if(!e)return!1;n={},r=h(this.value_,e,n)}else n=this.oldObject_,r=a(this.value_,this.oldObject_);return i(r)?!1:(m||(this.oldObject_=this.copyObject(this.value_)),this.report_([r.added||{},r.removed||{},r.changed||{},function(e){return n[e]}]),!0)},disconnect_:function(){m?(this.directObserver_.close(),this.directObserver_=void 0):this.oldObject_=void 0},deliver:function(){this.state_==x&&(m?this.directObserver_.deliver(!1):r(this))},discardChanges:function(){return this.directObserver_?this.directObserver_.deliver(!0):this.oldObject_=this.copyObject(this.value_),this.value_}});var D={},S={add:!0,update:!0,delete:!0};e.Observer=c,e.isBlacklisted=o,e.Observer.runEOM_=_,e.Observer.observerSentinel_=D,e.Observer.hasObjectObserve=m,e.diffObjectFromOldObject=a,e.ObjectObserver=p}(t)},function(e,t,r){function n(e){return!(o.default.isEmpty(e.added)&&o.default.isEmpty(e.removed)&&o.default.isEmpty(e.changed))}function i(e,t,r,n){var i=this,a=i.definitions[t];if(n=n||{},r=o.default.resolveId(a,r),!a)throw new u(t);if(!o.default._sn(r))throw o.default._snErr("id");return r=r===c?void 0:r,n=o.default._(a,n),{_this:i,definition:a,_resourceName:t,_id:r,_options:n}}var o=r(2),a=r(3),u=a.default.NER,s=a.default.IA,f=a.default.R,c="DS_"+(new Date).getTime();t.default={changes:function(e,t,r){var n=i.call(this,"changes",e,t,r),a=n._this,u=n.definition,s=n._resourceName,f=n._id,c=n._options,l=u.get(f);if(l){var d=function(){var e=a.store[s].observers[f];e&&"function"==typeof e&&e.deliver();var t=c.ignoredChanges||[];o.default.forEach(u.relationFields,function(e){o.default.contains(t,e)||t.push(e)});var r=o.default.diffObjectFromOldObject(l,a.store[s].previousAttributes[f],o.default.equals,t);return o.default.forOwn(r,function(e,t){var n=[];o.default.forOwn(e,function(e,t){o.default.isFunction(e)||n.push(t)}),r[t]=o.default.pick(r[t],n)}),o.default.forEach(u.relationFields,function(e){delete r.added[e],delete r.removed[e],delete r.changed[e]}),{v:r}}();if("object"==typeof d)return d.v}},changeHistory:function(e,t){var r=i.call(this,"changeHistory",e,t||c),n=r._this,o=r.definition,a=r._resourceName,u=r._id,s=n.store[a];if(o.keepChangeHistory){if(!a)return s.changeHistory;var f=o.get(u);if(f)return s.changeHistories[u]}else o.errorFn("changeHistory is disabled for this resource!")},commit:function(e,t){var r=i.call(this,"commit",e,t),n=r._this,a=r.definition,u=r._resourceName,s=r._id,f=n.store[u],c=n.store[u].index[s];return c&&(f.previousAttributes[s]=o.default.copy(c,null,null,null,a.relationFields)),f.changeHistories[s].length&&(o.default.forEach(f.changeHistories[s],function(e){o.default.remove(f.changeHistory,e)}),f.changeHistories[s].splice(0,f.changeHistories[s].length)),c},compute:function(e,t){var r=this,n=r.definitions[e];if(t=o.default.resolveItem(r.store[e],t),!n)throw new u(e);if(!t)throw new f("Item not in the store!");if(!o.default._o(t)&&!o.default._sn(t))throw new s('"instance" must be an object, string or number!');return o.default.forOwn(n.computed,function(e,r){o.default.compute.call(t,e,r)}),t},createInstance:function(e,t,r){var n=this.definitions[e],i=void 0;if(t=t||{},!n)throw new u(e);if(t&&!o.default.isObject(t))throw new s('"attrs" must be an object!');r=o.default._(n,r),r.beforeCreateInstance(r,t);var a=n[n.class];return i=new a,n.instanceEvents&&o.default.Events(i),r.defaultValues&&o.default.deepMixIn(i,r.defaultValues),o.default.deepMixIn(i,t),n.computed&&n.compute(i),r.afterCreateInstance(r,i),i},createCollection:function(e,t,r,n){var i=this,a=i.definitions[e];if(t=t||[],r=r||{},!a)throw new u(e);if(t&&!o.default.isArray(t))throw new s('"arr" must be an array!');return n=o.default._(a,n),n.beforeCreateCollection(n,t),Object.defineProperties(t,{fetch:{value:function(t,r){var n=this;return n.params=t||n.params,a.findAll(n.params,r).then(function(t){return t===n?n:(t.unshift(n.length),t.unshift(0),n.splice.apply(n,t),t.shift(),t.shift(),t.$$injected&&(i.store[e].queryData[o.default.toJson(n.params)]=n,n.$$injected=!0),n)})}},params:{value:r,writable:!0},resourceName:{value:e}}),n.afterCreateCollection(n,t),t},defineResource:r(31),digest:function(){this.observe.Platform.performMicrotaskCheckpoint()},eject:r(32),ejectAll:r(33),filter:r(34),get:function(e,t){var r=i.call(this,"get",e,t),n=r._this,o=r._resourceName,a=r._id;return n.store[o].index[a]},getAll:function(e,t){var r=this,n=r.definitions[e],i=r.store[e],a=[];if(!n)throw new u(e);if(t&&!o.default._a(t))throw o.default._aErr("ids");if(o.default._a(t))for(var s=t.length,f=0;s>f;f++)i.index[t[f]]&&a.push(i.index[t[f]]);else a=i.collection.slice();return a},hasChanges:function(e,t){var r=i.call(this,"hasChanges",e,t),o=r.definition,a=r._id;return o.get(a)?n(o.changes(a)):!1},inject:r(35),lastModified:function(e,t){var r=i.call(this,"lastModified",e,t||c),n=r._this,o=r._resourceName,a=r._id,u=n.store[o];return a?(a in u.modified||(u.modified[a]=0),u.modified[a]):u.collectionModified},lastSaved:function(e,t){var r=i.call(this,"lastSaved",e,t||c),n=r._this,o=r._resourceName,a=r._id,u=n.store[o];return a in u.saved||(u.saved[a]=0),u.saved[a];
},previous:function(e,t){var r=i.call(this,"previous",e,t),n=r._this,a=r._resourceName,u=r._id,s=n.store[a];return s.previousAttributes[u]?o.default.copy(s.previousAttributes[u]):void 0},revert:function(e,t,r){var n=i.call(this,"revert",e,t,r),a=n._this,u=n.definition,s=n._resourceName,f=n._id,c=n._options,l=c.preserve||[];if(0===l.length)return u.inject(a.previous(s,f));var d=function(){var e=u.get(t),r=a.previous(s,f),n={};return e?(o.default.forOwn(e,function(t,i){o.default.contains(l,i)?n[i]=e[i]:n[i]=r[i]}),{v:u.inject(n)}):{v:void 0}}();return"object"==typeof d?d.v:void 0}}},function(e,t,r){var n=r(2),i=r(3),o=["compute","eject","refresh","save","update","destroy","loadRelations","changeHistory","changes","commit","hasChanges","lastModified","lastSaved","previous","revert"];e.exports=function(e){function t(t){this.defaultValues={},this.methods={},this.computed={},this.scopes={},this.actions={},n.default.deepMixIn(this,t);var i=r.defaults;e.extends&&a[e.extends]&&(i=a[e.extends]),n.default.fillIn(this.defaultValues,i.defaultValues),n.default.fillIn(this.methods,i.methods),n.default.fillIn(this.computed,i.computed),n.default.fillIn(this.scopes,i.scopes),n.default.fillIn(this.actions,i.actions),this.endpoint="endpoint"in t?t.endpoint:this.name}var r=this,a=r.definitions;if(n.default._s(e)&&(e={name:e.replace(/\s/gi,"")}),!n.default._o(e))throw n.default._oErr("definition");if(!n.default._s(e.name))throw new i.default.IA('"name" must be a string!');if(a[e.name])throw new i.default.R(e.name+" is already registered!");try{var u,s,f=function(){if(e.extends&&a[e.extends]?t.prototype=a[e.extends]:t.prototype=r.defaults,a[e.name]=new t(e),u=a[e.name],u.getResource=function(e){return r.definitions[e]},!n.default._s(u.idAttribute))throw new i.default.IA('"idAttribute" must be a string!');u.relations&&(u.relationList=[],u.relationFields=[],n.default.forOwn(u.relations,function(e,t){n.default.forOwn(e,function(r,i){n.default._a(r)||(e[i]=[r]),n.default.forEach(e[i],function(e){e.type=t,e.relation=i,e.name=u.name,u.relationList.push(e),e.localField&&u.relationFields.push(e.localField)})})}),u.relations.belongsTo&&n.default.forOwn(u.relations.belongsTo,function(e,t){n.default.forEach(e,function(e){e.parent&&(u.parent=t,u.parentKey=e.localKey,u.parentField=e.localField)})}),"function"==typeof Object.freeze&&(Object.freeze(u.relations),Object.freeze(u.relationList))),s=u.class=n.default.pascalCase(u.name);try{"function"==typeof u.useClass?(u[s]=new Function("def","return function "+s+"() { def.useClass.call(this); }")(u),u[s].prototype=function(e){function t(){}return t.prototype=e,new t}(u.useClass.prototype)):u[s]=new Function("return function "+s+"() {}")()}catch(e){u[s]=function(){}}n.default.forOwn(u.methods,function(e,t){u[s].prototype[t]=e}),u[s].prototype.set=function(e,t){var r=this;return n.default.set(this,e,t),u.compute(this),u.instanceEvents&&setTimeout(function(){r.emit("DS.change",u,r)},0),u.handleChange(this),this},u[s].prototype.get=function(e){return n.default.get(this,e)},n.default.applyRelationGettersToTarget(r,u,u[s].prototype);var f=null;u.hasOwnProperty("omit")?f=r.defaults.omit:(f=u.omit,u.omit=[]),u.omit=u.omit.concat(f||[]),n.default.forOwn(u.computed,function(e,t){if(n.default.isFunction(e)&&(u.computed[t]=[e],e=u.computed[t]),u.methods&&t in u.methods&&u.errorFn('Computed property "'+t+'" conflicts with previously defined prototype method!'),u.omit.push(t),n.default.isArray(e)){var r;if(1===e.length){var i=e[0].toString().match(/function.*?\(([\s\S]*?)\)/);r=i[1].split(","),r=n.default.filter(r,function(e){return e}),u.computed[t]=r.concat(e),e=u.computed[t],r.length&&u.errorFn("Use the computed property array syntax for compatibility with minified code!")}r=e.slice(0,e.length-1),n.default.forEach(r,function(e,t){r[t]=e.trim()}),e.deps=n.default.filter(r,function(e){return!!e})}else n.default.isObject(e)&&Object.defineProperty(u[s].prototype,t,e)}),n.default.forEach(o,function(e){u[s].prototype["DS"+n.default.pascalCase(e)]=function(){for(var t=arguments.length,n=Array(t),i=0;t>i;i++)n[i]=arguments[i];return n.unshift(this[u.idAttribute]||this),n.unshift(u.name),r[e].apply(r,n)}}),u[s].prototype.DSCreate=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return t.unshift(this),t.unshift(u.name),r.create.apply(r,t)},r.store[u.name]={collection:[],expiresHeap:new n.default.BinaryHeap(function(e){return e.expires},function(e,t){return e.item===t}),completedQueries:{},queryData:{},pendingQueries:{},index:{},modified:{},saved:{},previousAttributes:{},observers:{},changeHistories:{},changeHistory:[],collectionModified:0};var c=r.store[u.name];u.reapInterval&&setInterval(function(){return u.reap()},u.reapInterval);var l=["registerAdapter","getAdapterName","getAdapter","is","!clear"];for(var d in r)"function"==typeof r[d]&&l.push(d);n.default.forEach(l,function(e){var t=e;"!"!==t[0]&&(r[t].shorthand!==!1?(u[t]=function(){for(var e=arguments.length,n=Array(e),i=0;e>i;i++)n[i]=arguments[i];return n.unshift(u.name),r[t].apply(r,n)},u[t].before=function(e){var r=u[t];u[t]=function(){for(var t=arguments.length,n=Array(t),i=0;t>i;i++)n[i]=arguments[i];return r.apply(u,e.apply(u,n)||n)}}):u[t]=function(){for(var e=arguments.length,n=Array(e),i=0;e>i;i++)n[i]=arguments[i];return r[t].apply(r,n)})}),u.beforeValidate=n.default.promisify(u.beforeValidate),u.validate=n.default.promisify(u.validate),u.afterValidate=n.default.promisify(u.afterValidate),u.beforeCreate=n.default.promisify(u.beforeCreate),u.afterCreate=n.default.promisify(u.afterCreate),u.afterFind=n.default.promisify(u.afterFind),u.afterFindAll=n.default.promisify(u.afterFindAll),u.afterLoadRelations=n.default.promisify(u.afterLoadRelations),u.beforeUpdate=n.default.promisify(u.beforeUpdate),u.afterUpdate=n.default.promisify(u.afterUpdate),u.beforeDestroy=n.default.promisify(u.beforeDestroy),u.afterDestroy=n.default.promisify(u.afterDestroy);var p=void 0;return u.hasOwnProperty("defaultAdapter")&&(p=u.defaultAdapter),n.default.forOwn(u.actions,function(e,t){if(u[t]&&!u.actions[t])throw new Error('Cannot override existing method "'+t+'"!');e.request=e.request||function(e){return e},e.response=e.response||function(e){return e},e.responseError=e.responseError||function(e){return n.default.Promise.reject(e)},u[t]=function(r,i){n.default._o(r)&&(i=r),i=i||{};var o=u.getAdapter(e.adapter||p||"http"),a=n.default.deepMixIn({},e);if(!i.hasOwnProperty("endpoint")&&a.endpoint&&(i.endpoint=a.endpoint),"function"==typeof i.getEndpoint)a.url=i.getEndpoint(u,i);else{var s=[i.basePath||u.basePath||o.defaults.basePath,o.getEndpoint(u,n.default._sn(r)?r:null,i)];n.default._sn(r)&&s.push(r),s.push(e.pathname||t),a.url=n.default.makePath.apply(null,s)}return a.method=a.method||"GET",a.resourceName=u.name,n.default.deepMixIn(a,i),new n.default.Promise(function(e){return e(a)}).then(i.request||e.request).then(function(e){return o.HTTP(e)}).then(function(e){return e&&e.config&&(e.config.resourceName=u.name),e}).then(i.response||e.response,i.responseError||e.responseError)}}),n.default.Events(u),u.handleChange=function(e){c.collectionModified=n.default.updateTimestamp(c.collectionModified),u.notify&&setTimeout(function(){u.emit("DS.change",u,e)},0)},{v:u}}();if("object"==typeof f)return f.v}catch(t){throw r.defaults.errorFn(t),delete a[e.name],delete r.store[e.name],t}}},function(e,t){e.exports=function(e,t,r){var n=this,i=n.utils,o=n.definitions[e],a=n.store[e],u=void 0,s=!1;if(t=i.resolveId(o,t),!o)throw new n.errors.NER(e);if(!i._sn(t))throw i._snErr("id");r=i._(o,r);for(var f=0;f<a.collection.length;f++)if(a.collection[f][o.idAttribute]==t){u=a.collection[f],a.expiresHeap.remove(u),s=!0;break}if(s){var c=function(){o.beforeEject(r,u),r.notify&&o.emit("DS.beforeEject",o,u);var e=[];return i.forOwn(a.queryData,function(t,n){t.$$injected&&i.remove(t,u),!t.length&&r.clearEmptyQueries&&e.push(n)}),i.forEach(a.changeHistories[t],function(e){i.remove(a.changeHistory,e)}),i.forEach(e,function(e){delete a.completedQueries[e],delete a.queryData[e]}),a.observers[t]&&"function"==typeof a.observers[t].close&&a.observers[t].close(),delete a.observers[t],delete a.index[t],delete a.previousAttributes[t],delete a.completedQueries[t],delete a.pendingQueries[t],delete a.changeHistories[t],delete a.modified[t],delete a.saved[t],o.instanceEvents&&u.off&&u.off(),a.collection.splice(f,1),o.handleChange(u),o.afterEject(r,u),r.notify&&o.emit("DS.afterEject",o,u),{v:u}}();if("object"==typeof c)return c.v}}},function(e,t){e.exports=function(e,t,r){var n=this,i=n.utils,o=n.definitions[e];if(t=t||{},!o)throw new n.errors.NER(e);if(!i._o(t))throw i._oErr("params");r=i._(o,r),i.applyScope(o,t,r);var a=n.store[e],u=i.toJson(t),s=o.filter(t);return i.isEmpty(t)?a.completedQueries={}:delete a.completedQueries[u],i.forEach(s,function(e){e&&e[o.idAttribute]&&o.eject(e[o.idAttribute],r)}),o.handleChange(s),s}},function(e,t){e.exports=function(e,t,r){var n=this,i=n.utils,o=n.definitions[e];if(!o)throw new n.errors.NER(e);if(t&&!i._o(t))throw i._oErr("params");return t=t||{},r=i._(o,r),i.applyScope(o,t,r),o.defaultFilter.call(n,n.store[e].collection,e,t,r)}},function(e,t,r){function n(e,t){var r=this,n=e.name;return function(i,a,u,s,f){var c=this,l=void 0,d=s&&s(e.idAttribute)?s(e.idAttribute):c[e.idAttribute];if(o.default.forEach(e.relationFields,function(e){delete i[e],delete a[e],delete u[e]}),(!o.default.isEmpty(i)||!o.default.isEmpty(a)||!o.default.isEmpty(u)||f)&&(l=r.get(n,d),t.modified[d]=o.default.updateTimestamp(t.modified[d]),l&&e.instanceEvents&&setTimeout(function(){l.emit("DS.change",e,l)},0),e.handleChange(l),e.keepChangeHistory)){var p={resourceName:n,target:l,added:i,removed:a,changed:u,timestamp:t.modified[d]};t.changeHistories[d].push(p),t.changeHistory.push(p)}e.computed&&(l=l||r.get(n,d),o.default.forOwn(e.computed,function(e,t){if(!o.default._o(e)){var r=!1;o.default.forEach(e.deps,function(e){(e in i||e in a||e in u||!(t in l))&&(r=!0)}),r=r||!e.deps.length,r&&o.default.compute.call(l,e,t)}})),e.idAttribute in u&&e.errorFn('Doh! You just changed the primary key of an object! Your data for the "'+n+'" resource is now in an undefined (probably broken) state.')}}function i(e,t,r,u){var s=this,f=void 0;if(o.default._a(r)){f=[];for(var c=0;c<r.length;c++)f.push(i.call(s,e,t,r[c],u))}else{var l=e.computed,d=e.idAttribute;if(l&&l[d]&&!function(){var e=[];o.default.forEach(l[d].deps,function(t){e.push(r[t])}),r[d]=l[d][l[d].length-1].apply(r,e)}(),!(d in r)){var p=new a.default.R(e.name+'.inject: "attrs" must contain the property specified by "idAttribute"!');throw u.errorFn(p),p}try{!function(){o.default.forEach(e.relationList,function(t){var n=t.relation,i=s.definitions[n],f=r[t.localField];if("function"==typeof t.inject)t.inject(e,t,r);else if(f&&t.inject!==!1){if(!i)throw new a.default.R(e.name+" relation is defined but the resource is not!");if(o.default._a(f))!function(){var a=[];o.default.forEach(f,function(f){if(f!==s.store[n].index[f[i.idAttribute]])try{var c=i.inject(f,u.orig());t.foreignKey&&o.default.set(c,t.foreignKey,r[e.idAttribute]),a.push(c)}catch(e){u.errorFn(e,"Failed to inject "+t.type+' relation: "'+n+'"!')}})}();else if(f!==s.store[n].index[f[i.idAttribute]])try{var c=i.inject(r[t.localField],u.orig());t.foreignKey&&o.default.set(c,t.foreignKey,r[e.idAttribute])}catch(e){u.errorFn(e,"Failed to inject "+t.type+' relation: "'+n+'"!')}}});var i=r[d],c=e.get(i),l=c?t.modified[i]:0;if(c)"merge"===u.onConflict?o.default.deepMixIn(c,r):"replace"===u.onConflict&&(o.default.forOwn(c,function(t,n){n!==e.idAttribute&&(r.hasOwnProperty(n)||delete c[n])}),o.default.forOwn(r,function(t,r){r!==e.idAttribute&&(c[r]=t)})),e.resetHistoryOnInject&&s.commit(e.name,i),t.observers[i]&&"function"==typeof t.observers[i]&&t.observers[i].deliver();else{c=r instanceof e[e.class]?r:new e[e.class],e.instanceEvents&&"function"!=typeof c.emit&&o.default.Events(c),o.default.forEach(e.relationList,function(t){("boolean"==typeof t.link?t.link:!!e.linkRelations)&&delete r[t.localField]}),o.default.deepMixIn(c,r),t.collection.push(c),t.changeHistories[i]=[];var p=n.call(s,e,t);e.watchChanges&&(t.observers[i]=new s.observe.ObjectObserver(c),t.observers[i].open(p,c)),t.index[i]=c,p.call(c,{},{},{},null,!0),t.previousAttributes[i]=o.default.copy(c,null,null,null,e.relationFields)}t.modified[i]=l&&t.modified[i]===l?o.default.updateTimestamp(t.modified[i]):t.modified[i],t.expiresHeap.remove(c);var h=(new Date).getTime();t.expiresHeap.push({item:c,timestamp:h,expires:e.maxAge?h+e.maxAge:Number.MAX_VALUE}),f=c}()}catch(e){u.errorFn(e,r)}}return f}var o=r(2),a=r(3);e.exports=function(e,t,r){var n=this,u=n.definitions[e],s=n.store[e],f=void 0;if(!u)throw new a.default.NER(e);if(!o.default._o(t)&&!o.default._a(t))throw new a.default.IA(e+'.inject: "attrs" must be an object or an array!');return r=o.default._(u,r),r.beforeInject(r,t),r.notify&&u.emit("DS.beforeInject",u,t),f=i.call(n,u,s,t,r),u.handleChange(f),r.afterInject(r,f),r.notify&&u.emit("DS.afterInject",u,f),f}},function(e,t,r){t.default={create:r(37),destroy:r(38),destroyAll:r(39),find:r(40),findAll:r(41),loadRelations:r(42),reap:r(43),refresh:function(e,t,r){var n=this,i=n.utils;return new i.Promise(function(o,a){var u=n.definitions[e];t=i.resolveId(n.definitions[e],t),u?i._sn(t)?(r=i._(u,r),r.bypassCache=!0,o(n.get(e,t))):a(i._snErr("id")):a(new n.errors.NER(e))}).then(function(i){return i?n.find(e,t,r):i}).catch(n.errorFn("refresh",e,t,r))},refreshAll:function(e,t,r){var n=this,i=n.utils,o=n.definitions[e];return t=t||{},new i.Promise(function(a,u){o?i._o(t)?(r=i._(o,r),r.bypassCache=!0,a(n.filter(e,t,r))):u(i._oErr("params")):u(new n.errors.NER(e))}).then(function(a){return r.bypassCache=!0,n.findAll(e,t,r).then(function(e){return i.forEach(a,function(t){-1===e.indexOf(t)&&o.eject(t)}),e})}).catch(n.errorFn("refreshAll",e,t,r))},save:r(44),update:r(45),updateAll:r(46)}},function(e,t){e.exports=function(e,t,r){var n=this,i=n.utils,o=n.definitions[e],a=void 0;r=r||{},t=t||{};var u=void 0;if(o)if(i._o(t)){if(r=i._(o,r),r.upsert&&i._sn(t[o.idAttribute]))return n.update(e,t[o.idAttribute],t,r)}else u=i._oErr("attrs");else u=new n.errors.NER(e);return new i.Promise(function(e,r){u?r(u):e(t)}).then(function(e){return r.beforeValidate.call(e,r,e)}).then(function(e){return r.validate.call(e,r,e)}).then(function(e){return r.afterValidate.call(e,r,e)}).then(function(e){return r.beforeCreate.call(e,r,e)}).then(function(e){return r.notify&&o.emit("DS.beforeCreate",o,e),a=n.getAdapterName(r),n.adapters[a].create(o,i.omit(e,r.omit),r)}).then(function(e){return r.afterCreate.call(e,r,e)}).then(function(t){if(r.notify&&o.emit("DS.afterCreate",o,t),r.cacheResponse){var a=n.inject(o.name,t,r.orig()),u=a[o.idAttribute],s=n.store[e];return s.completedQueries[u]=(new Date).getTime(),s.saved[u]=i.updateTimestamp(s.saved[u]),a}return n.createInstance(e,t,r)}).then(function(e){return i.respond(e,{adapter:a},r)}).catch(n.errorFn("create",e,t,r))}},function(e,t){e.exports=function(e,t,r){var n=this,i=n.utils,o=n.definitions[e],a=void 0,u=void 0;return new i.Promise(function(u,s){t=i.resolveId(o,t),o?i._sn(t)?(a=o.get(t)||{id:t},r=i._(o,r),u(a)):s(i._snErr("id")):s(new n.errors.NER(e))}).then(function(e){return r.beforeDestroy.call(e,r,e)}).then(function(e){return r.notify&&o.emit("DS.beforeDestroy",o,e),r.eagerEject&&o.eject(t),u=o.getAdapter(r),u.destroy(o,t,r)}).then(function(){return r.afterDestroy.call(a,r,a)}).then(function(e){return r.notify&&o.emit("DS.afterDestroy",o,e),o.eject(t),i.respond(t,{adapter:u},r)}).catch(function(i){return r&&r.eagerEject&&a&&o.inject(a,{notify:!1}),n.errorFn("destroy",e,t,r)(i)})}},function(e,t){e.exports=function(e,t,r){var n=this,i=n.utils,o=n.definitions[e],a=void 0,u=void 0,s=void 0;return t=t||{},new i.Promise(function(a,u){o?i._o(t)?(r=i._(o,r),i.applyScope(o,t,r),a()):u(i._oErr("attrs")):u(new n.errors.NER(e))}).then(function(){return u=o.defaultFilter.call(n,e,t),r.beforeDestroy(r,u)}).then(function(){return r.notify&&o.emit("DS.beforeDestroy",o,u),r.eagerEject&&(a=o.ejectAll(t)),s=o.getAdapterName(r),n.adapters[s].destroyAll(o,t,r)}).then(function(){return r.afterDestroy(r,u)}).then(function(){return r.notify&&o.emit("DS.afterDestroy",o,u),a||o.ejectAll(t)}).then(function(e){return i.respond(e,{adapter:s},r)}).catch(function(i){return r&&r.eagerEject&&a&&o.inject(a,{notify:!1}),n.errorFn("destroyAll",e,t,r)(i)})}},function(e,t){e.exports=function(e,t,r){var n=this,i=n.utils,o=n.definitions[e],a=n.store[e],u=void 0;return new i.Promise(function(u,s){if(o)if(i._sn(t)){r=i._(o,r),r.params&&(r.params=i.copy(r.params)),(r.bypassCache||!r.cacheResponse)&&delete a.completedQueries[t];var f=r.maxAge&&t in a.completedQueries&&a.completedQueries[t]+r.maxAge<(new Date).getTime();r.findStrictCache&&!(t in a.completedQueries)||!o.get(t)||r.bypassCache||f?(delete a.completedQueries[t],u()):u(o.get(t))}else s(i._snErr("id"));else s(new n.errors.NER(e))}).then(function(e){if(e)return e;if(!(t in a.pendingQueries)){var s=void 0,f=r.findStrategy||r.strategy;if("fallback"===f){var c=function e(a){return u=o.getAdapterName((r.findFallbackAdapters||r.fallbackAdapters)[a]),n.adapters[u].find(o,t,r).catch(function(t){return a++,a<r.fallbackAdapters.length?e(a):i.Promise.reject(t)})};s=c(0)}else u=o.getAdapterName(r),s=n.adapters[u].find(o,t,r);a.pendingQueries[t]=s.then(function(e){return r.afterFind.call(e,r,e)}).then(function(e){if(delete a.pendingQueries[t],r.cacheResponse){var n=o.inject(e,r.orig());return a.completedQueries[t]=(new Date).getTime(),a.saved[t]=i.updateTimestamp(a.saved[t]),n}return o.createInstance(e,r.orig())})}return a.pendingQueries[t]}).then(function(e){return i.respond(e,{adapter:u},r)}).catch(function(i){return a&&delete a.pendingQueries[t],n.errorFn("find",e,t,r)(i)})}},function(e,t){function r(e,t,r,n){var i=this,o=i.utils,a=i.definitions[t],u=i.store[t],s=i.definitions[t].idAttribute,f=(new Date).getTime();e=e||[],delete u.pendingQueries[r],u.completedQueries[r]=f;var c=a.inject(e,n.orig());return o._a(c)?o.forEach(c,function(e){if(e){var t=e[s];t&&(u.completedQueries[t]=f,u.saved[t]=o.updateTimestamp(u.saved[t]))}}):(n.errorFn("response is expected to be an array!"),u.completedQueries[c[s]]=f),c}e.exports=function(e,t,n){var i=this,o=i.utils,a=i.definitions[e],u=i.store[e],s=void 0,f=void 0;return new o.Promise(function(r,f){if(t=t||{},i.definitions[e])if(o._o(t)){n=o._(a,n),s=o.toJson(t),n.params&&(n.params=o.copy(n.params)),o.applyScope(a,t,n),(n.bypassCache||!n.cacheResponse)&&(delete u.completedQueries[s],delete u.queryData[s]);var c=n.maxAge&&s in u.completedQueries&&u.completedQueries[s]+n.maxAge<(new Date).getTime();s in u.completedQueries&&!c?r(n.useFilter?n.localKeys?a.getAll(n.localKeys,n.orig()):a.filter(t,n.orig()):u.queryData[s]):r()}else f(o._oErr("params"));else f(new i.errors.NER(e))}).then(function(c){if(c)return c;if(!(s in u.pendingQueries)){var l=void 0,d=n.findAllStrategy||n.strategy;if("fallback"===d){var p=function e(r){return f=a.getAdapterName((n.findAllFallbackAdapters||n.fallbackAdapters)[r]),i.adapters[f].findAll(a,t,n).catch(function(t){return r++,r<n.fallbackAdapters.length?e(r):o.Promise.reject(t)})};l=p(0)}else f=a.getAdapterName(n),l=i.adapters[f].findAll(a,t,n);u.pendingQueries[s]=l.then(function(e){return n.afterFindAll.call(e,n,e)}).then(function(t){return delete u.pendingQueries[s],n.cacheResponse?(u.queryData[s]=r.call(i,t,e,s,n),u.queryData[s].$$injected=!0,u.queryData[s]):(o.forEach(t,function(e,r){t[r]=a.createInstance(e,n.orig())}),t)})}return u.pendingQueries[s]}).then(function(e){return o.respond(e,{adapter:f},n)}).catch(function(r){return u&&delete u.pendingQueries[s],i.errorFn("findAll",e,t,n)(r)})}},function(e,t){function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.exports=function(e,t,n,i){var o=this,a=o.utils,u=o.errors,s=o.definitions[e],f=void 0;return new a.Promise(function(o,c){a._sn(t)&&(t=s.get(t)),a._s(n)&&(n=[n]),n=n||[],s?a._o(t)?a._a(n)?!function(){f=a._(s,i);var e=[];a.forEach(s.relationList,function(o){var u=o.relation,f=s.getResource(u),c=a._(f,i);if(!n.length||a.contains(n,u)||a.contains(n,o.localField)){var l=void 0,d={};c.allowSimpleWhere?d[o.foreignKey]=t[s.idAttribute]:(d.where={},d.where[o.foreignKey]={"==":t[s.idAttribute]});var p=c.orig(),h=o.localKey?a.get(t,o.localKey):null,v=!(!h&&0!==h);if("function"==typeof o.load)l=o.load(s,o,t,p);else if("hasMany"===o.type){if(o.localKeys){delete d[o.foreignKey];var m=a.get(t,o.localKeys)||[];m=a._a(m)?m:a.keys(m),d.where=r({},f.idAttribute,{in:m}),p.localKeys=m}else o.foreignKeys&&(delete d[o.foreignKey],d.where=r({},o.foreignKeys,{contains:t[s.idAttribute]}));l=f.findAll(d,p)}else"hasOne"===o.type?o.localKey&&v?l=f.find(h,p):o.foreignKey&&(l=f.findAll(d,p).then(function(e){return e.length?e[0]:null})):v&&(l=f.find(h,p));l&&e.push(l)}}),o(e)}():c(new u.IA('"relations" must be a string or an array!')):c(new u.IA('"instance(id)" must be a string, number or object!')):c(new u.NER(e))}).then(function(e){return a.Promise.all(e)}).then(function(){return f.afterLoadRelations.call(t,f,t)}).catch(o.errorFn("loadRelations",e,t,n,i))}},function(e,t){e.exports=function(e,t){var r=this,n=r.utils,i=r.definitions[e],o=r.store[e];return new n.Promise(function(a,u){if(i){t=n._(i,t),t.hasOwnProperty("notify")||(t.notify=!1);for(var s=[],f=(new Date).getTime(),c=void 0;(c=o.expiresHeap.peek())&&c.expires<f;)s.push(c.item),delete c.item,o.expiresHeap.pop();a(s)}else u(new r.errors.NER(e))}).then(function(e){if(e.length&&(i.beforeReap(t,e),t.notify&&i.emit("DS.beforeReap",i,e)),"inject"===t.reapAction)!function(){var t=(new Date).getTime();n.forEach(e,function(e){o.expiresHeap.push({item:e,timestamp:t,expires:i.maxAge?t+i.maxAge:Number.MAX_VALUE})})}();else if("eject"===t.reapAction)n.forEach(e,function(e){i.eject(e[i.idAttribute])});else if("refresh"===t.reapAction){var r=function(){var t=[];return n.forEach(e,function(e){t.push(i.refresh(e[i.idAttribute]))}),{v:n.Promise.all(t)}}();if("object"==typeof r)return r.v}return e}).then(function(e){return e.length&&(i.afterReap(t,e),t.notify&&i.emit("DS.afterReap",i,e)),e}).catch(r.errorFn("reap",e,t))}},function(e,t){e.exports=function(e,t,r){var n=this,i=n.utils,o=n.errors,a=n.definitions[e],u=n.store[e],s=void 0,f=void 0,c=void 0;return new i.Promise(function(n,u){t=i.resolveId(a,t),a?i._sn(t)?a.get(t)?(s=a.get(t),r=i._(a,r),n(s)):u(new o.R('id "'+t+'" not found in cache!')):u(i._snErr("id")):u(new o.NER(e))}).then(function(e){return r.beforeValidate.call(e,r,e)}).then(function(e){return r.validate.call(e,r,e)}).then(function(e){return r.afterValidate.call(e,r,e)}).then(function(e){return r.beforeUpdate.call(e,r,e)}).then(function(e){if(r.notify&&a.emit("DS.beforeUpdate",a,e),r.changesOnly){u.observers[t]&&"function"==typeof u.observers[t]&&u.observers[t].deliver();var o=[],s=a.changes(t);for(var l in s.added)o.push(l);for(l in s.changed)o.push(l);if(s=i.pick(e,o),i.isEmpty(s))return f=!0,e;e=s}return c=a.getAdapterName(r),n.adapters[c].update(a,t,i.omit(e,r.omit),r)}).then(function(e){return r.afterUpdate.call(e,r,e)}).then(function(e){if(r.notify&&a.emit("DS.afterUpdate",a,e),f)return e;if(r.cacheResponse){var t=a.inject(e,r.orig()),n=t[a.idAttribute];return u.saved[n]=i.updateTimestamp(u.saved[n]),a.resetHistoryOnInject||(u.previousAttributes[n]=i.copy(t,null,null,null,a.relationFields)),t}return a.createInstance(e,r.orig())}).then(function(e){return i.respond(e,{adapter:c},r)}).catch(n.errorFn("save",e,t,r))}},function(e,t){e.exports=function(e,t,r,n){var i=this,o=i.utils,a=i.errors,u=i.definitions[e],s=void 0;return new o.Promise(function(i,s){t=o.resolveId(u,t),u?o._sn(t)?(n=o._(u,n),i(r)):s(o._snErr("id")):s(new a.NER(e))}).then(function(e){return n.beforeValidate.call(e,n,e)}).then(function(e){return n.validate.call(e,n,e)}).then(function(e){return n.afterValidate.call(e,n,e)}).then(function(e){return n.beforeUpdate.call(e,n,e)}).then(function(e){return n.notify&&u.emit("DS.beforeUpdate",u,e),s=u.getAdapterName(n),i.adapters[s].update(u,t,o.omit(e,n.omit),n)}).then(function(e){return n.afterUpdate.call(e,n,e)}).then(function(t){if(n.notify&&u.emit("DS.afterUpdate",u,t),n.cacheResponse){var r=u.inject(t,n.orig()),a=i.store[e],s=r[u.idAttribute];return a.saved[s]=o.updateTimestamp(a.saved[s]),u.resetHistoryOnInject||(a.previousAttributes[s]=o.copy(r,null,null,null,u.relationFields)),r}return u.createInstance(t,n.orig())}).then(function(e){return o.respond(e,{adapter:s},n)}).catch(i.errorFn("update",e,t,r,n))}},function(e,t){e.exports=function(e,t,r,n){var i=this,o=i.utils,a=i.errors,u=i.definitions[e],s=void 0;return new o.Promise(function(i,s){u?(n=o._(u,n),o.applyScope(u,r,n),i(t)):s(new a.NER(e))}).then(function(e){return n.beforeValidate.call(e,n,e)}).then(function(e){return n.validate.call(e,n,e)}).then(function(e){return n.afterValidate.call(e,n,e)}).then(function(e){return n.beforeUpdate.call(e,n,e)}).then(function(e){return n.notify&&u.emit("DS.beforeUpdate",u,e),s=u.getAdapterName(n),i.adapters[s].updateAll(u,o.omit(e,n.omit),r,n)}).then(function(e){return n.afterUpdate.call(e,n,e)}).then(function(r){n.notify&&u.emit("DS.afterUpdate",u,t);var a=n.orig();if(n.cacheResponse){var s=function(){var t=u.inject(r,a),n=i.store[e];return o.forEach(t,function(e){var t=e[u.idAttribute];n.saved[t]=o.updateTimestamp(n.saved[t]),u.resetHistoryOnInject||(n.previousAttributes[t]=o.copy(e,null,null,null,u.relationFields))}),{v:t}}();if("object"==typeof s)return s.v}else{var f=function(){var e=[];return o.forEach(r,function(t){e.push(u.createInstance(t,a))}),{v:e}}();if("object"==typeof f)return f.v}}).then(function(e){return o.respond(e,{adapter:s},n)}).catch(i.errorFn("updateAll",e,t,r,n))}}])});
//# sourceMappingURL=dist/js-data.min.map
{
"name": "js-data",
"description": "Robust, framework-agnostic in-memory data store.",
"version": "2.6.1",
"version": "2.7.0",
"homepage": "http://www.js-data.io",

@@ -39,28 +39,21 @@ "repository": {

"babel-loader": "5.3.2",
"chai": "3.4.0",
"coveralls": "2.11.4",
"es6-promise": "3.0.2",
"grunt": "0.4.5",
"grunt-contrib-clean": "0.6.0",
"grunt-contrib-uglify": "0.9.2",
"grunt-contrib-watch": "0.6.1",
"grunt-karma": "0.12.1",
"grunt-karma-coveralls": "2.5.4",
"grunt-mocha-test": "0.12.7",
"grunt-webpack": "1.0.11",
"jit-grunt": "0.9.1",
"jshint": "2.8.0",
"jshint-loader": "0.8.3",
"karma": "0.13.10",
"karma": "0.13.14",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "0.2.1",
"karma-coverage": "0.5.2",
"karma-coverage": "0.5.3",
"karma-firefox-launcher": "0.1.6",
"karma-mocha": "0.2.0",
"karma-phantomjs-launcher": "0.2.1",
"karma-script-launcher": "0.1.0",
"karma-sinon": "1.0.4",
"karma-spec-reporter": "0.0.20",
"sinon": "1.17.1",
"mocha": "2.3.3",
"mout": "0.11.0",
"phantomjs": "1.9.18",
"sinon": "1.17.2",
"standard": "5.3.1",
"time-grunt": "1.2.1",
"webpack-dev-server": "1.12.0"
"uglify-js": "2.5.0",
"webpack": "1.12.2",
"yabh": "1.1.0"
},

@@ -71,8 +64,16 @@ "standard": {

"scripts": {
"test": "grunt test"
},
"dependencies": {
"yabh": "1.1.0",
"mout": "0.11.0"
"lint": "node node_modules/standard/bin/cmd.js src/**/*.js",
"bundle": "node node_modules/webpack/bin/webpack.js --config webpack.config.js --colors",
"min": "node node_modules/uglify-js/bin/uglifyjs dist/js-data.js -o dist/js-data.min.js --source-map dist/js-data.min.map -v -m -c --screw-ie8",
"debug": "node scripts/debug.js",
"version": "node scripts/version.js",
"banner": "node scripts/banner.js",
"gzip": "echo gzipped size: $(cat dist/js-data.min.js | gzip -f9 | wc -c)kb",
"build": "npm run lint && npm run bundle && npm run debug && npm run min && npm run version && npm run banner && npm run gzip",
"karma": "node node_modules/karma/bin/karma start",
"mocha": "mocha --timeout 20000 --reporter dot mocha.start.js test/both/* test/both/datastore/* test/both/datastore/async_methods/* test/both/datastore/sync_methods/*",
"test": "npm run mocha && npm run karma",
"all": "npm run build && npm run test",
"ci": "npm run all && cat ./coverage/PhantomJS*/lcov.info | node_modules/coveralls/bin/coveralls.js"
}
}
<img src="https://raw.githubusercontent.com/js-data/js-data/master/js-data.png" alt="js-data logo" title="js-data" align="right" width="64" height="64" />
## JSData [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/js-data/js-data?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Latest Release](https://img.shields.io/github/release/js-data/js-data.svg?style=flat-square)](https://github.com/js-data/js-data/releases) [![Circle CI](https://img.shields.io/circleci/project/js-data/js-data/master.svg?style=flat-square)](https://circleci.com/gh/js-data/js-data/tree/master) [![npm downloads](https://img.shields.io/npm/dm/js-data.svg?style=flat-square)](https://www.npmjs.org/package/js-data) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/js-data/js-data/blob/master/LICENSE)
## JSData [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/js-data/js-data?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Latest Release](https://img.shields.io/github/release/js-data/js-data.svg?style=flat-square)](https://github.com/js-data/js-data/releases) [![Circle CI](https://img.shields.io/circleci/project/js-data/js-data/master.svg?style=flat-square)](https://circleci.com/gh/js-data/js-data/tree/master) [![npm downloads](https://img.shields.io/npm/dm/js-data.svg?style=flat-square)](https://www.npmjs.org/package/js-data) [![Coverage Status](https://coveralls.io/repos/js-data/js-data/badge.svg?branch=master&service=github)](https://coveralls.io/github/js-data/js-data?branch=master)

@@ -180,3 +180,3 @@ Inspired by [Ember Data](https://github.com/emberjs/data), __JSData__ is the model layer you've been craving. It consists of a convenient __framework-agnostic__, __in-memory store__ for managing your data, which uses __adapters__ to communicate with various __persistence layers__.

1. Contribute to the issue that is the reason you'll be developing in the first place
1. Contribute to the issue/discussion that is the reason you'll be developing in the first place
1. Fork js-data

@@ -186,6 +186,8 @@ 1. `git clone git@github.com:<you>/js-data.git`

1. Write your code, including relevant documentation and tests
1. `grunt test` (build and test)
1. Submit a PR and we'll review
1. Run `npm test` (build and test)
1. Your code will be linted and checked for formatting, the tests will be run
1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They will be committed when a release is cut.
1. Submit your PR and we'll review!
1. Thanks!
### License

@@ -192,0 +194,0 @@

@@ -22,9 +22,2 @@ var webpack = require('webpack');

{ test: /(src)(.+)\.js$/, exclude: /node_modules/, loader: 'babel-loader?blacklist=useStrict&modules=commonStrict' }
],
preLoaders: [
{
test: /(src)(.+)\.js$|(test)(.+)\.js$/, // include .js files
exclude: /node_modules/, // exclude any and all files in the node_modules folder
loader: "jshint-loader?failOnHint=true"
}
]

@@ -31,0 +24,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc