ember-data-source 2.11.0 → 2.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dist/globals/ember-data.js +36 -13
- data/dist/globals/ember-data.min.js +4 -4
- data/dist/globals/ember-data.prod.js +33 -10
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 809320335e1d5d3e41a0cc0fbcc6433851ded2e3
|
4
|
+
data.tar.gz: 637b0e6fd12c8a245ab765f85f9cb5e0d1a05a47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef81d3937079fe2726cd77eef8c7544715a46118c99a5d045fe5e9d8152a59695450574ee3978e8582728d00aa7e9f0c4e125e0f05a71f03e9e5a6d2aff6a02
|
7
|
+
data.tar.gz: 62e707d734db11af4eb163f104c648f1844f46dbd55c51fd40218fbbffffcf43998c34fb95eb774f29f2d6383d6d86d8093267615851e5e5292dff790ee378f8
|
data/dist/globals/ember-data.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* @copyright Copyright 2011-2016 Tilde Inc. and contributors.
|
7
7
|
* Portions Copyright 2011 LivingSocial Inc.
|
8
8
|
* @license Licensed under MIT license (see license.js)
|
9
|
-
* @version 2.11.
|
9
|
+
* @version 2.11.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var loader, define, requireModule, require, requirejs;
|
@@ -1482,7 +1482,12 @@ define("ember-data/-private/system/many-array", ["exports", "ember", "ember-data
|
|
1482
1482
|
flushCanonical: function () {
|
1483
1483
|
var isInitialized = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
|
1484
1484
|
|
1485
|
-
|
1485
|
+
// TODO make this smarter, currently its plenty stupid
|
1486
|
+
// TODO this filtering was re-introduced as a bugfix, but seems unneeded in 2.13
|
1487
|
+
// with the changes to internalModel cleanup in that version.
|
1488
|
+
var toSet = this.canonicalState.filter(function (internalModel) {
|
1489
|
+
return internalModel.currentState.stateName !== 'root.deleted.saved';
|
1490
|
+
});
|
1486
1491
|
|
1487
1492
|
//a hack for not removing new records
|
1488
1493
|
//TODO remove once we have proper diffing
|
@@ -10392,7 +10397,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
10392
10397
|
@return {boolean}
|
10393
10398
|
*/
|
10394
10399
|
recordIsLoaded: function (modelName, id) {
|
10395
|
-
(0, _emberDataPrivateDebug.deprecate)('Use of recordIsLoaded is deprecated, use hasRecordForId instead.', {
|
10400
|
+
(0, _emberDataPrivateDebug.deprecate)('Use of recordIsLoaded is deprecated, use hasRecordForId instead.', false, {
|
10396
10401
|
id: 'ds.store.recordIsLoaded',
|
10397
10402
|
until: '3.0'
|
10398
10403
|
});
|
@@ -10632,8 +10637,15 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
10632
10637
|
// container._registry = 1.11 - 2.0
|
10633
10638
|
// container = < 1.11
|
10634
10639
|
var owner = (0, _emberDataPrivateUtils.getOwner)(this);
|
10640
|
+
var mixin = undefined;
|
10641
|
+
|
10642
|
+
if (owner.factoryFor) {
|
10643
|
+
var MaybeMixin = owner.factoryFor('mixin:' + normalizedModelName);
|
10644
|
+
mixin = MaybeMixin && MaybeMixin.class;
|
10645
|
+
} else {
|
10646
|
+
mixin = owner._lookupFactory('mixin:' + normalizedModelName);
|
10647
|
+
}
|
10635
10648
|
|
10636
|
-
var mixin = owner._lookupFactory('mixin:' + normalizedModelName);
|
10637
10649
|
if (mixin) {
|
10638
10650
|
//Cache the class as a model
|
10639
10651
|
owner.register('model:' + normalizedModelName, _emberDataModel.default.extend(mixin));
|
@@ -10681,7 +10693,14 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
10681
10693
|
|
10682
10694
|
var owner = (0, _emberDataPrivateUtils.getOwner)(this);
|
10683
10695
|
|
10684
|
-
|
10696
|
+
if (owner.factoryFor) {
|
10697
|
+
var MaybeModel = owner.factoryFor('model:' + normalizedKey);
|
10698
|
+
var MaybeModelFactory = MaybeModel && MaybeModel.class;
|
10699
|
+
|
10700
|
+
return MaybeModelFactory;
|
10701
|
+
} else {
|
10702
|
+
return owner._lookupFactory('model:' + normalizedKey);
|
10703
|
+
}
|
10685
10704
|
},
|
10686
10705
|
|
10687
10706
|
/**
|
@@ -10874,7 +10893,13 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
10874
10893
|
},
|
10875
10894
|
|
10876
10895
|
_hasModelFor: function (modelName) {
|
10877
|
-
|
10896
|
+
var owner = (0, _emberDataPrivateUtils.getOwner)(this);
|
10897
|
+
|
10898
|
+
if (owner.factoryFor) {
|
10899
|
+
return !!owner.factoryFor('model:' + modelName);
|
10900
|
+
} else {
|
10901
|
+
return !!owner._lookupFactory('model:' + modelName);
|
10902
|
+
}
|
10878
10903
|
},
|
10879
10904
|
|
10880
10905
|
_pushInternalModel: function (data) {
|
@@ -11142,7 +11167,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
11142
11167
|
},
|
11143
11168
|
|
11144
11169
|
lookupAdapter: function (name) {
|
11145
|
-
(0, _emberDataPrivateDebug.deprecate)('Use of lookupAdapter is deprecated, use adapterFor instead.', {
|
11170
|
+
(0, _emberDataPrivateDebug.deprecate)('Use of lookupAdapter is deprecated, use adapterFor instead.', false, {
|
11146
11171
|
id: 'ds.store.lookupAdapter',
|
11147
11172
|
until: '3.0'
|
11148
11173
|
});
|
@@ -11150,7 +11175,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
11150
11175
|
},
|
11151
11176
|
|
11152
11177
|
lookupSerializer: function (name) {
|
11153
|
-
(0, _emberDataPrivateDebug.deprecate)('Use of lookupSerializer is deprecated, use serializerFor instead.', {
|
11178
|
+
(0, _emberDataPrivateDebug.deprecate)('Use of lookupSerializer is deprecated, use serializerFor instead.', false, {
|
11154
11179
|
id: 'ds.store.lookupSerializer',
|
11155
11180
|
until: '3.0'
|
11156
11181
|
});
|
@@ -11957,15 +11982,13 @@ define('ember-data/-private/utils', ['exports', 'ember'], function (exports, _em
|
|
11957
11982
|
ember-container-inject-owner is a new feature in Ember 2.3 that finally provides a public
|
11958
11983
|
API for looking items up. This function serves as a super simple polyfill to avoid
|
11959
11984
|
triggering deprecations.
|
11960
|
-
|
11985
|
+
*/
|
11961
11986
|
function getOwner(context) {
|
11962
11987
|
var owner;
|
11963
11988
|
|
11964
11989
|
if (_ember.default.getOwner) {
|
11965
11990
|
owner = _ember.default.getOwner(context);
|
11966
|
-
}
|
11967
|
-
|
11968
|
-
if (!owner && context.container) {
|
11991
|
+
} else if (context.container) {
|
11969
11992
|
owner = context.container;
|
11970
11993
|
}
|
11971
11994
|
|
@@ -19104,7 +19127,7 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
|
|
19104
19127
|
});
|
19105
19128
|
});
|
19106
19129
|
define("ember-data/version", ["exports"], function (exports) {
|
19107
|
-
exports.default = "2.11.
|
19130
|
+
exports.default = "2.11.1";
|
19108
19131
|
});
|
19109
19132
|
define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
|
19110
19133
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
!function(){"use strict";var e,t,r,i,a;!function(n){function o(){p={define:0,require:0,reify:0,findDeps:0,modules:0,exports:0,resolve:0,resolveRelative:0,findModule:0,pendingQueueLength:0},a._stats=p}function s(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function d(e,t,r,i){p.modules++,this.id=g++,this.name=e,this.deps=!t.length&&r.length?R:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function l(e){this.name=e}function u(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function c(e,t,r){p.findModule++;for(var i=v[e]||v[e+"/index"];i&&i.isAlias;)i=v[i.name];return i||u(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i),p.pendingQueueLength++),i}function h(e,t){if(p.resolve++,"."!==e.charAt(0))return e;p.resolveRelative++;for(var r=e.split("/"),i=t.split("/"),a=i.slice(0,-1),n=0,o=r.length;n<o;n++){var s=r[n];if(".."===s){if(0===a.length)throw new Error("Cannot access parent module of root");a.pop()}else{if("."===s)continue;a.push(s)}}return a.join("/")}function f(e){return!(!v[e]&&!v[e+"/index"])}var p,m={loader:e,define:t,requireModule:r,require:i,requirejs:a};a=i=r=function(e){p.require++;for(var t=[],r=c(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports},o(),e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&m.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=m[t])}};var y;y=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var v={},b={},g=0,R=["require","exports","module"];d.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||Object.isFrozen(e)||(e.default=e)},d.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.exports;p.exports++,e.wrapModules&&(this.callback=e.wrapModules(this.name,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.state="finalized",this.hasExportsAsDep&&void 0===t||(this.module.exports=t),this.makeDefaultExport(),this.module.exports},d.prototype.unsee=function(){this.state="new",this.module={exports:{}}},d.prototype.reify=function(){if("reified"!==this.state){this.state="reifying";try{this.reified=this._reify(),this.state="reified"}finally{"reifying"===this.state&&(this.state="errored")}}},d.prototype._reify=function(){p.reify++;for(var e=this.reified.slice(),t=0;t<e.length;t++){var r=e[t];e[t]=r.exports?r.exports:r.module.exports()}return e},d.prototype.findDeps=function(e){if("new"===this.state){p.findDeps++,this.state="pending";for(var t=this.deps,r=0;r<t.length;r++){var i=t[r],a=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,a.exports=this.module.exports):"require"===i?a.exports=this.makeRequire():"module"===i?a.exports=this.module:a.module=c(h(i,this.name),this.name,e)}}},d.prototype.makeRequire=function(){var e=this.name,t=function(t){return i(h(t,e))};return t.default=t,t.has=function(t){return f(h(t,e))},t},t=function(e,t,r){p.define++,arguments.length<2&&s(arguments.length),y(t)||(r=t,t=[]),r instanceof l?v[e]=new d(r.name,t,r,!0):v[e]=new d(e,t,r,!1)},t.petal={},t.alias=function(e){return new l(e)},a.entries=a._eak_seen=v,a.has=f,a.unsee=function(e){c(e,"(unsee)",!1).unsee()},a.clear=function(){o(),a.entries=a._eak_seen=v={},b={}},t("foo",function(){}),t("foo/bar",[],function(){}),t("foo/asdf",["module","exports","require"],function(e,t,r){r.has("foo/bar")&&r("foo/bar")}),t("foo/baz",[],t.alias("foo")),t("foo/quz",t.alias("foo")),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),i("foo/main"),i.unsee("foo/bar"),a.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-private/adapters",["exports","ember-data/adapters/json-api","ember-data/adapters/rest"],function(e,t,r){e.JSONAPIAdapter=t.default,e.RESTAdapter=r.default}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){var r=t.default.get;e.default=t.default.Mixin.create({buildURL:function(e,t,r,i,a){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(a,e);case"queryRecord":return this.urlForQueryRecord(a,e);case"findMany":return this.urlForFindMany(t,e,r);case"findHasMany":return this.urlForFindHasMany(t,e,r);case"findBelongsTo":return this.urlForFindBelongsTo(t,e,r);case"createRecord":return this.urlForCreateRecord(e,r);case"updateRecord":return this.urlForUpdateRecord(t,e,r);case"deleteRecord":return this.urlForDeleteRecord(t,e,r);default:return this._buildURL(e,t)}},_buildURL:function(e,t){var i,a=[],n=r(this,"host"),o=this.urlPrefix();return e&&(i=this.pathForType(e),i&&a.push(i)),t&&a.push(encodeURIComponent(t)),o&&a.unshift(o),a=a.join("/"),!n&&a&&"/"!==a.charAt(0)&&(a="/"+a),a},urlForFindRecord:function(e,t,r){return this._buildURL(t,e)},urlForFindAll:function(e,t){return this._buildURL(e)},urlForQuery:function(e,t){return this._buildURL(t)},urlForQueryRecord:function(e,t){return this._buildURL(t)},urlForFindMany:function(e,t,r){return this._buildURL(t)},urlForFindHasMany:function(e,t,r){return this._buildURL(t,e)},urlForFindBelongsTo:function(e,t,r){return this._buildURL(t,e)},urlForCreateRecord:function(e,t){return this._buildURL(e)},urlForUpdateRecord:function(e,t,r){return this._buildURL(t,e)},urlForDeleteRecord:function(e,t,r){return this._buildURL(t,e)},urlPrefix:function(e,t){var i=r(this,"host"),a=r(this,"namespace");if(i&&"/"!==i||(i=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+i+e:t+"/"+e;var n=[];return i&&n.push(i),a&&n.push(a),n.join("/")},pathForType:function(e){var r=t.default.String.camelize(e);return t.default.String.pluralize(r)}})}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){var i=t.default.Namespace.create({VERSION:r.default,name:"DS"});t.default.libraries&&t.default.libraries.registerCoreLibrary("Ember Data",i.VERSION),e.default=i}),t("ember-data/-private/debug",["exports","ember"],function(e,t){function r(){return t.default.assert.apply(t.default,arguments)}function i(){return t.default.debug.apply(t.default,arguments)}function a(){return t.default.deprecate.apply(t.default,arguments)}function n(){return t.default.info.apply(t.default,arguments)}function o(){return t.default.runInDebug.apply(t.default,arguments)}function s(e){return e()}function d(){return t.default.warn.apply(t.default,arguments)}function l(){return t.default.debugSeal.apply(t.default,arguments)}function u(e,r){return e.__isMixin?e.__mixin.detect(r.PrototypeMixin):(t.default.MODEL_FACTORY_INJECTIONS&&(e=e.superclass),e.detect(r))}function c(e,t,i){var a=i.modelName,n=e.modelName,o=t.key,s=e.store.modelFor(t.type),d="You cannot add a record of modelClass '"+a+"' to the '"+n+"."+o+"' relationship (only '"+s.modelName+"' allowed)";r(d,u(s,i.modelClass))}e.assert=r,e.debug=i,e.deprecate=a,e.info=n,e.runInDebug=o,e.instrument=s,e.warn=d,e.debugSeal=l,e.assertPolymorphicType=c}),t("ember-data/-private/ext/date",["exports","ember","ember-data/-private/debug"],function(e,t,r){t.default.Date=t.default.Date||{};var i=Date.parse,a=[1,4,5,6,7,10,11],n=function(e){var t,r,n=0;if(r=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?:(\d{2}))?)?)?$/.exec(e)){for(var o,s=0;o=a[s];++s)r[o]=+r[o]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,"Z"!==r[8]&&void 0!==r[9]&&(n=60*r[10]+r[11],"+"===r[9]&&(n=0-n)),t=Date.UTC(r[1],r[2],r[3],r[4],r[5]+n,r[6],r[7])}else t=i?i(e):NaN;return t};e.parseDate=n,t.default.Date.parse=function(e){return n(e)},(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.Date)&&(Date.parse=n)}),t("ember-data/-private/features",["exports","ember"],function(e,t){function r(){var e;return(e=t.default.FEATURES).isEnabled.apply(e,arguments)}e.default=r}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}function r(e){return e&&void 0===e.nodeType?e:void 0}e.default=t(r("object"==typeof global&&global))||t("object"==typeof self&&self)||t("object"==typeof window&&window)||new Function("return this")()}),t("ember-data/-private/initializers/data-adapter",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){function r(e){e.register("data-adapter:main",t.default)}e.default=r}),t("ember-data/-private/initializers/store-injections",["exports"],function(e){function t(e){var t=e.inject||e.injection;t.call(e,"controller","store","service:store"),t.call(e,"route","store","service:store"),t.call(e,"data-adapter","store","service:store")}e.default=t}),t("ember-data/-private/initializers/store",["exports","ember-data/-private/system/store","ember-data/-private/serializers","ember-data/-private/adapters"],function(e,t,r,i){function a(e,t){return e.has?e.has(t):e.hasRegistration(t)}function n(e){var n=e.registerOptionsForType||e.optionsForType;n.call(e,"serializer",{singleton:!1}),n.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",r.JSONSerializer),e.register("serializer:-rest",r.RESTSerializer),e.register("adapter:-rest",i.RESTAdapter),e.register("adapter:-json-api",i.JSONAPIAdapter),e.register("serializer:-json-api",r.JSONAPISerializer),a(e,"service:store")||e.register("service:store",t.default)}e.default=n}),t("ember-data/-private/initializers/transforms",["exports","ember-data/-private/transforms"],function(e,t){function r(e){e.register("transform:boolean",t.BooleanTransform),e.register("transform:date",t.DateTransform),e.register("transform:number",t.NumberTransform),e.register("transform:string",t.StringTransform)}e.default=r}),t("ember-data/-private/instance-initializers/initialize-store-service",["exports"],function(e){function t(e){var t=e.lookup?e:e.container;t.lookup("service:store")}e.default=t}),t("ember-data/-private/serializers",["exports","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest"],function(e,t,r,i){e.JSONAPISerializer=t.default,e.JSONSerializer=r.default,e.RESTSerializer=i.default}),t("ember-data/-private/system/clone-null",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){var r=new t.default;for(var i in e)r[i]=e[i];return r}e.default=r}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:e+""}e.default=t}),t("ember-data/-private/system/debug",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){e.default=t.default}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/model"],function(e,t,r){var i=t.default.get,a=t.default.String.capitalize,n=t.default.String.underscore,o=t.default.assert;e.default=t.default.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==r.default&&r.default.detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,o=this;return i(e,"attributes").forEach(function(e,i){if(r++>o.attributeLimit)return!1;var s=a(n(i).replace("_"," "));t.push({name:i,desc:s})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var i=r.match(/model:(.*)/);i&&(t=i[1])}}return o("Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support",!!t),this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,a={id:i(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;var o=i(e,n);a[n]=o}),a},getRecordKeywords:function(e){var r=[],a=t.default.A(["id"]);return e.eachAttribute(function(e){return a.push(e)}),a.forEach(function(t){return r.push(i(e,t))}),r},getRecordFilterValues:function(e){return{isNew:e.get("isNew"),isModified:e.get("hasDirtyAttributes")&&!e.get("isNew"),isClean:!e.get("hasDirtyAttributes")}},getRecordColor:function(e){var t="black";return e.get("isNew")?t="green":e.get("hasDirtyAttributes")&&(t="blue"),t},observeRecord:function(e,r){var i=t.default.A(),a=t.default.A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return a.push(e)});var n=this;a.forEach(function(a){var o=function(){r(n.wrapRecord(e))};t.default.addObserver(e,a,o),i.push(function(){t.default.removeObserver(e,a,o)})});var o=function(){i.forEach(function(e){return e()})};return o}})}),t("ember-data/-private/system/debug/debug-info",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_debugInfo:function(){var e=["id"],t={},r=[];this.eachAttribute(function(t,r){return e.push(t)});var i=[{name:"Attributes",properties:e,expand:!0}];return this.eachRelationship(function(e,a){var n=t[a.kind];void 0===n&&(n=t[a.kind]=[],i.push({name:a.name,properties:n,expand:!0})),n.push(e),r.push(e)}),i.push({name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}),{propertyInfo:{includeOtherProperties:!0,groups:i,expensiveProperties:r}}}})}),t("ember-data/-private/system/empty-object",["exports"],function(e){function t(){}e.default=t;var r=Object.create(null,{constructor:{value:void 0,enumerable:!1,writable:!0}});t.prototype=r}),t("ember-data/-private/system/is-array-like",["exports","ember"],function(e,t){function r(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(t.default.Array.detect(e))return!0;var r=t.default.typeOf(e);return"array"===r||void 0!==e.length&&"object"===r}e.default=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common"],function(e,t,r,i,a){var n=t.default.get,o=t.default.set;e.default=t.default.Object.extend(t.default.MutableArray,t.default.Evented,{init:function(){this._super.apply(this,arguments),this.isLoaded=!1,this.length=0,this.promise=null,this.meta=this.meta||null,this.isPolymorphic=this.isPolymorphic||!1,this.relationship=this.relationship||null,this.currentState=t.default.A([]),this.flushCanonical(!1)},objectAt:function(e){if(this.currentState[e])return this.currentState[e].getRecord()},flushCanonical:function(){var e=arguments.length<=0||void 0===arguments[0]||arguments[0],t=this.canonicalState,r=this.currentState.filter(function(e){return e.isNew()&&t.indexOf(e)===-1});t=t.concat(r);var i=this.length;this.arrayContentWillChange(0,this.length,t.length),(0,a._objectIsAlive)(this)&&this.set("length",t.length),this.currentState=t,this.arrayContentDidChange(0,i,this.length),e&&this.relationship.notifyHasManyChanged()},internalReplace:function(e,t,r){r||(r=[]),this.arrayContentWillChange(e,t,r.length),this.currentState.splice.apply(this.currentState,[e,t].concat(r)),this.set("length",this.currentState.length),this.arrayContentDidChange(e,t,r.length)},internalRemoveRecords:function(e){for(var t=0;t<e.length;t++){var r=this.currentState.indexOf(e[t]);this.internalReplace(r,1)}},internalAddRecords:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var i=void 0;t>0&&(i=this.currentState.slice(e,e+t),this.get("relationship").removeRecords(i)),r&&this.get("relationship").addRecords(r.map(function(e){return e._internalModel}),e)},loadingRecordsCount:function(e){this.loadingRecordsCount=e},loadedRecord:function(){this.loadingRecordsCount--,0===this.loadingRecordsCount&&(o(this,"isLoaded",!0),this.trigger("didLoad"))},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+n(this,"type"),a=t.default.RSVP.all(this.invoke("save"),r).then(function(){return e},null,"DS: ManyArray#save return ManyArray");return i.PromiseArray.create({promise:a})},createRecord:function(e){var t,r=n(this,"store"),i=n(this,"type");return t=r.createRecord(i.modelName,e),this.pushObject(t),t}})}),t("ember-data/-private/system/model",["exports","ember-data/-private/system/model/model","ember-data/attr","ember-data/-private/system/model/states","ember-data/-private/system/model/errors"],function(e,t,r,i,a){e.RootState=i.default,e.attr=r.default,e.Errors=a.default,e.default=t.default}),t("ember-data/-private/system/model/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){var i=t.default.get,a=t.default.Map,n=t.default.Mixin.create({attributes:t.default.computed(function(){var e=a.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:t.default.computed(function(){var e=a.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){i(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){i(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}});e.AttrClassMethodsMixin=n;var o=t.default.Mixin.create({eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});e.AttrInstanceMethodsMixin=o}),t("ember-data/-private/system/model/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){var i=t.default.get,a=t.default.set,n=t.default.isEmpty,o=t.default.makeArray,s=t.default.MapWithDefault;e.default=t.default.ArrayProxy.extend(t.default.Evented,{registerHandlers:function(e,t,r){this._registerHandlers(e,t,r)},_registerHandlers:function(e,t,r){this.on("becameInvalid",e,t),this.on("becameValid",e,r)},errorsByAttributeName:t.default.computed(function(){return s.create({defaultValue:function(){return t.default.A()}})}),errorsFor:function(e){return i(this,"errorsByAttributeName").get(e)},messages:t.default.computed.mapBy("content","message"),content:t.default.computed(function(){return t.default.A()}),unknownProperty:function(e){var t=this.errorsFor(e);return n(t)?null:t},isEmpty:t.default.computed.not("length").readOnly(),add:function(e,t){var r=i(this,"isEmpty");this._add(e,t),r&&!i(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),i(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=o(t),a=new Array(i.length),n=0;n<i.length;n++){var s=i[n],d=r.findBy("message",s);d?a[n]=d:a[n]={attribute:e,message:s}}return a},remove:function(e){i(this,"isEmpty")||(this._remove(e),i(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!i(this,"isEmpty")){var t=this.rejectBy("attribute",e);a(this,"content",t),i(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e)}},clear:function(){i(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!i(this,"isEmpty")){var e=i(this,"errorsByAttributeName"),r=t.default.A();e.forEach(function(e,t){r.push(t)}),e.clear(),r.forEach(function(e){this.notifyPropertyChange(e)},this),t.default.ArrayProxy.prototype.clear.call(this)}},has:function(e){return!n(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/system/empty-object","ember-data/-private/features","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,a,n,o,s,d,l){function u(e){return x[e]||(x[e]=e.split("."))}function c(e){return k[e]||(k[e]=u(e)[0])}var h=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),f=t.default.get,p=t.default.set,m=t.default.copy,y=t.default.Error,v=t.default.inspect,b=t.default.isEmpty,g=t.default.isEqual,R=t.default.run,_=t.default.setOwner,A=t.default.RSVP,z=t.default.RSVP.Promise,F=t.default.assign||t.default.merge,M=new o.default,k=new o.default,x=new o.default,S=function(){function e(e,t,r,a){this.modelClass=e,this.id=t,this.store=r,this._data=a||new o.default,this.modelName=e.modelName,this.dataHasInitialized=!1,this._loadingPromise=null,this._recordArrays=void 0,this._record=null,this.currentState=i.default.empty,this.isReloading=!1,this._isDestroyed=!1,this.isError=!1,this.error=null,this.__deferredTriggers=null,this._references=null,this._recordReference=null,this.__inFlightAttributes=null,this.__relationships=null,this.__attributes=null,this.__implicitRelationships=null}return h(e,[{key:"isEmpty",value:function(){return this.currentState.isEmpty}},{key:"isLoading",value:function(){return this.currentState.isLoading}},{key:"isLoaded",value:function(){return this.currentState.isLoaded}},{key:"hasDirtyAttributes",value:function(){return this.currentState.hasDirtyAttributes}},{key:"isSaving",value:function(){return this.currentState.isSaving}},{key:"isDeleted",value:function(){return this.currentState.isDeleted}},{key:"isNew",value:function(){return this.currentState.isNew}},{key:"isValid",value:function(){return this.currentState.isValid}},{key:"dirtyType",value:function(){return this.currentState.dirtyType}},{key:"getRecord",value:function(){if(!this._record){var e={store:this.store,_internalModel:this,id:this.id,currentState:this.currentState,isError:this.isError,adapterError:this.error};_?_(e,(0,d.getOwner)(this.store)):e.container=this.store.container,this._record=this.modelClass._create(e),this._triggerDeferredTriggers()}return this._record}},{key:"recordObjectWillDestroy",value:function(){this._record=null}},{key:"deleteRecord",value:function(){this.send("deleteRecord")}},{key:"save",value:function(e){var t="DS: Model#save "+this,r=A.defer(t);return this.store.scheduleSave(this,r,e),r.promise}},{key:"startedReloading",value:function(){this.isReloading=!0,this.hasRecord&&p(this.record,"isReloading",!0)}},{key:"finishedReloading",value:function(){this.isReloading=!1,this.hasRecord&&p(this.record,"isReloading",!1)}},{key:"reload",value:function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new z(function(t){e.send("reloadRecord",t)},t).then(function(){return e.didCleanError(),e},function(t){throw e.didError(t),t},"DS: Model#reload complete, update flags").finally(function(){e.finishedReloading(),e.updateRecordArrays()})}},{key:"unloadRecord",value:function(){this.send("unloadRecord")}},{key:"eachRelationship",value:function(e,t){return this.modelClass.eachRelationship(e,t)}},{key:"eachAttribute",value:function(e,t){return this.modelClass.eachAttribute(e,t)}},{key:"inverseFor",value:function(e){return this.modelClass.inverseFor(e)}},{key:"setupData",value:function(e){var t=this._changedKeys(e.attributes);F(this._data,e.attributes),this.pushedData(),this.hasRecord&&this.record._notifyProperties(t),this.didInitializeData()}},{key:"becameReady",value:function(){R.schedule("actions",this.store.recordArrayManager,this.store.recordArrayManager.recordWasLoaded,this)}},{key:"didInitializeData",value:function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)}},{key:"destroy",value:function(){if(this._isDestroyed=!0,this.hasRecord)return this.record.destroy()}},{key:"createSnapshot",value:function(e){return new n.default(this,e)}},{key:"loadingData",value:function(e){this.send("loadingData",e)}},{key:"loadedData",value:function(){this.send("loadedData"),this.didInitializeData()}},{key:"notFound",value:function(){this.send("notFound")}},{key:"pushedData",value:function(){this.send("pushedData")}},{key:"flushChangedAttributes",value:function(){this._inFlightAttributes=this._attributes,this._attributes=new o.default}},{key:"hasChangedAttributes",value:function(){return Object.keys(this._attributes).length>0}},{key:"updateChangedAttributes",value:function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=this._attributes,i=0,a=t.length;i<a;i++){var n=t[i],o=e[n],s=o[0],d=o[1];s===d&&delete r[n]}}},{key:"changedAttributes",value:function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=F(m(r),t),a=new o.default,n=Object.keys(i),s=0,d=n.length;s<d;s++){var l=n[s];a[l]=[e[l],i[l]]}return a}},{key:"adapterWillCommit",value:function(){this.send("willCommit")}},{key:"adapterDidDirty",value:function(){this.send("becomeDirty"),this.updateRecordArraysLater()}},{key:"send",value:function(e,t){var r=this.currentState;return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)}},{key:"notifyHasManyAdded",value:function(e,t,r){this.hasRecord&&this.record.notifyHasManyAdded(e,t,r)}},{key:"notifyHasManyRemoved",value:function(e,t,r){this.hasRecord&&this.record.notifyHasManyRemoved(e,t,r)}},{key:"notifyBelongsToChanged",value:function(e,t){this.hasRecord&&this.record.notifyBelongsToChanged(e,t)}},{key:"notifyPropertyChange",value:function(e){this.hasRecord&&this.record.notifyPropertyChange(e)}},{key:"rollbackAttributes",value:function(){var e=Object.keys(this._attributes);this._attributes=new o.default,f(this,"isError")&&(this._inFlightAttributes=new o.default,this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=new o.default),this.send("rolledBack"),this.record._notifyProperties(e)}},{key:"transitionTo",value:function(e){var t=c(e),r=this.currentState,i=r.stateName+"->"+e;do r.exit&&r.exit(this),r=r.parentState;while(!r[t]);var a=void 0,n=void 0,o=void 0,s=void 0,d=M[i];if(d)a=d.setups,n=d.enters,r=d.state;else{a=[],n=[];var l=u(e);for(o=0,s=l.length;o<s;o++)r=r[l[o]],r.enter&&n.push(r),r.setup&&a.push(r);M[i]={setups:a,enters:n,state:r}}for(o=0,s=n.length;o<s;o++)n[o].enter(this);for(this.currentState=r,this.hasRecord&&p(this.record,"currentState",r),o=0,s=a.length;o<s;o++)a[o].setup(this);this.updateRecordArraysLater()}},{key:"_unhandledEvent",value:function(e,t,r){var i="Attempted to handle event `"+t+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==r&&(i+="Called with "+v(r)+"."),new y(i)}},{key:"triggerLater",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];1===this._deferredTriggers.push(t)&&R.schedule("actions",this,this._triggerDeferredTriggers)}},{key:"_triggerDeferredTriggers",value:function(){if(this.hasRecord){for(var e=0,t=this._deferredTriggers.length;e<t;e++)this.record.trigger.apply(this.record,this._deferredTriggers[e]);this._deferredTriggers.length=0}}},{key:"clearRelationships",value:function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var i=e._relationships.get(t);i.clear(),i.destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].destroy()})}},{key:"preloadData",value:function(e){var t=this;Object.keys(e).forEach(function(r){var i=f(e,r),a=t.modelClass.metaForProperty(r);a.isRelationship?t._preloadRelationship(r,i):t._data[r]=i})}},{key:"_preloadRelationship",value:function(e,t){var r=this.modelClass.metaForProperty(e),i=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,i):this._preloadBelongsTo(e,t,i)}},{key:"_preloadHasMany",value:function(e,t,r){for(var i=new Array(t.length),a=0;a<t.length;a++){var n=t[a];i[a]=this._convertStringOrNumberIntoInternalModel(n,r)}this._relationships.get(e).updateRecordsFromAdapter(i)}},{key:"_preloadBelongsTo",value:function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setRecord(i)}},{key:"_convertStringOrNumberIntoInternalModel",value:function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e}},{key:"updateRecordArrays",value:function(){this._updatingRecordArraysLater=!1,this.store.dataWasUpdated(this.modelClass,this)}},{key:"setId",value:function(e){this.id=e,this.record.get("id")!==e&&this.record.set("id",e)}},{key:"didError",value:function(e){this.error=e,this.isError=!0,this.hasRecord&&this.record.setProperties({isError:!0,adapterError:e})}},{key:"didCleanError",value:function(){this.error=null,this.isError=!1,this.hasRecord&&this.record.setProperties({isError:!1,adapterError:null})}},{key:"adapterDidCommit",value:function(e){e&&(e=e.attributes),this.didCleanError();var t=this._changedKeys(e);F(this._data,this._inFlightAttributes),e&&F(this._data,e),this._inFlightAttributes=new o.default,this.send("didCommit"),this.updateRecordArraysLater(),e&&this.record._notifyProperties(t)}},{key:"updateRecordArraysLater",value:function(){this._updatingRecordArraysLater||(this._updatingRecordArraysLater=!0,R.schedule("actions",this,this.updateRecordArrays))}},{key:"addErrorMessageToAttribute",value:function(e,t){f(this.getRecord(),"errors")._add(e,t)}},{key:"removeErrorMessageFromAttribute",value:function(e){f(this.getRecord(),"errors")._remove(e)}},{key:"clearErrorMessages",value:function(){f(this.getRecord(),"errors")._clear()}},{key:"hasErrors",value:function(){var e=f(this.getRecord(),"errors");return!b(e)}},{key:"adapterDidInvalidate",value:function(e){var t=void 0;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()}},{key:"adapterDidError",value:function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()}},{key:"_saveWasRejected",value:function(){for(var e=Object.keys(this._inFlightAttributes),t=this._attributes,r=0;r<e.length;r++)void 0===t[e[r]]&&(t[e[r]]=this._inFlightAttributes[e[r]]);this._inFlightAttributes=new o.default}},{key:"_changedKeys",value:function(e){var t=[];if(e){var r=void 0,i=void 0,a=void 0,n=void 0,s=Object.keys(e),d=s.length,l=this._attributes;for(r=F(new o.default,this._data),r=F(r,this._inFlightAttributes),i=0;i<d;i++)n=s[i],a=e[n],void 0===l[n]&&(g(r[n],a)||t.push(n))}return t}},{key:"toString",value:function(){return"<"+this.modelName+":"+this.id+">"}},{key:"referenceFor",value:function(e,t){var r=this.references[t];if(!r){var i=this._relationships.get(t);"belongsTo"===e?r=new l.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new l.HasManyReference(this.store,this,i)),this.references[t]=r}return r}},{key:"type",get:function(){return this.modelClass}},{key:"recordReference",get:function(){return null===this._recordReference&&(this._recordReference=new l.RecordReference(this.store,this)),this._recordReference}},{key:"references",get:function(){return null===this._references&&(this._references=new o.default),this._references}},{key:"_deferredTriggers",get:function(){return null===this.__deferredTriggers&&(this.__deferredTriggers=[]),this.__deferredTriggers}},{key:"_attributes",get:function(){return null===this.__attributes&&(this.__attributes=new o.default),this.__attributes},set:function(e){this.__attributes=e}},{key:"_relationships",get:function(){return null===this.__relationships&&(this.__relationships=new a.default(this)),this.__relationships}},{key:"_inFlightAttributes",get:function(){return null===this.__inFlightAttributes&&(this.__inFlightAttributes=new o.default),this.__inFlightAttributes},set:function(e){this.__inFlightAttributes=e}},{key:"_implicitRelationships",get:function(){return null===this.__implicitRelationships&&(this.__implicitRelationships=new o.default),this.__implicitRelationships}},{key:"record",get:function(){return this._record}},{key:"isDestroyed",get:function(){return this._isDestroyed}},{key:"hasRecord",get:function(){return!!this._record}}]),e}();e.default=S}),t("ember-data/-private/system/model/model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/system/debug/debug-info","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/system/relationships/ext","ember-data/-private/system/model/attr","ember-data/-private/features","ember-data/-private/system/model/states"],function(e,t,r,i,a,n,o,s,d,l,u,c){
|
1
|
+
!function(){"use strict";var e,t,r,i,a;!function(n){function o(){p={define:0,require:0,reify:0,findDeps:0,modules:0,exports:0,resolve:0,resolveRelative:0,findModule:0,pendingQueueLength:0},a._stats=p}function s(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function d(e,t,r,i){p.modules++,this.id=g++,this.name=e,this.deps=!t.length&&r.length?R:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function l(e){this.name=e}function u(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function c(e,t,r){p.findModule++;for(var i=v[e]||v[e+"/index"];i&&i.isAlias;)i=v[i.name];return i||u(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i),p.pendingQueueLength++),i}function h(e,t){if(p.resolve++,"."!==e.charAt(0))return e;p.resolveRelative++;for(var r=e.split("/"),i=t.split("/"),a=i.slice(0,-1),n=0,o=r.length;n<o;n++){var s=r[n];if(".."===s){if(0===a.length)throw new Error("Cannot access parent module of root");a.pop()}else{if("."===s)continue;a.push(s)}}return a.join("/")}function f(e){return!(!v[e]&&!v[e+"/index"])}var p,m={loader:e,define:t,requireModule:r,require:i,requirejs:a};a=i=r=function(e){p.require++;for(var t=[],r=c(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports},o(),e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&m.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=m[t])}};var y;y=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var v={},b={},g=0,R=["require","exports","module"];d.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||Object.isFrozen(e)||(e.default=e)},d.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.exports;p.exports++,e.wrapModules&&(this.callback=e.wrapModules(this.name,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.state="finalized",this.hasExportsAsDep&&void 0===t||(this.module.exports=t),this.makeDefaultExport(),this.module.exports},d.prototype.unsee=function(){this.state="new",this.module={exports:{}}},d.prototype.reify=function(){if("reified"!==this.state){this.state="reifying";try{this.reified=this._reify(),this.state="reified"}finally{"reifying"===this.state&&(this.state="errored")}}},d.prototype._reify=function(){p.reify++;for(var e=this.reified.slice(),t=0;t<e.length;t++){var r=e[t];e[t]=r.exports?r.exports:r.module.exports()}return e},d.prototype.findDeps=function(e){if("new"===this.state){p.findDeps++,this.state="pending";for(var t=this.deps,r=0;r<t.length;r++){var i=t[r],a=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,a.exports=this.module.exports):"require"===i?a.exports=this.makeRequire():"module"===i?a.exports=this.module:a.module=c(h(i,this.name),this.name,e)}}},d.prototype.makeRequire=function(){var e=this.name,t=function(t){return i(h(t,e))};return t.default=t,t.has=function(t){return f(h(t,e))},t},t=function(e,t,r){p.define++,arguments.length<2&&s(arguments.length),y(t)||(r=t,t=[]),r instanceof l?v[e]=new d(r.name,t,r,!0):v[e]=new d(e,t,r,!1)},t.petal={},t.alias=function(e){return new l(e)},a.entries=a._eak_seen=v,a.has=f,a.unsee=function(e){c(e,"(unsee)",!1).unsee()},a.clear=function(){o(),a.entries=a._eak_seen=v={},b={}},t("foo",function(){}),t("foo/bar",[],function(){}),t("foo/asdf",["module","exports","require"],function(e,t,r){r.has("foo/bar")&&r("foo/bar")}),t("foo/baz",[],t.alias("foo")),t("foo/quz",t.alias("foo")),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),i("foo/main"),i.unsee("foo/bar"),a.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-private/adapters",["exports","ember-data/adapters/json-api","ember-data/adapters/rest"],function(e,t,r){e.JSONAPIAdapter=t.default,e.RESTAdapter=r.default}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){var r=t.default.get;e.default=t.default.Mixin.create({buildURL:function(e,t,r,i,a){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(a,e);case"queryRecord":return this.urlForQueryRecord(a,e);case"findMany":return this.urlForFindMany(t,e,r);case"findHasMany":return this.urlForFindHasMany(t,e,r);case"findBelongsTo":return this.urlForFindBelongsTo(t,e,r);case"createRecord":return this.urlForCreateRecord(e,r);case"updateRecord":return this.urlForUpdateRecord(t,e,r);case"deleteRecord":return this.urlForDeleteRecord(t,e,r);default:return this._buildURL(e,t)}},_buildURL:function(e,t){var i,a=[],n=r(this,"host"),o=this.urlPrefix();return e&&(i=this.pathForType(e),i&&a.push(i)),t&&a.push(encodeURIComponent(t)),o&&a.unshift(o),a=a.join("/"),!n&&a&&"/"!==a.charAt(0)&&(a="/"+a),a},urlForFindRecord:function(e,t,r){return this._buildURL(t,e)},urlForFindAll:function(e,t){return this._buildURL(e)},urlForQuery:function(e,t){return this._buildURL(t)},urlForQueryRecord:function(e,t){return this._buildURL(t)},urlForFindMany:function(e,t,r){return this._buildURL(t)},urlForFindHasMany:function(e,t,r){return this._buildURL(t,e)},urlForFindBelongsTo:function(e,t,r){return this._buildURL(t,e)},urlForCreateRecord:function(e,t){return this._buildURL(e)},urlForUpdateRecord:function(e,t,r){return this._buildURL(t,e)},urlForDeleteRecord:function(e,t,r){return this._buildURL(t,e)},urlPrefix:function(e,t){var i=r(this,"host"),a=r(this,"namespace");if(i&&"/"!==i||(i=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+i+e:t+"/"+e;var n=[];return i&&n.push(i),a&&n.push(a),n.join("/")},pathForType:function(e){var r=t.default.String.camelize(e);return t.default.String.pluralize(r)}})}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){var i=t.default.Namespace.create({VERSION:r.default,name:"DS"});t.default.libraries&&t.default.libraries.registerCoreLibrary("Ember Data",i.VERSION),e.default=i}),t("ember-data/-private/debug",["exports","ember"],function(e,t){function r(){return t.default.assert.apply(t.default,arguments)}function i(){return t.default.debug.apply(t.default,arguments)}function a(){return t.default.deprecate.apply(t.default,arguments)}function n(){return t.default.info.apply(t.default,arguments)}function o(){return t.default.runInDebug.apply(t.default,arguments)}function s(e){return e()}function d(){return t.default.warn.apply(t.default,arguments)}function l(){return t.default.debugSeal.apply(t.default,arguments)}function u(e,r){return e.__isMixin?e.__mixin.detect(r.PrototypeMixin):(t.default.MODEL_FACTORY_INJECTIONS&&(e=e.superclass),e.detect(r))}function c(e,t,i){var a=i.modelName,n=e.modelName,o=t.key,s=e.store.modelFor(t.type),d="You cannot add a record of modelClass '"+a+"' to the '"+n+"."+o+"' relationship (only '"+s.modelName+"' allowed)";r(d,u(s,i.modelClass))}e.assert=r,e.debug=i,e.deprecate=a,e.info=n,e.runInDebug=o,e.instrument=s,e.warn=d,e.debugSeal=l,e.assertPolymorphicType=c}),t("ember-data/-private/ext/date",["exports","ember","ember-data/-private/debug"],function(e,t,r){t.default.Date=t.default.Date||{};var i=Date.parse,a=[1,4,5,6,7,10,11],n=function(e){var t,r,n=0;if(r=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?:(\d{2}))?)?)?$/.exec(e)){for(var o,s=0;o=a[s];++s)r[o]=+r[o]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,"Z"!==r[8]&&void 0!==r[9]&&(n=60*r[10]+r[11],"+"===r[9]&&(n=0-n)),t=Date.UTC(r[1],r[2],r[3],r[4],r[5]+n,r[6],r[7])}else t=i?i(e):NaN;return t};e.parseDate=n,t.default.Date.parse=function(e){return n(e)},(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.Date)&&(Date.parse=n)}),t("ember-data/-private/features",["exports","ember"],function(e,t){function r(){var e;return(e=t.default.FEATURES).isEnabled.apply(e,arguments)}e.default=r}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}function r(e){return e&&void 0===e.nodeType?e:void 0}e.default=t(r("object"==typeof global&&global))||t("object"==typeof self&&self)||t("object"==typeof window&&window)||new Function("return this")()}),t("ember-data/-private/initializers/data-adapter",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){function r(e){e.register("data-adapter:main",t.default)}e.default=r}),t("ember-data/-private/initializers/store-injections",["exports"],function(e){function t(e){var t=e.inject||e.injection;t.call(e,"controller","store","service:store"),t.call(e,"route","store","service:store"),t.call(e,"data-adapter","store","service:store")}e.default=t}),t("ember-data/-private/initializers/store",["exports","ember-data/-private/system/store","ember-data/-private/serializers","ember-data/-private/adapters"],function(e,t,r,i){function a(e,t){return e.has?e.has(t):e.hasRegistration(t)}function n(e){var n=e.registerOptionsForType||e.optionsForType;n.call(e,"serializer",{singleton:!1}),n.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",r.JSONSerializer),e.register("serializer:-rest",r.RESTSerializer),e.register("adapter:-rest",i.RESTAdapter),e.register("adapter:-json-api",i.JSONAPIAdapter),e.register("serializer:-json-api",r.JSONAPISerializer),a(e,"service:store")||e.register("service:store",t.default)}e.default=n}),t("ember-data/-private/initializers/transforms",["exports","ember-data/-private/transforms"],function(e,t){function r(e){e.register("transform:boolean",t.BooleanTransform),e.register("transform:date",t.DateTransform),e.register("transform:number",t.NumberTransform),e.register("transform:string",t.StringTransform)}e.default=r}),t("ember-data/-private/instance-initializers/initialize-store-service",["exports"],function(e){function t(e){var t=e.lookup?e:e.container;t.lookup("service:store")}e.default=t}),t("ember-data/-private/serializers",["exports","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest"],function(e,t,r,i){e.JSONAPISerializer=t.default,e.JSONSerializer=r.default,e.RESTSerializer=i.default}),t("ember-data/-private/system/clone-null",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){var r=new t.default;for(var i in e)r[i]=e[i];return r}e.default=r}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:e+""}e.default=t}),t("ember-data/-private/system/debug",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){e.default=t.default}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/model"],function(e,t,r){var i=t.default.get,a=t.default.String.capitalize,n=t.default.String.underscore,o=t.default.assert;e.default=t.default.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==r.default&&r.default.detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,o=this;return i(e,"attributes").forEach(function(e,i){if(r++>o.attributeLimit)return!1;var s=a(n(i).replace("_"," "));t.push({name:i,desc:s})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var i=r.match(/model:(.*)/);i&&(t=i[1])}}return o("Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support",!!t),this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,a={id:i(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;var o=i(e,n);a[n]=o}),a},getRecordKeywords:function(e){var r=[],a=t.default.A(["id"]);return e.eachAttribute(function(e){return a.push(e)}),a.forEach(function(t){return r.push(i(e,t))}),r},getRecordFilterValues:function(e){return{isNew:e.get("isNew"),isModified:e.get("hasDirtyAttributes")&&!e.get("isNew"),isClean:!e.get("hasDirtyAttributes")}},getRecordColor:function(e){var t="black";return e.get("isNew")?t="green":e.get("hasDirtyAttributes")&&(t="blue"),t},observeRecord:function(e,r){var i=t.default.A(),a=t.default.A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return a.push(e)});var n=this;a.forEach(function(a){var o=function(){r(n.wrapRecord(e))};t.default.addObserver(e,a,o),i.push(function(){t.default.removeObserver(e,a,o)})});var o=function(){i.forEach(function(e){return e()})};return o}})}),t("ember-data/-private/system/debug/debug-info",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_debugInfo:function(){var e=["id"],t={},r=[];this.eachAttribute(function(t,r){return e.push(t)});var i=[{name:"Attributes",properties:e,expand:!0}];return this.eachRelationship(function(e,a){var n=t[a.kind];void 0===n&&(n=t[a.kind]=[],i.push({name:a.name,properties:n,expand:!0})),n.push(e),r.push(e)}),i.push({name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}),{propertyInfo:{includeOtherProperties:!0,groups:i,expensiveProperties:r}}}})}),t("ember-data/-private/system/empty-object",["exports"],function(e){function t(){}e.default=t;var r=Object.create(null,{constructor:{value:void 0,enumerable:!1,writable:!0}});t.prototype=r}),t("ember-data/-private/system/is-array-like",["exports","ember"],function(e,t){function r(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(t.default.Array.detect(e))return!0;var r=t.default.typeOf(e);return"array"===r||void 0!==e.length&&"object"===r}e.default=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common"],function(e,t,r,i,a){var n=t.default.get,o=t.default.set;e.default=t.default.Object.extend(t.default.MutableArray,t.default.Evented,{init:function(){this._super.apply(this,arguments),this.isLoaded=!1,this.length=0,this.promise=null,this.meta=this.meta||null,this.isPolymorphic=this.isPolymorphic||!1,this.relationship=this.relationship||null,this.currentState=t.default.A([]),this.flushCanonical(!1)},objectAt:function(e){if(this.currentState[e])return this.currentState[e].getRecord()},flushCanonical:function(){var e=arguments.length<=0||void 0===arguments[0]||arguments[0],t=this.canonicalState.filter(function(e){return"root.deleted.saved"!==e.currentState.stateName}),r=this.currentState.filter(function(e){return e.isNew()&&t.indexOf(e)===-1});t=t.concat(r);var i=this.length;this.arrayContentWillChange(0,this.length,t.length),(0,a._objectIsAlive)(this)&&this.set("length",t.length),this.currentState=t,this.arrayContentDidChange(0,i,this.length),e&&this.relationship.notifyHasManyChanged()},internalReplace:function(e,t,r){r||(r=[]),this.arrayContentWillChange(e,t,r.length),this.currentState.splice.apply(this.currentState,[e,t].concat(r)),this.set("length",this.currentState.length),this.arrayContentDidChange(e,t,r.length)},internalRemoveRecords:function(e){for(var t=0;t<e.length;t++){var r=this.currentState.indexOf(e[t]);this.internalReplace(r,1)}},internalAddRecords:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var i=void 0;t>0&&(i=this.currentState.slice(e,e+t),this.get("relationship").removeRecords(i)),r&&this.get("relationship").addRecords(r.map(function(e){return e._internalModel}),e)},loadingRecordsCount:function(e){this.loadingRecordsCount=e},loadedRecord:function(){this.loadingRecordsCount--,0===this.loadingRecordsCount&&(o(this,"isLoaded",!0),this.trigger("didLoad"))},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+n(this,"type"),a=t.default.RSVP.all(this.invoke("save"),r).then(function(){return e},null,"DS: ManyArray#save return ManyArray");return i.PromiseArray.create({promise:a})},createRecord:function(e){var t,r=n(this,"store"),i=n(this,"type");return t=r.createRecord(i.modelName,e),this.pushObject(t),t}})}),t("ember-data/-private/system/model",["exports","ember-data/-private/system/model/model","ember-data/attr","ember-data/-private/system/model/states","ember-data/-private/system/model/errors"],function(e,t,r,i,a){e.RootState=i.default,e.attr=r.default,e.Errors=a.default,e.default=t.default}),t("ember-data/-private/system/model/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){var i=t.default.get,a=t.default.Map,n=t.default.Mixin.create({attributes:t.default.computed(function(){var e=a.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:t.default.computed(function(){var e=a.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){i(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){i(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}});e.AttrClassMethodsMixin=n;var o=t.default.Mixin.create({eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});e.AttrInstanceMethodsMixin=o}),t("ember-data/-private/system/model/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){var i=t.default.get,a=t.default.set,n=t.default.isEmpty,o=t.default.makeArray,s=t.default.MapWithDefault;e.default=t.default.ArrayProxy.extend(t.default.Evented,{registerHandlers:function(e,t,r){this._registerHandlers(e,t,r)},_registerHandlers:function(e,t,r){this.on("becameInvalid",e,t),this.on("becameValid",e,r)},errorsByAttributeName:t.default.computed(function(){return s.create({defaultValue:function(){return t.default.A()}})}),errorsFor:function(e){return i(this,"errorsByAttributeName").get(e)},messages:t.default.computed.mapBy("content","message"),content:t.default.computed(function(){return t.default.A()}),unknownProperty:function(e){var t=this.errorsFor(e);return n(t)?null:t},isEmpty:t.default.computed.not("length").readOnly(),add:function(e,t){var r=i(this,"isEmpty");this._add(e,t),r&&!i(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),i(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=o(t),a=new Array(i.length),n=0;n<i.length;n++){var s=i[n],d=r.findBy("message",s);d?a[n]=d:a[n]={attribute:e,message:s}}return a},remove:function(e){i(this,"isEmpty")||(this._remove(e),i(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!i(this,"isEmpty")){var t=this.rejectBy("attribute",e);a(this,"content",t),i(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e)}},clear:function(){i(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!i(this,"isEmpty")){var e=i(this,"errorsByAttributeName"),r=t.default.A();e.forEach(function(e,t){r.push(t)}),e.clear(),r.forEach(function(e){this.notifyPropertyChange(e)},this),t.default.ArrayProxy.prototype.clear.call(this)}},has:function(e){return!n(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/system/empty-object","ember-data/-private/features","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,a,n,o,s,d,l){function u(e){return x[e]||(x[e]=e.split("."))}function c(e){return k[e]||(k[e]=u(e)[0])}var h=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),f=t.default.get,p=t.default.set,m=t.default.copy,y=t.default.Error,v=t.default.inspect,b=t.default.isEmpty,g=t.default.isEqual,R=t.default.run,_=t.default.setOwner,A=t.default.RSVP,z=t.default.RSVP.Promise,F=t.default.assign||t.default.merge,M=new o.default,k=new o.default,x=new o.default,S=function(){function e(e,t,r,a){this.modelClass=e,this.id=t,this.store=r,this._data=a||new o.default,this.modelName=e.modelName,this.dataHasInitialized=!1,this._loadingPromise=null,this._recordArrays=void 0,this._record=null,this.currentState=i.default.empty,this.isReloading=!1,this._isDestroyed=!1,this.isError=!1,this.error=null,this.__deferredTriggers=null,this._references=null,this._recordReference=null,this.__inFlightAttributes=null,this.__relationships=null,this.__attributes=null,this.__implicitRelationships=null}return h(e,[{key:"isEmpty",value:function(){return this.currentState.isEmpty}},{key:"isLoading",value:function(){return this.currentState.isLoading}},{key:"isLoaded",value:function(){return this.currentState.isLoaded}},{key:"hasDirtyAttributes",value:function(){return this.currentState.hasDirtyAttributes}},{key:"isSaving",value:function(){return this.currentState.isSaving}},{key:"isDeleted",value:function(){return this.currentState.isDeleted}},{key:"isNew",value:function(){return this.currentState.isNew}},{key:"isValid",value:function(){return this.currentState.isValid}},{key:"dirtyType",value:function(){return this.currentState.dirtyType}},{key:"getRecord",value:function(){if(!this._record){var e={store:this.store,_internalModel:this,id:this.id,currentState:this.currentState,isError:this.isError,adapterError:this.error};_?_(e,(0,d.getOwner)(this.store)):e.container=this.store.container,this._record=this.modelClass._create(e),this._triggerDeferredTriggers()}return this._record}},{key:"recordObjectWillDestroy",value:function(){this._record=null}},{key:"deleteRecord",value:function(){this.send("deleteRecord")}},{key:"save",value:function(e){var t="DS: Model#save "+this,r=A.defer(t);return this.store.scheduleSave(this,r,e),r.promise}},{key:"startedReloading",value:function(){this.isReloading=!0,this.hasRecord&&p(this.record,"isReloading",!0)}},{key:"finishedReloading",value:function(){this.isReloading=!1,this.hasRecord&&p(this.record,"isReloading",!1)}},{key:"reload",value:function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new z(function(t){e.send("reloadRecord",t)},t).then(function(){return e.didCleanError(),e},function(t){throw e.didError(t),t},"DS: Model#reload complete, update flags").finally(function(){e.finishedReloading(),e.updateRecordArrays()})}},{key:"unloadRecord",value:function(){this.send("unloadRecord")}},{key:"eachRelationship",value:function(e,t){return this.modelClass.eachRelationship(e,t)}},{key:"eachAttribute",value:function(e,t){return this.modelClass.eachAttribute(e,t)}},{key:"inverseFor",value:function(e){return this.modelClass.inverseFor(e)}},{key:"setupData",value:function(e){var t=this._changedKeys(e.attributes);F(this._data,e.attributes),this.pushedData(),this.hasRecord&&this.record._notifyProperties(t),this.didInitializeData()}},{key:"becameReady",value:function(){R.schedule("actions",this.store.recordArrayManager,this.store.recordArrayManager.recordWasLoaded,this)}},{key:"didInitializeData",value:function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)}},{key:"destroy",value:function(){if(this._isDestroyed=!0,this.hasRecord)return this.record.destroy()}},{key:"createSnapshot",value:function(e){return new n.default(this,e)}},{key:"loadingData",value:function(e){this.send("loadingData",e)}},{key:"loadedData",value:function(){this.send("loadedData"),this.didInitializeData()}},{key:"notFound",value:function(){this.send("notFound")}},{key:"pushedData",value:function(){this.send("pushedData")}},{key:"flushChangedAttributes",value:function(){this._inFlightAttributes=this._attributes,this._attributes=new o.default}},{key:"hasChangedAttributes",value:function(){return Object.keys(this._attributes).length>0}},{key:"updateChangedAttributes",value:function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=this._attributes,i=0,a=t.length;i<a;i++){var n=t[i],o=e[n],s=o[0],d=o[1];s===d&&delete r[n]}}},{key:"changedAttributes",value:function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=F(m(r),t),a=new o.default,n=Object.keys(i),s=0,d=n.length;s<d;s++){var l=n[s];a[l]=[e[l],i[l]]}return a}},{key:"adapterWillCommit",value:function(){this.send("willCommit")}},{key:"adapterDidDirty",value:function(){this.send("becomeDirty"),this.updateRecordArraysLater()}},{key:"send",value:function(e,t){var r=this.currentState;return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)}},{key:"notifyHasManyAdded",value:function(e,t,r){this.hasRecord&&this.record.notifyHasManyAdded(e,t,r)}},{key:"notifyHasManyRemoved",value:function(e,t,r){this.hasRecord&&this.record.notifyHasManyRemoved(e,t,r)}},{key:"notifyBelongsToChanged",value:function(e,t){this.hasRecord&&this.record.notifyBelongsToChanged(e,t)}},{key:"notifyPropertyChange",value:function(e){this.hasRecord&&this.record.notifyPropertyChange(e)}},{key:"rollbackAttributes",value:function(){var e=Object.keys(this._attributes);this._attributes=new o.default,f(this,"isError")&&(this._inFlightAttributes=new o.default,this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=new o.default),this.send("rolledBack"),this.record._notifyProperties(e)}},{key:"transitionTo",value:function(e){var t=c(e),r=this.currentState,i=r.stateName+"->"+e;do r.exit&&r.exit(this),r=r.parentState;while(!r[t]);var a=void 0,n=void 0,o=void 0,s=void 0,d=M[i];if(d)a=d.setups,n=d.enters,r=d.state;else{a=[],n=[];var l=u(e);for(o=0,s=l.length;o<s;o++)r=r[l[o]],r.enter&&n.push(r),r.setup&&a.push(r);M[i]={setups:a,enters:n,state:r}}for(o=0,s=n.length;o<s;o++)n[o].enter(this);for(this.currentState=r,this.hasRecord&&p(this.record,"currentState",r),o=0,s=a.length;o<s;o++)a[o].setup(this);this.updateRecordArraysLater()}},{key:"_unhandledEvent",value:function(e,t,r){var i="Attempted to handle event `"+t+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==r&&(i+="Called with "+v(r)+"."),new y(i)}},{key:"triggerLater",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];1===this._deferredTriggers.push(t)&&R.schedule("actions",this,this._triggerDeferredTriggers)}},{key:"_triggerDeferredTriggers",value:function(){if(this.hasRecord){for(var e=0,t=this._deferredTriggers.length;e<t;e++)this.record.trigger.apply(this.record,this._deferredTriggers[e]);this._deferredTriggers.length=0}}},{key:"clearRelationships",value:function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var i=e._relationships.get(t);i.clear(),i.destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].destroy()})}},{key:"preloadData",value:function(e){var t=this;Object.keys(e).forEach(function(r){var i=f(e,r),a=t.modelClass.metaForProperty(r);a.isRelationship?t._preloadRelationship(r,i):t._data[r]=i})}},{key:"_preloadRelationship",value:function(e,t){var r=this.modelClass.metaForProperty(e),i=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,i):this._preloadBelongsTo(e,t,i)}},{key:"_preloadHasMany",value:function(e,t,r){for(var i=new Array(t.length),a=0;a<t.length;a++){var n=t[a];i[a]=this._convertStringOrNumberIntoInternalModel(n,r)}this._relationships.get(e).updateRecordsFromAdapter(i)}},{key:"_preloadBelongsTo",value:function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setRecord(i)}},{key:"_convertStringOrNumberIntoInternalModel",value:function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e}},{key:"updateRecordArrays",value:function(){this._updatingRecordArraysLater=!1,this.store.dataWasUpdated(this.modelClass,this)}},{key:"setId",value:function(e){this.id=e,this.record.get("id")!==e&&this.record.set("id",e)}},{key:"didError",value:function(e){this.error=e,this.isError=!0,this.hasRecord&&this.record.setProperties({isError:!0,adapterError:e})}},{key:"didCleanError",value:function(){this.error=null,this.isError=!1,this.hasRecord&&this.record.setProperties({isError:!1,adapterError:null})}},{key:"adapterDidCommit",value:function(e){e&&(e=e.attributes),this.didCleanError();var t=this._changedKeys(e);F(this._data,this._inFlightAttributes),e&&F(this._data,e),this._inFlightAttributes=new o.default,this.send("didCommit"),this.updateRecordArraysLater(),e&&this.record._notifyProperties(t)}},{key:"updateRecordArraysLater",value:function(){this._updatingRecordArraysLater||(this._updatingRecordArraysLater=!0,R.schedule("actions",this,this.updateRecordArrays))}},{key:"addErrorMessageToAttribute",value:function(e,t){f(this.getRecord(),"errors")._add(e,t)}},{key:"removeErrorMessageFromAttribute",value:function(e){f(this.getRecord(),"errors")._remove(e)}},{key:"clearErrorMessages",value:function(){f(this.getRecord(),"errors")._clear()}},{key:"hasErrors",value:function(){var e=f(this.getRecord(),"errors");return!b(e)}},{key:"adapterDidInvalidate",value:function(e){var t=void 0;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()}},{key:"adapterDidError",value:function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()}},{key:"_saveWasRejected",value:function(){for(var e=Object.keys(this._inFlightAttributes),t=this._attributes,r=0;r<e.length;r++)void 0===t[e[r]]&&(t[e[r]]=this._inFlightAttributes[e[r]]);this._inFlightAttributes=new o.default}},{key:"_changedKeys",value:function(e){var t=[];if(e){var r=void 0,i=void 0,a=void 0,n=void 0,s=Object.keys(e),d=s.length,l=this._attributes;for(r=F(new o.default,this._data),r=F(r,this._inFlightAttributes),i=0;i<d;i++)n=s[i],a=e[n],void 0===l[n]&&(g(r[n],a)||t.push(n))}return t}},{key:"toString",value:function(){return"<"+this.modelName+":"+this.id+">"}},{key:"referenceFor",value:function(e,t){var r=this.references[t];if(!r){var i=this._relationships.get(t);"belongsTo"===e?r=new l.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new l.HasManyReference(this.store,this,i)),this.references[t]=r}return r}},{key:"type",get:function(){return this.modelClass}},{key:"recordReference",get:function(){return null===this._recordReference&&(this._recordReference=new l.RecordReference(this.store,this)),this._recordReference}},{key:"references",get:function(){return null===this._references&&(this._references=new o.default),this._references}},{key:"_deferredTriggers",get:function(){return null===this.__deferredTriggers&&(this.__deferredTriggers=[]),this.__deferredTriggers}},{key:"_attributes",get:function(){return null===this.__attributes&&(this.__attributes=new o.default),this.__attributes},set:function(e){this.__attributes=e}},{key:"_relationships",get:function(){return null===this.__relationships&&(this.__relationships=new a.default(this)),this.__relationships}},{key:"_inFlightAttributes",get:function(){return null===this.__inFlightAttributes&&(this.__inFlightAttributes=new o.default),this.__inFlightAttributes},set:function(e){this.__inFlightAttributes=e}},{key:"_implicitRelationships",get:function(){return null===this.__implicitRelationships&&(this.__implicitRelationships=new o.default),this.__implicitRelationships}},{key:"record",get:function(){return this._record}},{key:"isDestroyed",get:function(){return this._isDestroyed}},{key:"hasRecord",get:function(){return!!this._record}}]),e}();e.default=S}),t("ember-data/-private/system/model/model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/system/debug/debug-info","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/system/relationships/ext","ember-data/-private/system/model/attr","ember-data/-private/features","ember-data/-private/system/model/states"],function(e,t,r,i,a,n,o,s,d,l,u,c){
|
2
2
|
var h=t.default.get,f=t.default.computed,p=f("currentState",function(e){return h(this._internalModel.currentState,e)}).readOnly(),m=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,isEmpty:p,isLoading:p,isLoaded:p,hasDirtyAttributes:f("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:p,isDeleted:p,isNew:p,isValid:p,dirtyType:p,isError:!1,isReloading:!1,id:null,currentState:c.default.empty,errors:f(function(){var e=a.default.create();return e._registerHandlers(this._internalModel,function(){this.send("becameInvalid")},function(){this.send("becameValid")}),e}).readOnly(),adapterError:null,serialize:function(e){return this._internalModel.createSnapshot().serialize(e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:function(){},didLoad:function(){},didUpdate:function(){},didCreate:function(){},didDelete:function(){},becameInvalid:function(){},becameError:function(){},rolledBack:function(){},send:function(e,t){return this._internalModel.send(e,t)},transitionTo:function(e){return this._internalModel.transitionTo(e)},deleteRecord:function(){this._internalModel.deleteRecord()},destroyRecord:function(e){return this.deleteRecord(),this.save(e)},unloadRecord:function(){this.isDestroyed||this._internalModel.unloadRecord()},_notifyProperties:function(e){t.default.beginPropertyChanges();for(var r,i=0,a=e.length;i<a;i++)r=e[i],this.notifyPropertyChange(r);t.default.endPropertyChanges()},changedAttributes:function(){return this._internalModel.changedAttributes()},rollbackAttributes:function(){this._internalModel.rollbackAttributes()},_createSnapshot:function(){return this._internalModel.createSnapshot()},toStringExtension:function(){return h(this,"id")},save:function(e){var t=this;return i.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){var e=this;return i.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){for(var r=arguments.length,i=new Array(r-1),a=1;a<r;a++)i[a-1]=arguments[a];t.default.tryInvoke(this,e,i),this._super.apply(this,arguments)},willDestroy:function(){this._super.apply(this,arguments),this._internalModel.clearRelationships(),this._internalModel.recordObjectWillDestroy()},willMergeMixin:function(e){this.constructor},attr:function(){},belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)},setId:t.default.observer("id",function(){this._internalModel.setId(this.get("id"))})});Object.defineProperty(m.prototype,"data",{get:function(){return this._internalModel._data}}),m.reopenClass({_create:m.create,create:function(){throw new t.default.Error("You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.")},modelName:null}),t.default.setOwner&&Object.defineProperty(m.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),m.reopenClass(d.RelationshipsClassMethodsMixin),m.reopenClass(l.AttrClassMethodsMixin),e.default=m.extend(n.default,o.BelongsToMixin,d.DidDefinePropertyMixin,d.RelationshipsInstanceMethodsMixin,s.HasManyMixin,l.AttrInstanceMethodsMixin)}),t("ember-data/-private/system/model/states",["exports","ember-data/-private/debug"],function(e,t){function r(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArraysLater()}function i(e){var t={},r=void 0;for(var a in e)r=e[a],r&&"object"==typeof r?t[a]=i(r):t[a]=r;return t}function a(e,t){for(var r in t)e[r]=t[r];return e}function n(e){var t=i(l);return a(t,e)}function o(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function s(e){}function d(e,t,r){e=a(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var i in e)e.hasOwnProperty(i)&&"parentState"!==i&&"stateName"!==i&&"object"==typeof e[i]&&(e[i]=d(e[i],e,r+"."+i));return e}var l={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:r,loadingData:function(){},propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:function(){},willCommit:function(e){e.transitionTo("inFlight")},reloadRecord:function(e,t){t(e.store.reloadRecord(e))},rolledBack:function(e){e.transitionTo("loaded.saved")},becameInvalid:function(e){e.transitionTo("invalid")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")}},inFlight:{isSaving:!0,didSetProperty:r,becomeDirty:function(){},pushedData:function(){},unloadRecord:s,willCommit:function(){},didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",this.dirtyType)},becameInvalid:function(e){e.transitionTo("invalid"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)}},invalid:{isValid:!1,deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),r(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},pushedData:function(){},willCommit:function(e){e.clearErrorMessages(),e.transitionTo("inFlight")},rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")},invokeLifecycleCallbacks:function(e){e.triggerLater("becameInvalid",e)}}},u=n({dirtyType:"created",isNew:!0});u.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},u.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var c=n({dirtyType:"updated"});u.uncommitted.deleteRecord=o,u.invalid.deleteRecord=o,u.uncommitted.rollback=function(e){l.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},u.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},u.uncommitted.propertyWasReset=function(){},c.inFlight.unloadRecord=s,c.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var h={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:function(){},unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},propertyWasReset:function(){},empty:{isEmpty:!0,loadingData:function(e,t){e._loadingPromise=t,e.transitionTo("loading")},loadedData:function(e){e.transitionTo("loaded.created.uncommitted"),e.triggerLater("ready")},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready")}},loading:{isLoading:!0,exit:function(e){e._loadingPromise=null},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready"),e.didCleanError()},becameError:function(e){e.triggerLater("becameError",e)},notFound:function(e){e.transitionTo("empty")}},loaded:{initialState:"saved",isLoaded:!0,loadingData:function(){},saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:r,pushedData:function(){},becomeDirty:function(e){e.transitionTo("updated.uncommitted")},willCommit:function(e){e.transitionTo("updated.inFlight")},reloadRecord:function(e,t){t(e.store.reloadRecord(e))},deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},didCommit:function(){},notFound:function(){}},created:u,updated:c},deleted:{initialState:"uncommitted",dirtyType:"deleted",isDeleted:!0,isLoaded:!0,isDirty:!0,setup:function(e){e.updateRecordArrays()},uncommitted:{willCommit:function(e){e.transitionTo("inFlight")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")},pushedData:function(){},becomeDirty:function(){},deleteRecord:function(){},rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:s,willCommit:function(){},didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)},becameInvalid:function(e){e.transitionTo("invalid"),e.triggerLater("becameInvalid",e)}},saved:{isDirty:!1,setup:function(e){e.clearRelationships();var t=e.store;t._dematerializeRecord(e)},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:function(){},didCommit:function(){}},invalid:{isValid:!1,didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),r(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},deleteRecord:function(){},willCommit:function(){},rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")}}},invokeLifecycleCallbacks:function(e,t){"created"===t?e.triggerLater("didCreate",e):e.triggerLater("didUpdate",e),e.triggerLater("didCommit",e)}};e.default=d(h,null,"root")}),t("ember-data/-private/system/normalize-link",["exports"],function(e){function t(e){switch(typeof e){case"object":return e;case"string":return{href:e}}return null}e.default=t}),t("ember-data/-private/system/normalize-model-name",["exports","ember"],function(e,t){function r(e){return t.default.String.dasherize(e)}e.default=r}),t("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e.default=r;var i=t.default.OrderedSet,a=t.default.guidFor;r.create=function(){var e=this;return new e},r.prototype=Object.create(i.prototype),r.prototype.constructor=r,r.prototype._super$constructor=i,r.prototype.addWithIndex=function(e,t){var r=a(e),i=this.presenceSet,n=this.list;if(i[r]!==!0)return i[r]=!0,void 0===t||null===t?n.push(e):n.splice(t,0,e),this.size+=1,this}}),t("ember-data/-private/system/promise-proxies",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t){return u.create({promise:d.resolve(e,t)})}function a(e,t){return l.create({promise:d.resolve(e,t)})}function n(e){return function(){var t;return(t=s(this,"content"))[e].apply(t,arguments)}}function o(e,t){return c.create({promise:d.resolve(e,t)})}e.promiseObject=i,e.promiseArray=a,e.proxyToContent=n,e.promiseManyArray=o;var s=t.default.get,d=t.default.RSVP.Promise,l=t.default.ArrayProxy.extend(t.default.PromiseProxyMixin);e.PromiseArray=l;var u=t.default.ObjectProxy.extend(t.default.PromiseProxyMixin);e.PromiseObject=u;var c=l.extend({reload:function(){return c.create({promise:s(this,"content").reload()})},createRecord:n("createRecord"),on:n("on"),one:n("one"),trigger:n("trigger"),off:n("off"),has:n("has")});e.PromiseManyArray=c}),t("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays","ember-data/-private/system/ordered-set"],function(e,t,r,i){function a(e){e.destroy()}function n(e){for(var t=e.length,r=[],i=0;i<t;i++)r=r.concat(e[i]);return r}function o(e,t){var r=e.indexOf(t);return r!==-1&&(e.splice(r,1),!0)}var s=t.default.get,d=t.default.MapWithDefault,l=t.default.run;e.default=t.default.Object.extend({init:function(){var e=this;this.filteredRecordArrays=d.create({defaultValue:function(){return[]}}),this.liveRecordArrays=d.create({defaultValue:function(t){return e.createRecordArray(t)}}),this.changedRecords=[],this._adapterPopulatedRecordArrays=[]},recordDidChange:function(e){1===this.changedRecords.push(e)&&l.schedule("actions",this,this.updateRecordArrays)},recordArraysForRecord:function(e){return e._recordArrays=e._recordArrays||i.default.create(),e._recordArrays},updateRecordArrays:function(){var e=this;this.changedRecords.forEach(function(t){t.isDestroyed||"root.deleted.saved"===t.currentState.stateName?e._recordWasDeleted(t):e._recordWasChanged(t)}),this.changedRecords.length=0},_recordWasDeleted:function(e){var t=e._recordArrays;t&&(t.forEach(function(t){return t._removeInternalModels([e])}),e._recordArrays=null)},_recordWasChanged:function(e){var t=this,r=e.type,i=this.filteredRecordArrays.get(r),a=void 0;i.forEach(function(i){a=s(i,"filterFunction"),t.updateFilterRecordArray(i,a,r,e)})},recordWasLoaded:function(e){var t=this,r=e.type,i=this.filteredRecordArrays.get(r),a=void 0;if(i.forEach(function(i){a=s(i,"filterFunction"),t.updateFilterRecordArray(i,a,r,e)}),this.liveRecordArrays.has(r)){var n=this.liveRecordArrays.get(r);this._addInternalModelToRecordArray(n,e)}},updateFilterRecordArray:function(e,t,r,i){var a=t(i.getRecord()),n=this.recordArraysForRecord(i);a?this._addInternalModelToRecordArray(e,i):(n.delete(e),e._removeInternalModels([i]))},_addInternalModelToRecordArray:function(e,t){var r=this.recordArraysForRecord(t);r.has(e)||(e._pushInternalModels([t]),r.add(e))},syncLiveRecordArray:function(e,t){var r=0===this.changedRecords.length,i=this.store.typeMapFor(t),a=i.records.length===e.length;r&&a||this.populateLiveRecordArray(e,t)},populateLiveRecordArray:function(e,t){for(var r=this.store.typeMapFor(t),i=r.records,a=void 0,n=0;n<i.length;n++)a=i[n],a.isDeleted()||a.isEmpty()||this._addInternalModelToRecordArray(e,a)},updateFilter:function(e,t,r){for(var i=this.store.typeMapFor(t),a=i.records,n=void 0,o=0;o<a.length;o++)n=a[o],n.isDeleted()||n.isEmpty()||this.updateFilterRecordArray(e,r,t,n)},liveRecordArrayFor:function(e){return this.liveRecordArrays.get(e)},createRecordArray:function(e){return r.RecordArray.create({type:e,content:t.default.A(),store:this.store,isLoaded:!0,manager:this})},createFilteredRecordArray:function(e,i,a){var n=r.FilteredRecordArray.create({query:a,type:e,content:t.default.A(),store:this.store,manager:this,filterFunction:i});return this.registerFilteredRecordArray(n,e,i),n},createAdapterPopulatedRecordArray:function(e,i){var a=r.AdapterPopulatedRecordArray.create({type:e,query:i,content:t.default.A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(a),a},registerFilteredRecordArray:function(e,t,r){var i=this.filteredRecordArrays.get(t);i.push(e),this.updateFilter(e,t,r)},unregisterRecordArray:function(e){var t=e.type,r=this.filteredRecordArrays.get(t),i=o(r,e),a=o(this._adapterPopulatedRecordArrays,e);if(!i&&!a&&this.liveRecordArrays.has(t)){var n=this.liveRecordArrayFor(t);e===n&&this.liveRecordArrays.delete(t)}},willDestroy:function(){this._super.apply(this,arguments),this.filteredRecordArrays.forEach(function(e){return n(e).forEach(a)}),this.liveRecordArrays.forEach(a),this._adapterPopulatedRecordArrays.forEach(a)}})}),t("ember-data/-private/system/record-arrays",["exports","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/record-arrays/filtered-record-array","ember-data/-private/system/record-arrays/adapter-populated-record-array"],function(e,t,r,i){e.RecordArray=t.default,e.FilteredRecordArray=r.default,e.AdapterPopulatedRecordArray=i.default}),t("ember-data/-private/system/record-arrays/adapter-populated-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/clone-null"],function(e,t,r,i){var a=t.default.get;e.default=r.default.extend({init:function(){this.set("content",this.get("content")||t.default.A()),this._super.apply(this,arguments),this.query=this.query||null,this.links=null},replace:function(){var e=a(this,"type").toString();throw new Error("The result of a server query (on "+e+") is immutable.")},_update:function(){var e=a(this,"store"),t=a(this,"type.modelName"),r=a(this,"query");return e._query(t,r,this)},_setInternalModels:function(e,r){var a=this;this.get("content").setObjects(e),this.setProperties({isLoaded:!0,isUpdating:!1,meta:(0,i.default)(r.meta),links:(0,i.default)(r.links)}),e.forEach(function(e){return a.manager.recordArraysForRecord(e).add(a)}),t.default.run.once(this,"trigger","didLoad")}})}),t("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array"],function(e,t,r){var i=t.default.get;e.default=r.default.extend({init:function(){this._super.apply(this,arguments),this.set("filterFunction",this.get("filterFunction")||null),this.isLoaded=!0},replace:function(){var e=i(this,"type").toString();throw new Error("The result of a client-side filter (on "+e+") is immutable.")},_updateFilter:function(){i(this,"isDestroying")||i(this,"isDestroyed")||i(this,"manager").updateFilter(this,i(this,"type"),i(this,"filterFunction"))},updateFilter:t.default.observer("filterFunction",function(){t.default.run.once(this,this._updateFilter)})})}),t("ember-data/-private/system/record-arrays/record-array",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/snapshot-record-array"],function(e,t,r,i){var a=t.default.get,n=t.default.set,o=t.default.RSVP.Promise;e.default=t.default.ArrayProxy.extend(t.default.Evented,{init:function(){this._super.apply(this,arguments),this.type=this.type||null,this.set("content",this.content||null),this.isLoaded=this.isLoaded||!1,this.isUpdating=!1,this.store=this.store||null,this._updatingPromise=null},replace:function(){var e=a(this,"type").toString();throw new Error("The result of a server query (for all "+e+" types) is immutable. To modify contents, use toArray()")},objectAtContent:function(e){var t=a(this,"content").objectAt(e);return t&&t.getRecord()},update:function(){var e=this;if(a(this,"isUpdating"))return this._updatingPromise;this.set("isUpdating",!0);var t=this._update().finally(function(){e._updatingPromise=null,e.get("isDestroying")||e.get("isDestroyed")||e.set("isUpdating",!1)});return this._updatingPromise=t,t},_update:function(){var e=a(this,"store"),t=a(this,"type.modelName");return e.findAll(t,{reload:!0})},_pushInternalModels:function(e){a(this,"content").pushObjects(e)},_removeInternalModels:function(e){a(this,"content").removeObjects(e)},save:function(){var e=this,t="DS: RecordArray#save "+a(this,"type"),i=o.all(this.invoke("save"),t).then(function(){return e},null,"DS: RecordArray#save return RecordArray");return r.PromiseArray.create({promise:i})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t._recordArrays;r&&r.delete(e)})},_unregisterFromManager:function(){a(this,"manager").unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),n(this,"content",null),n(this,"length",0),this._super.apply(this,arguments)},_createSnapshot:function(e){return new i.default(this,this.get("meta"),e)},_takeSnapshot:function(){return a(this,"content").map(function(e){return e.createSnapshot()})}})}),t("ember-data/-private/system/references",["exports","ember-data/-private/system/references/record","ember-data/-private/system/references/belongs-to","ember-data/-private/system/references/has-many"],function(e,t,r,i){e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=i.default}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/model","ember","ember-data/-private/system/references/reference","ember-data/-private/features","ember-data/-private/debug"],function(e,t,r,i,a,n){var o=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};o.prototype=Object.create(i.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=i.default,o.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},o.prototype.id=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.id},o.prototype.link=function(){return this.belongsToRelationship.link},o.prototype.meta=function(){return this.belongsToRelationship.meta},o.prototype.push=function(e){var i=this;return r.default.RSVP.resolve(e).then(function(e){var r;return r=e instanceof t.default?e:i.store.push(e),i.belongsToRelationship.setCanonicalRecord(r._internalModel),r})},o.prototype.value=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.isLoaded()?e.getRecord():null},o.prototype.load=function(){var e=this;return"id"===this.remoteType()?this.belongsToRelationship.getRecord():"link"===this.remoteType()?this.belongsToRelationship.findLink().then(function(t){return e.value()}):void 0},o.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=o}),t("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i,a){var n=t.default.RSVP.resolve,o=t.default.get,s=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};s.prototype=Object.create(r.default.prototype),s.prototype.constructor=s,s.prototype._super$constructor=r.default,s.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},s.prototype.link=function(){return this.hasManyRelationship.link},s.prototype.ids=function(){var e=this.hasManyRelationship.members.toArray();return e.map(function(e){return e.id})},s.prototype.meta=function(){return this.hasManyRelationship.meta},s.prototype.push=function(e){var r=this;return n(e).then(function(e){var i=e,a=!0;"object"==typeof e&&e.data&&(i=e.data,a=i.length&&i[0].data),a=!0;var n=void 0;if(a)n=i.map(function(e){var t=r.store.push(e);return t._internalModel});else{var o=r.store.push(e);n=t.default.A(o).mapBy("_internalModel")}return r.hasManyRelationship.computeChanges(n),r.hasManyRelationship.getManyArray()})},s.prototype._isLoaded=function(){var e=o(this.hasManyRelationship,"hasData");if(!e)return!1;var t=this.hasManyRelationship.members.toArray();return t.every(function(e){return e.isLoaded()===!0})},s.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.getManyArray():null},s.prototype.load=function(){return this._isLoaded()?n(this.hasManyRelationship.getManyArray()):this.hasManyRelationship.getRecords()},s.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=s}),t("ember-data/-private/system/references/record",["exports","ember","ember-data/-private/system/references/reference"],function(e,t,r){var i=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};i.prototype=Object.create(r.default.prototype),i.prototype.constructor=i,i.prototype._super$constructor=r.default,i.prototype.id=function(){return this._id},i.prototype.remoteType=function(){return"identity"},i.prototype.push=function(e){var r=this;return t.default.RSVP.resolve(e).then(function(e){return r.store.push(e)})},i.prototype.value=function(){return this.internalModel.record},i.prototype.load=function(){return this.store.findRecord(this.type,this._id)},i.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e.default=i}),t("ember-data/-private/system/references/reference",["exports"],function(e){var t=function(e,t){this.store=e,this.internalModel=t};t.prototype={constructor:t},e.default=t}),t("ember-data/-private/system/relationship-meta",["exports","ember-inflector","ember-data/-private/system/normalize-model-name"],function(e,t,r){function i(e){var i;return i=e.type||e.key,"hasMany"===e.kind&&(i=(0,t.singularize)((0,r.default)(i))),i}function a(e){return{key:e.key,kind:e.kind,type:i(e),options:e.options,name:e.name,parentType:e.parentType,isRelationship:!0}}e.typeForRelationshipMeta=i,e.relationshipFromMeta=a}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name"],function(e,t,r,i){function a(e,r){var a,n;"object"==typeof e?(a=e,n=void 0):(a=r,n=e),"string"==typeof n&&(n=(0,i.default)(n)),a=a||{};var o={type:n,isRelationship:!0,options:a,kind:"belongsTo",name:"Belongs To",key:null};return t.default.computed({get:function(e){return a.hasOwnProperty("serialize"),a.hasOwnProperty("embedded"),this._internalModel._relationships.get(e).getRecord()},set:function(e,t){return void 0===t&&(t=null),t&&t.then?this._internalModel._relationships.get(e).setRecordPromise(t):t?this._internalModel._relationships.get(e).setRecord(t._internalModel):this._internalModel._relationships.get(e).setRecord(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.default=a;var n=t.default.Mixin.create({notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)}});e.BelongsToMixin=n}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/debug","ember-data/-private/system/relationship-meta","ember-data/-private/system/empty-object"],function(e,t,r,i,a){var n=t.default.get,o=t.default.Map,s=t.default.MapWithDefault,d=t.default.computed(function(){t.default.testing===!0&&d._cacheable===!0&&(d._cacheable=!1);var e=new s({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var a=e.get((0,i.typeForRelationshipMeta)(r));a.push({name:t,kind:r.kind})}}),e}).readOnly(),l=t.default.computed(function(){t.default.testing===!0&&l._cacheable===!0&&(l._cacheable=!1);var e,r=t.default.A();return this.eachComputedProperty(function(t,a){a.isRelationship&&(a.key=t,e=(0,i.typeForRelationshipMeta)(a),r.includes(e)||r.push(e))}),r}).readOnly(),u=t.default.computed(function(){t.default.testing===!0&&u._cacheable===!0&&(u._cacheable=!1);var e=o.create();return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var a=(0,i.relationshipFromMeta)(r);a.type=(0,i.typeForRelationshipMeta)(r),e.set(t,a)}}),e}).readOnly(),c=t.default.Mixin.create({didDefineProperty:function(e,r,i){if(i instanceof t.default.ComputedProperty){var a=i.meta();a.parentType=e.constructor}}});e.DidDefinePropertyMixin=c;var h=t.default.Mixin.create({typeForRelationship:function(e,t){var r=n(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t.default.computed(function(){return new a.default}),inverseFor:function(e,t){var r=n(this,"inverseMap");if(r[e])return r[e];var i=this._findInverseFor(e,t);return r[e]=i,i},_findInverseFor:function(e,r){function i(t,r,a){var o=a||[],s=n(r,"relationships");if(!s)return o;var d=s.get(t.modelName);return d=d.filter(function(t){var i=r.metaForProperty(t.name).options;return!i.inverse||e===i.inverse}),d&&o.push.apply(o,d),t.superclass&&i(t.superclass,r,o),o}var a=this.typeForRelationship(e,r);if(!a)return null;var o=this.metaForProperty(e),s=o.options;if(null===s.inverse)return null;var d,l,u;if(s.inverse)d=s.inverse,u=t.default.get(a,"relationshipsByName").get(d),l=u.kind;else{o.type===o.parentType.modelName;var c=i(this,a);if(0===c.length)return null;var h=c.filter(function(t){var r=a.metaForProperty(t.name).options;return e===r.inverse});1===h.length&&(c=h),d=c[0].name,l=c[0].kind}return{type:a,name:d,kind:l}},relationships:d,relationshipNames:t.default.computed(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:l,relationshipsByName:u,fields:t.default.computed(function(){var e=o.create();return this.eachComputedProperty(function(t,r){r.isRelationship?e.set(t,r.kind):r.isAttribute&&e.set(t,"attribute")}),e}).readOnly(),eachRelationship:function(e,t){n(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=n(this,"relatedTypes"),i=0;i<r.length;i++){var a=r[i];e.call(t,a)}},determineRelationshipType:function(e,t){var r=e.key,i=e.kind,a=this.inverseFor(r,t),n=void 0;return a?(n=a.kind,"belongsTo"===n?"belongsTo"===i?"oneToOne":"manyToOne":"belongsTo"===i?"oneToMany":"manyToMany"):"belongsTo"===i?"oneToNone":"manyToNone"}});e.RelationshipsClassMethodsMixin=h;var f=t.default.Mixin.create({eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return n(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)}});e.RelationshipsInstanceMethodsMixin=f}),t("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,i,a){function n(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,i.default)(e));var a={type:e,isRelationship:!0,options:r,kind:"hasMany",name:"Has Many",key:null};return t.default.computed({get:function(e){var t=this._internalModel._relationships.get(e);return t.getRecords()},set:function(e,r){var i=this._internalModel._relationships.get(e);return i.clear(),i.addRecords(t.default.A(r).mapBy("_internalModel")),i.getRecords()}}).meta(a)}e.default=n;var o=t.default.Mixin.create({notifyHasManyAdded:function(e){this.notifyPropertyChange(e)}});e.HasManyMixin=o}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i,a){function n(e,t,r,i){this._super$constructor(e,t,r,i),this.record=t,this.key=i.key,this.inverseRecord=null,this.canonicalState=null}e.default=n,n.prototype=Object.create(a.default.prototype),n.prototype.constructor=n,n.prototype._super$constructor=a.default,n.prototype.setRecord=function(e){e?this.addRecord(e):this.inverseRecord&&this.removeRecord(this.inverseRecord),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype.setCanonicalRecord=function(e){e?this.addCanonicalRecord(e):this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.flushCanonicalLater()},n.prototype._super$addCanonicalRecord=a.default.prototype.addCanonicalRecord,n.prototype.addCanonicalRecord=function(e){this.canonicalMembers.has(e)||(this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.canonicalState=e,this._super$addCanonicalRecord(e))},n.prototype._super$flushCanonical=a.default.prototype.flushCanonical,n.prototype.flushCanonical=function(){this.inverseRecord&&this.inverseRecord.isNew()&&!this.canonicalState||(this.inverseRecord!==this.canonicalState&&(this.inverseRecord=this.canonicalState,this.record.notifyBelongsToChanged(this.key)),this._super$flushCanonical())},n.prototype._super$addRecord=a.default.prototype.addRecord,n.prototype.addRecord=function(e){this.members.has(e)||(this.inverseRecord&&this.removeRecord(this.inverseRecord),this.inverseRecord=e,this._super$addRecord(e),this.record.notifyBelongsToChanged(this.key))},n.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setRecord(t?t._internalModel:t)},n.prototype._super$removeRecordFromOwn=a.default.prototype.removeRecordFromOwn,n.prototype.removeRecordFromOwn=function(e){this.members.has(e)&&(this.inverseRecord=null,this._super$removeRecordFromOwn(e),this.record.notifyBelongsToChanged(this.key))},n.prototype._super$removeCanonicalRecordFromOwn=a.default.prototype.removeCanonicalRecordFromOwn,n.prototype.removeCanonicalRecordFromOwn=function(e){this.canonicalMembers.has(e)&&(this.canonicalState=null,this._super$removeCanonicalRecordFromOwn(e))},n.prototype.findRecord=function(){return this.inverseRecord?this.store._findByInternalModel(this.inverseRecord):t.default.RSVP.Promise.resolve(null)},n.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.record,this.link,this.relationshipMeta).then(function(t){return t&&e.addRecord(t),t})},n.prototype.getRecord=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),i.PromiseObject.create({promise:t,
|
3
|
-
content:this.inverseRecord?this.inverseRecord.getRecord():null})}if(null===this.inverseRecord)return null;var r=this.inverseRecord.getRecord();return r},n.prototype.reload=function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.hasRecord?this.inverseRecord.record.reload():this.findRecord()},n.prototype.updateData=function(e){var t=this.store._pushResourceIdentifier(this,e);this.setCanonicalRecord(t)}}),t("ember-data/-private/system/relationships/state/create",["exports","ember","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to","ember-data/-private/system/empty-object"],function(e,t,r,i,a){function n(e){var t=e.options;return!(t&&null===t.inverse)}function o(e,t,a){var o=void 0,s=null;return n(t)&&(s=e.type.inverseFor(t.key,a)),s&&(o=s.name),"hasMany"===t.kind?new r.default(a,e,o,t):new i.default(a,e,o,t)}function s(e){this.record=e,this.initializedRelationships=new a.default}e.default=s;var d=t.default.get;s.prototype.has=function(e){return!!this.initializedRelationships[e]},s.prototype.get=function(e){var t=this.initializedRelationships,r=d(this.record.type,"relationshipsByName");return!t[e]&&r.get(e)&&(t[e]=o(this.record,r.get(e),this.record.store)),t[e]}}),t("ember-data/-private/system/relationships/state/has-many",["exports","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/ordered-set","ember-data/-private/system/many-array"],function(e,t,r,i,a,n){function o(e,t,r,i){this._super$constructor(e,t,r,i),this.belongsToType=i.type,this.canonicalState=[],this.isPolymorphic=i.options.polymorphic}function s(e){var t=new a.default;if(e)for(var r=0,i=e.length;r<i;r++)t.add(e[r]);return t}e.default=o,o.prototype=Object.create(i.default.prototype),o.prototype.getManyArray=function(){return this._manyArray||(this._manyArray=n.default.create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:this.record,meta:this.meta,isPolymorphic:this.isPolymorphic})),this._manyArray},o.prototype.constructor=o,o.prototype._super$constructor=i.default,o.prototype.destroy=function(){this._manyArray&&this._manyArray.destroy()},o.prototype._super$updateMeta=i.default.prototype.updateMeta,o.prototype.updateMeta=function(e){this._super$updateMeta(e),this._manyArray&&this._manyArray.set("meta",e)},o.prototype._super$addCanonicalRecord=i.default.prototype.addCanonicalRecord,o.prototype.addCanonicalRecord=function(e,t){this.canonicalMembers.has(e)||(void 0!==t?this.canonicalState.splice(t,0,e):this.canonicalState.push(e),this._super$addCanonicalRecord(e,t))},o.prototype._super$addRecord=i.default.prototype.addRecord,o.prototype.addRecord=function(e,t){this.members.has(e)||(this._super$addRecord(e,t),this.getManyArray().internalAddRecords([e],t))},o.prototype._super$removeCanonicalRecordFromOwn=i.default.prototype.removeCanonicalRecordFromOwn,o.prototype.removeCanonicalRecordFromOwn=function(e,t){var r=t;this.canonicalMembers.has(e)&&(void 0===r&&(r=this.canonicalState.indexOf(e)),r>-1&&this.canonicalState.splice(r,1),this._super$removeCanonicalRecordFromOwn(e,t))},o.prototype._super$flushCanonical=i.default.prototype.flushCanonical,o.prototype.flushCanonical=function(){this._manyArray&&this._manyArray.flushCanonical(),this._super$flushCanonical()},o.prototype._super$removeRecordFromOwn=i.default.prototype.removeRecordFromOwn,o.prototype.removeRecordFromOwn=function(e,t){if(this.members.has(e)){this._super$removeRecordFromOwn(e,t);var r=this.getManyArray();void 0!==t?r.currentState.removeAt(t):r.internalRemoveRecords([e])}},o.prototype.notifyRecordRelationshipAdded=function(e,t){this.record.notifyHasManyAdded(this.key,e,t)},o.prototype.reload=function(){var e=this.getManyArray(),t=e.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&e.set("isLoaded",t)}return this.link?(this._loadingPromise=(0,r.promiseManyArray)(this.fetchLink(),"Reload with link"),this._loadingPromise):(this._loadingPromise=(0,r.promiseManyArray)(this.store._scheduleFetchMany(e.currentState).then(function(){return e}),"Reload with ids"),this._loadingPromise)},o.prototype.computeChanges=function(e){var t,r,i,a=this.canonicalMembers,n=[];for(e=s(e),a.forEach(function(t){e.has(t)||n.push(t)}),this.removeCanonicalRecords(n),e=e.toArray(),t=e.length,i=0;i<t;i++)r=e[i],this.removeCanonicalRecord(r),this.addCanonicalRecord(r,i)},o.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.record,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateRecordsFromAdapter(t),e.getManyArray().set("isLoaded",!0)}),e.getManyArray()})},o.prototype.findRecords=function(){for(var e=this.getManyArray(),t=e.toArray(),r=new Array(t.length),i=0;i<t.length;i++)r[i]=t[i]._internalModel;return this.store.findMany(r).then(function(){return e.get("isDestroyed")||e.set("isLoaded",!0),e})},o.prototype.notifyHasManyChanged=function(){this.record.notifyHasManyAdded(this.key)},o.prototype.getRecords=function(){var e=this,t=this.getManyArray();if(this.isAsync){var i;return i=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._loadingPromise=r.PromiseManyArray.create({content:t,promise:i}),this._loadingPromise}return t.get("isDestroyed")||t.set("isLoaded",!0),t},o.prototype.updateData=function(e){var t=this.store._pushResourceIdentifiers(this,e);this.updateRecordsFromAdapter(t)}}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember-data/-private/debug","ember-data/-private/system/ordered-set","ember-data/-private/system/normalize-link"],function(e,t,r,i){function a(e,t,i,a){var n=a.options.async;this.members=new r.default,this.canonicalMembers=new r.default,this.store=e,this.key=a.key,this.inverseKey=i,this.record=t,this.isAsync="undefined"==typeof n||n,this.relationshipMeta=a,this.inverseKeyForImplicit=this.record.constructor.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}e.default=a,a.prototype={constructor:a,destroy:function(){},updateMeta:function(e){this.meta=e},clear:function(){for(var e,t=this.members.list;t.length>0;)e=t[0],this.removeRecord(e)},removeRecords:function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})},addRecords:function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})},addCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])},addCanonicalRecord:function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.inverseKey?e._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new a(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)},removeCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])},removeCanonicalRecord:function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalRecordFromOwn(e),this.inverseKey?this.removeCanonicalRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecord(this.record)),this.flushCanonicalLater()},addRecord:function(e,t){this.members.has(e)||(this.members.addWithIndex(e,t),this.notifyRecordRelationshipAdded(e,t),this.inverseKey?e._relationships.get(this.inverseKey).addRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new a(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArraysLater()),this.setHasData(!0)},removeRecord:function(e){this.members.has(e)&&(this.removeRecordFromOwn(e),this.inverseKey?this.removeRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeRecord(this.record))},removeRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)},removeRecordFromOwn:function(e){this.members.delete(e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()},removeCanonicalRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)},removeCanonicalRecordFromOwn:function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},flushCanonical:function(){this.willSync=!1;for(var e=[],t=0;t<this.members.list.length;t++)this.members.list[t].isNew()&&e.push(this.members.list[t]);for(this.members=this.canonicalMembers.copy(),t=0;t<e.length;t++)this.members.add(e[t])},flushCanonicalLater:function(){var e=this;this.willSync||(this.willSync=!0,this.store._backburner.join(function(){return e.store._backburner.schedule("syncRelationships",e,e.flushCanonical)}))},updateLink:function(e){this.link=e,this.linkPromise=null,this.record.notifyPropertyChange(this.key)},findLink:function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},updateRecordsFromAdapter:function(e){this.computeChanges(e)},notifyRecordRelationshipAdded:function(){},notifyRecordRelationshipRemoved:function(){},setHasData:function(e){this.hasData=e},setHasLoaded:function(e){this.hasLoaded=e},push:function(e){var t=!1,r=!1;if(e.meta&&this.updateMeta(e.meta),void 0!==e.data&&(t=!0,this.updateData(e.data)),e.links&&e.links.related){var a=(0,i.default)(e.links.related);a&&a.href&&a.href!==this.link&&(r=!0,this.updateLink(a.href))}t?(this.setHasData(!0),this.setHasLoaded(!0)):r&&this.setHasLoaded(!1)},updateData:function(){}}}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){function t(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this.type=e.get("type"),this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}e.default=t,t.prototype.snapshots=function(){return null!==this._snapshots?this._snapshots:(this._snapshots=this._recordArray._takeSnapshot(),this._snapshots)}}),t("ember-data/-private/system/snapshot",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){function i(e){var t=this,i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this._attributes=new r.default,this._belongsToRelationships=new r.default,this._belongsToIds=new r.default,this._hasManyRelationships=new r.default,this._hasManyIds=new r.default;var n=e.getRecord();this.record=n,n.eachAttribute(function(e){return t._attributes[e]=a(n,e)}),this.id=e.id,this._internalModel=e,this.type=e.type,this.modelName=e.type.modelName,this.adapterOptions=i.adapterOptions,this.include=i.include,this._changedAttributes=n.changedAttributes()}e.default=i;var a=t.default.get;i.prototype={constructor:i,id:null,record:null,type:null,modelName:null,attr:function(e){if(e in this._attributes)return this._attributes[e];throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no attribute named '"+e+"' defined.")},attributes:function(){return t.default.copy(this._attributes)},changedAttributes:function(){for(var e=new r.default,i=Object.keys(this._changedAttributes),a=0,n=i.length;a<n;a++){var o=i[a];e[o]=t.default.copy(this._changedAttributes[o])}return e},belongsTo:function(e,r){var i,n,o,s,d=r&&r.id;if(d&&e in this._belongsToIds)return this._belongsToIds[e];if(!d&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(i=this._internalModel._relationships.get(e),!i||"belongsTo"!==i.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return o=a(i,"hasData"),n=a(i,"inverseRecord"),o&&(s=n&&!n.isDeleted()?d?a(n,"id"):n.createSnapshot():null),d?this._belongsToIds[e]=s:this._belongsToRelationships[e]=s,s},hasMany:function(e,r){var i,n,o,s,d=r&&r.ids;if(d&&e in this._hasManyIds)return this._hasManyIds[e];if(!d&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(i=this._internalModel._relationships.get(e),!i||"hasMany"!==i.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return o=a(i,"hasData"),n=a(i,"members"),o&&(s=[],n.forEach(function(e){e.isDeleted()||(d?s.push(e.id):s.push(e.createSnapshot()))})),d?this._hasManyIds[e]=s:this._hasManyRelationships[e]=s,s},eachAttribute:function(e,t){this.record.eachAttribute(e,t)},eachRelationship:function(e,t){this.record.eachRelationship(e,t)},serialize:function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)}}}),t("ember-data/-private/system/store",["exports","ember","ember-data/model","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/adapters/errors","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers","ember-data/-private/system/store/finders","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/system/record-array-manager","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/model/internal-model","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,f,p,m,y,v){function b(e,t){var r=e.then(function(e){return e.getRecord()});return(0,o.promiseObject)(r,t)}function g(e){return e.serializerFor("application")}function R(e,t,r,i){var a=i._internalModel,o=i.modelName,u=t.modelFor(o),c=e[r](t,u,i),h=(0,l.serializerForAdapter)(t,e,o),f="DS: Extract and notify about "+r+" completion of "+a;return c=N.resolve(c,f),c=(0,s._guard)(c,(0,s._bind)(s._objectIsAlive,t)),c=(0,s._guard)(c,(0,s._bind)(s._objectIsAlive,a)),c.then(function(e){return t._adapterRun(function(){var n=void 0,o=void 0;e&&(n=(0,d.normalizeResponseHelper)(h,t,u,e,i.id,r),n.included&&t.push({data:n.included}),o=n.data),t.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof n.InvalidError){var r=h.extractErrors(t,u,e,i.id);t.recordWasInvalid(a,r)}else t.recordWasError(a,e);throw e},f)}function _(e,t,r){r.relationships&&t.type.eachRelationship(function(e,i){if(r.relationships[e]){var a=t._relationships.get(e);a.push(r.relationships[e])}})}var A="`id` passed to `findRecord()` has to be non-empty string or number";e.badIdFormatAssertion=A;var z=t.default.A,F=t.default._Backburner,M=t.default.computed,k=t.default.copy,x=t.default.ENV,S=t.default.Error,T=t.default.get,w=t.default.guidFor,E=(t.default.inspect,t.default.isNone),D=(t.default.isPresent,t.default.MapWithDefault),C=t.default.run,P=t.default.set,O=t.default.RSVP,I=t.default.Service,j=t.default.typeOf,N=O.Promise,L=void 0;e.Store=L=I.extend({init:function(){this._super.apply(this,arguments),this._backburner=new F(["normalizeRelationships","syncRelationships","finished"]),this.typeMaps={},this.recordArrayManager=f.default.create({store:this}),this._pendingSave=[],this._instanceCache=new p.default((0,c.getOwner)(this),this),this._pendingFetch=D.create({defaultValue:function(){return[]}})},adapter:"-json-api",serialize:function(e,t){var r=e._internalModel.createSnapshot();return r.serialize(t)},defaultAdapter:M("adapter",function(){var e=T(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=this.modelFor(e),i=k(t)||new y.default;E(i.id)&&(i.id=this._generateId(e,i)),i.id=(0,h.default)(i.id);var a=this.buildInternalModel(r,i.id),n=a.getRecord();return a.loadedData(),n.setProperties(i),a.eachRelationship(function(e,t){a._relationships.get(e).setHasData(!0)}),n},_generateId:function(e,t){var r=this.adapterFor(e);return r&&r.generateIdForRecord?r.generateIdForRecord(this,e,t):null},deleteRecord:function(e){e.deleteRecord()},unloadRecord:function(e){e.unloadRecord()},find:function(e,t,r){return 1===arguments.length,"object"===j(t),this.findRecord(e,t)},findRecord:function(e,t,r){var i=this._internalModelForId(e,t);if(r=r||{},!this.hasRecordForId(e,t))return this._findByInternalModel(i,r);var a=this._findRecord(i,r);return b(a,"DS: Store#findRecord "+i.typeKey+" with id: "+T(i,"id"))},_findRecord:function(e,t){if(t.reload)return this._scheduleFetch(e,t);var r=e.createSnapshot(t),i=e.type,a=this.adapterFor(i.modelName);return a.shouldReloadRecord(this,r)?this._scheduleFetch(e,t):t.backgroundReload===!1?N.resolve(e):((t.backgroundReload||a.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),N.resolve(e))},_findByInternalModel:function(e,t){t=t||{},t.preload&&e.preloadData(t.preload);var r=this._findEmptyInternalModel(e,t);return b(r,"DS: Store#findRecord "+e.typeKey+" with id: "+T(e,"id"))},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this._scheduleFetch(e,t):e.isLoading()?e._loadingPromise:N.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=this.findRecord(e,t[i]);return(0,o.promiseArray)(O.all(r).then(z,null,"DS: Store#findByIds of "+e+" complete"))},_fetchRecord:function(e,t){var r=e.type,i=e.id,a=this.adapterFor(r.modelName);return(0,u._find)(a,this,r,i,e,t)},_scheduleFetchMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._scheduleFetch(e[r]);return N.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.type,i=O.defer("Fetching "+r.modelName+" with id: "+e.id),a={internalModel:e,resolver:i,options:t},n=i.promise;return e.loadingData(n),this._pendingFetch.get(r).push(a),C.scheduleOnce("afterRender",this,this.flushAllPendingFetches),n},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch.clear())},_flushPendingFetchForType:function(e,t){function r(e){var t=n._fetchRecord(e.internalModel,e.options);e.resolver.resolve(t)}function i(e,t){for(var r=new y.default,i=0,n=e.length;i<n;i++){var o=e[i],s=c[o.id];if(r[o.id]=o,s){var d=s.resolver;d.resolve(o)}}for(var l=[],i=0,n=t.length;i<n;i++){var o=t[i];r[o.id]||l.push(o)}l.length&&a(l)}function a(e,t){for(var r=0,i=e.length;r<i;r++){var a=c[e[r].id];a&&a.resolver.reject(t)}}for(var n=this,o=n.adapterFor(t.modelName),s=!!o.findMany&&o.coalesceFindRequests,d=e.length,l=new Array(d),c=new y.default,h=0;h<d;h++){var f=e[h],p=f.internalModel;l[h]=p,c[p.id]=f}if(s){for(var m=new Array(d),h=0;h<d;h++)m[h]=l[h].createSnapshot();for(var v=o.groupRecordsForFindMany(this,m),b=function(e,s){for(var d=v[e],l=v[e].length,h=new Array(l),f=new Array(l),p=0;p<l;p++){var m=d[p]._internalModel;f[p]=m,h[p]=m.id}if(l>1)(0,u._findMany)(o,n,t,h,f).then(function(e){i(e,f)}).catch(function(e){a(f,e)});else if(1===h.length){var y=c[f[0].id];r(y)}},h=0,g=v.length;h<g;h++)b(h,g)}else for(var h=0;h<d;h++)r(e[h])},getReference:function(e,t){return this._internalModelForId(e,t).recordReference},peekRecord:function(e,t){return this.hasRecordForId(e,t)?this._internalModelForId(e,t).getRecord():null},reloadRecord:function(e){var t=e.type.modelName;this.adapterFor(t),e.id;return this._scheduleFetch(e)},hasRecordForId:function(e,t){var r=(0,h.default)(t),i=this.modelFor(e),a=this.typeMapFor(i).idToRecord[r];return!!a&&a.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=this.modelFor(e),i=(0,h.default)(t),a=this.typeMapFor(r).idToRecord,n=a[i];return n&&a[i]||(n=this.buildInternalModel(r,i)),n},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findByInternalModel(e[r]);return N.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.type.modelName);return(0,u._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.type.modelName);return(0,u._findBelongsTo)(i,this,e,t,r)},query:function(e,t){return this._query(e,t)},_query:function(e,t,r){var i=this.modelFor(e);r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(i,t);var a=this.adapterFor(e),n=(0,o.promiseArray)((0,u._query)(a,this,i,t,r));return n},queryRecord:function(e,t){var r=this.modelFor(e),i=this.adapterFor(e);return(0,o.promiseObject)((0,u._queryRecord)(i,this,r,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=this.modelFor(e),i=this._fetchAll(r,this.peekAll(e),t);return i},_fetchAll:function(e,t,r){r=r||{};var i=this.adapterFor(e.modelName),a=this.typeMapFor(e).metadata.since;if(r.reload)return P(t,"isUpdating",!0),(0,o.promiseArray)((0,u._findAll)(i,this,e,a,r));var n=t._createSnapshot(r);return i.shouldReloadAll(this,n)?(P(t,"isUpdating",!0),(0,o.promiseArray)((0,u._findAll)(i,this,e,a,r))):r.backgroundReload===!1?(0,o.promiseArray)(N.resolve(t)):((r.backgroundReload||i.shouldBackgroundReloadAll(this,n))&&(P(t,"isUpdating",!0),(0,u._findAll)(i,this,e,a,r)),(0,o.promiseArray)(N.resolve(t)))},didUpdateAll:function(e){var t=this.recordArrayManager.liveRecordArrayFor(e);P(t,"isUpdating",!1)},peekAll:function(e){var t=this.modelFor(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.syncLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length){for(var t=this.typeMaps,r=Object.keys(t),i=new Array(r.length),a=0;a<r.length;a++)i[a]=t[r[a]].type.modelName;i.forEach(this.unloadAll,this)}else{for(var n=this.modelFor(e),o=this.typeMapFor(n),s=o.records.slice(),d=void 0,a=0;a<s.length;a++)d=s[a],d.unloadRecord(),d.destroy();o.metadata=new y.default}},filter:function(e,t,r){!x.ENABLE_DS_FILTER;var i=void 0,a=arguments.length,n=void 0,s=3===a;return s?i=this.query(e,t):2===arguments.length&&(r=t),e=this.modelFor(e),n=s?this.recordArrayManager.createFilteredRecordArray(e,r,t):this.recordArrayManager.createFilteredRecordArray(e,r),i=i||N.resolve(n),(0,o.promiseArray)(i.then(function(){return n},null,"DS: Store#filter of "+e))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},dataWasUpdated:function(e,t){this.recordArrayManager.recordDidChange(t)},scheduleSave:function(e,t,r){var i=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:i,resolver:t}),C.once(this,this.flushPendingSave)},flushPendingSave:function(){var e=this,t=this._pendingSave.slice();this._pendingSave=[],t.forEach(function(t){var r=t.snapshot,i=t.resolver,a=r._internalModel,n=e.adapterFor(a.modelClass.modelName),o=void 0;return"root.deleted.saved"===T(a,"currentState.stateName")?i.resolve():(o=a.isNew()?"createRecord":a.isDeleted()?"deleteRecord":"updateRecord",void i.resolve(R(n,e,o,r)))})},didSaveRecord:function(e,t){var r=void 0;t&&(r=t.data),r&&(this._backburner.schedule("normalizeRelationships",this,this._setupRelationships,e,r),this.updateId(e,r)),e.adapterDidCommit(r)},recordWasInvalid:function(e,t){e.adapterDidInvalidate(t)},recordWasError:function(e,t){e.adapterDidError(t)},updateId:function(e,t){var r=e.id,i=(0,h.default)(t.id);null!==r&&null===i||(this.typeMapFor(e.type).idToRecord[i]=e,e.setId(i))},typeMapFor:function(e){var t=T(this,"typeMaps"),r=w(e),i=t[r];return i?i:(i={idToRecord:new y.default,records:[],metadata:new y.default,type:e},t[r]=i,i)},_load:function(e){var t=this._internalModelForId(e.type,e.id);return t.setupData(e),this.recordArrayManager.recordDidChange(t),t},_modelForMixin:function(e){var t=(0,a.default)(e),i=(0,c.getOwner)(this),n=i._lookupFactory("mixin:"+t);n&&i.register("model:"+t,r.default.extend(n));var o=this.modelFactoryFor(t);return o&&(o.__isMixin=!0,o.__mixin=n),o},modelFor:function(e){var t=this.modelFactoryFor(e);if(t||(t=this._modelForMixin(e)),!t)throw new S("No model was found for '"+e+"'");return t.modelName=t.modelName||(0,a.default)(e),t},modelFactoryFor:function(e){var t=(0,a.default)(e),r=(0,c.getOwner)(this);return r._lookupFactory("model:"+t)},push:function(e){var t=this._push(e);if(Array.isArray(t)){var r=t.map(function(e){return e.getRecord()});return r}if(null===t)return null;var i=t.getRecord();return i},_push:function(e){var t=e.included,r=void 0,i=void 0;if(t)for(r=0,i=t.length;r<i;r++)this._pushInternalModel(t[r]);if(Array.isArray(e.data)){i=e.data.length;var a=new Array(i);for(r=0;r<i;r++)a[r]=this._pushInternalModel(e.data[r]);return a}if(null===e.data)return null;var n=this._pushInternalModel(e.data);return n},_hasModelFor:function(e){return!!(0,c.getOwner)(this)._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=this,r=(e.type,this._load(e));return this._backburner.join(function(){t._backburner.schedule("normalizeRelationships",t,t._setupRelationships,r,e)}),r},_setupRelationships:function(e,t){_(this,e,t)},pushPayload:function(e,t){var r=this,i=void 0,a=void 0;t?(a=t,i=this.serializerFor(e)):(a=e,i=g(this)),this._adapterRun(function(){return i.pushPayload(r,a)})},normalize:function(e,t){var r=this.serializerFor(e),i=this.modelFor(e);return r.normalize(i,t)},buildInternalModel:function(e,t,r){var i=this.typeMapFor(e),a=i.idToRecord,n=new m.default(e,t,this,r);return t&&(a[t]=n),i.records.push(n),n},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_dematerializeRecord:function(e){var t=e.type,r=this.typeMapFor(t),i=e.id;e.updateRecordArrays(),i&&delete r.idToRecord[i];var a=r.records.indexOf(e);r.records.splice(a,1)},adapterFor:function(e){var t=(0,a.default)(e);return this._instanceCache.get("adapter",t)},_adapterRun:function(e){return this._backburner.run(e)},serializerFor:function(e){var t=(0,a.default)(e);return this._instanceCache.get("serializer",t)},lookupAdapter:function(e){return this.adapterFor(e)},lookupSerializer:function(e){return this.serializerFor(e)},willDestroy:function(){this._super.apply(this,arguments),this.recordArrayManager.destroy(),this._instanceCache.destroy(),this.unloadAll()},_pushResourceIdentifier:function(e,t){if(!E(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!E(t)){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=this._pushResourceIdentifier(e,t[i]);return r}}}),e.Store=L,e.default=L}),t("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(void 0,t)}}function i(e,t){var r=e.finally(function(){t()||(r._subscribers.length=0)});return r}function a(e){return!(n(e,"isDestroyed")||n(e,"isDestroying"))}e._bind=r,e._guard=i,e._objectIsAlive=a;var n=t.default.get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),a=t.default.set,n=function(){function e(e,t){this._owner=e,this._store=t,this._namespaces={adapter:new r.default,serializer:new r.default}}return i(e,[{key:"get",value:function(e,t){var r=this._namespaces[e];if(r[t])return r[t];var i=e+":"+t,n=this._instanceFor(i)||this._findInstance(e,this._fallbacksFor(e,t));return n&&(r[t]=n,a(n,"store",this._store)),r[t]}},{key:"_fallbacksFor",value:function(e,t){return"adapter"===e?["application",this._store.get("adapter"),"-json-api"]:["application",this.get("adapter",t).get("defaultSerializer"),"-default"]}},{key:"_findInstance",value:function(e,t){for(var r=this._namespaces[e],i=0,a=t.length;i<a;i++){var n=t[i];if(r[n])return r[n];var o=e+":"+n,s=this._instanceFor(o);if(s)return r[n]=s,s}}},{key:"_instanceFor",value:function(e){return this._owner.lookup(e)}},{key:"destroyCache",value:function(e){for(var t=Object.keys(e),r=0,i=t.length;r<i;r++){var a=t[r],n=e[a];n&&n.destroy()}}},{key:"destroy",value:function(){this.destroyCache(this._namespaces.adapter),this.destroyCache(this._namespaces.serializer),this._namespaces=null,this._store=null,this._owner=null}},{key:"toString",value:function(){return"ContainerInstanceCache"}}]),e}();e.default=n}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/debug","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i,a,n){function o(e,t,r,o,s,d){var l=s.createSnapshot(d),u=e.findRecord(t,r,o,l),c=(0,n.serializerForAdapter)(t,e,s.type.modelName),h="DS: Handle Adapter#findRecord of "+r+" with id: "+o;return u=f.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u.then(function(e){return t._adapterRun(function(){var i=(0,a.normalizeResponseHelper)(c,t,r,e,o,"findRecord"),n=t._push(i);return n})},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+r+"'")}function s(e,r,o,s,d){var l=t.default.A(d).invoke("createSnapshot"),u=e.findMany(r,o,s,l),c=(0,n.serializerForAdapter)(r,e,o.modelName),h="DS: Handle Adapter#findMany of "+o;if(void 0===u)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return u=f.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return r._adapterRun(function(){var t=(0,a.normalizeResponseHelper)(c,r,o,e,null,"findMany"),i=r._push(t);return i})},null,"DS: Extract payload of "+o)}function d(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findHasMany(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findHasMany of "+r+" : "+s.type;return u=f.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findHasMany"),i=t.push(r),n=i.map(function(e){return e._internalModel});return n.meta=r.meta,n})},null,"DS: Extract payload of "+r+" : hasMany "+s.type)}function l(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findBelongsTo(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findBelongsTo of "+r+" : "+s.type;return u=f.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findBelongsTo");if(!r.data)return null;var i=t._push(r);return i})},null,"DS: Extract payload of "+r+" : "+s.type)}function u(e,t,r,o,s){var d=r.modelName,l=t.peekAll(d),u=l._createSnapshot(s),c=e.findAll(t,r,o,u),h=(0,n.serializerForAdapter)(t,e,d),p="DS: Handle Adapter#findAll of "+r;return c=f.resolve(c,p),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,t)),c.then(function(e){return t._adapterRun(function(){var i=(0,a.normalizeResponseHelper)(h,t,r,e,null,"findAll");t._push(i)}),t.didUpdateAll(r),t.peekAll(d)},null,"DS: Extract payload of findAll "+r)}function c(e,t,r,o,s){var d=r.modelName,l=e.query(t,r,o,s),u=(0,n.serializerForAdapter)(t,e,d),c="DS: Handle Adapter#query of "+r;return l=f.resolve(l,c),l=(0,i._guard)(l,(0,i._bind)(i._objectIsAlive,t)),l.then(function(e){var i=void 0,n=void 0;return t._adapterRun(function(){n=(0,a.normalizeResponseHelper)(u,t,r,e,null,"query"),i=t._push(n)}),s._setInternalModels(i,n),s},null,"DS: Extract payload of query "+r)}function h(e,t,r,o){var s=r.modelName,d=e.queryRecord(t,r,o),l=(0,n.serializerForAdapter)(t,e,s),u="DS: Handle Adapter#queryRecord of "+r;
|
4
|
-
return d=f.resolve(d,u),d=(0,i._guard)(d,(0,i._bind)(i._objectIsAlive,t)),d.then(function(e){var i;return t._adapterRun(function(){var n=(0,a.normalizeResponseHelper)(l,t,r,e,null,"queryRecord");i=t._push(n)}),i},null,"DS: Extract payload of queryRecord "+r)}e._find=o,e._findMany=s,e._findHasMany=d,e._findBelongsTo=l,e._findAll=u,e._query=c,e._queryRecord=h;var f=t.default.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){var t=[];return e&&"object"==typeof e?("data"in e||"errors"in e||"meta"in e?"data"in e&&"errors"in e&&t.push('Top level keys "errors" and "data" cannot both be present in a JSON API document'):t.push('One or more of the following keys must be present: "data", "errors", "meta".'),"data"in e&&(null===e.data||Array.isArray(e.data)||"object"==typeof e.data||t.push("data must be null, an object, or an array")),"meta"in e&&"object"!=typeof e.meta&&t.push("meta must be an object"),"errors"in e&&(Array.isArray(e.errors)||t.push("errors must be an array")),"links"in e&&"object"!=typeof e.links&&t.push("links must be an object"),"jsonapi"in e&&"object"!=typeof e.jsonapi&&t.push("jsonapi must be an object"),"included"in e&&"object"!=typeof e.included&&t.push("included must be an array")):t.push("Top level of a JSON API document must be an object"),t}function a(e,t,r,i,a,n){var o=e.normalizeResponse(t,r,i,a,n);return o}e.validateDocumentStructure=i,e.normalizeResponseHelper=a}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var i=t.serializer;return void 0===i&&(i=e.serializerFor(r)),null!==i&&void 0!==i||(i={extract:function(e,t,r){return r}}),i}e.serializerForAdapter=t}),t("ember-data/-private/transforms",["exports","ember-data/transform","ember-data/-private/transforms/number","ember-data/-private/transforms/date","ember-data/-private/transforms/string","ember-data/-private/transforms/boolean"],function(e,t,r,i,a,n){e.Transform=t.default,e.NumberTransform=r.default,e.DateTransform=i.default,e.StringTransform=a.default,e.BooleanTransform=n.default}),t("ember-data/-private/transforms/boolean",["exports","ember","ember-data/transform"],function(e,t,r){var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e,t){var r=typeof e;return i(e)&&t.allowNull===!0?null:"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r&&1===e},serialize:function(e,t){return i(e)&&t.allowNull===!0?null:Boolean(e)}})}),t("ember-data/-private/transforms/date",["exports","ember-data/-private/ext/date","ember-data/transform"],function(e,t,r){e.default=r.default.extend({deserialize:function(e){var r=typeof e;return"string"===r?new Date((0,t.parseDate)(e)):"number"===r?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date&&!isNaN(e)?e.toISOString():null}})}),t("ember-data/-private/transforms/number",["exports","ember","ember-data/transform"],function(e,t,r){function i(e){return e===e&&e!==1/0&&e!==-(1/0)}var a=t.default.isEmpty;e.default=r.default.extend({deserialize:function(e){var t;return a(e)?null:(t=Number(e),i(t)?t:null)},serialize:function(e){var t;return a(e)?null:(t=Number(e),i(t)?t:null)}})}),t("ember-data/-private/transforms/string",["exports","ember","ember-data/transform"],function(e,t,r){var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e){return i(e)?null:String(e)},serialize:function(e){return i(e)?null:String(e)}})}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return a(e,"attributes").has("type")||a(e,"relationshipsByName").has("type")}function i(e){var r;return t.default.getOwner&&(r=t.default.getOwner(e)),!r&&e.container&&(r=e.container),r&&r.lookupFactory&&!r._lookupFactory&&(r._lookupFactory=r.lookupFactory,r.register=function(){var e=r.registry||r._registry||r;return e.register.apply(e,arguments)}),r}var a=t.default.get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=i}),t("ember-data/-private/utils/parse-response-headers",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){return Array.isArray(e)?e:Array.from(e)}function i(e){var i=new t.default;if(!e)return i;var n=e.split(a);return n.forEach(function(e){var t=e.split(":"),a=r(t),n=a[0],o=a.slice(1);n=n.trim(),o=o.join(":").trim(),o&&(i[n]=o)}),i}e.default=i;var a="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){e.default=t.default.Object.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return e.serialize(t)},createRecord:null,updateRecord:null,deleteRecord:null,coalesceFindRequests:!0,findMany:null,groupRecordsForFindMany:function(e,t){return[t]},shouldReloadRecord:function(e,t){return!1},shouldReloadAll:function(e,t){return!t.length},shouldBackgroundReloadRecord:function(e,t){return!0},shouldBackgroundReloadAll:function(e,t){return!0}})}),t("ember-data/adapters/errors",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i){function a(e){var t=arguments.length<=1||void 0===arguments[1]?"Adapter operation failed":arguments[1];this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=t.message;return o(e,r)}}function o(e,t){var r=function(r,i){e.call(this,r,i||t)};return r.prototype=Object.create(e.prototype),f&&(r.extend=n(r)),r}function s(e){var r=[];return t.default.isPresent(e)&&Object.keys(e).forEach(function(i){for(var a=t.default.makeArray(e[i]),n=0;n<a.length;n++){var o="Invalid Attribute",s="/data/attributes/"+i;i===h&&(o="Invalid Document",s="/data"),r.push({title:o,detail:a[n],source:{pointer:s}})}}),r}function d(e){var r={};return t.default.isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(u);t?t=t[2]:e.source.pointer.search(c)!==-1&&(t=h),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.AdapterError=a,e.errorsHashToArray=s,e.errorsArrayToHash=d;var l=t.default.Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base",f=!1;a.prototype=Object.create(l.prototype),f&&(a.extend=n(a));var p=o(a,"The adapter rejected the commit because it was invalid");e.InvalidError=p;var m=o(a,"The adapter operation timed out");e.TimeoutError=m;var y=o(a,"The adapter operation was aborted");e.AbortError=y;var v=f?o(a,"The adapter operation is unauthorized"):null;e.UnauthorizedError=v;var b=f?o(a,"The adapter operation is forbidden"):null;e.ForbiddenError=b;var g=f?o(a,"The adapter could not find the resource"):null;e.NotFoundError=g;var R=f?o(a,"The adapter operation failed due to a conflict"):null;e.ConflictError=R;var _=f?o(a,"The adapter operation failed due to a server error"):null;e.ServerError=_}),t("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest","ember-data/-private/features","ember-data/-private/debug"],function(e,t,r,i,a){var n=r.default.extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var i=this._super.apply(this,arguments);i.contentType&&(i.contentType="application/vnd.api+json");var a=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),a&&a(e)},i},coalesceFindRequests:!1,findMany:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(a,"GET",{data:{filter:{id:r.join(",")}}})},pathForType:function(e){var r=t.default.String.dasherize(e);return t.default.String.pluralize(r)},updateRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName);a.serializeIntoHash(i,t,r,{includeId:!0});var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PATCH",{data:i})},_hasCustomizedAjax:function(){return this.ajax!==n.prototype.ajax||this.ajaxOptions!==n.prototype.ajaxOptions}});e.default=n}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/adapters/errors","ember-data/-private/adapters/build-url-mixin","ember-data/-private/features","ember-data/-private/debug","ember-data/-private/utils/parse-response-headers"],function(e,t,r,i,a,n,o,s){function d(e,t,r,i){var a=void 0;try{a=e.handleResponse(t.status,(0,s.default)(t.getAllResponseHeaders()),r,i)}catch(e){return f.reject(e)}return a&&a.isAdapterError?f.reject(a):a}function l(e,t,r,a){var n=void 0;if(a.errorThrown instanceof Error)n=a.errorThrown;else if("timeout"===a.textStatus)n=new i.TimeoutError;else if("abort"===a.textStatus||0===t.status)n=new i.AbortError;else try{n=e.handleResponse(t.status,(0,s.default)(t.getAllResponseHeaders()),e.parseErrorResponse(t.responseText)||a.errorThrown,r)}catch(e){n=e}return n}function u(e,t){return"function"!=typeof String.prototype.endsWith?e.indexOf(t,e.length-t.length)!==-1:e.endsWith(t)}var c=t.default.MapWithDefault,h=t.default.get,f=t.default.RSVP.Promise,p=r.default.extend(a.default,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},a=t.sort(),n=0;n<r;n++)i[a[n]]=e[a[n]];return i},coalesceFindRequests:!1,findRecord:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findRecord"),n=this.buildQuery(i);return this.ajax(a,"GET",{data:n})},findAll:function(e,t,r,i){var a=this.buildQuery(i),n=this.buildURL(t.modelName,null,i,"findAll");return r&&(a.since=r),this.ajax(n,"GET",{data:a})},query:function(e,t,r){var i=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(i,"GET",{data:r})},queryRecord:function(e,t,r){var i=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(i,"GET",{data:r})},findMany:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(a,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,i){var a=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,a,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,i){var a=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,a,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName),n=this.buildURL(t.modelName,null,r,"createRecord");return a.serializeIntoHash(i,t,r,{includeId:!0}),this.ajax(n,"POST",{data:i})},updateRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName);a.serializeIntoHash(i,t,r);var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PUT",{data:i})},deleteRecord:function(e,t,r){var i=r.id;return this.ajax(this.buildURL(t.modelName,i,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),a=i[i.length-1],n=t.id;return decodeURIComponent(a)===n?i[i.length-1]="":u(a,"?id="+n)&&(i[i.length-1]=a.substring(0,a.length-n.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var n=a._stripIDFromURL(e,t[0]),o=0,s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;n.length+o+t>=r&&(o=0,s.push([])),o+=t;var a=s.length-1;s[a].push(e)}),s}var i=c.create({defaultValue:function(){return[]}}),a=this,n=this.maxURLLength;t.forEach(function(t){var r=a._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){var i="&ids%5B%5D=".length,a=r(e,n,i);a.forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,a){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new i.InvalidError(r.errors);var n=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,a);return new i.AdapterError(n,o)},isSuccess:function(e,t,r){return e>=200&&e<300||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,r,i){var a=this,n={url:e,method:r};return new f(function(o,s){var u=a.ajaxOptions(e,r,i);u.success=function(e,r,i){var s=d(a,i,e,n);t.default.run.join(null,o,s)},u.error=function(e,r,i){var o={textStatus:r,errorThrown:i},d=l(a,e,n,o);t.default.run.join(null,s,d)},a._ajaxRequest(u)},"DS: RESTAdapter#ajax "+r+" to "+e)},_ajaxRequest:function(e){t.default.$.ajax(e)},ajaxOptions:function(e,t,r){var i=r||{};i.url=e,i.type=t,i.dataType="json",i.context=this,i.data&&"GET"!==t&&(i.contentType="application/json; charset=utf-8",i.data=JSON.stringify(i.data));var a=h(this,"headers");return void 0!==a&&(i.beforeSend=function(e){Object.keys(a).forEach(function(t){return e.setRequestHeader(t,a[t])})}),i},parseErrorResponse:function(e){var r=e;try{r=t.default.$.parseJSON(e)}catch(e){}return r},normalizeErrorResponse:function(e,t,r){return r&&"object"==typeof r&&r.errors?r.errors:[{status:""+e,title:"The backend responded with an error",detail:""+r}]},generatedDetailedMessage:function(e,t,r,i){var a,n=t["Content-Type"]||"Empty Content-Type";a="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r;var o=i.method+" "+i.url,s="Payload ("+n+")";return["Ember Data Request "+o+" returned a "+e,s,a].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t},_hasCustomizedAjax:function(){return this.ajax!==p.prototype.ajax||this.ajaxOptions!==p.prototype.ajaxOptions}});e.default=p}),t("ember-data/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var i=t.defaultValue;return i}function a(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function n(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function o(e,r){"object"==typeof e?(r=e,e=void 0):r=r||{};var o={type:e,isAttribute:!0,options:r};return t.default.computed({get:function(e){var t=this._internalModel;return a(t,e)?n(t,e):i(this,r,e)},set:function(e,t){var r,i=this._internalModel,a=n(i,e);return t!==a&&(i._attributes[e]=t,r=e in i._inFlightAttributes?i._inFlightAttributes[e]:i._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:a,originalValue:r,value:t})),t}}).meta(o)}e.default=o}),t("ember-data",["exports","ember","ember-data/-private/debug","ember-data/-private/features","ember-data/-private/global","ember-data/-private/core","ember-data/-private/system/normalize-model-name","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/store","ember-data/-private/system/model","ember-data/model","ember-data/-private/system/snapshot","ember-data/adapter","ember-data/serializer","ember-data/-private/system/debug","ember-data/adapters/errors","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/adapters","ember-data/-private/adapters/build-url-mixin","ember-data/-private/serializers","ember-inflector","ember-data/serializers/embedded-records-mixin","ember-data/-private/transforms","ember-data/relationships","ember-data/setup-container","ember-data/-private/instance-initializers/initialize-store-service","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,f,p,m,y,v,b,g,R,_,A,z,F,M,k,x,S,T){if(t.default.VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new t.default.Error("Ember Data requires at least Ember 1.13.0, but you have "+t.default.VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");n.default.Store=l.Store,n.default.PromiseArray=d.PromiseArray,n.default.PromiseObject=d.PromiseObject,n.default.PromiseManyArray=d.PromiseManyArray,n.default.Model=c.default,n.default.RootState=u.RootState,n.default.attr=u.attr,n.default.Errors=u.Errors,n.default.InternalModel=s.default,n.default.Snapshot=h.default,n.default.Adapter=f.default,n.default.AdapterError=y.AdapterError,n.default.InvalidError=y.InvalidError,n.default.TimeoutError=y.TimeoutError,n.default.AbortError=y.AbortError,n.default.errorsHashToArray=y.errorsHashToArray,n.default.errorsArrayToHash=y.errorsArrayToHash,n.default.Serializer=p.default,n.default.DebugAdapter=m.default,n.default.RecordArray=v.RecordArray,n.default.FilteredRecordArray=v.FilteredRecordArray,n.default.AdapterPopulatedRecordArray=v.AdapterPopulatedRecordArray,n.default.ManyArray=b.default,n.default.RecordArrayManager=g.default,n.default.RESTAdapter=R.RESTAdapter,n.default.BuildURLMixin=_.default,n.default.RESTSerializer=A.RESTSerializer,n.default.JSONSerializer=A.JSONSerializer,n.default.JSONAPIAdapter=R.JSONAPIAdapter,n.default.JSONAPISerializer=A.JSONAPISerializer,n.default.Transform=M.Transform,n.default.DateTransform=M.DateTransform,n.default.StringTransform=M.StringTransform,n.default.NumberTransform=M.NumberTransform,n.default.BooleanTransform=M.BooleanTransform,n.default.EmbeddedRecordsMixin=F.default,n.default.belongsTo=k.belongsTo,n.default.hasMany=k.hasMany,n.default.Relationship=T.default,n.default._setupContainer=x.default,n.default._initializeStoreService=S.default,Object.defineProperty(n.default,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:o.default}),Object.defineProperty(a.default,"DS",{configurable:!0,get:function(){return n.default}}),e.default=n.default}),t("ember-data/initializers/data-adapter",["exports","ember"],function(e,t){e.default={name:"data-adapter",before:"store",initialize:function(){}}}),t("ember-data/initializers/ember-data",["exports","ember-data/setup-container","ember-data/-private/core"],function(e,t,r){e.default={name:"ember-data",initialize:t.default}}),t("ember-data/initializers/injectStore",["exports","ember"],function(e,t){e.default={name:"injectStore",before:"store",initialize:function(){}}}),t("ember-data/initializers/store",["exports","ember"],function(e,t){e.default={name:"store",after:"ember-data",initialize:function(){}}}),t("ember-data/initializers/transforms",["exports","ember"],function(e,t){e.default={name:"transforms",before:"store",initialize:function(){}}}),t("ember-data/instance-initializers/ember-data",["exports","ember-data/-private/instance-initializers/initialize-store-service"],function(e,t){e.default={name:"ember-data",initialize:t.default}}),t("ember-data/model",["exports","ember-data/-private/system/model"],function(e,t){e.default=t.default}),t("ember-data/relationships",["exports","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many"],function(e,t,r){e.belongsTo=t.default,e.hasMany=r.default}),t("ember-data/serializer",["exports","ember"],function(e,t){e.default=t.default.Object.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var a=t.default.get,n=t.default.set,o=t.default.String.camelize;e.default=t.default.Mixin.create({normalize:function(e,t,r){var i=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,i)},keyForRelationship:function(e,t,r){return"serialize"===r&&this.hasSerializeRecordsOption(e)||"deserialize"===r&&this.hasDeserializeRecordsOption(e)?this.keyForAttribute(e,r):this._super(e,t,r)||e},serializeBelongsTo:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);var a=this.hasSerializeIdsOption(i),n=this.hasSerializeRecordsOption(i),o=e.belongsTo(i);if(a){var s=this._getMappedKey(r.key,e.type);s===r.key&&this.keyForRelationship&&(s=this.keyForRelationship(r.key,r.kind,"serialize")),o?(t[s]=o.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[s]=null}else n&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[a]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[a]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[a]=null},serializeHasMany:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);if(this.hasSerializeIdsOption(i)){var a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),t[a]=e.hasMany(i,{ids:!0})}else this.hasSerializeRecordsOption(i)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(i)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,r,i){var a=this.keyForAttribute(i.key,"serialize"),n=e.hasMany(i.key);r[a]=t.default.A(n).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),t[i]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,r){for(var i=e.hasMany(r.key),a=t.default.A(i),n=new Array(a.length),o=0;o<a.length;o++){var s=a[o],d=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,d),n[o]=d}return n},removeEmbeddedForeignKey:function(e,t,r,i){if("hasMany"!==r.kind&&"belongsTo"===r.kind){var a=e.type.inverseFor(r.key,this.store);if(a){var n=a.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(n,a.kind,"deserialize");s&&delete i[s]}}},hasEmbeddedAlwaysOption:function(e){var t=this.attrsOption(e);return t&&"always"===t.embedded},hasSerializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.serialize},hasSerializeIdsOption:function(e){var t=this.attrsOption(e);return t&&("ids"===t.serialize||"id"===t.serialize)},hasSerializeIdsAndTypesOption:function(e){var t=this.attrsOption(e);return t&&("ids-and-types"===t.serialize||"id-and-type"===t.serialize)},noSerializeOptionSpecified:function(e){var t=this.attrsOption(e);return!(t&&(t.serialize||t.embedded))},hasDeserializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.deserialize},attrsOption:function(e){var t=this.get("attrs");return t&&(t[o(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var a=this;return r.eachRelationship(function(r,n){e.hasDeserializeRecordsOption(r)&&("hasMany"===n.kind&&a._extractEmbeddedHasMany(t,r,i,n),"belongsTo"===n.kind&&a._extractEmbeddedBelongsTo(t,r,i,n))}),i},_extractEmbeddedHasMany:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){for(var d=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=this._normalizeEmbeddedRelationship(e,o,u),h=c.data,f=c.included;if(r.included=r.included||[],r.included.push(h),f){var p;(p=r.included).push.apply(p,i(f))}d[l]={id:h.id,type:h.type}}var m={data:d};n(r,"data.relationships."+t,m)}},_extractEmbeddedBelongsTo:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){var d=this._normalizeEmbeddedRelationship(e,o,s),l=d.data,u=d.included;if(r.included=r.included||[],r.included.push(l),u){var c;(c=r.included).push.apply(c,i(u))}var h={id:l.id,type:l.type},f={data:h};n(r,"data.relationships."+t,f)}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var a=e.modelFor(i),n=e.serializerFor(i);return n.normalize(a,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/features"],function(e,t,r,i,a,n,o){var s=t.default.String.dasherize,d=i.default.extend({_normalizeDocumentHelper:function(e){if("object"===t.default.typeOf(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeResourceHelper(a)}e.data=r}if(Array.isArray(e.included)){for(var r=new Array(e.included.length),i=0;i<e.included.length;i++){var n=e.included[i];r[i]=this._normalizeResourceHelper(n)}e.included=r}return e},_normalizeRelationshipDataHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);return e.type=t,e},_normalizeResourceHelper:function(e){var t=void 0,r=void 0;if(t=this.modelNameFromPayloadKey(e.type),r="modelNameFromPayloadKey",!this.store._hasModelFor(t))return null;var i=this.store.modelFor(t),a=this.store.serializerFor(t),n=a.normalize(i,e),o=n.data;return o},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);e.push(r)},_normalizeResponse:function(e,t,r,i,a,n){var o=this._normalizeDocumentHelper(r);return o},normalizeQueryRecordResponse:function(){var e=this._super.apply(this,arguments);return e},extractAttributes:function(e,t){var r=this,i={};return t.attributes&&e.eachAttribute(function(e){var a=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[a]&&(i[e]=t.attributes[a])}),i},extractRelationship:function(e){if("object"===t.default.typeOf(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeRelationshipDataHelper(a)}e.data=r}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,a){var n=r.keyForRelationship(e,a.kind,"deserialize");if(void 0!==t.relationships[n]){var o=t.relationships[n];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,a.default)(e))},payloadKeyFromModelName:function(e){return(0,n.pluralize)(e)},normalize:function(e,t){t.attributes&&this.normalizeUsingDeclaredMapping(e,t.attributes),t.relationships&&this.normalizeUsingDeclaredMapping(e,t.relationships);var r={id:this.extractId(e,t),type:this._extractType(e,t),attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)};return this.applyTransforms(e,r.attributes),{data:r}},keyForAttribute:function(e,t){return s(e)},keyForRelationship:function(e,t,r){return s(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),i=void 0;return i=this.payloadKeyFromModelName(e.modelName),r.type=i,{data:r}},serializeAttribute:function(e,t,r,i){var a=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var n=e.attr(r);if(a){var o=this.transformFor(a);n=o.serialize(n,i.options)}var s=this._getMappedKey(r,e.type);s===r&&(s=this.keyForAttribute(r,"serialize")),t.attributes[s]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i);if(void 0!==a){t.relationships=t.relationships||{};var n=this._getMappedKey(i,e.type);n===i&&(n=this.keyForRelationship(i,"belongsTo","serialize"));var o=null;if(a){var s=void 0;s=this.payloadKeyFromModelName(a.modelName),o={type:s,id:a.id}}t.relationships[n]={data:o}}}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if(this[a](e,i,r)){var n=e.hasMany(i);if(void 0!==n){t.relationships=t.relationships||{};var o=this._getMappedKey(i,e.type);o===i&&this.keyForRelationship&&(o=this.keyForRelationship(i,"hasMany","serialize"));for(var s=new Array(n.length),d=0;d<n.length;d++){var l=n[d],u=void 0;u=this.payloadKeyFromModelName(l.modelName),s[d]={type:u,id:l.id}}t.relationships[o]={data:s}}}}});e.default=d}),t("ember-data/serializers/json",["exports","ember","ember-data/-private/debug","ember-data/serializer","ember-data/-private/system/coerce-id","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/features","ember-data/adapters/errors"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t.default.get,c=t.default.isNone,h=t.default.assign||t.default.merge,f=i.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=u(e,"attributes");return e.eachTransformedAttribute(function(e,a){if(void 0!==t[e]){var n=r.transformFor(a),o=i.get(e);t[e]=n.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,a){switch(a){case"findRecord":return this.normalizeFindRecordResponse.apply(this,arguments);case"queryRecord":return this.normalizeQueryRecordResponse.apply(this,arguments);case"findAll":return this.normalizeFindAllResponse.apply(this,arguments);case"findBelongsTo":return this.normalizeFindBelongsToResponse.apply(this,arguments);case"findHasMany":return this.normalizeFindHasManyResponse.apply(this,arguments);case"findMany":return this.normalizeFindManyResponse.apply(this,arguments);case"query":return this.normalizeQueryResponse.apply(this,arguments);case"createRecord":return this.normalizeCreateRecordResponse.apply(this,arguments);case"deleteRecord":return this.normalizeDeleteRecordResponse.apply(this,arguments);case"updateRecord":return this.normalizeUpdateRecordResponse.apply(this,arguments)}},normalizeFindRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!0)},normalizeArrayResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!1)},_normalizeResponse:function(e,t,r,i,a,n){var o={data:null,included:[]},s=this.extractMeta(e,t,r);if(s&&(o.meta=s),n){var d=this.normalize(t,r),u=d.data,c=d.included;o.data=u,c&&(o.included=c)}else{for(var h=new Array(r.length),f=0,p=r.length;f<p;f++){var m=r[f],y=this.normalize(t,m),u=y.data,c=y.included;if(c){var v;(v=o.included).push.apply(v,l(c))}h[f]=u}o.data=h}return o},normalize:function(e,r){var i=null;return r&&(this.normalizeUsingDeclaredMapping(e,r),"object"===t.default.typeOf(r.links)&&this.normalizeUsingDeclaredMapping(e,r.links),i={id:this.extractId(e,r),type:e.modelName,attributes:this.extractAttributes(e,r),relationships:this.extractRelationships(e,r)},this.applyTransforms(e,i.attributes)),{data:i}},extractId:function(e,t){var r=u(this,"primaryKey"),i=t[r];return(0,a.default)(i)},extractAttributes:function(e,t){var r,i=this,a={};return e.eachAttribute(function(e){r=i.keyForAttribute(e,"deserialize"),void 0!==t[r]&&(a[e]=t[r])}),a},extractRelationship:function(e,r){if(t.default.isNone(r))return null;if("object"===t.default.typeOf(r)){r.id&&(r.id=(0,a.default)(r.id));var i=this.store.modelFor(e);if(r.type&&!(0,o.modelHasAttributeOrRelationshipNamedType)(i)){r.type=this.modelNameFromPayloadKey(r.type)}return r}return{id:(0,a.default)(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var i=this,a={};return e.eachRelationship(function(e,n){var o=null,s=i.keyForRelationship(e,n.kind,"deserialize");if(void 0!==r[s]){var d=null,l=r[s];if("belongsTo"===n.kind)d=n.options.polymorphic?i.extractPolymorphicRelationship(n.type,l,{
|
5
|
-
key:e,resourceHash:r,relationshipMeta:n}):i.extractRelationship(n.type,l);else if("hasMany"===n.kind&&!t.default.isNone(l)){d=new Array(l.length);for(var u=0,c=l.length;u<c;u++){var h=l[u];d[u]=i.extractRelationship(n.type,h)}}o={data:d}}var f=i.keyForLink(e,n.kind);if(r.links&&void 0!==r.links[f]){var p=r.links[f];o=o||{},o.links={related:p}}o&&(a[e]=o)}),a},modelNameFromPayloadKey:function(e){return(0,n.default)(e)},normalizeRelationships:function(e,t){var r,i=this;this.keyForRelationship&&e.eachRelationship(function(e,a){r=i.keyForRelationship(e,a.kind,"deserialize"),e!==r&&void 0!==t[r]&&(t[e]=t[r],delete t[r])})},normalizeUsingDeclaredMapping:function(e,t){var r,i,a,n=u(this,"attrs");if(n)for(a in n)r=i=this._getMappedKey(a,e),void 0!==t[i]&&(u(e,"attributes").has(a)&&(r=this.keyForAttribute(a)),u(e,"relationshipsByName").has(a)&&(r=this.keyForRelationship(a)),i!==r&&(t[r]=t[i],delete t[i]))},_getMappedKey:function(e,t){var r,i=u(this,"attrs");return i&&i[e]&&(r=i[e],r.key&&(r=r.key),"string"==typeof r&&(e=r)),e},_canSerialize:function(e){var t=u(this,"attrs");return!t||!t[e]||t[e].serialize!==!1},_mustSerialize:function(e){var t=u(this,"attrs");return t&&t[e]&&t[e].serialize===!0},shouldSerializeHasMany:function(e,t,r){return this._shouldSerializeHasMany!==f.prototype._shouldSerializeHasMany,this._shouldSerializeHasMany(e,t,r)},_shouldSerializeHasMany:function(e,t,r){var i=e.type.determineRelationshipType(r,this.store);return!!this._mustSerialize(t)||this._canSerialize(t)&&("manyToNone"===i||"manyToMany"===i)},serialize:function(e,t){var r=this,i={};if(t&&t.includeId){var a=e.id;a&&(i[u(this,"primaryKey")]=a)}return e.eachAttribute(function(t,a){r.serializeAttribute(e,i,t,a)}),e.eachRelationship(function(t,a){"belongsTo"===a.kind?r.serializeBelongsTo(e,i,a):"hasMany"===a.kind&&r.serializeHasMany(e,i,a)}),i},serializeIntoHash:function(e,t,r,i){h(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){var a=i.type;if(this._canSerialize(r)){var n=e.attr(r);if(a){var o=this.transformFor(a);n=o.serialize(n,i.options)}var s=this._getMappedKey(r,e.type);s===r&&this.keyForAttribute&&(s=this.keyForAttribute(r,"serialize")),t[s]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i,{id:!0}),n=this._getMappedKey(i,e.type);n===i&&this.keyForRelationship&&(n=this.keyForRelationship(i,"belongsTo","serialize")),c(a)?t[n]=null:t[n]=a,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if(this[a](e,i,r)){var n=e.hasMany(i,{ids:!0});if(void 0!==n){var o=this._getMappedKey(i,e.type);o===i&&this.keyForRelationship&&(o=this.keyForRelationship(i,"hasMany","serialize")),t[o]=n}}},serializePolymorphicType:function(){},extractMeta:function(e,t,r){if(r&&void 0!==r.meta){var i=r.meta;return delete r.meta,i}},extractErrors:function(e,t,r,i){var a=this;return r&&"object"==typeof r&&r.errors&&(r=(0,d.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=a.keyForAttribute(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=a.keyForRelationship(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var r=(0,o.getOwner)(this).lookup("transform:"+e);return r}});e.default=f}),t("ember-data/serializers/rest",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/system/coerce-id","ember-data/-private/utils","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t.default.String.camelize,c=i.default.extend({keyForPolymorphicType:function(e,t,r){var i=this.keyForRelationship(e);return i+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,r,i,a){var n=this,o={data:[],included:[]},s=e.modelFor(r),d=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,a,s,d),i=r.data,u=r.included;if(o.data.push(i),u){var c;(c=o.included).push.apply(c,l(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,i,a){var n=a,o=i,d=(0,s.modelHasAttributeOrRelationshipNamedType)(i);if(!d&&t.type){var l=void 0;l=this.modelNameFromPayloadKey(t.type),e._hasModelFor(l)&&(n=e.serializerFor(l),o=e.modelFor(l))}return n.normalize(o,t,r)},_normalizeResponse:function(e,r,i,a,n,s){var d={data:null,included:[]},u=this.extractMeta(e,r,i);u&&(d.meta=u);for(var c=Object.keys(i),h=0,f=c.length;h<f;h++){var p=c[h],m=p,y=!1;"_"===p.charAt(0)&&(y=!0,m=p.substr(1));var v=this.modelNameFromPayloadKey(m);if(e.modelFactoryFor(v)){var b=!y&&this.isPrimaryType(e,v,r),g=i[p];if(null!==g)if(b&&"array"!==t.default.typeOf(g)){var R=this._normalizePolymorphicRecord(e,g,p,r,this),_=R.data,A=R.included;if(d.data=_,A){var z;(z=d.included).push.apply(z,l(A))}}else{var F=this._normalizeArray(e,v,g,p),M=F.data,k=F.included;if(k){var x;(x=d.included).push.apply(x,l(k))}if(s)M.forEach(function(e){var t=b&&(0,o.default)(e.id)===a,r=b&&!a&&!d.data;r||t?d.data=e:d.included.push(e)});else if(b)d.data=M;else if(M){var S;(S=d.included).push.apply(S,l(M))}}}}return d},isPrimaryType:function(e,t,r){var i=e.modelFor(t);return i.modelName===r.modelName},pushPayload:function(e,r){var i={data:[],included:[]};for(var a in r){var n=this.modelNameFromPayloadKey(a);if(e.modelFactoryFor(n)){var o=e.modelFor(n),s=e.serializerFor(o.modelName);t.default.makeArray(r[a]).forEach(function(e){var t=s.normalize(o,e,a),r=t.data,n=t.included;if(i.data.push(r),n){var d;(d=i.included).push.apply(d,l(n))}})}}e.push(i)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,a.default)(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,i){var a=this.payloadKeyFromModelName(t.modelName);e[a]=this.serialize(r,i)},payloadKeyFromModelName:function(e){return u(e)},serializePolymorphicType:function(e,r,i){var a=i.key,n=e.belongsTo(a),o=this.keyForPolymorphicType(a,i.type,"serialize");a=this.keyForAttribute?this.keyForAttribute(a,"serialize"):a,a+="Type",a!==o&&this.keyForPolymorphicType===c.prototype.keyForPolymorphicType&&(o=a),t.default.isNone(n)?r[o]=null:r[o]=u(n.modelName)},extractPolymorphicRelationship:function(e,t,r){var i=r.key,a=r.resourceHash,n=r.relationshipMeta,o=n.options.polymorphic,s=this.keyForPolymorphicType(i,e,"deserialize");if(o&&void 0!==a[s]&&"object"!=typeof t){var d,d=this.modelNameFromPayloadKey(a[s]);return{id:t,type:d}}return this._super.apply(this,arguments)}});e.default=c}),t("ember-data/setup-container",["exports","ember-data/-private/initializers/store","ember-data/-private/initializers/transforms","ember-data/-private/initializers/store-injections","ember-data/-private/initializers/data-adapter"],function(e,t,r,i,a){function n(e){(0,a.default)(e),(0,r.default)(e),(0,i.default)(e),(0,t.default)(e)}e.default=n}),t("ember-data/store",["exports","ember-data/-private/system/store"],function(e,t){e.default=t.default}),t("ember-data/transform",["exports","ember"],function(e,t){e.default=t.default.Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.default="2.11.0"}),t("ember-inflector",["exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i,a){i.Inflector.defaultRules=i.defaultRules,r.default.Inflector=i.Inflector,r.default.String.pluralize=i.pluralize,r.default.String.singularize=i.singularize,e.default=i.Inflector,e.pluralize=i.pluralize,e.singularize=i.singularize,e.defaultRules=i.defaultRules,"undefined"!=typeof t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=i.Inflector,e.pluralize=i.pluralize,e.singularize=i.singularize,e}):"undefined"!=typeof module&&module.exports&&(module.exports=i.Inflector,i.Inflector.singularize=i.singularize,i.Inflector.pluralize=i.pluralize)}),t("ember-inflector/lib/ext/string",["exports","ember","ember-inflector/lib/system/string"],function(e,t,r){(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,r.pluralize)(this)},String.prototype.singularize=function(){return(0,r.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.default=(0,r.default)(function(e){var r=void 0,i=void 0;return 1===e.length?(i=e[0],(0,t.pluralize)(i)):(r=e[0],i=e[1],1!==parseFloat(r)&&(i=(0,t.pluralize)(i)),r+" "+i)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.default=(0,r.default)(function(e){return(0,t.singularize)(e[0])})}),t("ember-inflector/lib/system",["exports","ember-inflector/lib/system/inflector","ember-inflector/lib/system/string","ember-inflector/lib/system/inflections"],function(e,t,r,i){t.default.inflector=new t.default(i.default),e.Inflector=t.default,e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=i.default}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e.default={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status|bonus)$/i,"$1es"],[/(bu)s$/i,"$1ses"],[/(buffal|tomat)o$/i,"$1oes"],[/([ti])um$/i,"$1a"],[/([ti])a$/i,"$1a"],[/sis$/i,"ses"],[/(?:([^f])fe|([lr])f)$/i,"$1$2ves"],[/(hive)$/i,"$1s"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(x|ch|ss|sh)$/i,"$1es"],[/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"],[/^(m|l)ouse$/i,"$1ice"],[/^(m|l)ice$/i,"$1ice"],[/^(ox)$/i,"$1en"],[/^(oxen)$/i,"$1"],[/(quiz)$/i,"$1zes"]],singular:[[/s$/i,""],[/(ss)$/i,"$1"],[/(n)ews$/i,"$1ews"],[/([ti])a$/i,"$1um"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"],[/(^analy)(sis|ses)$/i,"$1sis"],[/([^f])ves$/i,"$1fe"],[/(hive)s$/i,"$1"],[/(tive)s$/i,"$1"],[/([lr])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/(s)eries$/i,"$1eries"],[/(m)ovies$/i,"$1ovie"],[/(x|ch|ss|sh)es$/i,"$1"],[/^(m|l)ice$/i,"$1ouse"],[/(bus)(es)?$/i,"$1"],[/(o)es$/i,"$1"],[/(shoe)s$/i,"$1"],[/(cris|test)(is|es)$/i,"$1is"],[/^(a)x[ie]s$/i,"$1xis"],[/(octop|vir)(us|i)$/i,"$1us"],[/(alias|status|bonus)(es)?$/i,"$1"],[/^(ox)en/i,"$1"],[/(vert|ind)ices$/i,"$1ex"],[/(matr)ices$/i,"$1ix"],[/(quiz)zes$/i,"$1"],[/(database)s$/i,"$1"]],irregularPairs:[["person","people"],["man","men"],["child","children"],["sex","sexes"],["move","moves"],["cow","kine"],["zombie","zombies"]],uncountable:["equipment","information","rice","money","species","series","fish","sheep","jeans","police"]}}),t("ember-inflector/lib/system/inflector",["exports","ember"],function(e,t){function r(e,t){for(var r=0,i=t.length;r<i;r++)e.uncountable[t[r].toLowerCase()]=!0}function i(e,t){for(var r,i=0,a=t.length;i<a;i++)r=t[i],e.irregular[r[0].toLowerCase()]=r[1],e.irregular[r[1].toLowerCase()]=r[1],e.irregularInverse[r[1].toLowerCase()]=r[0],e.irregularInverse[r[0].toLowerCase()]=r[0]}function a(e){e=e||{},e.uncountable=e.uncountable||n(),e.irregularPairs=e.irregularPairs||n();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};r(t,e.uncountable),i(t,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}var o=t.default.String.capitalize,s=/^\s*$/,d=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,u=/[A-Z][a-z\d]*$/;if(!Object.create&&!Object.create(null).hasOwnProperty)throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");a.prototype={enableCache:function(){this.purgeCache(),this.singularize=function(e){return this._cacheUsed=!0,this._sCache[e]||(this._sCache[e]=this._singularize(e))},this.pluralize=function(e){return this._cacheUsed=!0,this._pCache[e]||(this._pCache[e]=this._pluralize(e))}},purgeCache:function(){this._cacheUsed=!1,this._sCache=n(),this._pCache=n()},disableCache:function(){this._sCache=null,this._pCache=null,this.singularize=function(e){return this._singularize(e)},this.pluralize=function(e){return this._pluralize(e)}},plural:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.plurals.push([e,t.toLowerCase()])},singular:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.singular.push([e,t.toLowerCase()])},uncountable:function(e){this._cacheUsed&&this.purgeCache(),r(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),i(this.rules,[[e,t]])},pluralize:function(e){return this._pluralize(e)},_pluralize:function(e){return this.inflect(e,this.rules.plurals,this.rules.irregular)},singularize:function(e){return this._singularize(e)},_singularize:function(e){return this.inflect(e,this.rules.singular,this.rules.irregularInverse)},inflect:function(e,t,r){var i,a,n,c,h,f,p,m,y,v,b;if(m=!e||s.test(e),y=u.test(e),f="",m)return e;if(c=e.toLowerCase(),h=d.exec(e)||l.exec(e),h&&(f=h[1],p=h[2].toLowerCase()),b=this.rules.uncountable[c]||this.rules.uncountable[p])return e;for(v in r)if(c.match(v+"$"))return a=r[v],y&&r[p]&&(a=o(a),v=o(v)),e.replace(new RegExp(v,"i"),a);for(var g=t.length,R=0;g>R&&(i=t[g-1],v=i[0],!v.test(e));g--);return i=i||[],v=i[0],a=i[1],n=e.replace(v,a)}},e.default=a}),t("ember-inflector/lib/system/string",["exports","ember-inflector/lib/system/inflector"],function(e,t){function r(e){return t.default.inflector.pluralize(e)}function i(e){return t.default.inflector.singularize(e)}e.pluralize=r,e.singularize=i}),t("ember-inflector/lib/utils/make-helper",["exports","ember"],function(e,t){function r(e){return t.default.Helper?t.default.Helper.helper(e):t.default.HTMLBars?t.default.HTMLBars.makeBoundHelper(e):t.default.Handlebars.makeBoundHelper(e)}e.default=r}),t("ember-load-initializers",["exports","ember"],function(e,t){e.default=function(e,r){var n=new RegExp("^"+r+"/((?:instance-)?initializers)/"),o=Object.keys||t.default.keys;o(a._eak_seen).map(function(e){return{moduleName:e,matches:n.exec(e)}}).filter(function(e){return e.matches&&2===e.matches.length}).forEach(function(r){var a=r.moduleName,n=i(a,null,null,!0);if(!n)throw new Error(a+" must export an initializer.");var o=t.default.String.camelize(r.matches[1].substring(0,r.matches[1].length-1)),s=n.default;if(!s.name){var d=a.match(/[^\/]+\/?$/)[0];s.name=d}e[o]&&e[o](s)})}}),t("ember",[],function(){return{default:Ember}}),i("ember-data"),i("ember-load-initializers").default(Ember.Application,"ember-data"),function(){var e=i("ember-data/-private/global").default,t=i("ember-data").default;Object.defineProperty(e,"DS",{get:function(){return t}})}()}(),function(){function e(){var e={"ember-data":{default:DS},"ember-data/model":{default:DS.Model},"ember-data/mixins/embedded-records":{default:DS.EmbeddedRecordsMixin},"ember-data/serializers/rest":{default:DS.RESTSerializer},"ember-data/serializers/active-model":{default:DS.ActiveModelSerializer},"ember-data/serializers/json":{default:DS.JSONSerializer},"ember-data/serializers/json-api":{default:DS.JSONAPISerializer},"ember-data/serializer":{default:DS.Serializer},"ember-data/adapters/json-api":{default:DS.JSONAPIAdapter},"ember-data/adapters/rest":{default:DS.RESTAdapter},"ember-data/adapter":{default:DS.Adapter},"ember-data/adapters/active-model":{default:DS.ActiveModelAdapter},"ember-data/store":{default:DS.Store},"ember-data/transform":{default:DS.Transform},"ember-data/attr":{default:DS.attr},"ember-data/relationships":{hasMany:DS.hasMany,belongsTo:DS.belongsTo}};for(var r in e)t(r,e[r])}function t(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&e()}();
|
3
|
+
content:this.inverseRecord?this.inverseRecord.getRecord():null})}if(null===this.inverseRecord)return null;var r=this.inverseRecord.getRecord();return r},n.prototype.reload=function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.hasRecord?this.inverseRecord.record.reload():this.findRecord()},n.prototype.updateData=function(e){var t=this.store._pushResourceIdentifier(this,e);this.setCanonicalRecord(t)}}),t("ember-data/-private/system/relationships/state/create",["exports","ember","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to","ember-data/-private/system/empty-object"],function(e,t,r,i,a){function n(e){var t=e.options;return!(t&&null===t.inverse)}function o(e,t,a){var o=void 0,s=null;return n(t)&&(s=e.type.inverseFor(t.key,a)),s&&(o=s.name),"hasMany"===t.kind?new r.default(a,e,o,t):new i.default(a,e,o,t)}function s(e){this.record=e,this.initializedRelationships=new a.default}e.default=s;var d=t.default.get;s.prototype.has=function(e){return!!this.initializedRelationships[e]},s.prototype.get=function(e){var t=this.initializedRelationships,r=d(this.record.type,"relationshipsByName");return!t[e]&&r.get(e)&&(t[e]=o(this.record,r.get(e),this.record.store)),t[e]}}),t("ember-data/-private/system/relationships/state/has-many",["exports","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/ordered-set","ember-data/-private/system/many-array"],function(e,t,r,i,a,n){function o(e,t,r,i){this._super$constructor(e,t,r,i),this.belongsToType=i.type,this.canonicalState=[],this.isPolymorphic=i.options.polymorphic}function s(e){var t=new a.default;if(e)for(var r=0,i=e.length;r<i;r++)t.add(e[r]);return t}e.default=o,o.prototype=Object.create(i.default.prototype),o.prototype.getManyArray=function(){return this._manyArray||(this._manyArray=n.default.create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:this.record,meta:this.meta,isPolymorphic:this.isPolymorphic})),this._manyArray},o.prototype.constructor=o,o.prototype._super$constructor=i.default,o.prototype.destroy=function(){this._manyArray&&this._manyArray.destroy()},o.prototype._super$updateMeta=i.default.prototype.updateMeta,o.prototype.updateMeta=function(e){this._super$updateMeta(e),this._manyArray&&this._manyArray.set("meta",e)},o.prototype._super$addCanonicalRecord=i.default.prototype.addCanonicalRecord,o.prototype.addCanonicalRecord=function(e,t){this.canonicalMembers.has(e)||(void 0!==t?this.canonicalState.splice(t,0,e):this.canonicalState.push(e),this._super$addCanonicalRecord(e,t))},o.prototype._super$addRecord=i.default.prototype.addRecord,o.prototype.addRecord=function(e,t){this.members.has(e)||(this._super$addRecord(e,t),this.getManyArray().internalAddRecords([e],t))},o.prototype._super$removeCanonicalRecordFromOwn=i.default.prototype.removeCanonicalRecordFromOwn,o.prototype.removeCanonicalRecordFromOwn=function(e,t){var r=t;this.canonicalMembers.has(e)&&(void 0===r&&(r=this.canonicalState.indexOf(e)),r>-1&&this.canonicalState.splice(r,1),this._super$removeCanonicalRecordFromOwn(e,t))},o.prototype._super$flushCanonical=i.default.prototype.flushCanonical,o.prototype.flushCanonical=function(){this._manyArray&&this._manyArray.flushCanonical(),this._super$flushCanonical()},o.prototype._super$removeRecordFromOwn=i.default.prototype.removeRecordFromOwn,o.prototype.removeRecordFromOwn=function(e,t){if(this.members.has(e)){this._super$removeRecordFromOwn(e,t);var r=this.getManyArray();void 0!==t?r.currentState.removeAt(t):r.internalRemoveRecords([e])}},o.prototype.notifyRecordRelationshipAdded=function(e,t){this.record.notifyHasManyAdded(this.key,e,t)},o.prototype.reload=function(){var e=this.getManyArray(),t=e.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&e.set("isLoaded",t)}return this.link?(this._loadingPromise=(0,r.promiseManyArray)(this.fetchLink(),"Reload with link"),this._loadingPromise):(this._loadingPromise=(0,r.promiseManyArray)(this.store._scheduleFetchMany(e.currentState).then(function(){return e}),"Reload with ids"),this._loadingPromise)},o.prototype.computeChanges=function(e){var t,r,i,a=this.canonicalMembers,n=[];for(e=s(e),a.forEach(function(t){e.has(t)||n.push(t)}),this.removeCanonicalRecords(n),e=e.toArray(),t=e.length,i=0;i<t;i++)r=e[i],this.removeCanonicalRecord(r),this.addCanonicalRecord(r,i)},o.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.record,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateRecordsFromAdapter(t),e.getManyArray().set("isLoaded",!0)}),e.getManyArray()})},o.prototype.findRecords=function(){for(var e=this.getManyArray(),t=e.toArray(),r=new Array(t.length),i=0;i<t.length;i++)r[i]=t[i]._internalModel;return this.store.findMany(r).then(function(){return e.get("isDestroyed")||e.set("isLoaded",!0),e})},o.prototype.notifyHasManyChanged=function(){this.record.notifyHasManyAdded(this.key)},o.prototype.getRecords=function(){var e=this,t=this.getManyArray();if(this.isAsync){var i;return i=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._loadingPromise=r.PromiseManyArray.create({content:t,promise:i}),this._loadingPromise}return t.get("isDestroyed")||t.set("isLoaded",!0),t},o.prototype.updateData=function(e){var t=this.store._pushResourceIdentifiers(this,e);this.updateRecordsFromAdapter(t)}}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember-data/-private/debug","ember-data/-private/system/ordered-set","ember-data/-private/system/normalize-link"],function(e,t,r,i){function a(e,t,i,a){var n=a.options.async;this.members=new r.default,this.canonicalMembers=new r.default,this.store=e,this.key=a.key,this.inverseKey=i,this.record=t,this.isAsync="undefined"==typeof n||n,this.relationshipMeta=a,this.inverseKeyForImplicit=this.record.constructor.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}e.default=a,a.prototype={constructor:a,destroy:function(){},updateMeta:function(e){this.meta=e},clear:function(){for(var e,t=this.members.list;t.length>0;)e=t[0],this.removeRecord(e)},removeRecords:function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})},addRecords:function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})},addCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])},addCanonicalRecord:function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.inverseKey?e._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new a(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)},removeCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])},removeCanonicalRecord:function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalRecordFromOwn(e),this.inverseKey?this.removeCanonicalRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecord(this.record)),this.flushCanonicalLater()},addRecord:function(e,t){this.members.has(e)||(this.members.addWithIndex(e,t),this.notifyRecordRelationshipAdded(e,t),this.inverseKey?e._relationships.get(this.inverseKey).addRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new a(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArraysLater()),this.setHasData(!0)},removeRecord:function(e){this.members.has(e)&&(this.removeRecordFromOwn(e),this.inverseKey?this.removeRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeRecord(this.record))},removeRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)},removeRecordFromOwn:function(e){this.members.delete(e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()},removeCanonicalRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)},removeCanonicalRecordFromOwn:function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},flushCanonical:function(){this.willSync=!1;for(var e=[],t=0;t<this.members.list.length;t++)this.members.list[t].isNew()&&e.push(this.members.list[t]);for(this.members=this.canonicalMembers.copy(),t=0;t<e.length;t++)this.members.add(e[t])},flushCanonicalLater:function(){var e=this;this.willSync||(this.willSync=!0,this.store._backburner.join(function(){return e.store._backburner.schedule("syncRelationships",e,e.flushCanonical)}))},updateLink:function(e){this.link=e,this.linkPromise=null,this.record.notifyPropertyChange(this.key)},findLink:function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},updateRecordsFromAdapter:function(e){this.computeChanges(e)},notifyRecordRelationshipAdded:function(){},notifyRecordRelationshipRemoved:function(){},setHasData:function(e){this.hasData=e},setHasLoaded:function(e){this.hasLoaded=e},push:function(e){var t=!1,r=!1;if(e.meta&&this.updateMeta(e.meta),void 0!==e.data&&(t=!0,this.updateData(e.data)),e.links&&e.links.related){var a=(0,i.default)(e.links.related);a&&a.href&&a.href!==this.link&&(r=!0,this.updateLink(a.href))}t?(this.setHasData(!0),this.setHasLoaded(!0)):r&&this.setHasLoaded(!1)},updateData:function(){}}}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){function t(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this.type=e.get("type"),this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}e.default=t,t.prototype.snapshots=function(){return null!==this._snapshots?this._snapshots:(this._snapshots=this._recordArray._takeSnapshot(),this._snapshots)}}),t("ember-data/-private/system/snapshot",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){function i(e){var t=this,i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this._attributes=new r.default,this._belongsToRelationships=new r.default,this._belongsToIds=new r.default,this._hasManyRelationships=new r.default,this._hasManyIds=new r.default;var n=e.getRecord();this.record=n,n.eachAttribute(function(e){return t._attributes[e]=a(n,e)}),this.id=e.id,this._internalModel=e,this.type=e.type,this.modelName=e.type.modelName,this.adapterOptions=i.adapterOptions,this.include=i.include,this._changedAttributes=n.changedAttributes()}e.default=i;var a=t.default.get;i.prototype={constructor:i,id:null,record:null,type:null,modelName:null,attr:function(e){if(e in this._attributes)return this._attributes[e];throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no attribute named '"+e+"' defined.")},attributes:function(){return t.default.copy(this._attributes)},changedAttributes:function(){for(var e=new r.default,i=Object.keys(this._changedAttributes),a=0,n=i.length;a<n;a++){var o=i[a];e[o]=t.default.copy(this._changedAttributes[o])}return e},belongsTo:function(e,r){var i,n,o,s,d=r&&r.id;if(d&&e in this._belongsToIds)return this._belongsToIds[e];if(!d&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(i=this._internalModel._relationships.get(e),!i||"belongsTo"!==i.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return o=a(i,"hasData"),n=a(i,"inverseRecord"),o&&(s=n&&!n.isDeleted()?d?a(n,"id"):n.createSnapshot():null),d?this._belongsToIds[e]=s:this._belongsToRelationships[e]=s,s},hasMany:function(e,r){var i,n,o,s,d=r&&r.ids;if(d&&e in this._hasManyIds)return this._hasManyIds[e];if(!d&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(i=this._internalModel._relationships.get(e),!i||"hasMany"!==i.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return o=a(i,"hasData"),n=a(i,"members"),o&&(s=[],n.forEach(function(e){e.isDeleted()||(d?s.push(e.id):s.push(e.createSnapshot()))})),d?this._hasManyIds[e]=s:this._hasManyRelationships[e]=s,s},eachAttribute:function(e,t){this.record.eachAttribute(e,t)},eachRelationship:function(e,t){this.record.eachRelationship(e,t)},serialize:function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)}}}),t("ember-data/-private/system/store",["exports","ember","ember-data/model","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/adapters/errors","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers","ember-data/-private/system/store/finders","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/system/record-array-manager","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/model/internal-model","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,f,p,m,y,v){function b(e,t){var r=e.then(function(e){return e.getRecord()});return(0,o.promiseObject)(r,t)}function g(e){return e.serializerFor("application")}function R(e,t,r,i){var a=i._internalModel,o=i.modelName,u=t.modelFor(o),c=e[r](t,u,i),h=(0,l.serializerForAdapter)(t,e,o),f="DS: Extract and notify about "+r+" completion of "+a;return c=N.resolve(c,f),c=(0,s._guard)(c,(0,s._bind)(s._objectIsAlive,t)),c=(0,s._guard)(c,(0,s._bind)(s._objectIsAlive,a)),c.then(function(e){return t._adapterRun(function(){var n=void 0,o=void 0;e&&(n=(0,d.normalizeResponseHelper)(h,t,u,e,i.id,r),n.included&&t.push({data:n.included}),o=n.data),t.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof n.InvalidError){var r=h.extractErrors(t,u,e,i.id);t.recordWasInvalid(a,r)}else t.recordWasError(a,e);throw e},f)}function _(e,t,r){r.relationships&&t.type.eachRelationship(function(e,i){if(r.relationships[e]){var a=t._relationships.get(e);a.push(r.relationships[e])}})}var A="`id` passed to `findRecord()` has to be non-empty string or number";e.badIdFormatAssertion=A;var z=t.default.A,F=t.default._Backburner,M=t.default.computed,k=t.default.copy,x=t.default.ENV,S=t.default.Error,T=t.default.get,w=t.default.guidFor,E=(t.default.inspect,t.default.isNone),D=(t.default.isPresent,t.default.MapWithDefault),C=t.default.run,P=t.default.set,O=t.default.RSVP,I=t.default.Service,j=t.default.typeOf,N=O.Promise,L=void 0;e.Store=L=I.extend({init:function(){this._super.apply(this,arguments),this._backburner=new F(["normalizeRelationships","syncRelationships","finished"]),this.typeMaps={},this.recordArrayManager=f.default.create({store:this}),this._pendingSave=[],this._instanceCache=new p.default((0,c.getOwner)(this),this),this._pendingFetch=D.create({defaultValue:function(){return[]}})},adapter:"-json-api",serialize:function(e,t){var r=e._internalModel.createSnapshot();return r.serialize(t)},defaultAdapter:M("adapter",function(){var e=T(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=this.modelFor(e),i=k(t)||new y.default;E(i.id)&&(i.id=this._generateId(e,i)),i.id=(0,h.default)(i.id);var a=this.buildInternalModel(r,i.id),n=a.getRecord();return a.loadedData(),n.setProperties(i),a.eachRelationship(function(e,t){a._relationships.get(e).setHasData(!0)}),n},_generateId:function(e,t){var r=this.adapterFor(e);return r&&r.generateIdForRecord?r.generateIdForRecord(this,e,t):null},deleteRecord:function(e){e.deleteRecord()},unloadRecord:function(e){e.unloadRecord()},find:function(e,t,r){return 1===arguments.length,"object"===j(t),this.findRecord(e,t)},findRecord:function(e,t,r){var i=this._internalModelForId(e,t);if(r=r||{},!this.hasRecordForId(e,t))return this._findByInternalModel(i,r);var a=this._findRecord(i,r);return b(a,"DS: Store#findRecord "+i.typeKey+" with id: "+T(i,"id"))},_findRecord:function(e,t){if(t.reload)return this._scheduleFetch(e,t);var r=e.createSnapshot(t),i=e.type,a=this.adapterFor(i.modelName);return a.shouldReloadRecord(this,r)?this._scheduleFetch(e,t):t.backgroundReload===!1?N.resolve(e):((t.backgroundReload||a.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),N.resolve(e))},_findByInternalModel:function(e,t){t=t||{},t.preload&&e.preloadData(t.preload);var r=this._findEmptyInternalModel(e,t);return b(r,"DS: Store#findRecord "+e.typeKey+" with id: "+T(e,"id"))},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this._scheduleFetch(e,t):e.isLoading()?e._loadingPromise:N.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=this.findRecord(e,t[i]);return(0,o.promiseArray)(O.all(r).then(z,null,"DS: Store#findByIds of "+e+" complete"))},_fetchRecord:function(e,t){var r=e.type,i=e.id,a=this.adapterFor(r.modelName);return(0,u._find)(a,this,r,i,e,t)},_scheduleFetchMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._scheduleFetch(e[r]);return N.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.type,i=O.defer("Fetching "+r.modelName+" with id: "+e.id),a={internalModel:e,resolver:i,options:t},n=i.promise;return e.loadingData(n),this._pendingFetch.get(r).push(a),C.scheduleOnce("afterRender",this,this.flushAllPendingFetches),n},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch.clear())},_flushPendingFetchForType:function(e,t){function r(e){var t=n._fetchRecord(e.internalModel,e.options);e.resolver.resolve(t)}function i(e,t){for(var r=new y.default,i=0,n=e.length;i<n;i++){var o=e[i],s=c[o.id];if(r[o.id]=o,s){var d=s.resolver;d.resolve(o)}}for(var l=[],i=0,n=t.length;i<n;i++){var o=t[i];r[o.id]||l.push(o)}l.length&&a(l)}function a(e,t){for(var r=0,i=e.length;r<i;r++){var a=c[e[r].id];a&&a.resolver.reject(t)}}for(var n=this,o=n.adapterFor(t.modelName),s=!!o.findMany&&o.coalesceFindRequests,d=e.length,l=new Array(d),c=new y.default,h=0;h<d;h++){var f=e[h],p=f.internalModel;l[h]=p,c[p.id]=f}if(s){for(var m=new Array(d),h=0;h<d;h++)m[h]=l[h].createSnapshot();for(var v=o.groupRecordsForFindMany(this,m),b=function(e,s){for(var d=v[e],l=v[e].length,h=new Array(l),f=new Array(l),p=0;p<l;p++){var m=d[p]._internalModel;f[p]=m,h[p]=m.id}if(l>1)(0,u._findMany)(o,n,t,h,f).then(function(e){i(e,f)}).catch(function(e){a(f,e)});else if(1===h.length){var y=c[f[0].id];r(y)}},h=0,g=v.length;h<g;h++)b(h,g)}else for(var h=0;h<d;h++)r(e[h])},getReference:function(e,t){return this._internalModelForId(e,t).recordReference},peekRecord:function(e,t){return this.hasRecordForId(e,t)?this._internalModelForId(e,t).getRecord():null},reloadRecord:function(e){var t=e.type.modelName;this.adapterFor(t),e.id;return this._scheduleFetch(e)},hasRecordForId:function(e,t){var r=(0,h.default)(t),i=this.modelFor(e),a=this.typeMapFor(i).idToRecord[r];return!!a&&a.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=this.modelFor(e),i=(0,h.default)(t),a=this.typeMapFor(r).idToRecord,n=a[i];return n&&a[i]||(n=this.buildInternalModel(r,i)),n},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findByInternalModel(e[r]);return N.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.type.modelName);return(0,u._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.type.modelName);return(0,u._findBelongsTo)(i,this,e,t,r)},query:function(e,t){return this._query(e,t)},_query:function(e,t,r){var i=this.modelFor(e);r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(i,t);var a=this.adapterFor(e),n=(0,o.promiseArray)((0,u._query)(a,this,i,t,r));return n},queryRecord:function(e,t){var r=this.modelFor(e),i=this.adapterFor(e);return(0,o.promiseObject)((0,u._queryRecord)(i,this,r,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=this.modelFor(e),i=this._fetchAll(r,this.peekAll(e),t);return i},_fetchAll:function(e,t,r){r=r||{};var i=this.adapterFor(e.modelName),a=this.typeMapFor(e).metadata.since;if(r.reload)return P(t,"isUpdating",!0),(0,o.promiseArray)((0,u._findAll)(i,this,e,a,r));var n=t._createSnapshot(r);return i.shouldReloadAll(this,n)?(P(t,"isUpdating",!0),(0,o.promiseArray)((0,u._findAll)(i,this,e,a,r))):r.backgroundReload===!1?(0,o.promiseArray)(N.resolve(t)):((r.backgroundReload||i.shouldBackgroundReloadAll(this,n))&&(P(t,"isUpdating",!0),(0,u._findAll)(i,this,e,a,r)),(0,o.promiseArray)(N.resolve(t)))},didUpdateAll:function(e){var t=this.recordArrayManager.liveRecordArrayFor(e);P(t,"isUpdating",!1)},peekAll:function(e){var t=this.modelFor(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.syncLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length){for(var t=this.typeMaps,r=Object.keys(t),i=new Array(r.length),a=0;a<r.length;a++)i[a]=t[r[a]].type.modelName;i.forEach(this.unloadAll,this)}else{for(var n=this.modelFor(e),o=this.typeMapFor(n),s=o.records.slice(),d=void 0,a=0;a<s.length;a++)d=s[a],d.unloadRecord(),d.destroy();o.metadata=new y.default}},filter:function(e,t,r){!x.ENABLE_DS_FILTER;var i=void 0,a=arguments.length,n=void 0,s=3===a;return s?i=this.query(e,t):2===arguments.length&&(r=t),e=this.modelFor(e),n=s?this.recordArrayManager.createFilteredRecordArray(e,r,t):this.recordArrayManager.createFilteredRecordArray(e,r),i=i||N.resolve(n),(0,o.promiseArray)(i.then(function(){return n},null,"DS: Store#filter of "+e))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},dataWasUpdated:function(e,t){this.recordArrayManager.recordDidChange(t)},scheduleSave:function(e,t,r){var i=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:i,resolver:t}),C.once(this,this.flushPendingSave)},flushPendingSave:function(){var e=this,t=this._pendingSave.slice();this._pendingSave=[],t.forEach(function(t){var r=t.snapshot,i=t.resolver,a=r._internalModel,n=e.adapterFor(a.modelClass.modelName),o=void 0;return"root.deleted.saved"===T(a,"currentState.stateName")?i.resolve():(o=a.isNew()?"createRecord":a.isDeleted()?"deleteRecord":"updateRecord",void i.resolve(R(n,e,o,r)))})},didSaveRecord:function(e,t){var r=void 0;t&&(r=t.data),r&&(this._backburner.schedule("normalizeRelationships",this,this._setupRelationships,e,r),this.updateId(e,r)),e.adapterDidCommit(r)},recordWasInvalid:function(e,t){e.adapterDidInvalidate(t)},recordWasError:function(e,t){e.adapterDidError(t)},updateId:function(e,t){var r=e.id,i=(0,h.default)(t.id);null!==r&&null===i||(this.typeMapFor(e.type).idToRecord[i]=e,e.setId(i))},typeMapFor:function(e){var t=T(this,"typeMaps"),r=w(e),i=t[r];return i?i:(i={idToRecord:new y.default,records:[],metadata:new y.default,type:e},t[r]=i,i)},_load:function(e){var t=this._internalModelForId(e.type,e.id);return t.setupData(e),this.recordArrayManager.recordDidChange(t),t},_modelForMixin:function(e){var t=(0,a.default)(e),i=(0,c.getOwner)(this),n=void 0;if(i.factoryFor){var o=i.factoryFor("mixin:"+t);n=o&&o.class}else n=i._lookupFactory("mixin:"+t);n&&i.register("model:"+t,r.default.extend(n));var s=this.modelFactoryFor(t);return s&&(s.__isMixin=!0,s.__mixin=n),s},modelFor:function(e){var t=this.modelFactoryFor(e);if(t||(t=this._modelForMixin(e)),!t)throw new S("No model was found for '"+e+"'");return t.modelName=t.modelName||(0,a.default)(e),t},modelFactoryFor:function(e){var t=(0,a.default)(e),r=(0,c.getOwner)(this);if(r.factoryFor){var i=r.factoryFor("model:"+t),n=i&&i.class;return n}return r._lookupFactory("model:"+t)},push:function(e){var t=this._push(e);if(Array.isArray(t)){var r=t.map(function(e){return e.getRecord()});return r}if(null===t)return null;var i=t.getRecord();return i},_push:function(e){var t=e.included,r=void 0,i=void 0;if(t)for(r=0,i=t.length;r<i;r++)this._pushInternalModel(t[r]);if(Array.isArray(e.data)){i=e.data.length;var a=new Array(i);for(r=0;r<i;r++)a[r]=this._pushInternalModel(e.data[r]);return a}if(null===e.data)return null;var n=this._pushInternalModel(e.data);return n},_hasModelFor:function(e){var t=(0,c.getOwner)(this);return t.factoryFor?!!t.factoryFor("model:"+e):!!t._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=this,r=(e.type,this._load(e));return this._backburner.join(function(){t._backburner.schedule("normalizeRelationships",t,t._setupRelationships,r,e)}),r},_setupRelationships:function(e,t){_(this,e,t)},pushPayload:function(e,t){var r=this,i=void 0,a=void 0;t?(a=t,i=this.serializerFor(e)):(a=e,i=g(this)),this._adapterRun(function(){return i.pushPayload(r,a)})},normalize:function(e,t){var r=this.serializerFor(e),i=this.modelFor(e);return r.normalize(i,t)},buildInternalModel:function(e,t,r){var i=this.typeMapFor(e),a=i.idToRecord,n=new m.default(e,t,this,r);return t&&(a[t]=n),i.records.push(n),n},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_dematerializeRecord:function(e){var t=e.type,r=this.typeMapFor(t),i=e.id;e.updateRecordArrays(),i&&delete r.idToRecord[i];var a=r.records.indexOf(e);r.records.splice(a,1)},adapterFor:function(e){var t=(0,a.default)(e);return this._instanceCache.get("adapter",t)},_adapterRun:function(e){return this._backburner.run(e)},serializerFor:function(e){var t=(0,a.default)(e);return this._instanceCache.get("serializer",t)},lookupAdapter:function(e){return this.adapterFor(e)},lookupSerializer:function(e){return this.serializerFor(e)},willDestroy:function(){this._super.apply(this,arguments),this.recordArrayManager.destroy(),this._instanceCache.destroy(),this.unloadAll()},_pushResourceIdentifier:function(e,t){if(!E(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!E(t)){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=this._pushResourceIdentifier(e,t[i]);return r}}}),e.Store=L,e.default=L}),t("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(void 0,t)}}function i(e,t){var r=e.finally(function(){t()||(r._subscribers.length=0)});return r}function a(e){return!(n(e,"isDestroyed")||n(e,"isDestroying"))}e._bind=r,e._guard=i,e._objectIsAlive=a;var n=t.default.get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),a=t.default.set,n=function(){function e(e,t){this._owner=e,this._store=t,this._namespaces={adapter:new r.default,serializer:new r.default}}return i(e,[{key:"get",value:function(e,t){var r=this._namespaces[e];if(r[t])return r[t];var i=e+":"+t,n=this._instanceFor(i)||this._findInstance(e,this._fallbacksFor(e,t));return n&&(r[t]=n,a(n,"store",this._store)),r[t]}},{key:"_fallbacksFor",value:function(e,t){return"adapter"===e?["application",this._store.get("adapter"),"-json-api"]:["application",this.get("adapter",t).get("defaultSerializer"),"-default"]}},{key:"_findInstance",value:function(e,t){for(var r=this._namespaces[e],i=0,a=t.length;i<a;i++){var n=t[i];if(r[n])return r[n];var o=e+":"+n,s=this._instanceFor(o);if(s)return r[n]=s,s}}},{key:"_instanceFor",value:function(e){return this._owner.lookup(e)}},{key:"destroyCache",value:function(e){for(var t=Object.keys(e),r=0,i=t.length;r<i;r++){var a=t[r],n=e[a];n&&n.destroy()}}},{key:"destroy",value:function(){this.destroyCache(this._namespaces.adapter),this.destroyCache(this._namespaces.serializer),this._namespaces=null,this._store=null,this._owner=null}},{key:"toString",value:function(){return"ContainerInstanceCache"}}]),e}();e.default=n}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/debug","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i,a,n){function o(e,t,r,o,s,d){var l=s.createSnapshot(d),u=e.findRecord(t,r,o,l),c=(0,n.serializerForAdapter)(t,e,s.type.modelName),h="DS: Handle Adapter#findRecord of "+r+" with id: "+o;return u=f.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u.then(function(e){return t._adapterRun(function(){var i=(0,a.normalizeResponseHelper)(c,t,r,e,o,"findRecord"),n=t._push(i);return n})},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+r+"'")}function s(e,r,o,s,d){var l=t.default.A(d).invoke("createSnapshot"),u=e.findMany(r,o,s,l),c=(0,n.serializerForAdapter)(r,e,o.modelName),h="DS: Handle Adapter#findMany of "+o;if(void 0===u)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return u=f.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return r._adapterRun(function(){var t=(0,a.normalizeResponseHelper)(c,r,o,e,null,"findMany"),i=r._push(t);return i})},null,"DS: Extract payload of "+o)}function d(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findHasMany(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findHasMany of "+r+" : "+s.type;return u=f.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findHasMany"),i=t.push(r),n=i.map(function(e){return e._internalModel});return n.meta=r.meta,n})},null,"DS: Extract payload of "+r+" : hasMany "+s.type)}function l(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findBelongsTo(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findBelongsTo of "+r+" : "+s.type;return u=f.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findBelongsTo");if(!r.data)return null;var i=t._push(r);return i})},null,"DS: Extract payload of "+r+" : "+s.type)}function u(e,t,r,o,s){var d=r.modelName,l=t.peekAll(d),u=l._createSnapshot(s),c=e.findAll(t,r,o,u),h=(0,n.serializerForAdapter)(t,e,d),p="DS: Handle Adapter#findAll of "+r;return c=f.resolve(c,p),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,t)),c.then(function(e){return t._adapterRun(function(){var i=(0,a.normalizeResponseHelper)(h,t,r,e,null,"findAll");t._push(i)}),t.didUpdateAll(r),t.peekAll(d)},null,"DS: Extract payload of findAll "+r)}function c(e,t,r,o,s){var d=r.modelName,l=e.query(t,r,o,s),u=(0,n.serializerForAdapter)(t,e,d),c="DS: Handle Adapter#query of "+r;return l=f.resolve(l,c),l=(0,i._guard)(l,(0,i._bind)(i._objectIsAlive,t)),l.then(function(e){var i=void 0,n=void 0;return t._adapterRun(function(){n=(0,a.normalizeResponseHelper)(u,t,r,e,null,"query"),i=t._push(n)}),s._setInternalModels(i,n),
|
4
|
+
s},null,"DS: Extract payload of query "+r)}function h(e,t,r,o){var s=r.modelName,d=e.queryRecord(t,r,o),l=(0,n.serializerForAdapter)(t,e,s),u="DS: Handle Adapter#queryRecord of "+r;return d=f.resolve(d,u),d=(0,i._guard)(d,(0,i._bind)(i._objectIsAlive,t)),d.then(function(e){var i;return t._adapterRun(function(){var n=(0,a.normalizeResponseHelper)(l,t,r,e,null,"queryRecord");i=t._push(n)}),i},null,"DS: Extract payload of queryRecord "+r)}e._find=o,e._findMany=s,e._findHasMany=d,e._findBelongsTo=l,e._findAll=u,e._query=c,e._queryRecord=h;var f=t.default.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){var t=[];return e&&"object"==typeof e?("data"in e||"errors"in e||"meta"in e?"data"in e&&"errors"in e&&t.push('Top level keys "errors" and "data" cannot both be present in a JSON API document'):t.push('One or more of the following keys must be present: "data", "errors", "meta".'),"data"in e&&(null===e.data||Array.isArray(e.data)||"object"==typeof e.data||t.push("data must be null, an object, or an array")),"meta"in e&&"object"!=typeof e.meta&&t.push("meta must be an object"),"errors"in e&&(Array.isArray(e.errors)||t.push("errors must be an array")),"links"in e&&"object"!=typeof e.links&&t.push("links must be an object"),"jsonapi"in e&&"object"!=typeof e.jsonapi&&t.push("jsonapi must be an object"),"included"in e&&"object"!=typeof e.included&&t.push("included must be an array")):t.push("Top level of a JSON API document must be an object"),t}function a(e,t,r,i,a,n){var o=e.normalizeResponse(t,r,i,a,n);return o}e.validateDocumentStructure=i,e.normalizeResponseHelper=a}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var i=t.serializer;return void 0===i&&(i=e.serializerFor(r)),null!==i&&void 0!==i||(i={extract:function(e,t,r){return r}}),i}e.serializerForAdapter=t}),t("ember-data/-private/transforms",["exports","ember-data/transform","ember-data/-private/transforms/number","ember-data/-private/transforms/date","ember-data/-private/transforms/string","ember-data/-private/transforms/boolean"],function(e,t,r,i,a,n){e.Transform=t.default,e.NumberTransform=r.default,e.DateTransform=i.default,e.StringTransform=a.default,e.BooleanTransform=n.default}),t("ember-data/-private/transforms/boolean",["exports","ember","ember-data/transform"],function(e,t,r){var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e,t){var r=typeof e;return i(e)&&t.allowNull===!0?null:"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r&&1===e},serialize:function(e,t){return i(e)&&t.allowNull===!0?null:Boolean(e)}})}),t("ember-data/-private/transforms/date",["exports","ember-data/-private/ext/date","ember-data/transform"],function(e,t,r){e.default=r.default.extend({deserialize:function(e){var r=typeof e;return"string"===r?new Date((0,t.parseDate)(e)):"number"===r?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date&&!isNaN(e)?e.toISOString():null}})}),t("ember-data/-private/transforms/number",["exports","ember","ember-data/transform"],function(e,t,r){function i(e){return e===e&&e!==1/0&&e!==-(1/0)}var a=t.default.isEmpty;e.default=r.default.extend({deserialize:function(e){var t;return a(e)?null:(t=Number(e),i(t)?t:null)},serialize:function(e){var t;return a(e)?null:(t=Number(e),i(t)?t:null)}})}),t("ember-data/-private/transforms/string",["exports","ember","ember-data/transform"],function(e,t,r){var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e){return i(e)?null:String(e)},serialize:function(e){return i(e)?null:String(e)}})}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return a(e,"attributes").has("type")||a(e,"relationshipsByName").has("type")}function i(e){var r;return t.default.getOwner?r=t.default.getOwner(e):e.container&&(r=e.container),r&&r.lookupFactory&&!r._lookupFactory&&(r._lookupFactory=r.lookupFactory,r.register=function(){var e=r.registry||r._registry||r;return e.register.apply(e,arguments)}),r}var a=t.default.get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=i}),t("ember-data/-private/utils/parse-response-headers",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){return Array.isArray(e)?e:Array.from(e)}function i(e){var i=new t.default;if(!e)return i;var n=e.split(a);return n.forEach(function(e){var t=e.split(":"),a=r(t),n=a[0],o=a.slice(1);n=n.trim(),o=o.join(":").trim(),o&&(i[n]=o)}),i}e.default=i;var a="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){e.default=t.default.Object.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return e.serialize(t)},createRecord:null,updateRecord:null,deleteRecord:null,coalesceFindRequests:!0,findMany:null,groupRecordsForFindMany:function(e,t){return[t]},shouldReloadRecord:function(e,t){return!1},shouldReloadAll:function(e,t){return!t.length},shouldBackgroundReloadRecord:function(e,t){return!0},shouldBackgroundReloadAll:function(e,t){return!0}})}),t("ember-data/adapters/errors",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i){function a(e){var t=arguments.length<=1||void 0===arguments[1]?"Adapter operation failed":arguments[1];this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=t.message;return o(e,r)}}function o(e,t){var r=function(r,i){e.call(this,r,i||t)};return r.prototype=Object.create(e.prototype),f&&(r.extend=n(r)),r}function s(e){var r=[];return t.default.isPresent(e)&&Object.keys(e).forEach(function(i){for(var a=t.default.makeArray(e[i]),n=0;n<a.length;n++){var o="Invalid Attribute",s="/data/attributes/"+i;i===h&&(o="Invalid Document",s="/data"),r.push({title:o,detail:a[n],source:{pointer:s}})}}),r}function d(e){var r={};return t.default.isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(u);t?t=t[2]:e.source.pointer.search(c)!==-1&&(t=h),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.AdapterError=a,e.errorsHashToArray=s,e.errorsArrayToHash=d;var l=t.default.Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base",f=!1;a.prototype=Object.create(l.prototype),f&&(a.extend=n(a));var p=o(a,"The adapter rejected the commit because it was invalid");e.InvalidError=p;var m=o(a,"The adapter operation timed out");e.TimeoutError=m;var y=o(a,"The adapter operation was aborted");e.AbortError=y;var v=f?o(a,"The adapter operation is unauthorized"):null;e.UnauthorizedError=v;var b=f?o(a,"The adapter operation is forbidden"):null;e.ForbiddenError=b;var g=f?o(a,"The adapter could not find the resource"):null;e.NotFoundError=g;var R=f?o(a,"The adapter operation failed due to a conflict"):null;e.ConflictError=R;var _=f?o(a,"The adapter operation failed due to a server error"):null;e.ServerError=_}),t("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest","ember-data/-private/features","ember-data/-private/debug"],function(e,t,r,i,a){var n=r.default.extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var i=this._super.apply(this,arguments);i.contentType&&(i.contentType="application/vnd.api+json");var a=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),a&&a(e)},i},coalesceFindRequests:!1,findMany:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(a,"GET",{data:{filter:{id:r.join(",")}}})},pathForType:function(e){var r=t.default.String.dasherize(e);return t.default.String.pluralize(r)},updateRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName);a.serializeIntoHash(i,t,r,{includeId:!0});var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PATCH",{data:i})},_hasCustomizedAjax:function(){return this.ajax!==n.prototype.ajax||this.ajaxOptions!==n.prototype.ajaxOptions}});e.default=n}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/adapters/errors","ember-data/-private/adapters/build-url-mixin","ember-data/-private/features","ember-data/-private/debug","ember-data/-private/utils/parse-response-headers"],function(e,t,r,i,a,n,o,s){function d(e,t,r,i){var a=void 0;try{a=e.handleResponse(t.status,(0,s.default)(t.getAllResponseHeaders()),r,i)}catch(e){return f.reject(e)}return a&&a.isAdapterError?f.reject(a):a}function l(e,t,r,a){var n=void 0;if(a.errorThrown instanceof Error)n=a.errorThrown;else if("timeout"===a.textStatus)n=new i.TimeoutError;else if("abort"===a.textStatus||0===t.status)n=new i.AbortError;else try{n=e.handleResponse(t.status,(0,s.default)(t.getAllResponseHeaders()),e.parseErrorResponse(t.responseText)||a.errorThrown,r)}catch(e){n=e}return n}function u(e,t){return"function"!=typeof String.prototype.endsWith?e.indexOf(t,e.length-t.length)!==-1:e.endsWith(t)}var c=t.default.MapWithDefault,h=t.default.get,f=t.default.RSVP.Promise,p=r.default.extend(a.default,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},a=t.sort(),n=0;n<r;n++)i[a[n]]=e[a[n]];return i},coalesceFindRequests:!1,findRecord:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findRecord"),n=this.buildQuery(i);return this.ajax(a,"GET",{data:n})},findAll:function(e,t,r,i){var a=this.buildQuery(i),n=this.buildURL(t.modelName,null,i,"findAll");return r&&(a.since=r),this.ajax(n,"GET",{data:a})},query:function(e,t,r){var i=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(i,"GET",{data:r})},queryRecord:function(e,t,r){var i=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(i,"GET",{data:r})},findMany:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(a,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,i){var a=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,a,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,i){var a=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,a,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName),n=this.buildURL(t.modelName,null,r,"createRecord");return a.serializeIntoHash(i,t,r,{includeId:!0}),this.ajax(n,"POST",{data:i})},updateRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName);a.serializeIntoHash(i,t,r);var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PUT",{data:i})},deleteRecord:function(e,t,r){var i=r.id;return this.ajax(this.buildURL(t.modelName,i,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),a=i[i.length-1],n=t.id;return decodeURIComponent(a)===n?i[i.length-1]="":u(a,"?id="+n)&&(i[i.length-1]=a.substring(0,a.length-n.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var n=a._stripIDFromURL(e,t[0]),o=0,s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;n.length+o+t>=r&&(o=0,s.push([])),o+=t;var a=s.length-1;s[a].push(e)}),s}var i=c.create({defaultValue:function(){return[]}}),a=this,n=this.maxURLLength;t.forEach(function(t){var r=a._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){var i="&ids%5B%5D=".length,a=r(e,n,i);a.forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,a){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new i.InvalidError(r.errors);var n=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,a);return new i.AdapterError(n,o)},isSuccess:function(e,t,r){return e>=200&&e<300||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,r,i){var a=this,n={url:e,method:r};return new f(function(o,s){var u=a.ajaxOptions(e,r,i);u.success=function(e,r,i){var s=d(a,i,e,n);t.default.run.join(null,o,s)},u.error=function(e,r,i){var o={textStatus:r,errorThrown:i},d=l(a,e,n,o);t.default.run.join(null,s,d)},a._ajaxRequest(u)},"DS: RESTAdapter#ajax "+r+" to "+e)},_ajaxRequest:function(e){t.default.$.ajax(e)},ajaxOptions:function(e,t,r){var i=r||{};i.url=e,i.type=t,i.dataType="json",i.context=this,i.data&&"GET"!==t&&(i.contentType="application/json; charset=utf-8",i.data=JSON.stringify(i.data));var a=h(this,"headers");return void 0!==a&&(i.beforeSend=function(e){Object.keys(a).forEach(function(t){return e.setRequestHeader(t,a[t])})}),i},parseErrorResponse:function(e){var r=e;try{r=t.default.$.parseJSON(e)}catch(e){}return r},normalizeErrorResponse:function(e,t,r){return r&&"object"==typeof r&&r.errors?r.errors:[{status:""+e,title:"The backend responded with an error",detail:""+r}]},generatedDetailedMessage:function(e,t,r,i){var a,n=t["Content-Type"]||"Empty Content-Type";a="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r;var o=i.method+" "+i.url,s="Payload ("+n+")";return["Ember Data Request "+o+" returned a "+e,s,a].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t},_hasCustomizedAjax:function(){return this.ajax!==p.prototype.ajax||this.ajaxOptions!==p.prototype.ajaxOptions}});e.default=p}),t("ember-data/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var i=t.defaultValue;return i}function a(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function n(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function o(e,r){"object"==typeof e?(r=e,e=void 0):r=r||{};var o={type:e,isAttribute:!0,options:r};return t.default.computed({get:function(e){var t=this._internalModel;return a(t,e)?n(t,e):i(this,r,e)},set:function(e,t){var r,i=this._internalModel,a=n(i,e);return t!==a&&(i._attributes[e]=t,r=e in i._inFlightAttributes?i._inFlightAttributes[e]:i._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:a,originalValue:r,value:t})),t}}).meta(o)}e.default=o}),t("ember-data",["exports","ember","ember-data/-private/debug","ember-data/-private/features","ember-data/-private/global","ember-data/-private/core","ember-data/-private/system/normalize-model-name","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/store","ember-data/-private/system/model","ember-data/model","ember-data/-private/system/snapshot","ember-data/adapter","ember-data/serializer","ember-data/-private/system/debug","ember-data/adapters/errors","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/adapters","ember-data/-private/adapters/build-url-mixin","ember-data/-private/serializers","ember-inflector","ember-data/serializers/embedded-records-mixin","ember-data/-private/transforms","ember-data/relationships","ember-data/setup-container","ember-data/-private/instance-initializers/initialize-store-service","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,f,p,m,y,v,b,g,R,_,A,z,F,M,k,x,S,T){if(t.default.VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new t.default.Error("Ember Data requires at least Ember 1.13.0, but you have "+t.default.VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");n.default.Store=l.Store,n.default.PromiseArray=d.PromiseArray,n.default.PromiseObject=d.PromiseObject,n.default.PromiseManyArray=d.PromiseManyArray,n.default.Model=c.default,n.default.RootState=u.RootState,n.default.attr=u.attr,n.default.Errors=u.Errors,n.default.InternalModel=s.default,n.default.Snapshot=h.default,n.default.Adapter=f.default,n.default.AdapterError=y.AdapterError,n.default.InvalidError=y.InvalidError,n.default.TimeoutError=y.TimeoutError,n.default.AbortError=y.AbortError,n.default.errorsHashToArray=y.errorsHashToArray,n.default.errorsArrayToHash=y.errorsArrayToHash,n.default.Serializer=p.default,n.default.DebugAdapter=m.default,n.default.RecordArray=v.RecordArray,n.default.FilteredRecordArray=v.FilteredRecordArray,n.default.AdapterPopulatedRecordArray=v.AdapterPopulatedRecordArray,n.default.ManyArray=b.default,n.default.RecordArrayManager=g.default,n.default.RESTAdapter=R.RESTAdapter,n.default.BuildURLMixin=_.default,n.default.RESTSerializer=A.RESTSerializer,n.default.JSONSerializer=A.JSONSerializer,n.default.JSONAPIAdapter=R.JSONAPIAdapter,n.default.JSONAPISerializer=A.JSONAPISerializer,n.default.Transform=M.Transform,n.default.DateTransform=M.DateTransform,n.default.StringTransform=M.StringTransform,n.default.NumberTransform=M.NumberTransform,n.default.BooleanTransform=M.BooleanTransform,n.default.EmbeddedRecordsMixin=F.default,n.default.belongsTo=k.belongsTo,n.default.hasMany=k.hasMany,n.default.Relationship=T.default,n.default._setupContainer=x.default,n.default._initializeStoreService=S.default,Object.defineProperty(n.default,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:o.default}),Object.defineProperty(a.default,"DS",{configurable:!0,get:function(){return n.default}}),e.default=n.default}),t("ember-data/initializers/data-adapter",["exports","ember"],function(e,t){e.default={name:"data-adapter",before:"store",initialize:function(){}}}),t("ember-data/initializers/ember-data",["exports","ember-data/setup-container","ember-data/-private/core"],function(e,t,r){e.default={name:"ember-data",initialize:t.default}}),t("ember-data/initializers/injectStore",["exports","ember"],function(e,t){e.default={name:"injectStore",before:"store",initialize:function(){}}}),t("ember-data/initializers/store",["exports","ember"],function(e,t){e.default={name:"store",after:"ember-data",initialize:function(){}}}),t("ember-data/initializers/transforms",["exports","ember"],function(e,t){e.default={name:"transforms",before:"store",initialize:function(){}}}),t("ember-data/instance-initializers/ember-data",["exports","ember-data/-private/instance-initializers/initialize-store-service"],function(e,t){e.default={name:"ember-data",initialize:t.default}}),t("ember-data/model",["exports","ember-data/-private/system/model"],function(e,t){e.default=t.default}),t("ember-data/relationships",["exports","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many"],function(e,t,r){e.belongsTo=t.default,e.hasMany=r.default}),t("ember-data/serializer",["exports","ember"],function(e,t){e.default=t.default.Object.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var a=t.default.get,n=t.default.set,o=t.default.String.camelize;e.default=t.default.Mixin.create({normalize:function(e,t,r){var i=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,i)},keyForRelationship:function(e,t,r){return"serialize"===r&&this.hasSerializeRecordsOption(e)||"deserialize"===r&&this.hasDeserializeRecordsOption(e)?this.keyForAttribute(e,r):this._super(e,t,r)||e},serializeBelongsTo:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);var a=this.hasSerializeIdsOption(i),n=this.hasSerializeRecordsOption(i),o=e.belongsTo(i);if(a){var s=this._getMappedKey(r.key,e.type);s===r.key&&this.keyForRelationship&&(s=this.keyForRelationship(r.key,r.kind,"serialize")),o?(t[s]=o.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[s]=null}else n&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[a]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[a]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[a]=null},serializeHasMany:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);if(this.hasSerializeIdsOption(i)){var a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),t[a]=e.hasMany(i,{ids:!0})}else this.hasSerializeRecordsOption(i)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(i)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,r,i){var a=this.keyForAttribute(i.key,"serialize"),n=e.hasMany(i.key);r[a]=t.default.A(n).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),t[i]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,r){for(var i=e.hasMany(r.key),a=t.default.A(i),n=new Array(a.length),o=0;o<a.length;o++){var s=a[o],d=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,d),n[o]=d}return n},removeEmbeddedForeignKey:function(e,t,r,i){if("hasMany"!==r.kind&&"belongsTo"===r.kind){var a=e.type.inverseFor(r.key,this.store);if(a){var n=a.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(n,a.kind,"deserialize");s&&delete i[s]}}},hasEmbeddedAlwaysOption:function(e){var t=this.attrsOption(e);return t&&"always"===t.embedded},hasSerializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.serialize},hasSerializeIdsOption:function(e){var t=this.attrsOption(e);return t&&("ids"===t.serialize||"id"===t.serialize)},hasSerializeIdsAndTypesOption:function(e){var t=this.attrsOption(e);return t&&("ids-and-types"===t.serialize||"id-and-type"===t.serialize)},noSerializeOptionSpecified:function(e){var t=this.attrsOption(e);return!(t&&(t.serialize||t.embedded))},hasDeserializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.deserialize},attrsOption:function(e){var t=this.get("attrs");return t&&(t[o(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var a=this;return r.eachRelationship(function(r,n){e.hasDeserializeRecordsOption(r)&&("hasMany"===n.kind&&a._extractEmbeddedHasMany(t,r,i,n),"belongsTo"===n.kind&&a._extractEmbeddedBelongsTo(t,r,i,n))}),i},_extractEmbeddedHasMany:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){for(var d=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=this._normalizeEmbeddedRelationship(e,o,u),h=c.data,f=c.included;if(r.included=r.included||[],r.included.push(h),f){var p;(p=r.included).push.apply(p,i(f))}d[l]={id:h.id,type:h.type}}var m={data:d};n(r,"data.relationships."+t,m)}},_extractEmbeddedBelongsTo:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){var d=this._normalizeEmbeddedRelationship(e,o,s),l=d.data,u=d.included;if(r.included=r.included||[],r.included.push(l),u){var c;(c=r.included).push.apply(c,i(u))}var h={id:l.id,type:l.type},f={data:h};n(r,"data.relationships."+t,f)}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var a=e.modelFor(i),n=e.serializerFor(i);return n.normalize(a,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/features"],function(e,t,r,i,a,n,o){var s=t.default.String.dasherize,d=i.default.extend({_normalizeDocumentHelper:function(e){if("object"===t.default.typeOf(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeResourceHelper(a)}e.data=r}if(Array.isArray(e.included)){for(var r=new Array(e.included.length),i=0;i<e.included.length;i++){var n=e.included[i];r[i]=this._normalizeResourceHelper(n)}e.included=r}return e},_normalizeRelationshipDataHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);return e.type=t,e},_normalizeResourceHelper:function(e){var t=void 0,r=void 0;if(t=this.modelNameFromPayloadKey(e.type),r="modelNameFromPayloadKey",!this.store._hasModelFor(t))return null;var i=this.store.modelFor(t),a=this.store.serializerFor(t),n=a.normalize(i,e),o=n.data;return o},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);e.push(r)},_normalizeResponse:function(e,t,r,i,a,n){var o=this._normalizeDocumentHelper(r);return o},normalizeQueryRecordResponse:function(){var e=this._super.apply(this,arguments);return e},extractAttributes:function(e,t){var r=this,i={};return t.attributes&&e.eachAttribute(function(e){var a=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[a]&&(i[e]=t.attributes[a])}),i},extractRelationship:function(e){if("object"===t.default.typeOf(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeRelationshipDataHelper(a)}e.data=r}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,a){var n=r.keyForRelationship(e,a.kind,"deserialize");if(void 0!==t.relationships[n]){var o=t.relationships[n];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,a.default)(e))},payloadKeyFromModelName:function(e){return(0,n.pluralize)(e)},normalize:function(e,t){t.attributes&&this.normalizeUsingDeclaredMapping(e,t.attributes),t.relationships&&this.normalizeUsingDeclaredMapping(e,t.relationships);var r={id:this.extractId(e,t),type:this._extractType(e,t),attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)};return this.applyTransforms(e,r.attributes),{data:r}},keyForAttribute:function(e,t){return s(e)},keyForRelationship:function(e,t,r){return s(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),i=void 0;return i=this.payloadKeyFromModelName(e.modelName),r.type=i,{data:r}},serializeAttribute:function(e,t,r,i){var a=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var n=e.attr(r);if(a){var o=this.transformFor(a);n=o.serialize(n,i.options)}var s=this._getMappedKey(r,e.type);s===r&&(s=this.keyForAttribute(r,"serialize")),t.attributes[s]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i);if(void 0!==a){t.relationships=t.relationships||{};var n=this._getMappedKey(i,e.type);n===i&&(n=this.keyForRelationship(i,"belongsTo","serialize"));var o=null;if(a){var s=void 0;s=this.payloadKeyFromModelName(a.modelName),o={type:s,id:a.id}}t.relationships[n]={data:o}}}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if(this[a](e,i,r)){var n=e.hasMany(i);if(void 0!==n){t.relationships=t.relationships||{};var o=this._getMappedKey(i,e.type);o===i&&this.keyForRelationship&&(o=this.keyForRelationship(i,"hasMany","serialize"));for(var s=new Array(n.length),d=0;d<n.length;d++){var l=n[d],u=void 0;u=this.payloadKeyFromModelName(l.modelName),s[d]={type:u,id:l.id}}t.relationships[o]={data:s}}}}});e.default=d}),t("ember-data/serializers/json",["exports","ember","ember-data/-private/debug","ember-data/serializer","ember-data/-private/system/coerce-id","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/features","ember-data/adapters/errors"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t.default.get,c=t.default.isNone,h=t.default.assign||t.default.merge,f=i.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=u(e,"attributes");return e.eachTransformedAttribute(function(e,a){if(void 0!==t[e]){var n=r.transformFor(a),o=i.get(e);t[e]=n.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,a){switch(a){case"findRecord":return this.normalizeFindRecordResponse.apply(this,arguments);case"queryRecord":return this.normalizeQueryRecordResponse.apply(this,arguments);case"findAll":return this.normalizeFindAllResponse.apply(this,arguments);case"findBelongsTo":return this.normalizeFindBelongsToResponse.apply(this,arguments);case"findHasMany":return this.normalizeFindHasManyResponse.apply(this,arguments);case"findMany":return this.normalizeFindManyResponse.apply(this,arguments);case"query":return this.normalizeQueryResponse.apply(this,arguments);case"createRecord":return this.normalizeCreateRecordResponse.apply(this,arguments);case"deleteRecord":return this.normalizeDeleteRecordResponse.apply(this,arguments);case"updateRecord":return this.normalizeUpdateRecordResponse.apply(this,arguments)}},normalizeFindRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!0)},normalizeArrayResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!1)},_normalizeResponse:function(e,t,r,i,a,n){var o={data:null,included:[]},s=this.extractMeta(e,t,r);if(s&&(o.meta=s),n){var d=this.normalize(t,r),u=d.data,c=d.included;o.data=u,c&&(o.included=c)}else{for(var h=new Array(r.length),f=0,p=r.length;f<p;f++){var m=r[f],y=this.normalize(t,m),u=y.data,c=y.included;if(c){var v;(v=o.included).push.apply(v,l(c))}h[f]=u}o.data=h}return o},normalize:function(e,r){var i=null;return r&&(this.normalizeUsingDeclaredMapping(e,r),"object"===t.default.typeOf(r.links)&&this.normalizeUsingDeclaredMapping(e,r.links),i={id:this.extractId(e,r),type:e.modelName,attributes:this.extractAttributes(e,r),relationships:this.extractRelationships(e,r)},this.applyTransforms(e,i.attributes)),{data:i}},extractId:function(e,t){var r=u(this,"primaryKey"),i=t[r];return(0,a.default)(i)},extractAttributes:function(e,t){var r,i=this,a={};return e.eachAttribute(function(e){r=i.keyForAttribute(e,"deserialize"),void 0!==t[r]&&(a[e]=t[r])}),a},extractRelationship:function(e,r){if(t.default.isNone(r))return null;if("object"===t.default.typeOf(r)){r.id&&(r.id=(0,a.default)(r.id));var i=this.store.modelFor(e);if(r.type&&!(0,o.modelHasAttributeOrRelationshipNamedType)(i)){r.type=this.modelNameFromPayloadKey(r.type)}return r}return{id:(0,a.default)(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){
|
5
|
+
var i=this,a={};return e.eachRelationship(function(e,n){var o=null,s=i.keyForRelationship(e,n.kind,"deserialize");if(void 0!==r[s]){var d=null,l=r[s];if("belongsTo"===n.kind)d=n.options.polymorphic?i.extractPolymorphicRelationship(n.type,l,{key:e,resourceHash:r,relationshipMeta:n}):i.extractRelationship(n.type,l);else if("hasMany"===n.kind&&!t.default.isNone(l)){d=new Array(l.length);for(var u=0,c=l.length;u<c;u++){var h=l[u];d[u]=i.extractRelationship(n.type,h)}}o={data:d}}var f=i.keyForLink(e,n.kind);if(r.links&&void 0!==r.links[f]){var p=r.links[f];o=o||{},o.links={related:p}}o&&(a[e]=o)}),a},modelNameFromPayloadKey:function(e){return(0,n.default)(e)},normalizeRelationships:function(e,t){var r,i=this;this.keyForRelationship&&e.eachRelationship(function(e,a){r=i.keyForRelationship(e,a.kind,"deserialize"),e!==r&&void 0!==t[r]&&(t[e]=t[r],delete t[r])})},normalizeUsingDeclaredMapping:function(e,t){var r,i,a,n=u(this,"attrs");if(n)for(a in n)r=i=this._getMappedKey(a,e),void 0!==t[i]&&(u(e,"attributes").has(a)&&(r=this.keyForAttribute(a)),u(e,"relationshipsByName").has(a)&&(r=this.keyForRelationship(a)),i!==r&&(t[r]=t[i],delete t[i]))},_getMappedKey:function(e,t){var r,i=u(this,"attrs");return i&&i[e]&&(r=i[e],r.key&&(r=r.key),"string"==typeof r&&(e=r)),e},_canSerialize:function(e){var t=u(this,"attrs");return!t||!t[e]||t[e].serialize!==!1},_mustSerialize:function(e){var t=u(this,"attrs");return t&&t[e]&&t[e].serialize===!0},shouldSerializeHasMany:function(e,t,r){return this._shouldSerializeHasMany!==f.prototype._shouldSerializeHasMany,this._shouldSerializeHasMany(e,t,r)},_shouldSerializeHasMany:function(e,t,r){var i=e.type.determineRelationshipType(r,this.store);return!!this._mustSerialize(t)||this._canSerialize(t)&&("manyToNone"===i||"manyToMany"===i)},serialize:function(e,t){var r=this,i={};if(t&&t.includeId){var a=e.id;a&&(i[u(this,"primaryKey")]=a)}return e.eachAttribute(function(t,a){r.serializeAttribute(e,i,t,a)}),e.eachRelationship(function(t,a){"belongsTo"===a.kind?r.serializeBelongsTo(e,i,a):"hasMany"===a.kind&&r.serializeHasMany(e,i,a)}),i},serializeIntoHash:function(e,t,r,i){h(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){var a=i.type;if(this._canSerialize(r)){var n=e.attr(r);if(a){var o=this.transformFor(a);n=o.serialize(n,i.options)}var s=this._getMappedKey(r,e.type);s===r&&this.keyForAttribute&&(s=this.keyForAttribute(r,"serialize")),t[s]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i,{id:!0}),n=this._getMappedKey(i,e.type);n===i&&this.keyForRelationship&&(n=this.keyForRelationship(i,"belongsTo","serialize")),c(a)?t[n]=null:t[n]=a,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if(this[a](e,i,r)){var n=e.hasMany(i,{ids:!0});if(void 0!==n){var o=this._getMappedKey(i,e.type);o===i&&this.keyForRelationship&&(o=this.keyForRelationship(i,"hasMany","serialize")),t[o]=n}}},serializePolymorphicType:function(){},extractMeta:function(e,t,r){if(r&&void 0!==r.meta){var i=r.meta;return delete r.meta,i}},extractErrors:function(e,t,r,i){var a=this;return r&&"object"==typeof r&&r.errors&&(r=(0,d.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=a.keyForAttribute(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=a.keyForRelationship(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var r=(0,o.getOwner)(this).lookup("transform:"+e);return r}});e.default=f}),t("ember-data/serializers/rest",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/system/coerce-id","ember-data/-private/utils","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t.default.String.camelize,c=i.default.extend({keyForPolymorphicType:function(e,t,r){var i=this.keyForRelationship(e);return i+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,r,i,a){var n=this,o={data:[],included:[]},s=e.modelFor(r),d=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,a,s,d),i=r.data,u=r.included;if(o.data.push(i),u){var c;(c=o.included).push.apply(c,l(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,i,a){var n=a,o=i,d=(0,s.modelHasAttributeOrRelationshipNamedType)(i);if(!d&&t.type){var l=void 0;l=this.modelNameFromPayloadKey(t.type),e._hasModelFor(l)&&(n=e.serializerFor(l),o=e.modelFor(l))}return n.normalize(o,t,r)},_normalizeResponse:function(e,r,i,a,n,s){var d={data:null,included:[]},u=this.extractMeta(e,r,i);u&&(d.meta=u);for(var c=Object.keys(i),h=0,f=c.length;h<f;h++){var p=c[h],m=p,y=!1;"_"===p.charAt(0)&&(y=!0,m=p.substr(1));var v=this.modelNameFromPayloadKey(m);if(e.modelFactoryFor(v)){var b=!y&&this.isPrimaryType(e,v,r),g=i[p];if(null!==g)if(b&&"array"!==t.default.typeOf(g)){var R=this._normalizePolymorphicRecord(e,g,p,r,this),_=R.data,A=R.included;if(d.data=_,A){var z;(z=d.included).push.apply(z,l(A))}}else{var F=this._normalizeArray(e,v,g,p),M=F.data,k=F.included;if(k){var x;(x=d.included).push.apply(x,l(k))}if(s)M.forEach(function(e){var t=b&&(0,o.default)(e.id)===a,r=b&&!a&&!d.data;r||t?d.data=e:d.included.push(e)});else if(b)d.data=M;else if(M){var S;(S=d.included).push.apply(S,l(M))}}}}return d},isPrimaryType:function(e,t,r){var i=e.modelFor(t);return i.modelName===r.modelName},pushPayload:function(e,r){var i={data:[],included:[]};for(var a in r){var n=this.modelNameFromPayloadKey(a);if(e.modelFactoryFor(n)){var o=e.modelFor(n),s=e.serializerFor(o.modelName);t.default.makeArray(r[a]).forEach(function(e){var t=s.normalize(o,e,a),r=t.data,n=t.included;if(i.data.push(r),n){var d;(d=i.included).push.apply(d,l(n))}})}}e.push(i)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,a.default)(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,i){var a=this.payloadKeyFromModelName(t.modelName);e[a]=this.serialize(r,i)},payloadKeyFromModelName:function(e){return u(e)},serializePolymorphicType:function(e,r,i){var a=i.key,n=e.belongsTo(a),o=this.keyForPolymorphicType(a,i.type,"serialize");a=this.keyForAttribute?this.keyForAttribute(a,"serialize"):a,a+="Type",a!==o&&this.keyForPolymorphicType===c.prototype.keyForPolymorphicType&&(o=a),t.default.isNone(n)?r[o]=null:r[o]=u(n.modelName)},extractPolymorphicRelationship:function(e,t,r){var i=r.key,a=r.resourceHash,n=r.relationshipMeta,o=n.options.polymorphic,s=this.keyForPolymorphicType(i,e,"deserialize");if(o&&void 0!==a[s]&&"object"!=typeof t){var d,d=this.modelNameFromPayloadKey(a[s]);return{id:t,type:d}}return this._super.apply(this,arguments)}});e.default=c}),t("ember-data/setup-container",["exports","ember-data/-private/initializers/store","ember-data/-private/initializers/transforms","ember-data/-private/initializers/store-injections","ember-data/-private/initializers/data-adapter"],function(e,t,r,i,a){function n(e){(0,a.default)(e),(0,r.default)(e),(0,i.default)(e),(0,t.default)(e)}e.default=n}),t("ember-data/store",["exports","ember-data/-private/system/store"],function(e,t){e.default=t.default}),t("ember-data/transform",["exports","ember"],function(e,t){e.default=t.default.Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.default="2.11.1"}),t("ember-inflector",["exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i,a){i.Inflector.defaultRules=i.defaultRules,r.default.Inflector=i.Inflector,r.default.String.pluralize=i.pluralize,r.default.String.singularize=i.singularize,e.default=i.Inflector,e.pluralize=i.pluralize,e.singularize=i.singularize,e.defaultRules=i.defaultRules,"undefined"!=typeof t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=i.Inflector,e.pluralize=i.pluralize,e.singularize=i.singularize,e}):"undefined"!=typeof module&&module.exports&&(module.exports=i.Inflector,i.Inflector.singularize=i.singularize,i.Inflector.pluralize=i.pluralize)}),t("ember-inflector/lib/ext/string",["exports","ember","ember-inflector/lib/system/string"],function(e,t,r){(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,r.pluralize)(this)},String.prototype.singularize=function(){return(0,r.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.default=(0,r.default)(function(e){var r=void 0,i=void 0;return 1===e.length?(i=e[0],(0,t.pluralize)(i)):(r=e[0],i=e[1],1!==parseFloat(r)&&(i=(0,t.pluralize)(i)),r+" "+i)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.default=(0,r.default)(function(e){return(0,t.singularize)(e[0])})}),t("ember-inflector/lib/system",["exports","ember-inflector/lib/system/inflector","ember-inflector/lib/system/string","ember-inflector/lib/system/inflections"],function(e,t,r,i){t.default.inflector=new t.default(i.default),e.Inflector=t.default,e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=i.default}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e.default={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status|bonus)$/i,"$1es"],[/(bu)s$/i,"$1ses"],[/(buffal|tomat)o$/i,"$1oes"],[/([ti])um$/i,"$1a"],[/([ti])a$/i,"$1a"],[/sis$/i,"ses"],[/(?:([^f])fe|([lr])f)$/i,"$1$2ves"],[/(hive)$/i,"$1s"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(x|ch|ss|sh)$/i,"$1es"],[/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"],[/^(m|l)ouse$/i,"$1ice"],[/^(m|l)ice$/i,"$1ice"],[/^(ox)$/i,"$1en"],[/^(oxen)$/i,"$1"],[/(quiz)$/i,"$1zes"]],singular:[[/s$/i,""],[/(ss)$/i,"$1"],[/(n)ews$/i,"$1ews"],[/([ti])a$/i,"$1um"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"],[/(^analy)(sis|ses)$/i,"$1sis"],[/([^f])ves$/i,"$1fe"],[/(hive)s$/i,"$1"],[/(tive)s$/i,"$1"],[/([lr])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/(s)eries$/i,"$1eries"],[/(m)ovies$/i,"$1ovie"],[/(x|ch|ss|sh)es$/i,"$1"],[/^(m|l)ice$/i,"$1ouse"],[/(bus)(es)?$/i,"$1"],[/(o)es$/i,"$1"],[/(shoe)s$/i,"$1"],[/(cris|test)(is|es)$/i,"$1is"],[/^(a)x[ie]s$/i,"$1xis"],[/(octop|vir)(us|i)$/i,"$1us"],[/(alias|status|bonus)(es)?$/i,"$1"],[/^(ox)en/i,"$1"],[/(vert|ind)ices$/i,"$1ex"],[/(matr)ices$/i,"$1ix"],[/(quiz)zes$/i,"$1"],[/(database)s$/i,"$1"]],irregularPairs:[["person","people"],["man","men"],["child","children"],["sex","sexes"],["move","moves"],["cow","kine"],["zombie","zombies"]],uncountable:["equipment","information","rice","money","species","series","fish","sheep","jeans","police"]}}),t("ember-inflector/lib/system/inflector",["exports","ember"],function(e,t){function r(e,t){for(var r=0,i=t.length;r<i;r++)e.uncountable[t[r].toLowerCase()]=!0}function i(e,t){for(var r,i=0,a=t.length;i<a;i++)r=t[i],e.irregular[r[0].toLowerCase()]=r[1],e.irregular[r[1].toLowerCase()]=r[1],e.irregularInverse[r[1].toLowerCase()]=r[0],e.irregularInverse[r[0].toLowerCase()]=r[0]}function a(e){e=e||{},e.uncountable=e.uncountable||n(),e.irregularPairs=e.irregularPairs||n();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};r(t,e.uncountable),i(t,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}var o=t.default.String.capitalize,s=/^\s*$/,d=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,u=/[A-Z][a-z\d]*$/;if(!Object.create&&!Object.create(null).hasOwnProperty)throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");a.prototype={enableCache:function(){this.purgeCache(),this.singularize=function(e){return this._cacheUsed=!0,this._sCache[e]||(this._sCache[e]=this._singularize(e))},this.pluralize=function(e){return this._cacheUsed=!0,this._pCache[e]||(this._pCache[e]=this._pluralize(e))}},purgeCache:function(){this._cacheUsed=!1,this._sCache=n(),this._pCache=n()},disableCache:function(){this._sCache=null,this._pCache=null,this.singularize=function(e){return this._singularize(e)},this.pluralize=function(e){return this._pluralize(e)}},plural:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.plurals.push([e,t.toLowerCase()])},singular:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.singular.push([e,t.toLowerCase()])},uncountable:function(e){this._cacheUsed&&this.purgeCache(),r(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),i(this.rules,[[e,t]])},pluralize:function(e){return this._pluralize(e)},_pluralize:function(e){return this.inflect(e,this.rules.plurals,this.rules.irregular)},singularize:function(e){return this._singularize(e)},_singularize:function(e){return this.inflect(e,this.rules.singular,this.rules.irregularInverse)},inflect:function(e,t,r){var i,a,n,c,h,f,p,m,y,v,b;if(m=!e||s.test(e),y=u.test(e),f="",m)return e;if(c=e.toLowerCase(),h=d.exec(e)||l.exec(e),h&&(f=h[1],p=h[2].toLowerCase()),b=this.rules.uncountable[c]||this.rules.uncountable[p])return e;for(v in r)if(c.match(v+"$"))return a=r[v],y&&r[p]&&(a=o(a),v=o(v)),e.replace(new RegExp(v,"i"),a);for(var g=t.length,R=0;g>R&&(i=t[g-1],v=i[0],!v.test(e));g--);return i=i||[],v=i[0],a=i[1],n=e.replace(v,a)}},e.default=a}),t("ember-inflector/lib/system/string",["exports","ember-inflector/lib/system/inflector"],function(e,t){function r(e){return t.default.inflector.pluralize(e)}function i(e){return t.default.inflector.singularize(e)}e.pluralize=r,e.singularize=i}),t("ember-inflector/lib/utils/make-helper",["exports","ember"],function(e,t){function r(e){return t.default.Helper?t.default.Helper.helper(e):t.default.HTMLBars?t.default.HTMLBars.makeBoundHelper(e):t.default.Handlebars.makeBoundHelper(e)}e.default=r}),t("ember-load-initializers",["exports","ember"],function(e,t){e.default=function(e,r){var n=new RegExp("^"+r+"/((?:instance-)?initializers)/"),o=Object.keys||t.default.keys;o(a._eak_seen).map(function(e){return{moduleName:e,matches:n.exec(e)}}).filter(function(e){return e.matches&&2===e.matches.length}).forEach(function(r){var a=r.moduleName,n=i(a,null,null,!0);if(!n)throw new Error(a+" must export an initializer.");var o=t.default.String.camelize(r.matches[1].substring(0,r.matches[1].length-1)),s=n.default;if(!s.name){var d=a.match(/[^\/]+\/?$/)[0];s.name=d}e[o]&&e[o](s)})}}),t("ember",[],function(){return{default:Ember}}),i("ember-data"),i("ember-load-initializers").default(Ember.Application,"ember-data"),function(){var e=i("ember-data/-private/global").default,t=i("ember-data").default;Object.defineProperty(e,"DS",{get:function(){return t}})}()}(),function(){function e(){var e={"ember-data":{default:DS},"ember-data/model":{default:DS.Model},"ember-data/mixins/embedded-records":{default:DS.EmbeddedRecordsMixin},"ember-data/serializers/rest":{default:DS.RESTSerializer},"ember-data/serializers/active-model":{default:DS.ActiveModelSerializer},"ember-data/serializers/json":{default:DS.JSONSerializer},"ember-data/serializers/json-api":{default:DS.JSONAPISerializer},"ember-data/serializer":{default:DS.Serializer},"ember-data/adapters/json-api":{default:DS.JSONAPIAdapter},"ember-data/adapters/rest":{default:DS.RESTAdapter},"ember-data/adapter":{default:DS.Adapter},"ember-data/adapters/active-model":{default:DS.ActiveModelAdapter},"ember-data/store":{default:DS.Store},"ember-data/transform":{default:DS.Transform},"ember-data/attr":{default:DS.attr},"ember-data/relationships":{hasMany:DS.hasMany,belongsTo:DS.belongsTo}};for(var r in e)t(r,e[r])}function t(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&e()}();
|
@@ -6,7 +6,7 @@
|
|
6
6
|
* @copyright Copyright 2011-2016 Tilde Inc. and contributors.
|
7
7
|
* Portions Copyright 2011 LivingSocial Inc.
|
8
8
|
* @license Licensed under MIT license (see license.js)
|
9
|
-
* @version 2.11.
|
9
|
+
* @version 2.11.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var loader, define, requireModule, require, requirejs;
|
@@ -1475,7 +1475,12 @@ define("ember-data/-private/system/many-array", ["exports", "ember", "ember-data
|
|
1475
1475
|
flushCanonical: function () {
|
1476
1476
|
var isInitialized = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
|
1477
1477
|
|
1478
|
-
|
1478
|
+
// TODO make this smarter, currently its plenty stupid
|
1479
|
+
// TODO this filtering was re-introduced as a bugfix, but seems unneeded in 2.13
|
1480
|
+
// with the changes to internalModel cleanup in that version.
|
1481
|
+
var toSet = this.canonicalState.filter(function (internalModel) {
|
1482
|
+
return internalModel.currentState.stateName !== 'root.deleted.saved';
|
1483
|
+
});
|
1479
1484
|
|
1480
1485
|
//a hack for not removing new records
|
1481
1486
|
//TODO remove once we have proper diffing
|
@@ -10433,8 +10438,15 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
10433
10438
|
// container._registry = 1.11 - 2.0
|
10434
10439
|
// container = < 1.11
|
10435
10440
|
var owner = (0, _emberDataPrivateUtils.getOwner)(this);
|
10441
|
+
var mixin = undefined;
|
10442
|
+
|
10443
|
+
if (owner.factoryFor) {
|
10444
|
+
var MaybeMixin = owner.factoryFor('mixin:' + normalizedModelName);
|
10445
|
+
mixin = MaybeMixin && MaybeMixin.class;
|
10446
|
+
} else {
|
10447
|
+
mixin = owner._lookupFactory('mixin:' + normalizedModelName);
|
10448
|
+
}
|
10436
10449
|
|
10437
|
-
var mixin = owner._lookupFactory('mixin:' + normalizedModelName);
|
10438
10450
|
if (mixin) {
|
10439
10451
|
//Cache the class as a model
|
10440
10452
|
owner.register('model:' + normalizedModelName, _emberDataModel.default.extend(mixin));
|
@@ -10478,7 +10490,14 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
10478
10490
|
|
10479
10491
|
var owner = (0, _emberDataPrivateUtils.getOwner)(this);
|
10480
10492
|
|
10481
|
-
|
10493
|
+
if (owner.factoryFor) {
|
10494
|
+
var MaybeModel = owner.factoryFor('model:' + normalizedKey);
|
10495
|
+
var MaybeModelFactory = MaybeModel && MaybeModel.class;
|
10496
|
+
|
10497
|
+
return MaybeModelFactory;
|
10498
|
+
} else {
|
10499
|
+
return owner._lookupFactory('model:' + normalizedKey);
|
10500
|
+
}
|
10482
10501
|
},
|
10483
10502
|
|
10484
10503
|
/**
|
@@ -10669,7 +10688,13 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
10669
10688
|
},
|
10670
10689
|
|
10671
10690
|
_hasModelFor: function (modelName) {
|
10672
|
-
|
10691
|
+
var owner = (0, _emberDataPrivateUtils.getOwner)(this);
|
10692
|
+
|
10693
|
+
if (owner.factoryFor) {
|
10694
|
+
return !!owner.factoryFor('model:' + modelName);
|
10695
|
+
} else {
|
10696
|
+
return !!owner._lookupFactory('model:' + modelName);
|
10697
|
+
}
|
10673
10698
|
},
|
10674
10699
|
|
10675
10700
|
_pushInternalModel: function (data) {
|
@@ -11689,15 +11714,13 @@ define('ember-data/-private/utils', ['exports', 'ember'], function (exports, _em
|
|
11689
11714
|
ember-container-inject-owner is a new feature in Ember 2.3 that finally provides a public
|
11690
11715
|
API for looking items up. This function serves as a super simple polyfill to avoid
|
11691
11716
|
triggering deprecations.
|
11692
|
-
|
11717
|
+
*/
|
11693
11718
|
function getOwner(context) {
|
11694
11719
|
var owner;
|
11695
11720
|
|
11696
11721
|
if (_ember.default.getOwner) {
|
11697
11722
|
owner = _ember.default.getOwner(context);
|
11698
|
-
}
|
11699
|
-
|
11700
|
-
if (!owner && context.container) {
|
11723
|
+
} else if (context.container) {
|
11701
11724
|
owner = context.container;
|
11702
11725
|
}
|
11703
11726
|
|
@@ -18686,7 +18709,7 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
|
|
18686
18709
|
});
|
18687
18710
|
});
|
18688
18711
|
define("ember-data/version", ["exports"], function (exports) {
|
18689
|
-
exports.default = "2.11.
|
18712
|
+
exports.default = "2.11.1";
|
18690
18713
|
});
|
18691
18714
|
define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
|
18692
18715
|
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-data-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yehuda Katz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ember-source
|