ember-data-source 2.14.11 → 2.15.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- (function(){"use strict";var e,t,r,i,n;!function(a){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(id, deps, module)` instead got: `"+e+"` arguments to define`")}function l(e,t,r,i){this.uuid=b++,this.id=e,this.deps=!t.length&&r.length?_:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function d(){}function u(e){this.id=e}function c(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function h(e,t,r){for(var i=m[e]||m[e+"/index"];i&&i.isAlias;)i=m[i.id];return i||c(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function p(e,t){if("."!==e.charAt(0))return e;for(var r=e.split("/"),i=t.split("/"),n=i.slice(0,-1),a=0,o=r.length;a<o;a++){var s=r[a];if(".."===s){if(0===n.length)throw new Error("Cannot access parent module of root");n.pop()}else{if("."===s)continue;n.push(s)}}return n.join("/")}function f(e){return!(!m[e]&&!m[e+"/index"])}var y={loader:e,define:t,requireModule:r,require:i,requirejs:n};n=i=r=function(e){for(var t=[],r=h(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)&&y.hasOwnProperty(t)&&(r=e[t],a[r]=a[t],a[t]=y[t])},makeDefaultExport:!0};var m=o(),v=o(),b=0,_=["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.id,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.reified.length=0,this.state="finalized",this.hasExportsAsDep&&void 0===t||(this.module.exports=t),e.makeDefaultExport&&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],n=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,n.exports=this.module.exports):"require"===i?n.exports=this.makeRequire():"module"===i?n.exports=this.module:n.module=h(p(i,this.id),this.id,e)}}},l.prototype.makeRequire=function(){var e=this.id,t=function(t){return i(p(t,e))};return t.default=t,t.moduleId=e,t.has=function(t){return f(p(t,e))},t},t=function(e,t,r){var i=m[e];i&&"new"!==i.state||(arguments.length<2&&s(arguments.length),Array.isArray(t)||(r=t,t=[]),m[e]=r instanceof u?new l(r.id,t,r,!0):new l(e,t,r,!1))},t.exports=function(e,t){var r=m[e];if(!r||"new"===r.state)return r=new l(e,[],d,null),r.module.exports=t,r.state="finalized",m[e]=r,r},t.alias=function(e,r){return 2===arguments.length?t(r,new u(e)):new u(e)},n.entries=n._eak_seen=m,n.has=f,n.unsee=function(e){h(e,"(unsee)",!1).unsee()},n.clear=function(){n.entries=n._eak_seen=m=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.alias("foo","foo/qux"),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),t.exports("foo/exports",{}),i("foo/exports"),i("foo/main"),i.unsee("foo/bar"),n.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-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 n(){return t.default.deprecate.apply(t.default,arguments)}function a(){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 n=i.modelName,a=e.modelName,o=t.key,s=t.type;r("You cannot add a record of modelClass '"+n+"' to the '"+a+"."+o+"' relationship (only '"+s+"' allowed)",u(e.store.modelFor(s),i.modelClass))}e.__esModule=!0,e.assert=r,e.debug=i,e.deprecate=n,e.info=a,e.runInDebug=o,e.instrument=s,e.warn=l,e.debugSeal=d,e.assertPolymorphicType=c}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember","ember-inflector"],function(e,t,r){e.__esModule=!0;var i=t.default.get;e.default=t.default.Mixin.create({buildURL:function(e,t,r,i,n){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(n,e);case"queryRecord":return this.urlForQueryRecord(n,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 r=void 0,n=[],a=i(this,"host"),o=this.urlPrefix();return e&&(r=this.pathForType(e))&&n.push(r),t&&n.push(encodeURIComponent(t)),o&&n.unshift(o),n=n.join("/"),!a&&n&&"/"!==n.charAt(0)&&(n="/"+n),n},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 r=i(this,"host"),n=i(this,"namespace");if(r&&"/"!==r||(r=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+r+e:t+"/"+e;var a=[];return r&&a.push(r),n&&a.push(n),a.join("/")},pathForType:function(e){var i=t.default.String.camelize(e);return(0,r.pluralize)(i)}})}),t("ember-data/-private/adapters/errors",["exports","ember","ember-data/-private/features"],function(e,t,r){function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Adapter operation failed";this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.message;return a(e,r)}}function a(e,t){var r=function(r,i){e.call(this,r,i||t)};return r.prototype=Object.create(e.prototype),h&&(r.extend=n(r)),r}function o(e){var r=[];return t.default.isPresent(e)&&Object.keys(e).forEach(function(i){for(var n=t.default.makeArray(e[i]),a=0;a<n.length;a++){var o="Invalid Attribute",s="/data/attributes/"+i;i===c&&(o="Invalid Document",s="/data"),r.push({title:o,detail:n[a],source:{pointer:s}})}}),r}function s(e){var r={};return t.default.isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(d);t?t=t[2]:-1!==e.source.pointer.search(u)&&(t=c),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.__esModule=!0,e.ServerError=e.ConflictError=e.NotFoundError=e.ForbiddenError=e.UnauthorizedError=e.AbortError=e.TimeoutError=e.InvalidError=void 0,e.AdapterError=i,e.errorsHashToArray=o,e.errorsArrayToHash=s;var l=t.default.Error,d=/^\/?data\/(attributes|relationships)\/(.*)/,u=/^\/?data/,c="base",h=!1;h=!0,i.prototype=Object.create(l.prototype),h&&(i.extend=n(i));e.InvalidError=a(i,"The adapter rejected the commit because it was invalid"),e.TimeoutError=a(i,"The adapter operation timed out"),e.AbortError=a(i,"The adapter operation was aborted"),e.UnauthorizedError=h?a(i,"The adapter operation is unauthorized"):null,e.ForbiddenError=h?a(i,"The adapter operation is forbidden"):null,e.NotFoundError=h?a(i,"The adapter could not find the resource"):null,e.ConflictError=h?a(i,"The adapter operation failed due to a conflict"):null,e.ServerError=h?a(i,"The adapter operation failed due to a server error"):null}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){e.__esModule=!0;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/features",["exports","ember"],function(e,t){function r(){var e;return(e=t.default.FEATURES).isEnabled.apply(e,arguments)}e.__esModule=!0,e.default=r}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}e.__esModule=!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",["exports","ember-data/-private/system/model/model","ember-data/-private/system/model/errors","ember-data/-private/system/store","ember-data/-private/core","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/adapters/build-url-mixin","ember-data/-private/system/snapshot","ember-data/-private/adapters/errors","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/utils/parse-response-headers","ember-data/-private/global","ember-data/-private/features","ember-data/-private/system/model/states","ember-data/-private/system/model/internal-model","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/promise-proxies","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/debug/debug-adapter","ember-data/-private/system/diff-array","ember-data/-private/system/relationships/relationship-payloads-manager","ember-data/-private/system/relationships/relationship-payloads","ember-data/-private/system/snapshot-record-array"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,y,m,v,b,_,g,R,M,A,F,z,I,S,k){e.__esModule=!0,Object.defineProperty(e,"Model",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Errors",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DS",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"belongsTo",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"hasMany",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BuildURLMixin",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"Snapshot",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"AdapterError",{enumerable:!0,get:function(){return d.AdapterError}}),Object.defineProperty(e,"InvalidError",{enumerable:!0,get:function(){return d.InvalidError}}),Object.defineProperty(e,"UnauthorizedError",{enumerable:!0,get:function(){return d.UnauthorizedError}}),Object.defineProperty(e,"ForbiddenError",{enumerable:!0,get:function(){return d.ForbiddenError}}),Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return d.NotFoundError}}),Object.defineProperty(e,"ConflictError",{enumerable:!0,get:function(){return d.ConflictError}}),Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return d.ServerError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return d.TimeoutError}}),Object.defineProperty(e,"AbortError",{enumerable:!0,get:function(){return d.AbortError}}),Object.defineProperty(e,"errorsHashToArray",{enumerable:!0,get:function(){return d.errorsHashToArray}}),Object.defineProperty(e,"errorsArrayToHash",{enumerable:!0,get:function(){return d.errorsArrayToHash}}),Object.defineProperty(e,"normalizeModelName",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"getOwner",{enumerable:!0,get:function(){return c.getOwner}}),Object.defineProperty(e,"modelHasAttributeOrRelationshipNamedType",{enumerable:!0,get:function(){return c.modelHasAttributeOrRelationshipNamedType}}),Object.defineProperty(e,"coerceId",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"parseResponseHeaders",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"global",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"isEnabled",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"RootState",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"InternalModel",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"ContainerInstanceCache",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"PromiseArray",{enumerable:!0,get:function(){return _.PromiseArray}}),Object.defineProperty(e,"PromiseObject",{enumerable:!0,get:function(){return _.PromiseObject}}),Object.defineProperty(e,"PromiseManyArray",{enumerable:!0,get:function(){return _.PromiseManyArray}}),Object.defineProperty(e,"RecordArray",{enumerable:!0,get:function(){return g.RecordArray}}),Object.defineProperty(e,"FilteredRecordArray",{enumerable:!0,get:function(){return g.FilteredRecordArray}}),Object.defineProperty(e,"AdapterPopulatedRecordArray",{enumerable:!0,get:function(){return g.AdapterPopulatedRecordArray}}),Object.defineProperty(e,"ManyArray",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"RecordArrayManager",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"Relationship",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"DebugAdapter",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"diffArray",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(e,"RelationshipPayloadsManager",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(e,"RelationshipPayloads",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"SnapshotRecordArray",{enumerable:!0,get:function(){return k.default}})}),t("ember-data/-private/system/clone-null",["exports"],function(e){function t(e){var t=Object.create(null);for(var r in e)t[r]=e[r];return t}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:"string"==typeof e?e:""+e}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/-private/system/model/model"],function(e,t,r){e.__esModule=!0;var i=t.default.String.capitalize,n=t.default.String.underscore,a=t.default.assert,o=t.default.get;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,a=this;return o(e,"attributes").forEach(function(e,o){if(r++>a.attributeLimit)return!1;var s=i(n(o).replace("_"," "));t.push({name:o,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 a("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,i={id:o(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;i[n]=o(e,n)}),i},getRecordKeywords:function(e){var r=[],i=t.default.A(["id"]);return e.eachAttribute(function(e){return i.push(e)}),i.forEach(function(t){return r.push(o(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(),n=t.default.A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return n.push(e)});var a=this;return n.forEach(function(n){var o=function(){r(a.wrapRecord(e))};t.default.addObserver(e,n,o),i.push(function(){t.default.removeObserver(e,n,o)})}),function(){i.forEach(function(e){return e()})}}})}),t("ember-data/-private/system/diff-array",["exports"],function(e){function t(e,t){for(var r=e.length,i=t.length,n=Math.min(r,i),a=null,o=0;o<n;o++)if(e[o]!==t[o]){a=o;break}null===a&&i!==r&&(a=n);var s=0,l=0;if(null!==a){for(var d=n-a,u=1;u<=n;u++)if(e[r-u]!==t[i-u]){d=u-1;break}s=i-d-a,l=r-d-a}return{firstChangeIndex:a,addedCount:s,removedCount:l}}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/identity-map",["exports","ember-data/-private/system/internal-model-map"],function(e,t){e.__esModule=!0;var r=function(){function e(){this._map=Object.create(null)}return e.prototype.retrieve=function(e){var r=this._map[e];return r||(r=this._map[e]=new t.default(e)),r},e.prototype.clear=function(){for(var e=this._map,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].clear()}},e}();e.default=r}),t("ember-data/-private/system/internal-model-map",["exports","ember-data/-private/system/model/internal-model"],function(e,t){e.__esModule=!0;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(e){this.modelName=e,this._idToModel=Object.create(null),this._models=[],this._metadata=null}return e.prototype.get=function(e){return this._idToModel[e]},e.prototype.has=function(e){return!!this._idToModel[e]},e.prototype.set=function(e,t){this._idToModel[e]=t},e.prototype.add=function(e,t){t&&(this._idToModel[t]=e),this._models.push(e)},e.prototype.remove=function(e,t){t&&delete this._idToModel[t];var r=this._models.indexOf(e);-1!==r&&this._models.splice(r,1)},e.prototype.contains=function(e){return-1!==this._models.indexOf(e)},e.prototype.clear=function(){if(this._models){var e=this._models;this._models=[];for(var t=0;t<e.length;t++){e[t].unloadRecord()}}this._metadata=null},e.prototype.destroy=function(){this._store=null,this._modelClass=null},r(e,[{key:"idToRecord",get:function(){return this._idToModel}},{key:"length",get:function(){return this._models.length}},{key:"models",get:function(){return this._models}},{key:"metadata",get:function(){return this._metadata||(this._metadata=Object.create(null))}},{key:"type",get:function(){throw new Error("InternalModelMap.type is no longer available")}}]),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.__esModule=!0,e.default=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/diff-array"],function(e,t,r,i,n){e.__esModule=!0;var a=t.default.get;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=[],this.flushCanonical(!1)},objectAt:function(e){var t=this.currentState[e];if(void 0!==t)return t.getRecord()},flushCanonical:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if((0,i._objectIsAlive)(this)){var t=this.canonicalState,r=this.currentState.filter(function(e){return e.isNew()&&-1===t.indexOf(e)});t=t.concat(r);var a=(0,n.default)(this.currentState,t);null!==a.firstChangeIndex&&(this.arrayContentWillChange(a.firstChangeIndex,a.removedCount,a.addedCount),this.set("length",t.length),this.currentState=t,this.arrayContentDidChange(a.firstChangeIndex,a.removedCount,a.addedCount),e&&a.addedCount>0&&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)},_removeInternalModels:function(e){for(var t=0;t<e.length;t++){var r=this.currentState.indexOf(e[t]);this.internalReplace(r,1)}},_addInternalModels: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").removeInternalModels(i)),r&&this.get("relationship").addInternalModels(r.map(function(e){return e._internalModel}),e)},reload:function(){return this.relationship.reload()},save:function(){var e=this,i="DS: ManyArray#save "+a(this,"type"),n=t.default.RSVP.all(this.invoke("save"),i).then(function(){return e},null,"DS: ManyArray#save return ManyArray");return r.PromiseArray.create({promise:n})},createRecord:function(e){var t=a(this,"store"),r=a(this,"type"),i=t.createRecord(r.modelName,e);return this.pushObject(i),i}})}),t("ember-data/-private/system/model/errors",["exports","ember"],function(e,t){e.__esModule=!0;var r=t.default.get,i=t.default.set,n=t.default.isEmpty,a=t.default.makeArray,o=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 o.create({defaultValue:function(){return t.default.A()}})}),errorsFor:function(e){return r(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 i=r(this,"isEmpty");this._add(e,t),i&&!r(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),r(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=a(t),n=new Array(i.length),o=0;o<i.length;o++){var s=i[o],l=r.findBy("message",s);n[o]=l||{attribute:e,message:s}}return n},remove:function(e){r(this,"isEmpty")||(this._remove(e),r(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!r(this,"isEmpty")){var t=this.rejectBy("attribute",e);i(this,"content",t),r(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e)}},clear:function(){r(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!r(this,"isEmpty")){var e=r(this,"errorsByAttributeName"),i=t.default.A();e.forEach(function(e,t){i.push(t)}),e.clear(),i.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/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/features","ember-data/-private/system/ordered-set","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,n,a,o,s,l){function d(e){return k[e]||(k[e]=e.split("."))}function u(e){return S[e]||(S[e]=d(e)[0])}function c(e){for(var t=0;t<e.length;++t){var r=e[t]._record;if(r&&!r.get("isDestroyed")&&!r.get("isDestroying"))return!1}return!0}function h(e){e._inverseIsAsync()?(e.removeInternalModelFromInverse(e.inverseInternalModel),e.removeInverseRelationships()):e.removeCompletelyFromInverse()}e.__esModule=!0;var p=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,y=t.default.set,m=t.default.copy,v=t.default.Error,b=t.default.inspect,_=t.default.isEmpty,g=t.default.isEqual,R=t.default.setOwner,M=t.default.run,A=t.default.RSVP,F=t.default.RSVP.Promise,z=t.default.assign||t.default.merge,I=Object.create(null),S=Object.create(null),k=Object.create(null),P=1,x=1,T=function(){function e(e,r,i,n){this.id=r,this[t.default.GUID_KEY]=P+++"internal-model",this.store=i,this.modelName=e,this._loadingPromise=null,this._record=null,this._isDestroyed=!1,this.isError=!1,this._isUpdatingRecordArrays=!1,this._isDematerializing=!1,this._scheduledDestroy=null,this.resetRecord(),n&&(this.__data=n),this._modelClass=null,this.__deferredTriggers=null,this.__recordArrays=null,this._references=null,this._recordReference=null,this.__relationships=null,this.__implicitRelationships=null,this._bfsId=0}return e.prototype.isHiddenFromRecordArrays=function(){return this._isDematerializing||this.isDestroyed||"root.deleted.saved"===this.currentState.stateName||this.isEmpty()},e.prototype.isEmpty=function(){return this.currentState.isEmpty},e.prototype.isLoading=function(){return this.currentState.isLoading},e.prototype.isLoaded=function(){return this.currentState.isLoaded},e.prototype.hasDirtyAttributes=function(){return this.currentState.hasDirtyAttributes},e.prototype.isSaving=function(){return this.currentState.isSaving},e.prototype.isDeleted=function(){return this.currentState.isDeleted},e.prototype.isNew=function(){return this.currentState.isNew},e.prototype.isValid=function(){return this.currentState.isValid},e.prototype.dirtyType=function(){return this.currentState.dirtyType},e.prototype.getRecord=function(e){if(!this._record&&!this._isDematerializing){var t={store:this.store,_internalModel:this,id:this.id,currentState:this.currentState,isError:this.isError,adapterError:this.error};"object"==typeof e&&null!==e&&z(t,e),R?R(t,(0,s.getOwner)(this.store)):t.container=this.store.container,this._record=this.store.modelFactoryFor(this.modelName).create(t),this._triggerDeferredTriggers()}return this._record},e.prototype.resetRecord=function(){this._record=null,this.dataHasInitialized=!1,this.isReloading=!1,this.error=null,this.currentState=r.default.empty,this.__attributes=null,this.__inFlightAttributes=null,this._data=null},e.prototype.dematerializeRecord=function(){this._record&&(this._isDematerializing=!0,this._record.destroy(),this.destroyRelationships(),this.updateRecordArrays(),this.resetRecord())},e.prototype.deleteRecord=function(){this.send("deleteRecord")},e.prototype.save=function(e){var t="DS: Model#save "+this,r=A.defer(t);return this.store.scheduleSave(this,r,e),r.promise},e.prototype.startedReloading=function(){this.isReloading=!0,this.hasRecord&&y(this._record,"isReloading",!0)},e.prototype.finishedReloading=function(){this.isReloading=!1,this.hasRecord&&y(this._record,"isReloading",!1)},e.prototype.reload=function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new F(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()})},e.prototype._directlyRelatedInternalModels=function(){var e=[];return this._relationships.forEach(function(t,r){e=e.concat(r.members.list,r.canonicalMembers.list)}),e},e.prototype._allRelatedInternalModels=function(){var e=[],t=[],r=x++;for(t.push(this),this._bfsId=r;t.length>0;){var i=t.shift();e.push(i);for(var n=i._directlyRelatedInternalModels(),a=0;a<n.length;++a){var o=n[a];o._bfsId<r&&(t.push(o),o._bfsId=r)}}return e},e.prototype.unloadRecord=function(){this.isDestroyed||(this.send("unloadRecord"),this.dematerializeRecord(),null===this._scheduledDestroy&&(this._scheduledDestroy=M.schedule("destroy",this,"_checkForOrphanedInternalModels")))},e.prototype.hasScheduledDestroy=function(){return!!this._scheduledDestroy},e.prototype.cancelDestroy=function(){this._isDematerializing=!1,M.cancel(this._scheduledDestroy),this._scheduledDestroy=null},e.prototype.destroySync=function(){this._isDematerializing&&this.cancelDestroy(),this._checkForOrphanedInternalModels(),this.isDestroyed||this.isDestroying||this.destroy()},e.prototype._checkForOrphanedInternalModels=function(){this._isDematerializing=!1,this._scheduledDestroy=null,this.isDestroyed||this._cleanupOrphanedInternalModels()},e.prototype._cleanupOrphanedInternalModels=function(){var e=this._allRelatedInternalModels();if(c(e))for(var t=0;t<e.length;++t){var r=e[t];r.isDestroyed||r.destroy()}},e.prototype.eachRelationship=function(e,t){return this.modelClass.eachRelationship(e,t)},e.prototype.destroy=function(){this.store._internalModelDestroyed(this),this._relationships.forEach(function(e,t){return t.destroy()}),this._isDestroyed=!0},e.prototype.eachAttribute=function(e,t){return this.modelClass.eachAttribute(e,t)},e.prototype.inverseFor=function(e){return this.modelClass.inverseFor(e)},e.prototype.setupData=function(e){this.store._internalModelDidReceiveRelationshipData(this.modelName,this.id,e.relationships);var t=void 0;this.hasRecord&&(t=this._changedKeys(e.attributes)),z(this._data,e.attributes),this.pushedData(),this.hasRecord&&this._record._notifyProperties(t),this.didInitializeData()},e.prototype.becameReady=function(){this.store.recordArrayManager.recordWasLoaded(this)},e.prototype.didInitializeData=function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)},e.prototype.createSnapshot=function(e){return new n.default(this,e)},e.prototype.loadingData=function(e){this.send("loadingData",e)},e.prototype.loadedData=function(){this.send("loadedData"),this.didInitializeData()},e.prototype.notFound=function(){this.send("notFound")},e.prototype.pushedData=function(){this.send("pushedData")},e.prototype.flushChangedAttributes=function(){this._inFlightAttributes=this._attributes,this._attributes=null},e.prototype.hasChangedAttributes=function(){return null!==this.__attributes&&Object.keys(this.__attributes).length>0},e.prototype.updateChangedAttributes=function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=this._attributes,i=0,n=t.length;i<n;i++){var a=t[i],o=e[a];o[0]===o[1]&&delete r[a]}},e.prototype.changedAttributes=function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=z(m(r),t),n=Object.create(null),a=Object.keys(i),o=0,s=a.length;o<s;o++){var l=a[o];n[l]=[e[l],i[l]]}return n},e.prototype.adapterWillCommit=function(){this.send("willCommit")},e.prototype.adapterDidDirty=function(){this.send("becomeDirty"),this.updateRecordArrays()},e.prototype.send=function(e,t){
2
- var r=this.currentState;return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},e.prototype.notifyHasManyAdded=function(e,t,r){this.hasRecord&&this._record.notifyHasManyAdded(e,t,r)},e.prototype.notifyBelongsToChanged=function(e,t){this.hasRecord&&this._record.notifyBelongsToChanged(e,t)},e.prototype.notifyPropertyChange=function(e){this.hasRecord&&this._record.notifyPropertyChange(e)},e.prototype.rollbackAttributes=function(){var e=void 0;this.hasChangedAttributes()&&(e=Object.keys(this._attributes),this._attributes=null),f(this,"isError")&&(this._inFlightAttributes=null,this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.removeFromInverseRelationships(!0),this.isValid()&&(this._inFlightAttributes=null),this.send("rolledBack"),e&&e.length>0&&this._record._notifyProperties(e)},e.prototype.transitionTo=function(e){var t=u(e),r=this.currentState,i=r.stateName+"->"+e;do{r.exit&&r.exit(this),r=r.parentState}while(!r[t]);var n=void 0,a=void 0,o=void 0,s=void 0,l=I[i];if(l)n=l.setups,a=l.enters,r=l.state;else{n=[],a=[];var c=d(e);for(o=0,s=c.length;o<s;o++)r=r[c[o]],r.enter&&a.push(r),r.setup&&n.push(r);I[i]={setups:n,enters:a,state:r}}for(o=0,s=a.length;o<s;o++)a[o].enter(this);for(this.currentState=r,this.hasRecord&&y(this._record,"currentState",r),o=0,s=n.length;o<s;o++)n[o].setup(this);this.updateRecordArrays()},e.prototype._unhandledEvent=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 "+b(r)+"."),new v(i)},e.prototype.triggerLater=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];1===this._deferredTriggers.push(t)&&this.store._updateInternalModel(this)},e.prototype._triggerDeferredTriggers=function(){if(this.hasRecord){for(var e=this._deferredTriggers,t=this._record,r=t.trigger,i=0,n=e.length;i<n;i++)r.apply(t,e[i]);e.length=0}},e.prototype.removeFromInverseRelationships=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._relationships.forEach(function(t,r){r.removeCompletelyFromInverse(),!0===e&&r.clear()});var t=this._implicitRelationships;this.__implicitRelationships=null,Object.keys(t).forEach(function(r){var i=t[r];i.removeCompletelyFromInverse(),!0===e&&i.clear()})},e.prototype.destroyRelationships=function(){this._relationships.forEach(function(e,t){return h(t)});var e=this._implicitRelationships;this.__implicitRelationships=null,Object.keys(e).forEach(function(t){var r=e[t];h(r),r.destroy()})},e.prototype.preloadData=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})},e.prototype._preloadRelationship=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)},e.prototype._preloadHasMany=function(e,t,r){for(var i=new Array(t.length),n=0;n<t.length;n++){var a=t[n];i[n]=this._convertStringOrNumberIntoInternalModel(a,r)}this._relationships.get(e).updateInternalModelsFromAdapter(i)},e.prototype._preloadBelongsTo=function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setInternalModel(i)},e.prototype._convertStringOrNumberIntoInternalModel=function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},e.prototype.updateRecordArrays=function(){this.store.recordArrayManager.recordDidChange(this)},e.prototype.setId=function(e){this.id=e,this._record.get("id")!==e&&this._record.set("id",e)},e.prototype.didError=function(e){this.error=e,this.isError=!0,this.hasRecord&&this._record.setProperties({isError:!0,adapterError:e})},e.prototype.didCleanError=function(){this.error=null,this.isError=!1,this.hasRecord&&this._record.setProperties({isError:!1,adapterError:null})},e.prototype.adapterDidCommit=function(e){e&&(this.store._internalModelDidReceiveRelationshipData(this.modelName,this.id,e.relationships),e=e.attributes),this.didCleanError();var t=this._changedKeys(e);z(this._data,this._inFlightAttributes),e&&z(this._data,e),this._inFlightAttributes=null,this.send("didCommit"),this.updateRecordArrays(),e&&this._record._notifyProperties(t)},e.prototype.addErrorMessageToAttribute=function(e,t){f(this.getRecord(),"errors")._add(e,t)},e.prototype.removeErrorMessageFromAttribute=function(e){f(this.getRecord(),"errors")._remove(e)},e.prototype.clearErrorMessages=function(){f(this.getRecord(),"errors")._clear()},e.prototype.hasErrors=function(){var e=f(this.getRecord(),"errors");return!_(e)},e.prototype.adapterDidInvalidate=function(e){var t=void 0;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},e.prototype.adapterDidError=function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},e.prototype._saveWasRejected=function(){var e=Object.keys(this._inFlightAttributes);if(e.length>0)for(var t=this._attributes,r=0;r<e.length;r++)void 0===t[e[r]]&&(t[e[r]]=this._inFlightAttributes[e[r]]);this._inFlightAttributes=null},e.prototype._changedKeys=function(e){var t=[];if(e){var r=void 0,i=void 0,n=void 0,a=void 0,o=Object.keys(e),s=o.length,l=this.hasChangedAttributes(),d=void 0;for(l&&(d=this._attributes),r=z(Object.create(null),this._data),r=z(r,this._inFlightAttributes),i=0;i<s;i++)a=o[i],n=e[a],!0===l&&void 0!==d[a]||g(r[a],n)||t.push(a)}return t},e.prototype.toString=function(){return"<"+this.modelName+":"+this.id+">"},e.prototype.referenceFor=function(e,t){var r=this.references[t];if(!r){var i=this._relationships.get(t);"belongsTo"===e?r=new l.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new l.HasManyReference(this.store,this,i)),this.references[t]=r}return r},p(e,[{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 l.RecordReference(this.store,this)),this._recordReference}},{key:"_recordArrays",get:function(){return null===this.__recordArrays&&(this.__recordArrays=o.default.create()),this.__recordArrays}},{key:"references",get:function(){return null===this._references&&(this._references=Object.create(null)),this._references}},{key:"_deferredTriggers",get:function(){return null===this.__deferredTriggers&&(this.__deferredTriggers=[]),this.__deferredTriggers}},{key:"_attributes",get:function(){return null===this.__attributes&&(this.__attributes=Object.create(null)),this.__attributes},set:function(e){this.__attributes=e}},{key:"_relationships",get:function(){return null===this.__relationships&&(this.__relationships=new i.default(this)),this.__relationships}},{key:"_inFlightAttributes",get:function(){return null===this.__inFlightAttributes&&(this.__inFlightAttributes=Object.create(null)),this.__inFlightAttributes},set:function(e){this.__inFlightAttributes=e}},{key:"_data",get:function(){return null===this.__data&&(this.__data=Object.create(null)),this.__data},set:function(e){this.__data=e}},{key:"_implicitRelationships",get:function(){return null===this.__implicitRelationships&&(this.__implicitRelationships=Object.create(null)),this.__implicitRelationships}},{key:"isDestroyed",get:function(){return this._isDestroyed}},{key:"hasRecord",get:function(){return!!this._record}}]),e}();e.default=T,(0,a.default)("ds-rollback-attribute")&&(T.prototype.lastAcknowledgedValue=function(e){return e in this._inFlightAttributes?this._inFlightAttributes[e]:this._data[e]})}),t("ember-data/-private/system/model/model",["exports","ember","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/relationships/ext"],function(e,t,r,i,n,a,o){function s(e,t,r,i){var n=i||[],a=l(t,"relationships");if(!a)return n;var o=a.get(e.modelName).filter(function(e){var i=t.metaForProperty(e.name).options;return!i.inverse||r===i.inverse});return o&&n.push.apply(n,o),e.superclass&&s(e.superclass,t,r,n),n}e.__esModule=!0;var l=t.default.get,d=t.default.computed,u=t.default.Map,c=d("currentState",function(e){return l(this._internalModel.currentState,e)}).readOnly(),h=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,__defineNonEnumerable:function(e){this[e.name]=e.descriptor.value},isEmpty:c,isLoading:c,isLoaded:c,hasDirtyAttributes:d("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:c,isDeleted:c,isNew:c,isValid:c,dirtyType:c,isError:!1,isReloading:!1,id:null,currentState:a.default.empty,errors:d(function(){var e=i.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:null,didLoad:null,didUpdate:null,didCreate:null,didDelete:null,becameInvalid:null,becameError:null,rolledBack:null,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,n=e.length;i<n;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 l(this,"id")},save:function(e){var t=this;return r.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){var e=this;return r.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){var t=this[e];if("function"==typeof t){for(var r=arguments.length,i=new Array(r-1),n=1;n<r;n++)i[n-1]=arguments[n];t.apply(this,i)}this._super.apply(this,arguments)},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,n){var a=t[n.kind];void 0===a&&(a=t[n.kind]=[],i.push({name:n.name,properties:a,expand:!0})),a.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)},eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return l(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(h.prototype,"data",{get:function(){return this._internalModel._data}}),h.reopenClass({isModel:!0,modelName:null,typeForRelationship:function(e,t){var r=l(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t.default.computed(function(){return Object.create(null)}),inverseFor:function(e,t){var r=l(this,"inverseMap");if(void 0!==r[e])return r[e];var i=l(this,"relationshipsByName").get(e);if(!i)return r[e]=null,null;var n=i.options;return n&&null===n.inverse?(r[e]=null,null):r[e]=this._findInverseFor(e,t)},_findInverseFor:function(e,r){var i=this.typeForRelationship(e,r);if(!i)return null;var n=this.metaForProperty(e),a=n.options;if(null===a.inverse)return null;var o=void 0,l=void 0,d=void 0;if(a.inverse)o=a.inverse,d=t.default.get(i,"relationshipsByName").get(o),l=d.kind;else{n.parentType&&(n.type,n.parentType.modelName);var u=s(this,i,e);if(0===u.length)return null;var c=u.filter(function(t){var r=i.metaForProperty(t.name).options;return e===r.inverse});1===c.length&&(u=c),o=u[0].name,l=u[0].kind}return{type:i,name:o,kind:l}},relationships:o.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:o.relatedTypesDescriptor,relationshipsByName:o.relationshipsByNameDescriptor,fields:t.default.computed(function(){var e=u.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){l(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=l(this,"relatedTypes"),i=0;i<r.length;i++){var n=r[i];e.call(t,n)}},determineRelationshipType:function(e,t){var r=e.key,i=e.kind,n=this.inverseFor(r,t),a=void 0;return n?(a=n.kind,"belongsTo"===a?"belongsTo"===i?"oneToOne":"manyToOne":"belongsTo"===i?"oneToMany":"manyToMany"):"belongsTo"===i?"oneToNone":"manyToNone"},attributes:t.default.computed(function(){var e=u.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=u.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){l(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){l(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}}),t.default.setOwner&&Object.defineProperty(h.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),(0,n.default)("ds-rollback-attribute")&&h.reopen({rollbackAttribute:function(e){e in this._internalModel._attributes&&this.set(e,this._internalModel.lastAcknowledgedValue(e))}}),e.default=h}),t("ember-data/-private/system/model/states",["exports"],function(e){function t(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArrays()}function r(e){var t={},i=void 0;for(var n in e)i=e[n],t[n]=i&&"object"==typeof i?r(i):i;return t}function i(e,t){for(var r in t)e[r]=t[r];return e}function n(e){return i(r(l),e)}function a(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function o(e){}function s(e,t,r){e=i(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var n in e)e.hasOwnProperty(n)&&"parentState"!==n&&"stateName"!==n&&"object"==typeof e[n]&&(e[n]=s(e[n],e,r+"."+n));return e}e.__esModule=!0;var l={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:t,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:t,becomeDirty:function(){},pushedData:function(){},unloadRecord:o,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,r){e.removeErrorMessageFromAttribute(r.name),t(e,r),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)}}},d=n({dirtyType:"created",isNew:!0});d.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},d.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var u=n({dirtyType:"updated"});d.uncommitted.deleteRecord=a,d.invalid.deleteRecord=a,d.uncommitted.rollback=function(e){l.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},d.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},d.uncommitted.propertyWasReset=function(){},u.inFlight.unloadRecord=o,u.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var c={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:function(){},unloadRecord:function(e){},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:t,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){},didCommit:function(){},notFound:function(){}},created:d,updated:u},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:o,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.removeFromInverseRelationships()},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:function(){},didCommit:function(){}},invalid:{isValid:!1,didSetProperty:function(e,r){e.removeErrorMessageFromAttribute(r.name),t(e,r),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=s(c,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.__esModule=!0,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.__esModule=!0,e.default=r}),t("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e.__esModule=!0,e.default=r;var i=t.default.OrderedSet,n=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=n(e),i=this.presenceSet,a=this.list;if(!0!==i[r])return i[r]=!0,void 0===t||null===t?a.push(e):a.splice(t,0,e),this.size+=1,this}}),t("ember-data/-private/system/promise-proxies",["exports","ember"],function(e,t){function r(e,t){return d.create({promise:s.resolve(e,t)})}function i(e,t){return l.create({promise:s.resolve(e,t)})}function n(e){return function(){var t;return(t=o(this,"content"))[e].apply(t,arguments)}}function a(e,t){return u.create({promise:s.resolve(e,t)})}e.__esModule=!0,e.PromiseManyArray=e.PromiseObject=e.PromiseArray=void 0,e.promiseObject=r,e.promiseArray=i,e.proxyToContent=n,e.promiseManyArray=a;var o=t.default.get,s=t.default.RSVP.Promise,l=e.PromiseArray=t.default.ArrayProxy.extend(t.default.PromiseProxyMixin),d=e.PromiseObject=t.default.ObjectProxy.extend(t.default.PromiseProxyMixin),u=e.PromiseManyArray=l.extend({reload:function(){return this.set("promise",this.get("content").reload()),this},createRecord:n("createRecord"),on:n("on"),one:n("one"),trigger:n("trigger"),off:n("off"),has:n("has")})}),t("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays"],function(e,t,r){function i(e){e.destroy()}function n(e){for(var t=e.length,r=[],i=0;i<t;i++)r=r.concat(e[i]);return r}function a(e,t){var r=e.indexOf(t);return-1!==r&&(e.splice(r,1),!0)}e.__esModule=!0;var o=t.default.get,s=t.default.run,l=function(){function e(e){this.store=e.store,this.isDestroying=!1,this.isDestroyed=!1,this._filteredRecordArrays=Object.create(null),this._liveRecordArrays=Object.create(null),this._pending=Object.create(null),this._adapterPopulatedRecordArrays=[]}return e.prototype.recordDidChange=function(e){this.internalModelDidChange(e)},e.prototype.recordWasLoaded=function(e){this.internalModelDidChange(e)},e.prototype.internalModelDidChange=function(e){var t=e.modelName;if(!e._pendingRecordArrayManagerFlush){e._pendingRecordArrayManagerFlush=!0;var r=this._pending;1===(r[t]=r[t]||[]).push(e)&&s.schedule("actions",this,this._flush)}},e.prototype._flush=function(){var e=this._pending;this._pending=Object.create(null);var t=[];for(var r in e){for(var i=e[r],n=0;n<i.length;n++){var a=i[n];a._pendingRecordArrayManagerFlush=!1,a.isHiddenFromRecordArrays()&&t.push(a)}if(this._filteredRecordArrays[r])for(var o=this.filteredRecordArraysFor(r),s=0;s<o.length;s++)this.updateFilterRecordArray(o[s],r,i);this._liveRecordArrays[r]&&this.updateLiveRecordArray(r,i),t.length>0&&this.removeFromAdapterPopulatedRecordArrays(t)}},e.prototype.updateLiveRecordArray=function(e,t){for(var r=this.liveRecordArrayFor(e),i=[],n=[],a=0;a<t.length;a++){var o=t[a],s=o.isHiddenFromRecordArrays(),l=o._recordArrays;s||o.isEmpty()||l.has(r)||(i.push(o),l.add(r)),s&&(n.push(o),l.delete(r))}i.length>0&&r._pushInternalModels(i),n.length>0&&r._removeInternalModels(n)},e.prototype.removeFromAdapterPopulatedRecordArrays=function(e){for(var t=0;t<e.length;t++){for(var r=e[t],i=r._recordArrays.list,n=0;n<i.length;n++)i[n]._removeInternalModels([r]);r._recordArrays.clear()}},e.prototype.updateFilterRecordArray=function(e,t,r){for(var i=o(e,"filterFunction"),n=[],a=[],s=0;s<r.length;s++){var l=r[s];if(!1===l.isHiddenFromRecordArrays()&&i(l.getRecord())){if(l._recordArrays.has(e))continue;n.push(l),l._recordArrays.add(e)}else l._recordArrays.delete(e)&&a.push(l)}n.length>0&&e._pushInternalModels(n),a.length>0&&e._removeInternalModels(a)},e.prototype.syncLiveRecordArray=function(e,t){var r=0===Object.keys(this._pending).length,i=this.store._internalModelsFor(t),n=o(i,"length")===o(e,"length");r&&n||this.populateLiveRecordArray(e,i.models)},e.prototype.populateLiveRecordArray=function(e,t){for(var r=[],i=0;i<t.length;i++){var n=t[i];if(!n.isHiddenFromRecordArrays()){var a=n._recordArrays;a.has(e)||(r.push(n),a.add(e))}}e._pushInternalModels(r)},e.prototype.updateFilter=function(e,t,r){var i=this.store._internalModelsFor(t),n=i.models;this.updateFilterRecordArray(e,r,n)},e.prototype.liveRecordArrayFor=function(e){return this._liveRecordArrays[e]||(this._liveRecordArrays[e]=this.createRecordArray(e))},e.prototype.filteredRecordArraysFor=function(e){return this._filteredRecordArrays[e]||(this._filteredRecordArrays[e]=[])},e.prototype.createRecordArray=function(e){return r.RecordArray.create({modelName:e,content:t.default.A(),store:this.store,isLoaded:!0,manager:this})},e.prototype.createFilteredRecordArray=function(e,i,n){var a=r.FilteredRecordArray.create({query:n,modelName:e,content:t.default.A(),store:this.store,manager:this,filterFunction:i});return this.registerFilteredRecordArray(a,e,i),a},e.prototype.createAdapterPopulatedRecordArray=function(e,i){var n=r.AdapterPopulatedRecordArray.create({modelName:e,query:i,content:t.default.A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(n),n},e.prototype.registerFilteredRecordArray=function(e,t,r){this.filteredRecordArraysFor(t).push(e),this.updateFilter(e,t,r)},e.prototype.unregisterRecordArray=function(e){var t=e.modelName,r=this.filteredRecordArraysFor(t),i=a(r,e),n=a(this._adapterPopulatedRecordArrays,e);if(!i&&!n){var o=this._liveRecordArrays[t];o&&e===o&&delete this._liveRecordArrays[t]}},e.prototype.willDestroy=function(){var e=this;Object.keys(this._filteredRecordArrays).forEach(function(t){return n(e._filteredRecordArrays[t]).forEach(i)}),Object.keys(this._liveRecordArrays).forEach(function(t){return e._liveRecordArrays[t].destroy()}),this._adapterPopulatedRecordArrays.forEach(i),this.isDestroyed=!0},e.prototype.destroy=function(){this.isDestroying=!0,t.default.run.schedule("actions",this,this.willDestroy)},e}();e.default=l}),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.__esModule=!0,e.AdapterPopulatedRecordArray=e.FilteredRecordArray=e.RecordArray=void 0,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){e.__esModule=!0;var n=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=n(this,"store"),t=n(this,"query");return e._query(this.modelName,t,this)},_setInternalModels:function(e,r){this.get("content").setObjects(e),this.setProperties({isLoaded:!0,isUpdating:!1,meta:(0,i.default)(r.meta),links:(0,i.default)(r.links)});for(var n=0,a=e.length;n<a;n++){e[n]._recordArrays.add(this)}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){e.__esModule=!0;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){e.__esModule=!0;var n=t.default.computed,a=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:n("modelName",function(){return this.modelName?this.store._modelFor(this.modelName):null}).readOnly(),objectAtContent:function(e){var t=a(this,"content").objectAt(e);return t&&t.getRecord()},update:function(){var e=this;if(a(this,"isUpdating"))return this._updatingPromise;this.set("isUpdating",!0);var t=this._update().finally(function(){e._updatingPromise=null,e.get("isDestroying")||e.get("isDestroyed")||e.set("isUpdating",!1)});return this._updatingPromise=t,t},_update:function(){return this.store.findAll(this.modelName,{reload:!0})},_pushInternalModels:function(e){a(this,"content").pushObjects(e)},_removeInternalModels:function(e){a(this,"content").removeObjects(e)},save:function(){var e=this,t="DS: RecordArray#save "+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(){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 a(this,"content").map(function(e){return e.createSnapshot()})}})}),t("ember-data/-private/system/references",["exports","ember-data/-private/system/references/record","ember-data/-private/system/references/belongs-to","ember-data/-private/system/references/has-many"],function(e,t,r,i){e.__esModule=!0,e.HasManyReference=e.BelongsToReference=e.RecordReference=void 0,e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=i.default}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/-private/system/model/model","ember","ember-data/-private/system/references/reference","ember-data/-private/features"],function(e,t,r,i,n){e.__esModule=!0;var a=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};a.prototype=Object.create(i.default.prototype),a.prototype.constructor=a,a.prototype._super$constructor=i.default,a.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},a.prototype.id=function(){var e=this.belongsToRelationship.inverseInternalModel;return e&&e.id},a.prototype.link=function(){
3
- return this.belongsToRelationship.link},a.prototype.meta=function(){return this.belongsToRelationship.meta},a.prototype.push=function(e){var i=this;return r.default.RSVP.resolve(e).then(function(e){var r=void 0;return e instanceof t.default?((0,n.default)("ds-overhaul-references"),r=e):r=i.store.push(e),i.belongsToRelationship.setCanonicalInternalModel(r._internalModel),r})},a.prototype.value=function(){var e=this.belongsToRelationship.inverseInternalModel;return e&&e.isLoaded()?e.getRecord():null},a.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},a.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=a}),t("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/features"],function(e,t,r,i){e.__esModule=!0;var n=t.default.RSVP.resolve,a=t.default.get,o=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};o.prototype=Object.create(r.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=r.default,o.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},o.prototype.link=function(){return this.hasManyRelationship.link},o.prototype.ids=function(){return this.hasManyRelationship.members.toArray().map(function(e){return e.id})},o.prototype.meta=function(){return this.hasManyRelationship.meta},o.prototype.push=function(e){var r=this;return n(e).then(function(e){var n=e;(0,i.default)("ds-overhaul-references");var a=!0;"object"==typeof e&&e.data&&(n=e.data,a=n.length&&n[0].data,(0,i.default)("ds-overhaul-references")),(0,i.default)("ds-overhaul-references")||(a=!0);var o=void 0;if(a)o=n.map(function(e){return r.store.push(e)._internalModel});else{var s=r.store.push(e);o=t.default.A(s).mapBy("_internalModel")}return r.hasManyRelationship.computeChanges(o),r.hasManyRelationship.manyArray})},o.prototype._isLoaded=function(){return!!a(this.hasManyRelationship,"hasData")&&this.hasManyRelationship.members.toArray().every(function(e){return!0===e.isLoaded()})},o.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},o.prototype.load=function(){return this._isLoaded()?n(this.hasManyRelationship.manyArray):this.hasManyRelationship.getRecords()},o.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=o}),t("ember-data/-private/system/references/record",["exports","ember","ember-data/-private/system/references/reference"],function(e,t,r){e.__esModule=!0;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(){if(this.internalModel.hasRecord)return this.internalModel.getRecord()},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){e.__esModule=!0;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=void 0;return i=e.type||e.key,"hasMany"===e.kind&&(i=(0,t.singularize)((0,r.default)(i))),i}function n(e){return{key:e.key,kind:e.kind,type:i(e),options:e.options,name:e.name,parentType:e.parentType,isRelationship:!0}}e.__esModule=!0,e.typeForRelationshipMeta=i,e.relationshipFromMeta=n}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/system/normalize-model-name"],function(e,t,r){function i(e,i){var n=void 0,a=void 0;"object"==typeof e?(n=e,a=void 0):(n=i,a=e),"string"==typeof a&&(a=(0,r.default)(a)),n=n||{};var o={type:a,isRelationship:!0,options:n,kind:"belongsTo",name:"Belongs To",key:null};return t.default.computed({get:function(e){return n.hasOwnProperty("serialize"),n.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).setInternalModel(t._internalModel):this._internalModel._relationships.get(e).setInternalModel(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.__esModule=!0,e.default=i}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/system/relationship-meta"],function(e,t,r){e.__esModule=!0,e.relationshipsByNameDescriptor=e.relatedTypesDescriptor=e.relationshipsDescriptor=void 0;var i=t.default.Map,n=t.default.MapWithDefault,a=e.relationshipsDescriptor=t.default.computed(function(){!0===t.default.testing&&!0===a._cacheable&&(a._cacheable=!1);var e=new n({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,i){if(i.isRelationship){i.key=t;e.get((0,r.typeForRelationshipMeta)(i)).push({name:t,kind:i.kind})}}),e}).readOnly(),o=e.relatedTypesDescriptor=t.default.computed(function(){!0===t.default.testing&&!0===o._cacheable&&(o._cacheable=!1);var e=void 0,i=t.default.A();return this.eachComputedProperty(function(t,n){n.isRelationship&&(n.key=t,e=(0,r.typeForRelationshipMeta)(n),i.includes(e)||i.push(e))}),i}).readOnly();e.relationshipsByNameDescriptor=t.default.computed(function(){var e=i.create();return this.eachComputedProperty(function(t,i){if(i.isRelationship){i.key=t;var n=(0,r.relationshipFromMeta)(i);n.type=(0,r.typeForRelationshipMeta)(i),e.set(t,n)}}),e}).readOnly()}),t("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,i){function n(e,i){"object"==typeof e&&(i=e,e=void 0),i=i||{},"string"==typeof e&&(e=(0,r.default)(e));var n={type:e,options:i,isRelationship:!0,kind:"hasMany",name:"Has Many",key:null};return t.default.computed({get:function(e){return this._internalModel._relationships.get(e).getRecords()},set:function(e,t){var r=this._internalModel._relationships.get(e);return r.clear(),r.addInternalModels(t.map(function(e){return a(e,"_internalModel")})),r.getRecords()}}).meta(n)}e.__esModule=!0,e.default=n;var a=t.default.get}),t("ember-data/-private/system/relationships/relationship-payloads-manager",["exports","ember","ember-data/-private/system/relationships/relationship-payloads"],function(e,t,r){e.__esModule=!0;var i=t.default.get,n=function(){function e(e){this._store=e,this._cache=Object.create(null)}return e.prototype.get=function(e,t,r){var n=this._store._modelFor(e),a=i(n,"relationshipsByName"),o=this._getRelationshipPayloads(e,r,n,a,!1);return o&&o.get(e,t,r)},e.prototype.push=function(e,t,r){var n=this;if(r){var a=this._store._modelFor(e),o=i(a,"relationshipsByName");Object.keys(r).forEach(function(i){var s=n._getRelationshipPayloads(e,i,a,o,!0);s&&s.push(e,t,i,r[i])})}},e.prototype.unload=function(e,t){var r=this,n=this._store._modelFor(e),a=i(n,"relationshipsByName");a.forEach(function(i,o){var s=r._getRelationshipPayloads(e,o,n,a,!1);s&&s.unload(e,t,o)})},e.prototype._getRelationshipPayloads=function(e,t,r,i,n){if(i.has(t)){var a=e+":"+t;return!this._cache[a]&&n?this._initializeRelationshipPayloads(e,t,r,i):this._cache[a]}},e.prototype._initializeRelationshipPayloads=function(e,t,n,a){var o=a.get(t),s=n.inverseFor(t,this._store),l=void 0,d=void 0,u=void 0;s?(d=s.name,l=o.type,u=i(s.type,"relationshipsByName").get(d)):(l=d="",u=null);var c=e+":"+t,h=l+":"+d;return this._cache[c]=this._cache[h]=new r.default(this._store,e,t,o,l,d,u)},e}();e.default=n}),t("ember-data/-private/system/relationships/relationship-payloads",["exports"],function(e){e.__esModule=!0;var t=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}}(),r=function(){function e(e,t,r,i,n,a,o){this._store=e,this._lhsModelName=t,this._lhsRelationshipName=r,this._lhsRelationshipMeta=i,this._rhsModelName=n,this._rhsRelationshipName=a,this._rhsRelationshipMeta=o,this._lhsPayloads=Object.create(null),t!==n||r!==a?(this._rhsPayloads=Object.create(null),this._isReflexive=!1):(this._rhsPayloads=this._lhsPayloads,this._isReflexive=!0),this._pendingPayloads=[]}return e.prototype.get=function(e,t,r){return this._flushPending(),this._isLHS(e,r)?this._lhsPayloads[t]:this._rhsPayloads[t]},e.prototype.push=function(e,t,r,i){this._pendingPayloads.push([e,t,r,i])},e.prototype.unload=function(e,t,r){this._flushPending(),this._isLHS(e,r)?delete this._lhsPayloads[t]:delete this._rhsPayloads[t]},e.prototype._isLHS=function(e,t){return e===this._lhsModelName&&t===this._lhsRelationshipName},e.prototype._isRHS=function(e,t){return e===this._rhsModelName&&t===this._rhsRelationshipName},e.prototype._flushPending=function(){if(0!==this._pendingPayloads.length)for(var e=this._pendingPayloads.splice(0,this._pendingPayloads.length),t=0;t<e.length;++t){var r=e[t][0],i=e[t][1],n=e[t][2],a=e[t][3],o={data:{id:i,type:r}},s=void 0,l=void 0,d=void 0,u=void 0;this._isLHS(r,n)?(s=this._lhsPayloads[i],l=this._lhsPayloads,d=this._rhsPayloads,u=this._rhsRelationshipIsMany):(s=this._rhsPayloads[i],l=this._rhsPayloads,d=this._lhsPayloads,u=this._lhsRelationshipIsMany),void 0!==a.data&&this._removeInverse(i,s,d),l[i]=a,this._populateInverse(a,o,d,u)}},e.prototype._populateInverse=function(e,t,r,i){if(e.data)if(Array.isArray(e.data))for(var n=0;n<e.data.length;++n){var a=e.data[n].id;this._addToInverse(t,a,r,i)}else{var o=e.data.id;this._addToInverse(t,o,r,i)}},e.prototype._addToInverse=function(e,t,r,i){if(!this._isReflexive||e.data.id!==t){var n=r[t],a=n&&n.data;a?Array.isArray(a)?a.push(e.data):r[t]=e:r[t]=i?{data:[e.data]}:e}},e.prototype._removeInverse=function(e,t,r){var i=t&&t.data;if(i)if(Array.isArray(i))for(var n=0;n<i.length;++n)this._removeFromInverse(e,i[n].id,r);else this._removeFromInverse(e,i.id,r)},e.prototype._removeFromInverse=function(e,t,r){var i=r[t],n=i&&i.data;n&&(Array.isArray(n)?i.data=n.filter(function(t){return t.id!==e}):r[t]={data:null})},t(e,[{key:"_lhsRelationshipIsMany",get:function(){return this._lhsRelationshipMeta&&"hasMany"===this._lhsRelationshipMeta.kind}},{key:"_rhsRelationshipIsMany",get:function(){return this._rhsRelationshipMeta&&"hasMany"===this._rhsRelationshipMeta.kind}}]),e}();e.default=r}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i){function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(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)}e.__esModule=!0;var o=function(e){function i(t,r,i,a){var o=n(this,e.call(this,t,r,i,a));return o.internalModel=r,o.key=a.key,o.inverseInternalModel=null,o.canonicalState=null,o}return a(i,e),i.prototype.setInternalModel=function(e){e?this.addInternalModel(e):this.inverseInternalModel&&this.removeInternalModel(this.inverseInternalModel),this.setHasData(!0),this.setHasLoaded(!0)},i.prototype.setCanonicalInternalModel=function(e){e?this.addCanonicalInternalModel(e):this.canonicalState&&this.removeCanonicalInternalModel(this.canonicalState),this.flushCanonicalLater()},i.prototype.setInitialCanonicalInternalModel=function(e){e&&(this.canonicalMembers.add(e),this.members.add(e),this.inverseInternalModel=this.canonicalState=e,this.setupInverseRelationship(e))},i.prototype.addCanonicalInternalModel=function(t){this.canonicalMembers.has(t)||(this.canonicalState&&this.removeCanonicalInternalModel(this.canonicalState),this.canonicalState=t,e.prototype.addCanonicalInternalModel.call(this,t))},i.prototype.inverseDidDematerialize=function(){this.notifyBelongsToChanged()},i.prototype.removeCompletelyFromOwn=function(t){e.prototype.removeCompletelyFromOwn.call(this,t),this.canonicalState===t&&(this.canonicalState=null),this.inverseInternalModel===t&&(this.inverseInternalModel=null,this.notifyBelongsToChanged())},i.prototype.flushCanonical=function(){this.inverseInternalModel&&this.inverseInternalModel.isNew()&&!this.canonicalState||(this.inverseInternalModel!==this.canonicalState&&(this.inverseInternalModel=this.canonicalState,this.notifyBelongsToChanged()),e.prototype.flushCanonical.call(this))},i.prototype.addInternalModel=function(t){this.members.has(t)||(this.inverseInternalModel&&this.removeInternalModel(this.inverseInternalModel),this.inverseInternalModel=t,e.prototype.addInternalModel.call(this,t),this.notifyBelongsToChanged())},i.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setInternalModel(t?t._internalModel:t)},i.prototype.removeInternalModelFromOwn=function(t){this.members.has(t)&&(this.inverseInternalModel=null,e.prototype.removeInternalModelFromOwn.call(this,t),this.notifyBelongsToChanged())},i.prototype.notifyBelongsToChanged=function(){this.internalModel.notifyBelongsToChanged(this.key)},i.prototype.removeCanonicalInternalModelFromOwn=function(t){this.canonicalMembers.has(t)&&(this.canonicalState=null,e.prototype.removeCanonicalInternalModelFromOwn.call(this,t))},i.prototype.findRecord=function(){return this.inverseInternalModel?this.store._findByInternalModel(this.inverseInternalModel):t.default.RSVP.Promise.resolve(null)},i.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t&&e.addInternalModel(t),t})},i.prototype.getRecord=function(){var e=this;if(this.isAsync){var t=void 0;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),r.PromiseObject.create({promise:t,content:this.inverseInternalModel?this.inverseInternalModel.getRecord():null})}return null===this.inverseInternalModel?null:this.inverseInternalModel.getRecord()},i.prototype.reload=function(){return this.link?this.fetchLink():this.inverseInternalModel&&this.inverseInternalModel.hasRecord?this.inverseInternalModel.getRecord().reload():this.findRecord()},i.prototype.updateData=function(e,t){var r=this.store._pushResourceIdentifier(this,e);t?this.setInitialCanonicalInternalModel(r):this.setCanonicalInternalModel(r)},i}(i.default);e.default=o}),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"],function(e,t,r,i){function n(e){var t=e.options;return!(t&&null===t.inverse)}function a(e,t,a){var o=void 0,s=null;return n(t)&&(s=e.type.inverseFor(t.key,a)),s&&(o=s.name),"hasMany"===t.kind?new r.default(a,e,o,t):new i.default(a,e,o,t)}e.__esModule=!0;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=t.default.get,l=function(){function e(e){this.internalModel=e,this.initializedRelationships=Object.create(null)}return e.prototype.has=function(e){return!!this.initializedRelationships[e]},e.prototype.forEach=function(e){var t=this.initializedRelationships;Object.keys(t).forEach(function(r){e(r,t[r])})},e.prototype.get=function(e){var t=this.initializedRelationships,r=t[e],i=this.internalModel;if(!r){var n=s(i.type,"relationshipsByName"),o=n.get(e);if(!o)return;var l=i.store._relationshipsPayloads.get(i.modelName,i.id,e);r=t[e]=a(i,o,i.store),l&&r.push(l,!0)}return r},o(e,[{key:"record",get:function(){return this.internalModel}}]),e}();e.default=l}),t("ember-data/-private/system/relationships/state/has-many",["exports","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,n){function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 i.default;if(e)for(var r=0,n=e.length;r<n;r++)t.add(e[r]);return t}e.__esModule=!0;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){function r(t,r,i,n){var o=a(this,e.call(this,t,r,i,n));return o.belongsToType=n.type,o.canonicalState=[],o.isPolymorphic=n.options.polymorphic,o._manyArray=null,o.__loadingPromise=null,o}return o(r,e),r.prototype._updateLoadingPromise=function(e,r){return this.__loadingPromise?(r&&this.__loadingPromise.set("content",r),this.__loadingPromise.set("promise",e)):this.__loadingPromise=new t.PromiseManyArray({promise:e,content:r}),this.__loadingPromise},r.prototype.removeInverseRelationships=function(){e.prototype.removeInverseRelationships.call(this),this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this._loadingPromise&&this._loadingPromise.destroy()},r.prototype.updateMeta=function(t){e.prototype.updateMeta.call(this,t),this._manyArray&&this._manyArray.set("meta",t)},r.prototype.addCanonicalInternalModel=function(t,r){this.canonicalMembers.has(t)||(void 0!==r?this.canonicalState.splice(r,0,t):this.canonicalState.push(t),e.prototype.addCanonicalInternalModel.call(this,t,r))},r.prototype.inverseDidDematerialize=function(){this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this.notifyHasManyChanged()},r.prototype.addInternalModel=function(t,r){this.members.has(t)||(e.prototype.addInternalModel.call(this,t,r),this.manyArray._addInternalModels([t],r))},r.prototype.removeCanonicalInternalModelFromOwn=function(t,r){var i=r;this.canonicalMembers.has(t)&&(void 0===i&&(i=this.canonicalState.indexOf(t)),i>-1&&this.canonicalState.splice(i,1),e.prototype.removeCanonicalInternalModelFromOwn.call(this,t,r))},r.prototype.removeCompletelyFromOwn=function(t){e.prototype.removeCompletelyFromOwn.call(this,t);var r=this.canonicalState.indexOf(t);-1!==r&&this.canonicalState.splice(r,1);var i=this._manyArray;if(i){var n=i.currentState.indexOf(t);-1!==n&&i.internalReplace(n,1)}},r.prototype.flushCanonical=function(){this._manyArray&&this._manyArray.flushCanonical(),e.prototype.flushCanonical.call(this)},r.prototype.removeInternalModelFromOwn=function(t,r){if(this.members.has(t)){e.prototype.removeInternalModelFromOwn.call(this,t,r);var i=this.manyArray;void 0!==r?i.currentState.removeAt(r):i._removeInternalModels([t])}},r.prototype.notifyRecordRelationshipAdded=function(e,t){this.internalModel.notifyHasManyAdded(this.key,e,t)},r.prototype.reload=function(){var e=this.manyArray,t=e.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&e.set("isLoaded",t)}var r=void 0;return r=this.link?this.fetchLink():this.store._scheduleFetchMany(e.currentState).then(function(){return e}),this._updateLoadingPromise(r),this._loadingPromise},r.prototype.computeChanges=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.canonicalMembers,r=[],i=s(e);t.forEach(function(e){i.has(e)||r.push(e)}),this.removeCanonicalInternalModels(r);for(var n=0,a=e.length;n<a;n++){var o=e[n];this.removeCanonicalInternalModel(o),this.addCanonicalInternalModel(o,n)}},r.prototype.setInitialInternalModels=function(e){if(!1!==Array.isArray(e)&&0!==e.length){for(var t=0;t<e.length;t++){var r=e[t];this.canonicalMembers.has(r)||(this.canonicalMembers.add(r),this.members.add(r),this.setupInverseRelationship(r))}this.canonicalState=this.canonicalMembers.toArray()}},r.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateInternalModelsFromAdapter(t),e.manyArray.set("isLoaded",!0)}),e.manyArray})},r.prototype.findRecords=function(){var e=this.manyArray,t=e.currentState;return this.store.findMany(t).then(function(){return e.get("isDestroyed")||e.set("isLoaded",!0),e})},r.prototype.notifyHasManyChanged=function(){this.internalModel.notifyHasManyAdded(this.key)},r.prototype.getRecords=function(){var e=this,t=this.manyArray;if(this.isAsync){var r=void 0;return r=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._updateLoadingPromise(r,t)}return t.get("isDestroyed")||t.set("isLoaded",!0),t},r.prototype.updateData=function(e,t){var r=this.store._pushResourceIdentifiers(this,e);t?this.setInitialInternalModels(r):this.updateInternalModelsFromAdapter(r)},r.prototype.destroy=function(){e.prototype.destroy.call(this);var t=this._manyArray;t&&t.destroy();var r=this.__loadingPromise;r&&r.destroy()},l(r,[{key:"_loadingPromise",get:function(){return this.__loadingPromise}},{key:"manyArray",get: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.internalModel,meta:this.meta,isPolymorphic:this.isPolymorphic})),this._manyArray}}]),r}(r.default);e.default=d}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember-data/-private/system/ordered-set","ember-data/-private/system/normalize-link","ember"],function(e,t,r,i){e.__esModule=!0;var n=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=i.default.guidFor,o=function(){function e(e,r,i,n){var a=n.options.async,o=n.options.polymorphic;this.members=new t.default,this.canonicalMembers=new t.default,this.store=e,this.key=n.key,this.inverseKey=i,this.internalModel=r,this.isAsync=void 0===a||a,this.isPolymorphic=void 0===o||o,this.relationshipMeta=n,this.inverseKeyForImplicit=this.internalModel.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}return e.prototype._inverseIsAsync=function(){return!(!this.inverseKey||!this.inverseInternalModel)&&this.inverseInternalModel._relationships.get(this.inverseKey).isAsync},e.prototype.removeInverseRelationships=function(){if(this.inverseKey)for(var e=this.members.list.concat(this.canonicalMembers.list),t=0;t<e.length;t++){var r=e[t],i=r._relationships.get(this.inverseKey);i.inverseDidDematerialize()}},e.prototype.inverseDidDematerialize=function(){},e.prototype.updateMeta=function(e){this.meta=e},e.prototype.clear=function(){for(var e=this.members.list;e.length>0;){var t=e[0];this.removeInternalModel(t)}for(var r=this.canonicalMembers.list;r.length>0;){var i=r[0];this.removeCanonicalInternalModel(i)}},e.prototype.removeInternalModels=function(e){var t=this;e.forEach(function(e){return t.removeInternalModel(e)})},e.prototype.addInternalModels=function(e,t){var r=this;e.forEach(function(e){r.addInternalModel(e,t),void 0!==t&&t++})},e.prototype.addCanonicalInternalModels=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalInternalModel(e[r],r+t):this.addCanonicalInternalModel(e[r])},e.prototype.addCanonicalInternalModel=function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.setupInverseRelationship(e)),this.flushCanonicalLater(),this.setHasData(!0)},e.prototype.setupInverseRelationship=function(t){if(this.inverseKey){var r=t._relationships,i=r.has(this.inverseKey),n=r.get(this.inverseKey);(i||this.isPolymorphic)&&n.addCanonicalInternalModel(this.internalModel)}else{var a=t._implicitRelationships,o=a[this.inverseKeyForImplicit];o||(o=a[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{async:this.isAsync}})),o.addCanonicalInternalModel(this.internalModel)}},e.prototype.removeCanonicalInternalModels=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalInternalModel(e[r],r+t):this.removeCanonicalInternalModel(e[r])},e.prototype.removeCanonicalInternalModel=function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalInternalModelFromOwn(e),this.inverseKey?this.removeCanonicalInternalModelFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalInternalModel(this.internalModel)),this.flushCanonicalLater()},e.prototype.addInternalModel=function(t,r){this.members.has(t)||(this.members.addWithIndex(t,r),this.notifyRecordRelationshipAdded(t,r),this.inverseKey?t._relationships.get(this.inverseKey).addInternalModel(this.internalModel):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{async:this.isAsync}})),t._implicitRelationships[this.inverseKeyForImplicit].addInternalModel(this.internalModel)),this.internalModel.updateRecordArrays()),this.setHasData(!0)},e.prototype.removeInternalModel=function(e){this.members.has(e)&&(this.removeInternalModelFromOwn(e),this.inverseKey?this.removeInternalModelFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeInternalModel(this.internalModel))},e.prototype.removeInternalModelFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeInternalModelFromOwn(this.internalModel)},e.prototype.removeInternalModelFromOwn=function(e){this.members.delete(e),this.internalModel.updateRecordArrays()},e.prototype.removeCanonicalInternalModelFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalInternalModelFromOwn(this.internalModel)},e.prototype.removeCanonicalInternalModelFromOwn=function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},e.prototype.removeCompletelyFromInverse=function(){var e=this;if(this.inverseKey){var t=Object.create(null),r=this.internalModel,i=function(i){var n=a(i);if(void 0===t[n]){i._relationships.get(e.inverseKey).removeCompletelyFromOwn(r),t[n]=!0}};this.members.forEach(i),this.canonicalMembers.forEach(i)}},e.prototype.removeCompletelyFromOwn=function(e){this.canonicalMembers.delete(e),this.members.delete(e),this.internalModel.updateRecordArrays()},e.prototype.flushCanonical=function(){var e=this.members.list;this.willSync=!1;for(var t=[],r=0;r<e.length;r++)e[r].isNew()&&t.push(e[r]);this.members=this.canonicalMembers.copy();for(var i=0;i<t.length;i++)this.members.add(t[i])},e.prototype.flushCanonicalLater=function(){this.willSync||(this.willSync=!0,this.store._updateRelationshipState(this))},e.prototype.updateLink=function(e,t){this.link=e,this.linkPromise=null,t||this.internalModel.notifyPropertyChange(this.key)},e.prototype.findLink=function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},e.prototype.updateInternalModelsFromAdapter=function(e){this.computeChanges(e)},e.prototype.notifyRecordRelationshipAdded=function(){},e.prototype.setHasData=function(e){this.hasData=e},e.prototype.setHasLoaded=function(e){this.hasLoaded=e},e.prototype.push=function(e,t){var i=!1,n=!1;if(e.meta&&this.updateMeta(e.meta),void 0!==e.data&&(i=!0,this.updateData(e.data,t)),e.links&&e.links.related){var a=(0,r.default)(e.links.related);a&&a.href&&a.href!==this.link&&(n=!0,this.updateLink(a.href,t))}i?(this.setHasData(!0),this.setHasLoaded(!0)):n&&this.setHasLoaded(!1)},e.prototype.updateData=function(){},e.prototype.destroy=function(){},n(e,[{key:"parentType",get:function(){return this.internalModel.modelName}}]),e}();e.default=o}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){e.__esModule=!0;var t=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}}(),r=function(){function e(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=null,this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}return e.prototype.snapshots=function(){return null!==this._snapshots?this._snapshots:(this._snapshots=this._recordArray._takeSnapshot(),this._snapshots)},t(e,[{key:"type",get:function(){return this._type||(this._type=this._recordArray.get("type"))}}]),e}();e.default=r}),t("ember-data/-private/system/snapshot",["exports","ember"],function(e,t){e.__esModule=!0;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=t.default.get,n=function(){function e(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._attributes=Object.create(null),this._belongsToRelationships=Object.create(null),this._belongsToIds=Object.create(null),this._hasManyRelationships=Object.create(null),this._hasManyIds=Object.create(null),this._internalModel=e;var n=e.getRecord();this.record=n,n.eachAttribute(function(e){return t._attributes[e]=i(n,e)}),this.id=e.id,this.adapterOptions=r.adapterOptions,this.include=r.include,this.modelName=e.modelName,this._changedAttributes=n.changedAttributes()}return e.prototype.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.")},e.prototype.attributes=function(){return t.default.copy(this._attributes)},e.prototype.changedAttributes=function(){for(var e=Object.create(null),r=Object.keys(this._changedAttributes),i=0,n=r.length;i<n;i++){var a=r[i];e[a]=t.default.copy(this._changedAttributes[a])}return e},e.prototype.belongsTo=function(e,r){var n=r&&r.id,a=void 0,o=void 0,s=void 0,l=void 0;if(n&&e in this._belongsToIds)return this._belongsToIds[e];if(!n&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(!(a=this._internalModel._relationships.get(e))||"belongsTo"!==a.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return s=i(a,"hasData"),o=i(a,"inverseInternalModel"),s&&(l=o&&!o.isDeleted()?n?i(o,"id"):o.createSnapshot():null),
4
- n?this._belongsToIds[e]=l:this._belongsToRelationships[e]=l,l},e.prototype.hasMany=function(e,r){var n=r&&r.ids,a=void 0,o=void 0,s=void 0,l=void 0;if(n&&e in this._hasManyIds)return this._hasManyIds[e];if(!n&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(!(a=this._internalModel._relationships.get(e))||"hasMany"!==a.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return s=i(a,"hasData"),o=i(a,"members"),s&&(l=[],o.forEach(function(e){e.isDeleted()||(n?l.push(e.id):l.push(e.createSnapshot()))})),n?this._hasManyIds[e]=l:this._hasManyRelationships[e]=l,l},e.prototype.eachAttribute=function(e,t){this.record.eachAttribute(e,t)},e.prototype.eachRelationship=function(e,t){this.record.eachRelationship(e,t)},e.prototype.serialize=function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)},r(e,[{key:"type",get:function(){return this._internalModel.modelClass}}]),e}();e.default=n}),t("ember-data/-private/system/store",["exports","ember","ember-data/-private/adapters/errors","ember-data/-private/system/model/model","ember-data/-private/system/normalize-model-name","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/relationships/relationship-payloads-manager","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/features"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,y,m,v){function b(e,t){var r=e.then(function(e){return e.getRecord()});return(0,o.promiseObject)(r,t)}function _(e){return e.serializerFor("application")}function g(e,t,i,n){var a=n._internalModel,o=n.modelName,u=t._modelFor(o),c=e[i](t,u,n),h=(0,d.serializerForAdapter)(t,e,o),p="DS: Extract and notify about "+i+" completion of "+a;return c=N.resolve(c,p),c=(0,s._guard)(c,(0,s._bind)(s._objectIsAlive,t)),c=(0,s._guard)(c,(0,s._bind)(s._objectIsAlive,a)),c.then(function(e){return t._backburner.join(function(){var r=void 0,o=void 0;e&&(r=(0,l.normalizeResponseHelper)(h,t,u,e,n.id,i),r.included&&t._push({data:null,included:r.included}),o=r.data),t.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof r.InvalidError){var i=h.extractErrors(t,u,e,n.id);t.recordWasInvalid(a,i)}else t.recordWasError(a,e);throw e},p)}function R(e,t,r,i,n){var a=r.relationships[i].data;if(!a)return!1;var o=n[t.modelName];o||(o=n[t.modelName]=P(t.type,"inverseMap"));var s=o[i];if(void 0===s&&(s=t.type.inverseFor(i,e)),!s)return!1;var l=s,d=l.name;if(Array.isArray(a)){for(var u=0;u<a.length;++u){var c=e._internalModelsFor(a[u].type).get(a[u].id);if(c&&c._relationships.has(d))return!0}return!1}var h=e._internalModelsFor(a.type).get(a.id);return h&&h._relationships.has(d)}function M(e,t,r,i){var n=t._relationships;t.type.eachRelationship(function(a){if(r.relationships[a]){if(n.has(a)||R(e,t,r,a,i)){var o=r.relationships[a];n.get(a).push(o,!1)}}})}e.__esModule=!0,e.Store=void 0;var A=t.default.A,F=t.default._Backburner,z=t.default.computed,I=t.default.copy,S=t.default.ENV,k=t.default.Error,P=t.default.get,x=(t.default.inspect,t.default.isNone),T=(t.default.isPresent,t.default.MapWithDefault),E=t.default.run,j=t.default.set,O=t.default.RSVP,D=t.default.Service,N=(t.default.typeOf,O.Promise),C=void 0;e.Store=C=D.extend({init:function(){this._super.apply(this,arguments),this._backburner=new F(["normalizeRelationships","syncRelationships","finished"]),this.recordArrayManager=new f.default({store:this}),this._identityMap=new a.default,this._pendingSave=[],this._instanceCache=new y.default((0,h.getOwner)(this),this),this._modelFactoryCache=Object.create(null),this._relationshipsPayloads=new u.default(this),this._pendingSave=[],this._updatedRelationships=[],this._pushedInternalModels=[],this._updatedInternalModels=[],this._pendingFetch=T.create({defaultValue:function(){return[]}}),this._instanceCache=new y.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=P(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=(0,n.default)(e),i=I(t)||Object.create(null);x(i.id)&&(i.id=this._generateId(r,i)),i.id=(0,p.default)(i.id);var a=this._buildInternalModel(r,i.id);a.loadedData();var o=a.getRecord(i);return a.eachRelationship(function(e,t){void 0!==i[e]&&a._relationships.get(e).setHasData(!0)}),o},_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=(0,n.default)(e);return this.findRecord(i,t)},findRecord:function(e,t,r){var i=(0,n.default)(e),a=this._internalModelForId(i,t);return r=r||{},this.hasRecordForId(i,t)?b(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=this.adapterFor(e.modelName);return i.shouldReloadRecord(this,r)?this._scheduleFetch(e,t):!1===t.backgroundReload?N.resolve(e):((t.backgroundReload||i.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),N.resolve(e))},_findByInternalModel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.preload&&e.preloadData(t.preload),b(this._findEmptyInternalModel(e,t),"DS: Store#findRecord "+e.modelName+" with id: "+e.id)},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this._scheduleFetch(e,t):e.isLoading()?e._loadingPromise:N.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),i=(0,n.default)(e),a=0;a<t.length;a++)r[a]=this.findRecord(i,t[a]);return(0,o.promiseArray)(O.all(r).then(A,null,"DS: Store#findByIds of "+i+" complete"))},_fetchRecord:function(e,t){var r=e.modelName,i=this.adapterFor(r);return(0,c._find)(i,this,e.type,e.id,e,t)},_scheduleFetchMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._scheduleFetch(e[r]);return N.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.id,i=e.modelName,n=O.defer("Fetching "+i+"' with id: "+r),a={internalModel:e,resolver:n,options:t},o=n.promise;return e.loadingData(o),0===this._pendingFetch.size&&E.schedule("afterRender",this,this.flushAllPendingFetches),this._pendingFetch.get(i).push(a),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch.clear())},_flushPendingFetchForType:function(e,t){function r(e){var t=a._fetchRecord(e.internalModel,e.options);e.resolver.resolve(t)}function i(e,t){for(var r=Object.create(null),i=0,a=e.length;i<a;i++){var o=e[i],s=u[o.id];if(r[o.id]=o,s){s.resolver.resolve(o)}}for(var l=[],d=0,c=t.length;d<c;d++){var h=t[d];r[h.id]||l.push(h)}l.length&&n(l)}function n(e,t){for(var r=0,i=e.length;r<i;r++){var n=e[r],a=u[n.id];a&&a.resolver.reject(t||new Error("Expected: '"+n+"' to be present in the adapter provided payload, but it was not found."))}}for(var a=this,o=a.adapterFor(t),s=!!o.findMany&&o.coalesceFindRequests,l=e.length,d=new Array(l),u=Object.create(null),h=0;h<l;h++){var p=e[h],f=p.internalModel;d[h]=f,u[f.id]=p}if(s){for(var y=new Array(l),m=0;m<l;m++)y[m]=d[m].createSnapshot();for(var v=o.groupRecordsForFindMany(this,y),b=0,_=v.length;b<_;b++){for(var g=v[b],R=v[b].length,M=new Array(R),A=new Array(R),F=0;F<R;F++){var z=g[F]._internalModel;A[F]=z,M[F]=z.id}if(R>1)!function(e){(0,c._findMany)(o,a,t,M,e).then(function(t){i(t,e)}).catch(function(t){n(e,t)})}(A);else if(1===M.length){var I=u[A[0].id];r(I)}}}else for(var S=0;S<l;S++)r(e[S])},getReference:function(e,t){var r=(0,n.default)(e);return this._internalModelForId(r,t).recordReference},peekRecord:function(e,t){var r=(0,n.default)(e);return this.hasRecordForId(r,t)?this._internalModelForId(r,t).getRecord():null},_reloadRecord:function(e){var t=(e.id,e.modelName);this.adapterFor(t);return this._scheduleFetch(e)},hasRecordForId:function(e,t){var r=(0,n.default)(e),i=(0,p.default)(t),a=this._internalModelsFor(r).get(i);return!!a&&a.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=(0,p.default)(t),i=this._internalModelsFor(e).get(r);return i?i.hasScheduledDestroy()?(i.destroySync(),this._buildInternalModel(e,r)):i:this._buildInternalModel(e,r)},_internalModelDidReceiveRelationshipData:function(e,t,r){this._relationshipsPayloads.push(e,t,r)},_internalModelDestroyed:function(e){this._removeFromIdMap(e),this._relationshipsPayloads.unload(e.modelName,e.id)},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findEmptyInternalModel(e[r]);return N.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,c._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,c._findBelongsTo)(i,this,e,t,r)},query:function(e,t){var r=(0,n.default)(e);return this._query(r,t)},_query:function(e,t,r){r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(e,t);var i=this.adapterFor(e);return(0,o.promiseArray)((0,c._query)(i,this,e,t,r))},queryRecord:function(e,t){var r=(0,n.default)(e),i=this.adapterFor(r);return(0,o.promiseObject)((0,c._queryRecord)(i,this,e,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=(0,n.default)(e);return this._fetchAll(r,this.peekAll(r),t)},_fetchAll:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.adapterFor(e),n=this._internalModelsFor(e).metadata.since;if(r.reload)return j(t,"isUpdating",!0),(0,o.promiseArray)((0,c._findAll)(i,this,e,n,r));var a=t._createSnapshot(r);return i.shouldReloadAll(this,a)?(j(t,"isUpdating",!0),(0,o.promiseArray)((0,c._findAll)(i,this,e,n,r))):!1===r.backgroundReload?(0,o.promiseArray)(N.resolve(t)):((r.backgroundReload||i.shouldBackgroundReloadAll(this,a))&&(j(t,"isUpdating",!0),(0,c._findAll)(i,this,e,n,r)),(0,o.promiseArray)(N.resolve(t)))},_didUpdateAll:function(e){var t=this.recordArrayManager.liveRecordArrayFor(e);j(t,"isUpdating",!1)},didUpdateAll:function(e){return this._didUpdateAll(e)},peekAll:function(e){var t=(0,n.default)(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=(0,n.default)(e);this._internalModelsFor(t).clear()}},filter:function(e,t,r){S.ENABLE_DS_FILTER;var i=void 0,a=arguments.length,s=void 0,l=3===a,d=(0,n.default)(e);return l?i=this.query(d,t):2===arguments.length&&(r=t),s=l?this.recordArrayManager.createFilteredRecordArray(d,r,t):this.recordArrayManager.createFilteredRecordArray(d,r),i=i||N.resolve(s),(0,o.promiseArray)(i.then(function(){return s},null,"DS: Store#filter of "+d))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},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],n=i.snapshot,a=i.resolver,o=n._internalModel,s=this.adapterFor(o.modelName),l=void 0;"root.deleted.saved"!==o.currentState.stateName?(l=o.isNew()?"createRecord":o.isDeleted()?"deleteRecord":"updateRecord",a.resolve(g(s,this,l,n))):a.resolve()}},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=e.modelName,n=(0,p.default)(t.id);if(null===r||null!==n){this._existingInternalModelForId(i,n);this._internalModelsFor(e.modelName).set(n,e),e.setId(n)}},_internalModelsFor: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,h.getOwner)(this),r=void 0;if(t.factoryFor){var n=t.factoryFor("mixin:"+e);r=n&&n.class}else r=t._lookupFactory("mixin:"+e);if(r){var a=i.default.extend(r);a.reopenClass({__isMixin:!0,__mixin:r}),t.register("model:"+e,a)}return this.modelFactoryFor(e)},modelFor:function(e){var t=(0,n.default)(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._modelFactoryCache[e];if(!t){if(t=this.modelFactoryFor(e),t||(t=this._modelForMixin(e)),!t)throw new k("No model was found for '"+e+"'");var r=(0,h.getOwner)(this).factoryFor?t.class:t;r.modelName=r.modelName||e,this._modelFactoryCache[e]=t}return t},modelFactoryFor:function(e){var t=(0,n.default)(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,n=void 0;if(r)for(i=0,n=r.length;i<n;i++)t._pushInternalModel(r[i]);if(Array.isArray(e.data)){n=e.data.length;var a=new Array(n);for(i=0;i<n;i++)a[i]=t._pushInternalModel(e.data[i]);return a}return null===e.data?null:t._pushInternalModel(e.data)})},_hasModelFor:function(e){var t=(0,h.getOwner)(this);return e=(0,n.default)(e),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){void 0!==t.relationships&&2===this._pushedInternalModels.push(e,t)&&this._backburner.schedule("normalizeRelationships",this,this._setupRelationships)},_setupRelationships:function(){for(var e=this._pushedInternalModels,t=Object.create(null),r=0,i=e.length;r<i;r+=2){M(this,e[r],e[r+1],t)}e.length=0},pushPayload:function(e,t){var r=void 0,i=void 0;if(t){i=t;var a=(0,n.default)(e);r=this.serializerFor(a)}else i=e,r=_(this);if((0,v.default)("ds-pushpayload-return"))return r.pushPayload(this,i);r.pushPayload(this,i)},normalize:function(e,t){var r=(0,n.default)(e),i=this.serializerFor(r),a=this._modelFor(r);return i.normalize(a,t)},_buildInternalModel:function(e,t,r){var i=(this._existingInternalModelForId(e,t),new m.default(e,t,this,r));return this._internalModelsFor(e).add(i,t),i},_existingInternalModelForId:function(e,t){var r=this._internalModelsFor(e).get(t);return r&&r.hasScheduledDestroy()&&(r.destroySync(),r=null),r},buildInternalModel:function(e,t,r){return this._buildInternalModel(e,t,r)},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_removeFromIdMap:function(e){var t=this._internalModelsFor(e.modelName),r=e.id;t.remove(e,r)},adapterFor:function(e){var t=(0,n.default)(e);return this._instanceCache.get("adapter",t)},serializerFor:function(e){var t=(0,n.default)(e);return this._instanceCache.get("serializer",t)},lookupAdapter:function(e){return this.adapterFor(e)},lookupSerializer:function(e){return this.serializerFor(e)},willDestroy:function(){this._super.apply(this,arguments),this._pushedInternalModels=null,this.recordArrayManager.destroy(),this._instanceCache.destroy(),this.unloadAll()},_updateRelationshipState:function(e){var t=this;1===this._updatedRelationships.push(e)&&this._backburner.join(function(){t._backburner.schedule("syncRelationships",t,t._flushUpdatedRelationships)})},_flushUpdatedRelationships:function(){for(var e=this._updatedRelationships,t=0,r=e.length;t<r;t++)e[t].flushCanonical();e.length=0},_updateInternalModel:function(e){1===this._updatedInternalModels.push(e)&&E.schedule("actions",this,this._flushUpdatedInternalModels)},_flushUpdatedInternalModels:function(){for(var e=this._updatedInternalModels,t=0,r=e.length;t<r;t++)e[t]._triggerDeferredTriggers();e.length=0},_pushResourceIdentifier:function(e,t){if(!x(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!x(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=C,e.default=C}),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 n(e){return!(a(e,"isDestroyed")||a(e,"isDestroying"))}e.__esModule=!0,e._bind=r,e._guard=i,e._objectIsAlive=n;var a=t.default.get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember"],function(e,t){e.__esModule=!0;var r=t.default.set,i=function(){function e(e,t){this.isDestroying=!1,this.isDestroyed=!1,this._owner=e,this._store=t,this._namespaces={adapter:Object.create(null),serializer:Object.create(null)}}return e.prototype.get=function(e,t){var i=this._namespaces[e];if(i[t])return i[t];var n=e+":"+t,a=this._instanceFor(n)||this._findInstance(e,this._fallbacksFor(e,t));return a&&(i[t]=a,r(a,"store",this._store)),i[t]},e.prototype._fallbacksFor=function(e,t){return"adapter"===e?["application",this._store.get("adapter"),"-json-api"]:["application",this.get("adapter",t).get("defaultSerializer"),"-default"]},e.prototype._findInstance=function(e,t){for(var r=this._namespaces[e],i=0,n=t.length;i<n;i++){var a=t[i];if(r[a])return r[a];var o=e+":"+a,s=this._instanceFor(o);if(s)return r[a]=s,s}},e.prototype._instanceFor=function(e){return this._owner.lookup(e)},e.prototype.destroyCache=function(e){for(var t=Object.keys(e),r=0,i=t.length;r<i;r++){var n=t[r],a=e[n];a&&a.destroy()}},e.prototype.destroy=function(){this.isDestroying=!0,this.destroyCache(this._namespaces.adapter),this.destroyCache(this._namespaces.serializer),this.isDestroyed=!0},e.prototype.toString=function(){return"ContainerInstanceCache"},e}();e.default=i}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i,n){function a(e,t,a,o,s,l){var d=s.createSnapshot(l),u=s.modelName,c=e.findRecord(t,a,o,d),p="DS: Handle Adapter#findRecord of '"+u+"' with id: '"+o+"'";return c=h.resolve(c,p),c=(0,r._guard)(c,(0,r._bind)(r._objectIsAlive,t)),c.then(function(r){var s=(0,n.serializerForAdapter)(t,e,u),l=(0,i.normalizeResponseHelper)(s,t,a,r,o,"findRecord");return t._push(l)},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+u+"'")}function o(e,a,o,s,l){var d=t.default.A(l).invoke("createSnapshot"),u=a.modelFor(o),c=e.findMany(a,u,s,d),p="DS: Handle Adapter#findMany of '"+o+"'";if(void 0===c)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return c=h.resolve(c,p),c=(0,r._guard)(c,(0,r._bind)(r._objectIsAlive,a)),c.then(function(t){var r=(0,n.serializerForAdapter)(a,e,o),s=(0,i.normalizeResponseHelper)(r,a,u,t,null,"findMany");return a._push(s)},null,"DS: Extract payload of "+o)}function s(e,t,a,o,s){var l=a.createSnapshot(),d=t.modelFor(s.type),u=e.findHasMany(t,l,o,s),c="DS: Handle Adapter#findHasMany of '"+a.modelName+"' : '"+s.type+"'";return u=h.resolve(u,c),u=(0,r._guard)(u,(0,r._bind)(r._objectIsAlive,t)),u=(0,r._guard)(u,(0,r._bind)(r._objectIsAlive,a)),u.then(function(r){var a=(0,n.serializerForAdapter)(t,e,s.type),o=(0,i.normalizeResponseHelper)(a,t,d,r,null,"findHasMany"),l=t._push(o);return l.meta=o.meta,l},null,"DS: Extract payload of '"+a.modelName+"' : hasMany '"+s.type+"'")}function l(e,t,a,o,s){var l=a.createSnapshot(),d=t.modelFor(s.type),u=e.findBelongsTo(t,l,o,s),c="DS: Handle Adapter#findBelongsTo of "+a.modelName+" : "+s.type;return u=h.resolve(u,c),u=(0,r._guard)(u,(0,r._bind)(r._objectIsAlive,t)),u=(0,r._guard)(u,(0,r._bind)(r._objectIsAlive,a)),u.then(function(r){var a=(0,n.serializerForAdapter)(t,e,s.type),o=(0,i.normalizeResponseHelper)(a,t,d,r,null,"findBelongsTo");return o.data?t._push(o):null},null,"DS: Extract payload of "+a.modelName+" : "+s.type)}function d(e,t,a,o,s){var l=t.modelFor(a),d=t.peekAll(a),u=d._createSnapshot(s),c=e.findAll(t,l,o,u),p="DS: Handle Adapter#findAll of "+l;return c=h.resolve(c,p),c=(0,r._guard)(c,(0,r._bind)(r._objectIsAlive,t)),c.then(function(r){var o=(0,n.serializerForAdapter)(t,e,a),s=(0,i.normalizeResponseHelper)(o,t,l,r,null,"findAll");return t._push(s),t._didUpdateAll(a),d},null,"DS: Extract payload of findAll ${modelName}")}function u(e,t,a,o,s){var l=t.modelFor(a),d=e.query(t,l,o,s),u="DS: Handle Adapter#query of "+l;return d=h.resolve(d,u),d=(0,r._guard)(d,(0,r._bind)(r._objectIsAlive,t)),d.then(function(r){var o=(0,n.serializerForAdapter)(t,e,a),d=(0,i.normalizeResponseHelper)(o,t,l,r,null,"query"),u=t._push(d);return s._setInternalModels(u,d),s},null,"DS: Extract payload of query "+a)}function c(e,t,a,o){var s=t.modelFor(a),l=e.queryRecord(t,s,o),d="DS: Handle Adapter#queryRecord of "+a;return l=h.resolve(l,d),l=(0,r._guard)(l,(0,r._bind)(r._objectIsAlive,t)),l.then(function(r){var o=(0,n.serializerForAdapter)(t,e,a),l=(0,i.normalizeResponseHelper)(o,t,s,r,null,"queryRecord");return t._push(l)},null,"DS: Extract payload of queryRecord "+a)}e.__esModule=!0,e._find=a,e._findMany=o,e._findHasMany=s,e._findBelongsTo=l,e._findAll=d,e._query=u,e._queryRecord=c;var h=t.default.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember"],function(e,t){function r(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 i(e,t,r,i,n,a){var o=e.normalizeResponse(t,r,i,n,a);return o}e.__esModule=!0,e.validateDocumentStructure=r,e.normalizeResponseHelper=i}),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.__esModule=!0,e.serializerForAdapter=t}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return n(e,"attributes").has("type")||n(e,"relationshipsByName").has("type")}function i(e){var r=void 0;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}e.__esModule=!0,e.getOwner=e.modelHasAttributeOrRelationshipNamedType=void 0;var n=t.default.get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=i}),t("ember-data/-private/utils/parse-response-headers",["exports"],function(e){function t(e){var t=Object.create(null);if(!e)return t;for(var i=e.split(r),n=0;n<i.length;n++){for(var a=i[n],o=0,s=!1;o<a.length;o++)if(58===a.charCodeAt(o)){s=!0;break}if(!1!==s){var l=a.substring(0,o).trim(),d=a.substring(o+1,a.length).trim();d&&(t[l]=d)}}return t}e.__esModule=!0,e.default=t;var r="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){e.__esModule=!0,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-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"AdapterError",{enumerable:!0,get:function(){return t.AdapterError}}),Object.defineProperty(e,"InvalidError",{enumerable:!0,get:function(){return t.InvalidError}}),Object.defineProperty(e,"UnauthorizedError",{enumerable:!0,get:function(){return t.UnauthorizedError}}),Object.defineProperty(e,"ForbiddenError",{enumerable:!0,get:function(){return t.ForbiddenError}}),Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return t.NotFoundError}}),Object.defineProperty(e,"ConflictError",{enumerable:!0,get:function(){return t.ConflictError}}),Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return t.ServerError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return t.TimeoutError}}),Object.defineProperty(e,"AbortError",{enumerable:!0,get:function(){return t.AbortError}}),Object.defineProperty(e,"errorsHashToArray",{enumerable:!0,get:function(){return t.errorsHashToArray}}),Object.defineProperty(e,"errorsArrayToHash",{enumerable:!0,get:function(){return t.errorsArrayToHash}})}),t("ember-data/adapters/json-api",["exports","ember","ember-inflector","ember-data/adapters/rest","ember-data/-private"],function(e,t,r,i,n){e.__esModule=!0;var a=i.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 n=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),n&&n(e)},i},coalesceFindRequests:!1,findMany:function(e,t,r,i){if((0,n.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var a=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(a,"GET",{data:{filter:{id:r.join(",")}}})},pathForType:function(e){var i=t.default.String.dasherize(e);return(0,r.pluralize)(i)},updateRecord:function(e,t,r){if((0,n.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var i={};e.serializerFor(t.modelName).serializeIntoHash(i,t,r,{includeId:!0});var a=this.buildURL(t.modelName,r.id,r,"updateRecord");return this.ajax(a,"PATCH",{data:i})},_hasCustomizedAjax:function(){return this.ajax!==a.prototype.ajax||this.ajaxOptions!==a.prototype.ajaxOptions}});(0,n.isEnabled)("ds-improved-ajax")&&a.reopen({methodForRequest:function(e){return"updateRecord"===e.requestType?"PATCH":this._super.apply(this,arguments)},dataForRequest:function(e){var t=e.requestType,r=e.ids;if("findMany"===t)return{filter:{id:r.join(",")}};if("updateRecord"===t){var i=e.store,n=e.type,a=e.snapshot,o={};return i.serializerFor(n.modelName).serializeIntoHash(o,n,a,{includeId:!0}),o}return this._super.apply(this,arguments)},headersForRequest:function(){var e=this._super.apply(this,arguments)||{};return e.Accept="application/vnd.api+json",e},_requestToJQueryAjaxHash:function(){var e=this._super.apply(this,arguments);return e.contentType&&(e.contentType="application/vnd.api+json"),e}}),e.default=a}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/-private"],function(e,t,r,i){function n(e,t,r,n){var a=void 0;try{a=e.handleResponse(t.status,(0,i.parseResponseHeaders)(t.getAllResponseHeaders()),r,n)}catch(e){return d.reject(e)}return a&&a.isAdapterError?d.reject(a):a}function a(e,t,r,n){var a=void 0;if(n.errorThrown instanceof Error)a=n.errorThrown;else if("timeout"===n.textStatus)a=new i.TimeoutError;else if("abort"===n.textStatus||0===t.status)a=new i.AbortError;else try{a=e.handleResponse(t.status,(0,i.parseResponseHeaders)(t.getAllResponseHeaders()),e.parseErrorResponse(t.responseText)||n.errorThrown,r)}catch(e){a=e}return a}function o(e,t){return"function"!=typeof String.prototype.endsWith?-1!==e.indexOf(t,e.length-t.length):e.endsWith(t)}e.__esModule=!0;var s=t.default.MapWithDefault,l=t.default.get,d=t.default.RSVP.Promise,u=r.default.extend(i.BuildURLMixin,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},n=t.sort(),a=0;a<r;a++)i[n[a]]=e[n[a]];return i},coalesceFindRequests:!1,findRecord:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,id:r,snapshot:n,requestType:"findRecord"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,r,n,"findRecord"),s=this.buildQuery(n);return this.ajax(o,"GET",{data:s})},findAll:function(e,t,r,n){var a=this.buildQuery(n);if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var o=this._requestFor({store:e,type:t,sinceToken:r,query:a,snapshots:n,requestType:"findAll"});return this._makeRequest(o)}var s=this.buildURL(t.modelName,null,n,"findAll");return r&&(a.since=r),this.ajax(s,"GET",{data:a})},query:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,query:r,requestType:"query"});return this._makeRequest(n)}var a=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},queryRecord:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,query:r,requestType:"queryRecord"});return this._makeRequest(n)}var a=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},findMany:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,ids:r,snapshots:n,requestType:"findMany"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,r,n,"findMany");return this.ajax(o,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:r,relationship:n,requestType:"findHasMany"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return r=this.urlPrefix(r,this.buildURL(s,o,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:r,relationship:n,requestType:"findBelongsTo"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return r=this.urlPrefix(r,this.buildURL(s,o,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:r,requestType:"createRecord"});return this._makeRequest(n)}var a={},o=e.serializerFor(t.modelName),s=this.buildURL(t.modelName,null,r,"createRecord");return o.serializeIntoHash(a,t,r,{includeId:!0}),this.ajax(s,"POST",{data:a})},updateRecord:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:r,
5
- requestType:"updateRecord"});return this._makeRequest(n)}var a={};e.serializerFor(t.modelName).serializeIntoHash(a,t,r);var o=r.id,s=this.buildURL(t.modelName,o,r,"updateRecord");return this.ajax(s,"PUT",{data:a})},deleteRecord:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:r,requestType:"deleteRecord"});return this._makeRequest(n)}var a=r.id;return this.ajax(this.buildURL(t.modelName,a,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),n=i[i.length-1],a=t.id;return decodeURIComponent(n)===a?i[i.length-1]="":o(n,"?id="+a)&&(i[i.length-1]=n.substring(0,n.length-a.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var a=0,o=n._stripIDFromURL(e,t[0]),s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;o.length+a+t>=r&&(a=0,s.push([])),a+=t;var n=s.length-1;s[n].push(e)}),s}var i=s.create({defaultValue:function(){return[]}}),n=this,a=this.maxURLLength;t.forEach(function(t){var r=n._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){r(e,a,"&ids%5B%5D=".length).forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,n){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new i.InvalidError(r.errors);var a=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,n);if((0,i.isEnabled)("ds-extended-errors"))switch(e){case 401:return new i.UnauthorizedError(a,o);case 403:return new i.ForbiddenError(a,o);case 404:return new i.NotFoundError(a,o);case 409:return new i.ConflictError(a,o);default:if(e>=500)return new i.ServerError(a,o)}return new i.AdapterError(a,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 o=this,s={url:e,method:r};return new d(function(l,d){var u=o.ajaxOptions(e,r,i);u.success=function(e,r,i){var a=n(o,i,e,s);t.default.run.join(null,l,a)},u.error=function(e,r,i){var n={textStatus:r,errorThrown:i},l=a(o,e,s,n);t.default.run.join(null,d,l)},o._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 n=l(this,"headers");return void 0!==n&&(i.beforeSend=function(e){Object.keys(n).forEach(function(t){return e.setRequestHeader(t,n[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 n=void 0,a=t["Content-Type"]||"Empty Content-Type";return n="text/html"===a&&r.length>250?"[Omitted Lengthy HTML]":r,["Ember Data Request "+i.method+" "+i.url+" returned a "+e,"Payload ("+a+")",n].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t},_hasCustomizedAjax:function(){return this.ajax!==u.prototype.ajax||this.ajaxOptions!==u.prototype.ajaxOptions}});(0,i.isEnabled)("ds-improved-ajax")&&u.reopen({dataForRequest:function(e){var t=e.store,r=e.type,i=e.snapshot,n=e.requestType,a=e.query;r=r||i&&i.type;var o=t.serializerFor(r.modelName),s={};switch(n){case"createRecord":o.serializeIntoHash(s,r,i,{includeId:!0});break;case"updateRecord":o.serializeIntoHash(s,r,i);break;case"findRecord":s=this.buildQuery(i);break;case"findAll":e.sinceToken&&(a=a||{},a.since=e.sinceToken),s=a;break;case"query":case"queryRecord":this.sortQueryParams&&(a=this.sortQueryParams(a)),s=a;break;case"findMany":s={ids:e.ids};break;default:s=void 0}return s},methodForRequest:function(e){switch(e.requestType){case"createRecord":return"POST";case"updateRecord":return"PUT";case"deleteRecord":return"DELETE"}return"GET"},urlForRequest:function(e){var t=e.type,r=e.id,i=e.ids,n=e.snapshot,a=e.snapshots,o=e.requestType,s=e.query;switch(t=t||n&&n.type,r=r||n&&n.id,o){case"findAll":return this.buildURL(t.modelName,null,a,o);case"query":case"queryRecord":return this.buildURL(t.modelName,null,null,o,s);case"findMany":return this.buildURL(t.modelName,i,a,o);case"findHasMany":case"findBelongsTo":var l=this.buildURL(t.modelName,r,n,o);return this.urlPrefix(e.url,l)}return this.buildURL(t.modelName,r,n,o,s)},headersForRequest:function(e){return this.get("headers")},_requestFor:function(e){return{method:this.methodForRequest(e),url:this.urlForRequest(e),headers:this.headersForRequest(e),data:this.dataForRequest(e)}},_requestToJQueryAjaxHash:function(e){var t={};t.type=e.method,t.url=e.url,t.dataType="json",t.context=this,e.data&&("GET"!==e.method?(t.contentType="application/json; charset=utf-8",t.data=JSON.stringify(e.data)):t.data=e.data);var r=e.headers;return void 0!==r&&(t.beforeSend=function(e){Object.keys(r).forEach(function(t){return e.setRequestHeader(t,r[t])})}),t},_makeRequest:function(e){var r=this,i=this._requestToJQueryAjaxHash(e),o=e.method,s=e.url,l={method:o,url:s};return new t.default.RSVP.Promise(function(e,o){i.success=function(i,a,o){var s=n(r,o,i,l);t.default.run.join(null,e,s)},i.error=function(e,i,n){var s={textStatus:i,errorThrown:n},d=a(r,e,l,s);t.default.run.join(null,o,d)},r._ajaxRequest(i)},"DS: RESTAdapter#makeRequest: "+o+" "+s)}}),e.default=u}),t("ember-data/attr",["exports","ember"],function(e,t){function r(e,t,r){return"function"==typeof t.defaultValue?t.defaultValue.apply(null,arguments):t.defaultValue}function i(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 a(e,a){"object"==typeof e?(a=e,e=void 0):a=a||{};var o={type:e,isAttribute:!0,options:a};return t.default.computed({get:function(e){var t=this._internalModel;return i(t,e)?n(t,e):r(this,a,e)},set:function(e,t){var r=this._internalModel,i=n(r,e),a=void 0;return t!==i&&(r._attributes[e]=t,a=e in r._inFlightAttributes?r._inFlightAttributes[e]:r._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:i,originalValue:a,value:t})),t}}).meta(o)}e.__esModule=!0,e.default=a}),t("ember-data",["exports","ember","ember-data/-private","ember-data/setup-container","ember-data/instance-initializers/initialize-store-service","ember-data/transforms/transform","ember-data/transforms/number","ember-data/transforms/date","ember-data/transforms/string","ember-data/transforms/boolean","ember-data/adapter","ember-data/adapters/json-api","ember-data/adapters/rest","ember-data/serializer","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest","ember-data/serializers/embedded-records-mixin","ember-data/attr","ember-inflector"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,y,m,v,b){if(e.__esModule=!0,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.");r.DS.Store=r.Store,r.DS.PromiseArray=r.PromiseArray,r.DS.PromiseObject=r.PromiseObject,r.DS.PromiseManyArray=r.PromiseManyArray,r.DS.Model=r.Model,r.DS.RootState=r.RootState,r.DS.attr=b.default,r.DS.Errors=r.Errors,r.DS.InternalModel=r.InternalModel,r.DS.Snapshot=r.Snapshot,r.DS.Adapter=u.default,r.DS.AdapterError=r.AdapterError,r.DS.InvalidError=r.InvalidError,r.DS.TimeoutError=r.TimeoutError,r.DS.AbortError=r.AbortError,(0,r.isEnabled)("ds-extended-errors")&&(r.DS.UnauthorizedError=r.UnauthorizedError,r.DS.ForbiddenError=r.ForbiddenError,r.DS.NotFoundError=r.NotFoundError,r.DS.ConflictError=r.ConflictError,r.DS.ServerError=r.ServerError),r.DS.errorsHashToArray=r.errorsHashToArray,r.DS.errorsArrayToHash=r.errorsArrayToHash,r.DS.Serializer=p.default,r.DS.DebugAdapter=r.DebugAdapter,r.DS.RecordArray=r.RecordArray,r.DS.FilteredRecordArray=r.FilteredRecordArray,r.DS.AdapterPopulatedRecordArray=r.AdapterPopulatedRecordArray,r.DS.ManyArray=r.ManyArray,r.DS.RecordArrayManager=r.RecordArrayManager,r.DS.RESTAdapter=h.default,r.DS.BuildURLMixin=r.BuildURLMixin,r.DS.RESTSerializer=m.default,r.DS.JSONSerializer=y.default,r.DS.JSONAPIAdapter=c.default,r.DS.JSONAPISerializer=f.default,r.DS.Transform=a.default,r.DS.DateTransform=s.default,r.DS.StringTransform=l.default,r.DS.NumberTransform=o.default,r.DS.BooleanTransform=d.default,r.DS.EmbeddedRecordsMixin=v.default,r.DS.belongsTo=r.belongsTo,r.DS.hasMany=r.hasMany,r.DS.Relationship=r.Relationship,r.DS._setupContainer=i.default,r.DS._initializeStoreService=n.default,Object.defineProperty(r.DS,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:r.normalizeModelName}),Object.defineProperty(r.global,"DS",{configurable:!0,get:function(){return r.DS}}),e.default=r.DS}),t("ember-data/initializers/data-adapter",["exports"],function(e){e.__esModule=!0,e.default={name:"data-adapter",before:"store",initialize:function(){}}}),t("ember-data/initializers/ember-data",["exports","ember-data/setup-container","ember-data"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/initializers/injectStore",["exports"],function(e){e.__esModule=!0,e.default={name:"injectStore",before:"store",initialize:function(){}}}),t("ember-data/initializers/store",["exports"],function(e){e.__esModule=!0,e.default={name:"store",after:"ember-data",initialize:function(){}}}),t("ember-data/initializers/transforms",["exports"],function(e){e.__esModule=!0,e.default={name:"transforms",before:"store",initialize:function(){}}}),t("ember-data/instance-initializers/ember-data",["exports","ember-data/instance-initializers/initialize-store-service"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/instance-initializers/initialize-store-service",["exports"],function(e){function t(e){(e.lookup?e:e.container).lookup("service:store"),i((e.base||e.application).constructor.initializers)}function r(e){return-1!==a.indexOf(e)}function i(e){for(var t=Object.keys(e),i=0;i<t.length;i++){var a=t[i];r(a)||n(e[a])}}function n(e){r(e.before),r(e.after)}e.__esModule=!0,e.default=t;var a=["data-adapter","injectStore","transforms","store"]}),t("ember-data/model",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Model}})}),t("ember-data/relationships",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"belongsTo",{enumerable:!0,get:function(){return t.belongsTo}}),Object.defineProperty(e,"hasMany",{enumerable:!0,get:function(){return t.hasMany}})}),t("ember-data/serializer",["exports","ember"],function(e,t){e.__esModule=!0,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"],function(e,t){function r(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)}e.__esModule=!0;var i=t.default.get,n=t.default.set,a=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 n=this.hasSerializeIdsOption(i),a=this.hasSerializeRecordsOption(i),o=e.belongsTo(i);if(n){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 a&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),n=this._getMappedKey(r.key,e.type);n===r.key&&this.keyForRelationship&&(n=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[n]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[n]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[n]=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 n=this._getMappedKey(r.key,e.type);n===r.key&&this.keyForRelationship&&(n=this.keyForRelationship(r.key,r.kind,"serialize")),t[n]=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 n=this.keyForAttribute(i.key,"serialize"),a=e.hasMany(i.key);r[n]=t.default.A(a).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),n=t.default.A(i),a=new Array(n.length),o=0;o<n.length;o++){var s=n[o],l=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,l),a[o]=l}return a},removeEmbeddedForeignKey:function(e,t,r,i){if("belongsTo"===r.kind){var n=e.type.inverseFor(r.key,this.store);if(n){var a=n.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(a,n.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[a(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var n=this;return r.eachRelationship(function(r,a){e.hasDeserializeRecordsOption(r)&&("hasMany"===a.kind&&n._extractEmbeddedHasMany(t,r,i,a),"belongsTo"===a.kind&&n._extractEmbeddedBelongsTo(t,r,i,a))}),i},_extractEmbeddedHasMany:function(e,t,a,o){var s=i(a,"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,p=c.included;if(a.included=a.included||[],a.included.push(h),p){var f;(f=a.included).push.apply(f,r(p))}l[d]={id:h.id,type:h.type}}n(a,"data.relationships."+t,{data:l})}},_extractEmbeddedBelongsTo:function(e,t,a,o){var s=i(a,"data.relationships."+t+".data");if(s){var l=this._normalizeEmbeddedRelationship(e,o,s),d=l.data,u=l.included;if(a.included=a.included||[],a.included.push(d),u){var c;(c=a.included).push.apply(c,r(u))}var h={id:d.id,type:d.type};n(a,"data.relationships."+t,{data:h})}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var n=e.modelFor(i);return e.serializerFor(i).normalize(n,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-inflector","ember-data/serializers/json","ember-data/-private"],function(e,t,r,i,n){e.__esModule=!0;var a=t.default.String.dasherize,o=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 n=e.data[i];r[i]=this._normalizeResourceHelper(n)}e.data=r}if(Array.isArray(e.included)){for(var a=new Array(e.included.length),o=0;o<e.included.length;o++){var s=e.included[o];a[o]=this._normalizeResourceHelper(s)}e.included=a}return e},_normalizeRelationshipDataHelper:function(e){if((0,n.isEnabled)("ds-payload-type-hooks")){var t=this.modelNameFromPayloadType(e.type),r=this.modelNameFromPayloadKey(e.type);t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r),e.type=t}else e.type=this.modelNameFromPayloadKey(e.type);return e},_normalizeResourceHelper:function(e){var t=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){t=this.modelNameFromPayloadType(e.type);var r=this.modelNameFromPayloadKey(e.type);"modelNameFromPayloadType",t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r,"modelNameFromPayloadKey")}else t=this.modelNameFromPayloadKey(e.type),"modelNameFromPayloadKey";if(!this.store._hasModelFor(t))return null;var i=this.store._modelFor(t);return this.store.serializerFor(t).normalize(i,e).data},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);if((0,n.isEnabled)("ds-pushpayload-return"))return e.push(r);e.push(r)},_normalizeResponse:function(e,t,r,i,n,a){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 n=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[n]&&(i[e]=t.attributes[n])}),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 n=e.data[i];r[i]=this._normalizeRelationshipDataHelper(n)}e.data=r}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,n){var a=r.keyForRelationship(e,n.kind,"deserialize");if(void 0!==t.relationships[a]){var o=t.relationships[a];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){if((0,n.isEnabled)("ds-payload-type-hooks")){var r=this.modelNameFromPayloadType(t.type),i=this.modelNameFromPayloadKey(t.type);return r!==i&&this._hasCustomModelNameFromPayloadKey()&&(r=i),r}return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,r.singularize)((0,n.normalizeModelName)(e))},payloadKeyFromModelName:function(e){return(0,r.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 a(e)},keyForRelationship:function(e,t,r){return a(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),i=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){i=this.payloadTypeFromModelName(e.modelName);var a=this.payloadKeyFromModelName(e.modelName);i!==a&&this._hasCustomPayloadKeyFromModelName()&&(i=a)}else i=this.payloadKeyFromModelName(e.modelName);return r.type=i,{data:r}},serializeAttribute:function(e,t,r,i){var n=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var a=e.attr(r);if(n){a=this.transformFor(n).serialize(a,i.options)}var o=this._getMappedKey(r,e.type);o===r&&(o=this.keyForAttribute(r,"serialize")),t.attributes[o]=a}},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 o=this._getMappedKey(i,e.type);o===i&&(o=this.keyForRelationship(i,"belongsTo","serialize"));var s=null;if(a){var l=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){l=this.payloadTypeFromModelName(a.modelName);var d=this.payloadKeyFromModelName(a.modelName);l!==d&&this._hasCustomPayloadKeyFromModelName()&&(l=d)}else l=this.payloadKeyFromModelName(a.modelName);s={type:l,id:a.id}}t.relationships[o]={data:s}}}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if((0,n.isEnabled)("ds-check-should-serialize-relationships")&&(a="shouldSerializeHasMany"),this[a](e,i,r)){var o=e.hasMany(i);if(void 0!==o){t.relationships=t.relationships||{};var s=this._getMappedKey(i,e.type);s===i&&this.keyForRelationship&&(s=this.keyForRelationship(i,"hasMany","serialize"));for(var l=new Array(o.length),d=0;d<o.length;d++){var u=o[d],c=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){c=this.payloadTypeFromModelName(u.modelName);var h=this.payloadKeyFromModelName(u.modelName);c!==h&&this._hasCustomPayloadKeyFromModelName()&&(c=h)}else c=this.payloadKeyFromModelName(u.modelName);l[d]={type:c,id:u.id}}t.relationships[s]={data:l}}}}});(0,n.isEnabled)("ds-payload-type-hooks")&&o.reopen({modelNameFromPayloadType:function(e){return(0,r.singularize)((0,n.normalizeModelName)(e))},payloadTypeFromModelName:function(e){return(0,r.pluralize)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==o.prototype.modelNameFromPayloadKey},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==o.prototype.payloadKeyFromModelName}}),e.default=o}),t("ember-data/serializers/json",["exports","ember","ember-data/serializer","ember-data/-private"],function(e,t,r,i){function n(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)}e.__esModule=!0;var a=t.default.get,o=t.default.isNone,s=t.default.assign||t.default.merge,l=r.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=a(e,"attributes");return e.eachTransformedAttribute(function(e,n){if(void 0!==t[e]){var a=r.transformFor(n),o=i.get(e);t[e]=a.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,n){switch(n){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,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,n){return this._normalizeResponse(e,t,r,i,n,!0)},normalizeArrayResponse:function(e,t,r,i,n){return this._normalizeResponse(e,t,r,i,n,!1)},_normalizeResponse:function(e,t,r,i,a,o){var s={data:null,included:[]},l=this.extractMeta(e,t,r);if(l&&(s.meta=l),o){var d=this.normalize(t,r),u=d.data,c=d.included;s.data=u,c&&(s.included=c)}else{for(var h=new Array(r.length),p=0,f=r.length;p<f;p++){var y=r[p],m=this.normalize(t,y),v=m.data,b=m.included;if(b){var _;(_=s.included).push.apply(_,n(b))}h[p]=v}s.data=h}return s},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=a(this,"primaryKey"),n=t[r];return(0,i.coerceId)(n)},extractAttributes:function(e,t){var r=this,i=void 0,n={};return e.eachAttribute(function(e){i=r.keyForAttribute(e,"deserialize"),void 0!==t[i]&&(n[e]=t[i])}),n},extractRelationship:function(e,r){if(t.default.isNone(r))return null;if("object"===t.default.typeOf(r)){r.id&&(r.id=(0,i.coerceId)(r.id));var n=this.store.modelFor(e);if(r.type&&!(0,i.modelHasAttributeOrRelationshipNamedType)(n))if((0,i.isEnabled)("ds-payload-type-hooks")){var a=this.modelNameFromPayloadType(r.type),o=this.modelNameFromPayloadKey(r.type);a!==o&&this._hasCustomModelNameFromPayloadKey()&&(a=o),r.type=a}else r.type=this.modelNameFromPayloadKey(r.type);return r}return{id:(0,i.coerceId)(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var i=this,n={};return e.eachRelationship(function(e,a){var o=null,s=i.keyForRelationship(e,a.kind,"deserialize");if(void 0!==r[s]){var l=null,d=r[s];if("belongsTo"===a.kind)l=a.options.polymorphic?i.extractPolymorphicRelationship(a.type,d,{key:e,resourceHash:r,relationshipMeta:a}):i.extractRelationship(a.type,d);else if("hasMany"===a.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(a.type,h)}}o={data:l}}var p=i.keyForLink(e,a.kind);if(r.links&&void 0!==r.links[p]){var f=r.links[p];o=o||{},o.links={related:f}}o&&(n[e]=o)}),n},modelNameFromPayloadKey:function(e){return(0,i.normalizeModelName)(e)},normalizeRelationships:function(e,t){var r=this,i=void 0;this.keyForRelationship&&e.eachRelationship(function(e,n){i=r.keyForRelationship(e,n.kind,"deserialize"),e!==i&&void 0!==t[i]&&(t[e]=t[i],delete t[i])})},normalizeUsingDeclaredMapping:function(e,t){var r=a(this,"attrs"),i=void 0,n=void 0;if(r)for(var o in r)i=n=this._getMappedKey(o,e),void 0!==t[n]&&(a(e,"attributes").has(o)&&(i=this.keyForAttribute(o)),a(e,"relationshipsByName").has(o)&&(i=this.keyForRelationship(o)),n!==i&&(t[i]=t[n],delete t[n]))},_getMappedKey:function(e,t){var r=a(this,"attrs"),i=void 0;return r&&r[e]&&(i=r[e],i.key&&(i=i.key),"string"==typeof i&&(e=i)),e},_canSerialize:function(e){var t=a(this,"attrs");return!t||!t[e]||!1!==t[e].serialize},_mustSerialize:function(e){var t=a(this,"attrs");return t&&t[e]&&!0===t[e].serialize},shouldSerializeHasMany:function(e,t,r){return this._shouldSerializeHasMany,l.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,n={};if(t&&t.includeId)if((0,i.isEnabled)("ds-serialize-id"))this.serializeId(e,n,a(this,"primaryKey"));else{var o=e.id;o&&(n[a(this,"primaryKey")]=o)}return e.eachAttribute(function(t,i){r.serializeAttribute(e,n,t,i)}),e.eachRelationship(function(t,i){"belongsTo"===i.kind?r.serializeBelongsTo(e,n,i):"hasMany"===i.kind&&r.serializeHasMany(e,n,i)}),n},serializeIntoHash:function(e,t,r,i){s(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){if(this._canSerialize(r)){var n=i.type,a=e.attr(r);if(n){a=this.transformFor(n).serialize(a,i.options)}var o=this._getMappedKey(r,e.type);o===r&&this.keyForAttribute&&(o=this.keyForAttribute(r,"serialize")),t[o]=a}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var n=e.belongsTo(i,{id:!0}),a=this._getMappedKey(i,e.type);a===i&&this.keyForRelationship&&(a=this.keyForRelationship(i,"belongsTo","serialize")),o(n)?t[a]=null:t[a]=n,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var n=r.key,a="_shouldSerializeHasMany";if((0,i.isEnabled)("ds-check-should-serialize-relationships")&&(a="shouldSerializeHasMany"),this[a](e,n,r)){var o=e.hasMany(n,{ids:!0});if(void 0!==o){var s=this._getMappedKey(n,e.type);s===n&&this.keyForRelationship&&(s=this.keyForRelationship(n,"hasMany","serialize")),t[s]=o}}},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,n){var a=this;return r&&"object"==typeof r&&r.errors&&(r=(0,i.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,i.getOwner)(this).lookup("transform:"+e)}});(0,i.isEnabled)("ds-payload-type-hooks")&&l.reopen({modelNameFromPayloadType:function(e){return(0,i.normalizeModelName)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==l.prototype.modelNameFromPayloadKey}}),(0,i.isEnabled)("ds-serialize-id")&&l.reopen({serializeId:function(e,t,r){var i=e.id;i&&(t[r]=i)}}),e.default=l}),t("ember-data/serializers/rest",["exports","ember","ember-inflector","ember-data/serializers/json","ember-data/-private"],function(e,t,r,i,n){function a(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)}e.__esModule=!0;var o=t.default.String.camelize,s=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,n){var o=this,s={data:[],included:[]},l=e.modelFor(r),d=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=o._normalizePolymorphicRecord(e,t,n,l,d),i=r.data,u=r.included;if(s.data.push(i),u){var c;(c=s.included).push.apply(c,a(u))}}),s},_normalizePolymorphicRecord:function(e,t,r,i,a){var o=a,s=i;if(!(0,n.modelHasAttributeOrRelationshipNamedType)(i)&&t.type){var l=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){l=this.modelNameFromPayloadType(t.type);var d=this.modelNameFromPayloadKey(t.type);l!==d&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(l=d)}else l=this.modelNameFromPayloadKey(t.type);e._hasModelFor(l)&&(o=e.serializerFor(l),s=e.modelFor(l))}return o.normalize(s,t,r)},_normalizeResponse:function(e,t,r,i,o,s){var l={data:null,included:[]},d=this.extractMeta(e,t,r);d&&(l.meta=d);for(var u=Object.keys(r),c=0,h=u.length;c<h;c++){var p=u[c],f=p,y=!1;"_"===p.charAt(0)&&(y=!0,f=p.substr(1));var m=this.modelNameFromPayloadKey(f);if(e.modelFactoryFor(m)){var v=!y&&this.isPrimaryType(e,m,t),b=r[p];if(null!==b)if(!v||Array.isArray(b)){var _=this._normalizeArray(e,m,b,p),g=_.data,R=_.included;if(R){var M;(M=l.included).push.apply(M,a(R))}if(s)g.forEach(function(e){var t=v&&(0,n.coerceId)(e.id)===i
6
- ;v&&!i&&!l.data||t?l.data=e:l.included.push(e)});else if(v)l.data=g;else if(g){var A;(A=l.included).push.apply(A,a(g))}}else{var F=this._normalizePolymorphicRecord(e,b,p,t,this),z=F.data,I=F.included;if(l.data=z,I){var S;(S=l.included).push.apply(S,a(I))}}}}return l},isPrimaryType:function(e,t,r){return e.modelFor(t)===r},pushPayload:function(e,r){var i={data:[],included:[]};for(var o in r){var s=this.modelNameFromPayloadKey(o);if(e.modelFactoryFor(s)){var l=e.modelFor(s),d=e.serializerFor(l.modelName);t.default.makeArray(r[o]).forEach(function(e){var t=d.normalize(l,e,o),r=t.data,n=t.included;if(i.data.push(r),n){var s;(s=i.included).push.apply(s,a(n))}})}}if((0,n.isEnabled)("ds-pushpayload-return"))return e.push(i);e.push(i)},modelNameFromPayloadKey:function(e){return(0,r.singularize)((0,n.normalizeModelName)(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 o(e)},serializePolymorphicType:function(e,r,i){var a=i.key,l=this.keyForPolymorphicType(a,i.type,"serialize"),d=e.belongsTo(a);a=this.keyForAttribute?this.keyForAttribute(a,"serialize"):a,a+="Type",a!==l&&this.keyForPolymorphicType===s.prototype.keyForPolymorphicType&&(l=a),t.default.isNone(d)?r[l]=null:(0,n.isEnabled)("ds-payload-type-hooks")?r[l]=this.payloadTypeFromModelName(d.modelName):r[l]=o(d.modelName)},extractPolymorphicRelationship:function(e,t,r){var i=r.key,a=r.resourceHash,o=r.relationshipMeta,s=o.options.polymorphic,l=this.keyForPolymorphicType(i,e,"deserialize");if(s&&void 0!==a[l]&&"object"!=typeof t){if((0,n.isEnabled)("ds-payload-type-hooks")){var d=a[l],u=this.modelNameFromPayloadType(d),c=this.modelNameFromPayloadKey(d);return d!==c&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(u=c),{id:t,type:u}}return{id:t,type:this.modelNameFromPayloadKey(a[l])}}return this._super.apply(this,arguments)}});(0,n.isEnabled)("ds-payload-type-hooks")&&s.reopen({modelNameFromPayloadType:function(e){return(0,r.singularize)((0,n.normalizeModelName)(e))},payloadTypeFromModelName:function(e){return o(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==s.prototype.modelNameFromPayloadKey},_hasCustomModelNameFromPayloadType:function(){return this.modelNameFromPayloadType!==s.prototype.modelNameFromPayloadType},_hasCustomPayloadTypeFromModelName:function(){return this.payloadTypeFromModelName!==s.prototype.payloadTypeFromModelName},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==s.prototype.payloadKeyFromModelName}}),e.default=s}),t("ember-data/setup-container",["exports","ember-data/-private","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest","ember-data/adapters/json-api","ember-data/adapters/rest","ember-data/transforms/number","ember-data/transforms/date","ember-data/transforms/string","ember-data/transforms/boolean"],function(e,t,r,i,n,a,o,s,l,d,u){function c(e,t){return e.has?e.has(t):e.hasRegistration(t)}function h(e){var s=e.registerOptionsForType||e.optionsForType;s.call(e,"serializer",{singleton:!1}),s.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",i.default),e.register("serializer:-rest",n.default),e.register("adapter:-rest",o.default),e.register("adapter:-json-api",a.default),e.register("serializer:-json-api",r.default),c(e,"service:store")||e.register("service:store",t.Store)}function p(e){e.register("data-adapter:main",t.DebugAdapter)}function f(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")}function y(e){e.register("transform:boolean",u.default),e.register("transform:date",l.default),e.register("transform:number",s.default),e.register("transform:string",d.default)}function m(e){p(e),y(e),f(e),h(e)}e.__esModule=!0,e.default=m}),t("ember-data/store",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Store}})}),t("ember-data/transform",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),t("ember-data/transforms/boolean",["exports","ember","ember-data/transforms/transform"],function(e,t,r){e.__esModule=!0;var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e,t){var r=typeof e;return i(e)&&!0===t.allowNull?null:"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r&&1===e},serialize:function(e,t){return i(e)&&!0===t.allowNull?null:Boolean(e)}})}),t("ember-data/transforms/date",["exports","ember-data/transforms/transform","ember"],function(e,t,r){e.__esModule=!0,r.default.Date=r.default.Date||{},r.default.Date.parse=function(e){return Date.parse(e)},e.default=t.default.extend({deserialize:function(e){var t=typeof e;if("string"===t){var r=e.indexOf("+");return-1!==r&&e.length-3===r?new Date(e+":00"):-1!==r&&e.length-5===r?(r+=3,new Date(e.slice(0,r)+":"+e.slice(r))):new Date(e)}return"number"===t?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/transforms/number",["exports","ember","ember-data/transforms/transform"],function(e,t,r){function i(e){return e===e&&e!==1/0&&e!==-1/0}e.__esModule=!0;var n=t.default.isEmpty;e.default=r.default.extend({deserialize:function(e){var t=void 0;return n(e)?null:(t=Number(e),i(t)?t:null)},serialize:function(e){var t=void 0;return n(e)?null:(t=Number(e),i(t)?t:null)}})}),t("ember-data/transforms/string",["exports","ember","ember-data/transforms/transform"],function(e,t,r){e.__esModule=!0;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/transforms/transform",["exports","ember"],function(e,t){e.__esModule=!0,e.default=t.default.Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.__esModule=!0,e.default="2.14.11"}),t("ember-inflector",["module","exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i,n){r.__esModule=!0,r.defaultRules=r.singularize=r.pluralize=void 0,n.Inflector.defaultRules=n.defaultRules,i.default.Inflector=n.Inflector,i.default.String.pluralize=n.pluralize,i.default.String.singularize=n.singularize,r.default=n.Inflector,r.pluralize=n.pluralize,r.singularize=n.singularize,r.defaultRules=n.defaultRules,void 0!==t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=n.Inflector,e.pluralize=n.pluralize,e.singularize=n.singularize,e}):void 0!==e&&e.exports&&(e.exports=n.Inflector,n.Inflector.singularize=n.singularize,n.Inflector.pluralize=n.pluralize)}),t("ember-inflector/lib/ext/string",["ember","ember-inflector/lib/system/string"],function(e,t){(!0===e.default.EXTEND_PROTOTYPES||e.default.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,t.pluralize)(this)},String.prototype.singularize=function(){return(0,t.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,e.default=(0,r.default)(function(e,r){var i=void 0,n=void 0,a=!1;return 1===e.length?(n=e[0],(0,t.pluralize)(n)):(i=e[0],n=e[1],r["without-count"]&&(a=r["without-count"]),1!==parseFloat(i)&&(n=(0,t.pluralize)(n)),a?n:i+" "+n)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,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){e.__esModule=!0,e.defaultRules=e.pluralize=e.singularize=e.Inflector=void 0,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.__esModule=!0,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,n=t.length;i<n;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 n(e){e=e||{},e.uncountable=e.uncountable||a(),e.irregularPairs=e.irregularPairs||a();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:a(),irregularInverse:a(),uncountable:a()};r(t,e.uncountable),i(t,e.irregularPairs),this.enableCache()}function a(){var e=Object.create(null);return e._dict=null,delete e._dict,e}e.__esModule=!0;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");n.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=a(),this._pCache=a()},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,n,a,c,h,p,f,y;if(p=!e||s.test(e),f=u.test(e),"",p)return e;if(a=e.toLowerCase(),c=l.exec(e)||d.exec(e),c&&(c[1],h=c[2].toLowerCase()),this.rules.uncountable[a]||this.rules.uncountable[h])return e;for(y in r)if(a.match(y+"$"))return n=r[y],f&&r[h]&&(n=o(n),y=o(y)),e.replace(new RegExp(y,"i"),n);for(var m=t.length;m>0&&(i=t[m-1],y=i[0],!y.test(e));m--);return i=i||[],y=i[0],n=i[1],e.replace(y,n)}},e.default=n}),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.__esModule=!0,e.singularize=e.pluralize=void 0,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.__esModule=!0,e.default=r}),t("ember-load-initializers",["exports"],function(e){function t(e){var t=i(e,null,null,!0);if(!t)throw new Error(e+" must export an initializer.");var r=t.default;return r.name||(r.name=e.slice(e.lastIndexOf("/")+1)),r}function r(e,r){for(var i=0;i<r.length;i++)e.initializer(t(r[i]))}function a(e,r){for(var i=0;i<r.length;i++)e.instanceInitializer(t(r[i]))}e.__esModule=!0,e.default=function(e,t){for(var i=t+"/initializers/",o=t+"/instance-initializers/",s=[],l=[],d=Object.keys(n._eak_seen),u=0;u<d.length;u++){var c=d[u];0===c.lastIndexOf(i,0)?s.push(c):0===c.lastIndexOf(o,0)&&l.push(c)}r(e,s),a(e,l)}}),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])}()}();
1
+ (function(){"use strict";var e,t,r,i,n;!function(a){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(id, deps, module)` instead got: `"+e+"` arguments to define`")}function l(e,t,r,i){this.uuid=b++,this.id=e,this.deps=!t.length&&r.length?_:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function d(){}function u(e){this.id=e}function c(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function h(e,t,r){for(var i=m[e]||m[e+"/index"];i&&i.isAlias;)i=m[i.id];return i||c(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function p(e,t){if("."!==e.charAt(0))return e;for(var r=e.split("/"),i=t.split("/"),n=i.slice(0,-1),a=0,o=r.length;a<o;a++){var s=r[a];if(".."===s){if(0===n.length)throw new Error("Cannot access parent module of root");n.pop()}else{if("."===s)continue;n.push(s)}}return n.join("/")}function f(e){return!(!m[e]&&!m[e+"/index"])}var y=(a.heimdall,{loader:e,define:t,requireModule:r,require:i,requirejs:n});n=i=r=function(e){for(var t=[],r=h(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)&&y.hasOwnProperty(t)&&(r=e[t],a[r]=a[t],a[t]=y[t])}};var m=o(),v=o(),b=0,_=["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.id,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.reified.length=0,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],n=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,n.exports=this.module.exports):"require"===i?n.exports=this.makeRequire():"module"===i?n.exports=this.module:n.module=h(p(i,this.id),this.id,e)}}},l.prototype.makeRequire=function(){var e=this.id,t=function(t){return i(p(t,e))};return t.default=t,t.moduleId=e,t.has=function(t){return f(p(t,e))},t},t=function(e,t,r){var i=m[e];i&&"new"!==i.state||(arguments.length<2&&s(arguments.length),Array.isArray(t)||(r=t,t=[]),m[e]=r instanceof u?new l(r.id,t,r,!0):new l(e,t,r,!1))},t.exports=function(e,t){var r=m[e];if(!r||"new"===r.state)return r=new l(e,[],d,null),r.module.exports=t,r.state="finalized",m[e]=r,r},t.alias=function(e,r){return 2===arguments.length?t(r,new u(e)):new u(e)},n.entries=n._eak_seen=m,n.has=f,n.unsee=function(e){h(e,"(unsee)",!1).unsee()},n.clear=function(){n.entries=n._eak_seen=m=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.alias("foo","foo/qux"),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),t.exports("foo/exports",{}),i("foo/exports"),i("foo/main"),i.unsee("foo/bar"),n.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-debug",["exports","ember"],function(e,t){function r(e){return e()}e.__esModule=!0,e.assertPolymorphicType=void 0,e.instrument=r;var i=void 0;e.assertPolymorphicType=i}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){e.__esModule=!0;var r=t.default.get;e.default=t.default.Mixin.create({buildURL:function(e,t,r,i,n){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(n,e);case"queryRecord":return this.urlForQueryRecord(n,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=void 0,n=[],a=r(this,"host"),o=this.urlPrefix();return e&&(i=this.pathForType(e))&&n.push(i),t&&n.push(encodeURIComponent(t)),o&&n.unshift(o),n=n.join("/"),!a&&n&&"/"!==n.charAt(0)&&(n="/"+n),n},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"),n=r(this,"namespace");if(i&&"/"!==i||(i=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+i+e:t+"/"+e;var a=[];return i&&a.push(i),n&&a.push(n),a.join("/")},pathForType:function(e){var r=t.default.String.camelize(e);return t.default.String.pluralize(r)}})}),t("ember-data/-private/adapters/errors",["exports","ember","ember-data/-private/features"],function(e,t,r){function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Adapter operation failed";this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.message;return a(e,r)}}function a(e,t){var r=function(r,i){e.call(this,r,i||t)};return r.prototype=Object.create(e.prototype),h&&(r.extend=n(r)),r}function o(e){var r=[];return t.default.isPresent(e)&&Object.keys(e).forEach(function(i){for(var n=t.default.makeArray(e[i]),a=0;a<n.length;a++){var o="Invalid Attribute",s="/data/attributes/"+i;i===c&&(o="Invalid Document",s="/data"),r.push({title:o,detail:n[a],source:{pointer:s}})}}),r}function s(e){var r={};return t.default.isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(d);t?t=t[2]:-1!==e.source.pointer.search(u)&&(t=c),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.__esModule=!0,e.ServerError=e.ConflictError=e.NotFoundError=e.ForbiddenError=e.UnauthorizedError=e.AbortError=e.TimeoutError=e.InvalidError=void 0,e.AdapterError=i,e.errorsHashToArray=o,e.errorsArrayToHash=s;var l=t.default.Error,d=/^\/?data\/(attributes|relationships)\/(.*)/,u=/^\/?data/,c="base",h=!1;h=!0,i.prototype=Object.create(l.prototype),h&&(i.extend=n(i));e.InvalidError=a(i,"The adapter rejected the commit because it was invalid"),e.TimeoutError=a(i,"The adapter operation timed out"),e.AbortError=a(i,"The adapter operation was aborted"),e.UnauthorizedError=h?a(i,"The adapter operation is unauthorized"):null,e.ForbiddenError=h?a(i,"The adapter operation is forbidden"):null,e.NotFoundError=h?a(i,"The adapter could not find the resource"):null,e.ConflictError=h?a(i,"The adapter operation failed due to a conflict"):null,e.ServerError=h?a(i,"The adapter operation failed due to a server error"):null}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){e.__esModule=!0;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/features",["exports","ember"],function(e,t){function r(){var e;return(e=t.default.FEATURES).isEnabled.apply(e,arguments)}e.__esModule=!0,e.default=r}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}e.__esModule=!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",["exports","ember-data/-private/system/model/model","ember-data/-private/system/model/errors","ember-data/-private/system/store","ember-data/-private/core","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/adapters/build-url-mixin","ember-data/-private/system/snapshot","ember-data/-private/adapters/errors","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/utils/parse-response-headers","ember-data/-private/global","ember-data/-private/features","ember-data/-private/system/model/states","ember-data/-private/system/model/internal-model","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/promise-proxies","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/debug/debug-adapter","ember-data/-private/system/diff-array","ember-data/-private/system/relationships/relationship-payloads-manager","ember-data/-private/system/relationships/relationship-payloads","ember-data/-private/system/snapshot-record-array"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,y,m,v,b,_,g,R,M,A,F,z,k,S,P){e.__esModule=!0,Object.defineProperty(e,"Model",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Errors",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DS",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"belongsTo",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"hasMany",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BuildURLMixin",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"Snapshot",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"AdapterError",{enumerable:!0,get:function(){return d.AdapterError}}),Object.defineProperty(e,"InvalidError",{enumerable:!0,get:function(){return d.InvalidError}}),Object.defineProperty(e,"UnauthorizedError",{enumerable:!0,get:function(){return d.UnauthorizedError}}),Object.defineProperty(e,"ForbiddenError",{enumerable:!0,get:function(){return d.ForbiddenError}}),Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return d.NotFoundError}}),Object.defineProperty(e,"ConflictError",{enumerable:!0,get:function(){return d.ConflictError}}),Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return d.ServerError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return d.TimeoutError}}),Object.defineProperty(e,"AbortError",{enumerable:!0,get:function(){return d.AbortError}}),Object.defineProperty(e,"errorsHashToArray",{enumerable:!0,get:function(){return d.errorsHashToArray}}),Object.defineProperty(e,"errorsArrayToHash",{enumerable:!0,get:function(){return d.errorsArrayToHash}}),Object.defineProperty(e,"normalizeModelName",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"getOwner",{enumerable:!0,get:function(){return c.getOwner}}),Object.defineProperty(e,"modelHasAttributeOrRelationshipNamedType",{enumerable:!0,get:function(){return c.modelHasAttributeOrRelationshipNamedType}}),Object.defineProperty(e,"coerceId",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"parseResponseHeaders",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"global",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"isEnabled",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"RootState",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"InternalModel",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"ContainerInstanceCache",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"PromiseArray",{enumerable:!0,get:function(){return _.PromiseArray}}),Object.defineProperty(e,"PromiseObject",{enumerable:!0,get:function(){return _.PromiseObject}}),Object.defineProperty(e,"PromiseManyArray",{enumerable:!0,get:function(){return _.PromiseManyArray}}),Object.defineProperty(e,"RecordArray",{enumerable:!0,get:function(){return g.RecordArray}}),Object.defineProperty(e,"FilteredRecordArray",{enumerable:!0,get:function(){return g.FilteredRecordArray}}),Object.defineProperty(e,"AdapterPopulatedRecordArray",{enumerable:!0,get:function(){return g.AdapterPopulatedRecordArray}}),Object.defineProperty(e,"ManyArray",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"RecordArrayManager",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"Relationship",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"DebugAdapter",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"diffArray",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(e,"RelationshipPayloadsManager",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(e,"RelationshipPayloads",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"SnapshotRecordArray",{enumerable:!0,get:function(){return P.default}})}),t("ember-data/-private/system/clone-null",["exports"],function(e){function t(e){var t=Object.create(null);for(var r in e)t[r]=e[r];return t}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:"string"==typeof e?e:""+e}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/-private/system/model/model"],function(e,t,r){e.__esModule=!0;var i=t.default.String.capitalize,n=t.default.String.underscore,a=t.default.assert,o=t.default.get;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,a=this;return o(e,"attributes").forEach(function(e,o){if(r++>a.attributeLimit)return!1;var s=i(n(o).replace("_"," "));t.push({name:o,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 a("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,i={id:o(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;i[n]=o(e,n)}),i},getRecordKeywords:function(e){var r=[],i=t.default.A(["id"]);return e.eachAttribute(function(e){return i.push(e)}),i.forEach(function(t){return r.push(o(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(),n=t.default.A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return n.push(e)});var a=this;return n.forEach(function(n){var o=function(){r(a.wrapRecord(e))};t.default.addObserver(e,n,o),i.push(function(){t.default.removeObserver(e,n,o)})}),function(){i.forEach(function(e){return e()})}}})}),t("ember-data/-private/system/diff-array",["exports"],function(e){function t(e,t){for(var r=e.length,i=t.length,n=Math.min(r,i),a=null,o=0;o<n;o++)if(e[o]!==t[o]){a=o;break}null===a&&i!==r&&(a=n);var s=0,l=0;if(null!==a){for(var d=n-a,u=1;u<=n;u++)if(e[r-u]!==t[i-u]){d=u-1;break}s=i-d-a,l=r-d-a}return{firstChangeIndex:a,addedCount:s,removedCount:l}}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/identity-map",["exports","ember-data/-private/system/internal-model-map"],function(e,t){e.__esModule=!0;var r=function(){function e(){this._map=Object.create(null)}return e.prototype.retrieve=function(e){var r=this._map[e];return r||(r=this._map[e]=new t.default(e)),r},e.prototype.clear=function(){for(var e=this._map,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].clear()}},e}();e.default=r}),t("ember-data/-private/system/internal-model-map",["exports","ember-data/-private/system/model/internal-model"],function(e,t){e.__esModule=!0;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(e){this.modelName=e,this._idToModel=Object.create(null),this._models=[],this._metadata=null}return e.prototype.get=function(e){return this._idToModel[e]},e.prototype.has=function(e){return!!this._idToModel[e]},e.prototype.set=function(e,t){this._idToModel[e]=t},e.prototype.add=function(e,t){t&&(this._idToModel[t]=e),this._models.push(e)},e.prototype.remove=function(e,t){t&&delete this._idToModel[t];var r=this._models.indexOf(e);-1!==r&&this._models.splice(r,1)},e.prototype.contains=function(e){return-1!==this._models.indexOf(e)},e.prototype.clear=function(){if(this._models){var e=this._models;this._models=[];for(var t=0;t<e.length;t++){e[t].unloadRecord()}}this._metadata=null},e.prototype.destroy=function(){this._store=null,this._modelClass=null},r(e,[{key:"idToRecord",get:function(){return this._idToModel}},{key:"length",get:function(){return this._models.length}},{key:"models",get:function(){return this._models}},{key:"metadata",get:function(){return this._metadata||(this._metadata=Object.create(null))}},{key:"type",get:function(){throw new Error("InternalModelMap.type is no longer available")}}]),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.__esModule=!0,e.default=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/diff-array"],function(e,t,r,i,n){e.__esModule=!0;var a=t.default.get;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=[],this.flushCanonical(!1)},objectAt:function(e){var t=this.currentState[e];if(void 0!==t)return t.getRecord()},flushCanonical:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if((0,i._objectIsAlive)(this)){var t=this.canonicalState,r=this.currentState.filter(function(e){return e.isNew()&&-1===t.indexOf(e)});t=t.concat(r);var a=(0,n.default)(this.currentState,t);null!==a.firstChangeIndex&&(this.arrayContentWillChange(a.firstChangeIndex,a.removedCount,a.addedCount),this.set("length",t.length),this.currentState=t,this.arrayContentDidChange(a.firstChangeIndex,a.removedCount,a.addedCount),e&&a.addedCount>0&&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)},_removeInternalModels:function(e){for(var t=0;t<e.length;t++){var r=this.currentState.indexOf(e[t]);this.internalReplace(r,1)}},_addInternalModels: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").removeInternalModels(i)),r&&this.get("relationship").addInternalModels(r.map(function(e){return e._internalModel}),e)},reload:function(){return this.relationship.reload()},save:function(){var e=this,i="DS: ManyArray#save "+a(this,"type"),n=t.default.RSVP.all(this.invoke("save"),i).then(function(){return e},null,"DS: ManyArray#save return ManyArray");return r.PromiseArray.create({promise:n})},createRecord:function(e){var t=a(this,"store"),r=a(this,"type"),i=t.createRecord(r.modelName,e);return this.pushObject(i),i}})}),t("ember-data/-private/system/model/errors",["exports","ember"],function(e,t){e.__esModule=!0;var r=t.default.get,i=t.default.set,n=t.default.isEmpty,a=t.default.makeArray,o=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 o.create({defaultValue:function(){return t.default.A()}})}),errorsFor:function(e){return r(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 i=r(this,"isEmpty");this._add(e,t),i&&!r(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),r(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=a(t),n=new Array(i.length),o=0;o<i.length;o++){var s=i[o],l=r.findBy("message",s);n[o]=l||{attribute:e,message:s}}return n},remove:function(e){r(this,"isEmpty")||(this._remove(e),r(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!r(this,"isEmpty")){var t=this.rejectBy("attribute",e);i(this,"content",t),r(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e)}},clear:function(){r(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!r(this,"isEmpty")){var e=r(this,"errorsByAttributeName"),i=t.default.A();e.forEach(function(e,t){i.push(t)}),e.clear(),i.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/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/features","ember-data/-private/system/ordered-set","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,n,a,o,s,l){function d(e){return S[e]||(S[e]=e.split("."))}function u(e){return k[e]||(k[e]=d(e)[0])}function c(e){for(var t=0;t<e.length;++t){var r=e[t]._record;if(r&&!r.get("isDestroyed")&&!r.get("isDestroying"))return!1}return!0}e.__esModule=!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}}(),p=t.default.get,f=t.default.set,y=t.default.copy,m=t.default.Error,v=t.default.inspect,b=t.default.isEmpty,_=t.default.isEqual,g=t.default.setOwner,R=t.default.run,M=t.default.RSVP,A=t.default.RSVP.Promise,F=t.default.assign||t.default.merge,z=Object.create(null),k=Object.create(null),S=Object.create(null),P=1,I=1,T=function(){function e(e,r,i,n){this.id=r,this[t.default.GUID_KEY]=P+++"internal-model",this.store=i,this.modelName=e,this._loadingPromise=null,this._record=null,this._isDestroyed=!1,this.isError=!1,this._isUpdatingRecordArrays=!1,this._isDematerializing=!1,this._scheduledDestroy=null,this.resetRecord(),n&&(this.__data=n),this._modelClass=null,this.__deferredTriggers=null,this.__recordArrays=null,this._references=null,this._recordReference=null,this.__relationships=null,this.__implicitRelationships=null,this._bfsId=0}return e.prototype.isHiddenFromRecordArrays=function(){return this._isDematerializing||this.isDestroyed||"root.deleted.saved"===this.currentState.stateName||this.isEmpty()},e.prototype.isEmpty=function(){return this.currentState.isEmpty},e.prototype.isLoading=function(){return this.currentState.isLoading},e.prototype.isLoaded=function(){return this.currentState.isLoaded},e.prototype.hasDirtyAttributes=function(){return this.currentState.hasDirtyAttributes},e.prototype.isSaving=function(){return this.currentState.isSaving},e.prototype.isDeleted=function(){return this.currentState.isDeleted},e.prototype.isNew=function(){return this.currentState.isNew},e.prototype.isValid=function(){return this.currentState.isValid},e.prototype.dirtyType=function(){return this.currentState.dirtyType},e.prototype.getRecord=function(e){if(!this._record&&!this._isDematerializing){var t={store:this.store,_internalModel:this,id:this.id,currentState:this.currentState,isError:this.isError,adapterError:this.error};"object"==typeof e&&null!==e&&F(t,e),g?g(t,(0,s.getOwner)(this.store)):t.container=this.store.container,this._record=this.store.modelFactoryFor(this.modelName).create(t),this._triggerDeferredTriggers()}return this._record},e.prototype.resetRecord=function(){this._record=null,this.dataHasInitialized=!1,this.isReloading=!1,this.error=null,this.currentState=r.default.empty,this.__attributes=null,this.__inFlightAttributes=null,this._data=null},e.prototype.dematerializeRecord=function(){this._record&&(this._isDematerializing=!0,this._record.destroy(),this.destroyRelationships(),this.updateRecordArrays(),this.resetRecord())},e.prototype.deleteRecord=function(){this.send("deleteRecord")},e.prototype.save=function(e){var t="DS: Model#save "+this,r=M.defer(t);return this.store.scheduleSave(this,r,e),r.promise},e.prototype.startedReloading=function(){this.isReloading=!0,this.hasRecord&&f(this._record,"isReloading",!0)},e.prototype.finishedReloading=function(){this.isReloading=!1,this.hasRecord&&f(this._record,"isReloading",!1)},e.prototype.reload=function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new A(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()})},e.prototype._directlyRelatedInternalModels=function(){var e=this,t=[];return this.type.eachRelationship(function(r,i){if(e._relationships.has(r)){var n=e._relationships.get(r),a=n.members.toArray(),o=n.canonicalMembers.toArray();t=t.concat(a,o)}}),t},e.prototype._allRelatedInternalModels=function(){var e=[],t=[],r=I++;for(t.push(this),this._bfsId=r;t.length>0;){var i=t.shift();e.push(i);for(var n=i._directlyRelatedInternalModels(),a=0;a<n.length;++a){var o=n[a];o._bfsId<r&&(t.push(o),o._bfsId=r)}}return e},e.prototype.unloadRecord=function(){this.send("unloadRecord"),this.dematerializeRecord(),null===this._scheduledDestroy&&(this._scheduledDestroy=R.schedule("destroy",this,"_checkForOrphanedInternalModels"))},e.prototype.cancelDestroy=function(){this._isDematerializing=!1,R.cancel(this._scheduledDestroy),this._scheduledDestroy=null},e.prototype._checkForOrphanedInternalModels=function(){this._isDematerializing=!1,this._scheduledDestroy=null,this.isDestroyed||this._cleanupOrphanedInternalModels()},e.prototype._cleanupOrphanedInternalModels=function(){var e=this._allRelatedInternalModels();if(c(e))for(var t=0;t<e.length;++t){var r=e[t];r.isDestroyed||r.destroy()}},e.prototype.eachRelationship=function(e,t){return this.modelClass.eachRelationship(e,t)},e.prototype.destroy=function(){this.store._internalModelDestroyed(this),this._isDestroyed=!0},e.prototype.eachAttribute=function(e,t){return this.modelClass.eachAttribute(e,t)},e.prototype.inverseFor=function(e){return this.modelClass.inverseFor(e)},e.prototype.setupData=function(e){this.store._internalModelDidReceiveRelationshipData(this.modelName,this.id,e.relationships);var t=void 0;this.hasRecord&&(t=this._changedKeys(e.attributes)),F(this._data,e.attributes),this.pushedData(),this.hasRecord&&this._record._notifyProperties(t),this.didInitializeData()},e.prototype.becameReady=function(){this.store.recordArrayManager.recordWasLoaded(this)},e.prototype.didInitializeData=function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)},e.prototype.createSnapshot=function(e){return new n.default(this,e)},e.prototype.loadingData=function(e){this.send("loadingData",e)},e.prototype.loadedData=function(){this.send("loadedData"),this.didInitializeData()},e.prototype.notFound=function(){this.send("notFound")},e.prototype.pushedData=function(){this.send("pushedData")},e.prototype.flushChangedAttributes=function(){this._inFlightAttributes=this._attributes,this._attributes=null},e.prototype.hasChangedAttributes=function(){return null!==this.__attributes&&Object.keys(this.__attributes).length>0},e.prototype.updateChangedAttributes=function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=this._attributes,i=0,n=t.length;i<n;i++){var a=t[i],o=e[a];o[0]===o[1]&&delete r[a]}},e.prototype.changedAttributes=function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=F(y(r),t),n=Object.create(null),a=Object.keys(i),o=0,s=a.length;o<s;o++){var l=a[o];n[l]=[e[l],i[l]]}return n},e.prototype.adapterWillCommit=function(){this.send("willCommit")},e.prototype.adapterDidDirty=function(){this.send("becomeDirty"),this.updateRecordArrays()},e.prototype.send=function(e,t){var r=this.currentState;return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},e.prototype.notifyHasManyAdded=function(e,t,r){this.hasRecord&&this._record.notifyHasManyAdded(e,t,r)},e.prototype.notifyHasManyRemoved=function(e,t,r){this.hasRecord&&this._record.notifyHasManyRemoved(e,t,r)},e.prototype.notifyBelongsToChanged=function(e,t){this.hasRecord&&this._record.notifyBelongsToChanged(e,t)},e.prototype.notifyPropertyChange=function(e){this.hasRecord&&this._record.notifyPropertyChange(e)},e.prototype.rollbackAttributes=function(){var e=void 0;this.hasChangedAttributes()&&(e=Object.keys(this._attributes),this._attributes=null),p(this,"isError")&&(this._inFlightAttributes=null,this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=null),this.send("rolledBack"),e&&e.length>0&&this._record._notifyProperties(e)},e.prototype.transitionTo=function(e){var t=u(e),r=this.currentState,i=r.stateName+"->"+e;do{r.exit&&r.exit(this),r=r.parentState}while(!r[t]);var n=void 0,a=void 0,o=void 0,s=void 0,l=z[i];if(l)n=l.setups,a=l.enters,r=l.state;else{n=[],a=[];var c=d(e);for(o=0,s=c.length;o<s;o++)r=r[c[o]],r.enter&&a.push(r),r.setup&&n.push(r);z[i]={setups:n,enters:a,state:r}}for(o=0,
2
+ s=a.length;o<s;o++)a[o].enter(this);for(this.currentState=r,this.hasRecord&&f(this._record,"currentState",r),o=0,s=n.length;o<s;o++)n[o].setup(this);this.updateRecordArrays()},e.prototype._unhandledEvent=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 m(i)},e.prototype.triggerLater=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];1===this._deferredTriggers.push(t)&&this.store._updateInternalModel(this)},e.prototype._triggerDeferredTriggers=function(){if(this.hasRecord){for(var e=this._deferredTriggers,t=this._record,r=t.trigger,i=0,n=e.length;i<n;i++)r.apply(t,e[i]);e.length=0}},e.prototype.clearRelationships=function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var i=e._relationships.get(t);i.clear(),i.removeInverseRelationships()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].removeInverseRelationships()})},e.prototype.destroyRelationships=function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){e._relationships.get(t).removeInverseRelationships()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].removeInverseRelationships()})},e.prototype.preloadData=function(e){var t=this;Object.keys(e).forEach(function(r){var i=p(e,r);t.modelClass.metaForProperty(r).isRelationship?t._preloadRelationship(r,i):t._data[r]=i})},e.prototype._preloadRelationship=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)},e.prototype._preloadHasMany=function(e,t,r){for(var i=new Array(t.length),n=0;n<t.length;n++){var a=t[n];i[n]=this._convertStringOrNumberIntoInternalModel(a,r)}this._relationships.get(e).updateInternalModelsFromAdapter(i)},e.prototype._preloadBelongsTo=function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setInternalModel(i)},e.prototype._convertStringOrNumberIntoInternalModel=function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},e.prototype.updateRecordArrays=function(){this.store.recordArrayManager.recordDidChange(this)},e.prototype.setId=function(e){this.id=e,this._record.get("id")!==e&&this._record.set("id",e)},e.prototype.didError=function(e){this.error=e,this.isError=!0,this.hasRecord&&this._record.setProperties({isError:!0,adapterError:e})},e.prototype.didCleanError=function(){this.error=null,this.isError=!1,this.hasRecord&&this._record.setProperties({isError:!1,adapterError:null})},e.prototype.adapterDidCommit=function(e){e&&(this.store._internalModelDidReceiveRelationshipData(this.modelName,this.id,e.relationships),e=e.attributes),this.didCleanError();var t=this._changedKeys(e);F(this._data,this._inFlightAttributes),e&&F(this._data,e),this._inFlightAttributes=null,this.send("didCommit"),this.updateRecordArrays(),e&&this._record._notifyProperties(t)},e.prototype.addErrorMessageToAttribute=function(e,t){p(this.getRecord(),"errors")._add(e,t)},e.prototype.removeErrorMessageFromAttribute=function(e){p(this.getRecord(),"errors")._remove(e)},e.prototype.clearErrorMessages=function(){p(this.getRecord(),"errors")._clear()},e.prototype.hasErrors=function(){var e=p(this.getRecord(),"errors");return!b(e)},e.prototype.adapterDidInvalidate=function(e){var t=void 0;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},e.prototype.adapterDidError=function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},e.prototype._saveWasRejected=function(){var e=Object.keys(this._inFlightAttributes);if(e.length>0)for(var t=this._attributes,r=0;r<e.length;r++)void 0===t[e[r]]&&(t[e[r]]=this._inFlightAttributes[e[r]]);this._inFlightAttributes=null},e.prototype._changedKeys=function(e){var t=[];if(e){var r=void 0,i=void 0,n=void 0,a=void 0,o=Object.keys(e),s=o.length,l=this.hasChangedAttributes(),d=void 0;for(l&&(d=this._attributes),r=F(Object.create(null),this._data),r=F(r,this._inFlightAttributes),i=0;i<s;i++)a=o[i],n=e[a],!0===l&&void 0!==d[a]||_(r[a],n)||t.push(a)}return t},e.prototype.toString=function(){return"<"+this.modelName+":"+this.id+">"},e.prototype.referenceFor=function(e,t){var r=this.references[t];if(!r){var i=this._relationships.get(t);"belongsTo"===e?r=new l.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new l.HasManyReference(this.store,this,i)),this.references[t]=r}return r},h(e,[{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 l.RecordReference(this.store,this)),this._recordReference}},{key:"_recordArrays",get:function(){return null===this.__recordArrays&&(this.__recordArrays=o.default.create()),this.__recordArrays}},{key:"references",get:function(){return null===this._references&&(this._references=Object.create(null)),this._references}},{key:"_deferredTriggers",get:function(){return null===this.__deferredTriggers&&(this.__deferredTriggers=[]),this.__deferredTriggers}},{key:"_attributes",get:function(){return null===this.__attributes&&(this.__attributes=Object.create(null)),this.__attributes},set:function(e){this.__attributes=e}},{key:"_relationships",get:function(){return null===this.__relationships&&(this.__relationships=new i.default(this)),this.__relationships}},{key:"_inFlightAttributes",get:function(){return null===this.__inFlightAttributes&&(this.__inFlightAttributes=Object.create(null)),this.__inFlightAttributes},set:function(e){this.__inFlightAttributes=e}},{key:"_data",get:function(){return null===this.__data&&(this.__data=Object.create(null)),this.__data},set:function(e){this.__data=e}},{key:"_implicitRelationships",get:function(){return null===this.__implicitRelationships&&(this.__implicitRelationships=Object.create(null)),this.__implicitRelationships}},{key:"isDestroyed",get:function(){return this._isDestroyed}},{key:"hasRecord",get:function(){return!!this._record}}]),e}();e.default=T,(0,a.default)("ds-rollback-attribute")&&(T.prototype.lastAcknowledgedValue=function(e){return e in this._inFlightAttributes?this._inFlightAttributes[e]:this._data[e]})}),t("ember-data/-private/system/model/model",["exports","ember","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/relationships/ext"],function(e,t,r,i,n,a,o){function s(e,t,r,i){var n=i||[],a=l(t,"relationships");if(!a)return n;var o=a.get(e.modelName).filter(function(e){var i=t.metaForProperty(e.name).options;return!i.inverse||r===i.inverse});return o&&n.push.apply(n,o),e.superclass&&s(e.superclass,t,r,n),n}e.__esModule=!0;var l=t.default.get,d=t.default.computed,u=t.default.Map,c=d("currentState",function(e){return l(this._internalModel.currentState,e)}).readOnly(),h=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,__defineNonEnumerable:function(e){this[e.name]=e.descriptor.value},isEmpty:c,isLoading:c,isLoaded:c,hasDirtyAttributes:d("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:c,isDeleted:c,isNew:c,isValid:c,dirtyType:c,isError:!1,isReloading:!1,id:null,currentState:a.default.empty,errors:d(function(){var e=i.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:null,didLoad:null,didUpdate:null,didCreate:null,didDelete:null,becameInvalid:null,becameError:null,rolledBack:null,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,n=e.length;i<n;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 l(this,"id")},save:function(e){var t=this;return r.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){var e=this;return r.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){var t=this[e];if("function"==typeof t){for(var r=arguments.length,i=new Array(r-1),n=1;n<r;n++)i[n-1]=arguments[n];t.apply(this,i)}this._super.apply(this,arguments)},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,n){var a=t[n.kind];void 0===a&&(a=t[n.kind]=[],i.push({name:n.name,properties:a,expand:!0})),a.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)},eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return l(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(h.prototype,"data",{get:function(){return this._internalModel._data}}),h.reopenClass({isModel:!0,modelName:null,typeForRelationship:function(e,t){var r=l(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t.default.computed(function(){return Object.create(null)}),inverseFor:function(e,t){var r=l(this,"inverseMap");if(void 0!==r[e])return r[e];var i=l(this,"relationshipsByName").get(e);if(!i)return r[e]=null,null;var n=i.options;return n&&null===n.inverse?(r[e]=null,null):r[e]=this._findInverseFor(e,t)},_findInverseFor:function(e,r){var i=this.typeForRelationship(e,r);if(!i)return null;var n=this.metaForProperty(e),a=n.options;if(null===a.inverse)return null;var o=void 0,l=void 0,d=void 0;if(a.inverse)o=a.inverse,d=t.default.get(i,"relationshipsByName").get(o),l=d.kind;else{n.parentType&&(n.type,n.parentType.modelName);var u=s(this,i,e);if(0===u.length)return null;var c=u.filter(function(t){var r=i.metaForProperty(t.name).options;return e===r.inverse});1===c.length&&(u=c),o=u[0].name,l=u[0].kind}return{type:i,name:o,kind:l}},relationships:o.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:o.relatedTypesDescriptor,relationshipsByName:o.relationshipsByNameDescriptor,fields:t.default.computed(function(){var e=u.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){l(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=l(this,"relatedTypes"),i=0;i<r.length;i++){var n=r[i];e.call(t,n)}},determineRelationshipType:function(e,t){var r=e.key,i=e.kind,n=this.inverseFor(r,t),a=void 0;return n?(a=n.kind,"belongsTo"===a?"belongsTo"===i?"oneToOne":"manyToOne":"belongsTo"===i?"oneToMany":"manyToMany"):"belongsTo"===i?"oneToNone":"manyToNone"},attributes:t.default.computed(function(){var e=u.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=u.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){l(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){l(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}}),t.default.setOwner&&Object.defineProperty(h.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),(0,n.default)("ds-rollback-attribute")&&h.reopen({rollbackAttribute:function(e){e in this._internalModel._attributes&&this.set(e,this._internalModel.lastAcknowledgedValue(e))}}),e.default=h}),t("ember-data/-private/system/model/states",["exports"],function(e){function t(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArrays()}function r(e){var t={},i=void 0;for(var n in e)i=e[n],t[n]=i&&"object"==typeof i?r(i):i;return t}function i(e,t){for(var r in t)e[r]=t[r];return e}function n(e){return i(r(l),e)}function a(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function o(e){}function s(e,t,r){e=i(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var n in e)e.hasOwnProperty(n)&&"parentState"!==n&&"stateName"!==n&&"object"==typeof e[n]&&(e[n]=s(e[n],e,r+"."+n));return e}e.__esModule=!0;var l={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:t,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:t,becomeDirty:function(){},pushedData:function(){},unloadRecord:o,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,r){e.removeErrorMessageFromAttribute(r.name),t(e,r),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)}}},d=n({dirtyType:"created",isNew:!0});d.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},d.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var u=n({dirtyType:"updated"});d.uncommitted.deleteRecord=a,d.invalid.deleteRecord=a,d.uncommitted.rollback=function(e){l.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},d.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},d.uncommitted.propertyWasReset=function(){},u.inFlight.unloadRecord=o,u.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var c={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:function(){},unloadRecord:function(e){},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:t,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){},didCommit:function(){},notFound:function(){}},created:d,updated:u},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:o,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()},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:function(){},didCommit:function(){}},invalid:{isValid:!1,didSetProperty:function(e,r){e.removeErrorMessageFromAttribute(r.name),t(e,r),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=s(c,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.__esModule=!0,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.__esModule=!0,e.default=r}),t("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e.__esModule=!0,e.default=r;var i=t.default.OrderedSet,n=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=n(e),i=this.presenceSet,a=this.list;if(!0!==i[r])return i[r]=!0,void 0===t||null===t?a.push(e):a.splice(t,0,e),this.size+=1,this}}),t("ember-data/-private/system/promise-proxies",["exports","ember"],function(e,t){function r(e,t){return d.create({promise:s.resolve(e,t)})}function i(e,t){return l.create({promise:s.resolve(e,t)})}function n(e){return function(){var t;return(t=o(this,"content"))[e].apply(t,arguments)}}function a(e,t){return u.create({promise:s.resolve(e,t)})}e.__esModule=!0,e.PromiseManyArray=e.PromiseObject=e.PromiseArray=void 0,e.promiseObject=r,e.promiseArray=i,e.proxyToContent=n,e.promiseManyArray=a;var o=t.default.get,s=t.default.RSVP.Promise,l=e.PromiseArray=t.default.ArrayProxy.extend(t.default.PromiseProxyMixin),d=e.PromiseObject=t.default.ObjectProxy.extend(t.default.PromiseProxyMixin),u=e.PromiseManyArray=l.extend({reload:function(){return this.set("promise",this.get("content").reload()),this},createRecord:n("createRecord"),on:n("on"),one:n("one"),trigger:n("trigger"),off:n("off"),has:n("has")})}),t("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays","ember-data/-private/system/clone-null"],function(e,t,r,i){function n(e){e.destroy()}function a(e){for(var t=e.length,r=[],i=0;i<t;i++)r=r.concat(e[i]);return r}function o(e,t){var r=e.indexOf(t);return-1!==r&&(e.splice(r,1),!0)}function s(e,t){for(var r=[],i=[],n=0;n<t.length;n++){var a=t[n],o=a.isHiddenFromRecordArrays(),s=a._recordArrays;o||a.isEmpty()||s.has(e)||(r.push(a),s.add(e)),o&&(i.push(a),s.delete(e))}r.length>0&&e._pushInternalModels(r),i.length>0&&e._removeInternalModels(i)}function l(e){for(var t=0;t<e.length;t++){for(var r=e[t],i=r._recordArrays.list,n=0;n<i.length;n++)i[n]._removeInternalModels([r]);r._recordArrays.clear()}}function d(e,t){for(var r=0,i=e.length;r<i;r++){e[r]._recordArrays.add(t)}}e.__esModule=!0,e.associateWithRecordArray=d;var u=t.default.get,c=t.default.set,h=t.default.run,p=function(){function e(e){this.store=e.store,this.isDestroying=!1,this.isDestroyed=!1,this._filteredRecordArrays=Object.create(null),this._liveRecordArrays=Object.create(null),this._pending=Object.create(null),this._adapterPopulatedRecordArrays=[]}return e.prototype.recordDidChange=function(e){this.internalModelDidChange(e)},e.prototype.recordWasLoaded=function(e){this.internalModelDidChange(e)},e.prototype.internalModelDidChange=function(e){var t=e.modelName;if(!e._pendingRecordArrayManagerFlush){e._pendingRecordArrayManagerFlush=!0;var r=this._pending;1===(r[t]=r[t]||[]).push(e)&&h.schedule("actions",this,this._flush)}},e.prototype._flush=function(){var e=this._pending;this._pending=Object.create(null);var t=[];for(var r in e){for(var i=e[r],n=0;n<i.length;n++){var a=i[n];a._pendingRecordArrayManagerFlush=!1,a.isHiddenFromRecordArrays()&&t.push(a)}if(this._filteredRecordArrays[r])for(var o=this.filteredRecordArraysFor(r),s=0;s<o.length;s++)this.updateFilterRecordArray(o[s],r,i);var d=this._liveRecordArrays[r];d&&this.updateLiveRecordArray(d,i),t.length>0&&l(t)}},e.prototype.updateLiveRecordArray=function(e,t){return s(e,t)},e.prototype.updateFilterRecordArray=function(e,t,r){for(var i=u(e,"filterFunction"),n=[],a=[],o=0;o<r.length;o++){var s=r[o];if(!1===s.isHiddenFromRecordArrays()&&i(s.getRecord())){if(s._recordArrays.has(e))continue;n.push(s),s._recordArrays.add(e)}else s._recordArrays.delete(e)&&a.push(s)}n.length>0&&e._pushInternalModels(n),a.length>0&&e._removeInternalModels(a)},e.prototype._syncLiveRecordArray=function(e,t){var r=0===Object.keys(this._pending).length,i=this.store._internalModelsFor(t),n=u(i,"length")===u(e,"length");if(!r||!n){for(var a=this._visibleInternalModelsByType(t),o=[],s=0;s<a.length;s++){var l=a[s],d=l._recordArrays;!1===d.has(e)&&(d.add(e),o.push(l))}e._pushInternalModels(o)}},e.prototype.updateFilter=function(e,t,r){var i=this.store._internalModelsFor(t),n=i.models;this.updateFilterRecordArray(e,r,n)},e.prototype._didUpdateAll=function(e){var t=this._liveRecordArrays[e];t&&c(t,"isUpdating",!1)},e.prototype.liveRecordArrayFor=function(e){var t=this._liveRecordArrays[e];if(t)this._syncLiveRecordArray(t,e);else{var r=this._visibleInternalModelsByType(e);t=this.createRecordArray(e,r),this._liveRecordArrays[e]=t}return t},e.prototype._visibleInternalModelsByType=function(e){for(var t=this.store._internalModelsFor(e)._models,r=[],i=0;i<t.length;i++){var n=t[i];!1===n.isHiddenFromRecordArrays()&&r.push(n)}return r},e.prototype.filteredRecordArraysFor=function(e){return this._filteredRecordArrays[e]||(this._filteredRecordArrays[e]=[])},e.prototype.createRecordArray=function(e,i){var n=r.RecordArray.create({modelName:e,content:t.default.A(i||[]),store:this.store,isLoaded:!0,manager:this});return Array.isArray(i)&&d(i,n),n},e.prototype.createFilteredRecordArray=function(e,i,n){var a=r.FilteredRecordArray.create({query:n,modelName:e,content:t.default.A(),store:this.store,manager:this,filterFunction:i});return this.registerFilteredRecordArray(a,e,i),a},e.prototype.createAdapterPopulatedRecordArray=function(e,n,a,o){var s=void 0;return Array.isArray(a)?(s=r.AdapterPopulatedRecordArray.create({modelName:e,query:n,content:t.default.A(a),store:this.store,manager:this,isLoaded:!0,isUpdating:!1,meta:(0,i.default)(o.meta),links:(0,i.default)(o.links)}),d(a,s)):s=r.AdapterPopulatedRecordArray.create({modelName:e,query:n,content:t.default.A(),store:this.store,manager:this}),this._adapterPopulatedRecordArrays.push(s),s},e.prototype.registerFilteredRecordArray=function(e,t,r){this.filteredRecordArraysFor(t).push(e),this.updateFilter(e,t,r)},e.prototype.unregisterRecordArray=function(e){var t=e.modelName,r=this.filteredRecordArraysFor(t),i=o(r,e),n=o(this._adapterPopulatedRecordArrays,e);if(!i&&!n){var a=this._liveRecordArrays[t];a&&e===a&&delete this._liveRecordArrays[t]}},e.prototype.willDestroy=function(){var e=this;Object.keys(this._filteredRecordArrays).forEach(function(t){return a(e._filteredRecordArrays[t]).forEach(n)}),Object.keys(this._liveRecordArrays).forEach(function(t){return e._liveRecordArrays[t].destroy()}),this._adapterPopulatedRecordArrays.forEach(n),this.isDestroyed=!0},e.prototype.destroy=function(){this.isDestroying=!0,t.default.run.schedule("actions",this,this.willDestroy)},e}();e.default=p}),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.__esModule=!0,e.AdapterPopulatedRecordArray=e.FilteredRecordArray=e.RecordArray=void 0,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","ember-data/-private/system/record-array-manager"],function(e,t,r,i,n){e.__esModule=!0;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){this.get("content").setObjects(e),this.setProperties({isLoaded:!0,isUpdating:!1,meta:(0,i.default)(r.meta),links:(0,i.default)(r.links)}),(0,n.associateWithRecordArray)(e,this),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){e.__esModule=!0;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){e.__esModule=!0;var n=t.default.computed,a=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:n("modelName",function(){return this.modelName?this.store._modelFor(this.modelName):null}).readOnly(),objectAtContent:function(e){var t=a(this,"content").objectAt(e);return t&&t.getRecord()},update:function(){var e=this;if(a(this,"isUpdating"))return this._updatingPromise;this.set("isUpdating",!0);var t=this._update().finally(function(){e._updatingPromise=null,e.get("isDestroying")||e.get("isDestroyed")||e.set("isUpdating",!1)});return this._updatingPromise=t,t},_update:function(){return this.store.findAll(this.modelName,{reload:!0})},_pushInternalModels:function(e){a(this,"content").pushObjects(e)},_removeInternalModels:function(e){a(this,"content").removeObjects(e)},save:function(){var e=this,t="DS: RecordArray#save "+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(){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 a(this,"content").map(function(e){return e.createSnapshot()})}})}),t("ember-data/-private/system/references",["exports","ember-data/-private/system/references/record","ember-data/-private/system/references/belongs-to","ember-data/-private/system/references/has-many"],function(e,t,r,i){e.__esModule=!0,e.HasManyReference=e.BelongsToReference=e.RecordReference=void 0,e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=i.default}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/-private/system/model/model","ember","ember-data/-private/system/references/reference","ember-data/-private/features"],function(e,t,r,i,n){e.__esModule=!0;var a=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};a.prototype=Object.create(i.default.prototype),a.prototype.constructor=a,a.prototype._super$constructor=i.default,a.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},a.prototype.id=function(){var e=this.belongsToRelationship.inverseInternalModel;return e&&e.id},a.prototype.link=function(){return this.belongsToRelationship.link},a.prototype.meta=function(){return this.belongsToRelationship.meta},a.prototype.push=function(e){var i=this;return r.default.RSVP.resolve(e).then(function(e){var r=void 0;return e instanceof t.default?((0,n.default)("ds-overhaul-references"),r=e):r=i.store.push(e),i.belongsToRelationship.setCanonicalInternalModel(r._internalModel),r})},a.prototype.value=function(){var e=this.belongsToRelationship.inverseInternalModel
3
+ ;return e&&e.isLoaded()?e.getRecord():null},a.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},a.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=a}),t("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/features"],function(e,t,r,i){e.__esModule=!0;var n=t.default.RSVP.resolve,a=t.default.get,o=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};o.prototype=Object.create(r.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=r.default,o.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},o.prototype.link=function(){return this.hasManyRelationship.link},o.prototype.ids=function(){return this.hasManyRelationship.members.toArray().map(function(e){return e.id})},o.prototype.meta=function(){return this.hasManyRelationship.meta},o.prototype.push=function(e){var r=this;return n(e).then(function(e){var n=e;(0,i.default)("ds-overhaul-references");var a=!0;"object"==typeof e&&e.data&&(n=e.data,a=n.length&&n[0].data,(0,i.default)("ds-overhaul-references")),(0,i.default)("ds-overhaul-references")||(a=!0);var o=void 0;if(a)o=n.map(function(e){var t=r.store.push(e);return t._internalModel});else{var s=r.store.push(e);o=t.default.A(s).mapBy("_internalModel")}return r.hasManyRelationship.computeChanges(o),r.hasManyRelationship.manyArray})},o.prototype._isLoaded=function(){return!!a(this.hasManyRelationship,"hasData")&&this.hasManyRelationship.members.toArray().every(function(e){return!0===e.isLoaded()})},o.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},o.prototype.load=function(){return this._isLoaded()?n(this.hasManyRelationship.manyArray):this.hasManyRelationship.getRecords()},o.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=o}),t("ember-data/-private/system/references/record",["exports","ember","ember-data/-private/system/references/reference"],function(e,t,r){e.__esModule=!0;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(){if(this.internalModel.hasRecord)return this.internalModel.getRecord()},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){e.__esModule=!0;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=void 0;return i=e.type||e.key,"hasMany"===e.kind&&(i=(0,t.singularize)((0,r.default)(i))),i}function n(e){var t={key:e.key,kind:e.kind,type:i(e),options:e.options,name:e.name,parentType:e.parentType,isRelationship:!0};return t}e.__esModule=!0,e.typeForRelationshipMeta=i,e.relationshipFromMeta=n}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/system/normalize-model-name"],function(e,t,r){function i(e,i){var n=void 0,a=void 0;"object"==typeof e?(n=e,a=void 0):(n=i,a=e),"string"==typeof a&&(a=(0,r.default)(a)),n=n||{};var o={type:a,isRelationship:!0,options:n,kind:"belongsTo",name:"Belongs To",key:null};return t.default.computed({get:function(e){return n.hasOwnProperty("serialize"),n.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).setInternalModel(t._internalModel):this._internalModel._relationships.get(e).setInternalModel(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.__esModule=!0,e.default=i}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/system/relationship-meta"],function(e,t,r){e.__esModule=!0,e.relationshipsByNameDescriptor=e.relatedTypesDescriptor=e.relationshipsDescriptor=void 0;var i=t.default.Map,n=t.default.MapWithDefault,a=e.relationshipsDescriptor=t.default.computed(function(){!0===t.default.testing&&!0===a._cacheable&&(a._cacheable=!1);var e=new n({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,i){if(i.isRelationship){i.key=t;e.get((0,r.typeForRelationshipMeta)(i)).push({name:t,kind:i.kind})}}),e}).readOnly(),o=e.relatedTypesDescriptor=t.default.computed(function(){!0===t.default.testing&&!0===o._cacheable&&(o._cacheable=!1);var e=void 0,i=t.default.A();return this.eachComputedProperty(function(t,n){n.isRelationship&&(n.key=t,e=(0,r.typeForRelationshipMeta)(n),i.includes(e)||i.push(e))}),i}).readOnly();e.relationshipsByNameDescriptor=t.default.computed(function(){var e=i.create();return this.eachComputedProperty(function(t,i){if(i.isRelationship){i.key=t;var n=(0,r.relationshipFromMeta)(i);n.type=(0,r.typeForRelationshipMeta)(i),e.set(t,n)}}),e}).readOnly()}),t("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,i){function n(e,i){"object"==typeof e&&(i=e,e=void 0),i=i||{},"string"==typeof e&&(e=(0,r.default)(e));var n={type:e,options:i,isRelationship:!0,kind:"hasMany",name:"Has Many",key:null};return t.default.computed({get:function(e){return this._internalModel._relationships.get(e).getRecords()},set:function(e,t){var r=this._internalModel._relationships.get(e);return r.clear(),r.addInternalModels(t.map(function(e){return a(e,"_internalModel")})),r.getRecords()}}).meta(n)}e.__esModule=!0,e.default=n;var a=t.default.get}),t("ember-data/-private/system/relationships/relationship-payloads-manager",["exports","ember","ember-data/-private/system/relationships/relationship-payloads"],function(e,t,r){e.__esModule=!0;var i=t.default.get,n=function(){function e(e){this._store=e,this._cache=Object.create(null)}return e.prototype.get=function(e,t,r){var n=this._store._modelFor(e),a=i(n,"relationshipsByName"),o=this._getRelationshipPayloads(e,r,n,a,!1);return o&&o.get(e,t,r)},e.prototype.push=function(e,t,r){var n=this;if(r){var a=this._store._modelFor(e),o=i(a,"relationshipsByName");Object.keys(r).forEach(function(i){var s=n._getRelationshipPayloads(e,i,a,o,!0);s&&s.push(e,t,i,r[i])})}},e.prototype.unload=function(e,t){var r=this,n=this._store._modelFor(e),a=i(n,"relationshipsByName");a.forEach(function(i,o){var s=r._getRelationshipPayloads(e,o,n,a,!1);s&&s.unload(e,t,o)})},e.prototype._getRelationshipPayloads=function(e,t,r,i,n){if(i.has(t)){var a=e+":"+t;return!this._cache[a]&&n?this._initializeRelationshipPayloads(e,t,r,i):this._cache[a]}},e.prototype._initializeRelationshipPayloads=function(e,t,n,a){var o=a.get(t),s=n.inverseFor(t,this._store),l=void 0,d=void 0,u=void 0;s?(d=s.name,l=o.type,u=i(s.type,"relationshipsByName").get(d)):(l=d="",u=null);var c=e+":"+t,h=l+":"+d;return this._cache[c]=this._cache[h]=new r.default(this._store,e,t,o,l,d,u)},e}();e.default=n}),t("ember-data/-private/system/relationships/relationship-payloads",["exports"],function(e){e.__esModule=!0;var t=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}}(),r=function(){function e(e,t,r,i,n,a,o){this._store=e,this._lhsModelName=t,this._lhsRelationshipName=r,this._lhsRelationshipMeta=i,this._rhsModelName=n,this._rhsRelationshipName=a,this._rhsRelationshipMeta=o,this._lhsPayloads=Object.create(null),t!==n||r!==a?(this._rhsPayloads=Object.create(null),this._isReflexive=!1):(this._rhsPayloads=this._lhsPayloads,this._isReflexive=!0),this._pendingPayloads=[]}return e.prototype.get=function(e,t,r){return this._flushPending(),this._isLHS(e,r)?this._lhsPayloads[t]:this._rhsPayloads[t]},e.prototype.push=function(e,t,r,i){this._pendingPayloads.push([e,t,r,i])},e.prototype.unload=function(e,t,r){this._flushPending(),this._isLHS(e,r)?delete this._lhsPayloads[t]:delete this._rhsPayloads[t]},e.prototype._isLHS=function(e,t){return e===this._lhsModelName&&t===this._lhsRelationshipName},e.prototype._isRHS=function(e,t){return e===this._rhsModelName&&t===this._rhsRelationshipName},e.prototype._flushPending=function(){if(0!==this._pendingPayloads.length)for(var e=this._pendingPayloads.splice(0,this._pendingPayloads.length),t=0;t<e.length;++t){var r=e[t][0],i=e[t][1],n=e[t][2],a=e[t][3],o={data:{id:i,type:r}},s=void 0,l=void 0,d=void 0,u=void 0;this._isLHS(r,n)?(s=this._lhsPayloads[i],l=this._lhsPayloads,d=this._rhsPayloads,u=this._rhsRelationshipIsMany):(s=this._rhsPayloads[i],l=this._rhsPayloads,d=this._lhsPayloads,u=this._lhsRelationshipIsMany),this._removeInverse(i,s,d),l[i]=a,this._populateInverse(a,o,d,u)}},e.prototype._populateInverse=function(e,t,r,i){if(e.data)if(Array.isArray(e.data))for(var n=0;n<e.data.length;++n){var a=e.data[n].id;this._addToInverse(t,a,r,i)}else{var o=e.data.id;this._addToInverse(t,o,r,i)}},e.prototype._addToInverse=function(e,t,r,i){if(!this._isReflexive||e.data.id!==t){var n=r[t],a=n&&n.data;a?Array.isArray(a)?a.push(e.data):r[t]=e:r[t]=i?{data:[e.data]}:e}},e.prototype._removeInverse=function(e,t,r){var i=t&&t.data;if(i)if(Array.isArray(i))for(var n=0;n<i.length;++n)this._removeFromInverse(e,i[n].id,r);else this._removeFromInverse(e,i.id,r)},e.prototype._removeFromInverse=function(e,t,r){var i=r[t],n=i&&i.data;n&&(Array.isArray(n)?i.data=n.filter(function(t){return t.id!==e}):r[t]={data:null})},t(e,[{key:"_lhsRelationshipIsMany",get:function(){return this._lhsRelationshipMeta&&"hasMany"===this._lhsRelationshipMeta.kind}},{key:"_rhsRelationshipIsMany",get:function(){return this._rhsRelationshipMeta&&"hasMany"===this._rhsRelationshipMeta.kind}}]),e}();e.default=r}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i){function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(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)}e.__esModule=!0;var o=function(e){function i(t,r,i,a){var o=n(this,e.call(this,t,r,i,a));return o.internalModel=r,o.key=a.key,o.inverseInternalModel=null,o.canonicalState=null,o}return a(i,e),i.prototype.setInternalModel=function(e){e?this.addInternalModel(e):this.inverseInternalModel&&this.removeInternalModel(this.inverseInternalModel),this.setHasData(!0),this.setHasLoaded(!0)},i.prototype.setCanonicalInternalModel=function(e){e?this.addCanonicalInternalModel(e):this.canonicalState&&this.removeCanonicalInternalModel(this.canonicalState),this.flushCanonicalLater()},i.prototype.setInitialCanonicalInternalModel=function(e){e&&(this.canonicalMembers.add(e),this.members.add(e),this.inverseInternalModel=this.canonicalState=e,this.setupInverseRelationship(e))},i.prototype.addCanonicalInternalModel=function(t){this.canonicalMembers.has(t)||(this.canonicalState&&this.removeCanonicalInternalModel(this.canonicalState),this.canonicalState=t,e.prototype.addCanonicalInternalModel.call(this,t))},i.prototype.inverseDidDematerialize=function(){this.notifyBelongsToChanged()},i.prototype.flushCanonical=function(){this.inverseInternalModel&&this.inverseInternalModel.isNew()&&!this.canonicalState||(this.inverseInternalModel!==this.canonicalState&&(this.inverseInternalModel=this.canonicalState,this.notifyBelongsToChanged()),e.prototype.flushCanonical.call(this))},i.prototype.addInternalModel=function(t){this.members.has(t)||(this.inverseInternalModel&&this.removeInternalModel(this.inverseInternalModel),this.inverseInternalModel=t,e.prototype.addInternalModel.call(this,t),this.notifyBelongsToChanged())},i.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setInternalModel(t?t._internalModel:t)},i.prototype.removeInternalModelFromOwn=function(t){this.members.has(t)&&(this.inverseInternalModel=null,e.prototype.removeInternalModelFromOwn.call(this,t),this.notifyBelongsToChanged())},i.prototype.notifyBelongsToChanged=function(){this.internalModel.notifyBelongsToChanged(this.key)},i.prototype.removeCanonicalInternalModelFromOwn=function(t){this.canonicalMembers.has(t)&&(this.canonicalState=null,e.prototype.removeCanonicalInternalModelFromOwn.call(this,t))},i.prototype.findRecord=function(){return this.inverseInternalModel?this.store._findByInternalModel(this.inverseInternalModel):t.default.RSVP.Promise.resolve(null)},i.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t&&e.addInternalModel(t),t})},i.prototype.getRecord=function(){var e=this;if(this.isAsync){var t=void 0;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),r.PromiseObject.create({promise:t,content:this.inverseInternalModel?this.inverseInternalModel.getRecord():null})}if(null===this.inverseInternalModel)return null;var i=this.inverseInternalModel.getRecord();return i},i.prototype.reload=function(){return this.link?this.fetchLink():this.inverseInternalModel&&this.inverseInternalModel.hasRecord?this.inverseInternalModel.getRecord().reload():this.findRecord()},i.prototype.updateData=function(e,t){var r=this.store._pushResourceIdentifier(this,e);t?this.setInitialCanonicalInternalModel(r):this.setCanonicalInternalModel(r)},i}(i.default);e.default=o}),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"],function(e,t,r,i){function n(e){var t=e.options;return!(t&&null===t.inverse)}function a(e,t,a){var o=void 0,s=null;return n(t)&&(s=e.type.inverseFor(t.key,a)),s&&(o=s.name),"hasMany"===t.kind?new r.default(a,e,o,t):new i.default(a,e,o,t)}e.__esModule=!0;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=t.default.get,l=function(){function e(e){this.internalModel=e,this.initializedRelationships=Object.create(null)}return e.prototype.has=function(e){return!!this.initializedRelationships[e]},e.prototype.get=function(e){var t=this.initializedRelationships,r=t[e],i=this.internalModel;if(!r){var n=s(i.type,"relationshipsByName"),o=n.get(e);if(!o)return;var l=i.store._relationshipsPayloads.get(i.modelName,i.id,e);r=t[e]=a(i,o,i.store),l&&r.push(l,!0)}return r},o(e,[{key:"record",get:function(){return this.internalModel}}]),e}();e.default=l}),t("ember-data/-private/system/relationships/state/has-many",["exports","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,n){function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 i.default;if(e)for(var r=0,n=e.length;r<n;r++)t.add(e[r]);return t}e.__esModule=!0;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){function r(t,r,i,n){var o=a(this,e.call(this,t,r,i,n));return o.belongsToType=n.type,o.canonicalState=[],o.isPolymorphic=n.options.polymorphic,o._manyArray=null,o.__loadingPromise=null,o}return o(r,e),r.prototype._updateLoadingPromise=function(e,r){return this.__loadingPromise?(r&&this.__loadingPromise.set("content",r),this.__loadingPromise.set("promise",e)):this.__loadingPromise=new t.PromiseManyArray({promise:e,content:r}),this.__loadingPromise},r.prototype.removeInverseRelationships=function(){e.prototype.removeInverseRelationships.call(this),this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this._loadingPromise&&this._loadingPromise.destroy()},r.prototype.updateMeta=function(t){e.prototype.updateMeta.call(this,t),this._manyArray&&this._manyArray.set("meta",t)},r.prototype.addCanonicalInternalModel=function(t,r){this.canonicalMembers.has(t)||(void 0!==r?this.canonicalState.splice(r,0,t):this.canonicalState.push(t),e.prototype.addCanonicalInternalModel.call(this,t,r))},r.prototype.inverseDidDematerialize=function(){this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this.notifyHasManyChanged()},r.prototype.addInternalModel=function(t,r){this.members.has(t)||(e.prototype.addInternalModel.call(this,t,r),this.manyArray._addInternalModels([t],r))},r.prototype.removeCanonicalInternalModelFromOwn=function(t,r){var i=r;this.canonicalMembers.has(t)&&(void 0===i&&(i=this.canonicalState.indexOf(t)),i>-1&&this.canonicalState.splice(i,1),e.prototype.removeCanonicalInternalModelFromOwn.call(this,t,r))},r.prototype.flushCanonical=function(){this._manyArray&&this._manyArray.flushCanonical(),e.prototype.flushCanonical.call(this)},r.prototype.removeInternalModelFromOwn=function(t,r){if(this.members.has(t)){e.prototype.removeInternalModelFromOwn.call(this,t,r);var i=this.manyArray;void 0!==r?i.currentState.removeAt(r):i._removeInternalModels([t])}},r.prototype.notifyRecordRelationshipAdded=function(e,t){this.internalModel.notifyHasManyAdded(this.key,e,t)},r.prototype.reload=function(){var e=this.manyArray,t=e.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&e.set("isLoaded",t)}var r=void 0;return r=this.link?this.fetchLink():this.store._scheduleFetchMany(e.currentState).then(function(){return e}),this._updateLoadingPromise(r),this._loadingPromise},r.prototype.computeChanges=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.canonicalMembers,r=[],i=s(e);t.forEach(function(e){i.has(e)||r.push(e)}),this.removeCanonicalInternalModels(r);for(var n=0,a=e.length;n<a;n++){var o=e[n];this.removeCanonicalInternalModel(o),this.addCanonicalInternalModel(o,n)}},r.prototype.setInitialInternalModels=function(e){var t=this;if(e){var r=[0,this.canonicalState.length].concat(e);this.canonicalState.splice.apply(this.canonicalState,r),e.forEach(function(e){t.canonicalMembers.add(e),t.members.add(e),t.setupInverseRelationship(e)})}},r.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateInternalModelsFromAdapter(t),e.manyArray.set("isLoaded",!0)}),e.manyArray})},r.prototype.findRecords=function(){var e=this.manyArray,t=e.currentState;return this.store.findMany(t).then(function(){return e.get("isDestroyed")||e.set("isLoaded",!0),e})},r.prototype.notifyHasManyChanged=function(){this.internalModel.notifyHasManyAdded(this.key)},r.prototype.getRecords=function(){var e=this,t=this.manyArray;if(this.isAsync){var r=void 0;return r=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._updateLoadingPromise(r,t)}return t.get("isDestroyed")||t.set("isLoaded",!0),t},r.prototype.updateData=function(e,t){var r=this.store._pushResourceIdentifiers(this,e);t?this.setInitialInternalModels(r):this.updateInternalModelsFromAdapter(r)},l(r,[{key:"_loadingPromise",get:function(){return this.__loadingPromise}},{key:"manyArray",get: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.internalModel,meta:this.meta,isPolymorphic:this.isPolymorphic})),this._manyArray}}]),r}(r.default);e.default=d}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember-data/-private/system/ordered-set","ember-data/-private/system/normalize-link"],function(e,t,r){e.__esModule=!0;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}}(),n=function(){function e(e,r,i,n){var a=n.options.async,o=n.options.polymorphic;this.members=new t.default,this.canonicalMembers=new t.default,this.store=e,this.key=n.key,this.inverseKey=i,this.internalModel=r,this.isAsync=void 0===a||a,this.isPolymorphic=void 0===o||o,this.relationshipMeta=n,this.inverseKeyForImplicit=this.internalModel.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}return e.prototype.removeInverseRelationships=function(){var e=this;if(this.inverseKey){this.members.toArray().concat(this.canonicalMembers.toArray()).forEach(function(t){t._relationships.get(e.inverseKey).inverseDidDematerialize()})}},e.prototype.inverseDidDematerialize=function(){},e.prototype.updateMeta=function(e){this.meta=e},e.prototype.clear=function(){for(var e=this.members.list;e.length>0;){var t=e[0];this.removeInternalModel(t)}for(var r=this.canonicalMembers.list;r.length>0;){var i=r[0];this.removeCanonicalInternalModel(i)}},e.prototype.removeInternalModels=function(e){var t=this;e.forEach(function(e){return t.removeInternalModel(e)})},e.prototype.addInternalModels=function(e,t){var r=this;e.forEach(function(e){r.addInternalModel(e,t),void 0!==t&&t++})},e.prototype.addCanonicalInternalModels=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalInternalModel(e[r],r+t):this.addCanonicalInternalModel(e[r])},e.prototype.addCanonicalInternalModel=function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.setupInverseRelationship(e)),this.flushCanonicalLater(),this.setHasData(!0)},e.prototype.setupInverseRelationship=function(t){if(this.inverseKey){var r=t._relationships,i=r.has(this.inverseKey),n=r.get(this.inverseKey);(i||this.isPolymorphic)&&n.addCanonicalInternalModel(this.internalModel)}else{var a=t._implicitRelationships,o=a[this.inverseKeyForImplicit];o||(o=a[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{}})),o.addCanonicalInternalModel(this.internalModel)}},e.prototype.removeCanonicalInternalModels=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalInternalModel(e[r],r+t):this.removeCanonicalInternalModel(e[r])},e.prototype.removeCanonicalInternalModel=function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalInternalModelFromOwn(e),this.inverseKey?this.removeCanonicalInternalModelFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalInternalModel(this.internalModel)),this.flushCanonicalLater()},e.prototype.addInternalModel=function(t,r){this.members.has(t)||(this.members.addWithIndex(t,r),this.notifyRecordRelationshipAdded(t,r),this.inverseKey?t._relationships.get(this.inverseKey).addInternalModel(this.internalModel):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{}})),t._implicitRelationships[this.inverseKeyForImplicit].addInternalModel(this.internalModel)),this.internalModel.updateRecordArrays()),this.setHasData(!0)},e.prototype.removeInternalModel=function(e){this.members.has(e)&&(this.removeInternalModelFromOwn(e),this.inverseKey?this.removeInternalModelFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeInternalModel(this.internalModel))},e.prototype.removeInternalModelFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeInternalModelFromOwn(this.internalModel)},e.prototype.removeInternalModelFromOwn=function(e){this.members.delete(e),this.notifyRecordRelationshipRemoved(e),this.internalModel.updateRecordArrays()},e.prototype.removeCanonicalInternalModelFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalInternalModelFromOwn(this.internalModel)},e.prototype.removeCanonicalInternalModelFromOwn=function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},e.prototype.flushCanonical=function(){var e=this.members.list;this.willSync=!1;for(var t=[],r=0;r<e.length;r++)e[r].isNew()&&t.push(e[r]);this.members=this.canonicalMembers.copy();for(var i=0;i<t.length;i++)this.members.add(t[i])},e.prototype.flushCanonicalLater=function(){this.willSync||(this.willSync=!0,this.store._updateRelationshipState(this))},e.prototype.updateLink=function(e){this.link=e,this.linkPromise=null,this.internalModel.notifyPropertyChange(this.key)},e.prototype.findLink=function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},e.prototype.updateInternalModelsFromAdapter=function(e){this.computeChanges(e)},e.prototype.notifyRecordRelationshipAdded=function(){},e.prototype.notifyRecordRelationshipRemoved=function(){},e.prototype.setHasData=function(e){this.hasData=e},e.prototype.setHasLoaded=function(e){this.hasLoaded=e},e.prototype.push=function(e,t){var i=!1,n=!1;if(e.meta&&this.updateMeta(e.meta),void 0!==e.data&&(i=!0,this.updateData(e.data,t)),e.links&&e.links.related){var a=(0,r.default)(e.links.related);a&&a.href&&a.href!==this.link&&(n=!0,this.updateLink(a.href,t))}i?(this.setHasData(!0),this.setHasLoaded(!0)):n&&this.setHasLoaded(!1)},e.prototype.updateData=function(){},i(e,[{key:"parentType",get:function(){return this.internalModel.modelName}}]),e}();e.default=n}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){e.__esModule=!0;var t=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}}(),r=function(){function e(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=null,this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}return e.prototype.snapshots=function(){return null!==this._snapshots?this._snapshots:(this._snapshots=this._recordArray._takeSnapshot(),this._snapshots)},t(e,[{key:"type",get:function(){return this._type||(this._type=this._recordArray.get("type"))}}]),e}();e.default=r}),t("ember-data/-private/system/snapshot",["exports","ember"],function(e,t){e.__esModule=!0;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=t.default.get,n=function(){function e(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._attributes=Object.create(null),this._belongsToRelationships=Object.create(null),this._belongsToIds=Object.create(null),this._hasManyRelationships=Object.create(null),this._hasManyIds=Object.create(null),this._internalModel=e;var n=e.getRecord();this.record=n,n.eachAttribute(function(e){return t._attributes[e]=i(n,e)}),this.id=e.id,this.adapterOptions=r.adapterOptions,this.include=r.include,this.modelName=e.modelName,this._changedAttributes=n.changedAttributes()}return e.prototype.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.")},e.prototype.attributes=function(){return t.default.copy(this._attributes)},e.prototype.changedAttributes=function(){for(var e=Object.create(null),r=Object.keys(this._changedAttributes),i=0,n=r.length;i<n;i++){var a=r[i];e[a]=t.default.copy(this._changedAttributes[a])}return e},e.prototype.belongsTo=function(e,r){var n=r&&r.id,a=void 0,o=void 0,s=void 0,l=void 0;if(n&&e in this._belongsToIds)return this._belongsToIds[e];if(!n&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(!(a=this._internalModel._relationships.get(e))||"belongsTo"!==a.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return s=i(a,"hasData"),o=i(a,"inverseInternalModel"),s&&(l=o&&!o.isDeleted()?n?i(o,"id"):o.createSnapshot():null),n?this._belongsToIds[e]=l:this._belongsToRelationships[e]=l,l},e.prototype.hasMany=function(e,r){var n=r&&r.ids,a=void 0,o=void 0,s=void 0,l=void 0;if(n&&e in this._hasManyIds)return this._hasManyIds[e];if(!n&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(!(a=this._internalModel._relationships.get(e))||"hasMany"!==a.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return s=i(a,"hasData"),o=i(a,"members"),s&&(l=[],o.forEach(function(e){e.isDeleted()||(n?l.push(e.id):l.push(e.createSnapshot()))})),n?this._hasManyIds[e]=l:this._hasManyRelationships[e]=l,l},e.prototype.eachAttribute=function(e,t){this.record.eachAttribute(e,t)},e.prototype.eachRelationship=function(e,t){this.record.eachRelationship(e,t)},e.prototype.serialize=function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)},r(e,[{key:"type",get:function(){return this._internalModel.modelClass}}]),e}();e.default=n}),t("ember-data/-private/system/store",["exports","ember","ember-data/-private/adapters/errors","ember-data/-private/system/model/model","ember-data/-private/system/normalize-model-name","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/relationships/relationship-payloads-manager","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/features"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,y,m,v){function b(e,t){
4
+ var r=e.then(function(e){return e.getRecord()});return(0,o.promiseObject)(r,t)}function _(e){return e.serializerFor("application")}function g(e,t,i,n){var a=n._internalModel,o=n.modelName,u=t._modelFor(o),c=e[i](t,u,n),h=(0,d.serializerForAdapter)(t,e,o),p="DS: Extract and notify about "+i+" completion of "+a;return c=N.resolve(c,p),c=(0,s._guard)(c,(0,s._bind)(s._objectIsAlive,t)),c=(0,s._guard)(c,(0,s._bind)(s._objectIsAlive,a)),c.then(function(e){return t._backburner.join(function(){var r=void 0,o=void 0;e&&(r=(0,l.normalizeResponseHelper)(h,t,u,e,n.id,i),r.included&&t._push({data:null,included:r.included}),o=r.data),t.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof r.InvalidError){var i=h.extractErrors(t,u,e,n.id);t.recordWasInvalid(a,i)}else t.recordWasError(a,e);throw e},p)}function R(e,t,r,i,n){var a=r.relationships[i].data;if(!a)return!1;var o=n[t.modelName];o||(o=n[t.modelName]=I(t.type,"inverseMap"));var s=o[i];if(void 0===s&&(s=t.type.inverseFor(i,e)),!s)return!1;var l=s,d=l.name;if(Array.isArray(a)){for(var u=0;u<a.length;++u){var c=e._internalModelsFor(a[u].type).get(a[u].id);if(c&&c._relationships.has(d))return!0}return!1}var h=e._internalModelsFor(a.type).get(a.id);return h&&h._relationships.has(d)}function M(e,t,r,i){var n=t._relationships;t.type.eachRelationship(function(a){if(r.relationships[a]){if(n.has(a)||R(e,t,r,a,i)){var o=r.relationships[a];n.get(a).push(o)}}})}e.__esModule=!0,e.Store=void 0;var A=t.default.A,F=t.default._Backburner,z=t.default.computed,k=t.default.copy,S=t.default.ENV,P=t.default.Error,I=t.default.get,T=(t.default.inspect,t.default.isNone),x=(t.default.isPresent,t.default.MapWithDefault),E=t.default.run,j=t.default.set,D=t.default.RSVP,O=t.default.Service,N=(t.default.typeOf,D.Promise),C=void 0;e.Store=C=O.extend({init:function(){this._super.apply(this,arguments),this._backburner=new F(["normalizeRelationships","syncRelationships","finished"]),this.recordArrayManager=new f.default({store:this}),this._identityMap=new a.default,this._pendingSave=[],this._instanceCache=new y.default((0,h.getOwner)(this),this),this._modelFactoryCache=Object.create(null),this._relationshipsPayloads=new u.default(this),this._pendingSave=[],this._updatedRelationships=[],this._pushedInternalModels=[],this._updatedInternalModels=[],this._pendingFetch=x.create({defaultValue:function(){return[]}}),this._instanceCache=new y.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=I(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=(0,n.default)(e),i=k(t)||Object.create(null);T(i.id)&&(i.id=this._generateId(r,i)),i.id=(0,p.default)(i.id);var a=this._buildInternalModel(r,i.id);a.loadedData();var o=a.getRecord(i);return a.eachRelationship(function(e,t){a._relationships.get(e).setHasData(!0)}),o},_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=(0,n.default)(e);return this.findRecord(i,t)},findRecord:function(e,t,r){var i=(0,n.default)(e),a=this._internalModelForId(i,t);return r=r||{},this.hasRecordForId(i,t)?b(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=this.adapterFor(e.modelName);return i.shouldReloadRecord(this,r)?this._scheduleFetch(e,t):!1===t.backgroundReload?N.resolve(e):((t.backgroundReload||i.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),N.resolve(e))},_findByInternalModel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.preload&&e.preloadData(t.preload),b(this._findEmptyInternalModel(e,t),"DS: Store#findRecord "+e.modelName+" with id: "+e.id)},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this._scheduleFetch(e,t):e.isLoading()?e._loadingPromise:N.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),i=(0,n.default)(e),a=0;a<t.length;a++)r[a]=this.findRecord(i,t[a]);return(0,o.promiseArray)(D.all(r).then(A,null,"DS: Store#findByIds of "+i+" complete"))},_fetchRecord:function(e,t){var r=e.modelName,i=this.adapterFor(r);return(0,c._find)(i,this,e.type,e.id,e,t)},_scheduleFetchMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._scheduleFetch(e[r]);return N.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.id,i=e.modelName,n=D.defer("Fetching "+i+"' with id: "+r),a={internalModel:e,resolver:n,options:t},o=n.promise;return e.loadingData(o),0===this._pendingFetch.size&&E.schedule("afterRender",this,this.flushAllPendingFetches),this._pendingFetch.get(i).push(a),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch.clear())},_flushPendingFetchForType:function(e,t){function r(e){var t=a._fetchRecord(e.internalModel,e.options);e.resolver.resolve(t)}function i(e,t){for(var r=Object.create(null),i=0,a=e.length;i<a;i++){var o=e[i],s=u[o.id];if(r[o.id]=o,s){s.resolver.resolve(o)}}for(var l=[],d=0,c=t.length;d<c;d++){var h=t[d];r[h.id]||l.push(h)}l.length&&n(l)}function n(e,t){for(var r=0,i=e.length;r<i;r++){var n=e[r],a=u[n.id];a&&a.resolver.reject(t||new Error("Expected: '"+n+"' to be present in the adapter provided payload, but it was not found."))}}for(var a=this,o=a.adapterFor(t),s=!!o.findMany&&o.coalesceFindRequests,l=e.length,d=new Array(l),u=Object.create(null),h=0;h<l;h++){var p=e[h],f=p.internalModel;d[h]=f,u[f.id]=p}if(s){for(var y=new Array(l),m=0;m<l;m++)y[m]=d[m].createSnapshot();for(var v=o.groupRecordsForFindMany(this,y),b=0,_=v.length;b<_;b++){for(var g=v[b],R=v[b].length,M=new Array(R),A=new Array(R),F=0;F<R;F++){var z=g[F]._internalModel;A[F]=z,M[F]=z.id}if(R>1)!function(e){(0,c._findMany)(o,a,t,M,e).then(function(t){i(t,e)}).catch(function(t){n(e,t)})}(A);else if(1===M.length){var k=u[A[0].id];r(k)}}}else for(var S=0;S<l;S++)r(e[S])},getReference:function(e,t){var r=(0,n.default)(e);return this._internalModelForId(r,t).recordReference},peekRecord:function(e,t){var r=(0,n.default)(e);return this.hasRecordForId(r,t)?this._internalModelForId(r,t).getRecord():null},_reloadRecord:function(e){var t=(e.id,e.modelName);this.adapterFor(t);return this._scheduleFetch(e)},hasRecordForId:function(e,t){var r=(0,n.default)(e),i=(0,p.default)(t),a=this._internalModelsFor(r).get(i);return!!a&&a.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=(0,p.default)(t),i=this._internalModelsFor(e).get(r);return i?i.cancelDestroy():i=this._buildInternalModel(e,r),i},_internalModelDidReceiveRelationshipData:function(e,t,r){this._relationshipsPayloads.push(e,t,r)},_internalModelDestroyed:function(e){this._removeFromIdMap(e),this._relationshipsPayloads.unload(e.modelName,e.id)},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findEmptyInternalModel(e[r]);return N.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,c._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,c._findBelongsTo)(i,this,e,t,r)},query:function(e,t){var r=(0,n.default)(e);return this._query(r,t)},_query:function(e,t,r){var i=this.adapterFor(e);return(0,o.promiseArray)((0,c._query)(i,this,e,t,r))},queryRecord:function(e,t){var r=(0,n.default)(e),i=this.adapterFor(r);return(0,o.promiseObject)((0,c._queryRecord)(i,this,e,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=(0,n.default)(e);return this._fetchAll(r,this.peekAll(r),t)},_fetchAll:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.adapterFor(e),n=this._internalModelsFor(e).metadata.since;if(r.reload)return j(t,"isUpdating",!0),(0,o.promiseArray)((0,c._findAll)(i,this,e,n,r));var a=t._createSnapshot(r);return i.shouldReloadAll(this,a)?(j(t,"isUpdating",!0),(0,o.promiseArray)((0,c._findAll)(i,this,e,n,r))):!1===r.backgroundReload?(0,o.promiseArray)(N.resolve(t)):((r.backgroundReload||i.shouldBackgroundReloadAll(this,a))&&(j(t,"isUpdating",!0),(0,c._findAll)(i,this,e,n,r)),(0,o.promiseArray)(N.resolve(t)))},_didUpdateAll:function(e){this.recordArrayManager._didUpdateAll(e)},didUpdateAll:function(e){return this._didUpdateAll(e)},peekAll:function(e){var t=(0,n.default)(e);return this.recordArrayManager.liveRecordArrayFor(t)},unloadAll:function(e){if(0===arguments.length)this._identityMap.clear();else{var t=(0,n.default)(e);this._internalModelsFor(t).clear()}},filter:function(e,t,r){S.ENABLE_DS_FILTER;var i=void 0,a=arguments.length,s=void 0,l=3===a,d=(0,n.default)(e);return l?i=this.query(d,t):2===arguments.length&&(r=t),s=l?this.recordArrayManager.createFilteredRecordArray(d,r,t):this.recordArrayManager.createFilteredRecordArray(d,r),i=i||N.resolve(s),(0,o.promiseArray)(i.then(function(){return s},null,"DS: Store#filter of "+d))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},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],n=i.snapshot,a=i.resolver,o=n._internalModel,s=this.adapterFor(o.modelName),l=void 0;if("root.deleted.saved"===o.currentState.stateName)return a.resolve();l=o.isNew()?"createRecord":o.isDeleted()?"deleteRecord":"updateRecord",a.resolve(g(s,this,l,n))}},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=(e.modelName,(0,p.default)(t.id));null!==r&&null===i||(this._internalModelsFor(e.modelName).set(i,e),e.setId(i))},_internalModelsFor: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,h.getOwner)(this),r=void 0;if(t.factoryFor){var n=t.factoryFor("mixin:"+e);r=n&&n.class}else r=t._lookupFactory("mixin:"+e);if(r){var a=i.default.extend(r);a.reopenClass({__isMixin:!0,__mixin:r}),t.register("model:"+e,a)}return this.modelFactoryFor(e)},modelFor:function(e){var t=(0,n.default)(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._modelFactoryCache[e];if(!t){if(t=this.modelFactoryFor(e),t||(t=this._modelForMixin(e)),!t)throw new P("No model was found for '"+e+"'");var r=(0,h.getOwner)(this).factoryFor?t.class:t;r.modelName=r.modelName||e,this._modelFactoryCache[e]=t}return t},modelFactoryFor:function(e){var t=(0,n.default)(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,n=void 0;if(r)for(i=0,n=r.length;i<n;i++)t._pushInternalModel(r[i]);if(Array.isArray(e.data)){n=e.data.length;var a=new Array(n);for(i=0;i<n;i++)a[i]=t._pushInternalModel(e.data[i]);return a}return null===e.data?null:t._pushInternalModel(e.data)})},_hasModelFor:function(e){var t=(0,h.getOwner)(this);return e=(0,n.default)(e),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){void 0!==t.relationships&&2===this._pushedInternalModels.push(e,t)&&this._backburner.schedule("normalizeRelationships",this,this._setupRelationships)},_setupRelationships:function(){for(var e=this._pushedInternalModels,t=Object.create(null),r=0,i=e.length;r<i;r+=2){M(this,e[r],e[r+1],t)}e.length=0},pushPayload:function(e,t){var r=void 0,i=void 0;if(t){i=t;var a=(0,n.default)(e);r=this.serializerFor(a)}else i=e,r=_(this);if((0,v.default)("ds-pushpayload-return"))return r.pushPayload(this,i);r.pushPayload(this,i)},normalize:function(e,t){var r=(0,n.default)(e),i=this.serializerFor(r),a=this._modelFor(r);return i.normalize(a,t)},_buildInternalModel:function(e,t,r){var i=this._internalModelsFor(e),n=new m.default(e,t,this,r);return i.add(n,t),n},buildInternalModel:function(e,t,r){return this._buildInternalModel(e,t,r)},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_removeFromIdMap:function(e){var t=this._internalModelsFor(e.modelName),r=e.id;t.remove(e,r)},adapterFor:function(e){var t=(0,n.default)(e);return this._instanceCache.get("adapter",t)},serializerFor:function(e){var t=(0,n.default)(e);return this._instanceCache.get("serializer",t)},lookupAdapter:function(e){return this.adapterFor(e)},lookupSerializer:function(e){return this.serializerFor(e)},willDestroy:function(){this._super.apply(this,arguments),this._pushedInternalModels=null,this.recordArrayManager.destroy(),this._instanceCache.destroy(),this.unloadAll()},_updateRelationshipState:function(e){var t=this;1===this._updatedRelationships.push(e)&&this._backburner.join(function(){t._backburner.schedule("syncRelationships",t,t._flushUpdatedRelationships)})},_flushUpdatedRelationships:function(){for(var e=this._updatedRelationships,t=0,r=e.length;t<r;t++)e[t].flushCanonical();e.length=0},_updateInternalModel:function(e){1===this._updatedInternalModels.push(e)&&E.schedule("actions",this,this._flushUpdatedInternalModels)},_flushUpdatedInternalModels:function(){for(var e=this._updatedInternalModels,t=0,r=e.length;t<r;t++)e[t]._triggerDeferredTriggers();e.length=0},_pushResourceIdentifier:function(e,t){if(!T(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!T(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=C,e.default=C}),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 n(e){return!(a(e,"isDestroyed")||a(e,"isDestroying"))}e.__esModule=!0,e._bind=r,e._guard=i,e._objectIsAlive=n;var a=t.default.get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember"],function(e,t){e.__esModule=!0;var r=t.default.set,i=function(){function e(e,t){this.isDestroying=!1,this.isDestroyed=!1,this._owner=e,this._store=t,this._namespaces={adapter:Object.create(null),serializer:Object.create(null)}}return e.prototype.get=function(e,t){var i=this._namespaces[e];if(i[t])return i[t];var n=e+":"+t,a=this._instanceFor(n)||this._findInstance(e,this._fallbacksFor(e,t));return a&&(i[t]=a,r(a,"store",this._store)),i[t]},e.prototype._fallbacksFor=function(e,t){return"adapter"===e?["application",this._store.get("adapter"),"-json-api"]:["application",this.get("adapter",t).get("defaultSerializer"),"-default"]},e.prototype._findInstance=function(e,t){for(var r=this._namespaces[e],i=0,n=t.length;i<n;i++){var a=t[i];if(r[a])return r[a];var o=e+":"+a,s=this._instanceFor(o);if(s)return r[a]=s,s}},e.prototype._instanceFor=function(e){return this._owner.lookup(e)},e.prototype.destroyCache=function(e){for(var t=Object.keys(e),r=0,i=t.length;r<i;r++){var n=t[r],a=e[n];a&&a.destroy()}},e.prototype.destroy=function(){this.isDestroying=!0,this.destroyCache(this._namespaces.adapter),this.destroyCache(this._namespaces.serializer),this.isDestroyed=!0},e.prototype.toString=function(){return"ContainerInstanceCache"},e}();e.default=i}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i,n){function a(e,t,a,o,s,l){var d=s.createSnapshot(l),u=s.modelName,c=e.findRecord(t,a,o,d),p="DS: Handle Adapter#findRecord of '"+u+"' with id: '"+o+"'";return c=h.resolve(c,p),c=(0,r._guard)(c,(0,r._bind)(r._objectIsAlive,t)),c.then(function(r){var s=(0,n.serializerForAdapter)(t,e,u),l=(0,i.normalizeResponseHelper)(s,t,a,r,o,"findRecord");return t._push(l)},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+u+"'")}function o(e,a,o,s,l){var d=t.default.A(l).invoke("createSnapshot"),u=a.modelFor(o),c=e.findMany(a,u,s,d),p="DS: Handle Adapter#findMany of '"+o+"'";if(void 0===c)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return c=h.resolve(c,p),c=(0,r._guard)(c,(0,r._bind)(r._objectIsAlive,a)),c.then(function(t){var r=(0,n.serializerForAdapter)(a,e,o),s=(0,i.normalizeResponseHelper)(r,a,u,t,null,"findMany");return a._push(s)},null,"DS: Extract payload of "+o)}function s(e,t,a,o,s){var l=a.createSnapshot(),d=t.modelFor(s.type),u=e.findHasMany(t,l,o,s),c="DS: Handle Adapter#findHasMany of '"+a.modelName+"' : '"+s.type+"'";return u=h.resolve(u,c),u=(0,r._guard)(u,(0,r._bind)(r._objectIsAlive,t)),u=(0,r._guard)(u,(0,r._bind)(r._objectIsAlive,a)),u.then(function(r){var a=(0,n.serializerForAdapter)(t,e,s.type),o=(0,i.normalizeResponseHelper)(a,t,d,r,null,"findHasMany"),l=t._push(o);return l.meta=o.meta,l},null,"DS: Extract payload of '"+a.modelName+"' : hasMany '"+s.type+"'")}function l(e,t,a,o,s){var l=a.createSnapshot(),d=t.modelFor(s.type),u=e.findBelongsTo(t,l,o,s),c="DS: Handle Adapter#findBelongsTo of "+a.modelName+" : "+s.type;return u=h.resolve(u,c),u=(0,r._guard)(u,(0,r._bind)(r._objectIsAlive,t)),u=(0,r._guard)(u,(0,r._bind)(r._objectIsAlive,a)),u.then(function(r){var a=(0,n.serializerForAdapter)(t,e,s.type),o=(0,i.normalizeResponseHelper)(a,t,d,r,null,"findBelongsTo");return o.data?t._push(o):null},null,"DS: Extract payload of "+a.modelName+" : "+s.type)}function d(e,t,a,o,s){var l=t.modelFor(a),d=t.peekAll(a),u=d._createSnapshot(s),c=e.findAll(t,l,o,u),p="DS: Handle Adapter#findAll of "+l;return c=h.resolve(c,p),c=(0,r._guard)(c,(0,r._bind)(r._objectIsAlive,t)),c.then(function(r){var o=(0,n.serializerForAdapter)(t,e,a),s=(0,i.normalizeResponseHelper)(o,t,l,r,null,"findAll");return t._push(s),t._didUpdateAll(a),d},null,"DS: Extract payload of findAll ${modelName}")}function u(e,t,a,o,s){var l=t.modelFor(a),d=void 0;e.query.length>3?(s=s||t.recordArrayManager.createAdapterPopulatedRecordArray(a,o),d=e.query(t,l,o,s)):d=e.query(t,l,o);var u="DS: Handle Adapter#query of "+l;return d=h.resolve(d,u),d=(0,r._guard)(d,(0,r._bind)(r._objectIsAlive,t)),d.then(function(r){var d=(0,n.serializerForAdapter)(t,e,a),u=(0,i.normalizeResponseHelper)(d,t,l,r,null,"query"),c=t._push(u);return s?s._setInternalModels(c,u):s=t.recordArrayManager.createAdapterPopulatedRecordArray(a,o,c,u),s},null,"DS: Extract payload of query "+a)}function c(e,t,a,o){var s=t.modelFor(a),l=e.queryRecord(t,s,o),d="DS: Handle Adapter#queryRecord of "+a;return l=h.resolve(l,d),l=(0,r._guard)(l,(0,r._bind)(r._objectIsAlive,t)),l.then(function(r){var o=(0,n.serializerForAdapter)(t,e,a),l=(0,i.normalizeResponseHelper)(o,t,s,r,null,"queryRecord");return t._push(l)},null,"DS: Extract payload of queryRecord "+a)}e.__esModule=!0,e._find=a,e._findMany=o,e._findHasMany=s,e._findBelongsTo=l,e._findAll=d,e._query=u,e._queryRecord=c;var h=t.default.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember"],function(e,t){function r(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 i(e,t,r,i,n,a){var o=e.normalizeResponse(t,r,i,n,a);return o}e.__esModule=!0,e.validateDocumentStructure=r,e.normalizeResponseHelper=i}),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.__esModule=!0,e.serializerForAdapter=t}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return n(e,"attributes").has("type")||n(e,"relationshipsByName").has("type")}function i(e){var r=void 0;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}e.__esModule=!0,e.getOwner=e.modelHasAttributeOrRelationshipNamedType=void 0;var n=t.default.get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=i}),t("ember-data/-private/utils/parse-response-headers",["exports"],function(e){function t(e){var t=Object.create(null);if(!e)return t;for(var i=e.split(r),n=0;n<i.length;n++){for(var a=i[n],o=0,s=!1;o<a.length;o++)if(58===a.charCodeAt(o)){s=!0;break}if(!1===s)break;var l=a.substring(0,o).trim(),d=a.substring(o+1,a.length).trim();d&&(t[l]=d)}return t}e.__esModule=!0,e.default=t;var r="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){e.__esModule=!0,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-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"AdapterError",{enumerable:!0,get:function(){return t.AdapterError}}),Object.defineProperty(e,"InvalidError",{enumerable:!0,get:function(){return t.InvalidError}}),Object.defineProperty(e,"UnauthorizedError",{enumerable:!0,get:function(){return t.UnauthorizedError}}),Object.defineProperty(e,"ForbiddenError",{enumerable:!0,get:function(){return t.ForbiddenError}}),Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return t.NotFoundError}}),Object.defineProperty(e,"ConflictError",{enumerable:!0,get:function(){return t.ConflictError}}),Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return t.ServerError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return t.TimeoutError}}),Object.defineProperty(e,"AbortError",{enumerable:!0,get:function(){return t.AbortError}}),Object.defineProperty(e,"errorsHashToArray",{enumerable:!0,get:function(){return t.errorsHashToArray}}),Object.defineProperty(e,"errorsArrayToHash",{enumerable:!0,get:function(){return t.errorsArrayToHash}})}),t("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest","ember-data/-private"],function(e,t,r,i){e.__esModule=!0;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 n=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),n&&n(e)},i},coalesceFindRequests:!1,findMany:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var a=this.buildURL(t.modelName,r,n,"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){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var n={};e.serializerFor(t.modelName).serializeIntoHash(n,t,r,{includeId:!0});var a=this.buildURL(t.modelName,r.id,r,"updateRecord");return this.ajax(a,"PATCH",{data:n})},_hasCustomizedAjax:function(){return this.ajax!==n.prototype.ajax||this.ajaxOptions!==n.prototype.ajaxOptions}});(0,i.isEnabled)("ds-improved-ajax")&&n.reopen({methodForRequest:function(e){return"updateRecord"===e.requestType?"PATCH":this._super.apply(this,arguments)},dataForRequest:function(e){var t=e.requestType,r=e.ids;if("findMany"===t)return{filter:{id:r.join(",")}};if("updateRecord"===t){var i=e.store,n=e.type,a=e.snapshot,o={};return i.serializerFor(n.modelName).serializeIntoHash(o,n,a,{includeId:!0}),o}return this._super.apply(this,arguments)},headersForRequest:function(){var e=this._super.apply(this,arguments)||{};return e.Accept="application/vnd.api+json",e},_requestToJQueryAjaxHash:function(){var e=this._super.apply(this,arguments);return e.contentType&&(e.contentType="application/vnd.api+json"),e}}),e.default=n}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/-private"],function(e,t,r,i){function n(e,t,r,n){var a=void 0;try{a=e.handleResponse(t.status,(0,i.parseResponseHeaders)(t.getAllResponseHeaders()),r,n)}catch(e){return d.reject(e)}return a&&a.isAdapterError?d.reject(a):a}function a(e,t,r,n){var a=void 0;if(n.errorThrown instanceof Error)a=n.errorThrown;else if("timeout"===n.textStatus)a=new i.TimeoutError;else if("abort"===n.textStatus||0===t.status)a=new i.AbortError;else try{a=e.handleResponse(t.status,(0,i.parseResponseHeaders)(t.getAllResponseHeaders()),e.parseErrorResponse(t.responseText)||n.errorThrown,r)}catch(e){a=e}return a}function o(e,t){return"function"!=typeof String.prototype.endsWith?-1!==e.indexOf(t,e.length-t.length):e.endsWith(t)}e.__esModule=!0;var s=t.default.MapWithDefault,l=t.default.get,d=t.default.RSVP.Promise,u=r.default.extend(i.BuildURLMixin,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},n=t.sort(),a=0;a<r;a++)i[n[a]]=e[n[a]];return i},coalesceFindRequests:!1,findRecord:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,id:r,snapshot:n,requestType:"findRecord"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,r,n,"findRecord"),s=this.buildQuery(n);return this.ajax(o,"GET",{data:s})},findAll:function(e,t,r,n){var a=this.buildQuery(n);if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var o=this._requestFor({store:e,type:t,sinceToken:r,query:a,snapshots:n,requestType:"findAll"});return this._makeRequest(o)}var s=this.buildURL(t.modelName,null,n,"findAll");return r&&(a.since=r),this.ajax(s,"GET",{data:a})},query:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,query:r,requestType:"query"});return this._makeRequest(n)}var a=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},queryRecord:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,query:r,requestType:"queryRecord"});return this._makeRequest(n)}var a=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},findMany:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,ids:r,snapshots:n,requestType:"findMany"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,r,n,"findMany");return this.ajax(o,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:r,relationship:n,requestType:"findHasMany"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return r=this.urlPrefix(r,this.buildURL(s,o,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,n){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:r,relationship:n,requestType:"findBelongsTo"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return r=this.urlPrefix(r,this.buildURL(s,o,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:r,requestType:"createRecord"});return this._makeRequest(n)}var a={},o=e.serializerFor(t.modelName),s=this.buildURL(t.modelName,null,r,"createRecord");return o.serializeIntoHash(a,t,r,{includeId:!0}),this.ajax(s,"POST",{data:a})},updateRecord:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:r,requestType:"updateRecord"});return this._makeRequest(n)}var a={};e.serializerFor(t.modelName).serializeIntoHash(a,t,r);var o=r.id,s=this.buildURL(t.modelName,o,r,"updateRecord");return this.ajax(s,"PUT",{data:a})},deleteRecord:function(e,t,r){if((0,i.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:r,requestType:"deleteRecord"});return this._makeRequest(n)}var a=r.id;return this.ajax(this.buildURL(t.modelName,a,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),n=i[i.length-1],a=t.id;return decodeURIComponent(n)===a?i[i.length-1]="":o(n,"?id="+a)&&(i[i.length-1]=n.substring(0,n.length-a.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var a=0,o=n._stripIDFromURL(e,t[0]),s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;o.length+a+t>=r&&(a=0,s.push([])),a+=t;var n=s.length-1;s[n].push(e)}),s}var i=s.create({defaultValue:function(){return[]}}),n=this,a=this.maxURLLength;t.forEach(function(t){var r=n._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){r(e,a,"&ids%5B%5D=".length).forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,n){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new i.InvalidError(r.errors);var a=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,n);if((0,i.isEnabled)("ds-extended-errors"))switch(e){case 401:return new i.UnauthorizedError(a,o);case 403:return new i.ForbiddenError(a,o);case 404:return new i.NotFoundError(a,o);case 409:return new i.ConflictError(a,o);default:if(e>=500)return new i.ServerError(a,o)}return new i.AdapterError(a,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 o=this,s={url:e,method:r};return new d(function(l,d){var u=o.ajaxOptions(e,r,i);u.success=function(e,r,i){var a=n(o,i,e,s);t.default.run.join(null,l,a)},u.error=function(e,r,i){var n={textStatus:r,errorThrown:i},l=a(o,e,s,n);t.default.run.join(null,d,l)},
5
+ o._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 n=l(this,"headers");return void 0!==n&&(i.beforeSend=function(e){Object.keys(n).forEach(function(t){return e.setRequestHeader(t,n[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 n=void 0,a=t["Content-Type"]||"Empty Content-Type";return n="text/html"===a&&r.length>250?"[Omitted Lengthy HTML]":r,["Ember Data Request "+i.method+" "+i.url+" returned a "+e,"Payload ("+a+")",n].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t},_hasCustomizedAjax:function(){return this.ajax!==u.prototype.ajax||this.ajaxOptions!==u.prototype.ajaxOptions}});(0,i.isEnabled)("ds-improved-ajax")&&u.reopen({dataForRequest:function(e){var t=e.store,r=e.type,i=e.snapshot,n=e.requestType,a=e.query;r=r||i&&i.type;var o=t.serializerFor(r.modelName),s={};switch(n){case"createRecord":o.serializeIntoHash(s,r,i,{includeId:!0});break;case"updateRecord":o.serializeIntoHash(s,r,i);break;case"findRecord":s=this.buildQuery(i);break;case"findAll":e.sinceToken&&(a=a||{},a.since=e.sinceToken),s=a;break;case"query":case"queryRecord":this.sortQueryParams&&(a=this.sortQueryParams(a)),s=a;break;case"findMany":s={ids:e.ids};break;default:s=void 0}return s},methodForRequest:function(e){switch(e.requestType){case"createRecord":return"POST";case"updateRecord":return"PUT";case"deleteRecord":return"DELETE"}return"GET"},urlForRequest:function(e){var t=e.type,r=e.id,i=e.ids,n=e.snapshot,a=e.snapshots,o=e.requestType,s=e.query;switch(t=t||n&&n.type,r=r||n&&n.id,o){case"findAll":return this.buildURL(t.modelName,null,a,o);case"query":case"queryRecord":return this.buildURL(t.modelName,null,null,o,s);case"findMany":return this.buildURL(t.modelName,i,a,o);case"findHasMany":case"findBelongsTo":var l=this.buildURL(t.modelName,r,n,o);return this.urlPrefix(e.url,l)}return this.buildURL(t.modelName,r,n,o,s)},headersForRequest:function(e){return this.get("headers")},_requestFor:function(e){return{method:this.methodForRequest(e),url:this.urlForRequest(e),headers:this.headersForRequest(e),data:this.dataForRequest(e)}},_requestToJQueryAjaxHash:function(e){var t={};t.type=e.method,t.url=e.url,t.dataType="json",t.context=this,e.data&&("GET"!==e.method?(t.contentType="application/json; charset=utf-8",t.data=JSON.stringify(e.data)):t.data=e.data);var r=e.headers;return void 0!==r&&(t.beforeSend=function(e){Object.keys(r).forEach(function(t){return e.setRequestHeader(t,r[t])})}),t},_makeRequest:function(e){var r=this,i=this._requestToJQueryAjaxHash(e),o=e.method,s=e.url,l={method:o,url:s};return new t.default.RSVP.Promise(function(e,o){i.success=function(i,a,o){var s=n(r,o,i,l);t.default.run.join(null,e,s)},i.error=function(e,i,n){var s={textStatus:i,errorThrown:n},d=a(r,e,l,s);t.default.run.join(null,o,d)},r._ajaxRequest(i)},"DS: RESTAdapter#makeRequest: "+o+" "+s)}}),e.default=u}),t("ember-data/attr",["exports","ember"],function(e,t){function r(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var i=t.defaultValue;return i}function i(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 a(e,a){"object"==typeof e?(a=e,e=void 0):a=a||{};var o={type:e,isAttribute:!0,options:a};return t.default.computed({get:function(e){var t=this._internalModel;return i(t,e)?n(t,e):r(this,a,e)},set:function(e,t){var r=this._internalModel,i=n(r,e),a=void 0;return t!==i&&(r._attributes[e]=t,a=e in r._inFlightAttributes?r._inFlightAttributes[e]:r._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:i,originalValue:a,value:t})),t}}).meta(o)}e.__esModule=!0,e.default=a}),t("ember-data",["exports","ember","ember-data/-private","ember-data/setup-container","ember-data/instance-initializers/initialize-store-service","ember-data/transforms/transform","ember-data/transforms/number","ember-data/transforms/date","ember-data/transforms/string","ember-data/transforms/boolean","ember-data/adapter","ember-data/adapters/json-api","ember-data/adapters/rest","ember-data/serializer","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest","ember-data/serializers/embedded-records-mixin","ember-data/attr","ember-inflector"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,y,m,v,b){if(e.__esModule=!0,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.");r.DS.Store=r.Store,r.DS.PromiseArray=r.PromiseArray,r.DS.PromiseObject=r.PromiseObject,r.DS.PromiseManyArray=r.PromiseManyArray,r.DS.Model=r.Model,r.DS.RootState=r.RootState,r.DS.attr=b.default,r.DS.Errors=r.Errors,r.DS.InternalModel=r.InternalModel,r.DS.Snapshot=r.Snapshot,r.DS.Adapter=u.default,r.DS.AdapterError=r.AdapterError,r.DS.InvalidError=r.InvalidError,r.DS.TimeoutError=r.TimeoutError,r.DS.AbortError=r.AbortError,(0,r.isEnabled)("ds-extended-errors")&&(r.DS.UnauthorizedError=r.UnauthorizedError,r.DS.ForbiddenError=r.ForbiddenError,r.DS.NotFoundError=r.NotFoundError,r.DS.ConflictError=r.ConflictError,r.DS.ServerError=r.ServerError),r.DS.errorsHashToArray=r.errorsHashToArray,r.DS.errorsArrayToHash=r.errorsArrayToHash,r.DS.Serializer=p.default,r.DS.DebugAdapter=r.DebugAdapter,r.DS.RecordArray=r.RecordArray,r.DS.FilteredRecordArray=r.FilteredRecordArray,r.DS.AdapterPopulatedRecordArray=r.AdapterPopulatedRecordArray,r.DS.ManyArray=r.ManyArray,r.DS.RecordArrayManager=r.RecordArrayManager,r.DS.RESTAdapter=h.default,r.DS.BuildURLMixin=r.BuildURLMixin,r.DS.RESTSerializer=m.default,r.DS.JSONSerializer=y.default,r.DS.JSONAPIAdapter=c.default,r.DS.JSONAPISerializer=f.default,r.DS.Transform=a.default,r.DS.DateTransform=s.default,r.DS.StringTransform=l.default,r.DS.NumberTransform=o.default,r.DS.BooleanTransform=d.default,r.DS.EmbeddedRecordsMixin=v.default,r.DS.belongsTo=r.belongsTo,r.DS.hasMany=r.hasMany,r.DS.Relationship=r.Relationship,r.DS._setupContainer=i.default,r.DS._initializeStoreService=n.default,Object.defineProperty(r.DS,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:r.normalizeModelName}),Object.defineProperty(r.global,"DS",{configurable:!0,get:function(){return r.DS}}),e.default=r.DS}),t("ember-data/initializers/data-adapter",["exports"],function(e){e.__esModule=!0,e.default={name:"data-adapter",before:"store",initialize:function(){}}}),t("ember-data/initializers/ember-data",["exports","ember-data/setup-container","ember-data/index"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/initializers/injectStore",["exports"],function(e){e.__esModule=!0,e.default={name:"injectStore",before:"store",initialize:function(){}}}),t("ember-data/initializers/store",["exports"],function(e){e.__esModule=!0,e.default={name:"store",after:"ember-data",initialize:function(){}}}),t("ember-data/initializers/transforms",["exports"],function(e){e.__esModule=!0,e.default={name:"transforms",before:"store",initialize:function(){}}}),t("ember-data/instance-initializers/ember-data",["exports","ember-data/instance-initializers/initialize-store-service"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/instance-initializers/initialize-store-service",["exports"],function(e){function t(e){(e.lookup?e:e.container).lookup("service:store")}e.__esModule=!0,e.default=t}),t("ember-data/model",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Model}})}),t("ember-data/relationships",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"belongsTo",{enumerable:!0,get:function(){return t.belongsTo}}),Object.defineProperty(e,"hasMany",{enumerable:!0,get:function(){return t.hasMany}})}),t("ember-data/serializer",["exports","ember"],function(e,t){e.__esModule=!0,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"],function(e,t){function r(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)}e.__esModule=!0;var i=t.default.get,n=t.default.set,a=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 n=this.hasSerializeIdsOption(i),a=this.hasSerializeRecordsOption(i),o=e.belongsTo(i);if(n){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 a&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),n=this._getMappedKey(r.key,e.type);n===r.key&&this.keyForRelationship&&(n=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[n]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[n]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[n]=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 n=this._getMappedKey(r.key,e.type);n===r.key&&this.keyForRelationship&&(n=this.keyForRelationship(r.key,r.kind,"serialize")),t[n]=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 n=this.keyForAttribute(i.key,"serialize"),a=e.hasMany(i.key);r[n]=t.default.A(a).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),n=t.default.A(i),a=new Array(n.length),o=0;o<n.length;o++){var s=n[o],l=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,l),a[o]=l}return a},removeEmbeddedForeignKey:function(e,t,r,i){if("belongsTo"===r.kind){var n=e.type.inverseFor(r.key,this.store);if(n){var a=n.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(a,n.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[a(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var n=this;return r.eachRelationship(function(r,a){e.hasDeserializeRecordsOption(r)&&("hasMany"===a.kind&&n._extractEmbeddedHasMany(t,r,i,a),"belongsTo"===a.kind&&n._extractEmbeddedBelongsTo(t,r,i,a))}),i},_extractEmbeddedHasMany:function(e,t,a,o){var s=i(a,"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,p=c.included;if(a.included=a.included||[],a.included.push(h),p){var f;(f=a.included).push.apply(f,r(p))}l[d]={id:h.id,type:h.type}}n(a,"data.relationships."+t,{data:l})}},_extractEmbeddedBelongsTo:function(e,t,a,o){var s=i(a,"data.relationships."+t+".data");if(s){var l=this._normalizeEmbeddedRelationship(e,o,s),d=l.data,u=l.included;if(a.included=a.included||[],a.included.push(d),u){var c;(c=a.included).push.apply(c,r(u))}var h={id:d.id,type:d.type};n(a,"data.relationships."+t,{data:h})}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var n=e.modelFor(i);return e.serializerFor(i).normalize(n,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-inflector","ember-data/serializers/json","ember-data/-private"],function(e,t,r,i,n){e.__esModule=!0;var a=t.default.String.dasherize,o=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 n=e.data[i];r[i]=this._normalizeResourceHelper(n)}e.data=r}if(Array.isArray(e.included)){for(var a=new Array(e.included.length),o=0;o<e.included.length;o++){var s=e.included[o];a[o]=this._normalizeResourceHelper(s)}e.included=a}return e},_normalizeRelationshipDataHelper:function(e){if((0,n.isEnabled)("ds-payload-type-hooks")){var t=this.modelNameFromPayloadType(e.type),r=this.modelNameFromPayloadKey(e.type);t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r),e.type=t}else e.type=this.modelNameFromPayloadKey(e.type);return e},_normalizeResourceHelper:function(e){var t=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){t=this.modelNameFromPayloadType(e.type);var r=this.modelNameFromPayloadKey(e.type);"modelNameFromPayloadType",t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r,"modelNameFromPayloadKey")}else t=this.modelNameFromPayloadKey(e.type),"modelNameFromPayloadKey";if(!this.store._hasModelFor(t))return null;var i=this.store._modelFor(t);return this.store.serializerFor(t).normalize(i,e).data},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);if((0,n.isEnabled)("ds-pushpayload-return"))return e.push(r);e.push(r)},_normalizeResponse:function(e,t,r,i,n,a){return this._normalizeDocumentHelper(r)},normalizeQueryRecordResponse:function(){var e=this._super.apply(this,arguments);return e},extractAttributes:function(e,t){var r=this,i={};return t.attributes&&e.eachAttribute(function(e){var n=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[n]&&(i[e]=t.attributes[n])}),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 n=e.data[i];r[i]=this._normalizeRelationshipDataHelper(n)}e.data=r}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,n){var a=r.keyForRelationship(e,n.kind,"deserialize");if(void 0!==t.relationships[a]){var o=t.relationships[a];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){if((0,n.isEnabled)("ds-payload-type-hooks")){var r=this.modelNameFromPayloadType(t.type),i=this.modelNameFromPayloadKey(t.type);return r!==i&&this._hasCustomModelNameFromPayloadKey()&&(r=i),r}return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,r.singularize)((0,n.normalizeModelName)(e))},payloadKeyFromModelName:function(e){return(0,r.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 a(e)},keyForRelationship:function(e,t,r){return a(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),i=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){i=this.payloadTypeFromModelName(e.modelName);var a=this.payloadKeyFromModelName(e.modelName);i!==a&&this._hasCustomPayloadKeyFromModelName()&&(i=a)}else i=this.payloadKeyFromModelName(e.modelName);return r.type=i,{data:r}},serializeAttribute:function(e,t,r,i){var n=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var a=e.attr(r);if(n){a=this.transformFor(n).serialize(a,i.options)}var o=this._getMappedKey(r,e.type);o===r&&(o=this.keyForAttribute(r,"serialize")),t.attributes[o]=a}},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 o=this._getMappedKey(i,e.type);o===i&&(o=this.keyForRelationship(i,"belongsTo","serialize"));var s=null;if(a){var l=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){l=this.payloadTypeFromModelName(a.modelName);var d=this.payloadKeyFromModelName(a.modelName);l!==d&&this._hasCustomPayloadKeyFromModelName()&&(l=d)}else l=this.payloadKeyFromModelName(a.modelName);s={type:l,id:a.id}}t.relationships[o]={data:s}}}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if((0,n.isEnabled)("ds-check-should-serialize-relationships")&&(a="shouldSerializeHasMany"),this[a](e,i,r)){var o=e.hasMany(i);if(void 0!==o){t.relationships=t.relationships||{};var s=this._getMappedKey(i,e.type);s===i&&this.keyForRelationship&&(s=this.keyForRelationship(i,"hasMany","serialize"));for(var l=new Array(o.length),d=0;d<o.length;d++){var u=o[d],c=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){c=this.payloadTypeFromModelName(u.modelName);var h=this.payloadKeyFromModelName(u.modelName);c!==h&&this._hasCustomPayloadKeyFromModelName()&&(c=h)}else c=this.payloadKeyFromModelName(u.modelName);l[d]={type:c,id:u.id}}t.relationships[s]={data:l}}}}});(0,n.isEnabled)("ds-payload-type-hooks")&&o.reopen({modelNameFromPayloadType:function(e){return(0,r.singularize)((0,n.normalizeModelName)(e))},payloadTypeFromModelName:function(e){return(0,r.pluralize)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==o.prototype.modelNameFromPayloadKey},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==o.prototype.payloadKeyFromModelName}}),e.default=o}),t("ember-data/serializers/json",["exports","ember","ember-data/serializer","ember-data/-private"],function(e,t,r,i){function n(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)}e.__esModule=!0;var a=t.default.get,o=t.default.isNone,s=t.default.assign||t.default.merge,l=r.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=a(e,"attributes");return e.eachTransformedAttribute(function(e,n){if(void 0!==t[e]){var a=r.transformFor(n),o=i.get(e);t[e]=a.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,n){switch(n){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,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,n){return this._normalizeResponse(e,t,r,i,n,!0)},normalizeArrayResponse:function(e,t,r,i,n){return this._normalizeResponse(e,t,r,i,n,!1)},_normalizeResponse:function(e,t,r,i,a,o){var s={data:null,included:[]},l=this.extractMeta(e,t,r);if(l&&(s.meta=l),o){var d=this.normalize(t,r),u=d.data,c=d.included;s.data=u,c&&(s.included=c)}else{for(var h=new Array(r.length),p=0,f=r.length;p<f;p++){var y=r[p],m=this.normalize(t,y),v=m.data,b=m.included;if(b){var _;(_=s.included).push.apply(_,n(b))}h[p]=v}s.data=h}return s},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=a(this,"primaryKey"),n=t[r];return(0,i.coerceId)(n)},extractAttributes:function(e,t){var r=this,i=void 0,n={};return e.eachAttribute(function(e){i=r.keyForAttribute(e,"deserialize"),void 0!==t[i]&&(n[e]=t[i])}),n},extractRelationship:function(e,r){if(t.default.isNone(r))return null;if("object"===t.default.typeOf(r)){r.id&&(r.id=(0,i.coerceId)(r.id));var n=this.store.modelFor(e);if(r.type&&!(0,i.modelHasAttributeOrRelationshipNamedType)(n))if((0,i.isEnabled)("ds-payload-type-hooks")){var a=this.modelNameFromPayloadType(r.type),o=this.modelNameFromPayloadKey(r.type);a!==o&&this._hasCustomModelNameFromPayloadKey()&&(a=o),r.type=a}else r.type=this.modelNameFromPayloadKey(r.type);return r}return{id:(0,i.coerceId)(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var i=this,n={};return e.eachRelationship(function(e,a){var o=null,s=i.keyForRelationship(e,a.kind,"deserialize");if(void 0!==r[s]){var l=null,d=r[s];if("belongsTo"===a.kind)l=a.options.polymorphic?i.extractPolymorphicRelationship(a.type,d,{key:e,resourceHash:r,relationshipMeta:a}):i.extractRelationship(a.type,d);else if("hasMany"===a.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(a.type,h)}}o={data:l}}var p=i.keyForLink(e,a.kind);if(r.links&&void 0!==r.links[p]){var f=r.links[p];o=o||{},o.links={related:f}}o&&(n[e]=o)}),n},modelNameFromPayloadKey:function(e){return(0,i.normalizeModelName)(e)},normalizeRelationships:function(e,t){var r=this,i=void 0;this.keyForRelationship&&e.eachRelationship(function(e,n){i=r.keyForRelationship(e,n.kind,"deserialize"),e!==i&&void 0!==t[i]&&(t[e]=t[i],delete t[i])})},normalizeUsingDeclaredMapping:function(e,t){var r=a(this,"attrs"),i=void 0,n=void 0;if(r)for(var o in r)i=n=this._getMappedKey(o,e),void 0!==t[n]&&(a(e,"attributes").has(o)&&(i=this.keyForAttribute(o)),a(e,"relationshipsByName").has(o)&&(i=this.keyForRelationship(o)),n!==i&&(t[i]=t[n],delete t[n]))},_getMappedKey:function(e,t){var r=a(this,"attrs"),i=void 0;return r&&r[e]&&(i=r[e],i.key&&(i=i.key),"string"==typeof i&&(e=i)),e},_canSerialize:function(e){var t=a(this,"attrs");return!t||!t[e]||!1!==t[e].serialize},_mustSerialize:function(e){var t=a(this,"attrs");return t&&t[e]&&!0===t[e].serialize},shouldSerializeHasMany:function(e,t,r){return this._shouldSerializeHasMany,l.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,n={};if(t&&t.includeId)if((0,i.isEnabled)("ds-serialize-id"))this.serializeId(e,n,a(this,"primaryKey"));else{var o=e.id;o&&(n[a(this,"primaryKey")]=o)}return e.eachAttribute(function(t,i){r.serializeAttribute(e,n,t,i)}),e.eachRelationship(function(t,i){"belongsTo"===i.kind?r.serializeBelongsTo(e,n,i):"hasMany"===i.kind&&r.serializeHasMany(e,n,i)}),n},serializeIntoHash:function(e,t,r,i){s(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){if(this._canSerialize(r)){var n=i.type,a=e.attr(r);if(n){a=this.transformFor(n).serialize(a,i.options)}var o=this._getMappedKey(r,e.type);o===r&&this.keyForAttribute&&(o=this.keyForAttribute(r,"serialize")),t[o]=a}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var n=e.belongsTo(i,{id:!0}),a=this._getMappedKey(i,e.type);a===i&&this.keyForRelationship&&(a=this.keyForRelationship(i,"belongsTo","serialize")),o(n)?t[a]=null:t[a]=n,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var n=r.key,a="_shouldSerializeHasMany";if((0,i.isEnabled)("ds-check-should-serialize-relationships")&&(a="shouldSerializeHasMany"),this[a](e,n,r)){var o=e.hasMany(n,{ids:!0});if(void 0!==o){var s=this._getMappedKey(n,e.type);s===n&&this.keyForRelationship&&(s=this.keyForRelationship(n,"hasMany","serialize")),t[s]=o}}},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,n){var a=this;return r&&"object"==typeof r&&r.errors&&(r=(0,i.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=a.keyForAttribute(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=a.keyForRelationship(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var r=(0,i.getOwner)(this).lookup("transform:"+e);return r}});(0,i.isEnabled)("ds-payload-type-hooks")&&l.reopen({modelNameFromPayloadType:function(e){return(0,i.normalizeModelName)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==l.prototype.modelNameFromPayloadKey}}),(0,i.isEnabled)("ds-serialize-id")&&l.reopen({serializeId:function(e,t,r){var i=e.id;i&&(t[r]=i)}}),e.default=l}),t("ember-data/serializers/rest",["exports","ember","ember-inflector","ember-data/serializers/json","ember-data/-private"],function(e,t,r,i,n){function a(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)}e.__esModule=!0;var o=t.default.String.camelize,s=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,n){var o=this,s={data:[],included:[]},l=e.modelFor(r),d=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=o._normalizePolymorphicRecord(e,t,n,l,d),i=r.data,u=r.included;if(s.data.push(i),u){var c;(c=s.included).push.apply(c,a(u))}}),s},_normalizePolymorphicRecord:function(e,t,r,i,a){var o=a,s=i;if(!(0,n.modelHasAttributeOrRelationshipNamedType)(i)&&t.type){var l=void 0;if((0,n.isEnabled)("ds-payload-type-hooks")){l=this.modelNameFromPayloadType(t.type);var d=this.modelNameFromPayloadKey(t.type);l!==d&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(l=d)}else l=this.modelNameFromPayloadKey(t.type);e._hasModelFor(l)&&(o=e.serializerFor(l),s=e.modelFor(l))}return o.normalize(s,t,r)},_normalizeResponse:function(e,t,r,i,o,s){var l={data:null,included:[]},d=this.extractMeta(e,t,r);d&&(l.meta=d);for(var u=Object.keys(r),c=0,h=u.length;c<h;c++){var p=u[c],f=p,y=!1;"_"===p.charAt(0)&&(y=!0,f=p.substr(1));var m=this.modelNameFromPayloadKey(f);if(e.modelFactoryFor(m)){var v=!y&&this.isPrimaryType(e,m,t),b=r[p];if(null!==b){if(!v||Array.isArray(b)){var _=this._normalizeArray(e,m,b,p),g=_.data,R=_.included;if(R){var M;(M=l.included).push.apply(M,a(R))}if(s)g.forEach(function(e){var t=v&&(0,n.coerceId)(e.id)===i;v&&!i&&!l.data||t?l.data=e:l.included.push(e)});else if(v)l.data=g;else if(g){var A;(A=l.included).push.apply(A,a(g))}}else{var F=this._normalizePolymorphicRecord(e,b,p,t,this),z=F.data,k=F.included;if(l.data=z,k){var S;(S=l.included).push.apply(S,a(k))}}}}}return l},isPrimaryType:function(e,t,r){return e.modelFor(t)===r},pushPayload:function(e,r){var i={data:[],included:[]};for(var o in r){var s=this.modelNameFromPayloadKey(o);if(e.modelFactoryFor(s)){var l=e.modelFor(s),d=e.serializerFor(l.modelName);t.default.makeArray(r[o]).forEach(function(e){var t=d.normalize(l,e,o),r=t.data,n=t.included;if(i.data.push(r),n){var s;(s=i.included).push.apply(s,a(n))}})}}if((0,n.isEnabled)("ds-pushpayload-return"))return e.push(i);e.push(i)},modelNameFromPayloadKey:function(e){return(0,r.singularize)((0,n.normalizeModelName)(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 o(e)},serializePolymorphicType:function(e,r,i){var a=i.key,l=this.keyForPolymorphicType(a,i.type,"serialize"),d=e.belongsTo(a);a=this.keyForAttribute?this.keyForAttribute(a,"serialize"):a,a+="Type",a!==l&&this.keyForPolymorphicType===s.prototype.keyForPolymorphicType&&(l=a),t.default.isNone(d)?r[l]=null:(0,n.isEnabled)("ds-payload-type-hooks")?r[l]=this.payloadTypeFromModelName(d.modelName):r[l]=o(d.modelName)},extractPolymorphicRelationship:function(e,t,r){var i=r.key,a=r.resourceHash,o=r.relationshipMeta,s=o.options.polymorphic,l=this.keyForPolymorphicType(i,e,"deserialize");if(s&&void 0!==a[l]&&"object"!=typeof t){if((0,n.isEnabled)("ds-payload-type-hooks")){var d=a[l],u=this.modelNameFromPayloadType(d),c=this.modelNameFromPayloadKey(d);return d!==c&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(u=c),{id:t,type:u}}return{id:t,type:this.modelNameFromPayloadKey(a[l])}}return this._super.apply(this,arguments)}});(0,n.isEnabled)("ds-payload-type-hooks")&&s.reopen({modelNameFromPayloadType:function(e){return(0,r.singularize)((0,n.normalizeModelName)(e))},payloadTypeFromModelName:function(e){return o(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==s.prototype.modelNameFromPayloadKey},_hasCustomModelNameFromPayloadType:function(){
6
+ return this.modelNameFromPayloadType!==s.prototype.modelNameFromPayloadType},_hasCustomPayloadTypeFromModelName:function(){return this.payloadTypeFromModelName!==s.prototype.payloadTypeFromModelName},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==s.prototype.payloadKeyFromModelName}}),e.default=s}),t("ember-data/setup-container",["exports","ember-data/-private","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest","ember-data/adapters/json-api","ember-data/adapters/rest","ember-data/transforms/number","ember-data/transforms/date","ember-data/transforms/string","ember-data/transforms/boolean"],function(e,t,r,i,n,a,o,s,l,d,u){function c(e,t){return e.has?e.has(t):e.hasRegistration(t)}function h(e){var s=e.registerOptionsForType||e.optionsForType;s.call(e,"serializer",{singleton:!1}),s.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",i.default),e.register("serializer:-rest",n.default),e.register("adapter:-rest",o.default),e.register("adapter:-json-api",a.default),e.register("serializer:-json-api",r.default),c(e,"service:store")||e.register("service:store",t.Store)}function p(e){e.register("data-adapter:main",t.DebugAdapter)}function f(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")}function y(e){e.register("transform:boolean",u.default),e.register("transform:date",l.default),e.register("transform:number",s.default),e.register("transform:string",d.default)}function m(e){p(e),y(e),f(e),h(e)}e.__esModule=!0,e.default=m}),t("ember-data/store",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Store}})}),t("ember-data/transform",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),t("ember-data/transforms/boolean",["exports","ember","ember-data/transforms/transform"],function(e,t,r){e.__esModule=!0;var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e,t){var r=typeof e;return i(e)&&!0===t.allowNull?null:"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r&&1===e},serialize:function(e,t){return i(e)&&!0===t.allowNull?null:Boolean(e)}})}),t("ember-data/transforms/date",["exports","ember-data/transforms/transform","ember"],function(e,t,r){e.__esModule=!0,r.default.Date=r.default.Date||{},r.default.Date.parse=function(e){return Date.parse(e)},e.default=t.default.extend({deserialize:function(e){var t=typeof e;if("string"===t){var r=e.indexOf("+");return-1!==r&&e.length-3===r?new Date(e+":00"):-1!==r&&e.length-5===r?(r+=3,new Date(e.slice(0,r)+":"+e.slice(r))):new Date(e)}return"number"===t?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/transforms/number",["exports","ember","ember-data/transforms/transform"],function(e,t,r){function i(e){return e===e&&e!==1/0&&e!==-1/0}e.__esModule=!0;var n=t.default.isEmpty;e.default=r.default.extend({deserialize:function(e){var t=void 0;return n(e)?null:(t=Number(e),i(t)?t:null)},serialize:function(e){var t=void 0;return n(e)?null:(t=Number(e),i(t)?t:null)}})}),t("ember-data/transforms/string",["exports","ember","ember-data/transforms/transform"],function(e,t,r){e.__esModule=!0;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/transforms/transform",["exports","ember"],function(e,t){e.__esModule=!0,e.default=t.default.Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.__esModule=!0,e.default="2.15.0-beta.1"}),t("ember-inflector",["module","exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i,n){r.__esModule=!0,r.defaultRules=r.singularize=r.pluralize=void 0,n.Inflector.defaultRules=n.defaultRules,i.default.Inflector=n.Inflector,i.default.String.pluralize=n.pluralize,i.default.String.singularize=n.singularize,r.default=n.Inflector,r.pluralize=n.pluralize,r.singularize=n.singularize,r.defaultRules=n.defaultRules,void 0!==t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=n.Inflector,e.pluralize=n.pluralize,e.singularize=n.singularize,e}):void 0!==e&&e.exports&&(e.exports=n.Inflector,n.Inflector.singularize=n.singularize,n.Inflector.pluralize=n.pluralize)}),t("ember-inflector/lib/ext/string",["ember","ember-inflector/lib/system/string"],function(e,t){(!0===e.default.EXTEND_PROTOTYPES||e.default.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,t.pluralize)(this)},String.prototype.singularize=function(){return(0,t.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,e.default=(0,r.default)(function(e,r){var i=void 0,n=void 0,a=!1;return 1===e.length?(n=e[0],(0,t.pluralize)(n)):(i=e[0],n=e[1],r["without-count"]&&(a=r["without-count"]),1!==parseFloat(i)&&(n=(0,t.pluralize)(n)),a?n:i+" "+n)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,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){e.__esModule=!0,e.defaultRules=e.pluralize=e.singularize=e.Inflector=void 0,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.__esModule=!0,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,n=t.length;i<n;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 n(e){e=e||{},e.uncountable=e.uncountable||a(),e.irregularPairs=e.irregularPairs||a();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:a(),irregularInverse:a(),uncountable:a()};r(t,e.uncountable),i(t,e.irregularPairs),this.enableCache()}function a(){var e=Object.create(null);return e._dict=null,delete e._dict,e}e.__esModule=!0;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");n.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=a(),this._pCache=a()},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,n,a,c,h,p,f,y;if(p=!e||s.test(e),f=u.test(e),"",p)return e;if(a=e.toLowerCase(),c=l.exec(e)||d.exec(e),c&&(c[1],h=c[2].toLowerCase()),this.rules.uncountable[a]||this.rules.uncountable[h])return e;for(y in r)if(a.match(y+"$"))return n=r[y],f&&r[h]&&(n=o(n),y=o(y)),e.replace(new RegExp(y,"i"),n);for(var m=t.length;m>0&&(i=t[m-1],y=i[0],!y.test(e));m--);return i=i||[],y=i[0],n=i[1],e.replace(y,n)}},e.default=n}),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.__esModule=!0,e.singularize=e.pluralize=void 0,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.__esModule=!0,e.default=r}),t("ember-load-initializers",["exports"],function(e){function t(e){var t=i(e,null,null,!0);if(!t)throw new Error(e+" must export an initializer.");var r=t.default;return r.name||(r.name=e.slice(e.lastIndexOf("/")+1)),r}function r(e,r){for(var i=0;i<r.length;i++)e.initializer(t(r[i]))}function a(e,r){for(var i=0;i<r.length;i++)e.instanceInitializer(t(r[i]))}e.__esModule=!0,e.default=function(e,t){for(var i=t+"/initializers/",o=t+"/instance-initializers/",s=[],l=[],d=Object.keys(n._eak_seen),u=0;u<d.length;u++){var c=d[u];0===c.lastIndexOf(i,0)?s.push(c):0===c.lastIndexOf(o,0)&&l.push(c)}r(e,s),a(e,l)}}),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-2017 Tilde Inc. and contributors.
7
7
  * Portions Copyright 2011 LivingSocial Inc.
8
8
  * @license Licensed under MIT license (see license.js)
9
- * @version 2.14.11
9
+ * @version 2.15.0-beta.1
10
10
  */
11
11
 
12
12
  var loader, define, requireModule, require, requirejs;
@@ -14,6 +14,8 @@ var loader, define, requireModule, require, requirejs;
14
14
  (function (global) {
15
15
  'use strict';
16
16
 
17
+ var heimdall = global.heimdall;
18
+
17
19
  function dict() {
18
20
  var obj = Object.create(null);
19
21
  obj['__'] = undefined;
@@ -55,9 +57,7 @@ var loader, define, requireModule, require, requirejs;
55
57
  }
56
58
  }
57
59
  }
58
- },
59
- // Option to enable or disable the generation of default exports
60
- makeDefaultExport: true
60
+ }
61
61
  };
62
62
 
63
63
  var registry = dict();
@@ -107,7 +107,6 @@ var loader, define, requireModule, require, requirejs;
107
107
  return this.module.exports;
108
108
  }
109
109
 
110
-
111
110
  if (loader.wrapModules) {
112
111
  this.callback = loader.wrapModules(this.id, this.callback);
113
112
  }
@@ -121,9 +120,7 @@ var loader, define, requireModule, require, requirejs;
121
120
  if (!(this.hasExportsAsDep && result === undefined)) {
122
121
  this.module.exports = result;
123
122
  }
124
- if (loader.makeDefaultExport) {
125
- this.makeDefaultExport();
126
- }
123
+ this.makeDefaultExport();
127
124
  return this.module.exports;
128
125
  };
129
126
 
@@ -281,7 +278,6 @@ var loader, define, requireModule, require, requirejs;
281
278
  return child;
282
279
  }
283
280
 
284
-
285
281
  var parts = child.split('/');
286
282
  var nameParts = id.split('/');
287
283
  var parentBase = nameParts.slice(0, -1);
@@ -349,59 +345,12 @@ define('ember-data/-debug', ['exports', 'ember'], function (exports, _ember) {
349
345
  'use strict';
350
346
 
351
347
  exports.__esModule = true;
352
- exports.assert = assert;
353
- exports.debug = debug;
354
- exports.deprecate = deprecate;
355
- exports.info = info;
356
- exports.runInDebug = runInDebug;
348
+ exports.assertPolymorphicType = undefined;
357
349
  exports.instrument = instrument;
358
- exports.warn = warn;
359
- exports.debugSeal = debugSeal;
360
- exports.assertPolymorphicType = assertPolymorphicType;
361
- function assert() {
362
- return _ember.default.assert.apply(_ember.default, arguments);
363
- }
364
-
365
- function debug() {
366
- return _ember.default.debug.apply(_ember.default, arguments);
367
- }
368
-
369
- function deprecate() {
370
- return _ember.default.deprecate.apply(_ember.default, arguments);
371
- }
372
-
373
- function info() {
374
- return _ember.default.info.apply(_ember.default, arguments);
375
- }
376
-
377
- function runInDebug() {
378
- return _ember.default.runInDebug.apply(_ember.default, arguments);
379
- }
380
-
381
350
  function instrument(method) {
382
351
  return method();
383
352
  }
384
353
 
385
- function warn() {
386
- return _ember.default.warn.apply(_ember.default, arguments);
387
- }
388
-
389
- function debugSeal() {
390
- return _ember.default.debugSeal.apply(_ember.default, arguments);
391
- }
392
-
393
- function checkPolymorphic(modelClass, addedModelClass) {
394
- if (modelClass.__isMixin) {
395
- //TODO Need to do this in order to support mixins, should convert to public api
396
- //once it exists in Ember
397
- return modelClass.__mixin.detect(addedModelClass.PrototypeMixin);
398
- }
399
- if (_ember.default.MODEL_FACTORY_INJECTIONS) {
400
- modelClass = modelClass.superclass;
401
- }
402
- return modelClass.detect(addedModelClass);
403
- }
404
-
405
354
  /*
406
355
  Assert that `addedRecord` has a valid type so it can be added to the
407
356
  relationship of the `record`.
@@ -421,18 +370,36 @@ define('ember-data/-debug', ['exports', 'ember'], function (exports, _ember) {
421
370
  @param {InternalModel} addedRecord record which
422
371
  should be added/set for the relationship
423
372
  */
424
- function assertPolymorphicType(parentInternalModel, relationshipMeta, addedInternalModel) {
425
- var addedModelName = addedInternalModel.modelName;
426
- var parentModelName = parentInternalModel.modelName;
427
- var key = relationshipMeta.key;
428
- var relationshipModelName = relationshipMeta.type;
429
- var relationshipClass = parentInternalModel.store.modelFor(relationshipModelName);
430
- var assertionMessage = 'You cannot add a record of modelClass \'' + addedModelName + '\' to the \'' + parentModelName + '.' + key + '\' relationship (only \'' + relationshipModelName + '\' allowed)';
431
-
432
- assert(assertionMessage, checkPolymorphic(relationshipClass, addedInternalModel.modelClass));
373
+ var assertPolymorphicType = void 0;
374
+
375
+ if (false) {
376
+ var checkPolymorphic = function checkPolymorphic(modelClass, addedModelClass) {
377
+ if (modelClass.__isMixin) {
378
+ //TODO Need to do this in order to support mixins, should convert to public api
379
+ //once it exists in Ember
380
+ return modelClass.__mixin.detect(addedModelClass.PrototypeMixin);
381
+ }
382
+ if (_ember.default.MODEL_FACTORY_INJECTIONS) {
383
+ modelClass = modelClass.superclass;
384
+ }
385
+ return modelClass.detect(addedModelClass);
386
+ };
387
+
388
+ exports.assertPolymorphicType = assertPolymorphicType = function assertPolymorphicType(parentInternalModel, relationshipMeta, addedInternalModel) {
389
+ var addedModelName = addedInternalModel.modelName;
390
+ var parentModelName = parentInternalModel.modelName;
391
+ var key = relationshipMeta.key;
392
+ var relationshipModelName = relationshipMeta.type;
393
+ var relationshipClass = parentInternalModel.store.modelFor(relationshipModelName);
394
+ var assertionMessage = 'You cannot add a record of modelClass \'' + addedModelName + '\' to the \'' + parentModelName + '.' + key + '\' relationship (only \'' + relationshipModelName + '\' allowed)';
395
+
396
+ (false && _ember.default.assert(assertionMessage, checkPolymorphic(relationshipClass, addedInternalModel.modelClass)));
397
+ };
433
398
  }
399
+
400
+ exports.assertPolymorphicType = assertPolymorphicType;
434
401
  });
435
- define('ember-data/-private/adapters/build-url-mixin', ['exports', 'ember', 'ember-inflector'], function (exports, _ember, _emberInflector) {
402
+ define('ember-data/-private/adapters/build-url-mixin', ['exports', 'ember'], function (exports, _ember) {
436
403
  'use strict';
437
404
 
438
405
  exports.__esModule = true;
@@ -832,11 +799,10 @@ define('ember-data/-private/adapters/build-url-mixin', ['exports', 'ember', 'emb
832
799
  endpoint of "/line_items/".
833
800
  ```app/adapters/application.js
834
801
  import DS from 'ember-data';
835
- import { pluralize } from 'ember-inflector';
836
802
  export default DS.RESTAdapter.extend({
837
803
  pathForType: function(modelName) {
838
804
  var decamelized = Ember.String.decamelize(modelName);
839
- return pluralize(decamelized);
805
+ return Ember.String.pluralize(decamelized);
840
806
  }
841
807
  });
842
808
  ```
@@ -846,7 +812,7 @@ define('ember-data/-private/adapters/build-url-mixin', ['exports', 'ember', 'emb
846
812
  **/
847
813
  pathForType: function (modelName) {
848
814
  var camelized = _ember.default.String.camelize(modelName);
849
- return (0, _emberInflector.pluralize)(camelized);
815
+ return _ember.default.String.pluralize(camelized);
850
816
  }
851
817
  });
852
818
  });
@@ -961,6 +927,8 @@ define('ember-data/-private/adapters/errors', ['exports', 'ember', 'ember-data/-
961
927
 
962
928
  function extend(ParentErrorClass, defaultMessage) {
963
929
  var ErrorClass = function (errors, message) {
930
+ (false && _ember.default.assert('`AdapterError` expects json-api formatted errors array.', Array.isArray(errors || [])));
931
+
964
932
  ParentErrorClass.call(this, errors, message || defaultMessage);
965
933
  };
966
934
  ErrorClass.prototype = Object.create(ParentErrorClass.prototype);
@@ -1815,8 +1783,8 @@ define("ember-data/-private/system/diff-array", ["exports"], function (exports)
1815
1783
  exports.default = diffArray;
1816
1784
  /**
1817
1785
  @namespace
1818
- @method diff-array
1819
- @for DS
1786
+ @method diffArray
1787
+ @private
1820
1788
  @param {Array} oldArray the old array
1821
1789
  @param {Array} newArray the new array
1822
1790
  @return {hash} {
@@ -1975,11 +1943,18 @@ define('ember-data/-private/system/internal-model-map', ['exports', 'ember-data/
1975
1943
  };
1976
1944
 
1977
1945
  InternalModelMap.prototype.set = function set(id, internalModel) {
1946
+ (false && Ember.assert('You cannot index an internalModel by an empty id\'', id));
1947
+ (false && Ember.assert('You cannot set an index for an internalModel to something other than an internalModel', internalModel instanceof _internalModel.default));
1948
+ (false && Ember.assert('You cannot set an index for an internalModel that is not in the InternalModelMap', this.contains(internalModel)));
1949
+ (false && Ember.assert('You cannot update the id index of an InternalModel once set. Attempted to update ' + id + '.', !this.has(id) || this.get(id) === internalModel));
1950
+
1978
1951
 
1979
1952
  this._idToModel[id] = internalModel;
1980
1953
  };
1981
1954
 
1982
1955
  InternalModelMap.prototype.add = function add(internalModel, id) {
1956
+ (false && Ember.assert('You cannot re-add an already present InternalModel to the InternalModelMap.', !this.contains(internalModel)));
1957
+
1983
1958
 
1984
1959
  if (id) {
1985
1960
  this._idToModel[id] = internalModel;
@@ -2026,6 +2001,11 @@ define('ember-data/-private/system/internal-model-map', ['exports', 'ember-data/
2026
2001
  _createClass(InternalModelMap, [{
2027
2002
  key: 'idToRecord',
2028
2003
  get: function () {
2004
+ (false && !(false) && Ember.deprecate('Use of InternalModelMap.idToRecord is deprecated, use InternalModelMap.get(id) instead.', false, {
2005
+ id: 'ds.record-map.idToRecord',
2006
+ until: '2.13'
2007
+ }));
2008
+
2029
2009
  return this._idToModel;
2030
2010
  }
2031
2011
  }, {
@@ -2314,6 +2294,8 @@ define('ember-data/-private/system/many-array', ['exports', 'ember', 'ember-data
2314
2294
  var store = get(this, 'store');
2315
2295
  var type = get(this, 'type');
2316
2296
 
2297
+ (false && _ember.default.assert('You cannot add \'' + type.modelName + '\' records to this polymorphic relationship.', !get(this, 'isPolymorphic')));
2298
+
2317
2299
  var record = store.createRecord(type.modelName, hash);
2318
2300
  this.pushObject(record);
2319
2301
 
@@ -2423,6 +2405,11 @@ define('ember-data/-private/system/model/errors', ['exports', 'ember'], function
2423
2405
  @deprecated
2424
2406
  */
2425
2407
  registerHandlers: function (target, becameInvalid, becameValid) {
2408
+ (false && !(false) && _ember.default.deprecate('Record errors will no longer be evented.', false, {
2409
+ id: 'ds.errors.registerHandlers',
2410
+ until: '3.0.0'
2411
+ }));
2412
+
2426
2413
 
2427
2414
  this._registerHandlers(target, becameInvalid, becameValid);
2428
2415
  },
@@ -2539,6 +2526,10 @@ define('ember-data/-private/system/model/errors', ['exports', 'ember'], function
2539
2526
  @deprecated
2540
2527
  */
2541
2528
  add: function (attribute, messages) {
2529
+ (false && _ember.default.warn('Interacting with a record errors object will no longer change the record state.', false, {
2530
+ id: 'ds.errors.add'
2531
+ }));
2532
+
2542
2533
 
2543
2534
  var wasEmpty = get(this, 'isEmpty');
2544
2535
 
@@ -2620,6 +2611,10 @@ define('ember-data/-private/system/model/errors', ['exports', 'ember'], function
2620
2611
  @deprecated
2621
2612
  */
2622
2613
  remove: function (attribute) {
2614
+ (false && _ember.default.warn('Interacting with a record errors object will no longer change the record state.', false, {
2615
+ id: 'ds.errors.remove'
2616
+ }));
2617
+
2623
2618
 
2624
2619
  if (get(this, 'isEmpty')) {
2625
2620
  return;
@@ -2670,6 +2665,10 @@ define('ember-data/-private/system/model/errors', ['exports', 'ember'], function
2670
2665
  @deprecated
2671
2666
  */
2672
2667
  clear: function () {
2668
+ (false && _ember.default.warn('Interacting with a record errors object will no longer change the record state.', false, {
2669
+ id: 'ds.errors.clear'
2670
+ }));
2671
+
2673
2672
 
2674
2673
  if (get(this, 'isEmpty')) {
2675
2674
  return;
@@ -2808,14 +2807,6 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
2808
2807
  return true;
2809
2808
  }
2810
2809
 
2811
- function destroyRelationship(rel) {
2812
- if (rel._inverseIsAsync()) {
2813
- rel.removeInternalModelFromInverse(rel.inverseInternalModel);
2814
- rel.removeInverseRelationships();
2815
- } else {
2816
- rel.removeCompletelyFromInverse();
2817
- }
2818
- }
2819
2810
  // this (and all heimdall instrumentation) will be stripped by a babel transform
2820
2811
  // https://github.com/heimdalljs/babel5-plugin-strip-heimdall
2821
2812
 
@@ -3030,9 +3021,17 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3030
3021
  };
3031
3022
 
3032
3023
  InternalModel.prototype._directlyRelatedInternalModels = function _directlyRelatedInternalModels() {
3024
+ var _this = this;
3025
+
3033
3026
  var array = [];
3034
- this._relationships.forEach(function (name, rel) {
3035
- array = array.concat(rel.members.list, rel.canonicalMembers.list);
3027
+ this.type.eachRelationship(function (key, relationship) {
3028
+ if (_this._relationships.has(key)) {
3029
+ var _relationship = _this._relationships.get(key);
3030
+ var localRelationships = _relationship.members.toArray();
3031
+ var serverRelationships = _relationship.canonicalMembers.toArray();
3032
+
3033
+ array = array.concat(localRelationships, serverRelationships);
3034
+ }
3036
3035
  });
3037
3036
  return array;
3038
3037
  };
@@ -3049,6 +3048,7 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3049
3048
  var related = node._directlyRelatedInternalModels();
3050
3049
  for (var i = 0; i < related.length; ++i) {
3051
3050
  var internalModel = related[i];
3051
+ (false && _ember.default.assert('Internal Error: seen a future bfs iteration', internalModel._bfsId <= bfsId));
3052
3052
 
3053
3053
  if (internalModel._bfsId < bfsId) {
3054
3054
  queue.push(internalModel);
@@ -3060,42 +3060,22 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3060
3060
  };
3061
3061
 
3062
3062
  InternalModel.prototype.unloadRecord = function unloadRecord() {
3063
- if (this.isDestroyed) {
3064
- return;
3065
- }
3066
3063
  this.send('unloadRecord');
3067
3064
  this.dematerializeRecord();
3068
-
3069
3065
  if (this._scheduledDestroy === null) {
3070
3066
  this._scheduledDestroy = run.schedule('destroy', this, '_checkForOrphanedInternalModels');
3071
3067
  }
3072
3068
  };
3073
3069
 
3074
- InternalModel.prototype.hasScheduledDestroy = function hasScheduledDestroy() {
3075
- return !!this._scheduledDestroy;
3076
- };
3077
-
3078
3070
  InternalModel.prototype.cancelDestroy = function cancelDestroy() {
3071
+ (false && _ember.default.assert('You cannot cancel the destruction of an InternalModel once it has already been destroyed', !this.isDestroyed));
3072
+
3079
3073
 
3080
3074
  this._isDematerializing = false;
3081
3075
  run.cancel(this._scheduledDestroy);
3082
3076
  this._scheduledDestroy = null;
3083
3077
  };
3084
3078
 
3085
- InternalModel.prototype.destroySync = function destroySync() {
3086
- if (this._isDematerializing) {
3087
- this.cancelDestroy();
3088
- }
3089
- this._checkForOrphanedInternalModels();
3090
- if (this.isDestroyed || this.isDestroying) {
3091
- return;
3092
- }
3093
-
3094
- // just in-case we are not one of the orphaned, we should still
3095
- // still destroy ourselves
3096
- this.destroy();
3097
- };
3098
-
3099
3079
  InternalModel.prototype._checkForOrphanedInternalModels = function _checkForOrphanedInternalModels() {
3100
3080
  this._isDematerializing = false;
3101
3081
  this._scheduledDestroy = null;
@@ -3123,13 +3103,10 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3123
3103
  };
3124
3104
 
3125
3105
  InternalModel.prototype.destroy = function destroy() {
3106
+ (false && _ember.default.assert("Cannot destroy an internalModel while its record is materialized", !this._record || this._record.get('isDestroyed') || this._record.get('isDestroying')));
3126
3107
 
3127
- this.store._internalModelDestroyed(this);
3128
-
3129
- this._relationships.forEach(function (name, rel) {
3130
- return rel.destroy();
3131
- });
3132
3108
 
3109
+ this.store._internalModelDestroyed(this);
3133
3110
  this._isDestroyed = true;
3134
3111
  };
3135
3112
 
@@ -3258,6 +3235,12 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3258
3235
  }
3259
3236
  };
3260
3237
 
3238
+ InternalModel.prototype.notifyHasManyRemoved = function notifyHasManyRemoved(key, record, idx) {
3239
+ if (this.hasRecord) {
3240
+ this._record.notifyHasManyRemoved(key, record, idx);
3241
+ }
3242
+ };
3243
+
3261
3244
  InternalModel.prototype.notifyBelongsToChanged = function notifyBelongsToChanged(key, record) {
3262
3245
  if (this.hasRecord) {
3263
3246
  this._record.notifyBelongsToChanged(key, record);
@@ -3291,7 +3274,7 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3291
3274
  }
3292
3275
 
3293
3276
  if (this.isNew()) {
3294
- this.removeFromInverseRelationships(true);
3277
+ this.clearRelationships();
3295
3278
  }
3296
3279
 
3297
3280
  if (this.isValid()) {
@@ -3407,57 +3390,47 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3407
3390
  triggers.length = 0;
3408
3391
  };
3409
3392
 
3410
- InternalModel.prototype.removeFromInverseRelationships = function removeFromInverseRelationships() {
3411
- var isNew = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
3393
+ InternalModel.prototype.clearRelationships = function clearRelationships() {
3394
+ var _this2 = this;
3412
3395
 
3413
- this._relationships.forEach(function (name, rel) {
3414
- rel.removeCompletelyFromInverse();
3415
- if (isNew === true) {
3396
+ this.eachRelationship(function (name, relationship) {
3397
+ if (_this2._relationships.has(name)) {
3398
+ var rel = _this2._relationships.get(name);
3416
3399
  rel.clear();
3400
+ rel.removeInverseRelationships();
3417
3401
  }
3418
3402
  });
3419
-
3420
- var implicitRelationships = this._implicitRelationships;
3421
- this.__implicitRelationships = null;
3422
-
3423
- Object.keys(implicitRelationships).forEach(function (key) {
3424
- var rel = implicitRelationships[key];
3425
-
3426
- rel.removeCompletelyFromInverse();
3427
- if (isNew === true) {
3428
- rel.clear();
3429
- }
3403
+ Object.keys(this._implicitRelationships).forEach(function (key) {
3404
+ _this2._implicitRelationships[key].clear();
3405
+ _this2._implicitRelationships[key].removeInverseRelationships();
3430
3406
  });
3431
3407
  };
3432
3408
 
3433
3409
  InternalModel.prototype.destroyRelationships = function destroyRelationships() {
3434
- var relationships = this._relationships;
3435
- relationships.forEach(function (name, rel) {
3436
- return destroyRelationship(rel);
3437
- });
3438
-
3439
- var implicitRelationships = this._implicitRelationships;
3440
- this.__implicitRelationships = null;
3441
- Object.keys(implicitRelationships).forEach(function (key) {
3442
- var rel = implicitRelationships[key];
3443
-
3444
- destroyRelationship(rel);
3410
+ var _this3 = this;
3445
3411
 
3446
- rel.destroy();
3412
+ this.eachRelationship(function (name, relationship) {
3413
+ if (_this3._relationships.has(name)) {
3414
+ var rel = _this3._relationships.get(name);
3415
+ rel.removeInverseRelationships();
3416
+ }
3417
+ });
3418
+ Object.keys(this._implicitRelationships).forEach(function (key) {
3419
+ _this3._implicitRelationships[key].removeInverseRelationships();
3447
3420
  });
3448
3421
  };
3449
3422
 
3450
3423
  InternalModel.prototype.preloadData = function preloadData(preload) {
3451
- var _this = this;
3424
+ var _this4 = this;
3452
3425
 
3453
3426
  //TODO(Igor) consider the polymorphic case
3454
3427
  Object.keys(preload).forEach(function (key) {
3455
3428
  var preloadValue = get(preload, key);
3456
- var relationshipMeta = _this.modelClass.metaForProperty(key);
3429
+ var relationshipMeta = _this4.modelClass.metaForProperty(key);
3457
3430
  if (relationshipMeta.isRelationship) {
3458
- _this._preloadRelationship(key, preloadValue);
3431
+ _this4._preloadRelationship(key, preloadValue);
3459
3432
  } else {
3460
- _this._data[key] = preloadValue;
3433
+ _this4._data[key] = preloadValue;
3461
3434
  }
3462
3435
  });
3463
3436
  };
@@ -3473,6 +3446,8 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3473
3446
  };
3474
3447
 
3475
3448
  InternalModel.prototype._preloadHasMany = function _preloadHasMany(key, preloadValue, modelClass) {
3449
+ (false && _ember.default.assert("You need to pass in an array to set a hasMany property on a record", Array.isArray(preloadValue)));
3450
+
3476
3451
  var recordsToSet = new Array(preloadValue.length);
3477
3452
 
3478
3453
  for (var i = 0; i < preloadValue.length; i++) {
@@ -3508,6 +3483,8 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3508
3483
  };
3509
3484
 
3510
3485
  InternalModel.prototype.setId = function setId(id) {
3486
+ (false && _ember.default.assert('A record\'s id cannot be changed once it is in the loaded state', this.id === null || this.id === id || this.isNew()));
3487
+
3511
3488
  this.id = id;
3512
3489
  if (this._record.get('id') !== id) {
3513
3490
  this._record.set('id', id);
@@ -3661,13 +3638,20 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember', '
3661
3638
  };
3662
3639
 
3663
3640
  InternalModel.prototype.referenceFor = function referenceFor(kind, name) {
3664
- var _this2 = this;
3665
-
3666
3641
  var reference = this.references[name];
3667
3642
 
3668
3643
  if (!reference) {
3669
3644
  var relationship = this._relationships.get(name);
3670
3645
 
3646
+ if (false) {
3647
+ var modelName = this.modelName;
3648
+ (false && _ember.default.assert('There is no ' + kind + ' relationship named \'' + name + '\' on a model of modelClass \'' + modelName + '\'', relationship));
3649
+
3650
+
3651
+ var actualRelationshipKind = relationship.relationshipMeta.kind;
3652
+ (false && _ember.default.assert('You tried to get the \'' + name + '\' relationship on a \'' + modelName + '\' via record.' + kind + '(\'' + name + '\'), but the relationship is of kind \'' + actualRelationshipKind + '\'. Use record.' + actualRelationshipKind + '(\'' + name + '\') instead.', actualRelationshipKind === kind));
3653
+ }
3654
+
3671
3655
  if (kind === "belongsTo") {
3672
3656
  reference = new _references.BelongsToReference(this.store, this, relationship);
3673
3657
  } else if (kind === "hasMany") {
@@ -4301,7 +4285,9 @@ define('ember-data/-private/system/model/model', ['exports', 'ember', 'ember-dat
4301
4285
 
4302
4286
  this._super.apply(this, arguments);
4303
4287
  },
4304
- attr: function () {},
4288
+ attr: function () {
4289
+ (false && _ember.default.assert("The `attr` method is not available on DS.Model, a DS.Snapshot was probably expected. Are you passing a DS.Model instead of a DS.Snapshot to your serializer?", false));
4290
+ },
4305
4291
  belongsTo: function (name) {
4306
4292
  return this._internalModel.referenceFor('belongsTo', name);
4307
4293
  },
@@ -4395,6 +4381,18 @@ define('ember-data/-private/system/model/model', ['exports', 'ember', 'ember-dat
4395
4381
  }
4396
4382
  });
4397
4383
 
4384
+ if (false) {
4385
+ Model.reopen({
4386
+ init: function () {
4387
+ this._super.apply(this, arguments);
4388
+
4389
+ if (!this._internalModel) {
4390
+ throw new _ember.default.Error('You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.');
4391
+ }
4392
+ }
4393
+ });
4394
+ }
4395
+
4398
4396
  Model.reopenClass({
4399
4397
  isModel: true,
4400
4398
 
@@ -4488,10 +4486,17 @@ define('ember-data/-private/system/model/model', ['exports', 'ember', 'ember-dat
4488
4486
  inverseName = options.inverse;
4489
4487
  inverse = _ember.default.get(inverseType, 'relationshipsByName').get(inverseName);
4490
4488
 
4489
+ (false && _ember.default.assert("We found no inverse relationships by the name of '" + inverseName + "' on the '" + inverseType.modelName + "' model. This is most likely due to a missing attribute on your model definition.", !_ember.default.isNone(inverse)));
4490
+
4491
+
4491
4492
  inverseKind = inverse.kind;
4492
4493
  } else {
4493
4494
  //No inverse was specified manually, we need to use a heuristic to guess one
4494
- if (propertyMeta.parentType && propertyMeta.type === propertyMeta.parentType.modelName) {}
4495
+ if (propertyMeta.parentType && propertyMeta.type === propertyMeta.parentType.modelName) {
4496
+ (false && _ember.default.warn('Detected a reflexive relationship by the name of \'' + name + '\' without an inverse option. Look at http://emberjs.com/guides/models/defining-models/#toc_reflexive-relation for how to explicitly specify inverses.', false, {
4497
+ id: 'ds.model.reflexive-relationship-without-inverse'
4498
+ }));
4499
+ }
4495
4500
 
4496
4501
  var possibleRelationships = findPossibleInverses(this, inverseType, name);
4497
4502
 
@@ -4504,10 +4509,16 @@ define('ember-data/-private/system/model/model', ['exports', 'ember', 'ember-dat
4504
4509
  return name === optionsForRelationship.inverse;
4505
4510
  });
4506
4511
 
4512
+ (false && _ember.default.assert("You defined the '" + name + "' relationship on " + this + ", but you defined the inverse relationships of type " + inverseType.toString() + " multiple times. Look at http://emberjs.com/guides/models/defining-models/#toc_explicit-inverses for how to explicitly specify inverses", filteredRelationships.length < 2));
4513
+
4514
+
4507
4515
  if (filteredRelationships.length === 1) {
4508
4516
  possibleRelationships = filteredRelationships;
4509
4517
  }
4510
4518
 
4519
+ (false && _ember.default.assert("You defined the '" + name + "' relationship on " + this + ", but multiple possible inverse relationships of type " + this + " were found on " + inverseType + ". Look at http://emberjs.com/guides/models/defining-models/#toc_explicit-inverses for how to explicitly specify inverses", possibleRelationships.length === 1));
4520
+
4521
+
4511
4522
  inverseName = possibleRelationships[0].name;
4512
4523
  inverseKind = possibleRelationships[0].kind;
4513
4524
  }
@@ -4773,6 +4784,8 @@ define('ember-data/-private/system/model/model', ['exports', 'ember', 'ember-dat
4773
4784
 
4774
4785
  this.eachComputedProperty(function (name, meta) {
4775
4786
  if (meta.isAttribute) {
4787
+ (false && _ember.default.assert("You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: DS.attr('<type>')` from " + _this3.toString(), name !== 'id'));
4788
+
4776
4789
 
4777
4790
  meta.name = name;
4778
4791
  map.set(name, meta);
@@ -4846,6 +4859,8 @@ define('ember-data/-private/system/model/model', ['exports', 'ember', 'ember-dat
4846
4859
  configurable: true,
4847
4860
  enumerable: false,
4848
4861
  get: function () {
4862
+ (false && !(false) && _ember.default.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.', false, { id: 'ember-application.injected-container', until: '3.0.0' }));
4863
+
4849
4864
 
4850
4865
  return this.store.container;
4851
4866
  }
@@ -4862,6 +4877,28 @@ define('ember-data/-private/system/model/model', ['exports', 'ember', 'ember-dat
4862
4877
  });
4863
4878
  }
4864
4879
 
4880
+ if (false) {
4881
+ Model.reopen({
4882
+ willMergeMixin: function (props) {
4883
+ var constructor = this.constructor;
4884
+ (false && _ember.default.assert('`' + intersection(Object.keys(props), RESERVED_MODEL_PROPS)[0] + '` is a reserved property name on DS.Model objects. Please choose a different property name for ' + constructor.toString(), !intersection(Object.keys(props), RESERVED_MODEL_PROPS)[0]));
4885
+ (false && _ember.default.assert("You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: DS.attr('<type>')` from " + constructor.toString(), Object.keys(props).indexOf('id') === -1));
4886
+ },
4887
+ didDefineProperty: function (proto, key, value) {
4888
+ // Check if the value being set is a computed property.
4889
+ if (value instanceof _ember.default.ComputedProperty) {
4890
+
4891
+ // If it is, get the metadata for the relationship. This is
4892
+ // populated by the `DS.belongsTo` helper when it is creating
4893
+ // the computed property.
4894
+ var meta = value.meta();
4895
+
4896
+ meta.parentType = proto.constructor;
4897
+ }
4898
+ }
4899
+ });
4900
+ }
4901
+
4865
4902
  exports.default = Model;
4866
4903
  });
4867
4904
  define('ember-data/-private/system/model/states', ['exports'], function (exports) {
@@ -5280,7 +5317,9 @@ define('ember-data/-private/system/model/states', ['exports'], function (exports
5280
5317
 
5281
5318
  createdState.uncommitted.propertyWasReset = function () {};
5282
5319
 
5283
- function assertAgainstUnloadRecord(internalModel) {}
5320
+ function assertAgainstUnloadRecord(internalModel) {
5321
+ (false && Ember.assert("You can only unload a record which is not inFlight. `" + internalModel + "`", false));
5322
+ }
5284
5323
 
5285
5324
  updatedState.inFlight.unloadRecord = assertAgainstUnloadRecord;
5286
5325
 
@@ -5486,7 +5525,7 @@ define('ember-data/-private/system/model/states', ['exports'], function (exports
5486
5525
  isDirty: false,
5487
5526
 
5488
5527
  setup: function (internalModel) {
5489
- internalModel.removeFromInverseRelationships();
5528
+ internalModel.clearRelationships();
5490
5529
  },
5491
5530
  invokeLifecycleCallbacks: function (internalModel) {
5492
5531
  internalModel.triggerLater('didDelete', internalModel);
@@ -5765,6 +5804,8 @@ define('ember-data/-private/system/promise-proxies', ['exports', 'ember'], funct
5765
5804
 
5766
5805
  var PromiseManyArray = exports.PromiseManyArray = PromiseArray.extend({
5767
5806
  reload: function () {
5807
+ (false && _ember.default.assert('You are trying to reload an async manyArray before it has been created', get(this, 'content')));
5808
+
5768
5809
  this.set('promise', this.get('content').reload());
5769
5810
  return this;
5770
5811
  },
@@ -5789,10 +5830,11 @@ define('ember-data/-private/system/promise-proxies', ['exports', 'ember'], funct
5789
5830
  });
5790
5831
  }
5791
5832
  });
5792
- define('ember-data/-private/system/record-array-manager', ['exports', 'ember', 'ember-data/-private/system/record-arrays'], function (exports, _ember, _recordArrays) {
5793
- 'use strict';
5833
+ define("ember-data/-private/system/record-array-manager", ["exports", "ember", "ember-data/-private/system/record-arrays", "ember-data/-private/system/clone-null"], function (exports, _ember, _recordArrays, _cloneNull) {
5834
+ "use strict";
5794
5835
 
5795
5836
  exports.__esModule = true;
5837
+ exports.associateWithRecordArray = associateWithRecordArray;
5796
5838
 
5797
5839
  function _classCallCheck(instance, Constructor) {
5798
5840
  if (!(instance instanceof Constructor)) {
@@ -5801,6 +5843,7 @@ define('ember-data/-private/system/record-array-manager', ['exports', 'ember', '
5801
5843
  }
5802
5844
 
5803
5845
  var get = _ember.default.get,
5846
+ set = _ember.default.set,
5804
5847
  emberRun = _ember.default.run;
5805
5848
 
5806
5849
  var RecordArrayManager = function () {
@@ -5872,63 +5915,22 @@ define('ember-data/-private/system/record-array-manager', ['exports', 'ember', '
5872
5915
  }
5873
5916
  }
5874
5917
 
5875
- // TODO: skip if it only changed
5876
- // process liveRecordArrays
5877
- if (this._liveRecordArrays[modelName]) {
5878
- this.updateLiveRecordArray(modelName, internalModels);
5918
+ var array = this._liveRecordArrays[modelName];
5919
+ if (array) {
5920
+ // TODO: skip if it only changed
5921
+ // process liveRecordArrays
5922
+ this.updateLiveRecordArray(array, internalModels);
5879
5923
  }
5880
5924
 
5881
5925
  // process adapterPopulatedRecordArrays
5882
5926
  if (modelsToRemove.length > 0) {
5883
- this.removeFromAdapterPopulatedRecordArrays(modelsToRemove);
5927
+ removeFromAdapterPopulatedRecordArrays(modelsToRemove);
5884
5928
  }
5885
5929
  }
5886
5930
  };
5887
5931
 
5888
- RecordArrayManager.prototype.updateLiveRecordArray = function updateLiveRecordArray(modelName, internalModels) {
5889
- var array = this.liveRecordArrayFor(modelName);
5890
-
5891
- var modelsToAdd = [];
5892
- var modelsToRemove = [];
5893
-
5894
- for (var i = 0; i < internalModels.length; i++) {
5895
- var internalModel = internalModels[i];
5896
- var isDeleted = internalModel.isHiddenFromRecordArrays();
5897
- var recordArrays = internalModel._recordArrays;
5898
-
5899
- if (!isDeleted && !internalModel.isEmpty()) {
5900
- if (!recordArrays.has(array)) {
5901
- modelsToAdd.push(internalModel);
5902
- recordArrays.add(array);
5903
- }
5904
- }
5905
-
5906
- if (isDeleted) {
5907
- modelsToRemove.push(internalModel);
5908
- recordArrays.delete(array);
5909
- }
5910
- }
5911
-
5912
- if (modelsToAdd.length > 0) {
5913
- array._pushInternalModels(modelsToAdd);
5914
- }
5915
- if (modelsToRemove.length > 0) {
5916
- array._removeInternalModels(modelsToRemove);
5917
- }
5918
- };
5919
-
5920
- RecordArrayManager.prototype.removeFromAdapterPopulatedRecordArrays = function removeFromAdapterPopulatedRecordArrays(internalModels) {
5921
- for (var i = 0; i < internalModels.length; i++) {
5922
- var internalModel = internalModels[i];
5923
- var list = internalModel._recordArrays.list;
5924
-
5925
- for (var j = 0; j < list.length; j++) {
5926
- // TODO: group by arrays, so we can batch remove
5927
- list[j]._removeInternalModels([internalModel]);
5928
- }
5929
-
5930
- internalModel._recordArrays.clear();
5931
- }
5932
+ RecordArrayManager.prototype.updateLiveRecordArray = function updateLiveRecordArray(array, internalModels) {
5933
+ return _updateLiveRecordArray(array, internalModels);
5932
5934
  };
5933
5935
 
5934
5936
  RecordArrayManager.prototype.updateFilterRecordArray = function updateFilterRecordArray(array, modelName, internalModels) {
@@ -5961,7 +5963,9 @@ define('ember-data/-private/system/record-array-manager', ['exports', 'ember', '
5961
5963
  }
5962
5964
  };
5963
5965
 
5964
- RecordArrayManager.prototype.syncLiveRecordArray = function syncLiveRecordArray(array, modelName) {
5966
+ RecordArrayManager.prototype._syncLiveRecordArray = function _syncLiveRecordArray(array, modelName) {
5967
+ (false && _ember.default.assert("recordArrayManger.syncLiveRecordArray expects modelName not modelClass as the second param", typeof modelName === 'string'));
5968
+
5965
5969
  var hasNoPotentialDeletions = Object.keys(this._pending).length === 0;
5966
5970
  var map = this.store._internalModelsFor(modelName);
5967
5971
  var hasNoInsertionsOrRemovals = get(map, 'length') === get(array, 'length');
@@ -5971,27 +5975,19 @@ define('ember-data/-private/system/record-array-manager', ['exports', 'ember', '
5971
5975
  liveRecordArrays, and is capable of strategically flushing those changes and applying
5972
5976
  small diffs if desired. However, until we've refactored recordArrayManager, this dirty
5973
5977
  check prevents us from unnecessarily wiping out live record arrays returned by peekAll.
5974
- */
5978
+ */
5975
5979
  if (hasNoPotentialDeletions && hasNoInsertionsOrRemovals) {
5976
5980
  return;
5977
5981
  }
5978
5982
 
5979
- this.populateLiveRecordArray(array, map.models);
5980
- };
5981
-
5982
- RecordArrayManager.prototype.populateLiveRecordArray = function populateLiveRecordArray(array, internalModels) {
5983
-
5983
+ var internalModels = this._visibleInternalModelsByType(modelName);
5984
5984
  var modelsToAdd = [];
5985
5985
  for (var i = 0; i < internalModels.length; i++) {
5986
5986
  var internalModel = internalModels[i];
5987
-
5988
- if (!internalModel.isHiddenFromRecordArrays()) {
5989
- var recordArrays = internalModel._recordArrays;
5990
-
5991
- if (!recordArrays.has(array)) {
5992
- modelsToAdd.push(internalModel);
5993
- recordArrays.add(array);
5994
- }
5987
+ var recordArrays = internalModel._recordArrays;
5988
+ if (recordArrays.has(array) === false) {
5989
+ recordArrays.add(array);
5990
+ modelsToAdd.push(internalModel);
5995
5991
  }
5996
5992
  }
5997
5993
 
@@ -5999,33 +5995,82 @@ define('ember-data/-private/system/record-array-manager', ['exports', 'ember', '
5999
5995
  };
6000
5996
 
6001
5997
  RecordArrayManager.prototype.updateFilter = function updateFilter(array, modelName, filter) {
5998
+ (false && _ember.default.assert("recordArrayManger.updateFilter expects modelName not modelClass as the second param, received " + modelName, typeof modelName === 'string'));
5999
+
6002
6000
  var modelMap = this.store._internalModelsFor(modelName);
6003
6001
  var internalModels = modelMap.models;
6004
6002
 
6005
6003
  this.updateFilterRecordArray(array, filter, internalModels);
6006
6004
  };
6007
6005
 
6006
+ RecordArrayManager.prototype._didUpdateAll = function _didUpdateAll(modelName) {
6007
+ var recordArray = this._liveRecordArrays[modelName];
6008
+ if (recordArray) {
6009
+ set(recordArray, 'isUpdating', false);
6010
+ }
6011
+ };
6012
+
6008
6013
  RecordArrayManager.prototype.liveRecordArrayFor = function liveRecordArrayFor(modelName) {
6014
+ (false && _ember.default.assert("recordArrayManger.liveRecordArrayFor expects modelName not modelClass as the param", typeof modelName === 'string'));
6015
+
6016
+
6017
+ var array = this._liveRecordArrays[modelName];
6009
6018
 
6010
- return this._liveRecordArrays[modelName] || (this._liveRecordArrays[modelName] = this.createRecordArray(modelName));
6019
+ if (array) {
6020
+ // if the array already exists, synchronize
6021
+ this._syncLiveRecordArray(array, modelName);
6022
+ } else {
6023
+ // if the array is being newly created merely create it with its initial
6024
+ // content already set. This prevents unneeded change events.
6025
+ var internalModels = this._visibleInternalModelsByType(modelName);
6026
+ array = this.createRecordArray(modelName, internalModels);
6027
+ this._liveRecordArrays[modelName] = array;
6028
+ }
6029
+
6030
+ return array;
6031
+ };
6032
+
6033
+ RecordArrayManager.prototype._visibleInternalModelsByType = function _visibleInternalModelsByType(modelName) {
6034
+ var all = this.store._internalModelsFor(modelName)._models;
6035
+ var visible = [];
6036
+ for (var i = 0; i < all.length; i++) {
6037
+ var model = all[i];
6038
+ if (model.isHiddenFromRecordArrays() === false) {
6039
+ visible.push(model);
6040
+ }
6041
+ }
6042
+ return visible;
6011
6043
  };
6012
6044
 
6013
6045
  RecordArrayManager.prototype.filteredRecordArraysFor = function filteredRecordArraysFor(modelName) {
6046
+ (false && _ember.default.assert("recordArrayManger.filteredRecordArraysFor expects modelName not modelClass as the param", typeof modelName === 'string'));
6047
+
6014
6048
 
6015
6049
  return this._filteredRecordArrays[modelName] || (this._filteredRecordArrays[modelName] = []);
6016
6050
  };
6017
6051
 
6018
- RecordArrayManager.prototype.createRecordArray = function createRecordArray(modelName) {
6019
- return _recordArrays.RecordArray.create({
6052
+ RecordArrayManager.prototype.createRecordArray = function createRecordArray(modelName, content) {
6053
+ (false && _ember.default.assert("recordArrayManger.createRecordArray expects modelName not modelClass as the param", typeof modelName === 'string'));
6054
+
6055
+
6056
+ var array = _recordArrays.RecordArray.create({
6020
6057
  modelName: modelName,
6021
- content: _ember.default.A(),
6058
+ content: _ember.default.A(content || []),
6022
6059
  store: this.store,
6023
6060
  isLoaded: true,
6024
6061
  manager: this
6025
6062
  });
6063
+
6064
+ if (Array.isArray(content)) {
6065
+ associateWithRecordArray(content, array);
6066
+ }
6067
+
6068
+ return array;
6026
6069
  };
6027
6070
 
6028
6071
  RecordArrayManager.prototype.createFilteredRecordArray = function createFilteredRecordArray(modelName, filter, query) {
6072
+ (false && _ember.default.assert("recordArrayManger.createFilteredRecordArray expects modelName not modelClass as the first param, received " + modelName, typeof modelName === 'string'));
6073
+
6029
6074
  var array = _recordArrays.FilteredRecordArray.create({
6030
6075
  query: query,
6031
6076
  modelName: modelName,
@@ -6040,15 +6085,34 @@ define('ember-data/-private/system/record-array-manager', ['exports', 'ember', '
6040
6085
  return array;
6041
6086
  };
6042
6087
 
6043
- RecordArrayManager.prototype.createAdapterPopulatedRecordArray = function createAdapterPopulatedRecordArray(modelName, query) {
6088
+ RecordArrayManager.prototype.createAdapterPopulatedRecordArray = function createAdapterPopulatedRecordArray(modelName, query, internalModels, payload) {
6089
+ (false && _ember.default.assert("recordArrayManger.createAdapterPopulatedRecordArray expects modelName not modelClass as the first param, received " + modelName, typeof modelName === 'string'));
6044
6090
 
6045
- var array = _recordArrays.AdapterPopulatedRecordArray.create({
6046
- modelName: modelName,
6047
- query: query,
6048
- content: _ember.default.A(),
6049
- store: this.store,
6050
- manager: this
6051
- });
6091
+
6092
+ var array = void 0;
6093
+ if (Array.isArray(internalModels)) {
6094
+ array = _recordArrays.AdapterPopulatedRecordArray.create({
6095
+ modelName: modelName,
6096
+ query: query,
6097
+ content: _ember.default.A(internalModels),
6098
+ store: this.store,
6099
+ manager: this,
6100
+ isLoaded: true,
6101
+ isUpdating: false,
6102
+ meta: (0, _cloneNull.default)(payload.meta),
6103
+ links: (0, _cloneNull.default)(payload.links)
6104
+ });
6105
+
6106
+ associateWithRecordArray(internalModels, array);
6107
+ } else {
6108
+ array = _recordArrays.AdapterPopulatedRecordArray.create({
6109
+ modelName: modelName,
6110
+ query: query,
6111
+ content: _ember.default.A(),
6112
+ store: this.store,
6113
+ manager: this
6114
+ });
6115
+ }
6052
6116
 
6053
6117
  this._adapterPopulatedRecordArrays.push(array);
6054
6118
 
@@ -6056,6 +6120,8 @@ define('ember-data/-private/system/record-array-manager', ['exports', 'ember', '
6056
6120
  };
6057
6121
 
6058
6122
  RecordArrayManager.prototype.registerFilteredRecordArray = function registerFilteredRecordArray(array, modelName, filter) {
6123
+ (false && _ember.default.assert("recordArrayManger.registerFilteredRecordArray expects modelName not modelClass as the second param, received " + modelName, typeof modelName === 'string'));
6124
+
6059
6125
 
6060
6126
  this.filteredRecordArraysFor(modelName).push(array);
6061
6127
  this.updateFilter(array, modelName, filter);
@@ -6133,6 +6199,57 @@ define('ember-data/-private/system/record-array-manager', ['exports', 'ember', '
6133
6199
 
6134
6200
  return false;
6135
6201
  }
6202
+
6203
+ function _updateLiveRecordArray(array, internalModels) {
6204
+ var modelsToAdd = [];
6205
+ var modelsToRemove = [];
6206
+
6207
+ for (var i = 0; i < internalModels.length; i++) {
6208
+ var internalModel = internalModels[i];
6209
+ var isDeleted = internalModel.isHiddenFromRecordArrays();
6210
+ var recordArrays = internalModel._recordArrays;
6211
+
6212
+ if (!isDeleted && !internalModel.isEmpty()) {
6213
+ if (!recordArrays.has(array)) {
6214
+ modelsToAdd.push(internalModel);
6215
+ recordArrays.add(array);
6216
+ }
6217
+ }
6218
+
6219
+ if (isDeleted) {
6220
+ modelsToRemove.push(internalModel);
6221
+ recordArrays.delete(array);
6222
+ }
6223
+ }
6224
+
6225
+ if (modelsToAdd.length > 0) {
6226
+ array._pushInternalModels(modelsToAdd);
6227
+ }
6228
+ if (modelsToRemove.length > 0) {
6229
+ array._removeInternalModels(modelsToRemove);
6230
+ }
6231
+ }
6232
+
6233
+ function removeFromAdapterPopulatedRecordArrays(internalModels) {
6234
+ for (var i = 0; i < internalModels.length; i++) {
6235
+ var internalModel = internalModels[i];
6236
+ var list = internalModel._recordArrays.list;
6237
+
6238
+ for (var j = 0; j < list.length; j++) {
6239
+ // TODO: group by arrays, so we can batch remove
6240
+ list[j]._removeInternalModels([internalModel]);
6241
+ }
6242
+
6243
+ internalModel._recordArrays.clear();
6244
+ }
6245
+ }
6246
+
6247
+ function associateWithRecordArray(internalModels, array) {
6248
+ for (var i = 0, l = internalModels.length; i < l; i++) {
6249
+ var internalModel = internalModels[i];
6250
+ internalModel._recordArrays.add(array);
6251
+ }
6252
+ }
6136
6253
  });
6137
6254
  define("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 (exports, _recordArray, _filteredRecordArray, _adapterPopulatedRecordArray) {
6138
6255
  "use strict";
@@ -6143,7 +6260,7 @@ define("ember-data/-private/system/record-arrays", ["exports", "ember-data/-priv
6143
6260
  exports.FilteredRecordArray = _filteredRecordArray.default;
6144
6261
  exports.AdapterPopulatedRecordArray = _adapterPopulatedRecordArray.default;
6145
6262
  });
6146
- define("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 (exports, _ember, _recordArray, _cloneNull) {
6263
+ define("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", "ember-data/-private/system/record-array-manager"], function (exports, _ember, _recordArray, _cloneNull, _recordArrayManager) {
6147
6264
  "use strict";
6148
6265
 
6149
6266
  exports.__esModule = true;
@@ -6188,11 +6305,7 @@ define("ember-data/-private/system/record-arrays/adapter-populated-record-array"
6188
6305
  links: (0, _cloneNull.default)(payload.links)
6189
6306
  });
6190
6307
 
6191
- for (var i = 0, l = internalModels.length; i < l; i++) {
6192
- var internalModel = internalModels[i];
6193
-
6194
- internalModel._recordArrays.add(this);
6195
- }
6308
+ (0, _recordArrayManager.associateWithRecordArray)(internalModels, this);
6196
6309
 
6197
6310
  // TODO: should triggering didLoad event be the last action of the runLoop?
6198
6311
  _ember.default.run.once(this, 'trigger', 'didLoad');
@@ -6692,7 +6805,7 @@ define('ember-data/-private/system/references/belongs-to', ['exports', 'ember-da
6692
6805
  ```
6693
6806
 
6694
6807
  @method meta
6695
- @return {Object} The meta information for the belongs-oo relationship.
6808
+ @return {Object} The meta information for the belongs-to relationship.
6696
6809
  */
6697
6810
  BelongsToReference.prototype.meta = function () {
6698
6811
  return this.belongsToRelationship.meta;
@@ -6749,7 +6862,12 @@ define('ember-data/-private/system/references/belongs-to', ['exports', 'ember-da
6749
6862
  var record = void 0;
6750
6863
 
6751
6864
  if (data instanceof _model.default) {
6752
- if ((0, _features.default)('ds-overhaul-references')) {}
6865
+ if ((0, _features.default)('ds-overhaul-references')) {
6866
+ (false && !(false) && _ember.default.deprecate("BelongsToReference#push(DS.Model) is deprecated. Update relationship via `model.set('relationshipName', value)` instead.", false, {
6867
+ id: 'ds.references.belongs-to.push-record',
6868
+ until: '3.0'
6869
+ }));
6870
+ }
6753
6871
  record = data;
6754
6872
  } else {
6755
6873
  record = _this.store.push(data);
@@ -7055,7 +7173,7 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'e
7055
7173
  commentsRef.ids(); // ['1']
7056
7174
  ```
7057
7175
 
7058
- @method remoteType
7176
+ @method ids
7059
7177
  @return {Array} The ids in this has-many relationship
7060
7178
  */
7061
7179
  HasManyReference.prototype.ids = function () {
@@ -7067,8 +7185,7 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'e
7067
7185
  };
7068
7186
 
7069
7187
  /**
7070
- The link Ember Data will use to fetch or reload this has-many
7071
- relationship.
7188
+ The meta data for the has-many relationship.
7072
7189
 
7073
7190
  Example
7074
7191
 
@@ -7158,14 +7275,24 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'e
7158
7275
  return resolve(objectOrPromise).then(function (payload) {
7159
7276
  var array = payload;
7160
7277
 
7161
- if ((0, _features.default)("ds-overhaul-references")) {}
7278
+ if ((0, _features.default)("ds-overhaul-references")) {
7279
+ (false && !(!Array.isArray(payload)) && _ember.default.deprecate("HasManyReference#push(array) is deprecated. Push a JSON-API document instead.", !Array.isArray(payload), {
7280
+ id: 'ds.references.has-many.push-array',
7281
+ until: '3.0'
7282
+ }));
7283
+ }
7162
7284
 
7163
7285
  var useLegacyArrayPush = true;
7164
7286
  if (typeof payload === "object" && payload.data) {
7165
7287
  array = payload.data;
7166
7288
  useLegacyArrayPush = array.length && array[0].data;
7167
7289
 
7168
- if ((0, _features.default)('ds-overhaul-references')) {}
7290
+ if ((0, _features.default)('ds-overhaul-references')) {
7291
+ (false && !(!useLegacyArrayPush) && _ember.default.deprecate("HasManyReference#push() expects a valid JSON-API document.", !useLegacyArrayPush, {
7292
+ id: 'ds.references.has-many.push-invalid-json-api',
7293
+ until: '3.0'
7294
+ }));
7295
+ }
7169
7296
  }
7170
7297
 
7171
7298
  if (!(0, _features.default)('ds-overhaul-references')) {
@@ -7177,11 +7304,21 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'e
7177
7304
  internalModels = array.map(function (obj) {
7178
7305
  var record = _this.store.push(obj);
7179
7306
 
7307
+ if (false) {
7308
+ var relationshipMeta = _this.hasManyRelationship.relationshipMeta;
7309
+ }
7310
+
7180
7311
  return record._internalModel;
7181
7312
  });
7182
7313
  } else {
7183
7314
  var records = _this.store.push(payload);
7184
7315
  internalModels = _ember.default.A(records).mapBy('_internalModel');
7316
+
7317
+ if (false) {
7318
+ internalModels.forEach(function (internalModel) {
7319
+ var relationshipMeta = _this.hasManyRelationship.relationshipMeta;
7320
+ });
7321
+ }
7185
7322
  }
7186
7323
 
7187
7324
  _this.hasManyRelationship.computeChanges(internalModels);
@@ -7547,6 +7684,10 @@ define('ember-data/-private/system/relationship-meta', ['exports', 'ember-inflec
7547
7684
  isRelationship: true
7548
7685
  };
7549
7686
 
7687
+ if (false) {
7688
+ result.parentType = meta.parentType;
7689
+ }
7690
+
7550
7691
  return result;
7551
7692
  }
7552
7693
  });
@@ -7644,6 +7785,9 @@ define('ember-data/-private/system/relationships/belongs-to', ['exports', 'ember
7644
7785
  userEnteredModelName = (0, _normalizeModelName.default)(userEnteredModelName);
7645
7786
  }
7646
7787
 
7788
+ (false && _ember.default.assert("The first argument to DS.belongsTo must be a string representing a model type key, not an instance of " + _ember.default.inspect(userEnteredModelName) + ". E.g., to define a relation to the Person model, use DS.belongsTo('person')", typeof userEnteredModelName === 'string' || typeof userEnteredModelName === 'undefined'));
7789
+
7790
+
7647
7791
  opts = opts || {};
7648
7792
 
7649
7793
  var meta = {
@@ -7657,9 +7801,17 @@ define('ember-data/-private/system/relationships/belongs-to', ['exports', 'ember
7657
7801
 
7658
7802
  return _ember.default.computed({
7659
7803
  get: function (key) {
7660
- if (opts.hasOwnProperty('serialize')) {}
7804
+ if (opts.hasOwnProperty('serialize')) {
7805
+ (false && _ember.default.warn('You provided a serialize option on the "' + key + '" property in the "' + this._internalModel.modelName + '" class, this belongs in the serializer. See DS.Serializer and it\'s implementations http://emberjs.com/api/data/classes/DS.Serializer.html', false, {
7806
+ id: 'ds.model.serialize-option-in-belongs-to'
7807
+ }));
7808
+ }
7661
7809
 
7662
- if (opts.hasOwnProperty('embedded')) {}
7810
+ if (opts.hasOwnProperty('embedded')) {
7811
+ (false && _ember.default.warn('You provided an embedded option on the "' + key + '" property in the "' + this._internalModel.modelName + '" class, this belongs in the serializer. See DS.EmbeddedRecordsMixin http://emberjs.com/api/data/classes/DS.EmbeddedRecordsMixin.html', false, {
7812
+ id: 'ds.model.embedded-option-in-belongs-to'
7813
+ }));
7814
+ }
7663
7815
 
7664
7816
  return this._internalModel._relationships.get(key).getRecord();
7665
7817
  },
@@ -7737,7 +7889,12 @@ define('ember-data/-private/system/relationships/ext', ['exports', 'ember', 'emb
7737
7889
  meta.key = name;
7738
7890
  modelName = (0, _relationshipMeta.typeForRelationshipMeta)(meta);
7739
7891
 
7892
+ (false && _ember.default.assert('You specified a hasMany (' + meta.type + ') on ' + meta.parentType + ' but ' + meta.type + ' was not found.', modelName));
7893
+
7894
+
7740
7895
  if (!types.includes(modelName)) {
7896
+ (false && _ember.default.assert('Trying to sideload ' + name + ' on ' + _this.toString() + ' but the type doesn\'t exist.', !!modelName));
7897
+
7741
7898
  types.push(modelName);
7742
7899
  }
7743
7900
  }
@@ -7881,6 +8038,9 @@ define('ember-data/-private/system/relationships/has-many', ['exports', 'ember',
7881
8038
  type = undefined;
7882
8039
  }
7883
8040
 
8041
+ (false && _ember.default.assert('The first argument to DS.hasMany must be a string representing a model type key, not an instance of ' + _ember.default.inspect(type) + '. E.g., to define a relation to the Comment model, use DS.hasMany(\'comment\')', typeof type === 'string' || typeof type === 'undefined'));
8042
+
8043
+
7884
8044
  options = options || {};
7885
8045
 
7886
8046
  if (typeof type === 'string') {
@@ -7905,6 +8065,13 @@ define('ember-data/-private/system/relationships/has-many', ['exports', 'ember',
7905
8065
  return this._internalModel._relationships.get(key).getRecords();
7906
8066
  },
7907
8067
  set: function (key, records) {
8068
+ (false && _ember.default.assert('You must pass an array of records to set a hasMany relationship', (0, _isArrayLike.default)(records)));
8069
+ (false && _ember.default.assert('All elements of a hasMany relationship must be instances of DS.Model, you passed ' + _ember.default.inspect(records), function () {
8070
+ return _ember.default.A(records).every(function (record) {
8071
+ return record.hasOwnProperty('_internalModel') === true;
8072
+ });
8073
+ }()));
8074
+
7908
8075
 
7909
8076
  var relationship = this._internalModel._relationships.get(key);
7910
8077
  relationship.clear();
@@ -8176,6 +8343,8 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8176
8343
  if (this._isLHS(modelName, relationshipName)) {
8177
8344
  return this._lhsPayloads[id];
8178
8345
  } else {
8346
+ (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._lhsModelName + ':' + this._lhsRelationshipName + '<->' + this._rhsModelName + ':' + this._rhsRelationshipName, this._isRHS(modelName, relationshipName)));
8347
+
8179
8348
  return this._rhsPayloads[id];
8180
8349
  }
8181
8350
  };
@@ -8190,6 +8359,8 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8190
8359
  if (this._isLHS(modelName, relationshipName)) {
8191
8360
  delete this._lhsPayloads[id];
8192
8361
  } else {
8362
+ (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._lhsModelName + ':' + this._lhsRelationshipName + '<->' + this._rhsModelName + ':' + this._rhsRelationshipName, this._isRHS(modelName, relationshipName)));
8363
+
8193
8364
  delete this._rhsPayloads[id];
8194
8365
  }
8195
8366
  };
@@ -8235,6 +8406,8 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8235
8406
  inverseIdToPayloads = this._rhsPayloads;
8236
8407
  inverseIsMany = this._rhsRelationshipIsMany;
8237
8408
  } else {
8409
+ (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._lhsModelName + ':' + this._lhsRelationshipName + '<->' + this._rhsModelName + ':' + this._rhsRelationshipName, this._isRHS(modelName, relationshipName)));
8410
+
8238
8411
  previousPayload = this._rhsPayloads[id];
8239
8412
  idToPayloads = this._rhsPayloads;
8240
8413
  inverseIdToPayloads = this._lhsPayloads;
@@ -8276,13 +8449,7 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8276
8449
  // Then we will initially have set user:2 as having helicopter:1, which we
8277
8450
  // need to remove before adding helicopter:1 to user:4
8278
8451
  //
8279
- // only remove relationship information before adding if there is relationshipData.data
8280
- // * null is considered new information "empty", and it should win
8281
- // * undefined is NOT considered new information, we should keep original state
8282
- // * anything else is considered new information, and it should win
8283
- if (relationshipData.data !== undefined) {
8284
- this._removeInverse(id, previousPayload, inverseIdToPayloads);
8285
- }
8452
+ this._removeInverse(id, previousPayload, inverseIdToPayloads);
8286
8453
  idToPayloads[id] = relationshipData;
8287
8454
  this._populateInverse(relationshipData, inverseRelationshipData, inverseIdToPayloads, inverseIsMany);
8288
8455
  }
@@ -8493,19 +8660,6 @@ define('ember-data/-private/system/relationships/state/belongs-to', ['exports',
8493
8660
  this.notifyBelongsToChanged();
8494
8661
  };
8495
8662
 
8496
- BelongsToRelationship.prototype.removeCompletelyFromOwn = function removeCompletelyFromOwn(internalModel) {
8497
- _Relationship.prototype.removeCompletelyFromOwn.call(this, internalModel);
8498
-
8499
- if (this.canonicalState === internalModel) {
8500
- this.canonicalState = null;
8501
- }
8502
-
8503
- if (this.inverseInternalModel === internalModel) {
8504
- this.inverseInternalModel = null;
8505
- this.notifyBelongsToChanged();
8506
- }
8507
- };
8508
-
8509
8663
  BelongsToRelationship.prototype.flushCanonical = function flushCanonical() {
8510
8664
  //temporary fix to not remove newly created records if server returned null.
8511
8665
  //TODO remove once we have proper diffing
@@ -8536,6 +8690,7 @@ define('ember-data/-private/system/relationships/state/belongs-to', ['exports',
8536
8690
 
8537
8691
  BelongsToRelationship.prototype.setRecordPromise = function setRecordPromise(newPromise) {
8538
8692
  var content = newPromise.get && newPromise.get('content');
8693
+ (false && _ember.default.assert("You passed in a promise that did not originate from an EmberData relationship. You can only pass promises that come from a belongsTo or hasMany relationship to the get call.", content !== undefined));
8539
8694
 
8540
8695
  this.setInternalModel(content ? content._internalModel : content);
8541
8696
  };
@@ -8607,6 +8762,7 @@ define('ember-data/-private/system/relationships/state/belongs-to', ['exports',
8607
8762
  return null;
8608
8763
  }
8609
8764
  var toReturn = this.inverseInternalModel.getRecord();
8765
+ (false && _ember.default.assert("You looked up the '" + this.key + "' relationship on a '" + this.internalModel.modelName + "' with id " + this.internalModel.id + " but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async (`DS.belongsTo({ async: true })`)", toReturn === null || !toReturn.get('isEmpty')));
8610
8766
 
8611
8767
  return toReturn;
8612
8768
  }
@@ -8628,6 +8784,8 @@ define('ember-data/-private/system/relationships/state/belongs-to', ['exports',
8628
8784
  };
8629
8785
 
8630
8786
  BelongsToRelationship.prototype.updateData = function updateData(data, initial) {
8787
+ (false && _ember.default.assert('Ember Data expected the data for the ' + this.key + ' relationship on a ' + this.internalModel.toString() + ' to be in a JSON API format and include an `id` and `type` property but it found ' + _ember.default.inspect(data) + '. Please check your serializer and make sure it is serializing the relationship payload into a JSON API format.', data === null || data.id !== undefined && data.type !== undefined));
8788
+
8631
8789
  var internalModel = this.store._pushResourceIdentifier(this, data);
8632
8790
  if (initial) {
8633
8791
  this.setInitialCanonicalInternalModel(internalModel);
@@ -8684,7 +8842,9 @@ define("ember-data/-private/system/relationships/state/create", ["exports", "emb
8684
8842
 
8685
8843
  if (shouldFindInverse(relationshipMeta)) {
8686
8844
  inverse = internalModel.type.inverseFor(relationshipMeta.key, store);
8687
- } else {}
8845
+ } else if (false) {
8846
+ internalModel.type.typeForRelationship(relationshipMeta.key, store);
8847
+ }
8688
8848
 
8689
8849
  if (inverse) {
8690
8850
  inverseKey = inverse.name;
@@ -8710,13 +8870,6 @@ define("ember-data/-private/system/relationships/state/create", ["exports", "emb
8710
8870
  return !!this.initializedRelationships[key];
8711
8871
  };
8712
8872
 
8713
- Relationships.prototype.forEach = function forEach(cb) {
8714
- var rels = this.initializedRelationships;
8715
- Object.keys(rels).forEach(function (name) {
8716
- cb(name, rels[name]);
8717
- });
8718
- };
8719
-
8720
8873
  Relationships.prototype.get = function get(key) {
8721
8874
  var relationships = this.initializedRelationships;
8722
8875
  var relationship = relationships[key];
@@ -8900,26 +9053,6 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
8900
9053
  _Relationship.prototype.removeCanonicalInternalModelFromOwn.call(this, internalModel, idx);
8901
9054
  };
8902
9055
 
8903
- ManyRelationship.prototype.removeCompletelyFromOwn = function removeCompletelyFromOwn(internalModel) {
8904
- _Relationship.prototype.removeCompletelyFromOwn.call(this, internalModel);
8905
-
8906
- var canonicalIndex = this.canonicalState.indexOf(internalModel);
8907
-
8908
- if (canonicalIndex !== -1) {
8909
- this.canonicalState.splice(canonicalIndex, 1);
8910
- }
8911
-
8912
- var manyArray = this._manyArray;
8913
-
8914
- if (manyArray) {
8915
- var idx = manyArray.currentState.indexOf(internalModel);
8916
-
8917
- if (idx !== -1) {
8918
- manyArray.internalReplace(idx, 1);
8919
- }
8920
- }
8921
- };
8922
-
8923
9056
  ManyRelationship.prototype.flushCanonical = function flushCanonical() {
8924
9057
  if (this._manyArray) {
8925
9058
  this._manyArray.flushCanonical();
@@ -8996,36 +9129,33 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
8996
9129
  };
8997
9130
 
8998
9131
  ManyRelationship.prototype.setInitialInternalModels = function setInitialInternalModels(internalModels) {
8999
- if (Array.isArray(internalModels) === false || internalModels.length === 0) {
9000
- return;
9001
- }
9002
-
9003
- for (var i = 0; i < internalModels.length; i++) {
9004
- var internalModel = internalModels[i];
9005
- if (this.canonicalMembers.has(internalModel)) {
9006
- continue;
9007
- }
9132
+ var _this2 = this;
9008
9133
 
9009
- this.canonicalMembers.add(internalModel);
9010
- this.members.add(internalModel);
9011
- this.setupInverseRelationship(internalModel);
9134
+ if (!internalModels) {
9135
+ return;
9012
9136
  }
9013
9137
 
9014
- this.canonicalState = this.canonicalMembers.toArray();
9138
+ var args = [0, this.canonicalState.length].concat(internalModels);
9139
+ this.canonicalState.splice.apply(this.canonicalState, args);
9140
+ internalModels.forEach(function (internalModel) {
9141
+ _this2.canonicalMembers.add(internalModel);
9142
+ _this2.members.add(internalModel);
9143
+ _this2.setupInverseRelationship(internalModel);
9144
+ });
9015
9145
  };
9016
9146
 
9017
9147
  ManyRelationship.prototype.fetchLink = function fetchLink() {
9018
- var _this2 = this;
9148
+ var _this3 = this;
9019
9149
 
9020
9150
  return this.store.findHasMany(this.internalModel, this.link, this.relationshipMeta).then(function (records) {
9021
9151
  if (records.hasOwnProperty('meta')) {
9022
- _this2.updateMeta(records.meta);
9152
+ _this3.updateMeta(records.meta);
9023
9153
  }
9024
- _this2.store._backburner.join(function () {
9025
- _this2.updateInternalModelsFromAdapter(records);
9026
- _this2.manyArray.set('isLoaded', true);
9154
+ _this3.store._backburner.join(function () {
9155
+ _this3.updateInternalModelsFromAdapter(records);
9156
+ _this3.manyArray.set('isLoaded', true);
9027
9157
  });
9028
- return _this2.manyArray;
9158
+ return _this3.manyArray;
9029
9159
  });
9030
9160
  };
9031
9161
 
@@ -9048,7 +9178,7 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9048
9178
  };
9049
9179
 
9050
9180
  ManyRelationship.prototype.getRecords = function getRecords() {
9051
- var _this3 = this;
9181
+ var _this4 = this;
9052
9182
 
9053
9183
  //TODO(Igor) sync server here, once our syncing is not stupid
9054
9184
  var manyArray = this.manyArray;
@@ -9059,7 +9189,7 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9059
9189
  promise = this.findRecords();
9060
9190
  } else {
9061
9191
  promise = this.findLink().then(function () {
9062
- return _this3.findRecords();
9192
+ return _this4.findRecords();
9063
9193
  });
9064
9194
  }
9065
9195
  } else {
@@ -9067,6 +9197,8 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9067
9197
  }
9068
9198
  return this._updateLoadingPromise(promise, manyArray);
9069
9199
  } else {
9200
+ (false && Ember.assert('You looked up the \'' + this.key + '\' relationship on a \'' + this.internalModel.type.modelName + '\' with id ' + this.internalModel.id + ' but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async (\'DS.hasMany({ async: true })\')', manyArray.isEvery('isEmpty', false)));
9201
+
9070
9202
 
9071
9203
  //TODO(Igor) WTF DO I DO HERE?
9072
9204
  // TODO @runspired equal WTFs to Igor
@@ -9086,20 +9218,6 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9086
9218
  }
9087
9219
  };
9088
9220
 
9089
- ManyRelationship.prototype.destroy = function destroy() {
9090
- _Relationship.prototype.destroy.call(this);
9091
- var manyArray = this._manyArray;
9092
- if (manyArray) {
9093
- manyArray.destroy();
9094
- }
9095
-
9096
- var proxy = this.__loadingPromise;
9097
-
9098
- if (proxy) {
9099
- proxy.destroy();
9100
- }
9101
- };
9102
-
9103
9221
  _createClass(ManyRelationship, [{
9104
9222
  key: '_loadingPromise',
9105
9223
  get: function () {
@@ -9141,7 +9259,7 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9141
9259
  return set;
9142
9260
  }
9143
9261
  });
9144
- define('ember-data/-private/system/relationships/state/relationship', ['exports', 'ember-data/-private/system/ordered-set', 'ember-data/-private/system/normalize-link', 'ember'], function (exports, _orderedSet, _normalizeLink2, _ember) {
9262
+ define('ember-data/-private/system/relationships/state/relationship', ['exports', 'ember-data/-private/system/ordered-set', 'ember-data/-private/system/normalize-link'], function (exports, _orderedSet, _normalizeLink2) {
9145
9263
  'use strict';
9146
9264
 
9147
9265
  exports.__esModule = true;
@@ -9170,8 +9288,6 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9170
9288
  };
9171
9289
  }();
9172
9290
 
9173
- var guidFor = _ember.default.guidFor;
9174
-
9175
9291
  var Relationship = function () {
9176
9292
  function Relationship(store, internalModel, inverseKey, relationshipMeta) {
9177
9293
  var async = relationshipMeta.options.async;
@@ -9194,14 +9310,9 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9194
9310
  this.hasLoaded = false;
9195
9311
  }
9196
9312
 
9197
- Relationship.prototype._inverseIsAsync = function _inverseIsAsync() {
9198
- if (!this.inverseKey || !this.inverseInternalModel) {
9199
- return false;
9200
- }
9201
- return this.inverseInternalModel._relationships.get(this.inverseKey).isAsync;
9202
- };
9203
-
9204
9313
  Relationship.prototype.removeInverseRelationships = function removeInverseRelationships() {
9314
+ var _this = this;
9315
+
9205
9316
  if (!this.inverseKey) {
9206
9317
  return;
9207
9318
  }
@@ -9209,13 +9320,12 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9209
9320
  var allMembers =
9210
9321
  // we actually want a union of members and canonicalMembers
9211
9322
  // they should be disjoint but currently are not due to a bug
9212
- this.members.list.concat(this.canonicalMembers.list);
9323
+ this.members.toArray().concat(this.canonicalMembers.toArray());
9213
9324
 
9214
- for (var i = 0; i < allMembers.length; i++) {
9215
- var inverseInternalModel = allMembers[i];
9216
- var relationship = inverseInternalModel._relationships.get(this.inverseKey);
9325
+ allMembers.forEach(function (inverseInternalModel) {
9326
+ var relationship = inverseInternalModel._relationships.get(_this.inverseKey);
9217
9327
  relationship.inverseDidDematerialize();
9218
- }
9328
+ });
9219
9329
  };
9220
9330
 
9221
9331
  Relationship.prototype.inverseDidDematerialize = function inverseDidDematerialize() {};
@@ -9240,18 +9350,18 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9240
9350
  };
9241
9351
 
9242
9352
  Relationship.prototype.removeInternalModels = function removeInternalModels(internalModels) {
9243
- var _this = this;
9353
+ var _this2 = this;
9244
9354
 
9245
9355
  internalModels.forEach(function (internalModel) {
9246
- return _this.removeInternalModel(internalModel);
9356
+ return _this2.removeInternalModel(internalModel);
9247
9357
  });
9248
9358
  };
9249
9359
 
9250
9360
  Relationship.prototype.addInternalModels = function addInternalModels(internalModels, idx) {
9251
- var _this2 = this;
9361
+ var _this3 = this;
9252
9362
 
9253
9363
  internalModels.forEach(function (internalModel) {
9254
- _this2.addInternalModel(internalModel, idx);
9364
+ _this3.addInternalModel(internalModel, idx);
9255
9365
  if (idx !== undefined) {
9256
9366
  idx++;
9257
9367
  }
@@ -9294,7 +9404,7 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9294
9404
  var _relationships = internalModel._implicitRelationships;
9295
9405
  var _relationship = _relationships[this.inverseKeyForImplicit];
9296
9406
  if (!_relationship) {
9297
- _relationship = _relationships[this.inverseKeyForImplicit] = new Relationship(this.store, internalModel, this.key, { options: { async: this.isAsync } });
9407
+ _relationship = _relationships[this.inverseKeyForImplicit] = new Relationship(this.store, internalModel, this.key, { options: {} });
9298
9408
  }
9299
9409
  _relationship.addCanonicalInternalModel(this.internalModel);
9300
9410
  }
@@ -9332,7 +9442,7 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9332
9442
  internalModel._relationships.get(this.inverseKey).addInternalModel(this.internalModel);
9333
9443
  } else {
9334
9444
  if (!internalModel._implicitRelationships[this.inverseKeyForImplicit]) {
9335
- internalModel._implicitRelationships[this.inverseKeyForImplicit] = new Relationship(this.store, internalModel, this.key, { options: { async: this.isAsync } });
9445
+ internalModel._implicitRelationships[this.inverseKeyForImplicit] = new Relationship(this.store, internalModel, this.key, { options: {} });
9336
9446
  }
9337
9447
  internalModel._implicitRelationships[this.inverseKeyForImplicit].addInternalModel(this.internalModel);
9338
9448
  }
@@ -9364,6 +9474,7 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9364
9474
 
9365
9475
  Relationship.prototype.removeInternalModelFromOwn = function removeInternalModelFromOwn(internalModel) {
9366
9476
  this.members.delete(internalModel);
9477
+ this.notifyRecordRelationshipRemoved(internalModel);
9367
9478
  this.internalModel.updateRecordArrays();
9368
9479
  };
9369
9480
 
@@ -9380,38 +9491,6 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9380
9491
  this.flushCanonicalLater();
9381
9492
  };
9382
9493
 
9383
- Relationship.prototype.removeCompletelyFromInverse = function removeCompletelyFromInverse() {
9384
- var _this3 = this;
9385
-
9386
- if (!this.inverseKey) {
9387
- return;
9388
- }
9389
-
9390
- // we actually want a union of members and canonicalMembers
9391
- // they should be disjoint but currently are not due to a bug
9392
- var seen = Object.create(null);
9393
- var internalModel = this.internalModel;
9394
-
9395
- var unload = function (inverseInternalModel) {
9396
- var id = guidFor(inverseInternalModel);
9397
-
9398
- if (seen[id] === undefined) {
9399
- var relationship = inverseInternalModel._relationships.get(_this3.inverseKey);
9400
- relationship.removeCompletelyFromOwn(internalModel);
9401
- seen[id] = true;
9402
- }
9403
- };
9404
-
9405
- this.members.forEach(unload);
9406
- this.canonicalMembers.forEach(unload);
9407
- };
9408
-
9409
- Relationship.prototype.removeCompletelyFromOwn = function removeCompletelyFromOwn(internalModel) {
9410
- this.canonicalMembers.delete(internalModel);
9411
- this.members.delete(internalModel);
9412
- this.internalModel.updateRecordArrays();
9413
- };
9414
-
9415
9494
  Relationship.prototype.flushCanonical = function flushCanonical() {
9416
9495
  var list = this.members.list;
9417
9496
  this.willSync = false;
@@ -9439,14 +9518,16 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9439
9518
  this.store._updateRelationshipState(this);
9440
9519
  };
9441
9520
 
9442
- Relationship.prototype.updateLink = function updateLink(link, initial) {
9521
+ Relationship.prototype.updateLink = function updateLink(link) {
9522
+ (false && Ember.warn('You pushed a record of type \'' + this.internalModel.modelName + '\' with a relationship \'' + this.key + '\' configured as \'async: false\'. You\'ve included a link but no primary data, this may be an error in your payload.', this.isAsync || this.hasData, {
9523
+ id: 'ds.store.push-link-for-sync-relationship'
9524
+ }));
9525
+ (false && Ember.assert('You have pushed a record of type \'' + this.internalModel.modelName + '\' with \'' + this.key + '\' as a link, but the value of that link is not a string.', typeof link === 'string' || link === null));
9526
+
9443
9527
 
9444
9528
  this.link = link;
9445
9529
  this.linkPromise = null;
9446
-
9447
- if (!initial) {
9448
- this.internalModel.notifyPropertyChange(this.key);
9449
- }
9530
+ this.internalModel.notifyPropertyChange(this.key);
9450
9531
  };
9451
9532
 
9452
9533
  Relationship.prototype.findLink = function findLink() {
@@ -9469,6 +9550,8 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9469
9550
 
9470
9551
  Relationship.prototype.notifyRecordRelationshipAdded = function notifyRecordRelationshipAdded() {};
9471
9552
 
9553
+ Relationship.prototype.notifyRecordRelationshipRemoved = function notifyRecordRelationshipRemoved() {};
9554
+
9472
9555
  Relationship.prototype.setHasData = function setHasData(value) {
9473
9556
  this.hasData = value;
9474
9557
  };
@@ -9519,8 +9602,6 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9519
9602
 
9520
9603
  Relationship.prototype.updateData = function updateData() {};
9521
9604
 
9522
- Relationship.prototype.destroy = function destroy() {};
9523
-
9524
9605
  _createClass(Relationship, [{
9525
9606
  key: 'parentType',
9526
9607
  get: function () {
@@ -10042,7 +10123,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10042
10123
 
10043
10124
  Note: When creating a new record using any of the above methods
10044
10125
  Ember Data will update `DS.RecordArray`s such as those returned by
10045
- `store#peekAll()` or `store#findAll()`. This means any
10126
+ `store#peekAll()`, `store#findAll()` or `store#filter()`. This means any
10046
10127
  data bindings or computed properties that depend on the RecordArray
10047
10128
  will automatically be synced to include the new or updated record
10048
10129
  values.
@@ -10124,7 +10205,12 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10124
10205
  @param {Object} options an options hash
10125
10206
  */
10126
10207
  serialize: function (record, options) {
10127
- if (true) {}
10208
+ if (true) {
10209
+ (false && !(false) && _ember.default.deprecate('Use of store.serialize is deprecated, use record.serialize instead.', false, {
10210
+ id: 'ds.store.serialize',
10211
+ until: '3.0'
10212
+ }));
10213
+ }
10128
10214
  var snapshot = record._internalModel.createSnapshot();
10129
10215
  return snapshot.serialize(options);
10130
10216
  },
@@ -10145,6 +10231,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10145
10231
  defaultAdapter: computed('adapter', function () {
10146
10232
  var adapter = get(this, 'adapter');
10147
10233
 
10234
+ (false && _ember.default.assert('You tried to set `adapter` property to an instance of `DS.Adapter`, where it should be a name', typeof adapter === 'string'));
10235
+
10236
+
10148
10237
  return this.adapterFor(adapter);
10149
10238
  }),
10150
10239
 
@@ -10176,6 +10265,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10176
10265
  @return {DS.Model} record
10177
10266
  */
10178
10267
  createRecord: function (modelName, inputProperties) {
10268
+ (false && _ember.default.assert('You need to pass a model name to the store\'s createRecord method', isPresent(modelName)));
10269
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
10270
+
10179
10271
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
10180
10272
  var properties = copy(inputProperties) || Object.create(null);
10181
10273
 
@@ -10197,9 +10289,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10197
10289
 
10198
10290
  // TODO @runspired this should also be coalesced into some form of internalModel.setState()
10199
10291
  internalModel.eachRelationship(function (key, descriptor) {
10200
- if (properties[key] !== undefined) {
10201
- internalModel._relationships.get(key).setHasData(true);
10202
- }
10292
+ internalModel._relationships.get(key).setHasData(true);
10203
10293
  });
10204
10294
 
10205
10295
  return record;
@@ -10280,6 +10370,14 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10280
10370
  // The default `model` hook in Ember.Route calls `find(modelName, id)`,
10281
10371
  // that's why we have to keep this method around even though `findRecord` is
10282
10372
  // the public way to get a record by modelName and id.
10373
+ (false && _ember.default.assert('Using store.find(type) has been removed. Use store.findAll(modelName) to retrieve all records for a given type.', arguments.length !== 1));
10374
+ (false && _ember.default.assert('Calling store.find(modelName, id, { preload: preload }) is no longer supported. Use store.findRecord(modelName, id, { preload: preload }) instead.', !options));
10375
+ (false && _ember.default.assert('You need to pass the model name and id to the store\'s find method', arguments.length === 2));
10376
+ (false && _ember.default.assert('You cannot pass \'' + id + '\' as id to the store\'s find method', typeof id === 'string' || typeof id === 'number'));
10377
+ (false && _ember.default.assert('Calling store.find() with a query object is no longer supported. Use store.query() instead.', typeof id !== 'object'));
10378
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
10379
+
10380
+
10283
10381
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
10284
10382
 
10285
10383
  return this.findRecord(normalizedModelName, id);
@@ -10460,6 +10558,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10460
10558
  @return {Promise} promise
10461
10559
  */
10462
10560
  findRecord: function (modelName, id, options) {
10561
+ (false && _ember.default.assert('You need to pass a model name to the store\'s findRecord method', isPresent(modelName)));
10562
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
10563
+ (false && _ember.default.assert(badIdFormatAssertion, typeof id === 'string' && id.length > 0 || typeof id === 'number' && !isNaN(id)));
10564
+
10463
10565
 
10464
10566
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
10465
10567
 
@@ -10535,6 +10637,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10535
10637
  @return {Promise} promise
10536
10638
  */
10537
10639
  findByIds: function (modelName, ids) {
10640
+ (false && _ember.default.assert('You need to pass a model name to the store\'s findByIds method', isPresent(modelName)));
10641
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
10642
+
10538
10643
 
10539
10644
  var promises = new Array(ids.length);
10540
10645
 
@@ -10561,6 +10666,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10561
10666
  var modelName = internalModel.modelName;
10562
10667
  var adapter = this.adapterFor(modelName);
10563
10668
 
10669
+ (false && _ember.default.assert('You tried to find a record but you have no adapter (for ' + modelName + ')', adapter));
10670
+ (false && _ember.default.assert('You tried to find a record but your adapter (for ' + modelName + ') does not implement \'findRecord\'', typeof adapter.findRecord === 'function'));
10671
+
10672
+
10564
10673
  return (0, _finders._find)(adapter, this, internalModel.type, internalModel.id, internalModel, options);
10565
10674
  },
10566
10675
  _scheduleFetchMany: function (internalModels) {
@@ -10653,6 +10762,12 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10653
10762
  }
10654
10763
 
10655
10764
  if (missingInternalModels.length) {
10765
+ (false && _ember.default.warn('Ember Data expected to find records with the following ids in the adapter response but they were missing: ' + inspect(missingInternalModels.map(function (r) {
10766
+ return r.id;
10767
+ })), false, {
10768
+ id: 'ds.store.missing-records-from-adapter'
10769
+ }));
10770
+
10656
10771
  rejectInternalModels(missingInternalModels);
10657
10772
  }
10658
10773
  }
@@ -10710,7 +10825,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10710
10825
  } else if (ids.length === 1) {
10711
10826
  var pair = seeking[groupedInternalModels[0].id];
10712
10827
  _fetchRecord(pair);
10713
- } else {}
10828
+ } else {
10829
+ (false && _ember.default.assert("You cannot return an empty array from adapter's method groupRecordsForFindMany", false));
10830
+ }
10714
10831
  }
10715
10832
  } else {
10716
10833
  for (var _i6 = 0; _i6 < totalItems; _i6++) {
@@ -10773,6 +10890,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10773
10890
  @return {DS.Model|null} record
10774
10891
  */
10775
10892
  peekRecord: function (modelName, id) {
10893
+ (false && _ember.default.assert('You need to pass a model name to the store\'s peekRecord method', isPresent(modelName)));
10894
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
10895
+
10776
10896
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
10777
10897
 
10778
10898
  if (this.hasRecordForId(normalizedModelName, id)) {
@@ -10799,6 +10919,11 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10799
10919
 
10800
10920
  var adapter = this.adapterFor(modelName);
10801
10921
 
10922
+ (false && _ember.default.assert('You cannot reload a record without an ID', id));
10923
+ (false && _ember.default.assert('You tried to reload a record but you have no adapter (for ' + modelName + ')', adapter));
10924
+ (false && _ember.default.assert('You tried to reload a record but your adapter does not implement \'findRecord\'', typeof adapter.findRecord === 'function' || typeof adapter.find === 'function'));
10925
+
10926
+
10802
10927
  return this._scheduleFetch(internalModel);
10803
10928
  },
10804
10929
 
@@ -10820,6 +10945,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10820
10945
  @return {Boolean}
10821
10946
  */
10822
10947
  hasRecordForId: function (modelName, id) {
10948
+ (false && _ember.default.assert('You need to pass a model name to the store\'s hasRecordForId method', isPresent(modelName)));
10949
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
10950
+
10823
10951
 
10824
10952
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
10825
10953
 
@@ -10840,6 +10968,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10840
10968
  @return {DS.Model} record
10841
10969
  */
10842
10970
  recordForId: function (modelName, id) {
10971
+ (false && _ember.default.assert('You need to pass a model name to the store\'s recordForId method', isPresent(modelName)));
10972
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
10973
+
10843
10974
 
10844
10975
  return this._internalModelForId(modelName, id).getRecord();
10845
10976
  },
@@ -10847,16 +10978,15 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10847
10978
  var trueId = (0, _coerceId.default)(id);
10848
10979
  var internalModel = this._internalModelsFor(modelName).get(trueId);
10849
10980
 
10850
- if (internalModel) {
10851
- if (internalModel.hasScheduledDestroy()) {
10852
- internalModel.destroySync();
10853
- return this._buildInternalModel(modelName, trueId);
10854
- } else {
10855
- return internalModel;
10856
- }
10981
+ if (!internalModel) {
10982
+ internalModel = this._buildInternalModel(modelName, trueId);
10857
10983
  } else {
10858
- return this._buildInternalModel(modelName, trueId);
10984
+ // if we already have an internalModel, we need to ensure any async teardown is cancelled
10985
+ // since we want it again.
10986
+ internalModel.cancelDestroy();
10859
10987
  }
10988
+
10989
+ return internalModel;
10860
10990
  },
10861
10991
  _internalModelDidReceiveRelationshipData: function (modelName, id, relationshipData) {
10862
10992
  this._relationshipsPayloads.push(modelName, id, relationshipData);
@@ -10902,6 +11032,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10902
11032
  findHasMany: function (internalModel, link, relationship) {
10903
11033
  var adapter = this.adapterFor(internalModel.modelName);
10904
11034
 
11035
+ (false && _ember.default.assert('You tried to load a hasMany relationship but you have no adapter (for ' + internalModel.modelName + ')', adapter));
11036
+ (false && _ember.default.assert('You tried to load a hasMany relationship from a specified \'link\' in the original payload but your adapter does not implement \'findHasMany\'', typeof adapter.findHasMany === 'function'));
11037
+
11038
+
10905
11039
  return (0, _finders._findHasMany)(adapter, this, internalModel, link, relationship);
10906
11040
  },
10907
11041
 
@@ -10917,6 +11051,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10917
11051
  findBelongsTo: function (internalModel, link, relationship) {
10918
11052
  var adapter = this.adapterFor(internalModel.modelName);
10919
11053
 
11054
+ (false && _ember.default.assert('You tried to load a belongsTo relationship but you have no adapter (for ' + internalModel.modelName + ')', adapter));
11055
+ (false && _ember.default.assert('You tried to load a belongsTo relationship from a specified \'link\' in the original payload but your adapter does not implement \'findBelongsTo\'', typeof adapter.findBelongsTo === 'function'));
11056
+
11057
+
10920
11058
  return (0, _finders._findBelongsTo)(adapter, this, internalModel, link, relationship);
10921
11059
  },
10922
11060
 
@@ -10960,15 +11098,22 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
10960
11098
  @return {Promise} promise
10961
11099
  */
10962
11100
  query: function (modelName, query) {
11101
+ (false && _ember.default.assert('You need to pass a model name to the store\'s query method', isPresent(modelName)));
11102
+ (false && _ember.default.assert('You need to pass a query hash to the store\'s query method', query));
11103
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
11104
+
10963
11105
 
10964
11106
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
10965
11107
  return this._query(normalizedModelName, query);
10966
11108
  },
10967
11109
  _query: function (modelName, query, array) {
10968
-
10969
- array = array || this.recordArrayManager.createAdapterPopulatedRecordArray(modelName, query);
11110
+ (false && _ember.default.assert('You need to pass a model name to the store\'s query method', isPresent(modelName)));
11111
+ (false && _ember.default.assert('You need to pass a query hash to the store\'s query method', query));
11112
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
10970
11113
 
10971
11114
  var adapter = this.adapterFor(modelName);
11115
+ (false && _ember.default.assert('You tried to load a query but you have no adapter (for ' + modelName + ')', adapter));
11116
+ (false && _ember.default.assert('You tried to load a query but your adapter does not implement \'query\'', typeof adapter.query === 'function'));
10972
11117
 
10973
11118
 
10974
11119
  var pA = (0, _promiseProxies.promiseArray)((0, _finders._query)(adapter, this, modelName, query, array));
@@ -11056,11 +11201,19 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11056
11201
  @return {Promise} promise which resolves with the found record or `null`
11057
11202
  */
11058
11203
  queryRecord: function (modelName, query) {
11204
+ (false && _ember.default.assert('You need to pass a model name to the store\'s queryRecord method', isPresent(modelName)));
11205
+ (false && _ember.default.assert('You need to pass a query hash to the store\'s queryRecord method', query));
11206
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
11207
+
11059
11208
 
11060
11209
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
11061
11210
 
11062
11211
  var adapter = this.adapterFor(normalizedModelName);
11063
11212
 
11213
+ (false && _ember.default.assert('You tried to make a query but you have no adapter (for ' + normalizedModelName + ')', adapter));
11214
+ (false && _ember.default.assert('You tried to make a query but your adapter does not implement \'queryRecord\'', typeof adapter.queryRecord === 'function'));
11215
+
11216
+
11064
11217
  return (0, _promiseProxies.promiseObject)((0, _finders._queryRecord)(adapter, this, modelName, query).then(function (internalModel) {
11065
11218
  // the promise returned by store.queryRecord is expected to resolve with
11066
11219
  // an instance of DS.Model
@@ -11224,6 +11377,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11224
11377
  @return {Promise} promise
11225
11378
  */
11226
11379
  findAll: function (modelName, options) {
11380
+ (false && _ember.default.assert('You need to pass a model name to the store\'s findAll method', isPresent(modelName)));
11381
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
11382
+
11227
11383
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
11228
11384
  var fetch = this._fetchAll(normalizedModelName, this.peekAll(normalizedModelName), options);
11229
11385
 
@@ -11244,6 +11400,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11244
11400
  var adapter = this.adapterFor(modelName);
11245
11401
  var sinceToken = this._internalModelsFor(modelName).metadata.since;
11246
11402
 
11403
+ (false && _ember.default.assert('You tried to load all records but you have no adapter (for ' + modelName + ')', adapter));
11404
+ (false && _ember.default.assert('You tried to load all records but your adapter does not implement \'findAll\'', typeof adapter.findAll === 'function'));
11405
+
11406
+
11247
11407
  if (options.reload) {
11248
11408
  set(array, 'isUpdating', true);
11249
11409
  return (0, _promiseProxies.promiseArray)((0, _finders._findAll)(adapter, this, modelName, sinceToken, options));
@@ -11275,11 +11435,11 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11275
11435
  @private
11276
11436
  */
11277
11437
  _didUpdateAll: function (modelName) {
11278
- var liveRecordArray = this.recordArrayManager.liveRecordArrayFor(modelName);
11279
-
11280
- set(liveRecordArray, 'isUpdating', false);
11438
+ this.recordArrayManager._didUpdateAll(modelName);
11281
11439
  },
11282
11440
  didUpdateAll: function (modelName) {
11441
+ (false && !(false) && _ember.default.deprecate('didUpdateAll was documented as private and will be removed in the next version of Ember Data.', false, { id: 'ember-data.didUpdateAll', until: '2.17.0' }));
11442
+
11283
11443
  return this._didUpdateAll(modelName);
11284
11444
  },
11285
11445
 
@@ -11304,12 +11464,11 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11304
11464
  @return {DS.RecordArray}
11305
11465
  */
11306
11466
  peekAll: function (modelName) {
11307
- var normalizedModelName = (0, _normalizeModelName.default)(modelName);
11308
- var liveRecordArray = this.recordArrayManager.liveRecordArrayFor(normalizedModelName);
11467
+ (false && _ember.default.assert('You need to pass a model name to the store\'s peekAll method', isPresent(modelName)));
11468
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
11309
11469
 
11310
- this.recordArrayManager.syncLiveRecordArray(liveRecordArray, normalizedModelName);
11311
-
11312
- return liveRecordArray;
11470
+ var normalizedModelName = (0, _normalizeModelName.default)(modelName);
11471
+ return this.recordArrayManager.liveRecordArrayFor(normalizedModelName);
11313
11472
  },
11314
11473
 
11315
11474
 
@@ -11325,6 +11484,8 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11325
11484
  @param {String} modelName
11326
11485
  */
11327
11486
  unloadAll: function (modelName) {
11487
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, !modelName || typeof modelName === 'string'));
11488
+
11328
11489
 
11329
11490
  if (arguments.length === 0) {
11330
11491
  this._identityMap.clear();
@@ -11380,8 +11541,13 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11380
11541
  @deprecated
11381
11542
  */
11382
11543
  filter: function (modelName, query, filter) {
11544
+ (false && _ember.default.assert('You need to pass a model name to the store\'s filter method', isPresent(modelName)));
11545
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
11546
+
11383
11547
 
11384
- if (!ENV.ENABLE_DS_FILTER) {}
11548
+ if (!ENV.ENABLE_DS_FILTER) {
11549
+ (false && _ember.default.assert('The filter API has been moved to a plugin. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page. https://github.com/ember-data/ember-data-filter', false));
11550
+ }
11385
11551
 
11386
11552
  var promise = void 0;
11387
11553
  var length = arguments.length;
@@ -11421,6 +11587,11 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11421
11587
  @return {boolean}
11422
11588
  */
11423
11589
  recordIsLoaded: function (modelName, id) {
11590
+ (false && !(false) && _ember.default.deprecate('Use of recordIsLoaded is deprecated, use hasRecordForId instead.', false, {
11591
+ id: 'ds.store.recordIsLoaded',
11592
+ until: '3.0'
11593
+ }));
11594
+
11424
11595
  return this.hasRecordForId(modelName, id);
11425
11596
  },
11426
11597
 
@@ -11470,8 +11641,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11470
11641
  var operation = void 0;
11471
11642
 
11472
11643
  if (internalModel.currentState.stateName === 'root.deleted.saved') {
11473
- resolver.resolve();
11474
- continue;
11644
+ return resolver.resolve();
11475
11645
  } else if (internalModel.isNew()) {
11476
11646
  operation = 'createRecord';
11477
11647
  } else if (internalModel.isDeleted()) {
@@ -11505,7 +11675,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11505
11675
  // normalize relationship IDs into records
11506
11676
  this.updateId(internalModel, data);
11507
11677
  this._setupRelationshipsForModel(internalModel, data);
11508
- } else {}
11678
+ } else {
11679
+ (false && _ember.default.assert('Your ' + internalModel.modelName + ' record was saved to the server, but the response does not have an id and no id has been set client side. Records must have ids. Please update the server response to provide an id in the response or generate the id on the client side either before saving the record or while normalizing the response.', internalModel.id));
11680
+ }
11509
11681
 
11510
11682
  //We first make sure the primary data has been updated
11511
11683
  //TODO try to move notification to the user to the end of the runloop
@@ -11556,19 +11728,21 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11556
11728
  var id = (0, _coerceId.default)(data.id);
11557
11729
 
11558
11730
  // ID absolutely can't be missing if the oldID is empty (missing Id in response for a new record)
11559
-
11731
+ (false && _ember.default.assert('\'' + modelName + '\' was saved to the server, but the response does not have an id and your record does not either.', !(id === null && oldId === null)));
11560
11732
 
11561
11733
  // ID absolutely can't be different than oldID if oldID is not null
11562
11734
 
11735
+ (false && _ember.default.assert('\'' + modelName + ':' + oldId + '\' was saved to the server, but the response returned the new id \'' + id + '\'. The store cannot assign a new id to a record that already has an id.', !(oldId !== null && id !== oldId)));
11563
11736
 
11564
11737
  // ID can be null if oldID is not null (altered ID in response for a record)
11565
11738
  // however, this is more than likely a developer error.
11739
+
11566
11740
  if (oldId !== null && id === null) {
11741
+ (false && _ember.default.warn('Your ' + modelName + ' record was saved to the server, but the response does not have an id.', !(oldId !== null && id === null)));
11742
+
11567
11743
  return;
11568
11744
  }
11569
11745
 
11570
- var existingInternalModel = this._existingInternalModelForId(modelName, id);
11571
-
11572
11746
  this._internalModelsFor(internalModel.modelName).set(id, internalModel);
11573
11747
 
11574
11748
  internalModel.setId(id);
@@ -11664,6 +11838,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11664
11838
  @return {DS.Model}
11665
11839
  */
11666
11840
  modelFor: function (modelName) {
11841
+ (false && _ember.default.assert('You need to pass a model name to the store\'s modelFor method', isPresent(modelName)));
11842
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
11843
+
11667
11844
 
11668
11845
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
11669
11846
 
@@ -11696,7 +11873,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11696
11873
  // interopt with the future
11697
11874
  var klass = (0, _utils.getOwner)(this).factoryFor ? factory.class : factory;
11698
11875
 
11876
+ (false && _ember.default.assert('\'' + inspect(klass) + '\' does not appear to be an ember-data model', klass.isModel));
11877
+
11699
11878
  // TODO: deprecate this
11879
+
11700
11880
  klass.modelName = klass.modelName || modelName;
11701
11881
 
11702
11882
  this._modelFactoryCache[modelName] = factory;
@@ -11710,6 +11890,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11710
11890
  @private
11711
11891
  */
11712
11892
  modelFactoryFor: function (modelName) {
11893
+ (false && _ember.default.assert('You need to pass a model name to the store\'s modelFactoryFor method', isPresent(modelName)));
11894
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
11895
+
11713
11896
 
11714
11897
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
11715
11898
  var owner = (0, _utils.getOwner)(this);
@@ -11908,6 +12091,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11908
12091
  return null;
11909
12092
  }
11910
12093
 
12094
+ (false && _ember.default.assert('Expected an object in the \'data\' property in a call to \'push\' for ' + jsonApiDoc.type + ', but was ' + typeOf(jsonApiDoc.data), typeOf(jsonApiDoc.data) === 'object'));
12095
+
12096
+
11911
12097
  return _this._pushInternalModel(jsonApiDoc.data);
11912
12098
  });
11913
12099
 
@@ -11924,10 +12110,34 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
11924
12110
  }
11925
12111
  },
11926
12112
  _pushInternalModel: function (data) {
11927
- var _this2 = this;
11928
-
11929
12113
  var modelName = data.type;
12114
+ (false && _ember.default.assert('You must include an \'id\' for ' + modelName + ' in an object passed to \'push\'', data.id !== null && data.id !== undefined && data.id !== ''));
12115
+ (false && _ember.default.assert('You tried to push data with a type \'' + modelName + '\' but no model could be found with that name.', this._hasModelFor(modelName)));
12116
+
12117
+
12118
+ if (false) {
12119
+ // If ENV.DS_WARN_ON_UNKNOWN_KEYS is set to true and the payload
12120
+ // contains unknown attributes or relationships, log a warning.
11930
12121
 
12122
+ if (ENV.DS_WARN_ON_UNKNOWN_KEYS) {
12123
+ var modelClass = this._modelFor(modelName);
12124
+
12125
+ // Check unknown attributes
12126
+ var unknownAttributes = Object.keys(data.attributes || {}).filter(function (key) {
12127
+ return !get(modelClass, 'fields').has(key);
12128
+ });
12129
+ var unknownAttributesMessage = 'The payload for \'' + modelName + '\' contains these unknown attributes: ' + unknownAttributes + '. Make sure they\'ve been defined in your model.';
12130
+ (false && _ember.default.warn(unknownAttributesMessage, unknownAttributes.length === 0, { id: 'ds.store.unknown-keys-in-payload' }));
12131
+
12132
+ // Check unknown relationships
12133
+
12134
+ var unknownRelationships = Object.keys(data.relationships || {}).filter(function (key) {
12135
+ return !get(modelClass, 'fields').has(key);
12136
+ });
12137
+ var unknownRelationshipsMessage = 'The payload for \'' + modelName + '\' contains these unknown relationships: ' + unknownRelationships + '. Make sure they\'ve been defined in your model.';
12138
+ (false && _ember.default.warn(unknownRelationshipsMessage, unknownRelationships.length === 0, { id: 'ds.store.unknown-keys-in-payload' }));
12139
+ }
12140
+ }
11931
12141
 
11932
12142
  // Actually load the record into the store.
11933
12143
  var internalModel = this._load(data);
@@ -12017,8 +12227,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12017
12227
  if (!inputPayload) {
12018
12228
  payload = modelName;
12019
12229
  serializer = defaultSerializer(this);
12230
+ (false && _ember.default.assert('You cannot use \'store#pushPayload\' without a modelName unless your default serializer defines \'pushPayload\'', typeof serializer.pushPayload === 'function'));
12020
12231
  } else {
12021
12232
  payload = inputPayload;
12233
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
12022
12234
 
12023
12235
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
12024
12236
  serializer = this.serializerFor(normalizedModelName);
@@ -12048,6 +12260,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12048
12260
  @return {Object} The normalized payload
12049
12261
  */
12050
12262
  normalize: function (modelName, payload) {
12263
+ (false && _ember.default.assert('You need to pass a model name to the store\'s normalize method', isPresent(modelName)));
12264
+ (false && _ember.default.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + inspect(modelName), typeof modelName === 'string'));
12265
+
12051
12266
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
12052
12267
  var serializer = this.serializerFor(normalizedModelName);
12053
12268
  var model = this._modelFor(normalizedModelName);
@@ -12066,29 +12281,25 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12066
12281
  @return {InternalModel} internal model
12067
12282
  */
12068
12283
  _buildInternalModel: function (modelName, id, data) {
12284
+ (false && _ember.default.assert('You can no longer pass a modelClass as the first argument to store._buildInternalModel. Pass modelName instead.', typeof modelName === 'string'));
12069
12285
 
12070
- var existingInternalModel = this._existingInternalModelForId(modelName, id);
12286
+
12287
+ var recordMap = this._internalModelsFor(modelName);
12288
+
12289
+ (false && _ember.default.assert('The id ' + id + ' has already been used with another record for modelClass \'' + modelName + '\'.', !id || !recordMap.get(id)));
12071
12290
 
12072
12291
  // lookupFactory should really return an object that creates
12073
12292
  // instances with the injections applied
12074
- var internalModel = new _internalModel5.default(modelName, id, this, data);
12075
12293
 
12076
- this._internalModelsFor(modelName).add(internalModel, id);
12294
+ var internalModel = new _internalModel5.default(modelName, id, this, data);
12077
12295
 
12078
- return internalModel;
12079
- },
12080
- _existingInternalModelForId: function (modelName, id) {
12081
- var internalModel = this._internalModelsFor(modelName).get(id);
12296
+ recordMap.add(internalModel, id);
12082
12297
 
12083
- if (internalModel && internalModel.hasScheduledDestroy()) {
12084
- // unloadRecord is async, if one attempts to unload + then sync create,
12085
- // we must ensure the unload is complete before starting the create
12086
- internalModel.destroySync();
12087
- internalModel = null;
12088
- }
12089
12298
  return internalModel;
12090
12299
  },
12091
12300
  buildInternalModel: function (modelName, id, data) {
12301
+ (false && !(false) && _ember.default.deprecate('buildInternalModel was documented as private and will be removed in the next version of Ember Data.', false, { id: 'ember-data.buildInternalModel', until: '2.17.0' }));
12302
+
12092
12303
  return this._buildInternalModel(modelName, id, data);
12093
12304
  },
12094
12305
 
@@ -12137,6 +12348,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12137
12348
  @return DS.Adapter
12138
12349
  */
12139
12350
  adapterFor: function (modelName) {
12351
+ (false && _ember.default.assert('You need to pass a model name to the store\'s adapterFor method', isPresent(modelName)));
12352
+ (false && _ember.default.assert('Passing classes to store.adapterFor has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
12353
+
12140
12354
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
12141
12355
 
12142
12356
  return this._instanceCache.get('adapter', normalizedModelName);
@@ -12165,14 +12379,27 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12165
12379
  @return {DS.Serializer}
12166
12380
  */
12167
12381
  serializerFor: function (modelName) {
12382
+ (false && _ember.default.assert('You need to pass a model name to the store\'s serializerFor method', isPresent(modelName)));
12383
+ (false && _ember.default.assert('Passing classes to store.serializerFor has been removed. Please pass a dasherized string instead of ' + modelName, typeof modelName === 'string'));
12384
+
12168
12385
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
12169
12386
 
12170
12387
  return this._instanceCache.get('serializer', normalizedModelName);
12171
12388
  },
12172
12389
  lookupAdapter: function (name) {
12390
+ (false && !(false) && _ember.default.deprecate('Use of lookupAdapter is deprecated, use adapterFor instead.', false, {
12391
+ id: 'ds.store.lookupAdapter',
12392
+ until: '3.0'
12393
+ }));
12394
+
12173
12395
  return this.adapterFor(name);
12174
12396
  },
12175
12397
  lookupSerializer: function (name) {
12398
+ (false && !(false) && _ember.default.deprecate('Use of lookupSerializer is deprecated, use serializerFor instead.', false, {
12399
+ id: 'ds.store.lookupSerializer',
12400
+ until: '3.0'
12401
+ }));
12402
+
12176
12403
  return this.serializerFor(name);
12177
12404
  },
12178
12405
  willDestroy: function () {
@@ -12184,14 +12411,14 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12184
12411
  this.unloadAll();
12185
12412
  },
12186
12413
  _updateRelationshipState: function (relationship) {
12187
- var _this3 = this;
12414
+ var _this2 = this;
12188
12415
 
12189
12416
  if (this._updatedRelationships.push(relationship) !== 1) {
12190
12417
  return;
12191
12418
  }
12192
12419
 
12193
12420
  this._backburner.join(function () {
12194
- _this3._backburner.schedule('syncRelationships', _this3, _this3._flushUpdatedRelationships);
12421
+ _this2._backburner.schedule('syncRelationships', _this2, _this2._flushUpdatedRelationships);
12195
12422
  });
12196
12423
  },
12197
12424
  _flushUpdatedRelationships: function () {
@@ -12224,7 +12451,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12224
12451
  return;
12225
12452
  }
12226
12453
 
12454
+ (false && _ember.default.assert('A ' + relationship.internalModel.modelName + ' record was pushed into the store with the value of ' + relationship.key + ' being ' + inspect(resourceIdentifier) + ', but ' + relationship.key + ' is a belongsTo relationship so the value must not be an array. You should probably check your data payload or serializer.', !Array.isArray(resourceIdentifier)));
12455
+
12227
12456
  //TODO:Better asserts
12457
+
12228
12458
  return this._internalModelForId(resourceIdentifier.type, resourceIdentifier.id);
12229
12459
  },
12230
12460
  _pushResourceIdentifiers: function (relationship, resourceIdentifiers) {
@@ -12232,6 +12462,9 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12232
12462
  return;
12233
12463
  }
12234
12464
 
12465
+ (false && _ember.default.assert('A ' + relationship.internalModel.modelName + ' record was pushed into the store with the value of ' + relationship.key + ' being \'' + inspect(resourceIdentifiers) + '\', but ' + relationship.key + ' is a hasMany relationship so the value must be an array. You should probably check your data payload or serializer.', Array.isArray(resourceIdentifiers)));
12466
+
12467
+
12235
12468
  var _internalModels = new Array(resourceIdentifiers.length);
12236
12469
  for (var i = 0; i < resourceIdentifiers.length; i++) {
12237
12470
  _internalModels[i] = this._pushResourceIdentifier(relationship, resourceIdentifiers[i]);
@@ -12251,11 +12484,16 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12251
12484
  var internalModel = snapshot._internalModel;
12252
12485
  var modelName = snapshot.modelName;
12253
12486
  var modelClass = store._modelFor(modelName);
12487
+ (false && _ember.default.assert('You tried to update a record but you have no adapter (for ' + modelName + ')', adapter));
12488
+ (false && _ember.default.assert('You tried to update a record but your adapter (for ' + modelName + ') does not implement \'' + operation + '\'', typeof adapter[operation] === 'function'));
12254
12489
 
12255
12490
  var promise = adapter[operation](store, modelClass, snapshot);
12256
12491
  var serializer = (0, _serializers.serializerForAdapter)(store, adapter, modelName);
12257
12492
  var label = 'DS: Extract and notify about ' + operation + ' completion of ' + internalModel;
12258
12493
 
12494
+ (false && _ember.default.assert('Your adapter\'s \'' + operation + '\' method must return a value, but it returned \'undefined\'', promise !== undefined));
12495
+
12496
+
12259
12497
  promise = Promise.resolve(promise, label);
12260
12498
  promise = (0, _common._guard)(promise, (0, _common._bind)(_common._objectIsAlive, store));
12261
12499
  promise = (0, _common._guard)(promise, (0, _common._bind)(_common._objectIsAlive, internalModel));
@@ -12348,10 +12586,30 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/-pri
12348
12586
 
12349
12587
  if (relationshipRequiresNotification) {
12350
12588
  var relationshipData = data.relationships[relationshipName];
12351
- relationships.get(relationshipName).push(relationshipData, false);
12589
+ relationships.get(relationshipName).push(relationshipData);
12352
12590
  }
12353
12591
 
12354
12592
  // in debug, assert payload validity eagerly
12593
+ if (false) {
12594
+ var relationshipMeta = get(internalModel.type, 'relationshipsByName').get(relationshipName);
12595
+ var _relationshipData = data.relationships[relationshipName];
12596
+ if (!_relationshipData || !relationshipMeta) {
12597
+ return;
12598
+ }
12599
+
12600
+ if (_relationshipData.links) {
12601
+ var isAsync = relationshipMeta.options && relationshipMeta.options.async !== false;
12602
+ (false && _ember.default.warn('You pushed a record of type \'' + internalModel.type.modelName + '\' with a relationship \'' + relationshipName + '\' configured as \'async: false\'. You\'ve included a link but no primary data, this may be an error in your payload.', isAsync || _relationshipData.data, {
12603
+ id: 'ds.store.push-link-for-sync-relationship'
12604
+ }));
12605
+ } else if (_relationshipData.data) {
12606
+ if (relationshipMeta.kind === 'belongsTo') {
12607
+ (false && _ember.default.assert('A ' + internalModel.type.modelName + ' record was pushed into the store with the value of ' + relationshipName + ' being ' + inspect(_relationshipData.data) + ', but ' + relationshipName + ' is a belongsTo relationship so the value must not be an array. You should probably check your data payload or serializer.', !Array.isArray(_relationshipData.data)));
12608
+ } else if (relationshipMeta.kind === 'hasMany') {
12609
+ (false && _ember.default.assert('A ' + internalModel.type.modelName + ' record was pushed into the store with the value of ' + relationshipName + ' being \'' + inspect(_relationshipData.data) + '\', but ' + relationshipName + ' is a hasMany relationship so the value must be an array. You should probably check your data payload or serializer.', Array.isArray(_relationshipData.data)));
12610
+ }
12611
+ }
12612
+ }
12355
12613
  });
12356
12614
  }
12357
12615
 
@@ -12527,8 +12785,14 @@ define('ember-data/-private/system/store/finders', ['exports', 'ember', 'ember-d
12527
12785
  promise = (0, _common._guard)(promise, (0, _common._bind)(_common._objectIsAlive, store));
12528
12786
 
12529
12787
  return promise.then(function (adapterPayload) {
12788
+ (false && _ember.default.assert('You made a \'findRecord\' request for a \'' + modelName + '\' with id \'' + id + '\', but the adapter\'s response did not have any data', payloadIsNotBlank(adapterPayload)));
12789
+
12530
12790
  var serializer = (0, _serializers.serializerForAdapter)(store, adapter, modelName);
12531
12791
  var payload = (0, _serializerResponse.normalizeResponseHelper)(serializer, store, modelClass, adapterPayload, id, 'findRecord');
12792
+ (false && _ember.default.assert('Ember Data expected the primary data returned from a \'findRecord\' response to be an object but instead it found an array.', !Array.isArray(payload.data)));
12793
+ (false && _ember.default.warn('You requested a record of type \'' + modelName + '\' with id \'' + id + '\' but the adapter returned a payload with primary data having an id of \'' + payload.data.id + '\'. Use \'store.findRecord()\' when the requested id is the same as the one returned by the adapter. In other cases use \'store.queryRecord()\' instead http://emberjs.com/api/data/classes/DS.Store.html#method_queryRecord', payload.data.id === id, {
12794
+ id: 'ds.store.findRecord.id-mismatch'
12795
+ }));
12532
12796
 
12533
12797
 
12534
12798
  return store._push(payload);
@@ -12556,6 +12820,8 @@ define('ember-data/-private/system/store/finders', ['exports', 'ember', 'ember-d
12556
12820
  promise = (0, _common._guard)(promise, (0, _common._bind)(_common._objectIsAlive, store));
12557
12821
 
12558
12822
  return promise.then(function (adapterPayload) {
12823
+ (false && _ember.default.assert('You made a \'findMany\' request for \'' + modelName + '\' records with ids \'[' + ids + ']\', but the adapter\'s response did not have any data', payloadIsNotBlank(adapterPayload)));
12824
+
12559
12825
  var serializer = (0, _serializers.serializerForAdapter)(store, adapter, modelName);
12560
12826
  var payload = (0, _serializerResponse.normalizeResponseHelper)(serializer, store, modelClass, adapterPayload, null, 'findMany');
12561
12827
  return store._push(payload);
@@ -12573,6 +12839,8 @@ define('ember-data/-private/system/store/finders', ['exports', 'ember', 'ember-d
12573
12839
  promise = (0, _common._guard)(promise, (0, _common._bind)(_common._objectIsAlive, internalModel));
12574
12840
 
12575
12841
  return promise.then(function (adapterPayload) {
12842
+ (false && _ember.default.assert('You made a \'findHasMany\' request for a ' + internalModel.modelName + '\'s \'' + relationship.key + '\' relationship, using link \'' + link + '\' , but the adapter\'s response did not have any data', payloadIsNotBlank(adapterPayload)));
12843
+
12576
12844
  var serializer = (0, _serializers.serializerForAdapter)(store, adapter, relationship.type);
12577
12845
  var payload = (0, _serializerResponse.normalizeResponseHelper)(serializer, store, modelClass, adapterPayload, null, 'findHasMany');
12578
12846
  var internalModelArray = store._push(payload);
@@ -12615,6 +12883,8 @@ define('ember-data/-private/system/store/finders', ['exports', 'ember', 'ember-d
12615
12883
  promise = (0, _common._guard)(promise, (0, _common._bind)(_common._objectIsAlive, store));
12616
12884
 
12617
12885
  return promise.then(function (adapterPayload) {
12886
+ (false && _ember.default.assert('You made a \'findAll\' request for \'' + modelName + '\' records, but the adapter\'s response did not have any data', payloadIsNotBlank(adapterPayload)));
12887
+
12618
12888
  var serializer = (0, _serializers.serializerForAdapter)(store, adapter, modelName);
12619
12889
  var payload = (0, _serializerResponse.normalizeResponseHelper)(serializer, store, modelClass, adapterPayload, null, 'findAll');
12620
12890
 
@@ -12627,7 +12897,14 @@ define('ember-data/-private/system/store/finders', ['exports', 'ember', 'ember-d
12627
12897
 
12628
12898
  function _query(adapter, store, modelName, query, recordArray) {
12629
12899
  var modelClass = store.modelFor(modelName); // adapter.query needs the class
12630
- var promise = adapter.query(store, modelClass, query, recordArray);
12900
+
12901
+ var promise = void 0;
12902
+ if (adapter.query.length > 3) {
12903
+ recordArray = recordArray || store.recordArrayManager.createAdapterPopulatedRecordArray(modelName, query);
12904
+ promise = adapter.query(store, modelClass, query, recordArray);
12905
+ } else {
12906
+ promise = adapter.query(store, modelClass, query);
12907
+ }
12631
12908
 
12632
12909
  var label = 'DS: Handle Adapter#query of ' + modelClass;
12633
12910
 
@@ -12641,7 +12918,13 @@ define('ember-data/-private/system/store/finders', ['exports', 'ember', 'ember-d
12641
12918
 
12642
12919
  var internalModels = store._push(payload);
12643
12920
 
12644
- recordArray._setInternalModels(internalModels, payload);
12921
+ (false && _ember.default.assert('The response to store.query is expected to be an array but it was a single record. Please wrap your response in an array or use `store.queryRecord` to query for a single record.', Array.isArray(internalModels)));
12922
+
12923
+ if (recordArray) {
12924
+ recordArray._setInternalModels(internalModels, payload);
12925
+ } else {
12926
+ recordArray = store.recordArrayManager.createAdapterPopulatedRecordArray(modelName, query, internalModels, payload);
12927
+ }
12645
12928
 
12646
12929
  return recordArray;
12647
12930
  }, null, 'DS: Extract payload of query ' + modelName);
@@ -12659,6 +12942,11 @@ define('ember-data/-private/system/store/finders', ['exports', 'ember', 'ember-d
12659
12942
  var serializer = (0, _serializers.serializerForAdapter)(store, adapter, modelName);
12660
12943
  var payload = (0, _serializerResponse.normalizeResponseHelper)(serializer, store, modelClass, adapterPayload, null, 'queryRecord');
12661
12944
 
12945
+ (false && _ember.default.assert('Expected the primary data returned by the serializer for a \'queryRecord\' response to be a single object or null but instead it was an array.', !Array.isArray(payload.data), {
12946
+ id: 'ds.store.queryRecord-array-response'
12947
+ }));
12948
+
12949
+
12662
12950
  return store._push(payload);
12663
12951
  }, null, 'DS: Extract payload of queryRecord ' + modelName);
12664
12952
  }
@@ -12743,6 +13031,10 @@ define('ember-data/-private/system/store/serializer-response', ['exports', 'embe
12743
13031
  function normalizeResponseHelper(serializer, store, modelClass, payload, id, requestType) {
12744
13032
  var normalizedResponse = serializer.normalizeResponse(store, modelClass, payload, id, requestType);
12745
13033
  var validationErrors = [];
13034
+ if (false) {
13035
+ validationErrors = validateDocumentStructure(normalizedResponse);
13036
+ }
13037
+ (false && _ember.default.assert('normalizeResponse must return a valid JSON API document:\n\t* ' + validationErrors.join('\n\t* '), _ember.default.isEmpty(validationErrors)));
12746
13038
 
12747
13039
 
12748
13040
  return normalizedResponse;
@@ -12848,7 +13140,7 @@ define('ember-data/-private/utils/parse-response-headers', ['exports'], function
12848
13140
  }
12849
13141
 
12850
13142
  if (foundSep === false) {
12851
- continue;
13143
+ break;
12852
13144
  }
12853
13145
 
12854
13146
  var field = header.substring(0, j).trim();
@@ -13459,7 +13751,7 @@ define('ember-data/adapters/errors', ['exports', 'ember-data/-private'], functio
13459
13751
  }
13460
13752
  });
13461
13753
  });
13462
- define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-inflector', 'ember-data/adapters/rest', 'ember-data/-private'], function (exports, _ember, _emberInflector, _rest, _private) {
13754
+ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters/rest', 'ember-data/-private'], function (exports, _ember, _rest, _private) {
13463
13755
  'use strict';
13464
13756
 
13465
13757
  exports.__esModule = true;
@@ -13601,11 +13893,6 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-inflector', '
13601
13893
  @namespace DS
13602
13894
  @extends DS.RESTAdapter
13603
13895
  */
13604
- /* global heimdall */
13605
- /**
13606
- @module ember-data
13607
- */
13608
-
13609
13896
  var JSONAPIAdapter = _rest.default.extend({
13610
13897
  defaultSerializer: '-json-api',
13611
13898
 
@@ -13684,7 +13971,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-inflector', '
13684
13971
  },
13685
13972
  pathForType: function (modelName) {
13686
13973
  var dasherized = _ember.default.String.dasherize(modelName);
13687
- return (0, _emberInflector.pluralize)(dasherized);
13974
+ return _ember.default.String.pluralize(dasherized);
13688
13975
  },
13689
13976
  updateRecord: function (store, type, snapshot) {
13690
13977
  if ((0, _private.isEnabled)('ds-improved-ajax') && !this._hasCustomizedAjax()) {
@@ -13702,16 +13989,29 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-inflector', '
13702
13989
  },
13703
13990
  _hasCustomizedAjax: function () {
13704
13991
  if (this.ajax !== JSONAPIAdapter.prototype.ajax) {
13992
+ (false && !(false) && _ember.default.deprecate('JSONAPIAdapter#ajax has been deprecated please use. `methodForRequest`, `urlForRequest`, `headersForRequest` or `dataForRequest` instead.', false, {
13993
+ id: 'ds.json-api-adapter.ajax',
13994
+ until: '3.0.0'
13995
+ }));
13996
+
13705
13997
  return true;
13706
13998
  }
13707
13999
 
13708
14000
  if (this.ajaxOptions !== JSONAPIAdapter.prototype.ajaxOptions) {
14001
+ (false && !(false) && _ember.default.deprecate('JSONAPIAdapterr#ajaxOptions has been deprecated please use. `methodForRequest`, `urlForRequest`, `headersForRequest` or `dataForRequest` instead.', false, {
14002
+ id: 'ds.json-api-adapter.ajax-options',
14003
+ until: '3.0.0'
14004
+ }));
14005
+
13709
14006
  return true;
13710
14007
  }
13711
14008
 
13712
14009
  return false;
13713
14010
  }
13714
- });
14011
+ }); /* global heimdall */
14012
+ /**
14013
+ @module ember-data
14014
+ */
13715
14015
 
13716
14016
  if ((0, _private.isEnabled)('ds-improved-ajax')) {
13717
14017
 
@@ -14490,10 +14790,20 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
14490
14790
  },
14491
14791
  _hasCustomizedAjax: function () {
14492
14792
  if (this.ajax !== RESTAdapter.prototype.ajax) {
14793
+ (false && !(false) && _ember.default.deprecate('RESTAdapter#ajax has been deprecated please use. `methodForRequest`, `urlForRequest`, `headersForRequest` or `dataForRequest` instead.', false, {
14794
+ id: 'ds.rest-adapter.ajax',
14795
+ until: '3.0.0'
14796
+ }));
14797
+
14493
14798
  return true;
14494
14799
  }
14495
14800
 
14496
14801
  if (this.ajaxOptions !== RESTAdapter.prototype.ajaxOptions) {
14802
+ (false && !(false) && _ember.default.deprecate('RESTAdapter#ajaxOptions has been deprecated please use. `methodForRequest`, `urlForRequest`, `headersForRequest` or `dataForRequest` instead.', false, {
14803
+ id: 'ds.rest-adapter.ajax-options',
14804
+ until: '3.0.0'
14805
+ }));
14806
+
14497
14807
  return true;
14498
14808
  }
14499
14809
 
@@ -14695,6 +15005,13 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
14695
15005
  }
14696
15006
 
14697
15007
  function ajaxError(adapter, jqXHR, requestData, responseData) {
15008
+ if (false) {
15009
+ var message = 'The server returned an empty string for ' + requestData.method + ' ' + requestData.url + ', which cannot be parsed into a valid JSON. Return either null or {}.';
15010
+ var validJSONString = !(responseData.textStatus === "parsererror" && jqXHR.responseText === "");
15011
+ (false && _ember.default.warn(message, validJSONString, {
15012
+ id: 'ds.adapter.returned-empty-string-as-JSON'
15013
+ }));
15014
+ }
14698
15015
 
14699
15016
  var error = void 0;
14700
15017
 
@@ -14742,6 +15059,10 @@ define('ember-data/attr', ['exports', 'ember'], function (exports, _ember) {
14742
15059
  return options.defaultValue.apply(null, arguments);
14743
15060
  } else {
14744
15061
  var defaultValue = options.defaultValue;
15062
+ (false && !(typeof defaultValue !== 'object' || defaultValue === null) && _ember.default.deprecate('Non primitive defaultValues are deprecated because they are shared between all instances. If you would like to use a complex object as a default value please provide a function that returns the complex object.', typeof defaultValue !== 'object' || defaultValue === null, {
15063
+ id: 'ds.defaultValue.complex-object',
15064
+ until: '3.0.0'
15065
+ }));
14745
15066
 
14746
15067
  return defaultValue;
14747
15068
  }
@@ -14992,6 +15313,8 @@ define("ember-data", ["exports", "ember", "ember-data/-private", "ember-data/set
14992
15313
  Object.defineProperty(_private.global, 'DS', {
14993
15314
  configurable: true,
14994
15315
  get: function () {
15316
+ (false && !(false) && _ember.default.deprecate('Using the global version of DS is deprecated. Please either import ' + 'the specific modules needed or `import DS from \'ember-data\';`.', false, { id: 'ember-data.global-ds', until: '3.0.0' }));
15317
+
14995
15318
 
14996
15319
  return _private.DS;
14997
15320
  }
@@ -15009,7 +15332,7 @@ define('ember-data/initializers/data-adapter', ['exports'], function (exports) {
15009
15332
  initialize: function () {}
15010
15333
  };
15011
15334
  });
15012
- define('ember-data/initializers/ember-data', ['exports', 'ember-data/setup-container', 'ember-data'], function (exports, _setupContainer) {
15335
+ define('ember-data/initializers/ember-data', ['exports', 'ember-data/setup-container', 'ember-data/index'], function (exports, _setupContainer) {
15013
15336
  'use strict';
15014
15337
 
15015
15338
  exports.__esModule = true;
@@ -15064,6 +15387,8 @@ define('ember-data/instance-initializers/initialize-store-service', ['exports'],
15064
15387
  exports.default = initializeStoreService;
15065
15388
 
15066
15389
 
15390
+ var deprecateOldEmberDataInitializers = void 0;
15391
+
15067
15392
  /*
15068
15393
  Configures a registry for use with an Ember-Data
15069
15394
  store.
@@ -15079,39 +15404,48 @@ define('ember-data/instance-initializers/initialize-store-service', ['exports'],
15079
15404
  // Eagerly generate the store so defaultStore is populated.
15080
15405
  container.lookup('service:store');
15081
15406
 
15082
- // In Ember 2.4+ instance.base is the `Ember.Application` or `Ember.Engine` instance
15083
- // In Ember 1.11 - 2.3 we fallback to `instance.application`
15084
- var base = instance.base || instance.application;
15085
- deprecateOldEmberDataInitializers(base.constructor.initializers);
15407
+ if (false) {
15408
+ // In Ember 2.4+ instance.base is the `Ember.Application` or `Ember.Engine` instance
15409
+ // In Ember 1.11 - 2.3 we fallback to `instance.application`
15410
+ var base = instance.base || instance.application;
15411
+ deprecateOldEmberDataInitializers(base.constructor.initializers);
15412
+ }
15086
15413
  }
15087
15414
 
15088
- var DEPRECATED_INITIALIZER_NAMES = ['data-adapter', 'injectStore', 'transforms', 'store'];
15415
+ if (false) {
15416
+ var DEPRECATED_INITIALIZER_NAMES = ['data-adapter', 'injectStore', 'transforms', 'store'];
15089
15417
 
15090
- function matchesDeprecatedInititalizer(name) {
15091
- return DEPRECATED_INITIALIZER_NAMES.indexOf(name) !== -1;
15092
- }
15418
+ var matchesDeprecatedInititalizer = function matchesDeprecatedInititalizer(name) {
15419
+ return DEPRECATED_INITIALIZER_NAMES.indexOf(name) !== -1;
15420
+ };
15421
+
15422
+ var warnForDeprecatedInitializers = function warnForDeprecatedInitializers(initializer) {
15423
+ var deprecatedBeforeInitializer = matchesDeprecatedInititalizer(initializer.before);
15424
+ var deprecatedAfterInitializer = matchesDeprecatedInititalizer(initializer.after);
15425
+ var deprecatedProp = deprecatedBeforeInitializer ? 'before' : 'after';
15093
15426
 
15094
- function deprecateOldEmberDataInitializers(initializers) {
15095
- // collect all of the initializers
15096
- var keys = Object.keys(initializers);
15427
+ (false && !(!(deprecatedBeforeInitializer || deprecatedAfterInitializer)) && Ember.deprecate('The initializer `' + initializer[deprecatedProp] + '` has been deprecated. Please update your `' + initializer.name + '` initializer to use use `' + deprecatedProp + ': \'ember-data\'` instead.', !(deprecatedBeforeInitializer || deprecatedAfterInitializer), {
15428
+ id: 'ds.deprecated-initializers',
15429
+ until: '3.0.0'
15430
+ }));
15431
+ };
15097
15432
 
15098
- for (var i = 0; i < keys.length; i++) {
15099
- var name = keys[i];
15433
+ deprecateOldEmberDataInitializers = function deprecateOldEmberDataInitializers(initializers) {
15434
+ // collect all of the initializers
15435
+ var keys = Object.keys(initializers);
15100
15436
 
15101
- // filter out all of the Ember Data initializer. We have some
15102
- // deprecated initializers that depend on other deprecated
15103
- // initializers which may trigger the deprecation warning
15104
- // unintentionally.
15105
- if (!matchesDeprecatedInititalizer(name)) {
15106
- warnForDeprecatedInitializers(initializers[name]);
15107
- }
15108
- }
15109
- }
15437
+ for (var i = 0; i < keys.length; i++) {
15438
+ var name = keys[i];
15110
15439
 
15111
- function warnForDeprecatedInitializers(initializer) {
15112
- var deprecatedBeforeInitializer = matchesDeprecatedInititalizer(initializer.before);
15113
- var deprecatedAfterInitializer = matchesDeprecatedInititalizer(initializer.after);
15114
- var deprecatedProp = deprecatedBeforeInitializer ? 'before' : 'after';
15440
+ // filter out all of the Ember Data initializer. We have some
15441
+ // deprecated initializers that depend on other deprecated
15442
+ // initializers which may trigger the deprecation warning
15443
+ // unintentionally.
15444
+ if (!matchesDeprecatedInititalizer(name)) {
15445
+ warnForDeprecatedInitializers(initializers[name]);
15446
+ }
15447
+ }
15448
+ };
15115
15449
  }
15116
15450
  });
15117
15451
  define('ember-data/model', ['exports', 'ember-data/-private'], function (exports, _private) {
@@ -15663,6 +15997,9 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember'], fu
15663
15997
  serializedKey = this.keyForRelationship(relationship.key, relationship.kind, "serialize");
15664
15998
  }
15665
15999
 
16000
+ (false && _ember.default.warn('The embedded relationship \'' + serializedKey + '\' is undefined for \'' + snapshot.modelName + '\' with id \'' + snapshot.id + '\'. Please include it in your original payload.', _ember.default.typeOf(snapshot.hasMany(relationship.key)) !== 'undefined', { id: 'ds.serializer.embedded-relationship-undefined' }));
16001
+
16002
+
15666
16003
  json[serializedKey] = this._generateSerializedHasMany(snapshot, relationship);
15667
16004
  },
15668
16005
 
@@ -16031,6 +16368,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16031
16368
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(relationshipDataHash.type);
16032
16369
 
16033
16370
  if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
16371
+ (false && !(false) && _ember.default.deprecate("You are using modelNameFromPayloadKey to normalize the type for a relationship. This has been deprecated in favor of modelNameFromPayloadType", false, {
16372
+ id: 'ds.json-api-serializer.deprecated-model-name-for-relationship',
16373
+ until: '3.0.0'
16374
+ }));
16375
+
16034
16376
 
16035
16377
  modelName = deprecatedModelNameLookup;
16036
16378
  }
@@ -16043,6 +16385,10 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16043
16385
  return relationshipDataHash;
16044
16386
  },
16045
16387
  _normalizeResourceHelper: function (resourceHash) {
16388
+ (false && _ember.default.assert(this.warnMessageForUndefinedType(), !_ember.default.isNone(resourceHash.type), {
16389
+ id: 'ds.serializer.type-is-undefined'
16390
+ }));
16391
+
16046
16392
 
16047
16393
  var modelName = void 0,
16048
16394
  usedLookup = void 0;
@@ -16054,6 +16400,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16054
16400
  usedLookup = 'modelNameFromPayloadType';
16055
16401
 
16056
16402
  if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
16403
+ (false && !(false) && _ember.default.deprecate("You are using modelNameFromPayloadKey to normalize the type for a resource. This has been deprecated in favor of modelNameFromPayloadType", false, {
16404
+ id: 'ds.json-api-serializer.deprecated-model-name-for-resource',
16405
+ until: '3.0.0'
16406
+ }));
16407
+
16057
16408
 
16058
16409
  modelName = deprecatedModelNameLookup;
16059
16410
  usedLookup = 'modelNameFromPayloadKey';
@@ -16064,6 +16415,10 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16064
16415
  }
16065
16416
 
16066
16417
  if (!this.store._hasModelFor(modelName)) {
16418
+ (false && _ember.default.warn(this.warnMessageNoModelForType(modelName, resourceHash.type, usedLookup), false, {
16419
+ id: 'ds.serializer.model-for-type-missing'
16420
+ }));
16421
+
16067
16422
  return null;
16068
16423
  }
16069
16424
 
@@ -16090,6 +16445,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16090
16445
  normalizeQueryRecordResponse: function () {
16091
16446
  var normalized = this._super.apply(this, arguments);
16092
16447
 
16448
+ (false && _ember.default.assert('Expected the primary data returned by the serializer for a `queryRecord` response to be a single object but instead it was an array.', !Array.isArray(normalized.data), {
16449
+ id: 'ds.serializer.json-api.queryRecord-array-response'
16450
+ }));
16451
+
16452
+
16093
16453
  return normalized;
16094
16454
  },
16095
16455
  extractAttributes: function (modelClass, resourceHash) {
@@ -16103,6 +16463,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16103
16463
  if (resourceHash.attributes[attributeKey] !== undefined) {
16104
16464
  attributes[key] = resourceHash.attributes[attributeKey];
16105
16465
  }
16466
+ if (false) {
16467
+ if (resourceHash.attributes[attributeKey] === undefined && resourceHash.attributes[key] !== undefined) {
16468
+ (false && _ember.default.assert('Your payload for \'' + modelClass.modelName + '\' contains \'' + key + '\', but your serializer is setup to look for \'' + attributeKey + '\'. This is most likely because Ember Data\'s JSON API serializer dasherizes attribute keys by default. You should subclass JSONAPISerializer and implement \'keyForAttribute(key) { return key; }\' to prevent Ember Data from customizing your attribute keys.', false));
16469
+ }
16470
+ }
16106
16471
  });
16107
16472
  }
16108
16473
 
@@ -16140,6 +16505,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16140
16505
  var relationshipHash = resourceHash.relationships[relationshipKey];
16141
16506
  relationships[key] = _this2.extractRelationship(relationshipHash);
16142
16507
  }
16508
+ if (false) {
16509
+ if (resourceHash.relationships[relationshipKey] === undefined && resourceHash.relationships[key] !== undefined) {
16510
+ (false && _ember.default.assert('Your payload for \'' + modelClass.modelName + '\' contains \'' + key + '\', but your serializer is setup to look for \'' + relationshipKey + '\'. This is most likely because Ember Data\'s JSON API serializer dasherizes relationship keys by default. You should subclass JSONAPISerializer and implement \'keyForRelationship(key) { return key; }\' to prevent Ember Data from customizing your relationship keys.', false));
16511
+ }
16512
+ }
16143
16513
  });
16144
16514
  }
16145
16515
 
@@ -16151,6 +16521,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16151
16521
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(resourceHash.type);
16152
16522
 
16153
16523
  if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
16524
+ (false && !(false) && _ember.default.deprecate("You are using modelNameFromPayloadKey to normalize the type for a polymorphic relationship. This has been deprecated in favor of modelNameFromPayloadType", false, {
16525
+ id: 'ds.json-api-serializer.deprecated-model-name-for-polymorphic-type',
16526
+ until: '3.0.0'
16527
+ }));
16528
+
16154
16529
 
16155
16530
  modelName = deprecatedModelNameLookup;
16156
16531
  }
@@ -16201,6 +16576,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16201
16576
  var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(snapshot.modelName);
16202
16577
 
16203
16578
  if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
16579
+ (false && !(false) && _ember.default.deprecate("You used payloadKeyFromModelName to customize how a type is serialized. Use payloadTypeFromModelName instead.", false, {
16580
+ id: 'ds.json-api-serializer.deprecated-payload-type-for-model',
16581
+ until: '3.0.0'
16582
+ }));
16583
+
16204
16584
 
16205
16585
  payloadType = deprecatedPayloadTypeLookup;
16206
16586
  }
@@ -16255,6 +16635,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16255
16635
  var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(belongsTo.modelName);
16256
16636
 
16257
16637
  if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
16638
+ (false && !(false) && _ember.default.deprecate("You used payloadKeyFromModelName to serialize type for belongs-to relationship. Use payloadTypeFromModelName instead.", false, {
16639
+ id: 'ds.json-api-serializer.deprecated-payload-type-for-belongs-to',
16640
+ until: '3.0.0'
16641
+ }));
16642
+
16258
16643
 
16259
16644
  payloadType = deprecatedPayloadTypeLookup;
16260
16645
  }
@@ -16302,6 +16687,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16302
16687
  var deprecatedPayloadTypeLookup = this.payloadKeyFromModelName(item.modelName);
16303
16688
 
16304
16689
  if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
16690
+ (false && !(false) && _ember.default.deprecate("You used payloadKeyFromModelName to serialize type for belongs-to relationship. Use payloadTypeFromModelName instead.", false, {
16691
+ id: 'ds.json-api-serializer.deprecated-payload-type-for-has-many',
16692
+ until: '3.0.0'
16693
+ }));
16694
+
16305
16695
 
16306
16696
  payloadType = deprecatedPayloadTypeLookup;
16307
16697
  }
@@ -16339,6 +16729,26 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-inflector'
16339
16729
  });
16340
16730
  }
16341
16731
 
16732
+ if (false) {
16733
+ JSONAPISerializer.reopen({
16734
+ willMergeMixin: function (props) {
16735
+ var constructor = this.constructor;
16736
+ (false && _ember.default.warn('You\'ve defined \'extractMeta\' in ' + constructor.toString() + ' which is not used for serializers extending JSONAPISerializer. Read more at http://emberjs.com/api/data/classes/DS.JSONAPISerializer.html#toc_customizing-meta on how to customize meta when using JSON API.', _ember.default.isNone(props.extractMeta) || props.extractMeta === _json.default.prototype.extractMeta, {
16737
+ id: 'ds.serializer.json-api.extractMeta'
16738
+ }));
16739
+ (false && _ember.default.warn('The JSONAPISerializer does not work with the EmbeddedRecordsMixin because the JSON API spec does not describe how to format embedded resources.', !props.isEmbeddedRecordsMixin, {
16740
+ id: 'ds.serializer.embedded-records-mixin-not-supported'
16741
+ }));
16742
+ },
16743
+ warnMessageForUndefinedType: function () {
16744
+ return 'Encountered a resource object with an undefined type (resolved resource using ' + this.constructor.toString() + ')';
16745
+ },
16746
+ warnMessageNoModelForType: function (modelName, originalType, usedLookup) {
16747
+ return 'Encountered a resource object with type "' + originalType + '", but no model was found for model name "' + modelName + '" (resolved model name using \'' + this.constructor.toString() + '.' + usedLookup + '("' + originalType + '")\').';
16748
+ }
16749
+ });
16750
+ }
16751
+
16342
16752
  exports.default = JSONAPISerializer;
16343
16753
  });
16344
16754
  define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/serializer', 'ember-data/-private'], function (exports, _ember, _serializer, _private) {
@@ -16418,7 +16828,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/serialize
16418
16828
  - `normalizeResponse` - entry method to the serializer.
16419
16829
  - `normalizeCreateRecordResponse` - a `normalizeResponse` for a specific operation is called.
16420
16830
  - `normalizeSingleResponse`|`normalizeArrayResponse` - for methods like `createRecord` we expect
16421
- a single record back, while for methods like `findAll` we expect multiple methods back.
16831
+ a single record back, while for methods like `findAll` we expect multiple records back.
16422
16832
  - `normalize` - `normalizeArray` iterates and calls `normalize` for each of its records while `normalizeSingle`
16423
16833
  calls it once. This is the method you most likely want to subclass.
16424
16834
  - `extractId` | `extractAttributes` | `extractRelationships` - `normalize` delegates to these methods to
@@ -16589,6 +16999,8 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/serialize
16589
16999
 
16590
17000
  var meta = this.extractMeta(store, primaryModelClass, payload);
16591
17001
  if (meta) {
17002
+ (false && _ember.default.assert('The `meta` returned from `extractMeta` has to be an object, not "' + _ember.default.typeOf(meta) + '".', _ember.default.typeOf(meta) === 'object'));
17003
+
16592
17004
  documentHash.meta = meta;
16593
17005
  }
16594
17006
 
@@ -16686,6 +17098,11 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/serialize
16686
17098
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(relationshipHash.type);
16687
17099
 
16688
17100
  if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
17101
+ (false && !(false) && _ember.default.deprecate("You used modelNameFromPayloadKey to customize how a type is normalized. Use modelNameFromPayloadType instead", false, {
17102
+ id: 'ds.json-serializer.deprecated-type-for-polymorphic-relationship',
17103
+ until: '3.0.0'
17104
+ }));
17105
+
16689
17106
 
16690
17107
  modelName = deprecatedModelNameLookup;
16691
17108
  }
@@ -16801,6 +17218,10 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/serialize
16801
17218
  }
16802
17219
  },
16803
17220
  _getMappedKey: function (key, modelClass) {
17221
+ (false && _ember.default.warn('There is no attribute or relationship with the name `' + key + '` on `' + modelClass.modelName + '`. Check your serializers attrs hash.', get(modelClass, 'attributes').has(key) || get(modelClass, 'relationshipsByName').has(key), {
17222
+ id: 'ds.serializer.no-mapped-attrs-key'
17223
+ }));
17224
+
16804
17225
 
16805
17226
  var attrs = get(this, 'attrs');
16806
17227
  var mappedKey = void 0;
@@ -16829,7 +17250,12 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/serialize
16829
17250
  return attrs && attrs[key] && attrs[key].serialize === true;
16830
17251
  },
16831
17252
  shouldSerializeHasMany: function (snapshot, key, relationship) {
16832
- if (this._shouldSerializeHasMany !== JSONSerializer.prototype._shouldSerializeHasMany) {}
17253
+ if (this._shouldSerializeHasMany !== JSONSerializer.prototype._shouldSerializeHasMany) {
17254
+ (false && !(false) && _ember.default.deprecate('The private method _shouldSerializeHasMany has been promoted to the public API. Please remove the underscore to use the public shouldSerializeHasMany method.', false, {
17255
+ id: 'ds.serializer.private-should-serialize-has-many',
17256
+ until: '3.0.0'
17257
+ }));
17258
+ }
16833
17259
 
16834
17260
  return this._shouldSerializeHasMany(snapshot, key, relationship);
16835
17261
  },
@@ -16988,6 +17414,9 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/serialize
16988
17414
  transformFor: function (attributeType, skipAssertion) {
16989
17415
  var transform = (0, _private.getOwner)(this).lookup('transform:' + attributeType);
16990
17416
 
17417
+ (false && _ember.default.assert("Unable to find transform for '" + attributeType + "'", skipAssertion || !!transform));
17418
+
17419
+
16991
17420
  return transform;
16992
17421
  }
16993
17422
  });
@@ -17088,6 +17517,11 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17088
17517
  },
17089
17518
  normalize: function (modelClass, resourceHash, prop) {
17090
17519
  if (this.normalizeHash && this.normalizeHash[prop]) {
17520
+ (false && !(false) && _ember.default.deprecate('`RESTSerializer.normalizeHash` has been deprecated. Please use `serializer.normalize` to modify the payload of single resources.', false, {
17521
+ id: 'ds.serializer.normalize-hash-deprecated',
17522
+ until: '3.0.0'
17523
+ }));
17524
+
17091
17525
  this.normalizeHash[prop](resourceHash);
17092
17526
  }
17093
17527
  return this._super(modelClass, resourceHash);
@@ -17132,6 +17566,11 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17132
17566
  var deprecatedModelNameLookup = this.modelNameFromPayloadKey(hash.type);
17133
17567
 
17134
17568
  if (modelName !== deprecatedModelNameLookup && !this._hasCustomModelNameFromPayloadType() && this._hasCustomModelNameFromPayloadKey()) {
17569
+ (false && !(false) && _ember.default.deprecate("You are using modelNameFromPayloadKey to normalize the type for a polymorphic relationship. This is has been deprecated in favor of modelNameFromPayloadType", false, {
17570
+ id: 'ds.rest-serializer.deprecated-model-name-for-polymorphic-type',
17571
+ until: '3.0.0'
17572
+ }));
17573
+
17135
17574
 
17136
17575
  modelName = deprecatedModelNameLookup;
17137
17576
  }
@@ -17155,6 +17594,8 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17155
17594
 
17156
17595
  var meta = this.extractMeta(store, primaryModelClass, payload);
17157
17596
  if (meta) {
17597
+ (false && _ember.default.assert('The `meta` returned from `extractMeta` has to be an object, not "' + _ember.default.typeOf(meta) + '".', _ember.default.typeOf(meta) === 'object'));
17598
+
17158
17599
  documentHash.meta = meta;
17159
17600
  }
17160
17601
 
@@ -17189,6 +17630,10 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17189
17630
 
17190
17631
  var typeName = this.modelNameFromPayloadKey(modelName);
17191
17632
  if (!store.modelFactoryFor(typeName)) {
17633
+ (false && _ember.default.warn(this.warnMessageNoModelForKey(modelName, typeName), false, {
17634
+ id: 'ds.serializer.model-for-key-missing'
17635
+ }));
17636
+
17192
17637
  continue;
17193
17638
  }
17194
17639
 
@@ -17199,6 +17644,16 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17199
17644
  continue;
17200
17645
  }
17201
17646
 
17647
+ if (false) {
17648
+ var isQueryRecordAnArray = requestType === 'queryRecord' && isPrimary && Array.isArray(value);
17649
+ var message = "The adapter returned an array for the primary data of a `queryRecord` response. This is deprecated as `queryRecord` should return a single record.";
17650
+
17651
+ (false && !(!isQueryRecordAnArray) && _ember.default.deprecate(message, !isQueryRecordAnArray, {
17652
+ id: 'ds.serializer.rest.queryRecord-array-response',
17653
+ until: '3.0'
17654
+ }));
17655
+ }
17656
+
17202
17657
  /*
17203
17658
  Support primary data as an object instead of an array.
17204
17659
  Example
@@ -17278,6 +17733,10 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17278
17733
  for (var prop in payload) {
17279
17734
  var modelName = this.modelNameFromPayloadKey(prop);
17280
17735
  if (!store.modelFactoryFor(modelName)) {
17736
+ (false && _ember.default.warn(this.warnMessageNoModelForKey(prop, modelName), false, {
17737
+ id: 'ds.serializer.model-for-key-missing'
17738
+ }));
17739
+
17281
17740
  continue;
17282
17741
  }
17283
17742
  var type = store.modelFor(modelName);
@@ -17331,6 +17790,11 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17331
17790
  // `keyForPolymorphicType`. If this is the case, a deprecation warning is
17332
17791
  // logged and the old way is restored (so nothing breaks).
17333
17792
  if (key !== typeKey && this.keyForPolymorphicType === RESTSerializer.prototype.keyForPolymorphicType) {
17793
+ (false && !(false) && _ember.default.deprecate("The key to serialize the type of a polymorphic record is created via keyForAttribute which has been deprecated. Use the keyForPolymorphicType hook instead.", false, {
17794
+ id: 'ds.rest-serializer.deprecated-key-for-polymorphic-type',
17795
+ until: '3.0.0'
17796
+ }));
17797
+
17334
17798
 
17335
17799
  typeKey = key;
17336
17800
  }
@@ -17380,6 +17844,11 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17380
17844
  var deprecatedTypeLookup = this.modelNameFromPayloadKey(payloadType);
17381
17845
 
17382
17846
  if (payloadType !== deprecatedTypeLookup && !this._hasCustomModelNameFromPayloadType() && this._hasCustomModelNameFromPayloadKey()) {
17847
+ (false && !(false) && _ember.default.deprecate("You are using modelNameFromPayloadKey to normalize the type for a polymorphic relationship. This has been deprecated in favor of modelNameFromPayloadType", false, {
17848
+ id: 'ds.rest-serializer.deprecated-model-name-for-polymorphic-type',
17849
+ until: '3.0.0'
17850
+ }));
17851
+
17383
17852
 
17384
17853
  type = deprecatedTypeLookup;
17385
17854
  }
@@ -17426,6 +17895,14 @@ define('ember-data/serializers/rest', ['exports', 'ember', 'ember-inflector', 'e
17426
17895
  });
17427
17896
  }
17428
17897
 
17898
+ if (false) {
17899
+ RESTSerializer.reopen({
17900
+ warnMessageNoModelForKey: function (prop, typeKey) {
17901
+ return 'Encountered "' + prop + '" in payload, but no model was found for model name "' + typeKey + '" (resolved model name using ' + this.constructor.toString() + '.modelNameFromPayloadKey("' + prop + '"))';
17902
+ }
17903
+ });
17904
+ }
17905
+
17429
17906
  exports.default = RESTSerializer;
17430
17907
  });
17431
17908
  define('ember-data/setup-container', ['exports', 'ember-data/-private', 'ember-data/serializers/json-api', 'ember-data/serializers/json', 'ember-data/serializers/rest', 'ember-data/adapters/json-api', 'ember-data/adapters/rest', 'ember-data/transforms/number', 'ember-data/transforms/date', 'ember-data/transforms/string', 'ember-data/transforms/boolean'], function (exports, _private, _jsonApi, _json, _rest, _jsonApi2, _rest2, _number, _date, _string, _boolean) {
@@ -17594,9 +18071,13 @@ define('ember-data/transforms/date', ['exports', 'ember-data/transforms/transfor
17594
18071
  @deprecated
17595
18072
  */
17596
18073
  _ember.default.Date.parse = function (date) {
18074
+ (false && !(false) && _ember.default.deprecate('Ember.Date.parse is deprecated because Safari 5-, IE8-, and\n Firefox 3.6- are no longer supported (see\n https://github.com/csnover/js-iso8601 for the history of this issue).\n Please use Date.parse instead', false, {
18075
+ id: 'ds.ember.date.parse-deprecate',
18076
+ until: '3.0.0'
18077
+ }));
18078
+
17597
18079
 
17598
18080
  return Date.parse(date);
17599
- // throw deprecation
17600
18081
  };
17601
18082
 
17602
18083
  /**
@@ -17629,6 +18110,11 @@ define('ember-data/transforms/date', ['exports', 'ember-data/transforms/transfor
17629
18110
  var offset = serialized.indexOf('+');
17630
18111
 
17631
18112
  if (offset !== -1 && serialized.length - 3 === offset) {
18113
+ (false && !(false) && _ember.default.deprecate('The ECMA2015 Spec for ISO 8601 dates does not allow for shorthand timezone offsets such as +00.\n Ember Data\'s normalization of date\'s allowing for this shorthand has been deprecated, please update your API to return\n UTC dates formatted with \xB1hh:mm timezone offsets or implement a custom UTC transform.', false, {
18114
+ id: 'ds.attr.date.normalize-utc',
18115
+ until: '3.0.0'
18116
+ }));
18117
+
17632
18118
  return new Date(serialized + ':00');
17633
18119
 
17634
18120
  // this is a phantom specific bug fix in which +0000 is not supported
@@ -17796,7 +18282,7 @@ define("ember-data/version", ["exports"], function (exports) {
17796
18282
  "use strict";
17797
18283
 
17798
18284
  exports.__esModule = true;
17799
- exports.default = "2.14.11";
18285
+ exports.default = "2.15.0-beta.1";
17800
18286
  });
17801
18287
  define("ember-inflector", ["module", "exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (module, exports, _ember, _system) {
17802
18288
  "use strict";