ember-data-source 2.12.0 → 2.12.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 +3 -3
- data/dist/globals/ember-data.min.js +2 -2
- data/dist/globals/ember-data.prod.js +3 -3
- 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: ce60a67a175459661dd3e0bbfb40bf92c1c8eb34
|
4
|
+
data.tar.gz: dd9f74dde2173fce93e05bcdd6697284d90affc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 190fb2d51cbc895ffae94dfea620287b4dcbc5747ef6f4521336f27f67660f2232f62c434b8cdadbe7030e899c797f3c9e79c21ddf53e06980bfd98401998339
|
7
|
+
data.tar.gz: 73a3109d4432574ee88b0f459d1a8805c56a000b4185551fc823e5c34fdf49a34312c38575f52756abfa659a5cc130657cadfcf6596cf8b3d4b142093f4887a6
|
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.12.
|
9
|
+
* @version 2.12.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var loader, define, requireModule, require, requirejs;
|
@@ -19825,7 +19825,7 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
|
|
19825
19825
|
});
|
19826
19826
|
});
|
19827
19827
|
define("ember-data/version", ["exports"], function (exports) {
|
19828
|
-
exports.default = "2.12.
|
19828
|
+
exports.default = "2.12.1";
|
19829
19829
|
});
|
19830
19830
|
define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
|
19831
19831
|
|
@@ -20338,7 +20338,7 @@ require("ember-load-initializers")["default"](Ember.Application, "ember-data");
|
|
20338
20338
|
}
|
20339
20339
|
});
|
20340
20340
|
})();
|
20341
|
-
})();
|
20341
|
+
}).call(this);
|
20342
20342
|
;(function() {
|
20343
20343
|
function processEmberDataShims() {
|
20344
20344
|
var shims = {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
!function(){"use strict";var e,t,r,i,a;!function(n){function o(){var e=Object.create(null);return e.__=void 0,delete e.__,e}function s(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function l(e,t,r,i){this.id=b++,this.name=e,this.deps=!t.length&&r.length?g:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function d(e){this.name=e}function u(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function c(e,t,r){for(var i=y[e]||y[e+"/index"];i&&i.isAlias;)i=y[i.name];return i||u(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function h(e,t){if("."!==e.charAt(0))return e;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!(!y[e]&&!y[e+"/index"])}var p=(n.heimdall,{loader:e,define:t,requireModule:r,require:i,requirejs:a});a=i=r=function(e){for(var t=[],r=c(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports},e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&p.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=p[t])}};var m;m=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var y=o(),v=o(),b=0,g=["require","exports","module"];l.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||!Object.isExtensible(e)||(e.default=e)},l.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.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},l.prototype.unsee=function(){this.state="new",this.module={exports:{}}},l.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")}}},l.prototype._reify=function(){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},l.prototype.findDeps=function(e){if("new"===this.state){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)}}},l.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){var i=y[e];i&&"new"!==i.state||(arguments.length<2&&s(arguments.length),m(t)||(r=t,t=[]),y[e]=r instanceof d?new l(r.name,t,r,!0):new l(e,t,r,!1))},t.alias=function(e){return new d(e)},a.entries=a._eak_seen=y,a.has=f,a.unsee=function(e){c(e,"(unsee)",!1).unsee()},a.clear=function(){a.entries=a._eak_seen=y=o(),v=o()},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))&&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 l(){return t.default.warn.apply(t.default,arguments)}function d(){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);r("You cannot add a record of modelClass '"+a+"' to the '"+n+"."+o+"' relationship (only '"+s.modelName+"' allowed)",u(s,i.modelClass))}e.assert=r,e.debug=i,e.deprecate=a,e.info=n,e.runInDebug=o,e.instrument=s,e.warn=l,e.debugSeal=d,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}e.default=t(function(e){return e&&void 0===e.nodeType?e:void 0}("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){(e.lookup?e:e.container).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;return 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)})}),function(){i.forEach(function(e){return e()})}}})}),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/identity-map",["exports","ember-data/-private/system/record-map"],function(e,t){var r=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}}(),i=function(){function e(){this._map=Object.create(null)}return r(e,[{key:"retrieve",value:function(e){var r=this._map[e];return r||(r=this._map[e]=new t.default(e)),r}},{key:"clear",value:function(){for(var e=this._map,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].clear()}}}]),e}();e.default=i}),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(){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/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],l=r.findBy("message",s);a[n]=l?l:{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")){a(this,"content",this.rejectBy("attribute",e)),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,l,d){function u(e){return S[e]||(S[e]=e.split("."))}function c(e){return M[e]||(M[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,_=t.default.run,R=t.default.setOwner,A=t.default.RSVP,k=t.default.RSVP.Promise,F=t.default.assign||t.default.merge,z=new o.default,M=new o.default,S=new o.default,x=1,T=function(){function e(e,t,r,a){this.id=t,this._internalId=x++,this.store=r,this._data=a||new o.default,this.modelName=e,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._modelClass=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};R?R(e,(0,l.getOwner)(this.store)):e.container=this.store.container,this._record=this.store.modelFactoryFor(this.modelName).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 k(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(){_.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];o[0]===o[1]&&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,l=n.length;s<l;s++){var d=n[s];a[d]=[e[d],i[d]]}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,l=z[i];if(l)a=l.setups,n=l.enters,r=l.state;else{a=[],n=[];var d=u(e);for(o=0,s=d.length;o<s;o++)r=r[d[o]],r.enter&&n.push(r),r.setup&&a.push(r);z[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)&&_.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);t.modelClass.metaForProperty(r).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)}},{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,_.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(){return!b(f(this.getRecord(),"errors"))}},{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),l=s.length,d=this._attributes;for(r=F(new o.default,this._data),r=F(r,this._inFlightAttributes),i=0;i<l;i++)n=s[i],a=e[n],void 0===d[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 d.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new d.HasManyReference(this.store,this,i)),this.references[t]=r}return r}},{key:"modelClass",get:function(){return this._modelClass||(this._modelClass=this.store._modelFor(this.modelName))}},{key:"type",get:function(){return this.modelClass}},{key:"recordReference",get:function(){return null===this._recordReference&&(this._recordReference=new d.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=T}),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/features","ember-data/-private/system/model/states","ember-data/-private/system/empty-object","ember-data/-private/system/relationships/ext"],function(e,t,r,i,a,n,o,s,l){function d(e,t,r,i){var a=i||[],n=u(t,"relationships");if(!n)return a;var o=n.get(e.modelName).filter(function(e){var i=t.metaForProperty(e.name).options;return!i.inverse||r===i.inverse});return o&&a.push.apply(a,o),e.superclass&&d(e.superclass,t,r,a),a}var u=t.default.get,c=t.default.computed,h=t.default.Map,f=c("currentState",function(e){return u(this._internalModel.currentState,e)}).readOnly(),p=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,isEmpty:f,isLoading:f,isLoaded:f,hasDirtyAttributes:c("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:f,isDeleted:f,isNew:f,isValid:f,dirtyType:f,isError:!1,isReloading:!1,
|
1
|
+
(function(){"use strict";var e,t,r,i,a;!function(n){function o(){var e=Object.create(null);return e.__=void 0,delete e.__,e}function s(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function l(e,t,r,i){this.id=b++,this.name=e,this.deps=!t.length&&r.length?g:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function d(e){this.name=e}function u(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function c(e,t,r){for(var i=y[e]||y[e+"/index"];i&&i.isAlias;)i=y[i.name];return i||u(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function h(e,t){if("."!==e.charAt(0))return e;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!(!y[e]&&!y[e+"/index"])}var p=(n.heimdall,{loader:e,define:t,requireModule:r,require:i,requirejs:a});a=i=r=function(e){for(var t=[],r=c(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports},e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&p.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=p[t])}};var m;m=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var y=o(),v=o(),b=0,g=["require","exports","module"];l.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||!Object.isExtensible(e)||(e.default=e)},l.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.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},l.prototype.unsee=function(){this.state="new",this.module={exports:{}}},l.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")}}},l.prototype._reify=function(){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},l.prototype.findDeps=function(e){if("new"===this.state){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)}}},l.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){var i=y[e];i&&"new"!==i.state||(arguments.length<2&&s(arguments.length),m(t)||(r=t,t=[]),y[e]=r instanceof d?new l(r.name,t,r,!0):new l(e,t,r,!1))},t.alias=function(e){return new d(e)},a.entries=a._eak_seen=y,a.has=f,a.unsee=function(e){c(e,"(unsee)",!1).unsee()},a.clear=function(){a.entries=a._eak_seen=y=o(),v=o()},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))&&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 l(){return t.default.warn.apply(t.default,arguments)}function d(){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);r("You cannot add a record of modelClass '"+a+"' to the '"+n+"."+o+"' relationship (only '"+s.modelName+"' allowed)",u(s,i.modelClass))}e.assert=r,e.debug=i,e.deprecate=a,e.info=n,e.runInDebug=o,e.instrument=s,e.warn=l,e.debugSeal=d,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}e.default=t(function(e){return e&&void 0===e.nodeType?e:void 0}("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){(e.lookup?e:e.container).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;return 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)})}),function(){i.forEach(function(e){return e()})}}})}),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/identity-map",["exports","ember-data/-private/system/record-map"],function(e,t){var r=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}}(),i=function(){function e(){this._map=Object.create(null)}return r(e,[{key:"retrieve",value:function(e){var r=this._map[e];return r||(r=this._map[e]=new t.default(e)),r}},{key:"clear",value:function(){for(var e=this._map,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].clear()}}}]),e}();e.default=i}),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(){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/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],l=r.findBy("message",s);a[n]=l?l:{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")){a(this,"content",this.rejectBy("attribute",e)),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,l,d){function u(e){return S[e]||(S[e]=e.split("."))}function c(e){return M[e]||(M[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,_=t.default.run,R=t.default.setOwner,A=t.default.RSVP,k=t.default.RSVP.Promise,F=t.default.assign||t.default.merge,z=new o.default,M=new o.default,S=new o.default,x=1,T=function(){function e(e,t,r,a){this.id=t,this._internalId=x++,this.store=r,this._data=a||new o.default,this.modelName=e,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._modelClass=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};R?R(e,(0,l.getOwner)(this.store)):e.container=this.store.container,this._record=this.store.modelFactoryFor(this.modelName).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 k(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(){_.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];o[0]===o[1]&&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,l=n.length;s<l;s++){var d=n[s];a[d]=[e[d],i[d]]}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,l=z[i];if(l)a=l.setups,n=l.enters,r=l.state;else{a=[],n=[];var d=u(e);for(o=0,s=d.length;o<s;o++)r=r[d[o]],r.enter&&n.push(r),r.setup&&a.push(r);z[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)&&_.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);t.modelClass.metaForProperty(r).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)}},{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,_.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(){return!b(f(this.getRecord(),"errors"))}},{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),l=s.length,d=this._attributes;for(r=F(new o.default,this._data),r=F(r,this._inFlightAttributes),i=0;i<l;i++)n=s[i],a=e[n],void 0===d[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 d.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new d.HasManyReference(this.store,this,i)),this.references[t]=r}return r}},{key:"modelClass",get:function(){return this._modelClass||(this._modelClass=this.store._modelFor(this.modelName))}},{key:"type",get:function(){return this.modelClass}},{key:"recordReference",get:function(){return null===this._recordReference&&(this._recordReference=new d.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=T}),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/features","ember-data/-private/system/model/states","ember-data/-private/system/empty-object","ember-data/-private/system/relationships/ext"],function(e,t,r,i,a,n,o,s,l){function d(e,t,r,i){var a=i||[],n=u(t,"relationships");if(!n)return a;var o=n.get(e.modelName).filter(function(e){var i=t.metaForProperty(e.name).options;return!i.inverse||r===i.inverse});return o&&a.push.apply(a,o),e.superclass&&d(e.superclass,t,r,a),a}var u=t.default.get,c=t.default.computed,h=t.default.Map,f=c("currentState",function(e){return u(this._internalModel.currentState,e)}).readOnly(),p=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,isEmpty:f,isLoading:f,isLoaded:f,hasDirtyAttributes:c("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:f,isDeleted:f,isNew:f,isValid:f,dirtyType:f,isError:!1,isReloading:!1,
|
2
2
|
id:null,currentState:o.default.empty,errors:c(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=void 0,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 u(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"))}),_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}}},notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)},didDefineProperty:function(e,r,i){if(i instanceof t.default.ComputedProperty){i.meta().parentType=e.constructor}},eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return u(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)},notifyHasManyAdded:function(e){this.notifyPropertyChange(e)},eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});Object.defineProperty(p.prototype,"data",{get:function(){return this._internalModel._data}}),p.reopenClass({isModel:!0,modelName:null,typeForRelationship:function(e,t){var r=u(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t.default.computed(function(){return new s.default}),inverseFor:function(e,t){var r=u(this,"inverseMap");if(r[e])return r[e];var i=this._findInverseFor(e,t);return r[e]=i,i},_findInverseFor:function(e,r){var i=this.typeForRelationship(e,r);if(!i)return null;var a=this.metaForProperty(e),n=a.options;if(null===n.inverse)return null;var o=void 0,s=void 0,l=void 0;if(n.inverse)o=n.inverse,l=t.default.get(i,"relationshipsByName").get(o),s=l.kind;else{a.type,a.parentType.modelName;var u=d(this,i,e);if(0===u.length)return null;var c=u.filter(function(t){return e===i.metaForProperty(t.name).options.inverse});1===c.length&&(u=c),o=u[0].name,s=u[0].kind}return{type:i,name:o,kind:s}},relationships:l.relationshipsDescriptor,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.relatedTypesDescriptor,relationshipsByName:l.relationshipsByNameDescriptor,fields:t.default.computed(function(){var e=h.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){u(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=u(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"},attributes:t.default.computed(function(){var e=h.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=h.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){u(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){u(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}}),t.default.setOwner&&Object.defineProperty(p.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),e.default=p}),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],t[a]=r&&"object"==typeof r?i(r):r;return t}function a(e,t){for(var r in t)e[r]=t[r];return e}function n(e){return a(i(d),e)}function o(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function s(e){}function l(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]=l(e[i],e,r+"."+i));return e}var d={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){d.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(),e.store._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=l(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(){return new this},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:l.resolve(e,t)})}function a(e,t){return d.create({promise:l.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:l.resolve(e,t)})}e.promiseObject=i,e.promiseArray=a,e.proxyToContent=n,e.promiseManyArray=o;var s=t.default.get,l=t.default.RSVP.Promise,d=t.default.ArrayProxy.extend(t.default.PromiseProxyMixin);e.PromiseArray=d;var u=t.default.ObjectProxy.extend(t.default.PromiseProxyMixin);e.PromiseObject=u;var c=d.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","ember-data/-private/debug"],function(e,t,r,i,a){function n(e){e.destroy()}function o(e){for(var t=e.length,r=[],i=0;i<t;i++)r=r.concat(e[i]);return r}function s(e,t){var r=e.indexOf(t);return r!==-1&&(e.splice(r,1),!0)}var l=t.default.get,d=t.default.MapWithDefault,u=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)&&u.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.modelName,i=this.filteredRecordArrays.get(r),a=void 0;i.forEach(function(i){a=l(i,"filterFunction"),t.updateFilterRecordArray(i,a,r,e)})},recordWasLoaded:function(e){var t=this,r=e.modelName,i=this.filteredRecordArrays.get(r),a=void 0;if(i.forEach(function(i){a=l(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._recordMapFor(t),a=i.length===e.length;r&&a||this.populateLiveRecordArray(e,t)},populateLiveRecordArray:function(e,t){for(var r=this.store._recordMapFor(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._recordMapFor(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({modelName:e,content:t.default.A(),store:this.store,isLoaded:!0,manager:this})},createFilteredRecordArray:function(e,i,a){var n=r.FilteredRecordArray.create({query:a,modelName: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({modelName:e,query:i,content:t.default.A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(a),a},registerFilteredRecordArray:function(e,t,r){this.filteredRecordArrays.get(t).push(e),this.updateFilter(e,t,r)},unregisterRecordArray:function(e){var t=e.modelName,r=this.filteredRecordArrays.get(t),i=s(r,e),a=s(this._adapterPopulatedRecordArrays,e);if(!i&&!a&&this.liveRecordArrays.has(t)){e===this.liveRecordArrayFor(t)&&this.liveRecordArrays.delete(t)}},willDestroy:function(){this._super.apply(this,arguments),this.filteredRecordArrays.forEach(function(e){return o(e).forEach(n)}),this.liveRecordArrays.forEach(n),this._adapterPopulatedRecordArrays.forEach(n)}})}),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(){throw new Error("The result of a server query (on "+this.modelName+") is immutable.")},_update:function(){var e=a(this,"store"),t=a(this,"query");return e._query(this.modelName,t,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(){throw new Error("The result of a client-side filter (on "+this.modelName+") is immutable.")},_updateFilter:function(){i(this,"isDestroying")||i(this,"isDestroyed")||i(this,"manager").updateFilter(this,this.modelName,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.computed,n=t.default.get,o=t.default.set,s=t.default.RSVP.Promise;e.default=t.default.ArrayProxy.extend(t.default.Evented,{init:function(){this._super.apply(this,arguments),this.set("content",this.content||null),this.isLoaded=this.isLoaded||!1,this.isUpdating=!1,this.store=this.store||null,this._updatingPromise=null},replace:function(){throw new Error("The result of a server query (for all "+this.modelName+" types) is immutable. To modify contents, use toArray()")},type:a("modelName",function(){return this.modelName?this.store._modelFor(this.modelName):null}).readOnly(),objectAtContent:function(e){var t=n(this,"content").objectAt(e);return t&&t.getRecord()},update:function(){var e=this;if(n(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(){return this.store.findAll(this.modelName,{reload:!0})},_pushInternalModels:function(e){n(this,"content").pushObjects(e)},_removeInternalModels:function(e){n(this,"content").removeObjects(e)},save:function(){var e=this,t="DS: RecordArray#save "+this.modelName,i=s.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(){n(this,"manager").unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),o(this,"content",null),o(this,"length",0),this._super.apply(this,arguments)},_createSnapshot:function(e){return new i.default(this,this.get("meta"),e)},_takeSnapshot:function(){return n(this,"content").map(function(e){return e.createSnapshot()})}})}),t("ember-data/-private/system/record-map",["exports","ember-data/-private/debug","ember-data/-private/system/model/internal-model"],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=function(){function e(e){this.modelName=e,this._idToRecord=Object.create(null),this._records=[],this._metadata=null}return i(e,[{key:"get",value:function(e){return this._idToRecord[e]}},{key:"has",value:function(e){return!!this._idToRecord[e]}},{key:"set",value:function(e,t){this._idToRecord[e]=t}},{key:"add",value:function(e,t){t&&(this._idToRecord[t]=e),this._records.push(e)}},{key:"remove",value:function(e,t){t&&delete this._idToRecord[t];var r=this._records.indexOf(e);r!==-1&&this._records.splice(r,1)}},{key:"contains",value:function(e){return this._records.indexOf(e)!==-1}},{key:"clear",value:function(){if(this._records){var e=this._records;this._records=[];for(var t=void 0,r=0;r<e.length;r++)t=e[r],t.unloadRecord(),t.destroy()}this._metadata=null}},{key:"destroy",value:function(){this._store=null,this._modelClass=null}},{key:"idToRecord",get:function(){return this._idToRecord}},{key:"length",get:function(){return this._records.length}},{key:"records",get:function(){return this._records}},{key:"metadata",get:function(){return this._metadata||(this._metadata=Object.create(null))}},{key:"type",get:function(){throw new Error("RecordMap.type is no longer available")}}]),e}();e.default=a}),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(){return this.hasManyRelationship.members.toArray().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){return r.store.push(e)._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(){return!!o(this.hasManyRelationship,"hasData")&&this.hasManyRelationship.members.toArray().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}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/debug","ember-data/-private/system/relationship-meta"],function(e,t,r,i){var a=t.default.Map,n=t.default.MapWithDefault,o=t.default.computed(function(){t.default.testing===!0&&o._cacheable===!0&&(o._cacheable=!1);var e=new n({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;e.get((0,i.typeForRelationshipMeta)(r)).push({name:t,kind:r.kind})}}),e}).readOnly();e.relationshipsDescriptor=o;var s=t.default.computed(function(){t.default.testing===!0&&s._cacheable===!0&&(s._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();e.relatedTypesDescriptor=s;var l=t.default.computed(function(){t.default.testing===!0&&l._cacheable===!0&&(l._cacheable=!1);var e=a.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();e.relationshipsByNameDescriptor=l}),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){return this._internalModel._relationships.get(e).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}),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){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=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}}(),s=function e(t,r,i){null===t&&(t=Function.prototype);var a=Object.getOwnPropertyDescriptor(t,r);if(void 0===a){var n=Object.getPrototypeOf(t);return null===n?void 0:e(n,r,i)}if("value"in a)return a.value;var o=a.get;if(void 0!==o)return o.call(i)},l=function(e){function r(e,t,i,a){s(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,e,t,i,a),this.internalModel=t,this.key=a.key,this.inverseRecord=null,this.canonicalState=null}return n(r,e),o(r,[{key:"setRecord",value:function(e){e?this.addRecord(e):this.inverseRecord&&this.removeRecord(this.inverseRecord),this.setHasData(!0),this.setHasLoaded(!0)}},{
|
3
3
|
key:"setCanonicalRecord",value:function(e){e?this.addCanonicalRecord(e):this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.flushCanonicalLater()}},{key:"addCanonicalRecord",value:function(e){this.canonicalMembers.has(e)||(this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.canonicalState=e,s(Object.getPrototypeOf(r.prototype),"addCanonicalRecord",this).call(this,e))}},{key:"flushCanonical",value:function(){this.inverseRecord&&this.inverseRecord.isNew()&&!this.canonicalState||(this.inverseRecord!==this.canonicalState&&(this.inverseRecord=this.canonicalState,this.internalModel.notifyBelongsToChanged(this.key)),s(Object.getPrototypeOf(r.prototype),"flushCanonical",this).call(this))}},{key:"addRecord",value:function(e){this.members.has(e)||(this.inverseRecord&&this.removeRecord(this.inverseRecord),this.inverseRecord=e,s(Object.getPrototypeOf(r.prototype),"addRecord",this).call(this,e),this.internalModel.notifyBelongsToChanged(this.key))}},{key:"setRecordPromise",value:function(e){var t=e.get&&e.get("content");this.setRecord(t?t._internalModel:t)}},{key:"removeRecordFromOwn",value:function(e){this.members.has(e)&&(this.inverseRecord=null,s(Object.getPrototypeOf(r.prototype),"removeRecordFromOwn",this).call(this,e),this.internalModel.notifyBelongsToChanged(this.key))}},{key:"removeCanonicalRecordFromOwn",value:function(e){this.canonicalMembers.has(e)&&(this.canonicalState=null,s(Object.getPrototypeOf(r.prototype),"removeCanonicalRecordFromOwn",this).call(this,e))}},{key:"findRecord",value:function(){return this.inverseRecord?this.store._findByInternalModel(this.inverseRecord):t.default.RSVP.Promise.resolve(null)}},{key:"fetchLink",value:function(){var e=this;return this.store.findBelongsTo(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t&&e.addRecord(t),t})}},{key:"getRecord",value: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,content:this.inverseRecord?this.inverseRecord.getRecord():null})}return null===this.inverseRecord?null:this.inverseRecord.getRecord()}},{key:"reload",value:function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.hasRecord?this.inverseRecord.record.reload():this.findRecord()}},{key:"updateData",value:function(e){var t=this.store._pushResourceIdentifier(this,e);this.setCanonicalRecord(t)}}]),r}(a.default);e.default=l}),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","ember-data/-private/debug"],function(e,t,r,i,a,n){function o(e){var t=e.options;return!(t&&null===t.inverse)}function s(e,t,a){var n=void 0,s=null;return o(t)&&(s=e.type.inverseFor(t.key,a)),s&&(n=s.name),"hasMany"===t.kind?new r.default(a,e,n,t):new i.default(a,e,n,t)}var l=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}}(),d=t.default.get,u=function(){function e(e){this.internalModel=e,this.initializedRelationships=new a.default}return l(e,[{key:"has",value:function(e){return!!this.initializedRelationships[e]}},{key:"get",value:function(e){var t=this.initializedRelationships,r=this.internalModel,i=d(r.type,"relationshipsByName");return!t[e]&&i.get(e)&&(t[e]=s(r,i.get(e),r.store)),t[e]}},{key:"record",get:function(){return this.internalModel}}]),e}();e.default=u}),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){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}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}var l=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}}(),d=function e(t,r,i){null===t&&(t=Function.prototype);var a=Object.getOwnPropertyDescriptor(t,r);if(void 0===a){var n=Object.getPrototypeOf(t);return null===n?void 0:e(n,r,i)}if("value"in a)return a.value;var o=a.get;if(void 0!==o)return o.call(i)},u=function(e){function t(e,r,i,a){d(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,a),this.belongsToType=a.type,this.canonicalState=[],this.isPolymorphic=a.options.polymorphic}return o(t,e),l(t,[{key:"getManyArray",value: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}},{key:"destroy",value:function(){this._manyArray&&this._manyArray.destroy()}},{key:"updateMeta",value:function(e){d(Object.getPrototypeOf(t.prototype),"updateMeta",this).call(this,e),this._manyArray&&this._manyArray.set("meta",e)}},{key:"addCanonicalRecord",value:function(e,r){this.canonicalMembers.has(e)||(void 0!==r?this.canonicalState.splice(r,0,e):this.canonicalState.push(e),d(Object.getPrototypeOf(t.prototype),"addCanonicalRecord",this).call(this,e,r))}},{key:"addRecord",value:function(e,r){this.members.has(e)||(d(Object.getPrototypeOf(t.prototype),"addRecord",this).call(this,e,r),this.getManyArray().internalAddRecords([e],r))}},{key:"removeCanonicalRecordFromOwn",value:function(e,r){var i=r;this.canonicalMembers.has(e)&&(void 0===i&&(i=this.canonicalState.indexOf(e)),i>-1&&this.canonicalState.splice(i,1),d(Object.getPrototypeOf(t.prototype),"removeCanonicalRecordFromOwn",this).call(this,e,r))}},{key:"flushCanonical",value:function(){this._manyArray&&this._manyArray.flushCanonical(),d(Object.getPrototypeOf(t.prototype),"flushCanonical",this).call(this)}},{key:"removeRecordFromOwn",value:function(e,r){if(this.members.has(e)){d(Object.getPrototypeOf(t.prototype),"removeRecordFromOwn",this).call(this,e,r);var i=this.getManyArray();void 0!==r?i.currentState.removeAt(r):i.internalRemoveRecords([e])}}},{key:"notifyRecordRelationshipAdded",value:function(e,t){this.record.notifyHasManyAdded(this.key,e,t)}},{key:"reload",value: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)}},{key:"computeChanges",value: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)}},{key:"fetchLink",value: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()})}},{key:"findRecords",value: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})}},{key:"notifyHasManyChanged",value:function(){this.record.notifyHasManyAdded(this.key)}},{key:"getRecords",value: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}},{key:"updateData",value:function(e){var t=this.store._pushResourceIdentifiers(this,e);this.updateRecordsFromAdapter(t)}}]),t}(i.default);e.default=u}),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){var a=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}}(),n=function(){function e(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.internalModel=t,this.isAsync=void 0===n||n,this.relationshipMeta=a,this.inverseKeyForImplicit=this.internalModel.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}return a(e,[{key:"destroy",value:function(){}},{key:"updateMeta",value:function(e){this.meta=e}},{key:"clear",value:function(){for(var e,t=this.members.list;t.length>0;)e=t[0],this.removeRecord(e)}},{key:"removeRecords",value:function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})}},{key:"addRecords",value:function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})}},{key:"addCanonicalRecords",value:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])}},{key:"addCanonicalRecord",value:function(t,r){this.canonicalMembers.has(t)||(this.canonicalMembers.add(t),this.inverseKey?t._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{}})),t._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)}},{key:"removeCanonicalRecords",value:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])}},{key:"removeCanonicalRecord",value: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()}},{key:"addRecord",value:function(t,r){this.members.has(t)||(this.members.addWithIndex(t,r),this.notifyRecordRelationshipAdded(t,r),this.inverseKey?t._relationships.get(this.inverseKey).addRecord(this.record):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{}})),t._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArraysLater()),this.setHasData(!0)}},{key:"removeRecord",value: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))}},{key:"removeRecordFromInverse",value:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)}},{key:"removeRecordFromOwn",value:function(e){this.members.delete(e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()}},{key:"removeCanonicalRecordFromInverse",value:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)}},{key:"removeCanonicalRecordFromOwn",value:function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()}},{key:"flushCanonical",value: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])}},{key:"flushCanonicalLater",value:function(){var e=this;this.willSync||(this.willSync=!0,this.store._backburner.join(function(){return e.store._backburner.schedule("syncRelationships",e,e.flushCanonical)}))}},{key:"updateLink",value:function(e){this.link=e,this.linkPromise=null,this.record.notifyPropertyChange(this.key)}},{key:"findLink",value:function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})}},{key:"updateRecordsFromAdapter",value:function(e){this.computeChanges(e)}},{key:"notifyRecordRelationshipAdded",value:function(){}},{key:"notifyRecordRelationshipRemoved",value:function(){}},{key:"setHasData",value:function(e){this.hasData=e}},{key:"setHasLoaded",value:function(e){this.hasLoaded=e}},{key:"push",value: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)}},{key:"updateData",value:function(){}},{key:"record",get:function(){return this.internalModel}},{key:"parentType",get:function(){return this.internalModel.modelName}}]),e}();e.default=n}),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,l=r&&r.id;if(l&&e in this._belongsToIds)return this._belongsToIds[e];if(!l&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(!(i=this._internalModel._relationships.get(e))||"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()?l?a(n,"id"):n.createSnapshot():null),l?this._belongsToIds[e]=s:this._belongsToRelationships[e]=s,s},hasMany:function(e,r){var i,n,o,s,l=r&&r.ids;if(l&&e in this._hasManyIds)return this._hasManyIds[e];if(!l&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(!(i=this._internalModel._relationships.get(e))||"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()||(l?s.push(e.id):s.push(e.createSnapshot()))})),l?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/identity-map","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,l,d,u,c,h,f,p,m,y,v,b){function g(e,t){var r=e.then(function(e){return e.getRecord()});return(0,s.promiseObject)(r,t)}function _(e){return e.serializerFor("application")}function R(e,t,r,i){var a=i._internalModel,o=i.modelName,s=t._modelFor(o),c=e[r](t,s,i),h=(0,u.serializerForAdapter)(t,e,o),f="DS: Extract and notify about "+r+" completion of "+a;return c=C.resolve(c,f),c=(0,l._guard)(c,(0,l._bind)(l._objectIsAlive,t)),c=(0,l._guard)(c,(0,l._bind)(l._objectIsAlive,a)),c.then(function(e){return t._backburner.join(function(){var n=void 0,o=void 0;e&&(n=(0,d.normalizeResponseHelper)(h,t,s,e,i.id,r),n.included&&t._push({data:null,included:n.included}),o=n.data),t.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof n.InvalidError){var r=h.extractErrors(t,s,e,i.id);t.recordWasInvalid(a,r)}else t.recordWasError(a,e);throw e},f)}function A(e,t,r){r.relationships&&t.type.eachRelationship(function(e,i){if(r.relationships[e]){t._relationships.get(e).push(r.relationships[e])}})}e.badIdFormatAssertion="`id` passed to `findRecord()` has to be non-empty string or number";var k=t.default.A,F=t.default._Backburner,z=t.default.computed,M=t.default.copy,S=t.default.ENV,x=t.default.Error,T=t.default.get,w=(t.default.inspect,t.default.isNone),O=(t.default.isPresent,t.default.MapWithDefault),E=t.default.run,P=t.default.set,D=t.default.RSVP,j=t.default.Service,C=(t.default.typeOf,D.Promise),I=void 0;e.Store=I=j.extend({init:function(){this._super.apply(this,arguments),this._backburner=new F(["normalizeRelationships","syncRelationships","finished"]),this.recordArrayManager=p.default.create({store:this}),this._identityMap=new o.default,this._pendingSave=[],this._instanceCache=new m.default((0,h.getOwner)(this),this),this._modelClassCache=new v.default,this._pendingSave=[],this._pushedInternalModels=[],this._relationshipFlush=null,this._pendingFetch=O.create({defaultValue:function(){return[]}}),this._instanceCache=new m.default((0,h.getOwner)(this),this)},adapter:"-json-api",serialize:function(e,t){return e._internalModel.createSnapshot().serialize(t)},defaultAdapter:z("adapter",function(){var e=T(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=this._classKeyFor(e),i=M(t)||new v.default;w(i.id)&&(i.id=this._generateId(r,i)),i.id=(0,f.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){var i=this._classKeyFor(e);return this.findRecord(i,t)},findRecord:function(e,t,r){var i=this._classKeyFor(e),a=this._internalModelForId(i,t);return r=r||{},this.hasRecordForId(i,t)?g(this._findRecord(a,r),"DS: Store#findRecord "+i+" with id: "+t):this._findByInternalModel(a,r)},_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?C.resolve(e):((t.backgroundReload||a.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),C.resolve(e))},_findByInternalModel:function(e,t){return t=t||{},t.preload&&e.preloadData(t.preload),g(this._findEmptyInternalModel(e,t),"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:C.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),i=this._classKeyFor(e),a=0;a<t.length;a++)r[a]=this.findRecord(i,t[a]);return(0,s.promiseArray)(D.all(r).then(k,null,"DS: Store#findByIds of "+i+" complete"))},_fetchRecord:function(e,t){var r=e.type,i=e.id,a=this.adapterFor(r.modelName);return(0,c._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 C.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.type,i=D.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),E.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 v.default,i=0,n=e.length;i<n;i++){var o=e[i],s=u[o.id];if(r[o.id]=o,s){s.resolver.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=u[e[r].id];a&&a.resolver.reject(t)}}for(var n=this,o=n.adapterFor(t.modelName),s=!!o.findMany&&o.coalesceFindRequests,l=e.length,d=new Array(l),u=new v.default,h=0;h<l;h++){var f=e[h],p=f.internalModel;d[h]=p,u[p.id]=f}if(s){for(var m=new Array(l),h=0;h<l;h++)m[h]=d[h].createSnapshot();for(var y=o.groupRecordsForFindMany(this,m),h=0,b=y.length;h<b;h++)!function(e,s){for(var l=y[e],d=y[e].length,h=new Array(d),f=new Array(d),p=0;p<d;p++){var m=l[p]._internalModel;f[p]=m,h[p]=m.id}if(d>1)(0,c._findMany)(o,n,t,h,f).then(function(e){i(e,f)}).catch(function(e){a(f,e)});else if(1===h.length){var v=u[f[0].id];r(v)}}(h)}else for(var h=0;h<l;h++)r(e[h])},getReference:function(e,t){var r=this._classKeyFor(e);return this._internalModelForId(r,t).recordReference},peekRecord:function(e,t){var r=this._classKeyFor(e);return this.hasRecordForId(r,t)?this._internalModelForId(r,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=this._classKeyFor(e),i=(0,f.default)(t),a=this._recordMapFor(r).get(i);return!!a&&a.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=(0,f.default)(t),i=this._recordMapFor(e).get(r);return i||(i=this.buildInternalModel(e,r)),i},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findByInternalModel(e[r]);return C.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.type.modelName);return(0,c._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.type.modelName);return(0,c._findBelongsTo)(i,this,e,t,r)},query:function(e,t){var r=this._classKeyFor(e);return this._query(r,t)},_query:function(e,t,r){var i=this._modelFor(e);r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(e,t);var a=this.adapterFor(e);return(0,s.promiseArray)((0,c._query)(a,this,i,t,r))},queryRecord:function(e,t){var r=this._classKeyFor(e),i=this._modelFor(r),a=this.adapterFor(r);return(0,s.promiseObject)((0,c._queryRecord)(a,this,i,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=this._classKeyFor(e),i=this._modelFor(r);return this._fetchAll(i,this.peekAll(r),t)},_fetchAll:function(e,t,r){r=r||{};var i=e.modelName,a=this.adapterFor(i),n=this._recordMapFor(i).metadata.since;if(r.reload)return P(t,"isUpdating",!0),(0,s.promiseArray)((0,c._findAll)(a,this,e,n,r));var o=t._createSnapshot(r);return a.shouldReloadAll(this,o)?(P(t,"isUpdating",!0),(0,s.promiseArray)((0,c._findAll)(a,this,e,n,r))):r.backgroundReload===!1?(0,s.promiseArray)(C.resolve(t)):((r.backgroundReload||a.shouldBackgroundReloadAll(this,o))&&(P(t,"isUpdating",!0),(0,c._findAll)(a,this,e,n,r)),(0,s.promiseArray)(C.resolve(t)))},didUpdateAll:function(e){P(this.recordArrayManager.liveRecordArrayFor(e),"isUpdating",!1)},peekAll:function(e){var t=this._classKeyFor(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.syncLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length)this._identityMap.clear();else{var t=this._classKeyFor(e);this._recordMapFor(t).clear()}},filter:function(e,t,r){S.ENABLE_DS_FILTER;var i=void 0,a=arguments.length,n=void 0,o=3===a,l=this._classKeyFor(e);return o?i=this.query(l,t):2===arguments.length&&(r=t),n=o?this.recordArrayManager.createFilteredRecordArray(l,r,t):this.recordArrayManager.createFilteredRecordArray(l,r),i=i||C.resolve(n),(0,s.promiseArray)(i.then(function(){return n},null,"DS: Store#filter of "+l))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},_dataWasUpdated:function(e){this.recordArrayManager.recordDidChange(e)},scheduleSave:function(e,t,r){var i=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:i,resolver:t}),E.once(this,this.flushPendingSave)},flushPendingSave:function(){var e=this._pendingSave.slice();this._pendingSave=[];for(var t=0,r=e.length;t<r;t++){var i=e[t],a=i.snapshot,n=i.resolver,o=a._internalModel,s=this.adapterFor(o.modelClass.modelName),l=void 0;if("root.deleted.saved"===T(o,"currentState.stateName"))return n.resolve();l=o.isNew()?"createRecord":o.isDeleted()?"deleteRecord":"updateRecord",n.resolve(R(s,this,l,a))}},didSaveRecord:function(e,t){var r=void 0;t&&(r=t.data),r&&(this.updateId(e,r),this._setupRelationshipsForModel(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,f.default)(t.id);null!==r&&null===i||(this._recordMapFor(e.modelName).set(i,e),e.setId(i))},_classKeyFor:function(e){return(0,a.default)(e)},_recordMapFor:function(e){return this._identityMap.retrieve(e)},_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,h.getOwner)(this),n=void 0;if(i.factoryFor){var o=i.factoryFor("mixin:"+t);n=o&&o.class}else n=i._lookupFactory("mixin:"+t);if(n){var s=r.default.extend(n);s.reopenClass({__isMixin:!0,__mixin:n}),i.register("model:"+t,s)}return this.modelFactoryFor(t)},modelFor:function(e){var t=this._classKeyFor(e);return this._modelFor(t)},_modelFor:function(e){var t=this._modelFactoryFor(e);return t.class?t.class:t},_modelFactoryFor:function(e){var t=this._modelClassCache[e];if(!t){if(t=this.modelFactoryFor(e),t||(t=this._modelForMixin(e)),!t)throw new x("No model was found for '"+e+"'");var r=(0,h.getOwner)(this).factoryFor?t.class:t;r.modelName=r.modelName||e,this._modelClassCache[e]=t}return t},modelFactoryFor:function(e){var t=this._classKeyFor(e),r=(0,h.getOwner)(this);return r.factoryFor?r.factoryFor("model:"+t):r._lookupFactory("model:"+t)},push:function(e){var t=this._push(e);if(Array.isArray(t)){return t.map(function(e){return e.getRecord()})}return null===t?null:t.getRecord()},_push:function(e){var t=this;return this._backburner.join(function(){var r=e.included,i=void 0,a=void 0;if(r)for(i=0,a=r.length;i<a;i++)t._pushInternalModel(r[i]);if(Array.isArray(e.data)){a=e.data.length;var n=new Array(a);for(i=0;i<a;i++)n[i]=t._pushInternalModel(e.data[i]);return n}return null===e.data?null:t._pushInternalModel(e.data)})},_hasModelFor:function(e){var t=(0,h.getOwner)(this);return t.factoryFor?!!t.factoryFor("model:"+e):!!t._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=(e.type,this._load(e));return this._setupRelationshipsForModel(t,e),t},_setupRelationshipsForModel:function(e,t){this._pushedInternalModels.push(e,t),null===this._relationshipFlush&&(this._relationshipFlush=this._backburner.schedule("normalizeRelationships",this,this._setupRelationships))},_setupRelationships:function(){var e=this._pushedInternalModels;this._pushedInternalModels=[],this._relationshipFlush=null;for(var t=0,r=e.length;t<r;t+=2){A(this,e[t],e[t+1])}},pushPayload:function(e,t){var r=void 0,i=void 0;if(t){i=t;var a=this._classKeyFor(e);r=this.serializerFor(a)}else i=e,r=_(this);r.pushPayload(this,i)},normalize:function(e,t){var r=this._classKeyFor(e),i=this.serializerFor(r),a=this._modelFor(r);return i.normalize(a,t)},buildInternalModel:function(e,t,r){var i=this._recordMapFor(e),a=new y.default(e,t,this,r);return i.add(a,t),a},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_dematerializeRecord:function(e){var t=this._recordMapFor(e.modelName),r=e.id;e.updateRecordArrays(),t.remove(e,r)},adapterFor:function(e){var t=this._classKeyFor(e);return this._instanceCache.get("adapter",t)},serializerFor:function(e){var t=this._classKeyFor(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._pushedInternalModels=null,this._backburner.cancel(this._relationshipFlush),this._relationshipFlush=null,this.recordArrayManager.destroy(),this._instanceCache.destroy(),this.unloadAll()},_pushResourceIdentifier:function(e,t){if(!w(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!w(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=I,e.default=I}),t("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return function(){return e.apply(void 0,r)}}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),
|
4
4
|
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,l){var d=s.createSnapshot(l),u=e.findRecord(t,r,o,d),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){var i=(0,a.normalizeResponseHelper)(c,t,r,e,o,"findRecord");return t._push(i)},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+r+"'")}function s(e,r,o,s,l){var d=t.default.A(l).invoke("createSnapshot"),u=e.findMany(r,o,s,d),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){var t=(0,a.normalizeResponseHelper)(c,r,o,e,null,"findMany");return r._push(t)},null,"DS: Extract payload of "+o)}function l(e,t,r,o,s){var l=r.createSnapshot(),d=t.modelFor(s.type),u=e.findHasMany(t,l,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){var r=(0,a.normalizeResponseHelper)(c,t,d,e,null,"findHasMany"),i=t._push(r);return i.meta=r.meta,i},null,"DS: Extract payload of "+r+" : hasMany "+s.type)}function d(e,t,r,o,s){var l=r.createSnapshot(),d=t.modelFor(s.type),u=e.findBelongsTo(t,l,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){var r=(0,a.normalizeResponseHelper)(c,t,d,e,null,"findBelongsTo");return r.data?t._push(r):null},null,"DS: Extract payload of "+r+" : "+s.type)}function u(e,t,r,o,s){var l=r.modelName,d=t.peekAll(l),u=d._createSnapshot(s),c=e.findAll(t,r,o,u),h=(0,n.serializerForAdapter)(t,e,l),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){var i=(0,a.normalizeResponseHelper)(h,t,r,e,null,"findAll");return t._push(i),t.didUpdateAll(l),t.peekAll(l)},null,"DS: Extract payload of findAll "+r)}function c(e,t,r,o,s){var l=r.modelName,d=e.query(t,r,o,s),u=(0,n.serializerForAdapter)(t,e,l),c="DS: Handle Adapter#query of "+r;return d=f.resolve(d,c),d=(0,i._guard)(d,(0,i._bind)(i._objectIsAlive,t)),d.then(function(e){var i=(0,a.normalizeResponseHelper)(u,t,r,e,null,"query"),n=t._push(i);return s._setInternalModels(n,i),s},null,"DS: Extract payload of query "+l)}function h(e,t,r,o){var s=r.modelName,l=e.queryRecord(t,r,o),d=(0,n.serializerForAdapter)(t,e,s),u="DS: Handle Adapter#queryRecord of "+s;return l=f.resolve(l,u),l=(0,i._guard)(l,(0,i._bind)(i._objectIsAlive,t)),l.then(function(e){var i=(0,a.normalizeResponseHelper)(d,t,r,e,null,"queryRecord");return t._push(i)},null,"DS: Extract payload of queryRecord "+s)}e._find=o,e._findMany=s,e._findHasMany=l,e._findBelongsTo=d,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;return e?(e.split(a).forEach(function(e){var t=e.split(":"),a=r(t),n=a[0],o=a.slice(1);n=n.trim(),(o=o.join(":").trim())&&(i[n]=o)}),i):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,d.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){return o(e,(arguments.length<=0||void 0===arguments[0]?{}:arguments[0]).message)}}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 l(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=l;var d=t.default.Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base",f=!1;a.prototype=Object.create(d.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 _=f?o(a,"The adapter operation failed due to a conflict"):null;e.ConflictError=_;var R=f?o(a,"The adapter operation failed due to a server error"):null;e.ServerError=R}),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={};e.serializerFor(t.modelName).serializeIntoHash(i,t,r,{includeId:!0});var a=r.id,n=this.buildURL(t.modelName,a,r,"updateRecord");return this.ajax(n,"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 l(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 d(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={};e.serializerFor(t.modelName).serializeIntoHash(i,t,r);var a=r.id,n=this.buildURL(t.modelName,a,r,"updateRecord");return this.ajax(n,"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,s[s.length-1].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){r(e,n,"&ids%5B%5D=".length).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=l(a,i,e,n);t.default.run.join(null,o,s)},u.error=function(e,r,i){var o={textStatus:r,errorThrown:i},l=d(a,e,n,o);t.default.run.join(null,s,l)},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";return a="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r,["Ember Data Request "+i.method+" "+i.url+" returned a "+e,"Payload ("+n+")",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){return"function"==typeof t.defaultValue?t.defaultValue.apply(null,arguments):t.defaultValue}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,l,d,u,c,h,f,p,m,y,v,b,g,_,R,A,k,F,z,M,S,x,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=d.Store,n.default.PromiseArray=l.PromiseArray,n.default.PromiseObject=l.PromiseObject,n.default.PromiseManyArray=l.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=_.RESTAdapter,n.default.BuildURLMixin=R.default,n.default.RESTSerializer=A.RESTSerializer,n.default.JSONSerializer=A.JSONSerializer,n.default.JSONAPIAdapter=_.JSONAPIAdapter,n.default.JSONAPISerializer=A.JSONAPISerializer,n.default.Transform=z.Transform,n.default.DateTransform=z.DateTransform,n.default.StringTransform=z.StringTransform,n.default.NumberTransform=z.NumberTransform,n.default.BooleanTransform=z.BooleanTransform,n.default.EmbeddedRecordsMixin=F.default,n.default.belongsTo=M.belongsTo,n.default.hasMany=M.hasMany,n.default.Relationship=T.default,n.default._setupContainer=S.default,n.default._initializeStoreService=x.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],l=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,l),n[o]=l}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 l=new Array(s.length),d=0;d<s.length;d++){var u=s[d],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))}l[d]={id:h.id,type:h.type}}n(r,"data.relationships."+t,{data:l})}},_extractEmbeddedBelongsTo:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){var l=this._normalizeEmbeddedRelationship(e,o,s),d=l.data,u=l.included;if(r.included=r.included||[],r.included.push(d),u){var c;(c=r.included).push.apply(c,i(u))}n(r,"data.relationships."+t,{data:{id:d.id,type:d.type}})}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var a=e.modelFor(i);return e.serializerFor(i).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,l=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;if(t=this.modelNameFromPayloadKey(e.type),"modelNameFromPayloadKey",!this.store._hasModelFor(t))return null;var r=this.store._modelFor(t);return this.store.serializerFor(t).normalize(r,e).data},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);e.push(r)},_normalizeResponse:function(e,t,r,i,a,n){return this._normalizeDocumentHelper(r)},normalizeQueryRecordResponse:function(){return this._super.apply(this,arguments)},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){n=this.transformFor(a).serialize(n,i.options)}var o=this._getMappedKey(r,e.type);o===r&&(o=this.keyForAttribute(r,"serialize")),t.attributes[o]=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(a="shouldSerializeHasMany",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),l=0;l<n.length;l++){var d=n[l],u=void 0;u=this.payloadKeyFromModelName(d.modelName),s[l]={type:u,id:d.id}}t.relationships[o]={data:s}}}}});e.default=l}),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,l){function d(e){if(Array.isArray(e)){
|
5
|
-
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 l=this.normalize(t,r),u=l.data,c=l.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,d(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 l=null,d=r[s];if("belongsTo"===n.kind)l=n.options.polymorphic?i.extractPolymorphicRelationship(n.type,d,{key:e,resourceHash:r,relationshipMeta:n}):i.extractRelationship(n.type,d);else if("hasMany"===n.kind&&!t.default.isNone(d)){l=new Array(d.length);for(var u=0,c=d.length;u<c;u++){var h=d[u];l[u]=i.extractRelationship(n.type,h)}}o={data:l}}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){this.serializeId(e,i,u(this,"primaryKey"))}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){n=this.transformFor(a).serialize(n,i.options)}var o=this._getMappedKey(r,e.type);o===r&&this.keyForAttribute&&(o=this.keyForAttribute(r,"serialize")),t[o]=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(a="shouldSerializeHasMany",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,l.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){return(0,o.getOwner)(this).lookup("transform:"+e)}});f.reopen({serializeId:function(e,t,r){var i=e.id;i&&(t[r]=i)}}),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,l){function d(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){return this.keyForRelationship(e)+"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),l=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,a,s,l),i=r.data,u=r.included;if(o.data.push(i),u){var c;(c=o.included).push.apply(c,d(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,i,a){var n=a,o=i;if(!(0,s.modelHasAttributeOrRelationshipNamedType)(i)&&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 l={data:null,included:[]},u=this.extractMeta(e,r,i);u&&(l.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 _=this._normalizePolymorphicRecord(e,g,p,r,this),R=_.data,A=_.included;if(l.data=R,A){var k;(k=l.included).push.apply(k,d(A))}}else{var F=this._normalizeArray(e,v,g,p),z=F.data,M=F.included;if(M){var S;(S=l.included).push.apply(S,d(M))}if(s)z.forEach(function(e){var t=b&&(0,o.default)(e.id)===a;b&&!a&&!l.data||t?l.data=e:l.included.push(e)});else if(b)l.data=z;else if(z){var x;(x=l.included).push.apply(x,d(z))}}}}return l},isPrimaryType:function(e,t,r){return e.modelFor(t).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 l;(l=i.included).push.apply(l,d(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){e[this.payloadKeyFromModelName(t.modelName)]=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 l,l=this.modelNameFromPayloadKey(a[s]);return{id:t,type:l}}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.12.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,void 0!==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*$/,l=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,d=/([\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;if(f=!e||s.test(e),p=u.test(e),"",f)return e;if(n=e.toLowerCase(),c=l.exec(e)||d.exec(e),c&&(c[1],h=c[2].toLowerCase()),this.rules.uncountable[n]||this.rules.uncountable[h])return e;for(m in r)if(n.match(m+"$"))return a=r[m],p&&r[h]&&(a=o(a),m=o(m)),e.replace(new RegExp(m,"i"),a);for(var y=t.length;y>0&&(i=t[y-1],m=i[0],!m.test(e));y--);return i=i||[],m=i[0],a=i[1],e.replace(m,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)/");(Object.keys||t.default.keys)(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 l=a.match(/[^\/]+\/?$/)[0];s.name=l}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(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&function(){var t={"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 t)e(r,t[r])}()}();
|
5
|
+
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 l=this.normalize(t,r),u=l.data,c=l.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,d(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 l=null,d=r[s];if("belongsTo"===n.kind)l=n.options.polymorphic?i.extractPolymorphicRelationship(n.type,d,{key:e,resourceHash:r,relationshipMeta:n}):i.extractRelationship(n.type,d);else if("hasMany"===n.kind&&!t.default.isNone(d)){l=new Array(d.length);for(var u=0,c=d.length;u<c;u++){var h=d[u];l[u]=i.extractRelationship(n.type,h)}}o={data:l}}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){this.serializeId(e,i,u(this,"primaryKey"))}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){n=this.transformFor(a).serialize(n,i.options)}var o=this._getMappedKey(r,e.type);o===r&&this.keyForAttribute&&(o=this.keyForAttribute(r,"serialize")),t[o]=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(a="shouldSerializeHasMany",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,l.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){return(0,o.getOwner)(this).lookup("transform:"+e)}});f.reopen({serializeId:function(e,t,r){var i=e.id;i&&(t[r]=i)}}),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,l){function d(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){return this.keyForRelationship(e)+"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),l=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,a,s,l),i=r.data,u=r.included;if(o.data.push(i),u){var c;(c=o.included).push.apply(c,d(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,i,a){var n=a,o=i;if(!(0,s.modelHasAttributeOrRelationshipNamedType)(i)&&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 l={data:null,included:[]},u=this.extractMeta(e,r,i);u&&(l.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 _=this._normalizePolymorphicRecord(e,g,p,r,this),R=_.data,A=_.included;if(l.data=R,A){var k;(k=l.included).push.apply(k,d(A))}}else{var F=this._normalizeArray(e,v,g,p),z=F.data,M=F.included;if(M){var S;(S=l.included).push.apply(S,d(M))}if(s)z.forEach(function(e){var t=b&&(0,o.default)(e.id)===a;b&&!a&&!l.data||t?l.data=e:l.included.push(e)});else if(b)l.data=z;else if(z){var x;(x=l.included).push.apply(x,d(z))}}}}return l},isPrimaryType:function(e,t,r){return e.modelFor(t).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 l;(l=i.included).push.apply(l,d(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){e[this.payloadKeyFromModelName(t.modelName)]=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 l,l=this.modelNameFromPayloadKey(a[s]);return{id:t,type:l}}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.12.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,void 0!==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*$/,l=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,d=/([\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;if(f=!e||s.test(e),p=u.test(e),"",f)return e;if(n=e.toLowerCase(),c=l.exec(e)||d.exec(e),c&&(c[1],h=c[2].toLowerCase()),this.rules.uncountable[n]||this.rules.uncountable[h])return e;for(m in r)if(n.match(m+"$"))return a=r[m],p&&r[h]&&(a=o(a),m=o(m)),e.replace(new RegExp(m,"i"),a);for(var y=t.length;y>0&&(i=t[y-1],m=i[0],!m.test(e));y--);return i=i||[],m=i[0],a=i[1],e.replace(m,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)/");(Object.keys||t.default.keys)(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 l=a.match(/[^\/]+\/?$/)[0];s.name=l}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}})}()}).call(this),function(){function e(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&function(){var t={"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 t)e(r,t[r])}()}();
|
@@ -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.12.
|
9
|
+
* @version 2.12.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var loader, define, requireModule, require, requirejs;
|
@@ -19363,7 +19363,7 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
|
|
19363
19363
|
});
|
19364
19364
|
});
|
19365
19365
|
define("ember-data/version", ["exports"], function (exports) {
|
19366
|
-
exports.default = "2.12.
|
19366
|
+
exports.default = "2.12.1";
|
19367
19367
|
});
|
19368
19368
|
define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
|
19369
19369
|
|
@@ -19876,7 +19876,7 @@ require("ember-load-initializers")["default"](Ember.Application, "ember-data");
|
|
19876
19876
|
}
|
19877
19877
|
});
|
19878
19878
|
})();
|
19879
|
-
})();
|
19879
|
+
}).call(this);
|
19880
19880
|
;(function() {
|
19881
19881
|
function processEmberDataShims() {
|
19882
19882
|
var shims = {
|
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.12.
|
4
|
+
version: 2.12.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-03-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ember-source
|