ember-data-source 2.6.2 → 2.7.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dist/globals/ember-data.js +1033 -868
- data/dist/globals/ember-data.min.js +5 -5
- data/dist/globals/ember-data.prod.js +1002 -853
- data/package.json +4 -4
- metadata +4 -4
@@ -1,5 +1,5 @@
|
|
1
|
-
!function(){"use strict";var e,t,r,i,a;!function(n){function o(){m={define:0,require:0,reify:0,findDeps:0,modules:0,exports:0,resolve:0,resolveRelative:0,findModule:0,pendingQueueLength:0},a._stats=m}function s(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function d(e,t,r,i){m.modules++,this.id=g++,this.name=e,this.deps=!t.length&&r.length?R:t,this.module={exports:{}},this.callback=r,this.finalized=!1,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this._foundDeps=!1,this.isPending=!1}function l(e){this.name=e}function u(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function c(e,t,r){m.findModule++;for(var i=v[e]||v[e+"/index"];i&&i.isAlias;)i=v[i.name];return i||u(e,t),!r||i.finalized||i.isPending||(i.findDeps(r),r.push(i),m.pendingQueueLength++),i}function h(e,t){if(m.resolve++,"."!==e.charAt(0))return e;m.resolveRelative++;for(var r=e.split("/"),i=t.split("/"),a=i.slice(0,-1),n=0,o=r.length;n<o;n++){var s=r[n];if(".."===s){if(0===a.length)throw new Error("Cannot access parent module of root");a.pop()}else{if("."===s)continue;a.push(s)}}return a.join("/")}function p(e){return!(!v[e]&&!v[e+"/index"])}var f={loader:e,define:t,requireModule:r,require:i,requirejs:a};a=i=r=function(e){m.require++;for(var t=[],r=c(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports};var m;o(),e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&f.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=f[t])}};var y;y=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var v={},b={},g=0,R=["require","exports","module"];d.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||(e.default=e)},d.prototype.exports=function(){if(this.finalized)return this.module.exports;m.exports++,this.finalized=!0,this.isPending=!1,e.wrapModules&&(this.callback=e.wrapModules(this.name,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.hasExportsAsDep&&void 0===t||(this.module.exports=t),this.makeDefaultExport(),this.module.exports},d.prototype.unsee=function(){this.finalized=!1,this._foundDeps=!1,this.isPending=!1,this.module={exports:{}}},d.prototype.reify=function(){m.reify++;for(var e=this.reified,t=0;t<e.length;t++){var r=e[t];e[t]=r.exports?r.exports:r.module.exports()}},d.prototype.findDeps=function(e){if(!this._foundDeps){m.findDeps++,this._foundDeps=!0,this.isPending=!0;for(var t=this.deps,r=0;r<t.length;r++){var i=t[r],a=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,a.exports=this.module.exports):"require"===i?a.exports=this.makeRequire():"module"===i?a.exports=this.module:a.module=c(h(i,this.name),this.name,e)}}},d.prototype.makeRequire=function(){var e=this.name,t=function(t){return i(h(t,e))};return t.default=t,t.has=function(t){return p(h(t,e))},t},t=function(e,t,r){m.define++,arguments.length<2&&s(arguments.length),y(t)||(r=t,t=[]),r instanceof l?v[e]=new d(r.name,t,r,(!0)):v[e]=new d(e,t,r,(!1))},t.petal={},t.alias=function(e){return new l(e)},a.entries=a._eak_seen=v,a.has=p,a.unsee=function(e){c(e,"(unsee)",!1).unsee()},a.clear=function(){o(),a.entries=a._eak_seen=v={},b={}},t("foo",function(){}),t("foo/bar",[],function(){}),t("foo/asdf",["module","exports","require"],function(e,t,r){r.has("foo/bar")&&r("foo/bar")}),t("foo/baz",[],t.alias("foo")),t("foo/quz",t.alias("foo")),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),i("foo/main"),i.unsee("foo/bar"),a.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-private/adapters",["exports","ember-data/adapters/json-api","ember-data/adapters/rest"],function(e,t,r){e.JSONAPIAdapter=t.default,e.RESTAdapter=r.default}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){var r=t.default.get;e.default=t.default.Mixin.create({buildURL:function(e,t,r,i,a){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(a,e);case"queryRecord":return this.urlForQueryRecord(a,e);case"findMany":return this.urlForFindMany(t,e,r);case"findHasMany":return this.urlForFindHasMany(t,e,r);case"findBelongsTo":return this.urlForFindBelongsTo(t,e,r);case"createRecord":return this.urlForCreateRecord(e,r);case"updateRecord":return this.urlForUpdateRecord(t,e,r);case"deleteRecord":return this.urlForDeleteRecord(t,e,r);default:return this._buildURL(e,t)}},_buildURL:function(e,t){var i,a=[],n=r(this,"host"),o=this.urlPrefix();return e&&(i=this.pathForType(e),i&&a.push(i)),t&&a.push(encodeURIComponent(t)),o&&a.unshift(o),a=a.join("/"),!n&&a&&"/"!==a.charAt(0)&&(a="/"+a),a},urlForFindRecord:function(e,t,r){return this._buildURL(t,e)},urlForFindAll:function(e,t){return this._buildURL(e)},urlForQuery:function(e,t){return this._buildURL(t)},urlForQueryRecord:function(e,t){return this._buildURL(t)},urlForFindMany:function(e,t,r){return this._buildURL(t)},urlForFindHasMany:function(e,t,r){return this._buildURL(t,e)},urlForFindBelongsTo:function(e,t,r){return this._buildURL(t,e)},urlForCreateRecord:function(e,t){return this._buildURL(e)},urlForUpdateRecord:function(e,t,r){return this._buildURL(t,e)},urlForDeleteRecord:function(e,t,r){return this._buildURL(t,e)},urlPrefix:function(e,t){var i=r(this,"host"),a=r(this,"namespace");if(i&&"/"!==i||(i=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+i+e:t+"/"+e;var n=[];return i&&n.push(i),a&&n.push(a),n.join("/")},pathForType:function(e){var r=t.default.String.camelize(e);return t.default.String.pluralize(r)}})}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){var i=t.default.Namespace.create({VERSION:r.default});t.default.libraries&&t.default.libraries.registerCoreLibrary("Ember Data",i.VERSION),e.default=i}),t("ember-data/-private/debug",["exports","ember"],function(e,t){function r(){return t.default.assert.apply(t.default,arguments)}function i(){return t.default.debug.apply(t.default,arguments)}function a(){return t.default.deprecate.apply(t.default,arguments)}function n(){return t.default.info.apply(t.default,arguments)}function o(){return t.default.runInDebug.apply(t.default,arguments)}function s(){return t.default.warn.apply(t.default,arguments)}function d(){return t.default.debugSeal.apply(t.default,arguments)}function l(e,r){return e.__isMixin?e.__mixin.detect(r.type.PrototypeMixin):(t.default.MODEL_FACTORY_INJECTIONS&&(e=e.superclass),e.detect(r.type))}function u(e,t,i){var a=i.type.modelName,n=e.type.modelName,o=t.key,s=e.store.modelFor(t.type),d="You cannot add a record of type '"+a+"' to the '"+n+"."+o+"' relationship (only '"+s.modelName+"' allowed)";r(d,l(s,i))}e.assert=r,e.debug=i,e.deprecate=a,e.info=n,e.runInDebug=o,e.warn=s,e.debugSeal=d,e.assertPolymorphicType=u}),t("ember-data/-private/ext/date",["exports","ember"],function(e,t){t.default.Date=t.default.Date||{};var r=Date.parse,i=[1,4,5,6,7,10,11];t.default.Date.parse=function(e){var t,a,n=0;if(a=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(e)){for(var o,s=0;o=i[s];++s)a[o]=+a[o]||0;a[2]=(+a[2]||1)-1,a[3]=+a[3]||1,"Z"!==a[8]&&void 0!==a[9]&&(n=60*a[10]+a[11],"+"===a[9]&&(n=0-n)),t=Date.UTC(a[1],a[2],a[3],a[4],a[5]+n,a[6],a[7])}else t=r?r(e):NaN;return t},(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.Date)&&(Date.parse=t.default.Date.parse)}),t("ember-data/-private/features",["exports","ember"],function(e,t){function r(){var e;return(e=t.default.FEATURES).isEnabled.apply(e,arguments)}e.default=r}),t("ember-data/-private/initializers/data-adapter",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){function r(e){e.register("data-adapter:main",t.default)}e.default=r}),t("ember-data/-private/initializers/store-injections",["exports"],function(e){function t(e){var t=e.inject||e.injection;t.call(e,"controller","store","service:store"),t.call(e,"route","store","service:store"),t.call(e,"data-adapter","store","service:store")}e.default=t}),t("ember-data/-private/initializers/store",["exports","ember-data/-private/system/store","ember-data/-private/serializers","ember-data/-private/adapters"],function(e,t,r,i){function a(e,t){return e.has?e.has(t):e.hasRegistration(t)}function n(e){var n=e.registerOptionsForType||e.optionsForType;n.call(e,"serializer",{singleton:!1}),n.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",r.JSONSerializer),e.register("serializer:-rest",r.RESTSerializer),e.register("adapter:-rest",i.RESTAdapter),e.register("adapter:-json-api",i.JSONAPIAdapter),e.register("serializer:-json-api",r.JSONAPISerializer),a(e,"service:store")||e.register("service:store",t.default)}e.default=n}),t("ember-data/-private/initializers/transforms",["exports","ember-data/-private/transforms"],function(e,t){function r(e){e.register("transform:boolean",t.BooleanTransform),e.register("transform:date",t.DateTransform),e.register("transform:number",t.NumberTransform),e.register("transform:string",t.StringTransform)}e.default=r}),t("ember-data/-private/instance-initializers/initialize-store-service",["exports"],function(e){function t(e){var t=e.lookup?e:e.container;t.lookup("service:store")}e.default=t}),t("ember-data/-private/serializers",["exports","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest"],function(e,t,r,i){e.JSONAPISerializer=t.default,e.JSONSerializer=r.default,e.RESTSerializer=i.default}),t("ember-data/-private/system/clone-null",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){var r=new t.default;for(var i in e)r[i]=e[i];return r}e.default=r}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null==e||""===e?null:e+""}e.default=t}),t("ember-data/-private/system/container-proxy",["exports","ember-data/-private/debug"],function(e,t){function r(e){this.container=e}e.default=r,r.prototype.aliasedFactory=function(e,t){var r=this;return{create:function(){return t&&t(),r.container.lookup(e)}}},r.prototype.registerAlias=function(e,t,r){var i=this.aliasedFactory(t,r);return this.container.register(e,i)},r.prototype.registerDeprecation=function(e,t){var r=function(){};return this.registerAlias(e,t,r)},r.prototype.registerDeprecations=function(e){var t,r,i,a;for(t=e.length;t>0;t--)r=e[t-1],i=r.deprecated,a=r.valid,this.registerDeprecation(i,a)}}),t("ember-data/-private/system/debug",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){e.default=t.default}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/model"],function(e,t,r){var i=t.default.get,a=t.default.String.capitalize,n=t.default.String.underscore,o=t.default.assert;e.default=t.default.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==r.default&&r.default.detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,o=this;return i(e,"attributes").forEach(function(e,i){if(r++>o.attributeLimit)return!1;var s=a(n(i).replace("_"," "));t.push({name:i,desc:s})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var i=r.match(/model:(.*)/);i&&(t=i[1])}}return o("Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support",!!t),this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,a={id:i(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;var o=i(e,n);a[n]=o}),a},getRecordKeywords:function(e){var r=[],a=t.default.A(["id"]);return e.eachAttribute(function(e){return a.push(e)}),a.forEach(function(t){return r.push(i(e,t))}),r},getRecordFilterValues:function(e){return{isNew:e.get("isNew"),isModified:e.get("hasDirtyAttributes")&&!e.get("isNew"),isClean:!e.get("hasDirtyAttributes")}},getRecordColor:function(e){var t="black";return e.get("isNew")?t="green":e.get("hasDirtyAttributes")&&(t="blue"),t},observeRecord:function(e,r){var i=t.default.A(),a=t.default.A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return a.push(e)});var n=this;a.forEach(function(a){var o=function(){r(n.wrapRecord(e))};t.default.addObserver(e,a,o),i.push(function(){t.default.removeObserver(e,a,o)})});var o=function(){i.forEach(function(e){return e()})};return o}})}),t("ember-data/-private/system/debug/debug-info",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_debugInfo:function(){var e=["id"],t={belongsTo:[],hasMany:[]},r=[];this.eachAttribute(function(t,r){return e.push(t)}),this.eachRelationship(function(e,i){t[i.kind].push(e),r.push(e)});var i=[{name:"Attributes",properties:e,expand:!0},{name:"Belongs To",properties:t.belongsTo,expand:!0},{name:"Has Many",properties:t.hasMany,expand:!0},{name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}];return{propertyInfo:{includeOtherProperties:!0,groups:i,expensiveProperties:r}}}})}),t("ember-data/-private/system/empty-object",["exports"],function(e){function t(){}e.default=t;var r=Object.create(null,{constructor:{value:void 0,enumerable:!1,writable:!0}});t.prototype=r}),t("ember-data/-private/system/is-array-like",["exports","ember"],function(e,t){function r(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(t.default.Array.detect(e))return!0;var r=t.default.typeOf(e);return"array"===r||void 0!==e.length&&"object"===r}e.default=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common"],function(e,t,r,i,a){var n=t.default.get,o=t.default.set;e.default=t.default.Object.extend(t.default.MutableArray,t.default.Evented,{init:function(){this._super.apply(this,arguments),this.currentState=t.default.A([])},record:null,canonicalState:null,currentState:null,length:0,objectAt:function(e){if(this.currentState[e])return this.currentState[e].getRecord()},flushCanonical:function(){var e=this.canonicalState.filter(function(e){return!e.isDeleted()}),t=this.currentState.filter(function(t){return t.isNew()&&e.indexOf(t)===-1});e=e.concat(t);var r=this.length;this.arrayContentWillChange(0,this.length,e.length),(0,a._objectIsAlive)(this)&&this.set("length",e.length),this.currentState=e,this.arrayContentDidChange(0,r,this.length),this.relationship.notifyHasManyChanged(),this.record.updateRecordArrays()},isPolymorphic:!1,isLoaded:!1,relationship:null,meta:null,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),r&&this.relationship.notifyHasManyChanged(),this.record.updateRecordArrays()},internalRemoveRecords:function(e){for(var t,r=0;r<e.length;r++)t=this.currentState.indexOf(e[r]),this.internalReplace(t,1)},internalAddRecords:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var i;t>0&&(i=this.currentState.slice(e,e+t),this.get("relationship").removeRecords(i)),r&&this.get("relationship").addRecords(r.map(function(e){return e._internalModel}),e)},promise:null,loadingRecordsCount:function(e){this.loadingRecordsCount=e},loadedRecord:function(){this.loadingRecordsCount--,0===this.loadingRecordsCount&&(o(this,"isLoaded",!0),this.trigger("didLoad"))},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+n(this,"type"),a=t.default.RSVP.all(this.invoke("save"),r).then(function(t){return e},null,"DS: ManyArray#save return ManyArray");return i.PromiseArray.create({promise:a})},createRecord:function(e){var t,r=n(this,"store"),i=n(this,"type");return t=r.createRecord(i.modelName,e),this.pushObject(t),t}})}),t("ember-data/-private/system/model",["exports","ember-data/-private/system/model/model","ember-data/attr","ember-data/-private/system/model/states","ember-data/-private/system/model/errors"],function(e,t,r,i,a){e.RootState=i.default,e.attr=r.default,e.Errors=a.default,e.default=t.default}),t("ember-data/-private/system/model/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){var i=t.default.get,a=t.default.Map,n=t.default.Mixin.create({attributes:t.default.computed(function(){var e=a.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:t.default.computed(function(){var e=a.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){i(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){i(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}});e.AttrClassMethodsMixin=n;var o=t.default.Mixin.create({eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});e.AttrInstanceMethodsMixin=o}),t("ember-data/-private/system/model/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){var i=t.default.get,a=t.default.set,n=t.default.isEmpty,o=t.default.makeArray,s=t.default.MapWithDefault;e.default=t.default.ArrayProxy.extend(t.default.Evented,{registerHandlers:function(e,t,r){this._registerHandlers(e,t,r)},_registerHandlers:function(e,t,r){this.on("becameInvalid",e,t),this.on("becameValid",e,r)},errorsByAttributeName:t.default.computed(function(){return s.create({defaultValue:function(){return t.default.A()}})}),errorsFor:function(e){return i(this,"errorsByAttributeName").get(e)},messages:t.default.computed.mapBy("content","message"),content:t.default.computed(function(){return t.default.A()}),unknownProperty:function(e){var t=this.errorsFor(e);return n(t)?null:t},isEmpty:t.default.computed.not("length").readOnly(),add:function(e,t){var r=i(this,"isEmpty");this._add(e,t),r&&!i(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),i(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=o(t),a=new Array(i.length),n=0;n<i.length;n++){var s=i[n],d=r.findBy("message",s);d?a[n]=d:a[n]={attribute:e,message:s}}return a},remove:function(e){i(this,"isEmpty")||(this._remove(e),i(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!i(this,"isEmpty")){var t=this.rejectBy("attribute",e);a(this,"content",t),i(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e)}},clear:function(){i(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!i(this,"isEmpty")){var e=i(this,"errorsByAttributeName"),r=t.default.A();e.forEach(function(e,t){r.push(t)}),e.clear(),r.forEach(function(e){this.notifyPropertyChange(e)},this),t.default.ArrayProxy.prototype.clear.call(this)}},has:function(e){return!n(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/system/empty-object","ember-data/-private/features","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,a,n,o,s,d,l){function u(e){return _[e]||(_[e]=e.split("."))}function c(e){return R[e]||(R[e]=u(e)[0])}function h(e){return function(){return y(this.currentState,e)}}function p(e,r,n,s,d){this.type=e,this.id=r,this.store=n,this._data=d||new o.default,this.modelName=e.modelName,this.dataHasInitialized=!1,this._deferredTriggers=[],this._attributes=new o.default,this._inFlightAttributes=new o.default,this._relationships=new a.default(this),this._recordArrays=void 0,this.currentState=i.default.empty,this.recordReference=new l.RecordReference(n,this),this.references={},this.isReloading=!1,this.isError=!1,this.error=null,this.__ember_meta__=null,this[t.default.GUID_KEY]=A++ +"internal-model",this._implicitRelationships=new o.default}var f=function(){function e(e,t){var r=[],i=!0,a=!1,n=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);i=!0);}catch(e){a=!0,n=e}finally{try{!i&&s.return&&s.return()}finally{if(a)throw n}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=p;var m=t.default.RSVP.Promise,y=t.default.get,v=t.default.set,b=t.default.copy,g=t.default.assign||t.default.merge,R=new o.default,_=new o.default,A=0;p.prototype={isEmpty:h("isEmpty"),isLoading:h("isLoading"),isLoaded:h("isLoaded"),hasDirtyAttributes:h("hasDirtyAttributes"),isSaving:h("isSaving"),isDeleted:h("isDeleted"),isNew:h("isNew"),isValid:h("isValid"),dirtyType:h("dirtyType"),constructor:p,materializeRecord:function(){var e={store:this.store,_internalModel:this,id:this.id,currentState:y(this,"currentState"),isError:this.isError,adapterError:this.error};t.default.setOwner?t.default.setOwner(e,(0,d.getOwner)(this.store)):e.container=this.store.container,this.record=this.type._create(e),this._triggerDeferredTriggers()},recordObjectWillDestroy:function(){this.record=null},deleteRecord:function(){this.send("deleteRecord")},save:function(e){var r="DS: Model#save "+this,i=t.default.RSVP.defer(r);return this.store.scheduleSave(this,i,e),i.promise},startedReloading:function(){this.isReloading=!0,this.record&&v(this.record,"isReloading",!0)},finishedReloading:function(){this.isReloading=!1,this.record&&v(this.record,"isReloading",!1)},reload:function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new m(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()})},getRecord:function(){return this.record||this.materializeRecord(),this.record},unloadRecord:function(){this.send("unloadRecord")},eachRelationship:function(e,t){return this.type.eachRelationship(e,t)},eachAttribute:function(e,t){return this.type.eachAttribute(e,t)},inverseFor:function(e){return this.type.inverseFor(e)},setupData:function(e){var t=this._changedKeys(e.attributes);g(this._data,e.attributes),this.pushedData(),this.record&&this.record._notifyProperties(t),this.didInitalizeData()},becameReady:function(){t.default.run.schedule("actions",this.store.recordArrayManager,this.store.recordArrayManager.recordWasLoaded,this)},didInitalizeData:function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)},destroy:function(){if(this.record)return this.record.destroy()},createSnapshot:function(e){return new n.default(this,e)},loadingData:function(e){this.send("loadingData",e)},loadedData:function(){this.send("loadedData"),this.didInitalizeData()},notFound:function(){this.send("notFound")},pushedData:function(){this.send("pushedData")},flushChangedAttributes:function(){this._inFlightAttributes=this._attributes,this._attributes=new o.default},hasChangedAttributes:function(){return Object.keys(this._attributes).length>0},updateChangedAttributes:function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=0,i=t.length;r<i;r++){var a=t[r],n=f(e[a],2),o=n[0],s=n[1];o===s&&delete this._attributes[a]}},changedAttributes:function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=g(b(r),t),a=new o.default,n=Object.keys(i),s=0,d=n.length;s<d;s++){var l=n[s];a[l]=[e[l],i[l]]}return a},adapterWillCommit:function(){this.send("willCommit")},adapterDidDirty:function(){this.send("becomeDirty"),this.updateRecordArraysLater()},send:function(e,t){var r=y(this,"currentState");return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},notifyHasManyAdded:function(e,t,r){this.record&&this.record.notifyHasManyAdded(e,t,r)},notifyHasManyRemoved:function(e,t,r){this.record&&this.record.notifyHasManyRemoved(e,t,r)},notifyBelongsToChanged:function(e,t){this.record&&this.record.notifyBelongsToChanged(e,t)},notifyPropertyChange:function(e){this.record&&this.record.notifyPropertyChange(e)},rollbackAttributes:function(){var e=Object.keys(this._attributes);this._attributes=new o.default,y(this,"isError")&&(this._inFlightAttributes=new o.default,this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=new o.default),this.send("rolledBack"),this.record._notifyProperties(e)},transitionTo:function(e){var t=c(e),r=y(this,"currentState"),i=r;do i.exit&&i.exit(this),i=i.parentState;while(!i.hasOwnProperty(t));var a,n,o=u(e),s=[],d=[];for(a=0,n=o.length;a<n;a++)i=i[o[a]],i.enter&&d.push(i),i.setup&&s.push(i);for(a=0,n=d.length;a<n;a++)d[a].enter(this);for(v(this,"currentState",i),this.record&&v(this.record,"currentState",i),a=0,n=s.length;a<n;a++)s[a].setup(this);this.updateRecordArraysLater()},_unhandledEvent:function(e,r,i){var a="Attempted to handle event `"+r+"` ";throw a+="on "+String(this)+" while in state ",a+=e.stateName+". ",void 0!==i&&(a+="Called with "+t.default.inspect(i)+"."),new t.default.Error(a)},triggerLater:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];1===this._deferredTriggers.push(r)&&t.default.run.scheduleOnce("actions",this,"_triggerDeferredTriggers")},_triggerDeferredTriggers:function(){if(this.record){for(var e=0,t=this._deferredTriggers.length;e<t;e++)this.record.trigger.apply(this.record,this._deferredTriggers[e]);this._deferredTriggers.length=0}},clearRelationships:function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var i=e._relationships.get(t);i.clear(),i.destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].destroy()})},_preloadData:function(e){var t=this;Object.keys(e).forEach(function(r){var i=y(e,r),a=t.type.metaForProperty(r);a.isRelationship?t._preloadRelationship(r,i):t._data[r]=i})},_preloadRelationship:function(e,t){var r=this.type.metaForProperty(e),i=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,i):this._preloadBelongsTo(e,t,i)},_preloadHasMany:function(e,t,r){for(var i=new Array(t.length),a=0;a<t.length;a++){var n=t[a];i[a]=this._convertStringOrNumberIntoInternalModel(n,r)}this._relationships.get(e).updateRecordsFromAdapter(i)},_preloadBelongsTo:function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setRecord(i)},_convertStringOrNumberIntoInternalModel:function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},updateRecordArrays:function(){this._updatingRecordArraysLater=!1,this.store.dataWasUpdated(this.type,this)},setId:function(e){this.id=e,this.record.get("id")!==e&&this.record.set("id",e)},didError:function(e){this.error=e,this.isError=!0,this.record&&this.record.setProperties({isError:!0,adapterError:e})},didCleanError:function(){this.error=null,this.isError=!1,this.record&&this.record.setProperties({isError:!1,adapterError:null})},adapterDidCommit:function(e){e&&(e=e.attributes),this.didCleanError();var t=this._changedKeys(e);g(this._data,this._inFlightAttributes),e&&g(this._data,e),this._inFlightAttributes=new o.default,this.send("didCommit"),this.updateRecordArraysLater(),e&&this.record._notifyProperties(t)},updateRecordArraysLater:function(){this._updatingRecordArraysLater||(this._updatingRecordArraysLater=!0,t.default.run.schedule("actions",this,this.updateRecordArrays))},addErrorMessageToAttribute:function(e,t){var r=this.getRecord();y(r,"errors")._add(e,t)},removeErrorMessageFromAttribute:function(e){var t=this.getRecord();y(t,"errors")._remove(e)},clearErrorMessages:function(){var e=this.getRecord();y(e,"errors")._clear()},hasErrors:function(){var e=this.getRecord(),r=y(e,"errors");return!t.default.isEmpty(r)},adapterDidInvalidate:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},adapterDidError:function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},_saveWasRejected:function(){for(var e=Object.keys(this._inFlightAttributes),t=0;t<e.length;t++)void 0===this._attributes[e[t]]&&(this._attributes[e[t]]=this._inFlightAttributes[e[t]]);this._inFlightAttributes=new o.default},_changedKeys:function(e){var r=[];if(e){var i,a,n,s,d=Object.keys(e),l=d.length;for(i=g(new o.default,this._data),i=g(i,this._inFlightAttributes),a=0;a<l;a++)s=d[a],n=e[s],void 0===this._attributes[s]&&(t.default.isEqual(i[s],n)||r.push(s))}return r},toString:function(){return this.record?this.record.toString():"<"+this.modelName+":"+this.id+">"}},p.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}}),t("ember-data/-private/system/model/model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/features","ember-data/-private/system/debug/debug-info","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/system/relationships/ext","ember-data/-private/system/model/attr"],function(e,t,r,i,a,n,o,s,d,l,u){var c=t.default.get,h=t.default.computed("currentState",function(e){return c(this._internalModel.currentState,e)}).readOnly(),p=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,isEmpty:h,isLoading:h,isLoaded:h,hasDirtyAttributes:t.default.computed("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:h,isDeleted:h,isNew:h,isValid:h,dirtyType:h,isError:!1,isReloading:!1,id:null,errors:t.default.computed(function(){var e=a.default.create();return e._registerHandlers(this._internalModel,function(){this.send("becameInvalid")},function(){this.send("becameValid")}),e}).readOnly(),adapterError:null,serialize:function(e){return this.store.serialize(this,e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:t.default.K,didLoad:t.default.K,didUpdate:t.default.K,didCreate:t.default.K,didDelete:t.default.K,becameInvalid:t.default.K,becameError:t.default.K,rolledBack:t.default.K,data:t.default.computed.readOnly("_internalModel._data"),send:function(e,t){return this._internalModel.send(e,t)},transitionTo:function(e){return this._internalModel.transitionTo(e)},deleteRecord:function(){this._internalModel.deleteRecord()},destroyRecord:function(e){return this.deleteRecord(),this.save(e)},unloadRecord:function(){this.isDestroyed||this._internalModel.unloadRecord()},_notifyProperties:function(e){t.default.beginPropertyChanges();for(var r,i=0,a=e.length;i<a;i++)r=e[i],this.notifyPropertyChange(r);t.default.endPropertyChanges()},changedAttributes:function(){return this._internalModel.changedAttributes()},rollbackAttributes:function(){this._internalModel.rollbackAttributes()},_createSnapshot:function(){return this._internalModel.createSnapshot()},toStringExtension:function(){return c(this,"id")},save:function(e){var t=this;return i.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){
|
2
|
-
var e=this;return i.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){for(var r=arguments.length,i=new Array(r-1),a=1;a<r;a++)i[a-1]=arguments[a];t.default.tryInvoke(this,e,i),this._super.apply(this,arguments)},willDestroy:function(){this._super.apply(this,arguments),this._internalModel.clearRelationships(),this._internalModel.recordObjectWillDestroy()},willMergeMixin:function(e){this.constructor},attr:function(){},belongsTo:function(){},hasMany:function(){},setId:t.default.observer("id",function(){this._internalModel.setId(this.get("id"))})});p.reopenClass({_create:p.create,create:function(){throw new t.default.Error("You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.")},modelName:null}),t.default.setOwner&&Object.defineProperty(p.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),p.reopen({belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)}}),p.reopenClass(l.RelationshipsClassMethodsMixin),p.reopenClass(u.AttrClassMethodsMixin),e.default=p.extend(o.default,s.BelongsToMixin,l.DidDefinePropertyMixin,l.RelationshipsInstanceMethodsMixin,d.HasManyMixin,u.AttrInstanceMethodsMixin)}),t("ember-data/-private/system/model/states",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArraysLater()}function a(e){var t,r={};for(var i in e)t=e[i],t&&"object"==typeof t?r[i]=a(t):r[i]=t;return r}function n(e,t){for(var r in t)e[r]=t[r];return e}function o(e){var t=a(c);return n(t,e)}function s(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function d(e){}function l(e,t,r){e=n(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var i in e)e.hasOwnProperty(i)&&"parentState"!==i&&"stateName"!==i&&"object"==typeof e[i]&&(e[i]=l(e[i],e,r+"."+i));return e}var u=t.default.get,c={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:i,loadingData:t.default.K,propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:t.default.K,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:i,becomeDirty:t.default.K,pushedData:t.default.K,unloadRecord:d,willCommit:t.default.K,didCommit:function(e){var t=u(this,"dirtyType");e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",t)},becameInvalid:function(e){e.transitionTo("invalid"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)}},invalid:{isValid:!1,deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),i(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:t.default.K,becomeDirty:t.default.K,pushedData:t.default.K,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)}}},h=o({dirtyType:"created",isNew:!0});h.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},h.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var p=o({dirtyType:"updated"});h.uncommitted.deleteRecord=s,h.invalid.deleteRecord=s,h.uncommitted.rollback=function(e){c.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},h.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},h.uncommitted.propertyWasReset=t.default.K,p.inFlight.unloadRecord=d,p.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var f={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:t.default.K,unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},propertyWasReset:t.default.K,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:t.default.K,saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:i,pushedData:t.default.K,becomeDirty:function(e){e.transitionTo("updated.uncommitted")},willCommit:function(e){e.transitionTo("updated.inFlight")},reloadRecord:function(e,t){t(e.store.reloadRecord(e))},deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},didCommit:function(e){e.send("invokeLifecycleCallbacks",u(e,"lastDirtyType"))},notFound:t.default.K},created:h,updated:p},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:t.default.K,becomeDirty:t.default.K,deleteRecord:t.default.K,rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:d,willCommit:t.default.K,didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)},becameInvalid:function(e){e.transitionTo("invalid"),e.triggerLater("becameInvalid",e)}},saved:{isDirty:!1,setup:function(e){e.clearRelationships();var t=e.store;t._dematerializeRecord(e)},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:t.default.K,didCommit:t.default.K},invalid:{isValid:!1,didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),i(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:t.default.K,becomeDirty:t.default.K,deleteRecord:t.default.K,willCommit:t.default.K,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)}};f=l(f,null,"root"),e.default=f}),t("ember-data/-private/system/normalize-link",["exports"],function(e){function t(e){switch(typeof e){case"object":return e;case"string":return{href:e}}return null}e.default=t}),t("ember-data/-private/system/normalize-model-name",["exports","ember"],function(e,t){function r(e){return t.default.String.dasherize(e)}e.default=r}),t("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e.default=r;var i=t.default.OrderedSet,a=t.default.guidFor;r.create=function(){var e=this;return new e},r.prototype=Object.create(i.prototype),r.prototype.constructor=r,r.prototype._super$constructor=i,r.prototype.addWithIndex=function(e,t){var r=a(e),i=this.presenceSet,n=this.list;if(i[r]!==!0)return i[r]=!0,void 0===t||null==t?n.push(e):n.splice(t,0,e),this.size+=1,this}}),t("ember-data/-private/system/promise-proxies",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){return function(){var t=n(this,"content");return t[e].apply(t,arguments)}}var a=t.default.RSVP.Promise,n=t.default.get,o=t.default.ArrayProxy.extend(t.default.PromiseProxyMixin),s=t.default.ObjectProxy.extend(t.default.PromiseProxyMixin),d=function(e,t){return s.create({promise:a.resolve(e,t)})},l=function(e,t){return o.create({promise:a.resolve(e,t)})},u=o.extend({reload:function(){return u.create({promise:n(this,"content").reload()})},createRecord:i("createRecord"),on:i("on"),one:i("one"),trigger:i("trigger"),off:i("off"),has:i("has")}),c=function(e,t){return u.create({promise:a.resolve(e,t)})};e.PromiseArray=o,e.PromiseObject=s,e.PromiseManyArray=u,e.promiseArray=l,e.promiseObject=d,e.promiseManyArray=c}),t("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays","ember-data/-private/system/ordered-set"],function(e,t,r,i){function a(e){e.destroy()}function n(e){for(var r=e.length,i=t.default.A(),a=0;a<r;a++)i=i.concat(e[a]);return i}function o(e,t){var r=e.indexOf(t);return r!==-1&&(e.splice(r,1),!0)}var s=t.default.MapWithDefault,d=t.default.get;e.default=t.default.Object.extend({init:function(){var e=this;this.filteredRecordArrays=s.create({defaultValue:function(){return[]}}),this.liveRecordArrays=s.create({defaultValue:function(t){return e.createRecordArray(t)}}),this.changedRecords=[],this._adapterPopulatedRecordArrays=[]},recordDidChange:function(e){1===this.changedRecords.push(e)&&t.default.run.schedule("actions",this,this.updateRecordArrays)},recordArraysForRecord:function(e){return e._recordArrays=e._recordArrays||i.default.create(),e._recordArrays},updateRecordArrays:function(){var e=this;this.changedRecords.forEach(function(t){d(t,"record.isDestroyed")||d(t,"record.isDestroying")||"root.deleted.saved"===d(t,"currentState.stateName")?e._recordWasDeleted(t):e._recordWasChanged(t)}),this.changedRecords.length=0},_recordWasDeleted:function(e){var t=e._recordArrays;t&&(t.forEach(function(t){return t.removeInternalModel(e)}),e._recordArrays=null)},_recordWasChanged:function(e){var t,r=this,i=e.type,a=this.filteredRecordArrays.get(i);a.forEach(function(a){t=d(a,"filterFunction"),r.updateFilterRecordArray(a,t,i,e)})},recordWasLoaded:function(e){var t,r=this,i=e.type,a=this.filteredRecordArrays.get(i);if(a.forEach(function(a){t=d(a,"filterFunction"),r.updateFilterRecordArray(a,t,i,e)}),this.liveRecordArrays.has(i)){var n=this.liveRecordArrays.get(i);this._addRecordToRecordArray(n,e)}},updateFilterRecordArray:function(e,t,r,i){var a=t(i.getRecord()),n=this.recordArraysForRecord(i);a?this._addRecordToRecordArray(e,i):(n.delete(e),e.removeInternalModel(i))},_addRecordToRecordArray:function(e,t){var r=this.recordArraysForRecord(t);r.has(e)||(e.addInternalModel(t),r.add(e))},populateLiveRecordArray:function(e,t){for(var r,i=this.store.typeMapFor(t),a=i.records,n=0;n<a.length;n++)r=a[n],r.isDeleted()||r.isEmpty()||this._addRecordToRecordArray(e,r)},updateFilter:function(e,t,r){for(var i,a=this.store.typeMapFor(t),n=a.records,o=0;o<n.length;o++)i=n[o],i.isDeleted()||i.isEmpty()||this.updateFilterRecordArray(e,r,t,i)},liveRecordArrayFor:function(e){return this.liveRecordArrays.get(e)},createRecordArray:function(e){var i=r.RecordArray.create({type:e,content:t.default.A(),store:this.store,isLoaded:!0,manager:this});return i},createFilteredRecordArray:function(e,i,a){var n=r.FilteredRecordArray.create({query:a,type:e,content:t.default.A(),store:this.store,manager:this,filterFunction:i});return this.registerFilteredRecordArray(n,e,i),n},createAdapterPopulatedRecordArray:function(e,i){var a=r.AdapterPopulatedRecordArray.create({type:e,query:i,content:t.default.A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(a),a},registerFilteredRecordArray:function(e,t,r){var i=this.filteredRecordArrays.get(t);i.push(e),this.updateFilter(e,t,r)},unregisterRecordArray:function(e){var t=e.type,r=this.filteredRecordArrays.get(t),i=o(r,e),a=o(this._adapterPopulatedRecordArrays,e);if(!i&&!a&&this.liveRecordArrays.has(t)){var n=this.liveRecordArrayFor(t);e===n&&this.liveRecordArrays.delete(t)}},willDestroy:function(){this._super.apply(this,arguments),this.filteredRecordArrays.forEach(function(e){return n(e).forEach(a)}),this.liveRecordArrays.forEach(a),this._adapterPopulatedRecordArrays.forEach(a)}})}),t("ember-data/-private/system/record-arrays",["exports","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/record-arrays/filtered-record-array","ember-data/-private/system/record-arrays/adapter-populated-record-array"],function(e,t,r,i){e.RecordArray=t.default,e.FilteredRecordArray=r.default,e.AdapterPopulatedRecordArray=i.default}),t("ember-data/-private/system/record-arrays/adapter-populated-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/clone-null","ember-data/-private/features"],function(e,t,r,i,a){var n=t.default.get;e.default=r.default.extend({query:null,replace:function(){var e=n(this,"type").toString();throw new Error("The result of a server query (on "+e+") is immutable.")},_update:function(){var e=n(this,"store"),t=n(this,"type.modelName"),r=n(this,"query");return e._query(t,r,this)},loadRecords:function(e,r){var a=this,n=t.default.A(e).mapBy("_internalModel");this.setProperties({content:t.default.A(n),isLoaded:!0,isUpdating:!1,meta:(0,i.default)(r.meta)}),n.forEach(function(e){a.manager.recordArraysForRecord(e).add(a)}),t.default.run.once(this,"trigger","didLoad")}})}),t("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array"],function(e,t,r){var i=t.default.get;e.default=r.default.extend({filterFunction:null,isLoaded:!0,replace:function(){var e=i(this,"type").toString();throw new Error("The result of a client-side filter (on "+e+") is immutable.")},_updateFilter:function(){var e=i(this,"manager");e.updateFilter(this,i(this,"type"),i(this,"filterFunction"))},updateFilter:t.default.observer("filterFunction",function(){t.default.run.once(this,this._updateFilter)})})}),t("ember-data/-private/system/record-arrays/record-array",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/snapshot-record-array"],function(e,t,r,i){var a=t.default.get,n=t.default.set;e.default=t.default.ArrayProxy.extend(t.default.Evented,{type:null,content:null,isLoaded:!1,isUpdating:!1,store:null,objectAtContent:function(e){var t=a(this,"content"),r=t.objectAt(e);return r&&r.getRecord()},update:function(){if(!a(this,"isUpdating"))return this.set("isUpdating",!0),this._update()},_update:function(){var e=a(this,"store"),t=a(this,"type.modelName");return e.findAll(t,{reload:!0})},addInternalModel:function(e,t){var r=a(this,"content");void 0===t?r.addObject(e):r.contains(e)||r.insertAt(t,e)},removeInternalModel:function(e){a(this,"content").removeObject(e)},save:function(){var e=this,i="DS: RecordArray#save "+a(this,"type"),n=t.default.RSVP.all(this.invoke("save"),i).then(function(t){return e},null,"DS: RecordArray#save return RecordArray");return r.PromiseArray.create({promise:n})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t._recordArrays;r&&r.delete(e)})},_unregisterFromManager:function(){var e=a(this,"manager");e.unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),n(this,"content",void 0),this._super.apply(this,arguments)},createSnapshot:function(e){var t=this.get("meta");return new i.default(this,t,e)}})}),t("ember-data/-private/system/references",["exports","ember-data/-private/system/references/record","ember-data/-private/system/references/belongs-to","ember-data/-private/system/references/has-many"],function(e,t,r,i){e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=i.default}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/model","ember","ember-data/-private/system/references/reference","ember-data/-private/debug"],function(e,t,r,i,a){var n=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};n.prototype=Object.create(i.default.prototype),n.prototype.constructor=n,n.prototype._super$constructor=i.default,n.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},n.prototype.id=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.id},n.prototype.link=function(){return this.belongsToRelationship.link},n.prototype.meta=function(){return this.belongsToRelationship.meta},n.prototype.push=function(e){var i=this;return r.default.RSVP.resolve(e).then(function(e){var r;return r=e instanceof t.default?e:i.store.push(e),i.belongsToRelationship.setCanonicalRecord(r._internalModel),r})},n.prototype.value=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.record?e.record:null},n.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},n.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=n}),t("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/debug"],function(e,t,r,i){var a=t.default.get,n=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};n.prototype=Object.create(r.default.prototype),n.prototype.constructor=n,n.prototype._super$constructor=r.default,n.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},n.prototype.link=function(){return this.hasManyRelationship.link},n.prototype.ids=function(){var e=this.hasManyRelationship.members,t=e.toArray().map(function(e){return e.id});return t},n.prototype.meta=function(){return this.hasManyRelationship.manyArray.meta},n.prototype.push=function(e){var r=this;return t.default.RSVP.resolve(e).then(function(e){var t=e;"object"==typeof e&&e.data&&(t=e.data);var i=t.map(function(e){var t=r.store.push(e);return t._internalModel});return r.hasManyRelationship.computeChanges(i),r.hasManyRelationship.manyArray})},n.prototype._isLoaded=function(){var e=a(this.hasManyRelationship,"hasData");if(!e)return!1;var t=this.hasManyRelationship.members.toArray(),r=t.every(function(e){return e.isLoaded()===!0});return r},n.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},n.prototype.load=function(){if(!this._isLoaded())return this.hasManyRelationship.getRecords();var e=this.hasManyRelationship.manyArray;return t.default.RSVP.resolve(e)},n.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=n}),t("ember-data/-private/system/references/record",["exports","ember","ember-data/-private/system/references/reference"],function(e,t,r){var i=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};i.prototype=Object.create(r.default.prototype),i.prototype.constructor=i,i.prototype._super$constructor=r.default,i.prototype.id=function(){return this._id},i.prototype.remoteType=function(){return"identity"},i.prototype.push=function(e){var r=this;return t.default.RSVP.resolve(e).then(function(e){var t=r.store.push(e);return t})},i.prototype.value=function(){return this.internalModel.record},i.prototype.load=function(){return this.store.findRecord(this.type,this._id)},i.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e.default=i}),t("ember-data/-private/system/references/reference",["exports"],function(e){var t=function(e,t){this.store=e,this.internalModel=t};t.prototype={constructor:t},e.default=t}),t("ember-data/-private/system/relationship-meta",["exports","ember-inflector","ember-data/-private/system/normalize-model-name"],function(e,t,r){function i(e){var i;return i=e.type||e.key,"hasMany"===e.kind&&(i=(0,t.singularize)((0,r.default)(i))),i}function a(e){return{key:e.key,kind:e.kind,type:i(e),options:e.options,parentType:e.parentType,isRelationship:!0}}e.typeForRelationshipMeta=i,e.relationshipFromMeta=a}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name"],function(e,t,r,i){function a(e,r){var a,n;"object"==typeof e?(a=e,n=void 0):(a=r,n=e),"string"==typeof n&&(n=(0,i.default)(n)),a=a||{};var o={type:n,isRelationship:!0,options:a,kind:"belongsTo",key:null};return t.default.computed({get:function(e){return a.hasOwnProperty("serialize"),a.hasOwnProperty("embedded"),this._internalModel._relationships.get(e).getRecord()},set:function(e,t){return void 0===t&&(t=null),t&&t.then?this._internalModel._relationships.get(e).setRecordPromise(t):t?this._internalModel._relationships.get(e).setRecord(t._internalModel):this._internalModel._relationships.get(e).setRecord(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.default=a;var n=t.default.Mixin.create({notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)}});e.BelongsToMixin=n}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/debug","ember-data/-private/system/relationship-meta","ember-data/-private/system/empty-object"],function(e,t,r,i,a){var n=t.default.get,o=t.default.Map,s=t.default.MapWithDefault,d=t.default.computed(function(){t.default.testing===!0&&d._cacheable===!0&&(d._cacheable=!1);var e=new s({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var a=e.get((0,i.typeForRelationshipMeta)(r));a.push({name:t,kind:r.kind})}}),e}).readOnly(),l=t.default.computed(function(){t.default.testing===!0&&l._cacheable===!0&&(l._cacheable=!1);var e,r=t.default.A();return this.eachComputedProperty(function(t,a){a.isRelationship&&(a.key=t,e=(0,i.typeForRelationshipMeta)(a),r.contains(e)||r.push(e))}),r}).readOnly(),u=t.default.computed(function(){t.default.testing===!0&&u._cacheable===!0&&(u._cacheable=!1);var e=o.create();return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var a=(0,i.relationshipFromMeta)(r);a.type=(0,i.typeForRelationshipMeta)(r),e.set(t,a)}}),e}).readOnly(),c=t.default.Mixin.create({didDefineProperty:function(e,r,i){if(i instanceof t.default.ComputedProperty){var a=i.meta();a.parentType=e.constructor}}});e.DidDefinePropertyMixin=c;var h=t.default.Mixin.create({typeForRelationship:function(e,t){var r=n(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t.default.computed(function(){return new a.default}),inverseFor:function(e,t){var r=n(this,"inverseMap");if(r[e])return r[e];var i=this._findInverseFor(e,t);return r[e]=i,i},_findInverseFor:function(e,r){function i(t,r,a){var o=a||[],s=n(r,"relationships");if(!s)return o;var d=s.get(t.modelName);return d=d.filter(function(t){var i=r.metaForProperty(t.name).options;return!i.inverse||e===i.inverse}),d&&o.push.apply(o,d),t.superclass&&i(t.superclass,r,o),o}var a=this.typeForRelationship(e,r);if(!a)return null;var o=this.metaForProperty(e),s=o.options;if(null===s.inverse)return null;var d,l,u;if(s.inverse)d=s.inverse,u=t.default.get(a,"relationshipsByName").get(d),l=u.kind;else{o.type===o.parentType.modelName;var c=i(this,a);if(0===c.length)return null;var h=c.filter(function(t){var r=a.metaForProperty(t.name).options;return e===r.inverse});1===h.length&&(c=h),d=c[0].name,l=c[0].kind}return{type:a,name:d,kind:l}},relationships:d,relationshipNames:t.default.computed(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:l,relationshipsByName:u,fields:t.default.computed(function(){var e=o.create();return this.eachComputedProperty(function(t,r){r.isRelationship?e.set(t,r.kind):r.isAttribute&&e.set(t,"attribute")}),e}).readOnly(),eachRelationship:function(e,t){n(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=n(this,"relatedTypes"),i=0;i<r.length;i++){var a=r[i];e.call(t,a)}},determineRelationshipType:function(e,t){var r=e.key,i=e.kind,a=this.inverseFor(r,t),n=void 0,o=void 0;return a?(n=a.name,o=a.kind,"belongsTo"===o?"belongsTo"===i?"oneToOne":"manyToOne":"belongsTo"===i?"oneToMany":"manyToMany"):"belongsTo"===i?"oneToNone":"manyToNone"}});e.RelationshipsClassMethodsMixin=h;var p=t.default.Mixin.create({eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return n(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)}});e.RelationshipsInstanceMethodsMixin=p}),t("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,i,a){function n(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,i.default)(e));var a={type:e,isRelationship:!0,options:r,kind:"hasMany",key:null};return t.default.computed({get:function(e){var t=this._internalModel._relationships.get(e);return t.getRecords()},set:function(e,r){var i=this._internalModel._relationships.get(e);return i.clear(),i.addRecords(t.default.A(r).mapBy("_internalModel")),i.getRecords()}}).meta(a)}e.default=n;var o=t.default.Mixin.create({notifyHasManyAdded:function(e){this.notifyPropertyChange(e)}});e.HasManyMixin=o}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i,a){function n(e,t,r,i){this._super$constructor(e,t,r,i),this.record=t,this.key=i.key,this.inverseRecord=null,this.canonicalState=null}e.default=n,n.prototype=Object.create(a.default.prototype),n.prototype.constructor=n,n.prototype._super$constructor=a.default,n.prototype.setRecord=function(e){e?this.addRecord(e):this.inverseRecord&&this.removeRecord(this.inverseRecord),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype.setCanonicalRecord=function(e){e?this.addCanonicalRecord(e):this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype._super$addCanonicalRecord=a.default.prototype.addCanonicalRecord,n.prototype.addCanonicalRecord=function(e){this.canonicalMembers.has(e)||(this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.canonicalState=e,this._super$addCanonicalRecord(e))},n.prototype._super$flushCanonical=a.default.prototype.flushCanonical,n.prototype.flushCanonical=function(){this.inverseRecord&&this.inverseRecord.isNew()&&!this.canonicalState||(this.inverseRecord=this.canonicalState,this.record.notifyBelongsToChanged(this.key),this._super$flushCanonical())},n.prototype._super$addRecord=a.default.prototype.addRecord,n.prototype.addRecord=function(e){this.members.has(e)||(this.inverseRecord&&this.removeRecord(this.inverseRecord),this.inverseRecord=e,this._super$addRecord(e),this.record.notifyBelongsToChanged(this.key))},n.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setRecord(t?t._internalModel:t)},n.prototype._super$removeRecordFromOwn=a.default.prototype.removeRecordFromOwn,n.prototype.removeRecordFromOwn=function(e){this.members.has(e)&&(this.inverseRecord=null,this._super$removeRecordFromOwn(e),this.record.notifyBelongsToChanged(this.key))},n.prototype._super$removeCanonicalRecordFromOwn=a.default.prototype.removeCanonicalRecordFromOwn,n.prototype.removeCanonicalRecordFromOwn=function(e){this.canonicalMembers.has(e)&&(this.canonicalState=null,this._super$removeCanonicalRecordFromOwn(e))},n.prototype.findRecord=function(){return this.inverseRecord?this.store._findByInternalModel(this.inverseRecord):t.default.RSVP.Promise.resolve(null)},n.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.record,this.link,this.relationshipMeta).then(function(t){return t&&e.addRecord(t),t})},n.prototype.getRecord=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),i.PromiseObject.create({promise:t,content:this.inverseRecord?this.inverseRecord.getRecord():null})}if(null===this.inverseRecord)return null;var r=this.inverseRecord.getRecord();return r},n.prototype.reload=function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.record?this.inverseRecord.record.reload():this.findRecord()}}),t("ember-data/-private/system/relationships/state/create",["exports","ember","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to","ember-data/-private/system/empty-object"],function(e,t,r,i,a){function n(e){var t=e.options;return!(t&&null===t.inverse)}function o(e,t,a){var o=void 0,s=null;return n(t)&&(s=e.type.inverseFor(t.key,a)),s&&(o=s.name),"hasMany"===t.kind?new r.default(a,e,o,t):new i.default(a,e,o,t)}function s(e){this.record=e,this.initializedRelationships=new a.default}e.default=s;var d=t.default.get;s.prototype.has=function(e){return!!this.initializedRelationships[e]},s.prototype.get=function(e){var t=this.initializedRelationships,r=d(this.record.type,"relationshipsByName");return!t[e]&&r.get(e)&&(t[e]=o(this.record,r.get(e),this.record.store)),t[e]}}),t("ember-data/-private/system/relationships/state/has-many",["exports","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/ordered-set","ember-data/-private/system/many-array"],function(e,t,r,i,a,n){function o(e,t,r,i){this._super$constructor(e,t,r,i),this.belongsToType=i.type,this.canonicalState=[],this.manyArray=n.default.create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:t}),this.isPolymorphic=i.options.polymorphic,this.manyArray.isPolymorphic=this.isPolymorphic}function s(e){var t=new a.default;if(e)for(var r=0,i=e.length;r<i;r++)t.add(e[r]);return t}e.default=o,o.prototype=Object.create(i.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=i.default,o.prototype.destroy=function(){this.manyArray.destroy()},o.prototype._super$updateMeta=i.default.prototype.updateMeta,o.prototype.updateMeta=function(e){this._super$updateMeta(e),this.manyArray.set("meta",e)},o.prototype._super$addCanonicalRecord=i.default.prototype.addCanonicalRecord,o.prototype.addCanonicalRecord=function(e,t){this.canonicalMembers.has(e)||(void 0!==t?this.canonicalState.splice(t,0,e):this.canonicalState.push(e),this._super$addCanonicalRecord(e,t))},o.prototype._super$addRecord=i.default.prototype.addRecord,o.prototype.addRecord=function(e,t){this.members.has(e)||(this._super$addRecord(e,t),this.manyArray.internalAddRecords([e],t))},o.prototype._super$removeCanonicalRecordFromOwn=i.default.prototype.removeCanonicalRecordFromOwn,o.prototype.removeCanonicalRecordFromOwn=function(e,t){var r=t;this.canonicalMembers.has(e)&&(void 0===r&&(r=this.canonicalState.indexOf(e)),r>-1&&this.canonicalState.splice(r,1),this._super$removeCanonicalRecordFromOwn(e,t))},o.prototype._super$flushCanonical=i.default.prototype.flushCanonical,o.prototype.flushCanonical=function(){this.manyArray.flushCanonical(),
|
3
|
-
this._super$flushCanonical()},o.prototype._super$removeRecordFromOwn=i.default.prototype.removeRecordFromOwn,o.prototype.removeRecordFromOwn=function(e,t){this.members.has(e)&&(this._super$removeRecordFromOwn(e,t),void 0!==t?this.manyArray.currentState.removeAt(t):this.manyArray.internalRemoveRecords([e]))},o.prototype.notifyRecordRelationshipAdded=function(e,t){this.record.notifyHasManyAdded(this.key,e,t)},o.prototype.reload=function(){var e=this,t=this.manyArray.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&this.manyArray.set("isLoaded",t)}return this.link?(this._loadingPromise=(0,r.promiseManyArray)(this.fetchLink(),"Reload with link"),this._loadingPromise):(this._loadingPromise=(0,r.promiseManyArray)(this.store.scheduleFetchMany(this.manyArray.toArray()).then(function(){return e.manyArray}),"Reload with ids"),this._loadingPromise)},o.prototype.computeChanges=function(e){var t,r,i,a=this.canonicalMembers,n=[];for(e=s(e),a.forEach(function(t){e.has(t)||n.push(t)}),this.removeCanonicalRecords(n),e=e.toArray(),t=e.length,i=0;i<t;i++)r=e[i],this.removeCanonicalRecord(r),this.addCanonicalRecord(r,i)},o.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.record,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateRecordsFromAdapter(t),e.manyArray.set("isLoaded",!0)}),e.manyArray})},o.prototype.findRecords=function(){for(var e=this,t=this.manyArray.toArray(),r=new Array(t.length),i=0;i<t.length;i++)r[i]=t[i]._internalModel;return this.store.findMany(r).then(function(){return e.manyArray.get("isDestroyed")||e.manyArray.set("isLoaded",!0),e.manyArray})},o.prototype.notifyHasManyChanged=function(){this.record.notifyHasManyAdded(this.key)},o.prototype.getRecords=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._loadingPromise=r.PromiseManyArray.create({content:this.manyArray,promise:t}),this._loadingPromise}return this.manyArray.get("isDestroyed")||this.manyArray.set("isLoaded",!0),this.manyArray}}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember","ember-data/-private/debug","ember-data/-private/system/ordered-set"],function(e,t,r,i){function a(e,t,r,a){var n=a.options.async;this.members=new i.default,this.canonicalMembers=new i.default,this.store=e,this.key=a.key,this.inverseKey=r,this.record=t,this.isAsync="undefined"==typeof n||n,this.relationshipMeta=a,this.inverseKeyForImplicit=this.record.constructor.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}e.default=a,a.prototype={constructor:a,destroy:t.default.K,updateMeta:function(e){this.meta=e},clear:function(){for(var e,t=this.members.list;t.length>0;)e=t[0],this.removeRecord(e)},removeRecords:function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})},addRecords:function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})},addCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])},addCanonicalRecord:function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.inverseKey?e._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new a(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)},removeCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])},removeCanonicalRecord:function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalRecordFromOwn(e),this.inverseKey?this.removeCanonicalRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecord(this.record)),this.flushCanonicalLater()},addRecord:function(e,t){this.members.has(e)||(this.members.addWithIndex(e,t),this.notifyRecordRelationshipAdded(e,t),this.inverseKey?e._relationships.get(this.inverseKey).addRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new a(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArraysLater()),this.setHasData(!0)},removeRecord:function(e){this.members.has(e)&&(this.removeRecordFromOwn(e),this.inverseKey?this.removeRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeRecord(this.record))},removeRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)},removeRecordFromOwn:function(e){this.members.delete(e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()},removeCanonicalRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)},removeCanonicalRecordFromOwn:function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},flushCanonical:function(){this.willSync=!1;for(var e=[],t=0;t<this.members.list.length;t++)this.members.list[t].isNew()&&e.push(this.members.list[t]);for(this.members=this.canonicalMembers.copy(),t=0;t<e.length;t++)this.members.add(e[t])},flushCanonicalLater:function(){var e=this;this.willSync||(this.willSync=!0,this.store._backburner.join(function(){return e.store._backburner.schedule("syncRelationships",e,e.flushCanonical)}))},updateLink:function(e){e!==this.link&&(this.link=e,this.linkPromise=null,this.setHasLoaded(!1),this.record.notifyPropertyChange(this.key))},findLink:function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},updateRecordsFromAdapter:function(e){this.computeChanges(e),this.setHasData(!0),this.setHasLoaded(!0)},notifyRecordRelationshipAdded:t.default.K,notifyRecordRelationshipRemoved:t.default.K,setHasData:function(e){this.hasData=e},setHasLoaded:function(e){this.hasLoaded=e}}}),t("ember-data/-private/system/snapshot-record-array",["exports","ember-data/-private/features"],function(e,t){function r(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this.type=e.get("type"),this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}e.default=r,r.prototype.snapshots=function(){if(this._snapshots)return this._snapshots;var e=this._recordArray;return this._snapshots=e.invoke("createSnapshot"),this._snapshots}}),t("ember-data/-private/system/snapshot",["exports","ember","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,i){function a(e){var t=this,i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this._attributes=new r.default,this._belongsToRelationships=new r.default,this._belongsToIds=new r.default,this._hasManyRelationships=new r.default,this._hasManyIds=new r.default;var a=e.getRecord();this.record=a,a.eachAttribute(function(e){return t._attributes[e]=n(a,e)}),this.id=e.id,this._internalModel=e,this.type=e.type,this.modelName=e.type.modelName,this.adapterOptions=i.adapterOptions,this.include=i.include,this._changedAttributes=a.changedAttributes()}e.default=a;var n=t.default.get;a.prototype={constructor:a,id:null,record:null,type:null,modelName:null,attr:function(e){if(e in this._attributes)return this._attributes[e];throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no attribute named '"+e+"' defined.")},attributes:function(){return t.default.copy(this._attributes)},changedAttributes:function(){for(var e=new r.default,i=Object.keys(this._changedAttributes),a=0,n=i.length;a<n;a++){var o=i[a];e[o]=t.default.copy(this._changedAttributes[o])}return e},belongsTo:function(e,r){var i,a,o,s,d=r&&r.id;if(d&&e in this._belongsToIds)return this._belongsToIds[e];if(!d&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(i=this._internalModel._relationships.get(e),!i||"belongsTo"!==i.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return o=n(i,"hasData"),a=n(i,"inverseRecord"),o&&(s=a&&!a.isDeleted()?d?n(a,"id"):a.createSnapshot():null),d?this._belongsToIds[e]=s:this._belongsToRelationships[e]=s,s},hasMany:function(e,r){var i,a,o,s,d=r&&r.ids;if(d&&e in this._hasManyIds)return this._hasManyIds[e];if(!d&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(i=this._internalModel._relationships.get(e),!i||"hasMany"!==i.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return o=n(i,"hasData"),a=n(i,"members"),o&&(s=[],a.forEach(function(e){e.isDeleted()||(d?s.push(e.id):s.push(e.createSnapshot()))})),d?this._hasManyIds[e]=s:this._hasManyRelationships[e]=s,s},eachAttribute:function(e,t){this.record.eachAttribute(e,t)},eachRelationship:function(e,t){this.record.eachRelationship(e,t)},serialize:function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)}}}),t("ember-data/-private/system/store",["exports","ember","ember-data/model","ember-data/-private/debug","ember-data/-private/system/normalize-link","ember-data/-private/system/normalize-model-name","ember-data/adapters/errors","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers","ember-data/-private/system/store/finders","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/system/record-array-manager","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/model/internal-model","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,p,f,m,y,v,b){function g(e,t){var r=e.then(function(e){return e.getRecord()});return(0,s.promiseObject)(r,t)}function R(e,t,r,i){if(!P(i))return e._internalModelForId(i.type,i.id)}function _(e,t,r,i){if(!P(i)){for(var a=new Array(i.length),n=0;n<i.length;n++)a[n]=R(e,t,r,i[n]);return a}}function A(e){return e.serializerFor("application")}function z(e,t,r,i){var a=i._internalModel,n=i.modelName,s=t.modelFor(n),c=e[r](t,s,i),h=(0,u.serializerForAdapter)(t,e,n),p="DS: Extract and notify about "+r+" completion of "+a;return c=O.resolve(c,p),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,t)),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,a)),c.then(function(e){return t._adapterRun(function(){var n,o;e&&(n=(0,l.normalizeResponseHelper)(h,t,s,e,i.id,r),n.included&&t.push({data:n.included}),o=n.data),t.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof o.InvalidError){var r=h.extractErrors(t,s,e,i.id);t.recordWasInvalid(a,r)}else t.recordWasError(a,e);throw e},p)}function F(e,t,r){r.relationships&&t.type.eachRelationship(function(i,n){var o=n.kind;if(r.relationships[i]){var s;if(r.relationships[i].links&&r.relationships[i].links.related){var d=(0,a.default)(r.relationships[i].links.related);d&&d.href&&(s=t._relationships.get(i),s.updateLink(d.href))}r.relationships[i].meta&&(s=t._relationships.get(i),s.updateMeta(r.relationships[i].meta)),M(e,i,n,r.relationships[i]);var l=r.relationships[i].data;void 0!==l&&("belongsTo"===o?(s=t._relationships.get(i),s.setCanonicalRecord(l)):"hasMany"===o&&(s=t._relationships.get(i),s.updateRecordsFromAdapter(l)))}})}function M(e,t,r,i){var a=i.data;if(a){var n=r.kind;"belongsTo"===n?i.data=R(e,t,r,a):"hasMany"===n&&(i.data=_(e,t,r,a))}}var S="`id` has to be non-empty string or number";e.badIdFormatAssertion=S;var x,T=t.default._Backburner,k=t.default.Map,E=t.default.get,w=t.default.set,D=t.default.run.once,P=t.default.isNone,O=(t.default.isPresent,t.default.RSVP.Promise),C=t.default.copy,I=t.default.Service;e.Store=x=I.extend({init:function(){this._super.apply(this,arguments),this._backburner=new T(["normalizeRelationships","syncRelationships","finished"]),this.typeMaps={},this.recordArrayManager=f.default.create({store:this}),this._pendingSave=[],this._instanceCache=new m.default((0,h.getOwner)(this)),this._pendingFetch=k.create()},adapter:"-json-api",serialize:function(e,t){var r=e._internalModel.createSnapshot();return r.serialize(t)},defaultAdapter:t.default.computed("adapter",function(){var e=E(this,"adapter");return e=this.retrieveManagedInstance("adapter",e)}),createRecord:function(e,t){var r=this.modelFor(e),i=C(t)||new v.default;P(i.id)&&(i.id=this._generateId(e,i)),i.id=(0,p.default)(i.id);var a=this.buildInternalModel(r,i.id),n=a.getRecord();return a.loadedData(),n.setProperties(i),a.eachRelationship(function(e,t){a._relationships.get(e).setHasData(!0)}),n},_generateId:function(e,t){var r=this.adapterFor(e);return r&&r.generateIdForRecord?r.generateIdForRecord(this,e,t):null},deleteRecord:function(e){e.deleteRecord()},unloadRecord:function(e){e.unloadRecord()},find:function(e,r,i){return 1===arguments.length,"object"===t.default.typeOf(r),this.findRecord(e,r)},findRecord:function(e,t,r){var i=this._internalModelForId(e,t);if(r=r||{},!this.hasRecordForId(e,t))return this._findByInternalModel(i,r);var a=this._findRecord(i,r);return g(a,"DS: Store#findRecord "+i.typeKey+" with id: "+E(i,"id"))},_findRecord:function(e,t){if(t.reload)return this.scheduleFetch(e,t);var r=e.createSnapshot(t),i=e.type,a=this.adapterFor(i.modelName);return a.shouldReloadRecord(this,r)?this.scheduleFetch(e,t):(a.shouldBackgroundReloadRecord(this,r)&&this.scheduleFetch(e,t),O.resolve(e))},_findByInternalModel:function(e,t){t=t||{},t.preload&&e._preloadData(t.preload);var r=this._findEmptyInternalModel(e,t);return g(r,"DS: Store#findRecord "+e.typeKey+" with id: "+E(e,"id"))},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this.scheduleFetch(e,t):e.isLoading()?e._loadingPromise:O.resolve(e)},findByIds:function(e,r){for(var i=new Array(r.length),a=0;a<r.length;a++)i[a]=this.findRecord(e,r[a]);return(0,s.promiseArray)(t.default.RSVP.all(i).then(t.default.A,null,"DS: Store#findByIds of "+e+" complete"))},fetchRecord:function(e,t){var r=e.type,i=e.id,a=this.adapterFor(r.modelName),n=(0,c._find)(a,this,r,i,e,t);return n},scheduleFetchMany:function(e){for(var r=new Array(e.length),i=new Array(e.length),a=0;a<e.length;a++)r[a]=e[a]._internalModel;for(var a=0;a<r.length;a++)i[a]=this.scheduleFetch(r[a]);return t.default.RSVP.Promise.all(i)},scheduleFetch:function(e,r){var i=e.type;if(e._loadingPromise)return e._loadingPromise;var a=t.default.RSVP.defer("Fetching "+i+"with id: "+e.id),n={record:e,resolver:a,options:r},o=a.promise;return e.loadingData(o),this._pendingFetch.get(i)?this._pendingFetch.get(i).push(n):this._pendingFetch.set(i,[n]),t.default.run.scheduleOnce("afterRender",this,this.flushAllPendingFetches),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch=k.create())},_flushPendingFetchForType:function(e,r){function i(e){e.resolver.resolve(d.fetchRecord(e.record,e.options))}function a(r){return r.forEach(function(r){var i=t.default.A(e).findBy("record",r);if(i){var a=i.resolver;a.resolve(r)}}),r}function n(e){return function(r){r=t.default.A(r);var i=e.reject(function(e){return r.contains(e)});i.length,s(i)}}function o(e){return function(t){s(e,t)}}function s(r,i){r.forEach(function(r){var a=t.default.A(e).findBy("record",r);if(a){var n=a.resolver;n.reject(i)}})}var d=this,l=d.adapterFor(r.modelName),u=!!l.findMany&&l.coalesceFindRequests,h=t.default.A(e).mapBy("record");if(1===e.length)i(e[0]);else if(u){var p=t.default.A(h).invoke("createSnapshot"),f=l.groupRecordsForFindMany(this,p);f.forEach(function(s){var u=t.default.A(s).mapBy("_internalModel"),h=t.default.A(u),p=h.mapBy("id");if(p.length>1)(0,c._findMany)(l,d,r,p,h).then(a).then(n(h)).then(null,o(h));else if(1===p.length){var f=t.default.A(e).findBy("record",u[0]);i(f)}})}else e.forEach(i)},peekRecord:function(e,t){return this.hasRecordForId(e,t)?this._internalModelForId(e,t).getRecord():null},reloadRecord:function(e){var t=e.type.modelName;this.adapterFor(t),e.id;return this.scheduleFetch(e)},hasRecordForId:function(e,t){var r=this.modelFor(e),i=(0,p.default)(t),a=this.typeMapFor(r).idToRecord[i];return!!a&&a.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=this.modelFor(e),i=(0,p.default)(t),a=this.typeMapFor(r).idToRecord,n=a[i];return n&&a[i]||(n=this.buildInternalModel(r,i)),n},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findByInternalModel(e[r]);return O.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.type.modelName);return(0,c._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.type.modelName);return(0,c._findBelongsTo)(i,this,e,t,r)},query:function(e,t){return this._query(e,t)},_query:function(e,t,r){var i=this.modelFor(e);r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(i,t);var a=this.adapterFor(e);return(0,s.promiseArray)((0,c._query)(a,this,i,t,r))},queryRecord:function(e,t){var r=this.modelFor(e),i=this.adapterFor(e);return(0,s.promiseObject)((0,c._queryRecord)(i,this,r,t))},findAll:function(e,t){var r=this.modelFor(e);return this._fetchAll(r,this.peekAll(e),t)},_fetchAll:function(e,t,r){r=r||{};var i=this.adapterFor(e.modelName),a=this.typeMapFor(e).metadata.since;if(w(t,"isUpdating",!0),r.reload)return(0,s.promiseArray)((0,c._findAll)(i,this,e,a,r));var n=t.createSnapshot(r);return i.shouldReloadAll(this,n)?(0,s.promiseArray)((0,c._findAll)(i,this,e,a,r)):(i.shouldBackgroundReloadAll(this,n)&&(0,c._findAll)(i,this,e,a,r),(0,s.promiseArray)(O.resolve(t)))},didUpdateAll:function(e){var t=this.recordArrayManager.liveRecordArrayFor(e);w(t,"isUpdating",!1)},peekAll:function(e){var t=this.modelFor(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.populateLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length){for(var t=this.typeMaps,r=Object.keys(t),i=new Array(r.length),a=0;a<r.length;a++)i[a]=t[r[a]].type.modelName;i.forEach(this.unloadAll,this)}else{for(var n=this.modelFor(e),o=this.typeMapFor(n),s=o.records.slice(),d=void 0,a=0;a<s.length;a++)d=s[a],d.unloadRecord(),d.destroy();o.metadata=new v.default}},filter:function(e,r,i){!t.default.ENV.ENABLE_DS_FILTER;var a,n,o=arguments.length,d=3===o;return d?a=this.query(e,r):2===arguments.length&&(i=r),e=this.modelFor(e),n=d?this.recordArrayManager.createFilteredRecordArray(e,i,r):this.recordArrayManager.createFilteredRecordArray(e,i),a=a||O.resolve(n),(0,s.promiseArray)(a.then(function(){return n},null,"DS: Store#filter of "+e))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},dataWasUpdated:function(e,t){this.recordArrayManager.recordDidChange(t)},scheduleSave:function(e,t,r){var i=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:i,resolver:t}),D(this,"flushPendingSave")},flushPendingSave:function(){var e=this,t=this._pendingSave.slice();this._pendingSave=[],t.forEach(function(t){var r,i=t.snapshot,a=t.resolver,n=i._internalModel,o=e.adapterFor(n.type.modelName);return"root.deleted.saved"===E(n,"currentState.stateName")?a.resolve():(r=n.isNew()?"createRecord":n.isDeleted()?"deleteRecord":"updateRecord",void a.resolve(z(o,e,r,i)))})},didSaveRecord:function(e,t){var r;t&&(r=t.data),r&&(this._backburner.schedule("normalizeRelationships",this,"_setupRelationships",e,r),this.updateId(e,r)),e.adapterDidCommit(r)},recordWasInvalid:function(e,t){e.adapterDidInvalidate(t)},recordWasError:function(e,t){e.adapterDidError(t)},updateId:function(e,t){var r=(e.id,(0,p.default)(t.id));this.typeMapFor(e.type).idToRecord[r]=e,e.setId(r)},typeMapFor:function(e){var r=E(this,"typeMaps"),i=t.default.guidFor(e),a=r[i];return a?a:(a={idToRecord:new v.default,records:[],metadata:new v.default,type:e},r[i]=a,a)},_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,n.default)(e),i=(0,h.getOwner)(this),a=i._lookupFactory("mixin:"+t);a&&i.register("model:"+t,r.default.extend(a));var o=this.modelFactoryFor(t);return o&&(o.__isMixin=!0,o.__mixin=a),o},modelFor:function(e){var r=this.modelFactoryFor(e);if(r||(r=this._modelForMixin(e)),!r)throw new t.default.Error("No model was found for '"+e+"'");return r.modelName=r.modelName||(0,n.default)(e),r},modelFactoryFor:function(e){var t=(0,n.default)(e),r=(0,h.getOwner)(this);return r._lookupFactory("model:"+t)},push:function(e){var t,r,i=e.included;if(i)for(t=0,r=i.length;t<r;t++)this._pushInternalModel(i[t]);if(Array.isArray(e.data)){r=e.data.length;var a=new Array(r);for(t=0;t<r;t++)a[t]=this._pushInternalModel(e.data[t]).getRecord();return a}if(null===e.data)return null;var n=this._pushInternalModel(e.data);return n.getRecord()},_hasModelFor:function(e){return!!(0,h.getOwner)(this)._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=this,r=(e.type,this._load(e));return this._backburner.join(function(){t._backburner.schedule("normalizeRelationships",t,"_setupRelationships",r,e)}),r},_setupRelationships:function(e,t){F(this,e,t)},pushPayload:function(e,t){var r,i,a=this;t?(i=t,r=this.serializerFor(e)):(i=e,r=A(this)),this._adapterRun(function(){return r.pushPayload(a,i)})},normalize:function(e,t){var r=this.serializerFor(e),i=this.modelFor(e);return r.normalize(i,t)},buildInternalModel:function(e,t,r){var i=this.typeMapFor(e),a=i.idToRecord,n=new y.default(e,t,this,null,r);return t&&(a[t]=n),i.records.push(n),n},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_dematerializeRecord:function(e){var t=e.type,r=this.typeMapFor(t),i=e.id;e.updateRecordArrays(),i&&delete r.idToRecord[i];var a=r.records.indexOf(e);r.records.splice(a,1)},adapterFor:function(e){return this.lookupAdapter(e)},_adapterRun:function(e){return this._backburner.run(e)},serializerFor:function(e){var t=["application",this.adapterFor(e).get("defaultSerializer"),"-default"],r=this.lookupSerializer(e,t);return r},retrieveManagedInstance:function(e,t,r){var i=(0,n.default)(t),a=this._instanceCache.get(e,i,r);return w(a,"store",this),a},lookupAdapter:function(e){return this.retrieveManagedInstance("adapter",e,this.get("_adapterFallbacks"))},_adapterFallbacks:t.default.computed("adapter",function(){var e=this.get("adapter");return["application",e,"-json-api"]}),lookupSerializer:function(e,t){return this.retrieveManagedInstance("serializer",e,t)},willDestroy:function(){this._super.apply(this,arguments),this.recordArrayManager.destroy(),this.unloadAll()}}),x.reopen({getReference:function(e,t){return this._internalModelForId(e,t).recordReference}}),e.Store=x,e.default=x}),t("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(void 0,t)}}function i(e,t){var r=e.finally(function(){t()||(r._subscribers.length=0)});return r}function a(e){return!(n(e,"isDestroyed")||n(e,"isDestroying"))}e._bind=r,e._guard=i,e._objectIsAlive=a;var n=t.default.get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){function i(e){this._owner=e,this._cache=new r.default}e.default=i;var a=t.default.assign||t.default.merge;i.prototype=new r.default,a(i.prototype,{get:function(e,t,r){var i=this._cache,a=e+":"+t;if(!(a in i)){var n=this.instanceFor(a)||this._findInstance(e,r);n&&(i[a]=n)}return i[a]},_findInstance:function(e,t){for(var r=0,i=t.length;r<i;r++){var a=t[r],n=e+":"+a,o=this.instanceFor(n);if(o)return o}},instanceFor:function(e){var t=this._cache;if(!t[e]){var r=this._owner.lookup(e);r&&(t[e]=r)}return t[e]},destroy:function(){for(var e=this._cache,t=Object.keys(e),r=0,i=t.length;r<i;r++){var a=t[r],n=e[a];n&&n.destroy()}this._owner=null},constructor:i,toString:function(){return"ContainerInstanceCache"}})}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/debug","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i,a,n){function o(e,t,r,o,s,d){var l=s.createSnapshot(d),u=e.findRecord(t,r,o,l),c=(0,n.serializerForAdapter)(t,e,s.type.modelName),h="DS: Handle Adapter#findRecord of "+r+" with id: "+o;return u=p.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u.then(function(e){return t._adapterRun(function(){var i=(0,a.normalizeResponseHelper)(c,t,r,e,o,"findRecord"),n=t.push(i);return n._internalModel})},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+r+"'")}function s(e,r,o,s,d){var l=t.default.A(d).invoke("createSnapshot"),u=e.findMany(r,o,s,l),c=(0,n.serializerForAdapter)(r,e,o.modelName),h="DS: Handle Adapter#findMany of "+o;if(void 0===u)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return u=p.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return r._adapterRun(function(){for(var t=(0,a.normalizeResponseHelper)(c,r,o,e,null,"findMany"),i=r.push(t),n=new Array(i.length),s=0;s<i.length;s++)n[s]=i[s]._internalModel;return n})},null,"DS: Extract payload of "+o)}function d(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findHasMany(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findHasMany of "+r+" : "+s.type;return u=p.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findHasMany"),i=t.push(r),n=i.map(function(e){return e._internalModel});return n.meta=r.meta,n})},null,"DS: Extract payload of "+r+" : hasMany "+s.type)}function l(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findBelongsTo(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findBelongsTo of "+r+" : "+s.type;return u=p.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findBelongsTo");if(!r.data)return null;var i=t.push(r);return i._internalModel})},null,"DS: Extract payload of "+r+" : "+s.type)}function u(e,t,r,o,s){var d=r.modelName,l=t.peekAll(d),u=l.createSnapshot(s),c=e.findAll(t,r,o,u),h=(0,n.serializerForAdapter)(t,e,d),f="DS: Handle Adapter#findAll of "+r;return c=p.resolve(c,f),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,t)),c.then(function(e){return t._adapterRun(function(){var i=(0,a.normalizeResponseHelper)(h,t,r,e,null,"findAll");t.push(i)}),t.didUpdateAll(r),t.peekAll(d)},null,"DS: Extract payload of findAll "+r)}function c(e,t,r,o,s){var d=r.modelName,l=e.query(t,r,o,s),u=(0,n.serializerForAdapter)(t,e,d),c="DS: Handle Adapter#query of "+r;return l=p.resolve(l,c),l=(0,i._guard)(l,(0,i._bind)(i._objectIsAlive,t)),l.then(function(e){var i,n;return t._adapterRun(function(){n=(0,a.normalizeResponseHelper)(u,t,r,e,null,"query"),i=t.push(n)}),s.loadRecords(i,n),s},null,"DS: Extract payload of query "+r)}function h(e,t,r,o){var s=r.modelName,d=e.queryRecord(t,r,o),l=(0,n.serializerForAdapter)(t,e,s),u="DS: Handle Adapter#queryRecord of "+r;return d=p.resolve(d,u),d=(0,i._guard)(d,(0,i._bind)(i._objectIsAlive,t)),d.then(function(e){var i;return t._adapterRun(function(){var n=(0,a.normalizeResponseHelper)(l,t,r,e,null,"queryRecord");i=t.push(n)}),i},null,"DS: Extract payload of queryRecord "+r)}e._find=o,e._findMany=s,e._findHasMany=d,e._findBelongsTo=l,e._findAll=u,e._query=c,e._queryRecord=h;var p=t.default.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){var t=[];return e&&"object"==typeof e?("data"in e||"errors"in e||"meta"in e?"data"in e&&"errors"in e&&t.push('Top level keys "errors" and "data" cannot both be present in a JSON API document'):t.push('One or more of the following keys must be present: "data", "errors", "meta".'),"data"in e&&(null===e.data||Array.isArray(e.data)||"object"==typeof e.data||t.push("data must be null, an object, or an array")),"meta"in e&&"object"!=typeof e.meta&&t.push("meta must be an object"),"errors"in e&&(Array.isArray(e.errors)||t.push("errors must be an array")),"links"in e&&"object"!=typeof e.links&&t.push("links must be an object"),"jsonapi"in e&&"object"!=typeof e.jsonapi&&t.push("jsonapi must be an object"),"included"in e&&"object"!=typeof e.included&&t.push("included must be an array")):t.push("Top level of a JSON API document must be an object"),t}function a(e,t,r,i,a,n){var o=e.normalizeResponse(t,r,i,a,n);return o}e.validateDocumentStructure=i,e.normalizeResponseHelper=a}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var i=t.serializer;return void 0===i&&(i=e.serializerFor(r)),null!==i&&void 0!==i||(i={extract:function(e,t,r){return r}}),i}e.serializerForAdapter=t}),t("ember-data/-private/transforms",["exports","ember-data/transform","ember-data/-private/transforms/number","ember-data/-private/transforms/date","ember-data/-private/transforms/string","ember-data/-private/transforms/boolean"],function(e,t,r,i,a,n){e.Transform=t.default,e.NumberTransform=r.default,e.DateTransform=i.default,e.StringTransform=a.default,e.BooleanTransform=n.default}),t("ember-data/-private/transforms/boolean",["exports","ember","ember-data/transform","ember-data/-private/features"],function(e,t,r,i){t.default.isNone;e.default=r.default.extend({deserialize:function(e,t){var r=typeof e;return"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r&&1===e},serialize:function(e,t){return Boolean(e)}})}),t("ember-data/-private/transforms/date",["exports","ember","ember-data/-private/ext/date","ember-data/transform"],function(e,t,r,i){e.default=i.default.extend({deserialize:function(e){var r=typeof e;return"string"===r?new Date(t.default.Date.parse(e)):"number"===r?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date?e.toISOString():null}})}),t("ember-data/-private/transforms/number",["exports","ember","ember-data/transform"],function(e,t,r){function i(e){return e===e&&e!==1/0&&e!==-(1/0)}var a=t.default.isEmpty;e.default=r.default.extend({deserialize:function(e){var t;return a(e)?null:(t=Number(e),i(t)?t:null)},serialize:function(e){var t;return a(e)?null:(t=Number(e),i(t)?t:null)}})}),t("ember-data/-private/transforms/string",["exports","ember","ember-data/transform"],function(e,t,r){var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e){return i(e)?null:String(e)},serialize:function(e){return i(e)?null:String(e)}})}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return a(e,"attributes").has("type")||a(e,"relationshipsByName").has("type")}function i(e){var r;return t.default.getOwner&&(r=t.default.getOwner(e)),!r&&e.container&&(r=e.container),r&&r.lookupFactory&&!r._lookupFactory&&(r._lookupFactory=r.lookupFactory,r.register=function(){var e=r.registry||r._registry||r;return e.register.apply(e,arguments)}),r}var a=t.default.get;e.modelHasAttributeOrRelationshipNamedType=r,
|
4
|
-
e.getOwner=i}),t("ember-data/-private/utils/parse-response-headers",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){return Array.isArray(e)?e:Array.from(e)}function i(e){var i=new t.default;if(!e)return i;var n=e.split(a);return n.forEach(function(e){var t=e.split(":"),a=r(t),n=a[0],o=a.slice(1);n=n.trim(),o=o.join(":").trim(),o&&(i[n]=o)}),i}e.default=i;var a="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){var r=t.default.get;e.default=t.default.Object.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return r(e.record,"store").serializerFor(e.modelName).serialize(e,t)},createRecord:null,updateRecord:null,deleteRecord:null,coalesceFindRequests:!0,findMany:null,groupRecordsForFindMany:function(e,t){return[t]},shouldReloadRecord:function(e,t){return!1},shouldReloadAll:function(e,t){return!t.length},shouldBackgroundReloadRecord:function(e,t){return!0},shouldBackgroundReloadAll:function(e,t){return!0}})}),t("ember-data/adapters/errors",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i){function a(e){var t=arguments.length<=1||void 0===arguments[1]?"Adapter operation failed":arguments[1];this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=t.message;return o(e,r)}}function o(e,t){var r=function(r,i){e.call(this,r,i||t)};return r.prototype=Object.create(e.prototype),p&&(r.extend=n(r)),r}function s(e){var r=[];return t.default.isPresent(e)&&Object.keys(e).forEach(function(i){for(var a=t.default.makeArray(e[i]),n=0;n<a.length;n++){var o="Invalid Attribute",s="/data/attributes/"+i;i===h&&(o="Invalid Document",s="/data"),r.push({title:o,detail:a[n],source:{pointer:s}})}}),r}function d(e){var r={};return t.default.isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(u);t?t=t[2]:e.source.pointer.search(c)!==-1&&(t=h),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.AdapterError=a,e.errorsHashToArray=s,e.errorsArrayToHash=d;var l=t.default.Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base",p=!1;a.prototype=Object.create(l.prototype),p&&(a.extend=n(a));var f=o(a,"The adapter rejected the commit because it was invalid");e.InvalidError=f;var m=o(a,"The adapter operation timed out");e.TimeoutError=m;var y=o(a,"The adapter operation was aborted");e.AbortError=y;var v=p?o(a,"The adapter operation is unauthorized"):null;e.UnauthorizedError=v;var b=p?o(a,"The adapter operation is forbidden"):null;e.ForbiddenError=b;var g=p?o(a,"The adapter could not find the resource"):null;e.NotFoundError=g;var R=p?o(a,"The adapter operation failed due to a conflict"):null;e.ConflictError=R;var _=p?o(a,"The adapter operation failed due to a server error"):null;e.ServerError=_}),t("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest","ember-data/-private/features"],function(e,t,r,i){var a=r.default.extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var i=this._super.apply(this,arguments);i.contentType&&(i.contentType="application/vnd.api+json");var a=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),a&&a(e)},i},coalesceFindRequests:!1,findMany:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(a,"GET",{data:{filter:{id:r.join(",")}}})},pathForType:function(e){var r=t.default.String.dasherize(e);return t.default.String.pluralize(r)},updateRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName);a.serializeIntoHash(i,t,r,{includeId:!0});var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PATCH",{data:i})}});e.default=a}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/adapters/errors","ember-data/-private/adapters/build-url-mixin","ember-data/-private/features","ember-data/-private/debug","ember-data/-private/utils/parse-response-headers"],function(e,t,r,i,a,n,o,s){function d(e,t){return"function"!=typeof String.prototype.endsWith?e.indexOf(t,e.length-t.length)!==-1:e.endsWith(t)}var l=t.default.MapWithDefault,u=t.default.get,c=r.default.extend(a.default,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},a=t.sort(),n=0;n<r;n++)i[a[n]]=e[a[n]];return i},coalesceFindRequests:!1,findRecord:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findRecord"),n=this.buildQuery(i);return this.ajax(a,"GET",{data:n})},findAll:function(e,t,r,i){var a=this.buildQuery(i),n=this.buildURL(t.modelName,null,i,"findAll");return r&&(a.since=r),this.ajax(n,"GET",{data:a})},query:function(e,t,r){var i=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(i,"GET",{data:r})},queryRecord:function(e,t,r){var i=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(i,"GET",{data:r})},findMany:function(e,t,r,i){var a=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(a,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,i){var a=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,a,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,i){var a=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,a,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName),n=this.buildURL(t.modelName,null,r,"createRecord");return a.serializeIntoHash(i,t,r,{includeId:!0}),this.ajax(n,"POST",{data:i})},updateRecord:function(e,t,r){var i={},a=e.serializerFor(t.modelName);a.serializeIntoHash(i,t,r);var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PUT",{data:i})},deleteRecord:function(e,t,r){var i=r.id;return this.ajax(this.buildURL(t.modelName,i,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),a=i[i.length-1],n=t.id;return a===n?i[i.length-1]="":d(a,"?id="+n)&&(i[i.length-1]=a.substring(0,a.length-n.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var n=a._stripIDFromURL(e,t[0]),o=0,s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;n.length+o+t>=r&&(o=0,s.push([])),o+=t;var a=s.length-1;s[a].push(e)}),s}var i=l.create({defaultValue:function(){return[]}}),a=this,n=this.maxURLLength;t.forEach(function(t){var r=a._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){var i="&ids%5B%5D=".length,a=r(e,n,i);a.forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,a){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new i.InvalidError(r.errors);var n=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,a);return new i.AdapterError(n,o)},isSuccess:function(e,t,r){return e>=200&&e<300||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,r,a){var n=this,o={url:e,method:r};return new t.default.RSVP.Promise(function(d,l){var u=n.ajaxOptions(e,r,a);u.success=function(e,r,i){var a=n.handleResponse(i.status,(0,s.default)(i.getAllResponseHeaders()),e,o);a&&a.isAdapterError?t.default.run.join(null,l,a):t.default.run.join(null,d,a)},u.error=function(e,r,a){var d=void 0;d=a instanceof Error?a:"timeout"===r?new i.TimeoutError:"abort"===r?new i.AbortError:n.handleResponse(e.status,(0,s.default)(e.getAllResponseHeaders()),n.parseErrorResponse(e.responseText)||a,o),t.default.run.join(null,l,d)},n._ajaxRequest(u)},"DS: RESTAdapter#ajax "+r+" to "+e)},_ajaxRequest:function(e){t.default.$.ajax(e)},ajaxOptions:function(e,t,r){var i=r||{};i.url=e,i.type=t,i.dataType="json",i.context=this,i.data&&"GET"!==t&&(i.contentType="application/json; charset=utf-8",i.data=JSON.stringify(i.data));var a=u(this,"headers");return void 0!==a&&(i.beforeSend=function(e){Object.keys(a).forEach(function(t){return e.setRequestHeader(t,a[t])})}),i},parseErrorResponse:function(e){var r=e;try{r=t.default.$.parseJSON(e)}catch(e){}return r},normalizeErrorResponse:function(e,t,r){return r&&"object"==typeof r&&r.errors?r.errors:[{status:""+e,title:"The backend responded with an error",detail:""+r}]},generatedDetailedMessage:function(e,t,r,i){var a,n=t["Content-Type"]||"Empty Content-Type";a="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r;var o=i.method+" "+i.url,s="Payload ("+n+")";return["Ember Data Request "+o+" returned a "+e,s,a].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t}});e.default=c}),t("ember-data/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var i=t.defaultValue;return i}function a(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function n(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function o(e,r){"object"==typeof e?(r=e,e=void 0):r=r||{};var o={type:e,isAttribute:!0,options:r};return t.default.computed({get:function(e){var t=this._internalModel;return a(t,e)?n(t,e):i(this,r,e)},set:function(e,t){var r,i=this._internalModel,a=n(i,e);return t!==a&&(i._attributes[e]=t,r=e in i._inFlightAttributes?i._inFlightAttributes[e]:i._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:a,originalValue:r,value:t})),t}}).meta(o)}e.default=o}),t("ember-data",["exports","ember","ember-data/-private/debug","ember-data/-private/features","ember-data/-private/core","ember-data/-private/system/normalize-model-name","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/store","ember-data/-private/system/model","ember-data/model","ember-data/-private/system/snapshot","ember-data/adapter","ember-data/serializer","ember-data/-private/system/debug","ember-data/adapters/errors","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/adapters","ember-data/-private/adapters/build-url-mixin","ember-data/-private/serializers","ember-inflector","ember-data/serializers/embedded-records-mixin","ember-data/-private/transforms","ember-data/relationships","ember-data/setup-container","ember-data/-private/instance-initializers/initialize-store-service","ember-data/-private/system/container-proxy","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,p,f,m,y,v,b,g,R,_,A,z,F,M,S,x,T,k){if(t.default.VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new t.default.Error("Ember Data requires at least Ember 1.13.0, but you have "+t.default.VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");a.default.Store=d.Store,a.default.PromiseArray=s.PromiseArray,a.default.PromiseObject=s.PromiseObject,a.default.PromiseManyArray=s.PromiseManyArray,a.default.Model=u.default,a.default.RootState=l.RootState,a.default.attr=l.attr,a.default.Errors=l.Errors,a.default.InternalModel=o.default,a.default.Snapshot=c.default,a.default.Adapter=h.default,a.default.AdapterError=m.AdapterError,a.default.InvalidError=m.InvalidError,a.default.TimeoutError=m.TimeoutError,a.default.AbortError=m.AbortError,a.default.errorsHashToArray=m.errorsHashToArray,a.default.errorsArrayToHash=m.errorsArrayToHash,a.default.Serializer=p.default,a.default.DebugAdapter=f.default,a.default.RecordArray=y.RecordArray,a.default.FilteredRecordArray=y.FilteredRecordArray,a.default.AdapterPopulatedRecordArray=y.AdapterPopulatedRecordArray,a.default.ManyArray=v.default,a.default.RecordArrayManager=b.default,a.default.RESTAdapter=g.RESTAdapter,a.default.BuildURLMixin=R.default,a.default.RESTSerializer=_.RESTSerializer,a.default.JSONSerializer=_.JSONSerializer,a.default.JSONAPIAdapter=g.JSONAPIAdapter,a.default.JSONAPISerializer=_.JSONAPISerializer,a.default.Transform=F.Transform,a.default.DateTransform=F.DateTransform,a.default.StringTransform=F.StringTransform,a.default.NumberTransform=F.NumberTransform,a.default.BooleanTransform=F.BooleanTransform,a.default.EmbeddedRecordsMixin=z.default,a.default.belongsTo=M.belongsTo,a.default.hasMany=M.hasMany,a.default.Relationship=k.default,a.default.ContainerProxy=T.default,a.default._setupContainer=S.default,a.default._initializeStoreService=x.default,Object.defineProperty(a.default,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:n.default}),t.default.lookup.DS=a.default,e.default=a.default}),t("ember-data/model",["exports","ember-data/-private/system/model"],function(e,t){e.default=t.default}),t("ember-data/relationships",["exports","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many"],function(e,t,r){e.belongsTo=t.default,e.hasMany=r.default}),t("ember-data/serializer",["exports","ember"],function(e,t){e.default=t.default.Object.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i){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)}var n=t.default.get,o=t.default.set,s=t.default.String.camelize;e.default=t.default.Mixin.create({normalize:function(e,t,r){var i=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,i)},keyForRelationship:function(e,t,r){return"serialize"===r&&this.hasSerializeRecordsOption(e)||"deserialize"===r&&this.hasDeserializeRecordsOption(e)?this.keyForAttribute(e,r):this._super(e,t,r)||e},serializeBelongsTo:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);var a,n=this.hasSerializeIdsOption(i),o=this.hasSerializeRecordsOption(i),s=e.belongsTo(i);n?(a=this.keyForRelationship(i,r.kind,"serialize"),s?(t[a]=s.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[a]=null):o&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[a]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[a]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[a]=null},serializeHasMany:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);if(this.hasSerializeIdsOption(i)){var a=this.keyForRelationship(i,r.kind,"serialize");t[a]=e.hasMany(i,{ids:!0})}else this.hasSerializeRecordsOption(i)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(i)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,r,i){var a=this.keyForAttribute(i.key,"serialize"),n=e.hasMany(i.key);r[a]=t.default.A(n).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),t[i]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,r){for(var i=e.hasMany(r.key),a=t.default.A(i),n=new Array(a.length),o=0;o<a.length;o++){var s=a[o],d=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,d),n[o]=d}return n},removeEmbeddedForeignKey:function(e,t,r,i){if("hasMany"!==r.kind&&"belongsTo"===r.kind){var a=e.type.inverseFor(r.key,this.store);if(a){var n=a.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(n,a.kind,"deserialize");s&&delete i[s]}}},hasEmbeddedAlwaysOption:function(e){var t=this.attrsOption(e);return t&&"always"===t.embedded},hasSerializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.serialize},hasSerializeIdsOption:function(e){var t=this.attrsOption(e);return t&&("ids"===t.serialize||"id"===t.serialize)},hasSerializeIdsAndTypesOption:function(e){var t=this.attrsOption(e);return t&&("ids-and-types"===t.serialize||"id-and-type"===t.serialize)},noSerializeOptionSpecified:function(e){var t=this.attrsOption(e);return!(t&&(t.serialize||t.embedded))},hasDeserializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.deserialize},attrsOption:function(e){var t=this.get("attrs");return t&&(t[s(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var a=this;return r.eachRelationship(function(r,n){e.hasDeserializeRecordsOption(r)&&("hasMany"===n.kind&&a._extractEmbeddedHasMany(t,r,i,n),"belongsTo"===n.kind&&a._extractEmbeddedBelongsTo(t,r,i,n))}),i},_extractEmbeddedHasMany:function(e,t,r,i){var s=n(r,"data.relationships."+t+".data");if(s){for(var d=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=this._normalizeEmbeddedRelationship(e,i,u),h=c.data,p=c.included;if(r.included=r.included||[],r.included.push(h),p){var f;(f=r.included).push.apply(f,a(p))}d[l]={id:h.id,type:h.type}}var m={data:d};o(r,"data.relationships."+t,m)}},_extractEmbeddedBelongsTo:function(e,t,r,i){var s=n(r,"data.relationships."+t+".data");if(s){var d=this._normalizeEmbeddedRelationship(e,i,s),l=d.data,u=d.included;if(r.included=r.included||[],r.included.push(l),u){var c;(c=r.included).push.apply(c,a(u))}var h={id:l.id,type:l.type},p={data:h};o(r,"data.relationships."+t,p)}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var a=e.modelFor(i),n=e.serializerFor(i);return n.normalize(a,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/features"],function(e,t,r,i,a,n,o){var s=t.default.String.dasherize,d=i.default.extend({_normalizeDocumentHelper:function(e){if("object"===t.default.typeOf(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeResourceHelper(a)}e.data=r}if(Array.isArray(e.included)){for(var r=new Array(e.included.length),i=0;i<e.included.length;i++){var n=e.included[i];r[i]=this._normalizeResourceHelper(n)}e.included=r}return e},_normalizeRelationshipDataHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);return e.type=t,e},_normalizeResourceHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);if(!this.store._hasModelFor(t))return null;var r=this.store.modelFor(t),i=this.store.serializerFor(t),a=i.normalize(r,e),n=a.data;return n},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);e.push(r)},_normalizeResponse:function(e,t,r,i,a,n){var o=this._normalizeDocumentHelper(r);return o},normalizeQueryRecordResponse:function(){var e=this._super.apply(this,arguments);return e},extractAttributes:function(e,t){var r=this,i={};return t.attributes&&e.eachAttribute(function(e){var a=r.keyForAttribute(e,"deserialize");t.attributes.hasOwnProperty(a)&&(i[e]=t.attributes[a])}),i},extractRelationship:function(e){if("object"===t.default.typeOf(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeRelationshipDataHelper(a)}e.data=r}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,a){var n=r.keyForRelationship(e,a.kind,"deserialize");if(t.relationships.hasOwnProperty(n)){var o=t.relationships[n];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,a.default)(e))},payloadKeyFromModelName:function(e){return(0,n.pluralize)(e)},normalize:function(e,t){t.attributes&&this.normalizeUsingDeclaredMapping(e,t.attributes),t.relationships&&this.normalizeUsingDeclaredMapping(e,t.relationships);var r={id:this.extractId(e,t),type:this._extractType(e,t),attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)};return this.applyTransforms(e,r.attributes),{data:r}},keyForAttribute:function(e,t){return s(e)},keyForRelationship:function(e,t,r){return s(e)},serialize:function(e,t){var r=this._super.apply(this,arguments);return r.type=this.payloadKeyFromModelName(e.modelName),{data:r}},serializeAttribute:function(e,t,r,i){var a=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var n=e.attr(r);if(a){var o=this.transformFor(a);n=o.serialize(n,i.options)}var s=this._getMappedKey(r,e.type);s===r&&(s=this.keyForAttribute(r,"serialize")),t.attributes[s]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i);if(void 0!==a){t.relationships=t.relationships||{};var n=this._getMappedKey(i,e.type);n===i&&(n=this.keyForRelationship(i,"belongsTo","serialize"));var o=null;a&&(o={type:this.payloadKeyFromModelName(a.modelName),id:a.id}),t.relationships[n]={data:o}}}},serializeHasMany:function(e,t,r){var i=r.key;if(this._shouldSerializeHasMany(e,i,r)){var a=e.hasMany(i);if(void 0!==a){t.relationships=t.relationships||{};var n=this._getMappedKey(i,e.type);n===i&&this.keyForRelationship&&(n=this.keyForRelationship(i,"hasMany","serialize"));for(var o=new Array(a.length),s=0;s<a.length;s++){var d=a[s];o[s]={type:this.payloadKeyFromModelName(d.modelName),id:d.id}}t.relationships[n]={data:o}}}}});e.default=d}),t("ember-data/serializers/json",["exports","ember","ember-data/-private/debug","ember-data/serializer","ember-data/-private/system/coerce-id","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/adapters/errors","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t.default.get,c=t.default.isNone,h=t.default.assign||t.default.merge;e.default=i.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=void 0;return i=u(e,"attributes"),e.eachTransformedAttribute(function(e,a){if(e in t){var n=r.transformFor(a),o=i.get(e);t[e]=n.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,a){switch(a){case"findRecord":return this.normalizeFindRecordResponse.apply(this,arguments);case"queryRecord":return this.normalizeQueryRecordResponse.apply(this,arguments);case"findAll":return this.normalizeFindAllResponse.apply(this,arguments);case"findBelongsTo":return this.normalizeFindBelongsToResponse.apply(this,arguments);case"findHasMany":return this.normalizeFindHasManyResponse.apply(this,arguments);case"findMany":return this.normalizeFindManyResponse.apply(this,arguments);case"query":return this.normalizeQueryResponse.apply(this,arguments);case"createRecord":return this.normalizeCreateRecordResponse.apply(this,arguments);case"deleteRecord":return this.normalizeDeleteRecordResponse.apply(this,arguments);case"updateRecord":return this.normalizeUpdateRecordResponse.apply(this,arguments)}},normalizeFindRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!0)},normalizeArrayResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!1)},_normalizeResponse:function(e,t,r,i,a,n){var o={data:null,included:[]},s=this.extractMeta(e,t,r);if(s&&(o.meta=s),n){var d=this.normalize(t,r),u=d.data,c=d.included;o.data=u,c&&(o.included=c)}else{for(var h=new Array(r.length),p=0,f=r.length;p<f;p++){var m=r[p],y=this.normalize(t,m),u=y.data,c=y.included;if(c){var v;(v=o.included).push.apply(v,l(c))}h[p]=u}o.data=h}return o},normalize:function(e,r){var i=null;return r&&(this.normalizeUsingDeclaredMapping(e,r),"object"===t.default.typeOf(r.links)&&this.normalizeUsingDeclaredMapping(e,r.links),i={id:this.extractId(e,r),type:e.modelName,attributes:this.extractAttributes(e,r),relationships:this.extractRelationships(e,r)},this.applyTransforms(e,i.attributes)),{data:i}},extractId:function(e,t){var r=u(this,"primaryKey"),i=t[r];return(0,a.default)(i)},extractAttributes:function(e,t){var r,i=this,a={};return e.eachAttribute(function(e){r=i.keyForAttribute(e,"deserialize"),t.hasOwnProperty(r)&&(a[e]=t[r])}),a},extractRelationship:function(e,r){if(t.default.isNone(r))return null;if("object"===t.default.typeOf(r)){r.id&&(r.id=(0,a.default)(r.id));var i=this.store.modelFor(e);return r.type&&!(0,o.modelHasAttributeOrRelationshipNamedType)(i)&&(r.type=this.modelNameFromPayloadKey(r.type)),r}return{id:(0,a.default)(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var i=this,a={};return e.eachRelationship(function(e,n){var o=null,s=i.keyForRelationship(e,n.kind,"deserialize");if(r.hasOwnProperty(s)){var d=null,l=r[s];if("belongsTo"===n.kind)d=n.options.polymorphic?i.extractPolymorphicRelationship(n.type,l,{key:e,resourceHash:r,relationshipMeta:n}):i.extractRelationship(n.type,l);else if("hasMany"===n.kind&&!t.default.isNone(l)){d=new Array(l.length);for(var u=0,c=l.length;u<c;u++){var h=l[u];d[u]=i.extractRelationship(n.type,h)}}o={data:d}}var p=i.keyForLink(e,n.kind);if(r.links&&r.links.hasOwnProperty(p)){var f=r.links[p];o=o||{},o.links={related:f}}o&&(a[e]=o)}),a},modelNameFromPayloadKey:function(e){return(0,n.default)(e)},normalizeAttributes:function(e,t){var r,i=this;this.keyForAttribute&&e.eachAttribute(function(e){r=i.keyForAttribute(e,"deserialize"),e!==r&&t.hasOwnProperty(r)&&(t[e]=t[r],delete t[r])})},normalizeRelationships:function(e,t){var r,i=this;this.keyForRelationship&&e.eachRelationship(function(e,a){r=i.keyForRelationship(e,a.kind,"deserialize"),e!==r&&t.hasOwnProperty(r)&&(t[e]=t[r],delete t[r])})},normalizeUsingDeclaredMapping:function(e,t){var r,i,a,n=u(this,"attrs");if(n)for(a in n)r=i=this._getMappedKey(a,e),t.hasOwnProperty(i)&&(u(e,"attributes").has(a)&&(r=this.keyForAttribute(a)),u(e,"relationshipsByName").has(a)&&(r=this.keyForRelationship(a)),i!==r&&(t[r]=t[i],delete t[i]))},_getMappedKey:function(e,t){var r,i=u(this,"attrs");return i&&i[e]&&(r=i[e],r.key&&(r=r.key),"string"==typeof r&&(e=r)),e},_canSerialize:function(e){var t=u(this,"attrs");return!t||!t[e]||t[e].serialize!==!1},_mustSerialize:function(e){var t=u(this,"attrs");return t&&t[e]&&t[e].serialize===!0},_shouldSerializeHasMany:function(e,t,r){var i=e.type.determineRelationshipType(r,this.store);return!!this._mustSerialize(t)||this._canSerialize(t)&&("manyToNone"===i||"manyToMany"===i)},serialize:function(e,t){var r=this,i={};if(t&&t.includeId){var a=e.id;a&&(i[u(this,"primaryKey")]=a)}return e.eachAttribute(function(t,a){r.serializeAttribute(e,i,t,a)}),e.eachRelationship(function(t,a){"belongsTo"===a.kind?r.serializeBelongsTo(e,i,a):"hasMany"===a.kind&&r.serializeHasMany(e,i,a)}),i},serializeIntoHash:function(e,t,r,i){h(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){var a=i.type;if(this._canSerialize(r)){var n=e.attr(r);if(a){var o=this.transformFor(a);n=o.serialize(n,i.options)}var s=this._getMappedKey(r,e.type);s===r&&this.keyForAttribute&&(s=this.keyForAttribute(r,"serialize")),t[s]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i,{id:!0}),n=this._getMappedKey(i,e.type);n===i&&this.keyForRelationship&&(n=this.keyForRelationship(i,"belongsTo","serialize")),c(a)?t[n]=null:t[n]=a,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var i=r.key;if(this._shouldSerializeHasMany(e,i,r)){var a=e.hasMany(i,{ids:!0});if(void 0!==a){var n=this._getMappedKey(i,e.type);n===i&&this.keyForRelationship&&(n=this.keyForRelationship(i,"hasMany","serialize")),t[n]=a}}},serializePolymorphicType:t.default.K,extractMeta:function(e,t,r){if(r&&r.hasOwnProperty("meta")){var i=r.meta;return delete r.meta,i}},extractErrors:function(e,t,r,i){var a=this;return r&&"object"==typeof r&&r.errors&&(r=(0,s.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=a.keyForAttribute(e,"deserialize");t!==e&&r.hasOwnProperty(t)&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=a.keyForRelationship(e,"deserialize");t!==e&&r.hasOwnProperty(t)&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var r=(0,o.getOwner)(this).lookup("transform:"+e);return r}})}),t("ember-data/serializers/rest",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/system/coerce-id","ember-data/-private/utils","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t.default.String.camelize,c=i.default.extend({keyForPolymorphicType:function(e,t,r){var i=this.keyForRelationship(e);return i+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,r,i,a){var n=this,o={data:[],included:[]},s=e.modelFor(r),d=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,a,s,d),i=r.data,u=r.included;if(o.data.push(i),u){var c;(c=o.included).push.apply(c,l(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,i,a){var n=void 0,o=void 0,d=(0,s.modelHasAttributeOrRelationshipNamedType)(i);return!d&&t.type&&e._hasModelFor(this.modelNameFromPayloadKey(t.type))?(n=e.serializerFor(this.modelNameFromPayloadKey(t.type)),o=e.modelFor(this.modelNameFromPayloadKey(t.type))):(n=a,o=i),n.normalize(o,t,r)},_normalizeResponse:function(e,r,i,a,n,s){var d={data:null,included:[]},u=this.extractMeta(e,r,i);u&&(d.meta=u);for(var c=Object.keys(i),h=0,p=c.length;h<p;h++){var f=c[h],m=f,y=!1;"_"===f.charAt(0)&&(y=!0,m=f.substr(1));var v=this.modelNameFromPayloadKey(m);if(e.modelFactoryFor(v)){var b=!y&&this.isPrimaryType(e,v,r),g=i[f];if(null!==g)if(b&&"array"!==t.default.typeOf(g)){var R=this._normalizePolymorphicRecord(e,g,f,r,this),_=R.data,A=R.included;if(d.data=_,A){var z;(z=d.included).push.apply(z,l(A))}}else{var F=this._normalizeArray(e,v,g,f),M=F.data,S=F.included;if(S){var x;(x=d.included).push.apply(x,l(S))}if(s)M.forEach(function(e){var t=b&&(0,o.default)(e.id)===a,r=b&&!a&&!d.data;r||t?d.data=e:d.included.push(e);
|
5
|
-
});else if(b)d.data=M;else if(M){var T;(T=d.included).push.apply(T,l(M))}}}}return d},isPrimaryType:function(e,t,r){var i=e.modelFor(t);return i.modelName===r.modelName},pushPayload:function(e,r){var i={data:[],included:[]};for(var a in r){var n=this.modelNameFromPayloadKey(a);if(e.modelFactoryFor(n)){var o=e.modelFor(n),s=e.serializerFor(o.modelName);t.default.makeArray(r[a]).forEach(function(e){var t=s.normalize(o,e,a),r=t.data,n=t.included;if(i.data.push(r),n){var d;(d=i.included).push.apply(d,l(n))}})}}e.push(i)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,a.default)(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,i){var a=this.payloadKeyFromModelName(t.modelName);e[a]=this.serialize(r,i)},payloadKeyFromModelName:function(e){return u(e)},serializePolymorphicType:function(e,r,i){var a=i.key,n=e.belongsTo(a),o=this.keyForPolymorphicType(a,i.type,"serialize");a=this.keyForAttribute?this.keyForAttribute(a,"serialize"):a,a+="Type",a!==o&&this.keyForPolymorphicType===c.prototype.keyForPolymorphicType&&(o=a),t.default.isNone(n)?r[o]=null:r[o]=u(n.modelName)},extractPolymorphicRelationship:function(e,t,r){var i=r.key,a=r.resourceHash,n=r.relationshipMeta,o=n.options.polymorphic,s=this.keyForPolymorphicType(i,e,"deserialize");if(o&&a.hasOwnProperty(s)&&"object"!=typeof t){var d=this.modelNameFromPayloadKey(a[s]);return{id:t,type:d}}return this._super.apply(this,arguments)}});e.default=c}),t("ember-data/setup-container",["exports","ember-data/-private/initializers/store","ember-data/-private/initializers/transforms","ember-data/-private/initializers/store-injections","ember-data/-private/initializers/data-adapter"],function(e,t,r,i,a){function n(e){(0,a.default)(e),(0,r.default)(e),(0,i.default)(e),(0,t.default)(e)}e.default=n}),t("ember-data/store",["exports","ember-data/-private/system/store"],function(e,t){e.default=t.default}),t("ember-data/transform",["exports","ember"],function(e,t){e.default=t.default.Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.default="2.6.2"}),t("ember-inflector",["exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i,a){i.Inflector.defaultRules=i.defaultRules,r.default.Inflector=i.Inflector,r.default.String.pluralize=i.pluralize,r.default.String.singularize=i.singularize,e.default=i.Inflector,e.pluralize=i.pluralize,e.singularize=i.singularize,e.defaultRules=i.defaultRules,"undefined"!=typeof t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=i.Inflector,i.Inflector}):"undefined"!=typeof module&&module.exports&&(module.exports=i.Inflector)}),t("ember-inflector/lib/ext/string",["exports","ember","ember-inflector/lib/system/string"],function(e,t,r){(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,r.pluralize)(this)},String.prototype.singularize=function(){return(0,r.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.default=(0,r.default)(function(e){var r=void 0,i=void 0;return 1===e.length?(i=e[0],(0,t.pluralize)(i)):(r=e[0],i=e[1],1!==parseFloat(r)&&(i=(0,t.pluralize)(i)),r+" "+i)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.default=(0,r.default)(function(e){return(0,t.singularize)(e[0])})}),t("ember-inflector/lib/system",["exports","ember-inflector/lib/system/inflector","ember-inflector/lib/system/string","ember-inflector/lib/system/inflections"],function(e,t,r,i){t.default.inflector=new t.default(i.default),e.Inflector=t.default,e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=i.default}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e.default={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status)$/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)(es)?$/i,"$1"],[/^(ox)en/i,"$1"],[/(vert|ind)ices$/i,"$1ex"],[/(matr)ices$/i,"$1ix"],[/(quiz)zes$/i,"$1"],[/(database)s$/i,"$1"]],irregularPairs:[["person","people"],["man","men"],["child","children"],["sex","sexes"],["move","moves"],["cow","kine"],["zombie","zombies"]],uncountable:["equipment","information","rice","money","species","series","fish","sheep","jeans","police"]}}),t("ember-inflector/lib/system/inflector",["exports","ember"],function(e,t){function r(e,t){for(var r=0,i=t.length;r<i;r++)e.uncountable[t[r].toLowerCase()]=!0}function i(e,t){for(var r,i=0,a=t.length;i<a;i++)r=t[i],e.irregular[r[0].toLowerCase()]=r[1],e.irregular[r[1].toLowerCase()]=r[1],e.irregularInverse[r[1].toLowerCase()]=r[0],e.irregularInverse[r[0].toLowerCase()]=r[0]}function a(e){e=e||{},e.uncountable=e.uncountable||n(),e.irregularPairs=e.irregularPairs||n();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};r(t,e.uncountable),i(t,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}var o=t.default.String.capitalize,s=/^\s*$/,d=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,u=/[A-Z][a-z\d]*$/;if(!Object.create&&!Object.create(null).hasOwnProperty)throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");a.prototype={enableCache:function(){this.purgeCache(),this.singularize=function(e){return this._cacheUsed=!0,this._sCache[e]||(this._sCache[e]=this._singularize(e))},this.pluralize=function(e){return this._cacheUsed=!0,this._pCache[e]||(this._pCache[e]=this._pluralize(e))}},purgeCache:function(){this._cacheUsed=!1,this._sCache=n(),this._pCache=n()},disableCache:function(){this._sCache=null,this._pCache=null,this.singularize=function(e){return this._singularize(e)},this.pluralize=function(e){return this._pluralize(e)}},plural:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.plurals.push([e,t.toLowerCase()])},singular:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.singular.push([e,t.toLowerCase()])},uncountable:function(e){this._cacheUsed&&this.purgeCache(),r(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),i(this.rules,[[e,t]])},pluralize:function(e){return this._pluralize(e)},_pluralize:function(e){return this.inflect(e,this.rules.plurals,this.rules.irregular)},singularize:function(e){return this._singularize(e)},_singularize:function(e){return this.inflect(e,this.rules.singular,this.rules.irregularInverse)},inflect:function(e,t,r){var i,a,n,c,h,p,f,m,y,v,b;if(m=!e||s.test(e),y=u.test(e),p="",m)return e;if(c=e.toLowerCase(),h=d.exec(e)||l.exec(e),h&&(p=h[1],f=h[2].toLowerCase()),b=this.rules.uncountable[c]||this.rules.uncountable[f])return e;for(v in r)if(c.match(v+"$"))return a=r[v],y&&r[f]&&(a=o(a),v=o(v)),e.replace(new RegExp(v,"i"),a);for(var g=t.length,R=0;g>R&&(i=t[g-1],v=i[0],!v.test(e));g--);return i=i||[],v=i[0],a=i[1],n=e.replace(v,a)}},e.default=a}),t("ember-inflector/lib/system/string",["exports","ember-inflector/lib/system/inflector"],function(e,t){function r(e){return t.default.inflector.pluralize(e)}function i(e){return t.default.inflector.singularize(e)}e.pluralize=r,e.singularize=i}),t("ember-inflector/lib/utils/make-helper",["exports","ember"],function(e,t){function r(e){return t.default.Helper?t.default.Helper.helper(e):t.default.HTMLBars?t.default.HTMLBars.makeBoundHelper(e):t.default.Handlebars.makeBoundHelper(e)}e.default=r}),t("ember",[],function(){return{default:Ember}}),i("ember-data")}(),function(){function e(){var e={"ember-data":{default:DS},"ember-data/model":{default:DS.Model},"ember-data/mixins/embedded-records":{default:DS.EmbeddedRecordsMixin},"ember-data/serializers/rest":{default:DS.RESTSerializer},"ember-data/serializers/active-model":{default:DS.ActiveModelSerializer},"ember-data/serializers/json":{default:DS.JSONSerializer},"ember-data/serializers/json-api":{default:DS.JSONAPISerializer},"ember-data/serializer":{default:DS.Serializer},"ember-data/adapters/json-api":{default:DS.JSONAPIAdapter},"ember-data/adapters/rest":{default:DS.RESTAdapter},"ember-data/adapter":{default:DS.Adapter},"ember-data/adapters/active-model":{default:DS.ActiveModelAdapter},"ember-data/store":{default:DS.Store},"ember-data/transform":{default:DS.Transform},"ember-data/attr":{default:DS.attr},"ember-data/relationships":{hasMany:DS.hasMany,belongsTo:DS.belongsTo}};for(var r in e)t(r,e[r])}function t(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&e()}(),function(){var e=Ember.K;Ember.onLoad("Ember.Application",function(t){t.initializer({name:"ember-data",initialize:DS._setupContainer}),t.instanceInitializer({name:"ember-data",initialize:DS._initializeStoreService}),t.initializer({name:"store",after:"ember-data",initialize:e}),t.initializer({name:"transforms",before:"store",initialize:e}),t.initializer({name:"data-adapter",before:"store",initialize:e}),t.initializer({name:"injectStore",before:"store",initialize:e})})}();
|
1
|
+
!function(){"use strict";var e,t,r,a,i;!function(n){function o(){m={define:0,require:0,reify:0,build:0,modules:0,exports:0,ensureBuild:0,resolve:0,resolveRelative:0,findModule:0},i._stats=m}function s(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function d(e,t,r,a){m.modules++,this.id=_++,this.name=e,this.deps=!t.length&&r.length?A:t,this.module={exports:{}},this.callback=r,this.state=void 0,this.finalized=!1,this.hasExportsAsDep=!1,this.isAlias=a,this.reified=new Array(t.length)}function l(e){this.name=e}function u(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function c(e,t){m.findModule++;for(var r=v[e]||v[e+"/index"];r&&r.isAlias;)r=v[r.name];return r||u(e,t),r.build(),r}function h(e,t){if(m.resolve++,"."!==e.charAt(0))return e;m.resolveRelative++;for(var r=e.split("/"),a=t.split("/"),i=a.slice(0,-1),n=0,o=r.length;o>n;n++){var s=r[n];if(".."===s){if(0===i.length)throw new Error("Cannot access parent module of root");i.pop()}else{if("."===s)continue;i.push(s)}}return i.join("/")}function p(e){return!(!v[e]&&!v[e+"/index"])}var f={loader:e,define:t,requireModule:r,require:a,requirejs:i};i=a=r=function(e){return m.require++,c(e,"(require)").module.exports};var m;o(),e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&f.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=f[t])}};var y;y=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var v={},b={},g=!1,R=!0,_=0,A=["require","exports","module"];d.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e["default"]||(e["default"]=e)},d.prototype.exports=function(){if(m.exports++,this.finalized)return this.module.exports;e.wrapModules&&(this.callback=e.wrapModules(this.name,this.callback));var t=this.callback.apply(this,this.reified);return this.hasExportsAsDep&&void 0===t||(this.module.exports=t),this.makeDefaultExport(),this.finalized=!0,this.module.exports},d.prototype.unsee=function(){this.finalized=!1,this.state=void 0,this.module={exports:{}}},d.prototype.reify=function(){m.reify++;for(var e,t=this.deps,r=this.reified,a=0;a<t.length;a++)e=t[a],"exports"===e?(this.hasExportsAsDep=!0,r[a]=this.module.exports):"require"===e?r[a]=this.makeRequire():"module"===e?r[a]=this.module:r[a]=c(h(e,this.name),this.name).module.exports},d.prototype.makeRequire=function(){var e=this.name,t=function(t){return a(h(t,e))};return t["default"]=t,t.has=function(t){return p(h(t,e))},t},d.prototype.build=function(){m.ensureBuild++,this.state!==g&&this.state!==R&&(m.build++,this.state=g,this.reify(),this.exports(),this.state=R)},t=function(e,t,r){m.define++,arguments.length<2&&s(arguments.length),y(t)||(r=t,t=[]),r instanceof l?v[e]=new d(r.name,t,r,!0):v[e]=new d(e,t,r,!1)},t.petal={},t.alias=function(e){return new l(e)},i.entries=i._eak_seen=v,i.has=p,i.unsee=function(e){c(e,"(unsee)").unsee()},i.clear=function(){o(),i.entries=i._eak_seen=v={},b={}},t("foo",function(){}),t("foo/bar",[],function(){}),t("foo/asdf",["module","exports","require"],function(e,t,r){r.has("foo/bar")&&r("foo/bar")}),t("foo/baz",[],t.alias("foo")),t("foo/quz",t.alias("foo")),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),a("foo/main"),a.unsee("foo/bar"),i.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:a,define:t})}(this),t("ember-data/-private/adapters",["exports","ember-data/adapters/json-api","ember-data/adapters/rest"],function(e,t,r){e.JSONAPIAdapter=t["default"],e.RESTAdapter=r["default"]}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){var r=t["default"].get;e["default"]=t["default"].Mixin.create({buildURL:function(e,t,r,a,i){switch(a){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(i,e);case"queryRecord":return this.urlForQueryRecord(i,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 a,i=[],n=r(this,"host"),o=this.urlPrefix();return e&&(a=this.pathForType(e),a&&i.push(a)),t&&i.push(encodeURIComponent(t)),o&&i.unshift(o),i=i.join("/"),!n&&i&&"/"!==i.charAt(0)&&(i="/"+i),i},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 a=r(this,"host"),i=r(this,"namespace");if(a&&"/"!==a||(a=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+a+e:t+"/"+e;var n=[];return a&&n.push(a),i&&n.push(i),n.join("/")},pathForType:function(e){var r=t["default"].String.camelize(e);return t["default"].String.pluralize(r)}})}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){var a=t["default"].Namespace.create({VERSION:r["default"],name:"DS"});t["default"].libraries&&t["default"].libraries.registerCoreLibrary("Ember Data",a.VERSION),e["default"]=a}),t("ember-data/-private/debug",["exports","ember"],function(e,t){function r(){return t["default"].assert.apply(t["default"],arguments)}function a(){return t["default"].debug.apply(t["default"],arguments)}function i(){return t["default"].deprecate.apply(t["default"],arguments)}function n(){return t["default"].info.apply(t["default"],arguments)}function o(){return t["default"].runInDebug.apply(t["default"],arguments)}function s(){return t["default"].warn.apply(t["default"],arguments)}function d(){return t["default"].debugSeal.apply(t["default"],arguments)}function l(e,r){return e.__isMixin?e.__mixin.detect(r.type.PrototypeMixin):(t["default"].MODEL_FACTORY_INJECTIONS&&(e=e.superclass),e.detect(r.type))}function u(e,t,a){var i=a.type.modelName,n=e.type.modelName,o=t.key,s=e.store.modelFor(t.type),d="You cannot add a record of type '"+i+"' to the '"+n+"."+o+"' relationship (only '"+s.modelName+"' allowed)";r(d,l(s,a))}e.assert=r,e.debug=a,e.deprecate=i,e.info=n,e.runInDebug=o,e.warn=s,e.debugSeal=d,e.assertPolymorphicType=u}),t("ember-data/-private/ext/date",["exports","ember","ember-data/-private/debug"],function(e,t,r){t["default"].Date=t["default"].Date||{};var a=Date.parse,i=[1,4,5,6,7,10,11],n=function(e){var t,r,n=0;if(r=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?:(\d{2}))?)?)?$/.exec(e)){for(var o,s=0;o=i[s];++s)r[o]=+r[o]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,"Z"!==r[8]&&void 0!==r[9]&&(n=60*r[10]+r[11],"+"===r[9]&&(n=0-n)),t=Date.UTC(r[1],r[2],r[3],r[4],r[5]+n,r[6],r[7])}else t=a?a(e):NaN;return t};e.parseDate=n,t["default"].Date.parse=function(e){return n(e)},(t["default"].EXTEND_PROTOTYPES===!0||t["default"].EXTEND_PROTOTYPES.Date)&&(Date.parse=n)}),t("ember-data/-private/features",["exports","ember"],function(e,t){function r(){var e;return(e=t["default"].FEATURES).isEnabled.apply(e,arguments)}e["default"]=r}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}function r(e){return e&&void 0===e.nodeType?e:void 0}e["default"]=t(r("object"==typeof global&&global))||t("object"==typeof self&&self)||t("object"==typeof window&&window)||new Function("return this")()}),t("ember-data/-private/initializers/data-adapter",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){function r(e){e.register("data-adapter:main",t["default"])}e["default"]=r}),t("ember-data/-private/initializers/store-injections",["exports"],function(e){function t(e){var t=e.inject||e.injection;t.call(e,"controller","store","service:store"),t.call(e,"route","store","service:store"),t.call(e,"data-adapter","store","service:store")}e["default"]=t}),t("ember-data/-private/initializers/store",["exports","ember-data/-private/system/store","ember-data/-private/serializers","ember-data/-private/adapters"],function(e,t,r,a){function i(e,t){return e.has?e.has(t):e.hasRegistration(t)}function n(e){var n=e.registerOptionsForType||e.optionsForType;n.call(e,"serializer",{singleton:!1}),n.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",r.JSONSerializer),e.register("serializer:-rest",r.RESTSerializer),e.register("adapter:-rest",a.RESTAdapter),e.register("adapter:-json-api",a.JSONAPIAdapter),e.register("serializer:-json-api",r.JSONAPISerializer),i(e,"service:store")||e.register("service:store",t["default"])}e["default"]=n}),t("ember-data/-private/initializers/transforms",["exports","ember-data/-private/transforms"],function(e,t){function r(e){e.register("transform:boolean",t.BooleanTransform),e.register("transform:date",t.DateTransform),e.register("transform:number",t.NumberTransform),e.register("transform:string",t.StringTransform)}e["default"]=r}),t("ember-data/-private/instance-initializers/initialize-store-service",["exports"],function(e){function t(e){var t=e.lookup?e:e.container;t.lookup("service:store")}e["default"]=t}),t("ember-data/-private/serializers",["exports","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest"],function(e,t,r,a){e.JSONAPISerializer=t["default"],e.JSONSerializer=r["default"],e.RESTSerializer=a["default"]}),t("ember-data/-private/system/clone-null",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){var r=new t["default"];for(var a in e)r[a]=e[a];return r}e["default"]=r}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:e+""}e["default"]=t}),t("ember-data/-private/system/container-proxy",["exports","ember-data/-private/debug"],function(e,t){function r(e){this.container=e}e["default"]=r,r.prototype.aliasedFactory=function(e,t){var r=this;return{create:function(){return t&&t(),r.container.lookup(e)}}},r.prototype.registerAlias=function(e,t,r){var a=this.aliasedFactory(t,r);return this.container.register(e,a)},r.prototype.registerDeprecation=function(e,t){var r=function(){};return this.registerAlias(e,t,r)},r.prototype.registerDeprecations=function(e){var t,r,a,i;for(t=e.length;t>0;t--)r=e[t-1],a=r.deprecated,i=r.valid,this.registerDeprecation(a,i)}}),t("ember-data/-private/system/debug",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){e["default"]=t["default"]}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/model"],function(e,t,r){var a=t["default"].get,i=t["default"].String.capitalize,n=t["default"].String.underscore,o=t["default"].assert;e["default"]=t["default"].DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==r["default"]&&r["default"].detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,o=this;return a(e,"attributes").forEach(function(e,a){if(r++>o.attributeLimit)return!1;var s=i(n(a).replace("_"," "));t.push({name:a,desc:s})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var a=r.match(/model:(.*)/);a&&(t=a[1])}}return o("Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support",!!t),this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,i={id:a(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;var o=a(e,n);i[n]=o}),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(a(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 a=t["default"].A(),i=t["default"].A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return i.push(e)});var n=this;i.forEach(function(i){var o=function(){r(n.wrapRecord(e))};t["default"].addObserver(e,i,o),a.push(function(){t["default"].removeObserver(e,i,o)})});var o=function(){a.forEach(function(e){return e()})};return o}})}),t("ember-data/-private/system/debug/debug-info",["exports","ember"],function(e,t){e["default"]=t["default"].Mixin.create({_debugInfo:function(){var e=["id"],t={belongsTo:[],hasMany:[]},r=[];this.eachAttribute(function(t,r){return e.push(t)}),this.eachRelationship(function(e,a){t[a.kind].push(e),r.push(e)});var a=[{name:"Attributes",properties:e,expand:!0},{name:"Belongs To",properties:t.belongsTo,expand:!0},{name:"Has Many",properties:t.hasMany,expand:!0},{name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}];return{propertyInfo:{includeOtherProperties:!0,groups:a,expensiveProperties:r}}}})}),t("ember-data/-private/system/empty-object",["exports"],function(e){function t(){}e["default"]=t;var r=Object.create(null,{constructor:{value:void 0,enumerable:!1,writable:!0}});t.prototype=r}),t("ember-data/-private/system/is-array-like",["exports","ember"],function(e,t){function r(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(t["default"].Array.detect(e))return!0;var r=t["default"].typeOf(e);return"array"===r?!0:void 0!==e.length&&"object"===r}e["default"]=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common"],function(e,t,r,a,i){var n=t["default"].get,o=t["default"].set;e["default"]=t["default"].Object.extend(t["default"].MutableArray,t["default"].Evented,{init:function(){this._super.apply(this,arguments),this.currentState=t["default"].A([])},record:null,canonicalState:null,currentState:null,length:0,objectAt:function(e){return this.currentState[e]?this.currentState[e].getRecord():void 0},flushCanonical:function(){var e=this.canonicalState.filter(function(e){return!e.isDeleted()}),t=this.currentState.filter(function(t){return t.isNew()&&-1===e.indexOf(t)});e=e.concat(t);var r=this.length;this.arrayContentWillChange(0,this.length,e.length),(0,i._objectIsAlive)(this)&&this.set("length",e.length),this.currentState=e,this.arrayContentDidChange(0,r,this.length),this.relationship.notifyHasManyChanged(),this.record.updateRecordArrays()},isPolymorphic:!1,isLoaded:!1,relationship:null,meta:null,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),r&&this.relationship.notifyHasManyChanged(),this.record.updateRecordArrays()},internalRemoveRecords:function(e){for(var t,r=0;r<e.length;r++)t=this.currentState.indexOf(e[r]),this.internalReplace(t,1)},internalAddRecords:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var a;t>0&&(a=this.currentState.slice(e,e+t),this.get("relationship").removeRecords(a)),r&&this.get("relationship").addRecords(r.map(function(e){return e._internalModel}),e)},promise:null,loadingRecordsCount:function(e){this.loadingRecordsCount=e},loadedRecord:function(){this.loadingRecordsCount--,0===this.loadingRecordsCount&&(o(this,"isLoaded",!0),this.trigger("didLoad"))},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+n(this,"type"),i=t["default"].RSVP.all(this.invoke("save"),r).then(function(t){return e},null,"DS: ManyArray#save return ManyArray");return a.PromiseArray.create({promise:i})},createRecord:function(e){var t,r=n(this,"store"),a=n(this,"type");return t=r.createRecord(a.modelName,e),this.pushObject(t),t}})}),t("ember-data/-private/system/model",["exports","ember-data/-private/system/model/model","ember-data/attr","ember-data/-private/system/model/states","ember-data/-private/system/model/errors"],function(e,t,r,a,i){e.RootState=a["default"],e.attr=r["default"],e.Errors=i["default"],e["default"]=t["default"]}),t("ember-data/-private/system/model/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){var a=t["default"].get,i=t["default"].Map,n=t["default"].Mixin.create({attributes:t["default"].computed(function(){var e=i.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=i.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){a(this,"attributes").forEach(function(r,a){e.call(t,a,r)})},eachTransformedAttribute:function(e,t){a(this,"transformedAttributes").forEach(function(r,a){e.call(t,a,r)})}});e.AttrClassMethodsMixin=n;var o=t["default"].Mixin.create({eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});e.AttrInstanceMethodsMixin=o}),t("ember-data/-private/system/model/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){var a=t["default"].get,i=t["default"].set,n=t["default"].isEmpty,o=t["default"].makeArray,s=t["default"].MapWithDefault;e["default"]=t["default"].ArrayProxy.extend(t["default"].Evented,{registerHandlers:function(e,t,r){this._registerHandlers(e,t,r)},_registerHandlers:function(e,t,r){this.on("becameInvalid",e,t),this.on("becameValid",e,r)},errorsByAttributeName:t["default"].computed(function(){return s.create({defaultValue:function(){return t["default"].A()}})}),errorsFor:function(e){return a(this,"errorsByAttributeName").get(e)},messages:t["default"].computed.mapBy("content","message"),content:t["default"].computed(function(){return t["default"].A()}),unknownProperty:function(e){var t=this.errorsFor(e);return n(t)?null:t},isEmpty:t["default"].computed.not("length").readOnly(),add:function(e,t){var r=a(this,"isEmpty");this._add(e,t),r&&!a(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),a(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),a=o(t),i=new Array(a.length),n=0;n<a.length;n++){var s=a[n],d=r.findBy("message",s);d?i[n]=d:i[n]={attribute:e,message:s}}return i},remove:function(e){a(this,"isEmpty")||(this._remove(e),a(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!a(this,"isEmpty")){var t=this.rejectBy("attribute",e);i(this,"content",t),a(this,"errorsByAttributeName")["delete"](e),this.notifyPropertyChange(e)}},clear:function(){a(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!a(this,"isEmpty")){var e=a(this,"errorsByAttributeName"),r=t["default"].A();e.forEach(function(e,t){r.push(t)}),e.clear(),r.forEach(function(e){this.notifyPropertyChange(e)},this),t["default"].ArrayProxy.prototype.clear.call(this)}},has:function(e){return!n(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/system/empty-object","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,a,i,n,o,s,d){function l(e){return R[e]||(R[e]=e.split("."))}function u(e){return g[e]||(g[e]=l(e)[0])}function c(e){return function(){return m(this.currentState,e)}}function h(e,r,n,s,l){this.type=e,this.id=r,this.store=n,this._data=l||new o["default"],this.modelName=e.modelName,this.dataHasInitialized=!1,this._deferredTriggers=[],this._attributes=new o["default"],this._inFlightAttributes=new o["default"],this._relationships=new i["default"](this),this._recordArrays=void 0,this.currentState=a["default"].empty,this.recordReference=new d.RecordReference(n,this),this.references={},this.isReloading=!1,this.isError=!1,this.error=null,this.__ember_meta__=null,this[t["default"].GUID_KEY]=_++ +"internal-model",this._implicitRelationships=new o["default"]}var p=function(){function e(e,t){var r=[],a=!0,i=!1,n=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);a=!0);}catch(d){i=!0,n=d}finally{try{!a&&s["return"]&&s["return"]()}finally{if(i)throw n}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e["default"]=h;var f=t["default"].RSVP.Promise,m=t["default"].get,y=t["default"].set,v=t["default"].copy,b=t["default"].assign||t["default"].merge,g=new o["default"],R=new o["default"],_=0;h.prototype={isEmpty:c("isEmpty"),isLoading:c("isLoading"),isLoaded:c("isLoaded"),hasDirtyAttributes:c("hasDirtyAttributes"),isSaving:c("isSaving"),isDeleted:c("isDeleted"),isNew:c("isNew"),isValid:c("isValid"),dirtyType:c("dirtyType"),constructor:h,materializeRecord:function(){var e={store:this.store,_internalModel:this,id:this.id,currentState:m(this,"currentState"),isError:this.isError,adapterError:this.error};t["default"].setOwner?t["default"].setOwner(e,(0,s.getOwner)(this.store)):e.container=this.store.container,this.record=this.type._create(e),this._triggerDeferredTriggers()},recordObjectWillDestroy:function(){this.record=null},deleteRecord:function(){this.send("deleteRecord")},save:function(e){var r="DS: Model#save "+this,a=t["default"].RSVP.defer(r);return this.store.scheduleSave(this,a,e),a.promise},startedReloading:function(){this.isReloading=!0,this.record&&y(this.record,"isReloading",!0)},finishedReloading:function(){this.isReloading=!1,this.record&&y(this.record,"isReloading",!1)},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()})},getRecord:function(){return this.record||this.materializeRecord(),this.record},unloadRecord:function(){this.send("unloadRecord")},eachRelationship:function(e,t){return this.type.eachRelationship(e,t)},eachAttribute:function(e,t){return this.type.eachAttribute(e,t)},inverseFor:function(e){return this.type.inverseFor(e)},setupData:function(e){var t=this._changedKeys(e.attributes);b(this._data,e.attributes),this.pushedData(),this.record&&this.record._notifyProperties(t),this.didInitalizeData()},becameReady:function(){t["default"].run.schedule("actions",this.store.recordArrayManager,this.store.recordArrayManager.recordWasLoaded,this)},didInitalizeData:function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)},destroy:function(){return this.record?this.record.destroy():void 0},createSnapshot:function(e){return new n["default"](this,e)},loadingData:function(e){this.send("loadingData",e)},loadedData:function(){this.send("loadedData"),this.didInitalizeData()},notFound:function(){this.send("notFound")},pushedData:function(){this.send("pushedData")},flushChangedAttributes:function(){this._inFlightAttributes=this._attributes,this._attributes=new o["default"]},hasChangedAttributes:function(){return Object.keys(this._attributes).length>0},updateChangedAttributes:function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=0,a=t.length;a>r;r++){var i=t[r],n=p(e[i],2),o=n[0],s=n[1];o===s&&delete this._attributes[i]}},changedAttributes:function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,a=b(v(r),t),i=new o["default"],n=Object.keys(a),s=0,d=n.length;d>s;s++){var l=n[s];i[l]=[e[l],a[l]]}return i},adapterWillCommit:function(){this.send("willCommit")},adapterDidDirty:function(){this.send("becomeDirty"),this.updateRecordArraysLater()},send:function(e,t){var r=m(this,"currentState");return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},notifyHasManyAdded:function(e,t,r){this.record&&this.record.notifyHasManyAdded(e,t,r)},notifyHasManyRemoved:function(e,t,r){this.record&&this.record.notifyHasManyRemoved(e,t,r)},notifyBelongsToChanged:function(e,t){this.record&&this.record.notifyBelongsToChanged(e,t)},notifyPropertyChange:function(e){this.record&&this.record.notifyPropertyChange(e)},rollbackAttributes:function(){var e=Object.keys(this._attributes);this._attributes=new o["default"],m(this,"isError")&&(this._inFlightAttributes=new o["default"],this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=new o["default"]),this.send("rolledBack"),this.record._notifyProperties(e)},transitionTo:function(e){var t=u(e),r=m(this,"currentState"),a=r;do a.exit&&a.exit(this),a=a.parentState;while(!a.hasOwnProperty(t));var i,n,o=l(e),s=[],d=[];for(i=0,n=o.length;n>i;i++)a=a[o[i]],a.enter&&d.push(a),a.setup&&s.push(a);for(i=0,n=d.length;n>i;i++)d[i].enter(this);for(y(this,"currentState",a),this.record&&y(this.record,"currentState",a),i=0,n=s.length;n>i;i++)s[i].setup(this);this.updateRecordArraysLater()},_unhandledEvent:function(e,r,a){var i="Attempted to handle event `"+r+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==a&&(i+="Called with "+t["default"].inspect(a)+"."),new t["default"].Error(i)},triggerLater:function(){for(var e=arguments.length,r=new Array(e),a=0;e>a;a++)r[a]=arguments[a];1===this._deferredTriggers.push(r)&&t["default"].run.scheduleOnce("actions",this,"_triggerDeferredTriggers")},_triggerDeferredTriggers:function(){if(this.record){for(var e=0,t=this._deferredTriggers.length;t>e;e++)this.record.trigger.apply(this.record,this._deferredTriggers[e]);this._deferredTriggers.length=0}},clearRelationships:function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var a=e._relationships.get(t);a.clear(),a.destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].destroy()})},_preloadData:function(e){var t=this;Object.keys(e).forEach(function(r){var a=m(e,r),i=t.type.metaForProperty(r);i.isRelationship?t._preloadRelationship(r,a):t._data[r]=a})},_preloadRelationship:function(e,t){var r=this.type.metaForProperty(e),a=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,a):this._preloadBelongsTo(e,t,a)},_preloadHasMany:function(e,t,r){for(var a=new Array(t.length),i=0;i<t.length;i++){var n=t[i];a[i]=this._convertStringOrNumberIntoInternalModel(n,r)}this._relationships.get(e).updateRecordsFromAdapter(a)},_preloadBelongsTo:function(e,t,r){var a=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setRecord(a)},_convertStringOrNumberIntoInternalModel:function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},updateRecordArrays:function(){this._updatingRecordArraysLater=!1,this.store.dataWasUpdated(this.type,this)},setId:function(e){this.id=e,this.record.get("id")!==e&&this.record.set("id",e)},didError:function(e){this.error=e,this.isError=!0,this.record&&this.record.setProperties({isError:!0,adapterError:e})},didCleanError:function(){this.error=null,this.isError=!1,this.record&&this.record.setProperties({isError:!1,adapterError:null})},adapterDidCommit:function(e){e&&(e=e.attributes),this.didCleanError();var t=this._changedKeys(e);b(this._data,this._inFlightAttributes),e&&b(this._data,e),this._inFlightAttributes=new o["default"],this.send("didCommit"),this.updateRecordArraysLater(),e&&this.record._notifyProperties(t)},updateRecordArraysLater:function(){this._updatingRecordArraysLater||(this._updatingRecordArraysLater=!0,t["default"].run.schedule("actions",this,this.updateRecordArrays))},addErrorMessageToAttribute:function(e,t){var r=this.getRecord();m(r,"errors")._add(e,t)},removeErrorMessageFromAttribute:function(e){var t=this.getRecord();m(t,"errors")._remove(e)},clearErrorMessages:function(){var e=this.getRecord();m(e,"errors")._clear()},hasErrors:function(){var e=this.getRecord(),r=m(e,"errors");return!t["default"].isEmpty(r)},adapterDidInvalidate:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},adapterDidError:function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},_saveWasRejected:function(){for(var e=Object.keys(this._inFlightAttributes),t=0;t<e.length;t++)void 0===this._attributes[e[t]]&&(this._attributes[e[t]]=this._inFlightAttributes[e[t]]);this._inFlightAttributes=new o["default"]},_changedKeys:function(e){var r=[];if(e){var a,i,n,s,d=Object.keys(e),l=d.length;for(a=b(new o["default"],this._data),a=b(a,this._inFlightAttributes),i=0;l>i;i++)s=d[i],n=e[s],void 0===this._attributes[s]&&(t["default"].isEqual(a[s],n)||r.push(s))}return r},toString:function(){return this.record?this.record.toString():"<"+this.modelName+":"+this.id+">"},referenceFor:function(e,t){var r=this.references[t];if(!r){var a=this._relationships.get(t);"belongsTo"===e?r=new d.BelongsToReference(this.store,this,a):"hasMany"===e&&(r=new d.HasManyReference(this.store,this,a)),this.references[t]=r}return r}}}),t("ember-data/-private/system/model/model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/system/debug/debug-info","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/system/relationships/ext","ember-data/-private/system/model/attr"],function(e,t,r,a,i,n,o,s,d,l){var u=t["default"].get,c=t["default"].computed("currentState",function(e){return u(this._internalModel.currentState,e)}).readOnly(),h=t["default"].Object.extend(t["default"].Evented,{_internalModel:null,store:null,isEmpty:c,isLoading:c,isLoaded:c,hasDirtyAttributes:t["default"].computed("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:c,isDeleted:c,isNew:c,isValid:c,dirtyType:c,isError:!1,isReloading:!1,id:null,errors:t["default"].computed(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.store.serialize(this,e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:t["default"].K,didLoad:t["default"].K,didUpdate:t["default"].K,didCreate:t["default"].K,didDelete:t["default"].K,becameInvalid:t["default"].K,becameError:t["default"].K,rolledBack:t["default"].K,data:t["default"].computed.readOnly("_internalModel._data"),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,a=0,i=e.length;i>a;a++)r=e[a],
|
2
|
+
this.notifyPropertyChange(r);t["default"].endPropertyChanges()},changedAttributes:function(){return this._internalModel.changedAttributes()},rollbackAttributes:function(){this._internalModel.rollbackAttributes()},_createSnapshot:function(){return this._internalModel.createSnapshot()},toStringExtension:function(){return u(this,"id")},save:function(e){var t=this;return a.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){var e=this;return a.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){for(var r=arguments.length,a=new Array(r-1),i=1;r>i;i++)a[i-1]=arguments[i];t["default"].tryInvoke(this,e,a),this._super.apply(this,arguments)},willDestroy:function(){this._super.apply(this,arguments),this._internalModel.clearRelationships(),this._internalModel.recordObjectWillDestroy()},willMergeMixin:function(e){this.constructor},attr:function(){},belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)},setId:t["default"].observer("id",function(){this._internalModel.setId(this.get("id"))})});h.reopenClass({_create:h.create,create:function(){throw new t["default"].Error("You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.")},modelName:null}),t["default"].setOwner&&Object.defineProperty(h.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),h.reopenClass(d.RelationshipsClassMethodsMixin),h.reopenClass(l.AttrClassMethodsMixin),e["default"]=h.extend(n["default"],o.BelongsToMixin,d.DidDefinePropertyMixin,d.RelationshipsInstanceMethodsMixin,s.HasManyMixin,l.AttrInstanceMethodsMixin)}),t("ember-data/-private/system/model/states",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArraysLater()}function i(e){var t,r={};for(var a in e)t=e[a],t&&"object"==typeof t?r[a]=i(t):r[a]=t;return r}function n(e,t){for(var r in t)e[r]=t[r];return e}function o(e){var t=i(c);return n(t,e)}function s(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function d(e){}function l(e,t,r){e=n(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var a in e)e.hasOwnProperty(a)&&"parentState"!==a&&"stateName"!==a&&"object"==typeof e[a]&&(e[a]=l(e[a],e,r+"."+a));return e}var u=t["default"].get,c={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:a,loadingData:t["default"].K,propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:t["default"].K,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:a,becomeDirty:t["default"].K,pushedData:t["default"].K,unloadRecord:d,willCommit:t["default"].K,didCommit:function(e){var t=u(this,"dirtyType");e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",t)},becameInvalid:function(e){e.transitionTo("invalid"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)}},invalid:{isValid:!1,deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),a(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:t["default"].K,becomeDirty:t["default"].K,pushedData:t["default"].K,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)}}},h=o({dirtyType:"created",isNew:!0});h.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},h.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var p=o({dirtyType:"updated"});h.uncommitted.deleteRecord=s,h.invalid.deleteRecord=s,h.uncommitted.rollback=function(e){c.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},h.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},h.uncommitted.propertyWasReset=t["default"].K,p.inFlight.unloadRecord=d,p.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var f={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:t["default"].K,unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},propertyWasReset:t["default"].K,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:t["default"].K,saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:a,pushedData:t["default"].K,becomeDirty:function(e){e.transitionTo("updated.uncommitted")},willCommit:function(e){e.transitionTo("updated.inFlight")},reloadRecord:function(e,t){t(e.store.reloadRecord(e))},deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},didCommit:function(e){e.send("invokeLifecycleCallbacks",u(e,"lastDirtyType"))},notFound:t["default"].K},created:h,updated:p},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:t["default"].K,becomeDirty:t["default"].K,deleteRecord:t["default"].K,rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:d,willCommit:t["default"].K,didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)},becameInvalid:function(e){e.transitionTo("invalid"),e.triggerLater("becameInvalid",e)}},saved:{isDirty:!1,setup:function(e){e.clearRelationships();var t=e.store;t._dematerializeRecord(e)},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:t["default"].K,didCommit:t["default"].K},invalid:{isValid:!1,didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),a(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:t["default"].K,becomeDirty:t["default"].K,deleteRecord:t["default"].K,willCommit:t["default"].K,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)}};f=l(f,null,"root"),e["default"]=f}),t("ember-data/-private/system/normalize-link",["exports"],function(e){function t(e){switch(typeof e){case"object":return e;case"string":return{href:e}}return null}e["default"]=t}),t("ember-data/-private/system/normalize-model-name",["exports","ember"],function(e,t){function r(e){return t["default"].String.dasherize(e)}e["default"]=r}),t("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e["default"]=r;var a=t["default"].OrderedSet,i=t["default"].guidFor;r.create=function(){var e=this;return new e},r.prototype=Object.create(a.prototype),r.prototype.constructor=r,r.prototype._super$constructor=a,r.prototype.addWithIndex=function(e,t){var r=i(e),a=this.presenceSet,n=this.list;return a[r]!==!0?(a[r]=!0,void 0===t||null===t?n.push(e):n.splice(t,0,e),this.size+=1,this):void 0}}),t("ember-data/-private/system/promise-proxies",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e){return function(){var t=n(this,"content");return t[e].apply(t,arguments)}}var i=t["default"].RSVP.Promise,n=t["default"].get,o=t["default"].ArrayProxy.extend(t["default"].PromiseProxyMixin),s=t["default"].ObjectProxy.extend(t["default"].PromiseProxyMixin),d=function(e,t){return s.create({promise:i.resolve(e,t)})},l=function(e,t){return o.create({promise:i.resolve(e,t)})},u=o.extend({reload:function(){return u.create({promise:n(this,"content").reload()})},createRecord:a("createRecord"),on:a("on"),one:a("one"),trigger:a("trigger"),off:a("off"),has:a("has")}),c=function(e,t){return u.create({promise:i.resolve(e,t)})};e.PromiseArray=o,e.PromiseObject=s,e.PromiseManyArray=u,e.promiseArray=l,e.promiseObject=d,e.promiseManyArray=c}),t("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays","ember-data/-private/system/ordered-set"],function(e,t,r,a){function i(e){e.destroy()}function n(e){for(var r=e.length,a=t["default"].A(),i=0;r>i;i++)a=a.concat(e[i]);return a}function o(e,t){var r=e.indexOf(t);return-1!==r?(e.splice(r,1),!0):!1}var s=t["default"].MapWithDefault,d=t["default"].get;e["default"]=t["default"].Object.extend({init:function(){var e=this;this.filteredRecordArrays=s.create({defaultValue:function(){return[]}}),this.liveRecordArrays=s.create({defaultValue:function(t){return e.createRecordArray(t)}}),this.changedRecords=[],this._adapterPopulatedRecordArrays=[]},recordDidChange:function(e){1===this.changedRecords.push(e)&&t["default"].run.schedule("actions",this,this.updateRecordArrays)},recordArraysForRecord:function(e){return e._recordArrays=e._recordArrays||a["default"].create(),e._recordArrays},updateRecordArrays:function(){var e=this;this.changedRecords.forEach(function(t){d(t,"record.isDestroyed")||d(t,"record.isDestroying")||"root.deleted.saved"===d(t,"currentState.stateName")?e._recordWasDeleted(t):e._recordWasChanged(t)}),this.changedRecords.length=0},_recordWasDeleted:function(e){var t=e._recordArrays;t&&(t.forEach(function(t){return t.removeInternalModel(e)}),e._recordArrays=null)},_recordWasChanged:function(e){var t,r=this,a=e.type,i=this.filteredRecordArrays.get(a);i.forEach(function(i){t=d(i,"filterFunction"),r.updateFilterRecordArray(i,t,a,e)})},recordWasLoaded:function(e){var t,r=this,a=e.type,i=this.filteredRecordArrays.get(a);if(i.forEach(function(i){t=d(i,"filterFunction"),r.updateFilterRecordArray(i,t,a,e)}),this.liveRecordArrays.has(a)){var n=this.liveRecordArrays.get(a);this._addRecordToRecordArray(n,e)}},updateFilterRecordArray:function(e,t,r,a){var i=t(a.getRecord()),n=this.recordArraysForRecord(a);i?this._addRecordToRecordArray(e,a):(n["delete"](e),e.removeInternalModel(a))},_addRecordToRecordArray:function(e,t){var r=this.recordArraysForRecord(t);r.has(e)||(e.addInternalModel(t),r.add(e))},populateLiveRecordArray:function(e,t){for(var r,a=this.store.typeMapFor(t),i=a.records,n=0;n<i.length;n++)r=i[n],r.isDeleted()||r.isEmpty()||this._addRecordToRecordArray(e,r)},updateFilter:function(e,t,r){for(var a,i=this.store.typeMapFor(t),n=i.records,o=0;o<n.length;o++)a=n[o],a.isDeleted()||a.isEmpty()||this.updateFilterRecordArray(e,r,t,a)},liveRecordArrayFor:function(e){return this.liveRecordArrays.get(e)},createRecordArray:function(e){var a=r.RecordArray.create({type:e,content:t["default"].A(),store:this.store,isLoaded:!0,manager:this});return a},createFilteredRecordArray:function(e,a,i){var n=r.FilteredRecordArray.create({query:i,type:e,content:t["default"].A(),store:this.store,manager:this,filterFunction:a});return this.registerFilteredRecordArray(n,e,a),n},createAdapterPopulatedRecordArray:function(e,a){var i=r.AdapterPopulatedRecordArray.create({type:e,query:a,content:t["default"].A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(i),i},registerFilteredRecordArray:function(e,t,r){var a=this.filteredRecordArrays.get(t);a.push(e),this.updateFilter(e,t,r)},unregisterRecordArray:function(e){var t=e.type,r=this.filteredRecordArrays.get(t),a=o(r,e),i=o(this._adapterPopulatedRecordArrays,e);if(!a&&!i&&this.liveRecordArrays.has(t)){var n=this.liveRecordArrayFor(t);e===n&&this.liveRecordArrays["delete"](t)}},willDestroy:function(){this._super.apply(this,arguments),this.filteredRecordArrays.forEach(function(e){return n(e).forEach(i)}),this.liveRecordArrays.forEach(i),this._adapterPopulatedRecordArrays.forEach(i)}})}),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,a){e.RecordArray=t["default"],e.FilteredRecordArray=r["default"],e.AdapterPopulatedRecordArray=a["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/features"],function(e,t,r,a,i){var n=t["default"].get;e["default"]=r["default"].extend({query:null,replace:function(){var e=n(this,"type").toString();throw new Error("The result of a server query (on "+e+") is immutable.")},_update:function(){var e=n(this,"store"),t=n(this,"type.modelName"),r=n(this,"query");return e._query(t,r,this)},loadRecords:function(e,r){var i=this,n=t["default"].A(e).mapBy("_internalModel");this.setProperties({content:t["default"].A(n),isLoaded:!0,isUpdating:!1,meta:(0,a["default"])(r.meta)}),this.set("links",(0,a["default"])(r.links)),n.forEach(function(e){i.manager.recordArraysForRecord(e).add(i)}),t["default"].run.once(this,"trigger","didLoad")}})}),t("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array"],function(e,t,r){var a=t["default"].get;e["default"]=r["default"].extend({filterFunction:null,isLoaded:!0,replace:function(){var e=a(this,"type").toString();throw new Error("The result of a client-side filter (on "+e+") is immutable.")},_updateFilter:function(){var e=a(this,"manager");e.updateFilter(this,a(this,"type"),a(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,a){var i=t["default"].get,n=t["default"].set;e["default"]=t["default"].ArrayProxy.extend(t["default"].Evented,{type:null,content:null,isLoaded:!1,isUpdating:!1,store:null,objectAtContent:function(e){var t=i(this,"content"),r=t.objectAt(e);return r&&r.getRecord()},update:function(){return i(this,"isUpdating")?void 0:(this.set("isUpdating",!0),this._update())},_update:function(){var e=i(this,"store"),t=i(this,"type.modelName");return e.findAll(t,{reload:!0})},addInternalModel:function(e,t){var r=i(this,"content");void 0===t?r.addObject(e):r.contains(e)||r.insertAt(t,e)},removeInternalModel:function(e){i(this,"content").removeObject(e)},save:function(){var e=this,a="DS: RecordArray#save "+i(this,"type"),n=t["default"].RSVP.all(this.invoke("save"),a).then(function(t){return e},null,"DS: RecordArray#save return RecordArray");return r.PromiseArray.create({promise:n})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t._recordArrays;r&&r["delete"](e)})},_unregisterFromManager:function(){var e=i(this,"manager");e.unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),n(this,"content",void 0),this._super.apply(this,arguments)},createSnapshot:function(e){var t=this.get("meta");return new a["default"](this,t,e)}})}),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,a){e.RecordReference=t["default"],e.BelongsToReference=r["default"],e.HasManyReference=a["default"]}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/model","ember","ember-data/-private/system/references/reference","ember-data/-private/features","ember-data/-private/debug"],function(e,t,r,a,i,n){var o=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};o.prototype=Object.create(a["default"].prototype),o.prototype.constructor=o,o.prototype._super$constructor=a["default"],o.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},o.prototype.id=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.id},o.prototype.link=function(){return this.belongsToRelationship.link},o.prototype.meta=function(){return this.belongsToRelationship.meta},o.prototype.push=function(e){var a=this;return r["default"].RSVP.resolve(e).then(function(e){var r;return r=e instanceof t["default"]?e:a.store.push(e),a.belongsToRelationship.setCanonicalRecord(r._internalModel),r})},o.prototype.value=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.record?e.record:null},o.prototype.load=function(){var e=this;return"id"===this.remoteType()?this.belongsToRelationship.getRecord():"link"===this.remoteType()?this.belongsToRelationship.findLink().then(function(t){return e.value()}):void 0},o.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e["default"]=o}),t("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,a,i){var n=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(){var e=this.hasManyRelationship.members,t=e.toArray().map(function(e){return e.id});return t},o.prototype.meta=function(){return this.hasManyRelationship.manyArray.meta},o.prototype.push=function(e){var r=this;return t["default"].RSVP.resolve(e).then(function(e){var a=e,i=!0;"object"==typeof e&&e.data&&(a=e.data,i=a.length&&a[0].data),i=!0;var n=void 0;if(i)n=a.map(function(e){var t=r.store.push(e);return t._internalModel});else{var o=r.store.push(e);n=t["default"].A(o).mapBy("_internalModel")}return r.hasManyRelationship.computeChanges(n),r.hasManyRelationship.manyArray})},o.prototype._isLoaded=function(){var e=n(this.hasManyRelationship,"hasData");if(!e)return!1;var t=this.hasManyRelationship.members.toArray(),r=t.every(function(e){return e.isLoaded()===!0});return r},o.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},o.prototype.load=function(){if(!this._isLoaded())return this.hasManyRelationship.getRecords();var e=this.hasManyRelationship.manyArray;return t["default"].RSVP.resolve(e)},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){var a=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};a.prototype=Object.create(r["default"].prototype),a.prototype.constructor=a,a.prototype._super$constructor=r["default"],a.prototype.id=function(){return this._id},a.prototype.remoteType=function(){return"identity"},a.prototype.push=function(e){var r=this;return t["default"].RSVP.resolve(e).then(function(e){var t=r.store.push(e);return t})},a.prototype.value=function(){return this.internalModel.record},a.prototype.load=function(){return this.store.findRecord(this.type,this._id)},a.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e["default"]=a}),t("ember-data/-private/system/references/reference",["exports"],function(e){var t=function(e,t){this.store=e,this.internalModel=t};t.prototype={constructor:t},e["default"]=t}),t("ember-data/-private/system/relationship-meta",["exports","ember-inflector","ember-data/-private/system/normalize-model-name"],function(e,t,r){function a(e){var a;return a=e.type||e.key,"hasMany"===e.kind&&(a=(0,t.singularize)((0,r["default"])(a))),a}function i(e){return{key:e.key,kind:e.kind,type:a(e),options:e.options,parentType:e.parentType,isRelationship:!0}}e.typeForRelationshipMeta=a,e.relationshipFromMeta=i}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name"],function(e,t,r,a){function i(e,r){var i,n;"object"==typeof e?(i=e,n=void 0):(i=r,n=e),"string"==typeof n&&(n=(0,a["default"])(n)),i=i||{};var o={type:n,isRelationship:!0,options:i,kind:"belongsTo",key:null};return t["default"].computed({get:function(e){return i.hasOwnProperty("serialize"),i.hasOwnProperty("embedded"),this._internalModel._relationships.get(e).getRecord()},set:function(e,t){return void 0===t&&(t=null),t&&t.then?this._internalModel._relationships.get(e).setRecordPromise(t):t?this._internalModel._relationships.get(e).setRecord(t._internalModel):this._internalModel._relationships.get(e).setRecord(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e["default"]=i;var n=t["default"].Mixin.create({notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)}});e.BelongsToMixin=n}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/debug","ember-data/-private/system/relationship-meta","ember-data/-private/system/empty-object"],function(e,t,r,a,i){var n=t["default"].get,o=t["default"].Map,s=t["default"].MapWithDefault,d=t["default"].computed(function(){t["default"].testing===!0&&d._cacheable===!0&&(d._cacheable=!1);var e=new s({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var i=e.get((0,a.typeForRelationshipMeta)(r));i.push({name:t,kind:r.kind})}}),e}).readOnly(),l=t["default"].computed(function(){t["default"].testing===!0&&l._cacheable===!0&&(l._cacheable=!1);var e,r=t["default"].A();return this.eachComputedProperty(function(t,i){i.isRelationship&&(i.key=t,e=(0,a.typeForRelationshipMeta)(i),r.contains(e)||r.push(e))}),r}).readOnly(),u=t["default"].computed(function(){t["default"].testing===!0&&u._cacheable===!0&&(u._cacheable=!1);var e=o.create();return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var i=(0,a.relationshipFromMeta)(r);i.type=(0,a.typeForRelationshipMeta)(r),e.set(t,i)}}),e}).readOnly(),c=t["default"].Mixin.create({didDefineProperty:function(e,r,a){if(a instanceof t["default"].ComputedProperty){var i=a.meta();i.parentType=e.constructor}}});e.DidDefinePropertyMixin=c;var h=t["default"].Mixin.create({typeForRelationship:function(e,t){var r=n(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t["default"].computed(function(){return new i["default"]}),inverseFor:function(e,t){var r=n(this,"inverseMap");if(r[e])return r[e];var a=this._findInverseFor(e,t);return r[e]=a,a},_findInverseFor:function(e,r){function a(t,r,i){var o=i||[],s=n(r,"relationships");if(!s)return o;var d=s.get(t.modelName);return d=d.filter(function(t){var a=r.metaForProperty(t.name).options;return a.inverse?e===a.inverse:!0}),d&&o.push.apply(o,d),t.superclass&&a(t.superclass,r,o),o}var i=this.typeForRelationship(e,r);if(!i)return null;var o=this.metaForProperty(e),s=o.options;if(null===s.inverse)return null;var d,l,u;if(s.inverse)d=s.inverse,u=t["default"].get(i,"relationshipsByName").get(d),l=u.kind;else{o.type===o.parentType.modelName;var c=a(this,i);if(0===c.length)return null;var h=c.filter(function(t){var r=i.metaForProperty(t.name).options;return e===r.inverse});1===h.length&&(c=h),d=c[0].name,l=c[0].kind}return{type:i,name:d,kind:l}},relationships:d,relationshipNames:t["default"].computed(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:l,relationshipsByName:u,fields:t["default"].computed(function(){var e=o.create();return this.eachComputedProperty(function(t,r){r.isRelationship?e.set(t,r.kind):r.isAttribute&&e.set(t,"attribute")}),e}).readOnly(),eachRelationship:function(e,t){n(this,"relationshipsByName").forEach(function(r,a){e.call(t,a,r)})},eachRelatedType:function(e,t){for(var r=n(this,"relatedTypes"),a=0;a<r.length;a++){var i=r[a];e.call(t,i)}},determineRelationshipType:function(e,t){var r=e.key,a=e.kind,i=this.inverseFor(r,t),n=void 0;return i?(n=i.kind,"belongsTo"===n?"belongsTo"===a?"oneToOne":"manyToOne":"belongsTo"===a?"oneToMany":"manyToMany"):"belongsTo"===a?"oneToNone":"manyToNone"}});e.RelationshipsClassMethodsMixin=h;var p=t["default"].Mixin.create({eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return n(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)}});e.RelationshipsInstanceMethodsMixin=p}),t("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,a,i){function n(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,a["default"])(e));var i={type:e,isRelationship:!0,options:r,kind:"hasMany",key:null};return t["default"].computed({get:function(e){var t=this._internalModel._relationships.get(e);return t.getRecords()},set:function(e,r){var a=this._internalModel._relationships.get(e);return a.clear(),a.addRecords(t["default"].A(r).mapBy("_internalModel")),a.getRecords()}}).meta(i)}e["default"]=n;var o=t["default"].Mixin.create({notifyHasManyAdded:function(e){this.notifyPropertyChange(e)}});e.HasManyMixin=o}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,a,i){function n(e,t,r,a){this._super$constructor(e,t,r,a),this.record=t,this.key=a.key,this.inverseRecord=null,this.canonicalState=null}e["default"]=n,n.prototype=Object.create(i["default"].prototype),n.prototype.constructor=n,n.prototype._super$constructor=i["default"],n.prototype.setRecord=function(e){e?this.addRecord(e):this.inverseRecord&&this.removeRecord(this.inverseRecord),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype.setCanonicalRecord=function(e){e?this.addCanonicalRecord(e):this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype._super$addCanonicalRecord=i["default"].prototype.addCanonicalRecord,n.prototype.addCanonicalRecord=function(e){this.canonicalMembers.has(e)||(this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.canonicalState=e,this._super$addCanonicalRecord(e))},n.prototype._super$flushCanonical=i["default"].prototype.flushCanonical,n.prototype.flushCanonical=function(){this.inverseRecord&&this.inverseRecord.isNew()&&!this.canonicalState||(this.inverseRecord=this.canonicalState,this.record.notifyBelongsToChanged(this.key),this._super$flushCanonical())},n.prototype._super$addRecord=i["default"].prototype.addRecord,n.prototype.addRecord=function(e){this.members.has(e)||(this.inverseRecord&&this.removeRecord(this.inverseRecord),this.inverseRecord=e,this._super$addRecord(e),this.record.notifyBelongsToChanged(this.key))},n.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setRecord(t?t._internalModel:t)},n.prototype._super$removeRecordFromOwn=i["default"].prototype.removeRecordFromOwn,n.prototype.removeRecordFromOwn=function(e){this.members.has(e)&&(this.inverseRecord=null,this._super$removeRecordFromOwn(e),this.record.notifyBelongsToChanged(this.key))},n.prototype._super$removeCanonicalRecordFromOwn=i["default"].prototype.removeCanonicalRecordFromOwn,n.prototype.removeCanonicalRecordFromOwn=function(e){this.canonicalMembers.has(e)&&(this.canonicalState=null,this._super$removeCanonicalRecordFromOwn(e))},n.prototype.findRecord=function(){return this.inverseRecord?this.store._findByInternalModel(this.inverseRecord):t["default"].RSVP.Promise.resolve(null)},n.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.record,this.link,this.relationshipMeta).then(function(t){return t&&e.addRecord(t),t})},n.prototype.getRecord=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),a.PromiseObject.create({promise:t,content:this.inverseRecord?this.inverseRecord.getRecord():null})}if(null===this.inverseRecord)return null;var r=this.inverseRecord.getRecord();return r},n.prototype.reload=function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.record?this.inverseRecord.record.reload():this.findRecord()}}),t("ember-data/-private/system/relationships/state/create",["exports","ember","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to","ember-data/-private/system/empty-object"],function(e,t,r,a,i){function n(e){var t=e.options;return!(t&&null===t.inverse)}function o(e,t,i){var o=void 0,s=null;return n(t)&&(s=e.type.inverseFor(t.key,i)),s&&(o=s.name),"hasMany"===t.kind?new r["default"](i,e,o,t):new a["default"](i,e,o,t)}function s(e){this.record=e,this.initializedRelationships=new i["default"]}e["default"]=s;var d=t["default"].get;s.prototype.has=function(e){return!!this.initializedRelationships[e]},s.prototype.get=function(e){var t=this.initializedRelationships,r=d(this.record.type,"relationshipsByName");return!t[e]&&r.get(e)&&(t[e]=o(this.record,r.get(e),this.record.store)),t[e]}}),t("ember-data/-private/system/relationships/state/has-many",["exports","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/ordered-set","ember-data/-private/system/many-array"],function(e,t,r,a,i,n){function o(e,t,r,a){this._super$constructor(e,t,r,a),this.belongsToType=a.type,this.canonicalState=[],this.manyArray=n["default"].create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:t}),this.isPolymorphic=a.options.polymorphic,this.manyArray.isPolymorphic=this.isPolymorphic}function s(e){var t=new i["default"];if(e)for(var r=0,a=e.length;a>r;r++)t.add(e[r]);return t}e["default"]=o,o.prototype=Object.create(a["default"].prototype),o.prototype.constructor=o,o.prototype._super$constructor=a["default"],o.prototype.destroy=function(){
|
3
|
+
this.manyArray.destroy()},o.prototype._super$updateMeta=a["default"].prototype.updateMeta,o.prototype.updateMeta=function(e){this._super$updateMeta(e),this.manyArray.set("meta",e)},o.prototype._super$addCanonicalRecord=a["default"].prototype.addCanonicalRecord,o.prototype.addCanonicalRecord=function(e,t){this.canonicalMembers.has(e)||(void 0!==t?this.canonicalState.splice(t,0,e):this.canonicalState.push(e),this._super$addCanonicalRecord(e,t))},o.prototype._super$addRecord=a["default"].prototype.addRecord,o.prototype.addRecord=function(e,t){this.members.has(e)||(this._super$addRecord(e,t),this.manyArray.internalAddRecords([e],t))},o.prototype._super$removeCanonicalRecordFromOwn=a["default"].prototype.removeCanonicalRecordFromOwn,o.prototype.removeCanonicalRecordFromOwn=function(e,t){var r=t;this.canonicalMembers.has(e)&&(void 0===r&&(r=this.canonicalState.indexOf(e)),r>-1&&this.canonicalState.splice(r,1),this._super$removeCanonicalRecordFromOwn(e,t))},o.prototype._super$flushCanonical=a["default"].prototype.flushCanonical,o.prototype.flushCanonical=function(){this.manyArray.flushCanonical(),this._super$flushCanonical()},o.prototype._super$removeRecordFromOwn=a["default"].prototype.removeRecordFromOwn,o.prototype.removeRecordFromOwn=function(e,t){this.members.has(e)&&(this._super$removeRecordFromOwn(e,t),void 0!==t?this.manyArray.currentState.removeAt(t):this.manyArray.internalRemoveRecords([e]))},o.prototype.notifyRecordRelationshipAdded=function(e,t){this.record.notifyHasManyAdded(this.key,e,t)},o.prototype.reload=function(){var e=this,t=this.manyArray.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&this.manyArray.set("isLoaded",t)}return this.link?(this._loadingPromise=(0,r.promiseManyArray)(this.fetchLink(),"Reload with link"),this._loadingPromise):(this._loadingPromise=(0,r.promiseManyArray)(this.store.scheduleFetchMany(this.manyArray.toArray()).then(function(){return e.manyArray}),"Reload with ids"),this._loadingPromise)},o.prototype.computeChanges=function(e){var t,r,a,i=this.canonicalMembers,n=[];for(e=s(e),i.forEach(function(t){e.has(t)||n.push(t)}),this.removeCanonicalRecords(n),e=e.toArray(),t=e.length,a=0;t>a;a++)r=e[a],this.removeCanonicalRecord(r),this.addCanonicalRecord(r,a)},o.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.record,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateRecordsFromAdapter(t),e.manyArray.set("isLoaded",!0)}),e.manyArray})},o.prototype.findRecords=function(){for(var e=this,t=this.manyArray.toArray(),r=new Array(t.length),a=0;a<t.length;a++)r[a]=t[a]._internalModel;return this.store.findMany(r).then(function(){return e.manyArray.get("isDestroyed")||e.manyArray.set("isLoaded",!0),e.manyArray})},o.prototype.notifyHasManyChanged=function(){this.record.notifyHasManyAdded(this.key)},o.prototype.getRecords=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._loadingPromise=r.PromiseManyArray.create({content:this.manyArray,promise:t}),this._loadingPromise}return this.manyArray.get("isDestroyed")||this.manyArray.set("isLoaded",!0),this.manyArray}}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember","ember-data/-private/debug","ember-data/-private/system/ordered-set"],function(e,t,r,a){function i(e,t,r,i){var n=i.options.async;this.members=new a["default"],this.canonicalMembers=new a["default"],this.store=e,this.key=i.key,this.inverseKey=r,this.record=t,this.isAsync="undefined"==typeof n?!0:n,this.relationshipMeta=i,this.inverseKeyForImplicit=this.record.constructor.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}e["default"]=i,i.prototype={constructor:i,destroy:t["default"].K,updateMeta:function(e){this.meta=e},clear:function(){for(var e,t=this.members.list;t.length>0;)e=t[0],this.removeRecord(e)},removeRecords:function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})},addRecords:function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})},addCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])},addCanonicalRecord:function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.inverseKey?e._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new i(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)},removeCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])},removeCanonicalRecord:function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalRecordFromOwn(e),this.inverseKey?this.removeCanonicalRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecord(this.record)),this.flushCanonicalLater()},addRecord:function(e,t){this.members.has(e)||(this.members.addWithIndex(e,t),this.notifyRecordRelationshipAdded(e,t),this.inverseKey?e._relationships.get(this.inverseKey).addRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new i(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArraysLater()),this.setHasData(!0)},removeRecord:function(e){this.members.has(e)&&(this.removeRecordFromOwn(e),this.inverseKey?this.removeRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeRecord(this.record))},removeRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)},removeRecordFromOwn:function(e){this.members["delete"](e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()},removeCanonicalRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)},removeCanonicalRecordFromOwn:function(e){this.canonicalMembers["delete"](e),this.flushCanonicalLater()},flushCanonical:function(){this.willSync=!1;for(var e=[],t=0;t<this.members.list.length;t++)this.members.list[t].isNew()&&e.push(this.members.list[t]);for(this.members=this.canonicalMembers.copy(),t=0;t<e.length;t++)this.members.add(e[t])},flushCanonicalLater:function(){var e=this;this.willSync||(this.willSync=!0,this.store._backburner.join(function(){return e.store._backburner.schedule("syncRelationships",e,e.flushCanonical)}))},updateLink:function(e){e!==this.link&&(this.link=e,this.linkPromise=null,this.setHasLoaded(!1),this.record.notifyPropertyChange(this.key))},findLink:function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},updateRecordsFromAdapter:function(e){this.computeChanges(e),this.setHasData(!0),this.setHasLoaded(!0)},notifyRecordRelationshipAdded:t["default"].K,notifyRecordRelationshipRemoved:t["default"].K,setHasData:function(e){this.hasData=e},setHasLoaded:function(e){this.hasLoaded=e}}}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){function t(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this.type=e.get("type"),this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}e["default"]=t,t.prototype.snapshots=function(){if(this._snapshots)return this._snapshots;var e=this._recordArray;return this._snapshots=e.invoke("createSnapshot"),this._snapshots}}),t("ember-data/-private/system/snapshot",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){function a(e){var t=this,a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this._attributes=new r["default"],this._belongsToRelationships=new r["default"],this._belongsToIds=new r["default"],this._hasManyRelationships=new r["default"],this._hasManyIds=new r["default"];var n=e.getRecord();this.record=n,n.eachAttribute(function(e){return t._attributes[e]=i(n,e)}),this.id=e.id,this._internalModel=e,this.type=e.type,this.modelName=e.type.modelName,this.adapterOptions=a.adapterOptions,this.include=a.include,this._changedAttributes=n.changedAttributes()}e["default"]=a;var i=t["default"].get;a.prototype={constructor:a,id:null,record:null,type:null,modelName:null,attr:function(e){if(e in this._attributes)return this._attributes[e];throw new t["default"].Error("Model '"+t["default"].inspect(this.record)+"' has no attribute named '"+e+"' defined.")},attributes:function(){return t["default"].copy(this._attributes)},changedAttributes:function(){for(var e=new r["default"],a=Object.keys(this._changedAttributes),i=0,n=a.length;n>i;i++){var o=a[i];e[o]=t["default"].copy(this._changedAttributes[o])}return e},belongsTo:function(e,r){var a,n,o,s,d=r&&r.id;if(d&&e in this._belongsToIds)return this._belongsToIds[e];if(!d&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(a=this._internalModel._relationships.get(e),!a||"belongsTo"!==a.relationshipMeta.kind)throw new t["default"].Error("Model '"+t["default"].inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return o=i(a,"hasData"),n=i(a,"inverseRecord"),o&&(s=n&&!n.isDeleted()?d?i(n,"id"):n.createSnapshot():null),d?this._belongsToIds[e]=s:this._belongsToRelationships[e]=s,s},hasMany:function(e,r){var a,n,o,s,d=r&&r.ids;if(d&&e in this._hasManyIds)return this._hasManyIds[e];if(!d&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(a=this._internalModel._relationships.get(e),!a||"hasMany"!==a.relationshipMeta.kind)throw new t["default"].Error("Model '"+t["default"].inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return o=i(a,"hasData"),n=i(a,"members"),o&&(s=[],n.forEach(function(e){e.isDeleted()||(d?s.push(e.id):s.push(e.createSnapshot()))})),d?this._hasManyIds[e]=s:this._hasManyRelationships[e]=s,s},eachAttribute:function(e,t){this.record.eachAttribute(e,t)},eachRelationship:function(e,t){this.record.eachRelationship(e,t)},serialize:function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)}}}),t("ember-data/-private/system/store",["exports","ember","ember-data/model","ember-data/-private/debug","ember-data/-private/system/normalize-link","ember-data/-private/system/normalize-model-name","ember-data/adapters/errors","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers","ember-data/-private/system/store/finders","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/system/record-array-manager","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/model/internal-model","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,a,i,n,o,s,d,l,u,c,h,p,f,m,y,v,b){function g(e,t){var r=e.then(function(e){return e.getRecord()});return(0,s.promiseObject)(r,t)}function R(e,t,r,a){return P(a)?void 0:e._internalModelForId(a.type,a.id)}function _(e,t,r,a){if(!P(a)){for(var i=new Array(a.length),n=0;n<a.length;n++)i[n]=R(e,t,r,a[n]);return i}}function A(e){return e.serializerFor("application")}function F(e,t,r,a){var i=a._internalModel,n=a.modelName,s=t.modelFor(n),c=e[r](t,s,a),h=(0,u.serializerForAdapter)(t,e,n),p="DS: Extract and notify about "+r+" completion of "+i;return c=O.resolve(c,p),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,t)),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,i)),c.then(function(e){return t._adapterRun(function(){var n,o;e&&(n=(0,l.normalizeResponseHelper)(h,t,s,e,a.id,r),n.included&&t.push({data:n.included}),o=n.data),t.didSaveRecord(i,{data:o})}),i},function(e){if(e instanceof o.InvalidError){var r=h.extractErrors(t,s,e,a.id);t.recordWasInvalid(i,r)}else t.recordWasError(i,e);throw e},p)}function z(e,t,r){r.relationships&&t.type.eachRelationship(function(a,n){var o=n.kind;if(r.relationships[a]){var s;if(r.relationships[a].links&&r.relationships[a].links.related){var d=(0,i["default"])(r.relationships[a].links.related);d&&d.href&&(s=t._relationships.get(a),s.updateLink(d.href))}r.relationships[a].meta&&(s=t._relationships.get(a),s.updateMeta(r.relationships[a].meta)),M(e,a,n,r.relationships[a]);var l=r.relationships[a].data;void 0!==l&&("belongsTo"===o?(s=t._relationships.get(a),s.setCanonicalRecord(l)):"hasMany"===o&&(s=t._relationships.get(a),s.updateRecordsFromAdapter(l)))}})}function M(e,t,r,a){var i=a.data;if(i){var n=r.kind;"belongsTo"===n?a.data=R(e,t,r,i):"hasMany"===n&&(a.data=_(e,t,r,i))}}var S="`id` passed to `findRecord()` has to be non-empty string or number";e.badIdFormatAssertion=S;var T,k=t["default"]._Backburner,x=t["default"].Map,E=t["default"].get,w=t["default"].set,D=t["default"].run.once,P=t["default"].isNone,O=(t["default"].isPresent,t["default"].RSVP.Promise),C=t["default"].copy,I=t["default"].Service;e.Store=T=I.extend({init:function(){this._super.apply(this,arguments),this._backburner=new k(["normalizeRelationships","syncRelationships","finished"]),this.typeMaps={},this.recordArrayManager=f["default"].create({store:this}),this._pendingSave=[],this._instanceCache=new m["default"]((0,h.getOwner)(this)),this._pendingFetch=x.create()},adapter:"-json-api",serialize:function(e,t){var r=e._internalModel.createSnapshot();return r.serialize(t)},defaultAdapter:t["default"].computed("adapter",function(){var e=E(this,"adapter");return e=this.retrieveManagedInstance("adapter",e)}),createRecord:function(e,t){var r=this.modelFor(e),a=C(t)||new v["default"];P(a.id)&&(a.id=this._generateId(e,a)),a.id=(0,p["default"])(a.id);var i=this.buildInternalModel(r,a.id),n=i.getRecord();return i.loadedData(),n.setProperties(a),i.eachRelationship(function(e,t){i._relationships.get(e).setHasData(!0)}),n},_generateId:function(e,t){var r=this.adapterFor(e);return r&&r.generateIdForRecord?r.generateIdForRecord(this,e,t):null},deleteRecord:function(e){e.deleteRecord()},unloadRecord:function(e){e.unloadRecord()},find:function(e,r,a){return 1===arguments.length,"object"===t["default"].typeOf(r),this.findRecord(e,r)},findRecord:function(e,t,r){var a=this._internalModelForId(e,t);if(r=r||{},!this.hasRecordForId(e,t))return this._findByInternalModel(a,r);var i=this._findRecord(a,r);return g(i,"DS: Store#findRecord "+a.typeKey+" with id: "+E(a,"id"))},_findRecord:function(e,t){if(t.reload)return this.scheduleFetch(e,t);var r=e.createSnapshot(t),a=e.type,i=this.adapterFor(a.modelName);return i.shouldReloadRecord(this,r)?this.scheduleFetch(e,t):t.backgroundReload===!1?O.resolve(e):((t.backgroundReload||i.shouldBackgroundReloadRecord(this,r))&&this.scheduleFetch(e,t),O.resolve(e))},_findByInternalModel:function(e,t){t=t||{},t.preload&&e._preloadData(t.preload);var r=this._findEmptyInternalModel(e,t);return g(r,"DS: Store#findRecord "+e.typeKey+" with id: "+E(e,"id"))},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this.scheduleFetch(e,t):e.isLoading()?e._loadingPromise:O.resolve(e)},findByIds:function(e,r){for(var a=new Array(r.length),i=0;i<r.length;i++)a[i]=this.findRecord(e,r[i]);return(0,s.promiseArray)(t["default"].RSVP.all(a).then(t["default"].A,null,"DS: Store#findByIds of "+e+" complete"))},fetchRecord:function(e,t){var r=e.type,a=e.id,i=this.adapterFor(r.modelName),n=(0,c._find)(i,this,r,a,e,t);return n},scheduleFetchMany:function(e){for(var r=new Array(e.length),a=new Array(e.length),i=0;i<e.length;i++)r[i]=e[i]._internalModel;for(var i=0;i<r.length;i++)a[i]=this.scheduleFetch(r[i]);return t["default"].RSVP.Promise.all(a)},scheduleFetch:function(e,r){var a=e.type;if(e._loadingPromise)return e._loadingPromise;var i=t["default"].RSVP.defer("Fetching "+a+"with id: "+e.id),n={record:e,resolver:i,options:r},o=i.promise;return e.loadingData(o),this._pendingFetch.get(a)?this._pendingFetch.get(a).push(n):this._pendingFetch.set(a,[n]),t["default"].run.scheduleOnce("afterRender",this,this.flushAllPendingFetches),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch=x.create())},_flushPendingFetchForType:function(e,r){function a(e){e.resolver.resolve(d.fetchRecord(e.record,e.options))}function i(r){return r.forEach(function(r){var a=t["default"].A(e).findBy("record",r);if(a){var i=a.resolver;i.resolve(r)}}),r}function n(e){return function(r){r=t["default"].A(r);var a=e.reject(function(e){return r.contains(e)});a.length,s(a)}}function o(e){return function(t){s(e,t)}}function s(r,a){r.forEach(function(r){var i=t["default"].A(e).findBy("record",r);if(i){var n=i.resolver;n.reject(a)}})}var d=this,l=d.adapterFor(r.modelName),u=!!l.findMany&&l.coalesceFindRequests,h=t["default"].A(e).mapBy("record");if(1===e.length)a(e[0]);else if(u){var p=t["default"].A(h).invoke("createSnapshot"),f=l.groupRecordsForFindMany(this,p);f.forEach(function(s){var u=t["default"].A(s).mapBy("_internalModel"),h=t["default"].A(u),p=h.mapBy("id");if(p.length>1)(0,c._findMany)(l,d,r,p,h).then(i).then(n(h)).then(null,o(h));else if(1===p.length){var f=t["default"].A(e).findBy("record",u[0]);a(f)}})}else e.forEach(a)},getReference:function(e,t){return this._internalModelForId(e,t).recordReference},peekRecord:function(e,t){return this.hasRecordForId(e,t)?this._internalModelForId(e,t).getRecord():null},reloadRecord:function(e){var t=e.type.modelName;this.adapterFor(t),e.id;return this.scheduleFetch(e)},hasRecordForId:function(e,t){var r=this.modelFor(e),a=(0,p["default"])(t),i=this.typeMapFor(r).idToRecord[a];return!!i&&i.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=this.modelFor(e),a=(0,p["default"])(t),i=this.typeMapFor(r).idToRecord,n=i[a];return n&&i[a]||(n=this.buildInternalModel(r,a)),n},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findByInternalModel(e[r]);return O.all(t)},findHasMany:function(e,t,r){var a=this.adapterFor(e.type.modelName);return(0,c._findHasMany)(a,this,e,t,r)},findBelongsTo:function(e,t,r){var a=this.adapterFor(e.type.modelName);return(0,c._findBelongsTo)(a,this,e,t,r)},query:function(e,t){return this._query(e,t)},_query:function(e,t,r){var a=this.modelFor(e);r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(a,t);var i=this.adapterFor(e);return(0,s.promiseArray)((0,c._query)(i,this,a,t,r))},queryRecord:function(e,t){var r=this.modelFor(e),a=this.adapterFor(e);return(0,s.promiseObject)((0,c._queryRecord)(a,this,r,t))},findAll:function(e,t){var r=this.modelFor(e);return this._fetchAll(r,this.peekAll(e),t)},_fetchAll:function(e,t,r){r=r||{};var a=this.adapterFor(e.modelName),i=this.typeMapFor(e).metadata.since;if(w(t,"isUpdating",!0),r.reload)return(0,s.promiseArray)((0,c._findAll)(a,this,e,i,r));var n=t.createSnapshot(r);return a.shouldReloadAll(this,n)?(0,s.promiseArray)((0,c._findAll)(a,this,e,i,r)):r.backgroundReload===!1?(0,s.promiseArray)(O.resolve(t)):((r.backgroundReload||a.shouldBackgroundReloadAll(this,n))&&(0,c._findAll)(a,this,e,i,r),(0,s.promiseArray)(O.resolve(t)))},didUpdateAll:function(e){var t=this.recordArrayManager.liveRecordArrayFor(e);w(t,"isUpdating",!1)},peekAll:function(e){var t=this.modelFor(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.populateLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length){for(var t=this.typeMaps,r=Object.keys(t),a=new Array(r.length),i=0;i<r.length;i++)a[i]=t[r[i]].type.modelName;a.forEach(this.unloadAll,this)}else{for(var n=this.modelFor(e),o=this.typeMapFor(n),s=o.records.slice(),d=void 0,i=0;i<s.length;i++)d=s[i],d.unloadRecord(),d.destroy();o.metadata=new v["default"]}},filter:function(e,r,a){!t["default"].ENV.ENABLE_DS_FILTER;var i,n,o=arguments.length,d=3===o;return d?i=this.query(e,r):2===arguments.length&&(a=r),e=this.modelFor(e),n=d?this.recordArrayManager.createFilteredRecordArray(e,a,r):this.recordArrayManager.createFilteredRecordArray(e,a),i=i||O.resolve(n),(0,s.promiseArray)(i.then(function(){return n},null,"DS: Store#filter of "+e))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},dataWasUpdated:function(e,t){this.recordArrayManager.recordDidChange(t)},scheduleSave:function(e,t,r){var a=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:a,resolver:t}),D(this,"flushPendingSave")},flushPendingSave:function(){var e=this,t=this._pendingSave.slice();this._pendingSave=[],t.forEach(function(t){var r,a=t.snapshot,i=t.resolver,n=a._internalModel,o=e.adapterFor(n.type.modelName);return"root.deleted.saved"===E(n,"currentState.stateName")?i.resolve():(r=n.isNew()?"createRecord":n.isDeleted()?"deleteRecord":"updateRecord",void i.resolve(F(o,e,r,a)))})},didSaveRecord:function(e,t){var r;t&&(r=t.data),r&&(this._backburner.schedule("normalizeRelationships",this,"_setupRelationships",e,r),this.updateId(e,r)),e.adapterDidCommit(r)},recordWasInvalid:function(e,t){e.adapterDidInvalidate(t)},recordWasError:function(e,t){e.adapterDidError(t)},updateId:function(e,t){var r=(e.id,(0,p["default"])(t.id));this.typeMapFor(e.type).idToRecord[r]=e,e.setId(r)},typeMapFor:function(e){var r=E(this,"typeMaps"),a=t["default"].guidFor(e),i=r[a];return i?i:(i={idToRecord:new v["default"],records:[],metadata:new v["default"],type:e},r[a]=i,i)},_load:function(e){var t=this._internalModelForId(e.type,e.id);return t.setupData(e),this.recordArrayManager.recordDidChange(t),t},_modelForMixin:function(e){var t=(0,n["default"])(e),a=(0,h.getOwner)(this),i=a._lookupFactory("mixin:"+t);i&&a.register("model:"+t,r["default"].extend(i));var o=this.modelFactoryFor(t);return o&&(o.__isMixin=!0,o.__mixin=i),o},modelFor:function(e){var r=this.modelFactoryFor(e);if(r||(r=this._modelForMixin(e)),!r)throw new t["default"].Error("No model was found for '"+e+"'");return r.modelName=r.modelName||(0,n["default"])(e),r},modelFactoryFor:function(e){var t=(0,n["default"])(e),r=(0,h.getOwner)(this);return r._lookupFactory("model:"+t)},push:function(e){var t,r,a=e.included;if(a)for(t=0,r=a.length;r>t;t++)this._pushInternalModel(a[t]);if(Array.isArray(e.data)){r=e.data.length;var i=new Array(r);for(t=0;r>t;t++)i[t]=this._pushInternalModel(e.data[t]).getRecord();return i}if(null===e.data)return null;var n=this._pushInternalModel(e.data);return n.getRecord()},_hasModelFor:function(e){return!!(0,h.getOwner)(this)._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=this,r=(e.type,this._load(e));return this._backburner.join(function(){t._backburner.schedule("normalizeRelationships",t,"_setupRelationships",r,e)}),r},_setupRelationships:function(e,t){z(this,e,t)},pushPayload:function(e,t){var r,a,i=this;t?(a=t,r=this.serializerFor(e)):(a=e,r=A(this)),this._adapterRun(function(){return r.pushPayload(i,a)})},normalize:function(e,t){var r=this.serializerFor(e),a=this.modelFor(e);return r.normalize(a,t)},buildInternalModel:function(e,t,r){var a=this.typeMapFor(e),i=a.idToRecord,n=new y["default"](e,t,this,null,r);return t&&(i[t]=n),a.records.push(n),n},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_dematerializeRecord:function(e){var t=e.type,r=this.typeMapFor(t),a=e.id;e.updateRecordArrays(),a&&delete r.idToRecord[a];var i=r.records.indexOf(e);r.records.splice(i,1)},adapterFor:function(e){return this.lookupAdapter(e)},_adapterRun:function(e){return this._backburner.run(e)},serializerFor:function(e){var t=["application",this.adapterFor(e).get("defaultSerializer"),"-default"],r=this.lookupSerializer(e,t);return r},retrieveManagedInstance:function(e,t,r){var a=(0,n["default"])(t),i=this._instanceCache.get(e,a,r);return w(i,"store",this),i},lookupAdapter:function(e){return this.retrieveManagedInstance("adapter",e,this.get("_adapterFallbacks"))},_adapterFallbacks:t["default"].computed("adapter",function(){var e=this.get("adapter");return["application",e,"-json-api"]}),lookupSerializer:function(e,t){return this.retrieveManagedInstance("serializer",e,t)},willDestroy:function(){this._super.apply(this,arguments),this.recordArrayManager.destroy(),this.unloadAll()}}),e.Store=T,e["default"]=T}),t("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(void 0,t)}}function a(e,t){var r=e["finally"](function(){t()||(r._subscribers.length=0)});return r}function i(e){return!(n(e,"isDestroyed")||n(e,"isDestroying"))}e._bind=r,e._guard=a,e._objectIsAlive=i;var n=t["default"].get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){function a(e){this._owner=e,this._cache=new r["default"]}e["default"]=a;var i=t["default"].assign||t["default"].merge;a.prototype=new r["default"],i(a.prototype,{get:function(e,t,r){var a=this._cache,i=e+":"+t;if(!(i in a)){var n=this.instanceFor(i)||this._findInstance(e,r);n&&(a[i]=n)}return a[i]},_findInstance:function(e,t){for(var r=0,a=t.length;a>r;r++){var i=t[r],n=e+":"+i,o=this.instanceFor(n);if(o)return o}},instanceFor:function(e){var t=this._cache;if(!t[e]){var r=this._owner.lookup(e);r&&(t[e]=r)}return t[e]},destroy:function(){for(var e=this._cache,t=Object.keys(e),r=0,a=t.length;a>r;r++){var i=t[r],n=e[i];n&&n.destroy()}this._owner=null},constructor:a,toString:function(){return"ContainerInstanceCache"}})}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/debug","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,a,i,n){function o(e,t,r,o,s,d){var l=s.createSnapshot(d),u=e.findRecord(t,r,o,l),c=(0,n.serializerForAdapter)(t,e,s.type.modelName),h="DS: Handle Adapter#findRecord of "+r+" with id: "+o;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u.then(function(e){return t._adapterRun(function(){var a=(0,i.normalizeResponseHelper)(c,t,r,e,o,"findRecord"),n=t.push(a);return n._internalModel})},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+r+"'")}function s(e,r,o,s,d){var l=t["default"].A(d).invoke("createSnapshot"),u=e.findMany(r,o,s,l),c=(0,n.serializerForAdapter)(r,e,o.modelName),h="DS: Handle Adapter#findMany of "+o;if(void 0===u)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return r._adapterRun(function(){for(var t=(0,i.normalizeResponseHelper)(c,r,o,e,null,"findMany"),a=r.push(t),n=new Array(a.length),s=0;s<a.length;s++)n[s]=a[s]._internalModel;return n})},null,"DS: Extract payload of "+o)}function d(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findHasMany(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findHasMany of "+r+" : "+s.type;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,i.normalizeResponseHelper)(c,t,l,e,null,"findHasMany"),a=t.push(r),n=a.map(function(e){return e._internalModel});return n.meta=r.meta,n})},null,"DS: Extract payload of "+r+" : hasMany "+s.type)}function l(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findBelongsTo(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findBelongsTo of "+r+" : "+s.type;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,i.normalizeResponseHelper)(c,t,l,e,null,"findBelongsTo");if(!r.data)return null;var a=t.push(r);return a._internalModel})},null,"DS: Extract payload of "+r+" : "+s.type)}function u(e,t,r,o,s){var d=r.modelName,l=t.peekAll(d),u=l.createSnapshot(s),c=e.findAll(t,r,o,u),h=(0,n.serializerForAdapter)(t,e,d),f="DS: Handle Adapter#findAll of "+r;return c=p.resolve(c,f),c=(0,a._guard)(c,(0,a._bind)(a._objectIsAlive,t)),c.then(function(e){return t._adapterRun(function(){var a=(0,i.normalizeResponseHelper)(h,t,r,e,null,"findAll");t.push(a)}),t.didUpdateAll(r),t.peekAll(d)},null,"DS: Extract payload of findAll "+r)}function c(e,t,r,o,s){var d=r.modelName,l=e.query(t,r,o,s),u=(0,n.serializerForAdapter)(t,e,d),c="DS: Handle Adapter#query of "+r;return l=p.resolve(l,c),l=(0,a._guard)(l,(0,a._bind)(a._objectIsAlive,t)),l.then(function(e){var a,n;return t._adapterRun(function(){n=(0,i.normalizeResponseHelper)(u,t,r,e,null,"query"),a=t.push(n)}),s.loadRecords(a,n),s},null,"DS: Extract payload of query "+r)}function h(e,t,r,o){var s=r.modelName,d=e.queryRecord(t,r,o),l=(0,n.serializerForAdapter)(t,e,s),u="DS: Handle Adapter#queryRecord of "+r;return d=p.resolve(d,u),d=(0,a._guard)(d,(0,a._bind)(a._objectIsAlive,t)),d.then(function(e){var a;return t._adapterRun(function(){var n=(0,i.normalizeResponseHelper)(l,t,r,e,null,"queryRecord");a=t.push(n)}),a},null,"DS: Extract payload of queryRecord "+r)}e._find=o,e._findMany=s,e._findHasMany=d,e._findBelongsTo=l,e._findAll=u,e._query=c,e._queryRecord=h;var p=t["default"].RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(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,a,i,n){var o=e.normalizeResponse(t,r,a,i,n);return o}e.validateDocumentStructure=a,e.normalizeResponseHelper=i}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var a=t.serializer;return void 0===a&&(a=e.serializerFor(r)),null!==a&&void 0!==a||(a={extract:function(e,t,r){return r}}),a}e.serializerForAdapter=t}),t("ember-data/-private/transforms",["exports","ember-data/transform","ember-data/-private/transforms/number","ember-data/-private/transforms/date","ember-data/-private/transforms/string","ember-data/-private/transforms/boolean"],function(e,t,r,a,i,n){e.Transform=t["default"],e.NumberTransform=r["default"],e.DateTransform=a["default"],e.StringTransform=i["default"],e.BooleanTransform=n["default"]}),t("ember-data/-private/transforms/boolean",["exports","ember","ember-data/transform","ember-data/-private/features"],function(e,t,r,a){var i=t["default"].isNone;e["default"]=r["default"].extend({deserialize:function(e,t){var r=typeof e;return i(e)&&t.allowNull===!0?null:"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r?1===e:!1;
|
4
|
+
},serialize:function(e,t){return i(e)&&t.allowNull===!0?null:Boolean(e)}})}),t("ember-data/-private/transforms/date",["exports","ember-data/-private/ext/date","ember-data/transform"],function(e,t,r){e["default"]=r["default"].extend({deserialize:function(e){var r=typeof e;return"string"===r?new Date((0,t.parseDate)(e)):"number"===r?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date?e.toISOString():null}})}),t("ember-data/-private/transforms/number",["exports","ember","ember-data/transform"],function(e,t,r){function a(e){return e===e&&e!==1/0&&e!==-(1/0)}var i=t["default"].isEmpty;e["default"]=r["default"].extend({deserialize:function(e){var t;return i(e)?null:(t=Number(e),a(t)?t:null)},serialize:function(e){var t;return i(e)?null:(t=Number(e),a(t)?t:null)}})}),t("ember-data/-private/transforms/string",["exports","ember","ember-data/transform"],function(e,t,r){var a=t["default"].isNone;e["default"]=r["default"].extend({deserialize:function(e){return a(e)?null:String(e)},serialize:function(e){return a(e)?null:String(e)}})}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return i(e,"attributes").has("type")||i(e,"relationshipsByName").has("type")}function a(e){var r;return t["default"].getOwner&&(r=t["default"].getOwner(e)),!r&&e.container&&(r=e.container),r&&r.lookupFactory&&!r._lookupFactory&&(r._lookupFactory=r.lookupFactory,r.register=function(){var e=r.registry||r._registry||r;return e.register.apply(e,arguments)}),r}var i=t["default"].get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=a}),t("ember-data/-private/utils/parse-response-headers",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){return Array.isArray(e)?e:Array.from(e)}function a(e){var a=new t["default"];if(!e)return a;var n=e.split(i);return n.forEach(function(e){var t=e.split(":"),i=r(t),n=i[0],o=i.slice(1);n=n.trim(),o=o.join(":").trim(),o&&(a[n]=o)}),a}e["default"]=a;var i="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){var r=t["default"].get;e["default"]=t["default"].Object.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return r(e.record,"store").serializerFor(e.modelName).serialize(e,t)},createRecord:null,updateRecord:null,deleteRecord:null,coalesceFindRequests:!0,findMany:null,groupRecordsForFindMany:function(e,t){return[t]},shouldReloadRecord:function(e,t){return!1},shouldReloadAll:function(e,t){return!t.length},shouldBackgroundReloadRecord:function(e,t){return!0},shouldBackgroundReloadAll:function(e,t){return!0}})}),t("ember-data/adapters/errors",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,a){function i(e){var t=arguments.length<=1||void 0===arguments[1]?"Adapter operation failed":arguments[1];this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=t.message;return o(e,r)}}function o(e,t){var r=function(r,a){e.call(this,r,a||t)};return r.prototype=Object.create(e.prototype),p&&(r.extend=n(r)),r}function s(e){var r=[];return t["default"].isPresent(e)&&Object.keys(e).forEach(function(a){for(var i=t["default"].makeArray(e[a]),n=0;n<i.length;n++){var o="Invalid Attribute",s="/data/attributes/"+a;a===h&&(o="Invalid Document",s="/data"),r.push({title:o,detail:i[n],source:{pointer:s}})}}),r}function d(e){var r={};return t["default"].isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(u);t?t=t[2]:-1!==e.source.pointer.search(c)&&(t=h),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.AdapterError=i,e.errorsHashToArray=s,e.errorsArrayToHash=d;var l=t["default"].Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base",p=!1;i.prototype=Object.create(l.prototype),p&&(i.extend=n(i));var f=o(i,"The adapter rejected the commit because it was invalid");e.InvalidError=f;var m=o(i,"The adapter operation timed out");e.TimeoutError=m;var y=o(i,"The adapter operation was aborted");e.AbortError=y;var v=p?o(i,"The adapter operation is unauthorized"):null;e.UnauthorizedError=v;var b=p?o(i,"The adapter operation is forbidden"):null;e.ForbiddenError=b;var g=p?o(i,"The adapter could not find the resource"):null;e.NotFoundError=g;var R=p?o(i,"The adapter operation failed due to a conflict"):null;e.ConflictError=R;var _=p?o(i,"The adapter operation failed due to a server error"):null;e.ServerError=_}),t("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest","ember-data/-private/features"],function(e,t,r,a){var i=r["default"].extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var a=this._super.apply(this,arguments);a.contentType&&(a.contentType="application/vnd.api+json");var i=a.beforeSend;return a.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),i&&i(e)},a},coalesceFindRequests:!1,findMany:function(e,t,r,a){return this._super.apply(this,arguments)},pathForType:function(e){var r=t["default"].String.dasherize(e);return t["default"].String.pluralize(r)},updateRecord:function(e,t,r){return this._super.apply(this,arguments)}});i.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 a=e.store,i=e.type,n=e.snapshot,o={},s=a.serializerFor(i.modelName);return s.serializeIntoHash(o,i,n,{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"]=i}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/adapters/errors","ember-data/-private/adapters/build-url-mixin","ember-data/-private/features","ember-data/-private/debug","ember-data/-private/utils/parse-response-headers"],function(e,t,r,a,i,n,o,s){function d(e,t){return"function"!=typeof String.prototype.endsWith?-1!==e.indexOf(t,e.length-t.length):e.endsWith(t)}var l=t["default"].MapWithDefault,u=t["default"].get,c=r["default"].extend(i["default"],{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(2>r)return e;for(var a={},i=t.sort(),n=0;r>n;n++)a[i[n]]=e[i[n]];return a},coalesceFindRequests:!1,findRecord:function(e,t,r,a){var i=this._requestFor({store:e,type:t,id:r,snapshot:a,requestType:"findRecord"});return this._makeRequest(i)},findAll:function(e,t,r,a){var i=this.buildQuery(a),n=this._requestFor({store:e,type:t,sinceToken:r,query:i,snapshots:a,requestType:"findAll"});return this._makeRequest(n)},query:function(e,t,r){var a=this._requestFor({store:e,type:t,query:r,requestType:"query"});return this._makeRequest(a)},queryRecord:function(e,t,r){var a=this._requestFor({store:e,type:t,query:r,requestType:"queryRecord"});return this._makeRequest(a)},findMany:function(e,t,r,a){var i=this._requestFor({store:e,type:t,ids:r,snapshots:a,requestType:"findMany"});return this._makeRequest(i)},findHasMany:function(e,t,r,a){var i=this._requestFor({store:e,snapshot:t,url:r,relationship:a,requestType:"findHasMany"});return this._makeRequest(i)},findBelongsTo:function(e,t,r,a){var i=this._requestFor({store:e,snapshot:t,url:r,relationship:a,requestType:"findBelongsTo"});return this._makeRequest(i)},createRecord:function(e,t,r){var a=this._requestFor({store:e,type:t,snapshot:r,requestType:"createRecord"});return this._makeRequest(a)},updateRecord:function(e,t,r){var a=this._requestFor({store:e,type:t,snapshot:r,requestType:"updateRecord"});return this._makeRequest(a)},deleteRecord:function(e,t,r){var a=this._requestFor({store:e,type:t,snapshot:r,requestType:"deleteRecord"});return this._makeRequest(a)},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),a=r.split("/"),i=a[a.length-1],n=t.id;return decodeURIComponent(i)===n?a[a.length-1]="":d(i,"?id="+n)&&(a[a.length-1]=i.substring(0,i.length-n.length-1)),a.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,a){var n=i._stripIDFromURL(e,t[0]),o=0,s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+a;n.length+o+t>=r&&(o=0,s.push([])),o+=t;var i=s.length-1;s[i].push(e)}),s}var a=l.create({defaultValue:function(){return[]}}),i=this,n=this.maxURLLength;t.forEach(function(t){var r=i._stripIDFromURL(e,t);a.get(r).push(t)});var o=[];return a.forEach(function(e,t){var a="&ids%5B%5D=".length,i=r(e,n,a);i.forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,i){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new a.InvalidError(r.errors);var n=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,i);return new a.AdapterError(n,o)},isSuccess:function(e,t,r){return e>=200&&300>e||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,r,i){var n=this,o={url:e,method:r};return new t["default"].RSVP.Promise(function(d,l){var u=n.ajaxOptions(e,r,i);u.success=function(e,r,a){var i=n.handleResponse(a.status,(0,s["default"])(a.getAllResponseHeaders()),e,o);i&&i.isAdapterError?t["default"].run.join(null,l,i):t["default"].run.join(null,d,i)},u.error=function(e,r,i){var d=void 0;d=i instanceof Error?i:"timeout"===r?new a.TimeoutError:"abort"===r?new a.AbortError:n.handleResponse(e.status,(0,s["default"])(e.getAllResponseHeaders()),n.parseErrorResponse(e.responseText)||i,o),t["default"].run.join(null,l,d)},n._ajaxRequest(u)},"DS: RESTAdapter#ajax "+r+" to "+e)},_ajaxRequest:function(e){t["default"].$.ajax(e)},ajaxOptions:function(e,t,r){var a=r||{};a.url=e,a.type=t,a.dataType="json",a.context=this,a.data&&"GET"!==t&&(a.contentType="application/json; charset=utf-8",a.data=JSON.stringify(a.data));var i=u(this,"headers");return void 0!==i&&(a.beforeSend=function(e){Object.keys(i).forEach(function(t){return e.setRequestHeader(t,i[t])})}),a},parseErrorResponse:function(e){var r=e;try{r=t["default"].$.parseJSON(e)}catch(a){}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,a){var i,n=t["Content-Type"]||"Empty Content-Type";i="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r;var o=a.method+" "+a.url,s="Payload ("+n+")";return["Ember Data Request "+o+" returned a "+e,s,i].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t}});c.reopen({dataForRequest:function(e){var t=e.store,r=e.type,a=e.snapshot,i=e.requestType,n=e.query;r=r||a&&a.type;var o=t.serializerFor(r.modelName),s={};switch(i){case"createRecord":o.serializeIntoHash(s,r,a,{includeId:!0});break;case"updateRecord":o.serializeIntoHash(s,r,a);break;case"findRecord":s=this.buildQuery(a);break;case"findAll":e.sinceToken&&(n=n||{},n.since=e.sinceToken),s=n;break;case"query":case"queryRecord":this.sortQueryParams&&(n=this.sortQueryParams(n)),s=n;break;case"findMany":s={ids:e.ids};break;default:s=void 0}return s},methodForRequest:function(e){var t=e.requestType;switch(t){case"createRecord":return"POST";case"updateRecord":return"PUT";case"deleteRecord":return"DELETE"}return"GET"},urlForRequest:function(e){var t=e.type,r=e.id,a=e.ids,i=e.snapshot,n=e.snapshots,o=e.requestType,s=e.query;switch(t=t||i&&i.type,r=r||i&&i.id,o){case"findAll":return this.buildURL(t.modelName,null,n,o);case"query":case"queryRecord":return this.buildURL(t.modelName,null,null,o,s);case"findMany":return this.buildURL(t.modelName,a,n,o);case"findHasMany":case"findBelongsTo":var d=this.buildURL(t.modelName,r,i,o);return this.urlPrefix(e.url,d)}return this.buildURL(t.modelName,r,i,o,s)},headersForRequest:function(e){return this.get("headers")},_requestFor:function(e){var t=this.methodForRequest(e),r=this.urlForRequest(e),a=this.headersForRequest(e),i=this.dataForRequest(e);return{method:t,url:r,headers:a,data:i}},_requestToJQueryAjaxHash:function(e){var t={};t.type=e.method,t.url=e.url,t.dataType="json",t.context=this,e.data&&("GET"!==e.type?(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),n=e.method,o=e.url,d={method:n,url:o};return new t["default"].RSVP.Promise(function(e,n){i.success=function(i,o,l){var u=r.handleResponse(l.status,(0,s["default"])(l.getAllResponseHeaders()),i,d);u instanceof a.AdapterError?t["default"].run.join(null,n,u):t["default"].run.join(null,e,u)},i.error=function(e,i,o){var l=void 0;l=o instanceof Error?o:"timeout"===i?new a.TimeoutError:"abort"===i?new a.AbortError:r.handleResponse(e.status,(0,s["default"])(e.getAllResponseHeaders()),r.parseErrorResponse(e.responseText)||o,d),t["default"].run.join(null,n,l)},r._ajaxRequest(i)},"DS: RESTAdapter#makeRequest: "+n+" "+o)}}),e["default"]=c}),t("ember-data/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var a=t.defaultValue;return a}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 o(e,r){"object"==typeof e?(r=e,e=void 0):r=r||{};var o={type:e,isAttribute:!0,options:r};return t["default"].computed({get:function(e){var t=this._internalModel;return i(t,e)?n(t,e):a(this,r,e)},set:function(e,t){var r,a=this._internalModel,i=n(a,e);return t!==i&&(a._attributes[e]=t,r=e in a._inFlightAttributes?a._inFlightAttributes[e]:a._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:i,originalValue:r,value:t})),t}}).meta(o)}e["default"]=o}),t("ember-data",["exports","ember","ember-data/-private/debug","ember-data/-private/features","ember-data/-private/global","ember-data/-private/core","ember-data/-private/system/normalize-model-name","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/store","ember-data/-private/system/model","ember-data/model","ember-data/-private/system/snapshot","ember-data/adapter","ember-data/serializer","ember-data/-private/system/debug","ember-data/adapters/errors","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/adapters","ember-data/-private/adapters/build-url-mixin","ember-data/-private/serializers","ember-inflector","ember-data/serializers/embedded-records-mixin","ember-data/-private/transforms","ember-data/relationships","ember-data/setup-container","ember-data/-private/instance-initializers/initialize-store-service","ember-data/-private/system/container-proxy","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,a,i,n,o,s,d,l,u,c,h,p,f,m,y,v,b,g,R,_,A,F,z,M,S,T,k,x,E){if(t["default"].VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new t["default"].Error("Ember Data requires at least Ember 1.13.0, but you have "+t["default"].VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");n["default"].Store=l.Store,n["default"].PromiseArray=d.PromiseArray,n["default"].PromiseObject=d.PromiseObject,n["default"].PromiseManyArray=d.PromiseManyArray,n["default"].Model=c["default"],n["default"].RootState=u.RootState,n["default"].attr=u.attr,n["default"].Errors=u.Errors,n["default"].InternalModel=s["default"],n["default"].Snapshot=h["default"],n["default"].Adapter=p["default"],n["default"].AdapterError=y.AdapterError,n["default"].InvalidError=y.InvalidError,n["default"].TimeoutError=y.TimeoutError,n["default"].AbortError=y.AbortError,n["default"].errorsHashToArray=y.errorsHashToArray,n["default"].errorsArrayToHash=y.errorsArrayToHash,n["default"].Serializer=f["default"],n["default"].DebugAdapter=m["default"],n["default"].RecordArray=v.RecordArray,n["default"].FilteredRecordArray=v.FilteredRecordArray,n["default"].AdapterPopulatedRecordArray=v.AdapterPopulatedRecordArray,n["default"].ManyArray=b["default"],n["default"].RecordArrayManager=g["default"],n["default"].RESTAdapter=R.RESTAdapter,n["default"].BuildURLMixin=_["default"],n["default"].RESTSerializer=A.RESTSerializer,n["default"].JSONSerializer=A.JSONSerializer,n["default"].JSONAPIAdapter=R.JSONAPIAdapter,n["default"].JSONAPISerializer=A.JSONAPISerializer,n["default"].Transform=M.Transform,n["default"].DateTransform=M.DateTransform,n["default"].StringTransform=M.StringTransform,n["default"].NumberTransform=M.NumberTransform,n["default"].BooleanTransform=M.BooleanTransform,n["default"].EmbeddedRecordsMixin=z["default"],n["default"].belongsTo=S.belongsTo,n["default"].hasMany=S.hasMany,n["default"].Relationship=E["default"],n["default"].ContainerProxy=x["default"],n["default"]._setupContainer=T["default"],n["default"]._initializeStoreService=k["default"],Object.defineProperty(n["default"],"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:o["default"]}),Object.defineProperty(i["default"],"DS",{configurable:!0,get:function(){return n["default"]}}),e["default"]=n["default"]}),t("ember-data/model",["exports","ember-data/-private/system/model"],function(e,t){e["default"]=t["default"]}),t("ember-data/relationships",["exports","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many"],function(e,t,r){e.belongsTo=t["default"],e.hasMany=r["default"]}),t("ember-data/serializer",["exports","ember"],function(e,t){e["default"]=t["default"].Object.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,a){function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var n=t["default"].get,o=t["default"].set,s=t["default"].String.camelize;e["default"]=t["default"].Mixin.create({normalize:function(e,t,r){var a=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,a)},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 a=r.key;if(this.noSerializeOptionSpecified(a))return void this._super(e,t,r);var i,n=this.hasSerializeIdsOption(a),o=this.hasSerializeRecordsOption(a),s=e.belongsTo(a);n?(i=this.keyForRelationship(a,r.kind,"serialize"),s?(t[i]=s.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[i]=null):o&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var a=e.belongsTo(r.key),i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),a?(t[i]=a.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,a,r,t[i]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[i]=null},serializeHasMany:function(e,t,r){var a=r.key;if(this.noSerializeOptionSpecified(a))return void this._super(e,t,r);if(this.hasSerializeIdsOption(a)){var i=this.keyForRelationship(a,r.kind,"serialize");t[i]=e.hasMany(a,{ids:!0})}else this.hasSerializeRecordsOption(a)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(a)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,r,a){var i=this.keyForAttribute(a.key,"serialize"),n=e.hasMany(a.key);r[i]=t["default"].A(n).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),t[a]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,r){for(var a=e.hasMany(r.key),i=t["default"].A(a),n=new Array(i.length),o=0;o<i.length;o++){var s=i[o],d=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,d),n[o]=d}return n},removeEmbeddedForeignKey:function(e,t,r,a){if("hasMany"!==r.kind&&"belongsTo"===r.kind){var i=e.type.inverseFor(r.key,this.store);if(i){var n=i.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(n,i.kind,"deserialize");s&&delete a[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[s(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,a){var i=this;return r.eachRelationship(function(r,n){e.hasDeserializeRecordsOption(r)&&("hasMany"===n.kind&&i._extractEmbeddedHasMany(t,r,a,n),"belongsTo"===n.kind&&i._extractEmbeddedBelongsTo(t,r,a,n))}),a},_extractEmbeddedHasMany:function(e,t,r,a){var s=n(r,"data.relationships."+t+".data");if(s){for(var d=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=this._normalizeEmbeddedRelationship(e,a,u),h=c.data,p=c.included;if(r.included=r.included||[],r.included.push(h),p){var f;(f=r.included).push.apply(f,i(p))}d[l]={id:h.id,type:h.type}}var m={data:d};o(r,"data.relationships."+t,m)}},_extractEmbeddedBelongsTo:function(e,t,r,a){var s=n(r,"data.relationships."+t+".data");if(s){var d=this._normalizeEmbeddedRelationship(e,a,s),l=d.data,u=d.included;if(r.included=r.included||[],r.included.push(l),u){var c;(c=r.included).push.apply(c,i(u))}var h={id:l.id,type:l.type},p={data:h};o(r,"data.relationships."+t,p)}},_normalizeEmbeddedRelationship:function(e,t,r){var a=t.type;t.options.polymorphic&&(a=r.type);var i=e.modelFor(a),n=e.serializerFor(a);return n.normalize(i,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/features"],function(e,t,r,a,i,n,o){var s=t["default"].String.dasherize,d=a["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),a=0;a<e.data.length;a++){var i=e.data[a];r[a]=this._normalizeResourceHelper(i)}e.data=r}if(Array.isArray(e.included)){for(var r=new Array(e.included.length),a=0;a<e.included.length;a++){var n=e.included[a];r[a]=this._normalizeResourceHelper(n)}e.included=r}return e},_normalizeRelationshipDataHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);return e.type=t,e},_normalizeResourceHelper:function(e){var t=void 0,r=void 0;if(t=this.modelNameFromPayloadKey(e.type),r="modelNameFromPayloadKey",!this.store._hasModelFor(t))return null;var a=this.store.modelFor(t),i=this.store.serializerFor(t),n=i.normalize(a,e),o=n.data;return o},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);e.push(r)},_normalizeResponse:function(e,t,r,a,i,n){var o=this._normalizeDocumentHelper(r);return o},normalizeQueryRecordResponse:function(){var e=this._super.apply(this,arguments);return e},extractAttributes:function(e,t){var r=this,a={};return t.attributes&&e.eachAttribute(function(e){var i=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[i]&&(a[e]=t.attributes[i])}),a},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),a=0;a<e.data.length;a++){var i=e.data[a];r[a]=this._normalizeRelationshipDataHelper(i)}e.data=r}return e},extractRelationships:function(e,t){var r=this,a={};return t.relationships&&e.eachRelationship(function(e,i){var n=r.keyForRelationship(e,i.kind,"deserialize");if(void 0!==t.relationships[n]){var o=t.relationships[n];a[e]=r.extractRelationship(o)}}),a},_extractType:function(e,t){return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,i["default"])(e))},payloadKeyFromModelName:function(e){return(0,n.pluralize)(e)},normalize:function(e,t){t.attributes&&this.normalizeUsingDeclaredMapping(e,t.attributes),t.relationships&&this.normalizeUsingDeclaredMapping(e,t.relationships);var r={id:this.extractId(e,t),type:this._extractType(e,t),attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)};return this.applyTransforms(e,r.attributes),{data:r}},keyForAttribute:function(e,t){return s(e)},keyForRelationship:function(e,t,r){return s(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),a=void 0;return a=this.payloadKeyFromModelName(e.modelName),r.type=a,{data:r}},serializeAttribute:function(e,t,r,a){var i=a.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var n=e.attr(r);if(i){var o=this.transformFor(i);n=o.serialize(n)}var s=this._getMappedKey(r,e.type);s===r&&(s=this.keyForAttribute(r,"serialize")),t.attributes[s]=n}},serializeBelongsTo:function(e,t,r){var a=r.key;if(this._canSerialize(a)){var i=e.belongsTo(a);if(void 0!==i){t.relationships=t.relationships||{};var n=this._getMappedKey(a,e.type);n===a&&(n=this.keyForRelationship(a,"belongsTo","serialize"));var o=null;if(i){var s=void 0;s=this.payloadKeyFromModelName(i.modelName),o={type:s,id:i.id}}t.relationships[n]={data:o}}}},serializeHasMany:function(e,t,r){var a=r.key,i="_shouldSerializeHasMany";if(this[i](e,a,r)){var n=e.hasMany(a);if(void 0!==n){t.relationships=t.relationships||{};var o=this._getMappedKey(a,e.type);o===a&&this.keyForRelationship&&(o=this.keyForRelationship(a,"hasMany","serialize"));for(var s=new Array(n.length),d=0;d<n.length;d++){var l=n[d],u=void 0;u=this.payloadKeyFromModelName(l.modelName),s[d]={type:u,id:l.id}}t.relationships[o]={data:s}}}}});e["default"]=d}),t("ember-data/serializers/json",["exports","ember","ember-data/-private/debug","ember-data/serializer","ember-data/-private/system/coerce-id","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/features","ember-data/adapters/errors"],function(e,t,r,a,i,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t["default"].get,c=t["default"].isNone,h=t["default"].assign||t["default"].merge,p=a["default"].extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,a=u(e,"attributes");return e.eachTransformedAttribute(function(e,i){if(void 0!==t[e]){var n=r.transformFor(i),o=a.get(e);t[e]=n.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,a,i){switch(i){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,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,a,i){return this._normalizeResponse(e,t,r,a,i,!0)},normalizeArrayResponse:function(e,t,r,a,i){return this._normalizeResponse(e,t,r,a,i,!1)},_normalizeResponse:function(e,t,r,a,i,n){var o={data:null,included:[]},s=this.extractMeta(e,t,r);if(s&&(o.meta=s),n){var d=this.normalize(t,r),u=d.data,c=d.included;o.data=u,c&&(o.included=c)}else{for(var h=new Array(r.length),p=0,f=r.length;f>p;p++){var m=r[p],y=this.normalize(t,m),u=y.data,c=y.included;if(c){var v;(v=o.included).push.apply(v,l(c))}h[p]=u}o.data=h}return o},normalize:function(e,r){var a=null;return r&&(this.normalizeUsingDeclaredMapping(e,r),"object"===t["default"].typeOf(r.links)&&this.normalizeUsingDeclaredMapping(e,r.links),a={id:this.extractId(e,r),type:e.modelName,attributes:this.extractAttributes(e,r),relationships:this.extractRelationships(e,r)},this.applyTransforms(e,a.attributes)),{data:a}},extractId:function(e,t){var r=u(this,"primaryKey"),a=t[r];return(0,i["default"])(a)},extractAttributes:function(e,t){var r,a=this,i={};return e.eachAttribute(function(e){r=a.keyForAttribute(e,"deserialize"),void 0!==t[r]&&(i[e]=t[r])}),i},extractRelationship:function(e,r){if(t["default"].isNone(r))return null;if("object"===t["default"].typeOf(r)){r.id&&(r.id=(0,i["default"])(r.id));var a=this.store.modelFor(e);return r.type&&!(0,o.modelHasAttributeOrRelationshipNamedType)(a)&&(r.type=this.modelNameFromPayloadKey(r.type)),r}return{id:(0,i["default"])(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var a=this,i={};return e.eachRelationship(function(e,n){var o=null,s=a.keyForRelationship(e,n.kind,"deserialize");if(void 0!==r[s]){var d=null,l=r[s];if("belongsTo"===n.kind)d=n.options.polymorphic?a.extractPolymorphicRelationship(n.type,l,{key:e,resourceHash:r,relationshipMeta:n}):a.extractRelationship(n.type,l);else if("hasMany"===n.kind&&!t["default"].isNone(l)){d=new Array(l.length);for(var u=0,c=l.length;c>u;u++){var h=l[u];d[u]=a.extractRelationship(n.type,h)}}o={data:d}}var p=a.keyForLink(e,n.kind);if(r.links&&void 0!==r.links[p]){var f=r.links[p];o=o||{},o.links={related:f}}o&&(i[e]=o)}),i},modelNameFromPayloadKey:function(e){return(0,n["default"])(e)},normalizeAttributes:function(e,t){var r,a=this;this.keyForAttribute&&e.eachAttribute(function(e){r=a.keyForAttribute(e,"deserialize"),e!==r&&void 0!==t[r]&&(t[e]=t[r],
|
5
|
+
delete t[r])})},normalizeRelationships:function(e,t){var r,a=this;this.keyForRelationship&&e.eachRelationship(function(e,i){r=a.keyForRelationship(e,i.kind,"deserialize"),e!==r&&void 0!==t[r]&&(t[e]=t[r],delete t[r])})},normalizeUsingDeclaredMapping:function(e,t){var r,a,i,n=u(this,"attrs");if(n)for(i in n)r=a=this._getMappedKey(i,e),void 0!==t[a]&&(u(e,"attributes").has(i)&&(r=this.keyForAttribute(i)),u(e,"relationshipsByName").has(i)&&(r=this.keyForRelationship(i)),a!==r&&(t[r]=t[a],delete t[a]))},_getMappedKey:function(e,t){var r,a=u(this,"attrs");return a&&a[e]&&(r=a[e],r.key&&(r=r.key),"string"==typeof r&&(e=r)),e},_canSerialize:function(e){var t=u(this,"attrs");return!t||!t[e]||t[e].serialize!==!1},_mustSerialize:function(e){var t=u(this,"attrs");return t&&t[e]&&t[e].serialize===!0},shouldSerializeHasMany:function(e,t,r){return this._shouldSerializeHasMany!==p.prototype._shouldSerializeHasMany,this._shouldSerializeHasMany(e,t,r)},_shouldSerializeHasMany:function(e,t,r){var a=e.type.determineRelationshipType(r,this.store);return this._mustSerialize(t)?!0:this._canSerialize(t)&&("manyToNone"===a||"manyToMany"===a)},serialize:function(e,t){var r=this,a={};if(t&&t.includeId){var i=e.id;i&&(a[u(this,"primaryKey")]=i)}return e.eachAttribute(function(t,i){r.serializeAttribute(e,a,t,i)}),e.eachRelationship(function(t,i){"belongsTo"===i.kind?r.serializeBelongsTo(e,a,i):"hasMany"===i.kind&&r.serializeHasMany(e,a,i)}),a},serializeIntoHash:function(e,t,r,a){h(e,this.serialize(r,a))},serializeAttribute:function(e,t,r,a){var i=a.type;if(this._canSerialize(r)){var n=e.attr(r);if(i){var o=this.transformFor(i);n=o.serialize(n,a.options)}var s=this._getMappedKey(r,e.type);s===r&&this.keyForAttribute&&(s=this.keyForAttribute(r,"serialize")),t[s]=n}},serializeBelongsTo:function(e,t,r){var a=r.key;if(this._canSerialize(a)){var i=e.belongsTo(a,{id:!0}),n=this._getMappedKey(a,e.type);n===a&&this.keyForRelationship&&(n=this.keyForRelationship(a,"belongsTo","serialize")),c(i)?t[n]=null:t[n]=i,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var a=r.key,i="_shouldSerializeHasMany";if(this[i](e,a,r)){var n=e.hasMany(a,{ids:!0});if(void 0!==n){var o=this._getMappedKey(a,e.type);o===a&&this.keyForRelationship&&(o=this.keyForRelationship(a,"hasMany","serialize")),t[o]=n}}},serializePolymorphicType:t["default"].K,extractMeta:function(e,t,r){if(r&&void 0!==r.meta){var a=r.meta;return delete r.meta,a}},extractErrors:function(e,t,r,a){var i=this;return r&&"object"==typeof r&&r.errors&&(r=(0,d.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=i.keyForAttribute(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=i.keyForRelationship(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var r=(0,o.getOwner)(this).lookup("transform:"+e);return r}});e["default"]=p}),t("ember-data/serializers/rest",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/system/coerce-id","ember-data/-private/utils","ember-data/-private/features"],function(e,t,r,a,i,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t["default"].String.camelize,c=a["default"].extend({keyForPolymorphicType:function(e,t,r){var a=this.keyForRelationship(e);return a+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,r,a,i){var n=this,o={data:[],included:[]},s=e.modelFor(r),d=e.serializerFor(r);return t["default"].makeArray(a).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,i,s,d),a=r.data,u=r.included;if(o.data.push(a),u){var c;(c=o.included).push.apply(c,l(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,a,i){var n=i,o=a,d=(0,s.modelHasAttributeOrRelationshipNamedType)(a);if(!d&&t.type){var l=void 0;l=this.modelNameFromPayloadKey(t.type),e._hasModelFor(l)&&(n=e.serializerFor(l),o=e.modelFor(l))}return n.normalize(o,t,r)},_normalizeResponse:function(e,r,a,i,n,s){var d={data:null,included:[]},u=this.extractMeta(e,r,a);u&&(d.meta=u);for(var c=Object.keys(a),h=0,p=c.length;p>h;h++){var f=c[h],m=f,y=!1;"_"===f.charAt(0)&&(y=!0,m=f.substr(1));var v=this.modelNameFromPayloadKey(m);if(e.modelFactoryFor(v)){var b=!y&&this.isPrimaryType(e,v,r),g=a[f];if(null!==g)if(b&&"array"!==t["default"].typeOf(g)){var R=this._normalizePolymorphicRecord(e,g,f,r,this),_=R.data,A=R.included;if(d.data=_,A){var F;(F=d.included).push.apply(F,l(A))}}else{var z=this._normalizeArray(e,v,g,f),M=z.data,S=z.included;if(S){var T;(T=d.included).push.apply(T,l(S))}if(s)M.forEach(function(e){var t=b&&(0,o["default"])(e.id)===i,r=b&&!i&&!d.data;r||t?d.data=e:d.included.push(e)});else if(b)d.data=M;else if(M){var k;(k=d.included).push.apply(k,l(M))}}}}return d},isPrimaryType:function(e,t,r){var a=e.modelFor(t);return a.modelName===r.modelName},pushPayload:function(e,r){var a={data:[],included:[]};for(var i in r){var n=this.modelNameFromPayloadKey(i);if(e.modelFactoryFor(n)){var o=e.modelFor(n),s=e.serializerFor(o.modelName);t["default"].makeArray(r[i]).forEach(function(e){var t=s.normalize(o,e,i),r=t.data,n=t.included;if(a.data.push(r),n){var d;(d=a.included).push.apply(d,l(n))}})}}e.push(a)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,i["default"])(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,a){var i=this.payloadKeyFromModelName(t.modelName);e[i]=this.serialize(r,a)},payloadKeyFromModelName:function(e){return u(e)},serializePolymorphicType:function(e,r,a){var i=a.key,n=e.belongsTo(i),o=this.keyForPolymorphicType(i,a.type,"serialize");i=this.keyForAttribute?this.keyForAttribute(i,"serialize"):i,i+="Type",i!==o&&this.keyForPolymorphicType===c.prototype.keyForPolymorphicType&&(o=i),t["default"].isNone(n)?r[o]=null:r[o]=u(n.modelName)},extractPolymorphicRelationship:function(e,t,r){var a=r.key,i=r.resourceHash,n=r.relationshipMeta,o=n.options.polymorphic,s=this.keyForPolymorphicType(a,e,"deserialize");if(o&&void 0!==i[s]&&"object"!=typeof t){var d=this.modelNameFromPayloadKey(i[s]);return{id:t,type:d}}return this._super.apply(this,arguments)}});e["default"]=c}),t("ember-data/setup-container",["exports","ember-data/-private/initializers/store","ember-data/-private/initializers/transforms","ember-data/-private/initializers/store-injections","ember-data/-private/initializers/data-adapter"],function(e,t,r,a,i){function n(e){(0,i["default"])(e),(0,r["default"])(e),(0,a["default"])(e),(0,t["default"])(e)}e["default"]=n}),t("ember-data/store",["exports","ember-data/-private/system/store"],function(e,t){e["default"]=t["default"]}),t("ember-data/transform",["exports","ember"],function(e,t){e["default"]=t["default"].Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e["default"]="2.7.0-beta.1"}),t("ember-inflector",["exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,a,i){a.Inflector.defaultRules=a.defaultRules,r["default"].Inflector=a.Inflector,r["default"].String.pluralize=a.pluralize,r["default"].String.singularize=a.singularize,e["default"]=a.Inflector,e.pluralize=a.pluralize,e.singularize=a.singularize,e.defaultRules=a.defaultRules,"undefined"!=typeof t&&t.amd?t("ember-inflector",["exports"],function(e){return e["default"]=a.Inflector,a.Inflector}):"undefined"!=typeof module&&module.exports&&(module.exports=a.Inflector)}),t("ember-inflector/lib/ext/string",["exports","ember","ember-inflector/lib/system/string"],function(e,t,r){(t["default"].EXTEND_PROTOTYPES===!0||t["default"].EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,r.pluralize)(this)},String.prototype.singularize=function(){return(0,r.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e["default"]=(0,r["default"])(function(e){var r=void 0,a=void 0;return 1===e.length?(a=e[0],(0,t.pluralize)(a)):(r=e[0],a=e[1],1!==parseFloat(r)&&(a=(0,t.pluralize)(a)),r+" "+a)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e["default"]=(0,r["default"])(function(e){return(0,t.singularize)(e[0])})}),t("ember-inflector/lib/system",["exports","ember-inflector/lib/system/inflector","ember-inflector/lib/system/string","ember-inflector/lib/system/inflections"],function(e,t,r,a){t["default"].inflector=new t["default"](a["default"]),e.Inflector=t["default"],e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=a["default"]}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e["default"]={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status)$/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)(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,a=t.length;a>r;r++)e.uncountable[t[r].toLowerCase()]=!0}function a(e,t){for(var r,a=0,i=t.length;i>a;a++)r=t[a],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 i(e){e=e||{},e.uncountable=e.uncountable||n(),e.irregularPairs=e.irregularPairs||n();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};r(t,e.uncountable),a(t,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}var o=t["default"].String.capitalize,s=/^\s*$/,d=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,u=/[A-Z][a-z\d]*$/;if(!Object.create&&!Object.create(null).hasOwnProperty)throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");i.prototype={enableCache:function(){this.purgeCache(),this.singularize=function(e){return this._cacheUsed=!0,this._sCache[e]||(this._sCache[e]=this._singularize(e))},this.pluralize=function(e){return this._cacheUsed=!0,this._pCache[e]||(this._pCache[e]=this._pluralize(e))}},purgeCache:function(){this._cacheUsed=!1,this._sCache=n(),this._pCache=n()},disableCache:function(){this._sCache=null,this._pCache=null,this.singularize=function(e){return this._singularize(e)},this.pluralize=function(e){return this._pluralize(e)}},plural:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.plurals.push([e,t.toLowerCase()])},singular:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.singular.push([e,t.toLowerCase()])},uncountable:function(e){this._cacheUsed&&this.purgeCache(),r(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),a(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 a,i,n,c,h,p,f,m,y,v,b;if(m=!e||s.test(e),y=u.test(e),p="",m)return e;if(c=e.toLowerCase(),h=d.exec(e)||l.exec(e),h&&(p=h[1],f=h[2].toLowerCase()),b=this.rules.uncountable[c]||this.rules.uncountable[f])return e;for(v in this.rules.irregular)if(c.match(v+"$"))return i=r[v],y&&r[f]&&(i=o(i),v=o(v)),e.replace(v,i);for(var g=t.length,R=0;g>R&&(a=t[g-1],v=a[0],!v.test(e));g--);return a=a||[],v=a[0],i=a[1],n=e.replace(v,i)}},e["default"]=i}),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 a(e){return t["default"].inflector.singularize(e)}e.pluralize=r,e.singularize=a}),t("ember-inflector/lib/utils/make-helper",["exports","ember"],function(e,t){function r(e){return t["default"].Helper?t["default"].Helper.helper(e):t["default"].HTMLBars?t["default"].HTMLBars.makeBoundHelper(e):t["default"].Handlebars.makeBoundHelper(e)}e["default"]=r}),t("ember",[],function(){return{"default":Ember}}),a("ember-data"),function(){var e=a("ember-data/-private/global")["default"],t=a("ember-data")["default"];Object.defineProperty(e,"DS",{get:function(){return t}})}()}(),function(){function e(){var e={"ember-data":{"default":DS},"ember-data/model":{"default":DS.Model},"ember-data/mixins/embedded-records":{"default":DS.EmbeddedRecordsMixin},"ember-data/serializers/rest":{"default":DS.RESTSerializer},"ember-data/serializers/active-model":{"default":DS.ActiveModelSerializer},"ember-data/serializers/json":{"default":DS.JSONSerializer},"ember-data/serializers/json-api":{"default":DS.JSONAPISerializer},"ember-data/serializer":{"default":DS.Serializer},"ember-data/adapters/json-api":{"default":DS.JSONAPIAdapter},"ember-data/adapters/rest":{"default":DS.RESTAdapter},"ember-data/adapter":{"default":DS.Adapter},"ember-data/adapters/active-model":{"default":DS.ActiveModelAdapter},"ember-data/store":{"default":DS.Store},"ember-data/transform":{"default":DS.Transform},"ember-data/attr":{"default":DS.attr},"ember-data/relationships":{hasMany:DS.hasMany,belongsTo:DS.belongsTo}};for(var r in e)t(r,e[r])}function t(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&e()}(),function(){var e=Ember.K;Ember.onLoad("Ember.Application",function(t){t.initializer({name:"ember-data",initialize:DS._setupContainer}),t.instanceInitializer({name:"ember-data",initialize:DS._initializeStoreService}),t.initializer({name:"store",after:"ember-data",initialize:e}),t.initializer({name:"transforms",before:"store",initialize:e}),t.initializer({name:"data-adapter",before:"store",initialize:e}),t.initializer({name:"injectStore",before:"store",initialize:e})})}();
|
@@ -6,7 +6,7 @@
|
|
6
6
|
* @copyright Copyright 2011-2016 Tilde Inc. and contributors.
|
7
7
|
* Portions Copyright 2011 LivingSocial Inc.
|
8
8
|
* @license Licensed under MIT license (see license.js)
|
9
|
-
* @version 2.
|
9
|
+
* @version 2.7.0-beta.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var loader, define, requireModule, require, requirejs;
|
@@ -25,14 +25,7 @@ var loader, define, requireModule, require, requirejs;
|
|
25
25
|
|
26
26
|
requirejs = require = requireModule = function(name) {
|
27
27
|
stats.require++;
|
28
|
-
|
29
|
-
var mod = findModule(name, '(require)', pending);
|
30
|
-
|
31
|
-
for (var i = pending.length - 1; i >= 0; i--) {
|
32
|
-
pending[i].exports();
|
33
|
-
}
|
34
|
-
|
35
|
-
return mod.module.exports;
|
28
|
+
return findModule(name, '(require)').module.exports;
|
36
29
|
};
|
37
30
|
|
38
31
|
function resetStats() {
|
@@ -40,19 +33,18 @@ var loader, define, requireModule, require, requirejs;
|
|
40
33
|
define: 0,
|
41
34
|
require: 0,
|
42
35
|
reify: 0,
|
43
|
-
|
36
|
+
build: 0,
|
44
37
|
modules: 0,
|
45
38
|
exports: 0,
|
39
|
+
ensureBuild: 0,
|
46
40
|
resolve: 0,
|
47
41
|
resolveRelative: 0,
|
48
42
|
findModule: 0,
|
49
|
-
pendingQueueLength: 0
|
50
43
|
};
|
51
44
|
requirejs._stats = stats;
|
52
45
|
}
|
53
46
|
|
54
47
|
var stats;
|
55
|
-
|
56
48
|
resetStats();
|
57
49
|
|
58
50
|
loader = {
|
@@ -83,6 +75,8 @@ var loader, define, requireModule, require, requirejs;
|
|
83
75
|
|
84
76
|
var registry = {};
|
85
77
|
var seen = {};
|
78
|
+
var FAILED = false;
|
79
|
+
var LOADED = true;
|
86
80
|
|
87
81
|
var uuid = 0;
|
88
82
|
|
@@ -94,18 +88,17 @@ var loader, define, requireModule, require, requirejs;
|
|
94
88
|
var defaultDeps = ['require', 'exports', 'module'];
|
95
89
|
|
96
90
|
function Module(name, deps, callback, alias) {
|
97
|
-
stats.modules++;
|
91
|
+
stats.modules ++;
|
98
92
|
this.id = uuid++;
|
99
93
|
this.name = name;
|
100
94
|
this.deps = !deps.length && callback.length ? defaultDeps : deps;
|
101
95
|
this.module = { exports: {} };
|
102
96
|
this.callback = callback;
|
97
|
+
this.state = undefined;
|
103
98
|
this.finalized = false;
|
104
99
|
this.hasExportsAsDep = false;
|
105
100
|
this.isAlias = alias;
|
106
101
|
this.reified = new Array(deps.length);
|
107
|
-
this._foundDeps = false;
|
108
|
-
this.isPending = false;
|
109
102
|
}
|
110
103
|
|
111
104
|
Module.prototype.makeDefaultExport = function() {
|
@@ -118,66 +111,46 @@ var loader, define, requireModule, require, requirejs;
|
|
118
111
|
};
|
119
112
|
|
120
113
|
Module.prototype.exports = function() {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
if (!(this.hasExportsAsDep && result === undefined)) {
|
136
|
-
this.module.exports = result;
|
114
|
+
stats.exports ++;
|
115
|
+
if (this.finalized) {
|
116
|
+
return this.module.exports;
|
117
|
+
} else {
|
118
|
+
if (loader.wrapModules) {
|
119
|
+
this.callback = loader.wrapModules(this.name, this.callback);
|
120
|
+
}
|
121
|
+
var result = this.callback.apply(this, this.reified);
|
122
|
+
if (!(this.hasExportsAsDep && result === undefined)) {
|
123
|
+
this.module.exports = result;
|
124
|
+
}
|
125
|
+
this.makeDefaultExport();
|
126
|
+
this.finalized = true;
|
127
|
+
return this.module.exports;
|
137
128
|
}
|
138
|
-
this.makeDefaultExport();
|
139
|
-
return this.module.exports;
|
140
129
|
};
|
141
130
|
|
142
131
|
Module.prototype.unsee = function() {
|
143
132
|
this.finalized = false;
|
144
|
-
this.
|
145
|
-
this.isPending = false;
|
133
|
+
this.state = undefined;
|
146
134
|
this.module = { exports: {}};
|
147
135
|
};
|
148
136
|
|
149
137
|
Module.prototype.reify = function() {
|
150
138
|
stats.reify++;
|
151
|
-
var reified = this.reified;
|
152
|
-
for (var i = 0; i < reified.length; i++) {
|
153
|
-
var mod = reified[i];
|
154
|
-
reified[i] = mod.exports ? mod.exports : mod.module.exports();
|
155
|
-
}
|
156
|
-
};
|
157
|
-
|
158
|
-
Module.prototype.findDeps = function(pending) {
|
159
|
-
if (this._foundDeps) {
|
160
|
-
return;
|
161
|
-
}
|
162
|
-
|
163
|
-
stats.findDeps++;
|
164
|
-
this._foundDeps = true;
|
165
|
-
this.isPending = true;
|
166
|
-
|
167
139
|
var deps = this.deps;
|
140
|
+
var dep;
|
141
|
+
var reified = this.reified;
|
168
142
|
|
169
143
|
for (var i = 0; i < deps.length; i++) {
|
170
|
-
|
171
|
-
var entry = this.reified[i] = { exports: undefined, module: undefined };
|
144
|
+
dep = deps[i];
|
172
145
|
if (dep === 'exports') {
|
173
146
|
this.hasExportsAsDep = true;
|
174
|
-
|
147
|
+
reified[i] = this.module.exports;
|
175
148
|
} else if (dep === 'require') {
|
176
|
-
|
149
|
+
reified[i] = this.makeRequire();
|
177
150
|
} else if (dep === 'module') {
|
178
|
-
|
151
|
+
reified[i] = this.module;
|
179
152
|
} else {
|
180
|
-
|
153
|
+
reified[i] = findModule(resolve(dep, this.name), this.name).module.exports;
|
181
154
|
}
|
182
155
|
}
|
183
156
|
};
|
@@ -194,6 +167,16 @@ var loader, define, requireModule, require, requirejs;
|
|
194
167
|
return r;
|
195
168
|
};
|
196
169
|
|
170
|
+
Module.prototype.build = function() {
|
171
|
+
stats.ensureBuild++;
|
172
|
+
if (this.state === FAILED || this.state === LOADED) { return; }
|
173
|
+
stats.build++;
|
174
|
+
this.state = FAILED;
|
175
|
+
this.reify()
|
176
|
+
this.exports();
|
177
|
+
this.state = LOADED;
|
178
|
+
};
|
179
|
+
|
197
180
|
define = function(name, deps, callback) {
|
198
181
|
stats.define++;
|
199
182
|
if (arguments.length < 2) {
|
@@ -229,7 +212,7 @@ var loader, define, requireModule, require, requirejs;
|
|
229
212
|
throw new Error('Could not find module `' + name + '` imported from `' + referrer + '`');
|
230
213
|
}
|
231
214
|
|
232
|
-
function findModule(name, referrer
|
215
|
+
function findModule(name, referrer) {
|
233
216
|
stats.findModule++;
|
234
217
|
var mod = registry[name] || registry[name + '/index'];
|
235
218
|
|
@@ -239,11 +222,7 @@ var loader, define, requireModule, require, requirejs;
|
|
239
222
|
|
240
223
|
if (!mod) { missingModule(name, referrer); }
|
241
224
|
|
242
|
-
|
243
|
-
mod.findDeps(pending);
|
244
|
-
pending.push(mod);
|
245
|
-
stats.pendingQueueLength++;
|
246
|
-
}
|
225
|
+
mod.build();
|
247
226
|
return mod;
|
248
227
|
}
|
249
228
|
|
@@ -279,7 +258,7 @@ var loader, define, requireModule, require, requirejs;
|
|
279
258
|
requirejs.entries = requirejs._eak_seen = registry;
|
280
259
|
requirejs.has = has;
|
281
260
|
requirejs.unsee = function(moduleName) {
|
282
|
-
findModule(moduleName, '(unsee)'
|
261
|
+
findModule(moduleName, '(unsee)').unsee();
|
283
262
|
};
|
284
263
|
|
285
264
|
requirejs.clear = function() {
|
@@ -621,7 +600,8 @@ define('ember-data/-private/core', ['exports', 'ember', 'ember-data/version'], f
|
|
621
600
|
@static
|
622
601
|
*/
|
623
602
|
var DS = _ember.default.Namespace.create({
|
624
|
-
VERSION: _emberDataVersion.default
|
603
|
+
VERSION: _emberDataVersion.default,
|
604
|
+
name: "DS"
|
625
605
|
});
|
626
606
|
|
627
607
|
if (_ember.default.libraries) {
|
@@ -711,30 +691,14 @@ define('ember-data/-private/debug', ['exports', 'ember'], function (exports, _em
|
|
711
691
|
assert(assertionMessage, checkPolymorphic(typeClass, addedRecord));
|
712
692
|
}
|
713
693
|
});
|
714
|
-
define('ember-data/-private/ext/date', ['exports', 'ember'], function (exports, _ember) {
|
694
|
+
define('ember-data/-private/ext/date', ['exports', 'ember', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateDebug) {
|
715
695
|
|
716
|
-
/**
|
717
|
-
Date.parse with progressive enhancement for ISO 8601 <https://github.com/csnover/js-iso8601>
|
718
|
-
|
719
|
-
© 2011 Colin Snover <http://zetafleet.com>
|
720
|
-
|
721
|
-
Released under MIT license.
|
722
|
-
|
723
|
-
@class Date
|
724
|
-
@namespace Ember
|
725
|
-
@static
|
726
|
-
*/
|
727
696
|
_ember.default.Date = _ember.default.Date || {};
|
728
697
|
|
729
698
|
var origParse = Date.parse;
|
730
699
|
var numericKeys = [1, 4, 5, 6, 7, 10, 11];
|
731
700
|
|
732
|
-
|
733
|
-
@method parse
|
734
|
-
@param {Date} date
|
735
|
-
@return {Number} timestamp
|
736
|
-
*/
|
737
|
-
_ember.default.Date.parse = function (date) {
|
701
|
+
var parseDate = function (date) {
|
738
702
|
var timestamp, struct;
|
739
703
|
var minutesOffset = 0;
|
740
704
|
|
@@ -742,7 +706,7 @@ define('ember-data/-private/ext/date', ['exports', 'ember'], function (exports,
|
|
742
706
|
// before falling back to any implementation-specific date parsing, so that’s what we do, even if native
|
743
707
|
// implementations could be faster
|
744
708
|
// 1 YYYY 2 MM 3 DD 4 HH 5 mm 6 ss 7 msec 8 Z 9 ± 10 tzHH 11 tzmm
|
745
|
-
if (struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(
|
709
|
+
if (struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?:(\d{2}))?)?)?$/.exec(date)) {
|
746
710
|
// avoid NaN timestamps caused by “undefined” values being passed to Date.UTC
|
747
711
|
for (var i = 0, k; k = numericKeys[i]; ++i) {
|
748
712
|
struct[k] = +struct[k] || 0;
|
@@ -768,8 +732,16 @@ define('ember-data/-private/ext/date', ['exports', 'ember'], function (exports,
|
|
768
732
|
return timestamp;
|
769
733
|
};
|
770
734
|
|
735
|
+
exports.parseDate = parseDate;
|
736
|
+
_ember.default.Date.parse = function (date) {
|
737
|
+
|
738
|
+
return parseDate(date);
|
739
|
+
|
740
|
+
// throw deprecation
|
741
|
+
};
|
742
|
+
|
771
743
|
if (_ember.default.EXTEND_PROTOTYPES === true || _ember.default.EXTEND_PROTOTYPES.Date) {
|
772
|
-
Date.parse =
|
744
|
+
Date.parse = parseDate;
|
773
745
|
}
|
774
746
|
});
|
775
747
|
/**
|
@@ -784,6 +756,25 @@ define('ember-data/-private/features', ['exports', 'ember'], function (exports,
|
|
784
756
|
return (_Ember$FEATURES = _ember.default.FEATURES).isEnabled.apply(_Ember$FEATURES, arguments);
|
785
757
|
}
|
786
758
|
});
|
759
|
+
define('ember-data/-private/global', ['exports'], function (exports) {
|
760
|
+
/* globals global, window, self */
|
761
|
+
|
762
|
+
// originally from https://github.com/emberjs/ember.js/blob/c0bd26639f50efd6a03ee5b87035fd200e313b8e/packages/ember-environment/lib/global.js
|
763
|
+
|
764
|
+
// from lodash to catch fake globals
|
765
|
+
function checkGlobal(value) {
|
766
|
+
return value && value.Object === Object ? value : undefined;
|
767
|
+
}
|
768
|
+
|
769
|
+
// element ids can ruin global miss checks
|
770
|
+
function checkElementIdShadowing(value) {
|
771
|
+
return value && value.nodeType === undefined ? value : undefined;
|
772
|
+
}
|
773
|
+
|
774
|
+
// export real global
|
775
|
+
exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || new Function('return this')();
|
776
|
+
// eval outside of strict mode
|
777
|
+
});
|
787
778
|
define("ember-data/-private/initializers/data-adapter", ["exports", "ember-data/-private/system/debug/debug-adapter"], function (exports, _emberDataPrivateSystemDebugDebugAdapter) {
|
788
779
|
exports.default = initializeDebugAdapter;
|
789
780
|
|
@@ -921,7 +912,7 @@ define('ember-data/-private/system/coerce-id', ['exports'], function (exports) {
|
|
921
912
|
// corresponding record, we will not know if it is a string or a number.
|
922
913
|
|
923
914
|
function coerceId(id) {
|
924
|
-
return id
|
915
|
+
return id === null || id === undefined || id === '' ? null : id + '';
|
925
916
|
}
|
926
917
|
});
|
927
918
|
define('ember-data/-private/system/container-proxy', ['exports', 'ember-data/-private/debug'], function (exports, _emberDataPrivateDebug) {
|
@@ -2103,7 +2094,7 @@ define('ember-data/-private/system/model/errors', ['exports', 'ember', 'ember-da
|
|
2103
2094
|
}
|
2104
2095
|
});
|
2105
2096
|
});
|
2106
|
-
define("ember-data/-private/system/model/internal-model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/model/states", "ember-data/-private/system/relationships/state/create", "ember-data/-private/system/snapshot", "ember-data/-private/system/empty-object", "ember-data/-private/
|
2097
|
+
define("ember-data/-private/system/model/internal-model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/model/states", "ember-data/-private/system/relationships/state/create", "ember-data/-private/system/snapshot", "ember-data/-private/system/empty-object", "ember-data/-private/utils", "ember-data/-private/system/references"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateSystemModelStates, _emberDataPrivateSystemRelationshipsStateCreate, _emberDataPrivateSystemSnapshot, _emberDataPrivateSystemEmptyObject, _emberDataPrivateUtils, _emberDataPrivateSystemReferences) {
|
2107
2098
|
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })();
|
2108
2099
|
|
2109
2100
|
exports.default = InternalModel;
|
@@ -2912,12 +2903,9 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
|
|
2912
2903
|
} else {
|
2913
2904
|
return "<" + this.modelName + ":" + this.id + ">";
|
2914
2905
|
}
|
2915
|
-
}
|
2916
|
-
};
|
2917
|
-
|
2918
|
-
if (true) {
|
2906
|
+
},
|
2919
2907
|
|
2920
|
-
|
2908
|
+
referenceFor: function (type, name) {
|
2921
2909
|
var reference = this.references[name];
|
2922
2910
|
|
2923
2911
|
if (!reference) {
|
@@ -2933,10 +2921,10 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
|
|
2933
2921
|
}
|
2934
2922
|
|
2935
2923
|
return reference;
|
2936
|
-
}
|
2937
|
-
}
|
2924
|
+
}
|
2925
|
+
};
|
2938
2926
|
});
|
2939
|
-
define("ember-data/-private/system/model/model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/model/errors", "ember-data/-private/
|
2927
|
+
define("ember-data/-private/system/model/model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/model/errors", "ember-data/-private/system/debug/debug-info", "ember-data/-private/system/relationships/belongs-to", "ember-data/-private/system/relationships/has-many", "ember-data/-private/system/relationships/ext", "ember-data/-private/system/model/attr"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemModelErrors, _emberDataPrivateSystemDebugDebugInfo, _emberDataPrivateSystemRelationshipsBelongsTo, _emberDataPrivateSystemRelationshipsHasMany, _emberDataPrivateSystemRelationshipsExt, _emberDataPrivateSystemModelAttr) {
|
2940
2928
|
|
2941
2929
|
/**
|
2942
2930
|
@module ember-data
|
@@ -3409,6 +3397,22 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
|
|
3409
3397
|
}
|
3410
3398
|
}
|
3411
3399
|
});
|
3400
|
+
```
|
3401
|
+
If you pass an object on the `adapterOptions` property of the options
|
3402
|
+
argument it will be passed to you adapter via the snapshot
|
3403
|
+
```js
|
3404
|
+
record.destroyRecord({ adapterOptions: { subscribe: false } });
|
3405
|
+
```
|
3406
|
+
```app/adapters/post.js
|
3407
|
+
import MyCustomAdapter from './custom-adapter';
|
3408
|
+
export default MyCustomAdapter.extend({
|
3409
|
+
deleteRecord: function(store, type, snapshot) {
|
3410
|
+
if (snapshot.adapterOptions.subscribe) {
|
3411
|
+
// ...
|
3412
|
+
}
|
3413
|
+
// ...
|
3414
|
+
}
|
3415
|
+
});
|
3412
3416
|
```
|
3413
3417
|
@method destroyRecord
|
3414
3418
|
@param {Object} options
|
@@ -3540,7 +3544,23 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
|
|
3540
3544
|
// Error callback
|
3541
3545
|
});
|
3542
3546
|
```
|
3543
|
-
|
3547
|
+
If you pass an object on the `adapterOptions` property of the options
|
3548
|
+
argument it will be passed to you adapter via the snapshot
|
3549
|
+
```js
|
3550
|
+
record.save({ adapterOptions: { subscribe: false } });
|
3551
|
+
```
|
3552
|
+
```app/adapters/post.js
|
3553
|
+
import MyCustomAdapter from './custom-adapter';
|
3554
|
+
export default MyCustomAdapter.extend({
|
3555
|
+
updateRecord: function(store, type, snapshot) {
|
3556
|
+
if (snapshot.adapterOptions.subscribe) {
|
3557
|
+
// ...
|
3558
|
+
}
|
3559
|
+
// ...
|
3560
|
+
}
|
3561
|
+
});
|
3562
|
+
```
|
3563
|
+
@method save
|
3544
3564
|
@param {Object} options
|
3545
3565
|
@return {Promise} a promise that will be resolved when the adapter returns
|
3546
3566
|
successfully or rejected if the adapter returns with an error.
|
@@ -3621,9 +3641,104 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
|
|
3621
3641
|
|
3622
3642
|
attr: function () {},
|
3623
3643
|
|
3624
|
-
|
3644
|
+
/**
|
3645
|
+
Get the reference for the specified belongsTo relationship.
|
3646
|
+
Example
|
3647
|
+
```javascript
|
3648
|
+
// models/blog.js
|
3649
|
+
export default DS.Model.extend({
|
3650
|
+
user: DS.belongsTo({ async: true })
|
3651
|
+
});
|
3652
|
+
var blog = store.push({
|
3653
|
+
type: 'blog',
|
3654
|
+
id: 1,
|
3655
|
+
relationships: {
|
3656
|
+
user: { type: 'user', id: 1 }
|
3657
|
+
}
|
3658
|
+
});
|
3659
|
+
var userRef = blog.belongsTo('user');
|
3660
|
+
// check if the user relationship is loaded
|
3661
|
+
var isLoaded = userRef.value() !== null;
|
3662
|
+
// get the record of the reference (null if not yet available)
|
3663
|
+
var user = userRef.value();
|
3664
|
+
// get the identifier of the reference
|
3665
|
+
if (userRef.remoteType() === "id") {
|
3666
|
+
var id = userRef.id();
|
3667
|
+
} else if (userRef.remoteType() === "link") {
|
3668
|
+
var link = userRef.link();
|
3669
|
+
}
|
3670
|
+
// load user (via store.findRecord or store.findBelongsTo)
|
3671
|
+
userRef.load().then(...)
|
3672
|
+
// or trigger a reload
|
3673
|
+
userRef.reload().then(...)
|
3674
|
+
// provide data for reference
|
3675
|
+
userRef.push({
|
3676
|
+
type: 'user',
|
3677
|
+
id: 1,
|
3678
|
+
attributes: {
|
3679
|
+
username: "@user"
|
3680
|
+
}
|
3681
|
+
}).then(function(user) {
|
3682
|
+
userRef.value() === user;
|
3683
|
+
});
|
3684
|
+
```
|
3685
|
+
@method belongsTo
|
3686
|
+
@param {String} name of the relationship
|
3687
|
+
@since 2.5.0
|
3688
|
+
@return {BelongsToReference} reference for this relationship
|
3689
|
+
*/
|
3690
|
+
belongsTo: function (name) {
|
3691
|
+
return this._internalModel.referenceFor('belongsTo', name);
|
3692
|
+
},
|
3625
3693
|
|
3626
|
-
|
3694
|
+
/**
|
3695
|
+
Get the reference for the specified hasMany relationship.
|
3696
|
+
Example
|
3697
|
+
```javascript
|
3698
|
+
// models/blog.js
|
3699
|
+
export default DS.Model.extend({
|
3700
|
+
comments: DS.hasMany({ async: true })
|
3701
|
+
});
|
3702
|
+
var blog = store.push({
|
3703
|
+
type: 'blog',
|
3704
|
+
id: 1,
|
3705
|
+
relationships: {
|
3706
|
+
comments: {
|
3707
|
+
data: [
|
3708
|
+
{ type: 'comment', id: 1 },
|
3709
|
+
{ type: 'comment', id: 2 }
|
3710
|
+
]
|
3711
|
+
}
|
3712
|
+
}
|
3713
|
+
});
|
3714
|
+
var commentsRef = blog.hasMany('comments');
|
3715
|
+
// check if the comments are loaded already
|
3716
|
+
var isLoaded = commentsRef.value() !== null;
|
3717
|
+
// get the records of the reference (null if not yet available)
|
3718
|
+
var comments = commentsRef.value();
|
3719
|
+
// get the identifier of the reference
|
3720
|
+
if (commentsRef.remoteType() === "ids") {
|
3721
|
+
var ids = commentsRef.ids();
|
3722
|
+
} else if (commentsRef.remoteType() === "link") {
|
3723
|
+
var link = commentsRef.link();
|
3724
|
+
}
|
3725
|
+
// load comments (via store.findMany or store.findHasMany)
|
3726
|
+
commentsRef.load().then(...)
|
3727
|
+
// or trigger a reload
|
3728
|
+
commentsRef.reload().then(...)
|
3729
|
+
// provide data for reference
|
3730
|
+
commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {
|
3731
|
+
commentsRef.value() === comments;
|
3732
|
+
});
|
3733
|
+
```
|
3734
|
+
@method hasMany
|
3735
|
+
@param {String} name of the relationship
|
3736
|
+
@since 2.5.0
|
3737
|
+
@return {HasManyReference} reference for this relationship
|
3738
|
+
*/
|
3739
|
+
hasMany: function (name) {
|
3740
|
+
return this._internalModel.referenceFor('hasMany', name);
|
3741
|
+
},
|
3627
3742
|
|
3628
3743
|
setId: _ember.default.observer('id', function () {
|
3629
3744
|
this._internalModel.setId(this.get('id'));
|
@@ -3696,109 +3811,6 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
|
|
3696
3811
|
});
|
3697
3812
|
}
|
3698
3813
|
|
3699
|
-
if (true) {
|
3700
|
-
|
3701
|
-
Model.reopen({
|
3702
|
-
|
3703
|
-
/**
|
3704
|
-
Get the reference for the specified belongsTo relationship.
|
3705
|
-
Example
|
3706
|
-
```javascript
|
3707
|
-
// models/blog.js
|
3708
|
-
export default DS.Model.extend({
|
3709
|
-
user: DS.belongsTo({ async: true })
|
3710
|
-
});
|
3711
|
-
var blog = store.push({
|
3712
|
-
type: 'blog',
|
3713
|
-
id: 1,
|
3714
|
-
relationships: {
|
3715
|
-
user: { type: 'user', id: 1 }
|
3716
|
-
}
|
3717
|
-
});
|
3718
|
-
var userRef = blog.belongsTo('user');
|
3719
|
-
// check if the user relationship is loaded
|
3720
|
-
var isLoaded = userRef.value() !== null;
|
3721
|
-
// get the record of the reference (null if not yet available)
|
3722
|
-
var user = userRef.value();
|
3723
|
-
// get the identifier of the reference
|
3724
|
-
if (userRef.remoteType() === "id") {
|
3725
|
-
var id = userRef.id();
|
3726
|
-
} else if (userRef.remoteType() === "link") {
|
3727
|
-
var link = userRef.link();
|
3728
|
-
}
|
3729
|
-
// load user (via store.findRecord or store.findBelongsTo)
|
3730
|
-
userRef.load().then(...)
|
3731
|
-
// or trigger a reload
|
3732
|
-
userRef.reload().then(...)
|
3733
|
-
// provide data for reference
|
3734
|
-
userRef.push({
|
3735
|
-
type: 'user',
|
3736
|
-
id: 1,
|
3737
|
-
attributes: {
|
3738
|
-
username: "@user"
|
3739
|
-
}
|
3740
|
-
}).then(function(user) {
|
3741
|
-
userRef.value() === user;
|
3742
|
-
});
|
3743
|
-
```
|
3744
|
-
@method belongsTo
|
3745
|
-
@param {String} name of the relationship
|
3746
|
-
@return {BelongsToReference} reference for this relationship
|
3747
|
-
*/
|
3748
|
-
belongsTo: function (name) {
|
3749
|
-
return this._internalModel.referenceFor('belongsTo', name);
|
3750
|
-
},
|
3751
|
-
|
3752
|
-
/**
|
3753
|
-
Get the reference for the specified hasMany relationship.
|
3754
|
-
Example
|
3755
|
-
```javascript
|
3756
|
-
// models/blog.js
|
3757
|
-
export default DS.Model.extend({
|
3758
|
-
comments: DS.hasMany({ async: true })
|
3759
|
-
});
|
3760
|
-
var blog = store.push({
|
3761
|
-
type: 'blog',
|
3762
|
-
id: 1,
|
3763
|
-
relationships: {
|
3764
|
-
comments: {
|
3765
|
-
data: [
|
3766
|
-
{ type: 'comment', id: 1 },
|
3767
|
-
{ type: 'comment', id: 2 }
|
3768
|
-
]
|
3769
|
-
}
|
3770
|
-
}
|
3771
|
-
});
|
3772
|
-
var commentsRef = blog.hasMany('comments');
|
3773
|
-
// check if the comments are loaded already
|
3774
|
-
var isLoaded = commentsRef.value() !== null;
|
3775
|
-
// get the records of the reference (null if not yet available)
|
3776
|
-
var comments = commentsRef.value();
|
3777
|
-
// get the identifier of the reference
|
3778
|
-
if (commentsRef.remoteType() === "ids") {
|
3779
|
-
var ids = commentsRef.ids();
|
3780
|
-
} else if (commentsRef.remoteType() === "link") {
|
3781
|
-
var link = commentsRef.link();
|
3782
|
-
}
|
3783
|
-
// load comments (via store.findMany or store.findHasMany)
|
3784
|
-
commentsRef.load().then(...)
|
3785
|
-
// or trigger a reload
|
3786
|
-
commentsRef.reload().then(...)
|
3787
|
-
// provide data for reference
|
3788
|
-
commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {
|
3789
|
-
commentsRef.value() === comments;
|
3790
|
-
});
|
3791
|
-
```
|
3792
|
-
@method hasMany
|
3793
|
-
@param {String} name of the relationship
|
3794
|
-
@return {HasManyReference} reference for this relationship
|
3795
|
-
*/
|
3796
|
-
hasMany: function (name) {
|
3797
|
-
return this._internalModel.referenceFor('hasMany', name);
|
3798
|
-
}
|
3799
|
-
});
|
3800
|
-
}
|
3801
|
-
|
3802
3814
|
Model.reopenClass(_emberDataPrivateSystemRelationshipsExt.RelationshipsClassMethodsMixin);
|
3803
3815
|
Model.reopenClass(_emberDataPrivateSystemModelAttr.AttrClassMethodsMixin);
|
3804
3816
|
|
@@ -4543,7 +4555,6 @@ define('ember-data/-private/system/model/states', ['exports', 'ember', 'ember-da
|
|
4543
4555
|
};
|
4544
4556
|
|
4545
4557
|
function wireState(object, parent, name) {
|
4546
|
-
/*jshint proto:true*/
|
4547
4558
|
// TODO: Use Object.create and copy instead
|
4548
4559
|
object = mixin(parent ? Object.create(parent) : {}, object);
|
4549
4560
|
object.parentState = parent;
|
@@ -4640,7 +4651,7 @@ define('ember-data/-private/system/ordered-set', ['exports', 'ember'], function
|
|
4640
4651
|
|
4641
4652
|
presenceSet[guid] = true;
|
4642
4653
|
|
4643
|
-
if (idx === undefined || idx
|
4654
|
+
if (idx === undefined || idx === null) {
|
4644
4655
|
list.push(obj);
|
4645
4656
|
} else {
|
4646
4657
|
list.splice(idx, 0, obj);
|
@@ -5182,9 +5193,7 @@ define("ember-data/-private/system/record-arrays/adapter-populated-record-array"
|
|
5182
5193
|
meta: (0, _emberDataPrivateSystemCloneNull.default)(payload.meta)
|
5183
5194
|
});
|
5184
5195
|
|
5185
|
-
|
5186
|
-
this.set('links', (0, _emberDataPrivateSystemCloneNull.default)(payload.links));
|
5187
|
-
}
|
5196
|
+
this.set('links', (0, _emberDataPrivateSystemCloneNull.default)(payload.links));
|
5188
5197
|
|
5189
5198
|
internalModels.forEach(function (record) {
|
5190
5199
|
_this.manager.recordArraysForRecord(record).add(_this);
|
@@ -5465,7 +5474,7 @@ define('ember-data/-private/system/references', ['exports', 'ember-data/-private
|
|
5465
5474
|
exports.BelongsToReference = _emberDataPrivateSystemReferencesBelongsTo.default;
|
5466
5475
|
exports.HasManyReference = _emberDataPrivateSystemReferencesHasMany.default;
|
5467
5476
|
});
|
5468
|
-
define('ember-data/-private/system/references/belongs-to', ['exports', 'ember-data/model', 'ember', 'ember-data/-private/system/references/reference', 'ember-data/-private/debug'], function (exports, _emberDataModel, _ember, _emberDataPrivateSystemReferencesReference, _emberDataPrivateDebug) {
|
5477
|
+
define('ember-data/-private/system/references/belongs-to', ['exports', 'ember-data/model', 'ember', 'ember-data/-private/system/references/reference', 'ember-data/-private/features', 'ember-data/-private/debug'], function (exports, _emberDataModel, _ember, _emberDataPrivateSystemReferencesReference, _emberDataPrivateFeatures, _emberDataPrivateDebug) {
|
5469
5478
|
|
5470
5479
|
var BelongsToReference = function (store, parentInternalModel, belongsToRelationship) {
|
5471
5480
|
this._super$constructor(store, parentInternalModel);
|
@@ -5553,7 +5562,7 @@ define('ember-data/-private/system/references/belongs-to', ['exports', 'ember-da
|
|
5553
5562
|
|
5554
5563
|
exports.default = BelongsToReference;
|
5555
5564
|
});
|
5556
|
-
define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'ember-data/-private/system/references/reference', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateSystemReferencesReference, _emberDataPrivateDebug) {
|
5565
|
+
define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'ember-data/-private/system/references/reference', 'ember-data/-private/debug', 'ember-data/-private/features'], function (exports, _ember, _emberDataPrivateSystemReferencesReference, _emberDataPrivateDebug, _emberDataPrivateFeatures) {
|
5557
5566
|
|
5558
5567
|
var get = _ember.default.get;
|
5559
5568
|
|
@@ -5600,15 +5609,26 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember', 'e
|
|
5600
5609
|
|
5601
5610
|
return _ember.default.RSVP.resolve(objectOrPromise).then(function (payload) {
|
5602
5611
|
var array = payload;
|
5612
|
+
|
5613
|
+
var useLegacyArrayPush = true;
|
5603
5614
|
if (typeof payload === "object" && payload.data) {
|
5604
5615
|
array = payload.data;
|
5616
|
+
useLegacyArrayPush = array.length && array[0].data;
|
5605
5617
|
}
|
5606
5618
|
|
5607
|
-
|
5608
|
-
var record = _this.store.push(obj);
|
5619
|
+
useLegacyArrayPush = true;
|
5609
5620
|
|
5610
|
-
|
5611
|
-
|
5621
|
+
var internalModels = undefined;
|
5622
|
+
if (useLegacyArrayPush) {
|
5623
|
+
internalModels = array.map(function (obj) {
|
5624
|
+
var record = _this.store.push(obj);
|
5625
|
+
|
5626
|
+
return record._internalModel;
|
5627
|
+
});
|
5628
|
+
} else {
|
5629
|
+
var records = _this.store.push(payload);
|
5630
|
+
internalModels = _ember.default.A(records).mapBy('_internalModel');
|
5631
|
+
}
|
5612
5632
|
|
5613
5633
|
_this.hasManyRelationship.computeChanges(internalModels);
|
5614
5634
|
|
@@ -6288,9 +6308,9 @@ define("ember-data/-private/system/relationships/ext", ["exports", "ember", "emb
|
|
6288
6308
|
import Blog from 'app/models/blog';
|
6289
6309
|
var relationshipsByName = Ember.get(Blog, 'relationshipsByName');
|
6290
6310
|
relationshipsByName.get('users');
|
6291
|
-
//=> { key: 'users', kind: 'hasMany', type:
|
6311
|
+
//=> { key: 'users', kind: 'hasMany', type: 'user', options: Object, isRelationship: true }
|
6292
6312
|
relationshipsByName.get('owner');
|
6293
|
-
//=> { key: 'owner', kind: 'belongsTo', type:
|
6313
|
+
//=> { key: 'owner', kind: 'belongsTo', type: 'user', options: Object, isRelationship: true }
|
6294
6314
|
```
|
6295
6315
|
@property relationshipsByName
|
6296
6316
|
@static
|
@@ -6383,14 +6403,14 @@ define("ember-data/-private/system/relationships/ext", ["exports", "ember", "emb
|
|
6383
6403
|
var knownKey = knownSide.key;
|
6384
6404
|
var knownKind = knownSide.kind;
|
6385
6405
|
var inverse = this.inverseFor(knownKey, store);
|
6386
|
-
|
6387
|
-
|
6406
|
+
// let key;
|
6407
|
+
var otherKind = undefined;
|
6388
6408
|
|
6389
6409
|
if (!inverse) {
|
6390
6410
|
return knownKind === 'belongsTo' ? 'oneToNone' : 'manyToNone';
|
6391
6411
|
}
|
6392
6412
|
|
6393
|
-
key = inverse.name;
|
6413
|
+
// key = inverse.name;
|
6394
6414
|
otherKind = inverse.kind;
|
6395
6415
|
|
6396
6416
|
if (otherKind === 'belongsTo') {
|
@@ -6420,7 +6440,7 @@ define("ember-data/-private/system/relationships/ext", ["exports", "ember", "emb
|
|
6420
6440
|
- **kind** <span class="type">String</span> "hasMany" or "belongsTo"
|
6421
6441
|
- **options** <span class="type">Object</span> the original options hash passed when the relationship was declared
|
6422
6442
|
- **parentType** <span class="type">DS.Model</span> the type of the Model that owns this relationship
|
6423
|
-
- **type** <span class="type">
|
6443
|
+
- **type** <span class="type">String</span> the type name of the related Model
|
6424
6444
|
Note that in addition to a callback, you can also pass an optional target
|
6425
6445
|
object that will be set as `this` on the context.
|
6426
6446
|
Example
|
@@ -7322,8 +7342,11 @@ define("ember-data/-private/system/relationships/state/relationship", ["exports"
|
|
7322
7342
|
}
|
7323
7343
|
};
|
7324
7344
|
});
|
7325
|
-
define('ember-data/-private/system/snapshot-record-array', ['exports'
|
7345
|
+
define('ember-data/-private/system/snapshot-record-array', ['exports'], function (exports) {
|
7326
7346
|
exports.default = SnapshotRecordArray;
|
7347
|
+
/**
|
7348
|
+
@module ember-data
|
7349
|
+
*/
|
7327
7350
|
|
7328
7351
|
/**
|
7329
7352
|
@class SnapshotRecordArray
|
@@ -7376,9 +7399,7 @@ define('ember-data/-private/system/snapshot-record-array', ['exports', 'ember-da
|
|
7376
7399
|
*/
|
7377
7400
|
this.adapterOptions = options.adapterOptions;
|
7378
7401
|
|
7379
|
-
|
7380
|
-
this.include = options.include;
|
7381
|
-
}
|
7402
|
+
this.include = options.include;
|
7382
7403
|
}
|
7383
7404
|
|
7384
7405
|
/**
|
@@ -7396,10 +7417,7 @@ define('ember-data/-private/system/snapshot-record-array', ['exports', 'ember-da
|
|
7396
7417
|
return this._snapshots;
|
7397
7418
|
};
|
7398
7419
|
});
|
7399
|
-
|
7400
|
-
@module ember-data
|
7401
|
-
*/
|
7402
|
-
define('ember-data/-private/system/snapshot', ['exports', 'ember', 'ember-data/-private/system/empty-object', 'ember-data/-private/features'], function (exports, _ember, _emberDataPrivateSystemEmptyObject, _emberDataPrivateFeatures) {
|
7420
|
+
define("ember-data/-private/system/snapshot", ["exports", "ember", "ember-data/-private/system/empty-object"], function (exports, _ember, _emberDataPrivateSystemEmptyObject) {
|
7403
7421
|
exports.default = Snapshot;
|
7404
7422
|
|
7405
7423
|
var get = _ember.default.get;
|
@@ -7441,9 +7459,7 @@ define('ember-data/-private/system/snapshot', ['exports', 'ember', 'ember-data/-
|
|
7441
7459
|
*/
|
7442
7460
|
this.adapterOptions = options.adapterOptions;
|
7443
7461
|
|
7444
|
-
|
7445
|
-
this.include = options.include;
|
7446
|
-
}
|
7462
|
+
this.include = options.include;
|
7447
7463
|
|
7448
7464
|
this._changedAttributes = record.changedAttributes();
|
7449
7465
|
}
|
@@ -7728,7 +7744,7 @@ define('ember-data/-private/system/snapshot', ['exports', 'ember', 'ember-data/-
|
|
7728
7744
|
@module ember-data
|
7729
7745
|
*/
|
7730
7746
|
define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/model', 'ember-data/-private/debug', 'ember-data/-private/system/normalize-link', 'ember-data/-private/system/normalize-model-name', 'ember-data/adapters/errors', 'ember-data/-private/system/promise-proxies', 'ember-data/-private/system/store/common', 'ember-data/-private/system/store/serializer-response', 'ember-data/-private/system/store/serializers', 'ember-data/-private/system/store/finders', 'ember-data/-private/utils', 'ember-data/-private/system/coerce-id', 'ember-data/-private/system/record-array-manager', 'ember-data/-private/system/store/container-instance-cache', 'ember-data/-private/system/model/internal-model', 'ember-data/-private/system/empty-object', 'ember-data/-private/features'], function (exports, _ember, _emberDataModel, _emberDataPrivateDebug, _emberDataPrivateSystemNormalizeLink, _emberDataPrivateSystemNormalizeModelName, _emberDataAdaptersErrors, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStoreCommon, _emberDataPrivateSystemStoreSerializerResponse, _emberDataPrivateSystemStoreSerializers, _emberDataPrivateSystemStoreFinders, _emberDataPrivateUtils, _emberDataPrivateSystemCoerceId, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateSystemStoreContainerInstanceCache, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemEmptyObject, _emberDataPrivateFeatures) {
|
7731
|
-
var badIdFormatAssertion = '`id` has to be non-empty string or number';
|
7747
|
+
var badIdFormatAssertion = '`id` passed to `findRecord()` has to be non-empty string or number';
|
7732
7748
|
|
7733
7749
|
exports.badIdFormatAssertion = badIdFormatAssertion;
|
7734
7750
|
var Backburner = _ember.default._Backburner;
|
@@ -8072,6 +8088,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8072
8088
|
method to find the necessary data. If the record is already present in the
|
8073
8089
|
store, it depends on the reload behavior _when_ the returned promise
|
8074
8090
|
resolves.
|
8091
|
+
### Reloading
|
8075
8092
|
The reload behavior is configured either via the passed `options` hash or
|
8076
8093
|
the result of the adapter's `shouldReloadRecord`.
|
8077
8094
|
If `{ reload: true }` is passed or `adapter.shouldReloadRecord` evaluates
|
@@ -8099,6 +8116,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8099
8116
|
```
|
8100
8117
|
If no reload is indicated via the abovementioned ways, then the promise
|
8101
8118
|
immediately resolves with the cached version in the store.
|
8119
|
+
### Background Reloading
|
8102
8120
|
Optionally, if `adapter.shouldBackgroundReloadRecord` evaluates to `true`,
|
8103
8121
|
then a background reload is started, which updates the records' data, once
|
8104
8122
|
it is available:
|
@@ -8133,6 +8151,40 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8133
8151
|
// }
|
8134
8152
|
// ]
|
8135
8153
|
blogPost.get('revision'); // 2
|
8154
|
+
```
|
8155
|
+
If you would like to force or prevent background reloading, you can set a
|
8156
|
+
boolean value for `backgroundReload` in the options object for
|
8157
|
+
`findRecord`.
|
8158
|
+
```app/routes/post/edit.js
|
8159
|
+
import Ember from 'ember';
|
8160
|
+
export default Ember.Route.extend({
|
8161
|
+
model: function(params) {
|
8162
|
+
return this.store.findRecord('post', params.post_id, { backgroundReload: false });
|
8163
|
+
}
|
8164
|
+
});
|
8165
|
+
```
|
8166
|
+
If you pass an object on the `adapterOptions` property of the options
|
8167
|
+
argument it will be passed to you adapter via the snapshot
|
8168
|
+
```app/routes/post/edit.js
|
8169
|
+
import Ember from 'ember';
|
8170
|
+
export default Ember.Route.extend({
|
8171
|
+
model: function(params) {
|
8172
|
+
return this.store.findRecord('post', params.post_id, {
|
8173
|
+
adapterOptions: { subscribe: false }
|
8174
|
+
});
|
8175
|
+
}
|
8176
|
+
});
|
8177
|
+
```
|
8178
|
+
```app/adapters/post.js
|
8179
|
+
import MyCustomAdapter from './custom-adapter';
|
8180
|
+
export default MyCustomAdapter.extend({
|
8181
|
+
findRecord: function(store, type, id, snapshot) {
|
8182
|
+
if (snapshot.adapterOptions.subscribe) {
|
8183
|
+
// ...
|
8184
|
+
}
|
8185
|
+
// ...
|
8186
|
+
}
|
8187
|
+
});
|
8136
8188
|
```
|
8137
8189
|
See [peekRecord](#method_peekRecord) to get the cached version of a record.
|
8138
8190
|
@method findRecord
|
@@ -8161,16 +8213,21 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8161
8213
|
return this.scheduleFetch(internalModel, options);
|
8162
8214
|
}
|
8163
8215
|
|
8164
|
-
// Refetch the record if the adapter thinks the record is stale
|
8165
8216
|
var snapshot = internalModel.createSnapshot(options);
|
8166
8217
|
var typeClass = internalModel.type;
|
8167
8218
|
var adapter = this.adapterFor(typeClass.modelName);
|
8219
|
+
|
8220
|
+
// Refetch the record if the adapter thinks the record is stale
|
8168
8221
|
if (adapter.shouldReloadRecord(this, snapshot)) {
|
8169
8222
|
return this.scheduleFetch(internalModel, options);
|
8170
8223
|
}
|
8171
8224
|
|
8172
|
-
|
8173
|
-
|
8225
|
+
if (options.backgroundReload === false) {
|
8226
|
+
return Promise.resolve(internalModel);
|
8227
|
+
}
|
8228
|
+
|
8229
|
+
// Trigger the background refetch if backgroundReload option is passed
|
8230
|
+
if (options.backgroundReload || adapter.shouldBackgroundReloadRecord(this, snapshot)) {
|
8174
8231
|
this.scheduleFetch(internalModel, options);
|
8175
8232
|
}
|
8176
8233
|
|
@@ -8372,6 +8429,38 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8372
8429
|
}
|
8373
8430
|
},
|
8374
8431
|
|
8432
|
+
/**
|
8433
|
+
Get the reference for the specified record.
|
8434
|
+
Example
|
8435
|
+
```javascript
|
8436
|
+
var userRef = store.getReference('user', 1);
|
8437
|
+
// check if the user is loaded
|
8438
|
+
var isLoaded = userRef.value() !== null;
|
8439
|
+
// get the record of the reference (null if not yet available)
|
8440
|
+
var user = userRef.value();
|
8441
|
+
// get the identifier of the reference
|
8442
|
+
if (userRef.remoteType() === "id") {
|
8443
|
+
var id = userRef.id();
|
8444
|
+
}
|
8445
|
+
// load user (via store.find)
|
8446
|
+
userRef.load().then(...)
|
8447
|
+
// or trigger a reload
|
8448
|
+
userRef.reload().then(...)
|
8449
|
+
// provide data for reference
|
8450
|
+
userRef.push({ id: 1, username: "@user" }).then(function(user) {
|
8451
|
+
userRef.value() === user;
|
8452
|
+
});
|
8453
|
+
```
|
8454
|
+
@method getReference
|
8455
|
+
@param {String} type
|
8456
|
+
@param {String|Integer} id
|
8457
|
+
@since 2.5.0
|
8458
|
+
@return {RecordReference}
|
8459
|
+
*/
|
8460
|
+
getReference: function (type, id) {
|
8461
|
+
return this._internalModelForId(type, id).recordReference;
|
8462
|
+
},
|
8463
|
+
|
8375
8464
|
/**
|
8376
8465
|
Get a record by a given type and ID without triggering a fetch.
|
8377
8466
|
This method will synchronously return the record if it is available in the store,
|
@@ -8637,7 +8726,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8637
8726
|
},
|
8638
8727
|
|
8639
8728
|
/**
|
8640
|
-
`findAll`
|
8729
|
+
`findAll` asks the adapter's `findAll` method to find the records for the
|
8641
8730
|
given type, and returns a promise which will resolve with all records of
|
8642
8731
|
this type present in the store, even if the adapter only returns a subset
|
8643
8732
|
of them.
|
@@ -8652,6 +8741,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8652
8741
|
_When_ the returned promise resolves depends on the reload behavior,
|
8653
8742
|
configured via the passed `options` hash and the result of the adapter's
|
8654
8743
|
`shouldReloadAll` method.
|
8744
|
+
### Reloading
|
8655
8745
|
If `{ reload: true }` is passed or `adapter.shouldReloadAll` evaluates to
|
8656
8746
|
`true`, then the returned promise resolves once the adapter returns data,
|
8657
8747
|
regardless if there are already records in the store:
|
@@ -8675,7 +8765,8 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8675
8765
|
```
|
8676
8766
|
If no reload is indicated via the abovementioned ways, then the promise
|
8677
8767
|
immediately resolves with all the records currently loaded in the store.
|
8678
|
-
|
8768
|
+
### Background Reloading
|
8769
|
+
Optionally, if `adapter.shouldBackgroundReloadAll` evaluates to `true`,
|
8679
8770
|
then a background reload is started. Once this resolves, the array with
|
8680
8771
|
which the promise resolves, is updated automatically so it contains all the
|
8681
8772
|
records in the store:
|
@@ -8710,7 +8801,41 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8710
8801
|
// ]
|
8711
8802
|
allAuthors.getEach('id'); // ['first', 'second']
|
8712
8803
|
```
|
8713
|
-
|
8804
|
+
If you would like to force or prevent background reloading, you can set a
|
8805
|
+
boolean value for `backgroundReload` in the options object for
|
8806
|
+
`findAll`.
|
8807
|
+
```app/routes/post/edit.js
|
8808
|
+
import Ember from 'ember';
|
8809
|
+
export default Ember.Route.extend({
|
8810
|
+
model: function() {
|
8811
|
+
return this.store.findAll('post', { backgroundReload: false });
|
8812
|
+
}
|
8813
|
+
});
|
8814
|
+
```
|
8815
|
+
If you pass an object on the `adapterOptions` property of the options
|
8816
|
+
argument it will be passed to you adapter via the `snapshotRecordArray`
|
8817
|
+
```app/routes/posts.js
|
8818
|
+
import Ember from 'ember';
|
8819
|
+
export default Ember.Route.extend({
|
8820
|
+
model: function(params) {
|
8821
|
+
return this.store.findAll('post', {
|
8822
|
+
adapterOptions: { subscribe: false }
|
8823
|
+
});
|
8824
|
+
}
|
8825
|
+
});
|
8826
|
+
```
|
8827
|
+
```app/adapters/post.js
|
8828
|
+
import MyCustomAdapter from './custom-adapter';
|
8829
|
+
export default MyCustomAdapter.extend({
|
8830
|
+
findAll: function(store, type, sinceToken, snapshotRecordArray) {
|
8831
|
+
if (snapshotRecordArray.adapterOptions.subscribe) {
|
8832
|
+
// ...
|
8833
|
+
}
|
8834
|
+
// ...
|
8835
|
+
}
|
8836
|
+
});
|
8837
|
+
```
|
8838
|
+
See [peekAll](#method_peekAll) to get an array of current records in the
|
8714
8839
|
store, without waiting until a reload is finished.
|
8715
8840
|
See [query](#method_query) to only get a subset of records from the server.
|
8716
8841
|
@method findAll
|
@@ -8741,13 +8866,21 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
8741
8866
|
if (options.reload) {
|
8742
8867
|
return (0, _emberDataPrivateSystemPromiseProxies.promiseArray)((0, _emberDataPrivateSystemStoreFinders._findAll)(adapter, this, typeClass, sinceToken, options));
|
8743
8868
|
}
|
8869
|
+
|
8744
8870
|
var snapshotArray = array.createSnapshot(options);
|
8871
|
+
|
8745
8872
|
if (adapter.shouldReloadAll(this, snapshotArray)) {
|
8746
8873
|
return (0, _emberDataPrivateSystemPromiseProxies.promiseArray)((0, _emberDataPrivateSystemStoreFinders._findAll)(adapter, this, typeClass, sinceToken, options));
|
8747
8874
|
}
|
8748
|
-
|
8875
|
+
|
8876
|
+
if (options.backgroundReload === false) {
|
8877
|
+
return (0, _emberDataPrivateSystemPromiseProxies.promiseArray)(Promise.resolve(array));
|
8878
|
+
}
|
8879
|
+
|
8880
|
+
if (options.backgroundReload || adapter.shouldBackgroundReloadAll(this, snapshotArray)) {
|
8749
8881
|
(0, _emberDataPrivateSystemStoreFinders._findAll)(adapter, this, typeClass, sinceToken, options);
|
8750
8882
|
}
|
8883
|
+
|
8751
8884
|
return (0, _emberDataPrivateSystemPromiseProxies.promiseArray)(Promise.resolve(array));
|
8752
8885
|
},
|
8753
8886
|
|
@@ -9421,15 +9554,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
9421
9554
|
|
9422
9555
|
serializer = this.serializerFor(modelName);
|
9423
9556
|
}
|
9424
|
-
|
9425
|
-
|
9426
|
-
|
9427
|
-
|
9428
|
-
} else {
|
9429
|
-
this._adapterRun(function () {
|
9430
|
-
return serializer.pushPayload(_this3, payload);
|
9431
|
-
});
|
9432
|
-
}
|
9557
|
+
|
9558
|
+
this._adapterRun(function () {
|
9559
|
+
return serializer.pushPayload(_this3, payload);
|
9560
|
+
});
|
9433
9561
|
},
|
9434
9562
|
|
9435
9563
|
/**
|
@@ -9613,42 +9741,6 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
|
|
9613
9741
|
|
9614
9742
|
});
|
9615
9743
|
|
9616
|
-
if (true) {
|
9617
|
-
|
9618
|
-
Store.reopen({
|
9619
|
-
/**
|
9620
|
-
Get the reference for the specified record.
|
9621
|
-
Example
|
9622
|
-
```javascript
|
9623
|
-
var userRef = store.getReference('user', 1);
|
9624
|
-
// check if the user is loaded
|
9625
|
-
var isLoaded = userRef.value() !== null;
|
9626
|
-
// get the record of the reference (null if not yet available)
|
9627
|
-
var user = userRef.value();
|
9628
|
-
// get the identifier of the reference
|
9629
|
-
if (userRef.remoteType() === "id") {
|
9630
|
-
var id = userRef.id();
|
9631
|
-
}
|
9632
|
-
// load user (via store.find)
|
9633
|
-
userRef.load().then(...)
|
9634
|
-
// or trigger a reload
|
9635
|
-
userRef.reload().then(...)
|
9636
|
-
// provide data for reference
|
9637
|
-
userRef.push({ id: 1, username: "@user" }).then(function(user) {
|
9638
|
-
userRef.value() === user;
|
9639
|
-
});
|
9640
|
-
```
|
9641
|
-
@method getReference
|
9642
|
-
@param {String} type
|
9643
|
-
@param {String|Integer} id
|
9644
|
-
@return {RecordReference}
|
9645
|
-
*/
|
9646
|
-
getReference: function (type, id) {
|
9647
|
-
return this._internalModelForId(type, id).recordReference;
|
9648
|
-
}
|
9649
|
-
});
|
9650
|
-
}
|
9651
|
-
|
9652
9744
|
function deserializeRecordId(store, key, relationship, id) {
|
9653
9745
|
if (isNone(id)) {
|
9654
9746
|
return;
|
@@ -10238,12 +10330,8 @@ define('ember-data/-private/transforms/boolean', ['exports', 'ember', 'ember-dat
|
|
10238
10330
|
deserialize: function (serialized, options) {
|
10239
10331
|
var type = typeof serialized;
|
10240
10332
|
|
10241
|
-
if (true) {
|
10242
|
-
|
10243
|
-
if (isNone(serialized) && options.allowNull === true) {
|
10244
|
-
return null;
|
10245
|
-
}
|
10246
|
-
}
|
10333
|
+
if (isNone(serialized) && options.allowNull === true) {
|
10334
|
+
return null;
|
10247
10335
|
}
|
10248
10336
|
|
10249
10337
|
if (type === "boolean") {
|
@@ -10258,25 +10346,21 @@ define('ember-data/-private/transforms/boolean', ['exports', 'ember', 'ember-dat
|
|
10258
10346
|
},
|
10259
10347
|
|
10260
10348
|
serialize: function (deserialized, options) {
|
10261
|
-
if (true) {
|
10262
|
-
|
10263
|
-
if (isNone(deserialized) && options.allowNull === true) {
|
10264
|
-
return null;
|
10265
|
-
}
|
10266
|
-
}
|
10349
|
+
if (isNone(deserialized) && options.allowNull === true) {
|
10350
|
+
return null;
|
10267
10351
|
}
|
10268
10352
|
|
10269
10353
|
return Boolean(deserialized);
|
10270
10354
|
}
|
10271
10355
|
});
|
10272
10356
|
});
|
10273
|
-
define("ember-data/-private/transforms/date", ["exports", "ember
|
10357
|
+
define("ember-data/-private/transforms/date", ["exports", "ember-data/-private/ext/date", "ember-data/transform"], function (exports, _emberDataPrivateExtDate, _emberDataTransform) {
|
10274
10358
|
exports.default = _emberDataTransform.default.extend({
|
10275
10359
|
deserialize: function (serialized) {
|
10276
10360
|
var type = typeof serialized;
|
10277
10361
|
|
10278
10362
|
if (type === "string") {
|
10279
|
-
return new Date(
|
10363
|
+
return new Date((0, _emberDataPrivateExtDate.parseDate)(serialized));
|
10280
10364
|
} else if (type === "number") {
|
10281
10365
|
return new Date(serialized);
|
10282
10366
|
} else if (serialized === null || serialized === undefined) {
|
@@ -10573,8 +10657,8 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
|
|
10573
10657
|
/**
|
10574
10658
|
The `findRecord()` method is invoked when the store is asked for a record that
|
10575
10659
|
has not previously been loaded. In response to `findRecord()` being called, you
|
10576
|
-
should query your persistence layer for a record with the given ID. The `findRecord`
|
10577
|
-
method should return a promise that will resolve to a JavaScript object that will be
|
10660
|
+
should query your persistence layer for a record with the given ID. The `findRecord`
|
10661
|
+
method should return a promise that will resolve to a JavaScript object that will be
|
10578
10662
|
normalized by the serializer.
|
10579
10663
|
Here is an example `findRecord` implementation:
|
10580
10664
|
```app/adapters/application.js
|
@@ -11064,9 +11148,6 @@ define('ember-data/adapters/errors', ['exports', 'ember', 'ember-data/-private/d
|
|
11064
11148
|
}
|
11065
11149
|
|
11066
11150
|
var extendedErrorsEnabled = false;
|
11067
|
-
if (false) {
|
11068
|
-
extendedErrorsEnabled = true;
|
11069
|
-
}
|
11070
11151
|
|
11071
11152
|
function extendFn(ErrorClass) {
|
11072
11153
|
return function () {
|
@@ -11353,12 +11434,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
|
|
11353
11434
|
@return {Promise} promise
|
11354
11435
|
*/
|
11355
11436
|
findMany: function (store, type, ids, snapshots) {
|
11356
|
-
|
11357
|
-
return this._super.apply(this, arguments);
|
11358
|
-
} else {
|
11359
|
-
var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
|
11360
|
-
return this.ajax(url, 'GET', { data: { filter: { id: ids.join(',') } } });
|
11361
|
-
}
|
11437
|
+
return this._super.apply(this, arguments);
|
11362
11438
|
},
|
11363
11439
|
|
11364
11440
|
/**
|
@@ -11380,80 +11456,65 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
|
|
11380
11456
|
@return {Promise} promise
|
11381
11457
|
*/
|
11382
11458
|
updateRecord: function (store, type, snapshot) {
|
11383
|
-
|
11384
|
-
return this._super.apply(this, arguments);
|
11385
|
-
} else {
|
11386
|
-
var data = {};
|
11387
|
-
var serializer = store.serializerFor(type.modelName);
|
11388
|
-
|
11389
|
-
serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
|
11390
|
-
|
11391
|
-
var id = snapshot.id;
|
11392
|
-
var url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');
|
11393
|
-
|
11394
|
-
return this.ajax(url, 'PATCH', { data: data });
|
11395
|
-
}
|
11459
|
+
return this._super.apply(this, arguments);
|
11396
11460
|
}
|
11397
11461
|
});
|
11398
11462
|
|
11399
|
-
|
11463
|
+
JSONAPIAdapter.reopen({
|
11400
11464
|
|
11401
|
-
|
11465
|
+
methodForRequest: function (params) {
|
11466
|
+
if (params.requestType === 'updateRecord') {
|
11467
|
+
return 'PATCH';
|
11468
|
+
}
|
11402
11469
|
|
11403
|
-
|
11404
|
-
|
11405
|
-
return 'PATCH';
|
11406
|
-
}
|
11470
|
+
return this._super.apply(this, arguments);
|
11471
|
+
},
|
11407
11472
|
|
11408
|
-
|
11409
|
-
|
11473
|
+
dataForRequest: function (params) {
|
11474
|
+
var requestType = params.requestType;
|
11475
|
+
var ids = params.ids;
|
11410
11476
|
|
11411
|
-
|
11412
|
-
|
11413
|
-
|
11477
|
+
if (requestType === 'findMany') {
|
11478
|
+
return {
|
11479
|
+
filter: { id: ids.join(',') }
|
11480
|
+
};
|
11481
|
+
}
|
11414
11482
|
|
11415
|
-
|
11416
|
-
|
11417
|
-
|
11418
|
-
|
11419
|
-
}
|
11420
|
-
|
11421
|
-
if (requestType === 'updateRecord') {
|
11422
|
-
var store = params.store;
|
11423
|
-
var type = params.type;
|
11424
|
-
var snapshot = params.snapshot;
|
11425
|
-
|
11426
|
-
var data = {};
|
11427
|
-
var serializer = store.serializerFor(type.modelName);
|
11483
|
+
if (requestType === 'updateRecord') {
|
11484
|
+
var store = params.store;
|
11485
|
+
var type = params.type;
|
11486
|
+
var snapshot = params.snapshot;
|
11428
11487
|
|
11429
|
-
|
11488
|
+
var data = {};
|
11489
|
+
var serializer = store.serializerFor(type.modelName);
|
11430
11490
|
|
11431
|
-
|
11432
|
-
}
|
11491
|
+
serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
|
11433
11492
|
|
11434
|
-
return
|
11435
|
-
}
|
11493
|
+
return data;
|
11494
|
+
}
|
11436
11495
|
|
11437
|
-
|
11438
|
-
|
11496
|
+
return this._super.apply(this, arguments);
|
11497
|
+
},
|
11439
11498
|
|
11440
|
-
|
11499
|
+
headersForRequest: function () {
|
11500
|
+
var headers = this._super.apply(this, arguments) || {};
|
11441
11501
|
|
11442
|
-
|
11443
|
-
},
|
11502
|
+
headers['Accept'] = 'application/vnd.api+json';
|
11444
11503
|
|
11445
|
-
|
11446
|
-
|
11504
|
+
return headers;
|
11505
|
+
},
|
11447
11506
|
|
11448
|
-
|
11449
|
-
|
11450
|
-
}
|
11507
|
+
_requestToJQueryAjaxHash: function () {
|
11508
|
+
var hash = this._super.apply(this, arguments);
|
11451
11509
|
|
11452
|
-
|
11510
|
+
if (hash.contentType) {
|
11511
|
+
hash.contentType = 'application/vnd.api+json';
|
11453
11512
|
}
|
11454
11513
|
|
11455
|
-
|
11456
|
-
|
11514
|
+
return hash;
|
11515
|
+
}
|
11516
|
+
|
11517
|
+
});
|
11457
11518
|
|
11458
11519
|
exports.default = JSONAPIAdapter;
|
11459
11520
|
});
|
@@ -11821,19 +11882,12 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
11821
11882
|
@return {Promise} promise
|
11822
11883
|
*/
|
11823
11884
|
findRecord: function (store, type, id, snapshot) {
|
11824
|
-
|
11825
|
-
|
11826
|
-
|
11827
|
-
|
11828
|
-
});
|
11829
|
-
|
11830
|
-
return this._makeRequest(request);
|
11831
|
-
} else {
|
11832
|
-
var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');
|
11833
|
-
var query = this.buildQuery(snapshot);
|
11885
|
+
var request = this._requestFor({
|
11886
|
+
store: store, type: type, id: id, snapshot: snapshot,
|
11887
|
+
requestType: 'findRecord'
|
11888
|
+
});
|
11834
11889
|
|
11835
|
-
|
11836
|
-
}
|
11890
|
+
return this._makeRequest(request);
|
11837
11891
|
},
|
11838
11892
|
|
11839
11893
|
/**
|
@@ -11851,23 +11905,13 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
11851
11905
|
findAll: function (store, type, sinceToken, snapshotRecordArray) {
|
11852
11906
|
var query = this.buildQuery(snapshotRecordArray);
|
11853
11907
|
|
11854
|
-
|
11855
|
-
|
11856
|
-
|
11857
|
-
|
11858
|
-
|
11859
|
-
});
|
11860
|
-
|
11861
|
-
return this._makeRequest(request);
|
11862
|
-
} else {
|
11863
|
-
var url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');
|
11864
|
-
|
11865
|
-
if (sinceToken) {
|
11866
|
-
query.since = sinceToken;
|
11867
|
-
}
|
11908
|
+
var request = this._requestFor({
|
11909
|
+
store: store, type: type, sinceToken: sinceToken, query: query,
|
11910
|
+
snapshots: snapshotRecordArray,
|
11911
|
+
requestType: 'findAll'
|
11912
|
+
});
|
11868
11913
|
|
11869
|
-
|
11870
|
-
}
|
11914
|
+
return this._makeRequest(request);
|
11871
11915
|
},
|
11872
11916
|
|
11873
11917
|
/**
|
@@ -11885,22 +11929,12 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
11885
11929
|
@return {Promise} promise
|
11886
11930
|
*/
|
11887
11931
|
query: function (store, type, query) {
|
11888
|
-
|
11889
|
-
|
11890
|
-
|
11891
|
-
|
11892
|
-
});
|
11893
|
-
|
11894
|
-
return this._makeRequest(request);
|
11895
|
-
} else {
|
11896
|
-
var url = this.buildURL(type.modelName, null, null, 'query', query);
|
11897
|
-
|
11898
|
-
if (this.sortQueryParams) {
|
11899
|
-
query = this.sortQueryParams(query);
|
11900
|
-
}
|
11932
|
+
var request = this._requestFor({
|
11933
|
+
store: store, type: type, query: query,
|
11934
|
+
requestType: 'query'
|
11935
|
+
});
|
11901
11936
|
|
11902
|
-
|
11903
|
-
}
|
11937
|
+
return this._makeRequest(request);
|
11904
11938
|
},
|
11905
11939
|
|
11906
11940
|
/**
|
@@ -11918,22 +11952,12 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
11918
11952
|
@return {Promise} promise
|
11919
11953
|
*/
|
11920
11954
|
queryRecord: function (store, type, query) {
|
11921
|
-
|
11922
|
-
|
11923
|
-
|
11924
|
-
|
11925
|
-
});
|
11926
|
-
|
11927
|
-
return this._makeRequest(request);
|
11928
|
-
} else {
|
11929
|
-
var url = this.buildURL(type.modelName, null, null, 'queryRecord', query);
|
11930
|
-
|
11931
|
-
if (this.sortQueryParams) {
|
11932
|
-
query = this.sortQueryParams(query);
|
11933
|
-
}
|
11955
|
+
var request = this._requestFor({
|
11956
|
+
store: store, type: type, query: query,
|
11957
|
+
requestType: 'queryRecord'
|
11958
|
+
});
|
11934
11959
|
|
11935
|
-
|
11936
|
-
}
|
11960
|
+
return this._makeRequest(request);
|
11937
11961
|
},
|
11938
11962
|
|
11939
11963
|
/**
|
@@ -11963,17 +11987,12 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
11963
11987
|
@return {Promise} promise
|
11964
11988
|
*/
|
11965
11989
|
findMany: function (store, type, ids, snapshots) {
|
11966
|
-
|
11967
|
-
|
11968
|
-
|
11969
|
-
|
11970
|
-
});
|
11990
|
+
var request = this._requestFor({
|
11991
|
+
store: store, type: type, ids: ids, snapshots: snapshots,
|
11992
|
+
requestType: 'findMany'
|
11993
|
+
});
|
11971
11994
|
|
11972
|
-
|
11973
|
-
} else {
|
11974
|
-
var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
|
11975
|
-
return this.ajax(url, 'GET', { data: { ids: ids } });
|
11976
|
-
}
|
11995
|
+
return this._makeRequest(request);
|
11977
11996
|
},
|
11978
11997
|
|
11979
11998
|
/**
|
@@ -12003,21 +12022,12 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12003
12022
|
@return {Promise} promise
|
12004
12023
|
*/
|
12005
12024
|
findHasMany: function (store, snapshot, url, relationship) {
|
12006
|
-
|
12007
|
-
|
12008
|
-
|
12009
|
-
|
12010
|
-
});
|
12011
|
-
|
12012
|
-
return this._makeRequest(request);
|
12013
|
-
} else {
|
12014
|
-
var id = snapshot.id;
|
12015
|
-
var type = snapshot.modelName;
|
12016
|
-
|
12017
|
-
url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findHasMany'));
|
12025
|
+
var request = this._requestFor({
|
12026
|
+
store: store, snapshot: snapshot, url: url, relationship: relationship,
|
12027
|
+
requestType: 'findHasMany'
|
12028
|
+
});
|
12018
12029
|
|
12019
|
-
|
12020
|
-
}
|
12030
|
+
return this._makeRequest(request);
|
12021
12031
|
},
|
12022
12032
|
|
12023
12033
|
/**
|
@@ -12047,20 +12057,12 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12047
12057
|
@return {Promise} promise
|
12048
12058
|
*/
|
12049
12059
|
findBelongsTo: function (store, snapshot, url, relationship) {
|
12050
|
-
|
12051
|
-
|
12052
|
-
|
12053
|
-
|
12054
|
-
});
|
12055
|
-
|
12056
|
-
return this._makeRequest(request);
|
12057
|
-
} else {
|
12058
|
-
var id = snapshot.id;
|
12059
|
-
var type = snapshot.modelName;
|
12060
|
+
var request = this._requestFor({
|
12061
|
+
store: store, snapshot: snapshot, url: url, relationship: relationship,
|
12062
|
+
requestType: 'findBelongsTo'
|
12063
|
+
});
|
12060
12064
|
|
12061
|
-
|
12062
|
-
return this.ajax(url, 'GET');
|
12063
|
-
}
|
12065
|
+
return this._makeRequest(request);
|
12064
12066
|
},
|
12065
12067
|
|
12066
12068
|
/**
|
@@ -12077,22 +12079,12 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12077
12079
|
@return {Promise} promise
|
12078
12080
|
*/
|
12079
12081
|
createRecord: function (store, type, snapshot) {
|
12080
|
-
|
12081
|
-
|
12082
|
-
|
12083
|
-
|
12084
|
-
});
|
12085
|
-
|
12086
|
-
return this._makeRequest(request);
|
12087
|
-
} else {
|
12088
|
-
var data = {};
|
12089
|
-
var serializer = store.serializerFor(type.modelName);
|
12090
|
-
var url = this.buildURL(type.modelName, null, snapshot, 'createRecord');
|
12091
|
-
|
12092
|
-
serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
|
12082
|
+
var request = this._requestFor({
|
12083
|
+
store: store, type: type, snapshot: snapshot,
|
12084
|
+
requestType: 'createRecord'
|
12085
|
+
});
|
12093
12086
|
|
12094
|
-
|
12095
|
-
}
|
12087
|
+
return this._makeRequest(request);
|
12096
12088
|
},
|
12097
12089
|
|
12098
12090
|
/**
|
@@ -12109,24 +12101,12 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12109
12101
|
@return {Promise} promise
|
12110
12102
|
*/
|
12111
12103
|
updateRecord: function (store, type, snapshot) {
|
12112
|
-
|
12113
|
-
|
12114
|
-
|
12115
|
-
|
12116
|
-
});
|
12117
|
-
|
12118
|
-
return this._makeRequest(request);
|
12119
|
-
} else {
|
12120
|
-
var data = {};
|
12121
|
-
var serializer = store.serializerFor(type.modelName);
|
12122
|
-
|
12123
|
-
serializer.serializeIntoHash(data, type, snapshot);
|
12124
|
-
|
12125
|
-
var id = snapshot.id;
|
12126
|
-
var url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');
|
12104
|
+
var request = this._requestFor({
|
12105
|
+
store: store, type: type, snapshot: snapshot,
|
12106
|
+
requestType: 'updateRecord'
|
12107
|
+
});
|
12127
12108
|
|
12128
|
-
|
12129
|
-
}
|
12109
|
+
return this._makeRequest(request);
|
12130
12110
|
},
|
12131
12111
|
|
12132
12112
|
/**
|
@@ -12139,28 +12119,26 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12139
12119
|
@return {Promise} promise
|
12140
12120
|
*/
|
12141
12121
|
deleteRecord: function (store, type, snapshot) {
|
12142
|
-
|
12143
|
-
|
12144
|
-
|
12145
|
-
|
12146
|
-
});
|
12147
|
-
|
12148
|
-
return this._makeRequest(request);
|
12149
|
-
} else {
|
12150
|
-
var id = snapshot.id;
|
12122
|
+
var request = this._requestFor({
|
12123
|
+
store: store, type: type, snapshot: snapshot,
|
12124
|
+
requestType: 'deleteRecord'
|
12125
|
+
});
|
12151
12126
|
|
12152
|
-
|
12153
|
-
}
|
12127
|
+
return this._makeRequest(request);
|
12154
12128
|
},
|
12155
12129
|
|
12156
12130
|
_stripIDFromURL: function (store, snapshot) {
|
12157
12131
|
var url = this.buildURL(snapshot.modelName, snapshot.id, snapshot);
|
12158
12132
|
|
12159
12133
|
var expandedURL = url.split('/');
|
12160
|
-
//Case when the url is of the format ...something/:id
|
12134
|
+
// Case when the url is of the format ...something/:id
|
12135
|
+
// We are decodeURIComponent-ing the lastSegment because if it represents
|
12136
|
+
// the id, it has been encodeURIComponent-ified within `buildURL`. If we
|
12137
|
+
// don't do this, then records with id having special characters are not
|
12138
|
+
// coalesced correctly (see GH #4190 for the reported bug)
|
12161
12139
|
var lastSegment = expandedURL[expandedURL.length - 1];
|
12162
12140
|
var id = snapshot.id;
|
12163
|
-
if (lastSegment === id) {
|
12141
|
+
if (decodeURIComponent(lastSegment) === id) {
|
12164
12142
|
expandedURL[expandedURL.length - 1] = "";
|
12165
12143
|
} else if (endsWith(lastSegment, '?id=' + id)) {
|
12166
12144
|
//Case when the url is of the format ...something?id=:id
|
@@ -12270,23 +12248,6 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12270
12248
|
var errors = this.normalizeErrorResponse(status, headers, payload);
|
12271
12249
|
var detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);
|
12272
12250
|
|
12273
|
-
if (false) {
|
12274
|
-
switch (status) {
|
12275
|
-
case 401:
|
12276
|
-
return new _emberDataAdaptersErrors.UnauthorizedError(errors, detailedMessage);
|
12277
|
-
case 403:
|
12278
|
-
return new _emberDataAdaptersErrors.ForbiddenError(errors, detailedMessage);
|
12279
|
-
case 404:
|
12280
|
-
return new _emberDataAdaptersErrors.NotFoundError(errors, detailedMessage);
|
12281
|
-
case 409:
|
12282
|
-
return new _emberDataAdaptersErrors.ConflictError(errors, detailedMessage);
|
12283
|
-
default:
|
12284
|
-
if (status >= 500) {
|
12285
|
-
return new _emberDataAdaptersErrors.ServerError(errors, detailedMessage);
|
12286
|
-
}
|
12287
|
-
}
|
12288
|
-
}
|
12289
|
-
|
12290
12251
|
return new _emberDataAdaptersErrors.AdapterError(errors, detailedMessage);
|
12291
12252
|
},
|
12292
12253
|
|
@@ -12431,7 +12392,9 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12431
12392
|
|
12432
12393
|
try {
|
12433
12394
|
json = _ember.default.$.parseJSON(responseText);
|
12434
|
-
} catch (e) {
|
12395
|
+
} catch (e) {
|
12396
|
+
// ignored
|
12397
|
+
}
|
12435
12398
|
|
12436
12399
|
return json;
|
12437
12400
|
},
|
@@ -12486,13 +12449,11 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12486
12449
|
buildQuery: function (snapshot) {
|
12487
12450
|
var query = {};
|
12488
12451
|
|
12489
|
-
if (
|
12490
|
-
|
12491
|
-
var include = snapshot.include;
|
12452
|
+
if (snapshot) {
|
12453
|
+
var include = snapshot.include;
|
12492
12454
|
|
12493
|
-
|
12494
|
-
|
12495
|
-
}
|
12455
|
+
if (include) {
|
12456
|
+
query.include = include;
|
12496
12457
|
}
|
12497
12458
|
}
|
12498
12459
|
|
@@ -12500,258 +12461,257 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
|
|
12500
12461
|
}
|
12501
12462
|
});
|
12502
12463
|
|
12503
|
-
|
12504
|
-
|
12505
|
-
RESTAdapter.reopen({
|
12464
|
+
RESTAdapter.reopen({
|
12506
12465
|
|
12507
|
-
|
12508
|
-
|
12509
|
-
|
12510
|
-
|
12511
|
-
|
12512
|
-
|
12513
|
-
|
12514
|
-
|
12515
|
-
|
12516
|
-
|
12517
|
-
|
12518
|
-
|
12519
|
-
|
12520
|
-
|
12466
|
+
/**
|
12467
|
+
* Get the data (body or query params) for a request.
|
12468
|
+
*
|
12469
|
+
* @public
|
12470
|
+
* @method dataForRequest
|
12471
|
+
* @param {Object} params
|
12472
|
+
* @return {Object} data
|
12473
|
+
*/
|
12474
|
+
dataForRequest: function (params) {
|
12475
|
+
var store = params.store;
|
12476
|
+
var type = params.type;
|
12477
|
+
var snapshot = params.snapshot;
|
12478
|
+
var requestType = params.requestType;
|
12479
|
+
var query = params.query;
|
12521
12480
|
|
12522
|
-
|
12523
|
-
|
12481
|
+
// type is not passed to findBelongsTo and findHasMany
|
12482
|
+
type = type || snapshot && snapshot.type;
|
12524
12483
|
|
12525
|
-
|
12526
|
-
|
12484
|
+
var serializer = store.serializerFor(type.modelName);
|
12485
|
+
var data = {};
|
12527
12486
|
|
12528
|
-
|
12529
|
-
|
12530
|
-
|
12531
|
-
|
12487
|
+
switch (requestType) {
|
12488
|
+
case 'createRecord':
|
12489
|
+
serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
|
12490
|
+
break;
|
12532
12491
|
|
12533
|
-
|
12534
|
-
|
12535
|
-
|
12492
|
+
case 'updateRecord':
|
12493
|
+
serializer.serializeIntoHash(data, type, snapshot);
|
12494
|
+
break;
|
12536
12495
|
|
12537
|
-
|
12538
|
-
|
12539
|
-
|
12496
|
+
case 'findRecord':
|
12497
|
+
data = this.buildQuery(snapshot);
|
12498
|
+
break;
|
12540
12499
|
|
12541
|
-
|
12542
|
-
|
12543
|
-
|
12544
|
-
|
12545
|
-
|
12546
|
-
|
12547
|
-
|
12500
|
+
case 'findAll':
|
12501
|
+
if (params.sinceToken) {
|
12502
|
+
query = query || {};
|
12503
|
+
query.since = params.sinceToken;
|
12504
|
+
}
|
12505
|
+
data = query;
|
12506
|
+
break;
|
12548
12507
|
|
12549
|
-
|
12550
|
-
|
12551
|
-
|
12552
|
-
|
12553
|
-
|
12554
|
-
|
12555
|
-
|
12508
|
+
case 'query':
|
12509
|
+
case 'queryRecord':
|
12510
|
+
if (this.sortQueryParams) {
|
12511
|
+
query = this.sortQueryParams(query);
|
12512
|
+
}
|
12513
|
+
data = query;
|
12514
|
+
break;
|
12556
12515
|
|
12557
|
-
|
12558
|
-
|
12559
|
-
|
12516
|
+
case 'findMany':
|
12517
|
+
data = { ids: params.ids };
|
12518
|
+
break;
|
12560
12519
|
|
12561
|
-
|
12562
|
-
|
12563
|
-
|
12564
|
-
|
12520
|
+
default:
|
12521
|
+
data = undefined;
|
12522
|
+
break;
|
12523
|
+
}
|
12565
12524
|
|
12566
|
-
|
12567
|
-
|
12525
|
+
return data;
|
12526
|
+
},
|
12568
12527
|
|
12569
|
-
|
12570
|
-
|
12571
|
-
|
12572
|
-
|
12573
|
-
|
12574
|
-
|
12575
|
-
|
12576
|
-
|
12577
|
-
|
12578
|
-
|
12579
|
-
|
12580
|
-
switch (requestType) {
|
12581
|
-
case 'createRecord':
|
12582
|
-
return 'POST';
|
12583
|
-
case 'updateRecord':
|
12584
|
-
return 'PUT';
|
12585
|
-
case 'deleteRecord':
|
12586
|
-
return 'DELETE';
|
12587
|
-
}
|
12528
|
+
/**
|
12529
|
+
* Get the HTTP method for a request.
|
12530
|
+
*
|
12531
|
+
* @public
|
12532
|
+
* @method methodForRequest
|
12533
|
+
* @param {Object} params
|
12534
|
+
* @return {String} HTTP method
|
12535
|
+
*/
|
12536
|
+
methodForRequest: function (params) {
|
12537
|
+
var requestType = params.requestType;
|
12588
12538
|
|
12589
|
-
|
12590
|
-
|
12539
|
+
switch (requestType) {
|
12540
|
+
case 'createRecord':
|
12541
|
+
return 'POST';
|
12542
|
+
case 'updateRecord':
|
12543
|
+
return 'PUT';
|
12544
|
+
case 'deleteRecord':
|
12545
|
+
return 'DELETE';
|
12546
|
+
}
|
12591
12547
|
|
12592
|
-
|
12593
|
-
|
12594
|
-
*
|
12595
|
-
* @public
|
12596
|
-
* @method urlForRequest
|
12597
|
-
* @param {Object} params
|
12598
|
-
* @return {String} URL
|
12599
|
-
*/
|
12600
|
-
urlForRequest: function (params) {
|
12601
|
-
var type = params.type;
|
12602
|
-
var id = params.id;
|
12603
|
-
var ids = params.ids;
|
12604
|
-
var snapshot = params.snapshot;
|
12605
|
-
var snapshots = params.snapshots;
|
12606
|
-
var requestType = params.requestType;
|
12607
|
-
var query = params.query;
|
12548
|
+
return 'GET';
|
12549
|
+
},
|
12608
12550
|
|
12609
|
-
|
12610
|
-
|
12611
|
-
|
12612
|
-
|
12551
|
+
/**
|
12552
|
+
* Get the URL for a request.
|
12553
|
+
*
|
12554
|
+
* @public
|
12555
|
+
* @method urlForRequest
|
12556
|
+
* @param {Object} params
|
12557
|
+
* @return {String} URL
|
12558
|
+
*/
|
12559
|
+
urlForRequest: function (params) {
|
12560
|
+
var type = params.type;
|
12561
|
+
var id = params.id;
|
12562
|
+
var ids = params.ids;
|
12563
|
+
var snapshot = params.snapshot;
|
12564
|
+
var snapshots = params.snapshots;
|
12565
|
+
var requestType = params.requestType;
|
12566
|
+
var query = params.query;
|
12567
|
+
|
12568
|
+
// type and id are not passed from updateRecord and deleteRecord, hence they
|
12569
|
+
// are defined if not set
|
12570
|
+
type = type || snapshot && snapshot.type;
|
12571
|
+
id = id || snapshot && snapshot.id;
|
12613
12572
|
|
12614
|
-
|
12615
|
-
|
12616
|
-
|
12573
|
+
switch (requestType) {
|
12574
|
+
case 'findAll':
|
12575
|
+
return this.buildURL(type.modelName, null, snapshots, requestType);
|
12617
12576
|
|
12618
|
-
|
12619
|
-
|
12620
|
-
|
12577
|
+
case 'query':
|
12578
|
+
case 'queryRecord':
|
12579
|
+
return this.buildURL(type.modelName, null, null, requestType, query);
|
12621
12580
|
|
12622
|
-
|
12623
|
-
|
12581
|
+
case 'findMany':
|
12582
|
+
return this.buildURL(type.modelName, ids, snapshots, requestType);
|
12624
12583
|
|
12625
|
-
|
12626
|
-
|
12584
|
+
case 'findHasMany':
|
12585
|
+
case 'findBelongsTo':
|
12586
|
+
{
|
12627
12587
|
var url = this.buildURL(type.modelName, id, snapshot, requestType);
|
12628
12588
|
return this.urlPrefix(params.url, url);
|
12629
|
-
|
12589
|
+
}
|
12590
|
+
}
|
12630
12591
|
|
12631
|
-
|
12632
|
-
|
12592
|
+
return this.buildURL(type.modelName, id, snapshot, requestType, query);
|
12593
|
+
},
|
12633
12594
|
|
12634
|
-
|
12635
|
-
|
12636
|
-
|
12637
|
-
|
12638
|
-
|
12639
|
-
|
12640
|
-
|
12641
|
-
|
12642
|
-
|
12643
|
-
|
12644
|
-
|
12645
|
-
|
12646
|
-
|
12647
|
-
|
12595
|
+
/**
|
12596
|
+
* Get the headers for a request.
|
12597
|
+
*
|
12598
|
+
* By default the value of the `headers` property of the adapter is
|
12599
|
+
* returned.
|
12600
|
+
*
|
12601
|
+
* @public
|
12602
|
+
* @method headersForRequest
|
12603
|
+
* @param {Object} params
|
12604
|
+
* @return {Object} headers
|
12605
|
+
*/
|
12606
|
+
headersForRequest: function (params) {
|
12607
|
+
return this.get('headers');
|
12608
|
+
},
|
12648
12609
|
|
12649
|
-
|
12650
|
-
|
12651
|
-
|
12652
|
-
|
12653
|
-
|
12654
|
-
|
12655
|
-
|
12656
|
-
|
12657
|
-
|
12658
|
-
|
12659
|
-
|
12660
|
-
|
12661
|
-
|
12662
|
-
|
12663
|
-
|
12664
|
-
return { method: method, url: url, headers: headers, data: data };
|
12665
|
-
},
|
12610
|
+
/**
|
12611
|
+
* Get an object which contains all properties for a request which should
|
12612
|
+
* be made.
|
12613
|
+
*
|
12614
|
+
* @private
|
12615
|
+
* @method _requestFor
|
12616
|
+
* @param {Object} params
|
12617
|
+
* @return {Object} request object
|
12618
|
+
*/
|
12619
|
+
_requestFor: function (params) {
|
12620
|
+
var method = this.methodForRequest(params);
|
12621
|
+
var url = this.urlForRequest(params);
|
12622
|
+
var headers = this.headersForRequest(params);
|
12623
|
+
var data = this.dataForRequest(params);
|
12666
12624
|
|
12667
|
-
|
12668
|
-
|
12669
|
-
*
|
12670
|
-
* @private
|
12671
|
-
* @method _requestToJQueryAjaxHash
|
12672
|
-
* @param {Object} request
|
12673
|
-
* @return {Object} jQuery ajax hash
|
12674
|
-
*/
|
12675
|
-
_requestToJQueryAjaxHash: function (request) {
|
12676
|
-
var hash = {};
|
12677
|
-
|
12678
|
-
hash.type = request.method;
|
12679
|
-
hash.url = request.url;
|
12680
|
-
hash.dataType = 'json';
|
12681
|
-
hash.context = this;
|
12682
|
-
|
12683
|
-
if (request.data) {
|
12684
|
-
if (request.type !== 'GET') {
|
12685
|
-
hash.contentType = 'application/json; charset=utf-8';
|
12686
|
-
hash.data = JSON.stringify(request.data);
|
12687
|
-
} else {
|
12688
|
-
hash.data = request.data;
|
12689
|
-
}
|
12690
|
-
}
|
12625
|
+
return { method: method, url: url, headers: headers, data: data };
|
12626
|
+
},
|
12691
12627
|
|
12692
|
-
|
12693
|
-
|
12694
|
-
|
12695
|
-
|
12696
|
-
|
12697
|
-
|
12698
|
-
|
12628
|
+
/**
|
12629
|
+
* Convert a request object into a hash which can be passed to `jQuery.ajax`.
|
12630
|
+
*
|
12631
|
+
* @private
|
12632
|
+
* @method _requestToJQueryAjaxHash
|
12633
|
+
* @param {Object} request
|
12634
|
+
* @return {Object} jQuery ajax hash
|
12635
|
+
*/
|
12636
|
+
_requestToJQueryAjaxHash: function (request) {
|
12637
|
+
var hash = {};
|
12638
|
+
|
12639
|
+
hash.type = request.method;
|
12640
|
+
hash.url = request.url;
|
12641
|
+
hash.dataType = 'json';
|
12642
|
+
hash.context = this;
|
12643
|
+
|
12644
|
+
if (request.data) {
|
12645
|
+
if (request.type !== 'GET') {
|
12646
|
+
hash.contentType = 'application/json; charset=utf-8';
|
12647
|
+
hash.data = JSON.stringify(request.data);
|
12648
|
+
} else {
|
12649
|
+
hash.data = request.data;
|
12699
12650
|
}
|
12651
|
+
}
|
12700
12652
|
|
12701
|
-
|
12702
|
-
|
12653
|
+
var headers = request.headers;
|
12654
|
+
if (headers !== undefined) {
|
12655
|
+
hash.beforeSend = function (xhr) {
|
12656
|
+
Object.keys(headers).forEach(function (key) {
|
12657
|
+
return xhr.setRequestHeader(key, headers[key]);
|
12658
|
+
});
|
12659
|
+
};
|
12660
|
+
}
|
12703
12661
|
|
12704
|
-
|
12705
|
-
|
12706
|
-
*
|
12707
|
-
* @private
|
12708
|
-
* @method _makeRequest
|
12709
|
-
* @param {Object} request
|
12710
|
-
* @return {Promise} promise
|
12711
|
-
*/
|
12712
|
-
_makeRequest: function (request) {
|
12713
|
-
var adapter = this;
|
12714
|
-
var hash = this._requestToJQueryAjaxHash(request);
|
12662
|
+
return hash;
|
12663
|
+
},
|
12715
12664
|
|
12716
|
-
|
12717
|
-
|
12665
|
+
/**
|
12666
|
+
* Make a request using `jQuery.ajax`.
|
12667
|
+
*
|
12668
|
+
* @private
|
12669
|
+
* @method _makeRequest
|
12670
|
+
* @param {Object} request
|
12671
|
+
* @return {Promise} promise
|
12672
|
+
*/
|
12673
|
+
_makeRequest: function (request) {
|
12674
|
+
var adapter = this;
|
12675
|
+
var hash = this._requestToJQueryAjaxHash(request);
|
12718
12676
|
|
12719
|
-
|
12677
|
+
var method = request.method;
|
12678
|
+
var url = request.url;
|
12720
12679
|
|
12721
|
-
|
12680
|
+
var requestData = { method: method, url: url };
|
12722
12681
|
|
12723
|
-
|
12724
|
-
var response = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);
|
12682
|
+
return new _ember.default.RSVP.Promise(function (resolve, reject) {
|
12725
12683
|
|
12726
|
-
|
12727
|
-
|
12728
|
-
} else {
|
12729
|
-
_ember.default.run.join(null, resolve, response);
|
12730
|
-
}
|
12731
|
-
};
|
12684
|
+
hash.success = function (payload, textStatus, jqXHR) {
|
12685
|
+
var response = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);
|
12732
12686
|
|
12733
|
-
|
12687
|
+
if (response instanceof _emberDataAdaptersErrors.AdapterError) {
|
12688
|
+
_ember.default.run.join(null, reject, response);
|
12689
|
+
} else {
|
12690
|
+
_ember.default.run.join(null, resolve, response);
|
12691
|
+
}
|
12692
|
+
};
|
12734
12693
|
|
12735
|
-
|
12694
|
+
hash.error = function (jqXHR, textStatus, errorThrown) {
|
12736
12695
|
|
12737
|
-
|
12738
|
-
error = errorThrown;
|
12739
|
-
} else if (textStatus === 'timeout') {
|
12740
|
-
error = new _emberDataAdaptersErrors.TimeoutError();
|
12741
|
-
} else if (textStatus === 'abort') {
|
12742
|
-
error = new _emberDataAdaptersErrors.AbortError();
|
12743
|
-
} else {
|
12744
|
-
error = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), adapter.parseErrorResponse(jqXHR.responseText) || errorThrown, requestData);
|
12745
|
-
}
|
12696
|
+
var error = undefined;
|
12746
12697
|
|
12747
|
-
|
12748
|
-
|
12698
|
+
if (errorThrown instanceof Error) {
|
12699
|
+
error = errorThrown;
|
12700
|
+
} else if (textStatus === 'timeout') {
|
12701
|
+
error = new _emberDataAdaptersErrors.TimeoutError();
|
12702
|
+
} else if (textStatus === 'abort') {
|
12703
|
+
error = new _emberDataAdaptersErrors.AbortError();
|
12704
|
+
} else {
|
12705
|
+
error = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), adapter.parseErrorResponse(jqXHR.responseText) || errorThrown, requestData);
|
12706
|
+
}
|
12749
12707
|
|
12750
|
-
|
12751
|
-
}
|
12752
|
-
|
12753
|
-
|
12754
|
-
|
12708
|
+
_ember.default.run.join(null, reject, error);
|
12709
|
+
};
|
12710
|
+
|
12711
|
+
adapter._ajaxRequest(hash);
|
12712
|
+
}, 'DS: RESTAdapter#makeRequest: ' + method + ' ' + url);
|
12713
|
+
}
|
12714
|
+
});
|
12755
12715
|
|
12756
12716
|
//From http://stackoverflow.com/questions/280634/endswith-in-javascript
|
12757
12717
|
function endsWith(string, suffix) {
|
@@ -12841,6 +12801,34 @@ define('ember-data/attr', ['exports', 'ember', 'ember-data/-private/debug'], fun
|
|
12841
12801
|
});
|
12842
12802
|
```
|
12843
12803
|
|
12804
|
+
The `options` hash is passed as second argument to a transforms'
|
12805
|
+
`serialize` and `deserialize` method. This allows to configure a
|
12806
|
+
transformation and adapt the corresponding value, based on the config:
|
12807
|
+
|
12808
|
+
```app/models/post.js
|
12809
|
+
export default DS.Model.extend({
|
12810
|
+
text: DS.attr('text', {
|
12811
|
+
uppercase: true
|
12812
|
+
})
|
12813
|
+
});
|
12814
|
+
```
|
12815
|
+
|
12816
|
+
```app/transforms/text.js
|
12817
|
+
export default DS.Transform.extend({
|
12818
|
+
serialize: function(value, options) {
|
12819
|
+
if (options.uppercase) {
|
12820
|
+
return value.toUpperCase();
|
12821
|
+
}
|
12822
|
+
|
12823
|
+
return value;
|
12824
|
+
},
|
12825
|
+
|
12826
|
+
deserialize: function(value) {
|
12827
|
+
return value;
|
12828
|
+
}
|
12829
|
+
})
|
12830
|
+
```
|
12831
|
+
|
12844
12832
|
@namespace
|
12845
12833
|
@method attr
|
12846
12834
|
@for DS
|
@@ -12900,40 +12888,9 @@ define('ember-data/attr', ['exports', 'ember', 'ember-data/-private/debug'], fun
|
|
12900
12888
|
}
|
12901
12889
|
}).meta(meta);
|
12902
12890
|
}
|
12903
|
-
|
12904
|
-
// TODO add to documentation of `attr` function above, once this feature is added
|
12905
|
-
// /**
|
12906
|
-
// * The `options` hash is passed as second argument to a transforms'
|
12907
|
-
// * `serialize` and `deserialize` method. This allows to configure a
|
12908
|
-
// * transformation and adapt the corresponding value, based on the config:
|
12909
|
-
// *
|
12910
|
-
// * ```app/models/post.js
|
12911
|
-
// * export default DS.Model.extend({
|
12912
|
-
// * text: DS.attr('text', {
|
12913
|
-
// * uppercase: true
|
12914
|
-
// * })
|
12915
|
-
// * });
|
12916
|
-
// * ```
|
12917
|
-
// *
|
12918
|
-
// * ```app/transforms/text.js
|
12919
|
-
// * export default DS.Transform.extend({
|
12920
|
-
// * serialize: function(value, options) {
|
12921
|
-
// * if (options.uppercase) {
|
12922
|
-
// * return value.toUpperCase();
|
12923
|
-
// * }
|
12924
|
-
// *
|
12925
|
-
// * return value;
|
12926
|
-
// * },
|
12927
|
-
// *
|
12928
|
-
// * deserialize: function(value) {
|
12929
|
-
// * return value;
|
12930
|
-
// * }
|
12931
|
-
// * })
|
12932
|
-
// * ```
|
12933
|
-
// *
|
12934
|
-
// */
|
12935
12891
|
});
|
12936
|
-
define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/features", "ember-data/-private/core", "ember-data/-private/system/normalize-model-name", "ember-data/-private/system/model/internal-model", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/store", "ember-data/-private/system/model", "ember-data/model", "ember-data/-private/system/snapshot", "ember-data/adapter", "ember-data/serializer", "ember-data/-private/system/debug", "ember-data/adapters/errors", "ember-data/-private/system/record-arrays", "ember-data/-private/system/many-array", "ember-data/-private/system/record-array-manager", "ember-data/-private/adapters", "ember-data/-private/adapters/build-url-mixin", "ember-data/-private/serializers", "ember-inflector", "ember-data/serializers/embedded-records-mixin", "ember-data/-private/transforms", "ember-data/relationships", "ember-data/setup-container", "ember-data/-private/instance-initializers/initialize-store-service", "ember-data/-private/system/container-proxy", "ember-data/-private/system/relationships/state/relationship"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateFeatures, _emberDataPrivateCore, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStore, _emberDataPrivateSystemModel, _emberDataModel, _emberDataPrivateSystemSnapshot, _emberDataAdapter, _emberDataSerializer, _emberDataPrivateSystemDebug, _emberDataAdaptersErrors, _emberDataPrivateSystemRecordArrays, _emberDataPrivateSystemManyArray, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateAdapters, _emberDataPrivateAdaptersBuildUrlMixin, _emberDataPrivateSerializers, _emberInflector, _emberDataSerializersEmbeddedRecordsMixin, _emberDataPrivateTransforms, _emberDataRelationships, _emberDataSetupContainer, _emberDataPrivateInstanceInitializersInitializeStoreService, _emberDataPrivateSystemContainerProxy, _emberDataPrivateSystemRelationshipsStateRelationship) {
|
12892
|
+
define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/features", "ember-data/-private/global", "ember-data/-private/core", "ember-data/-private/system/normalize-model-name", "ember-data/-private/system/model/internal-model", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/store", "ember-data/-private/system/model", "ember-data/model", "ember-data/-private/system/snapshot", "ember-data/adapter", "ember-data/serializer", "ember-data/-private/system/debug", "ember-data/adapters/errors", "ember-data/-private/system/record-arrays", "ember-data/-private/system/many-array", "ember-data/-private/system/record-array-manager", "ember-data/-private/adapters", "ember-data/-private/adapters/build-url-mixin", "ember-data/-private/serializers", "ember-inflector", "ember-data/serializers/embedded-records-mixin", "ember-data/-private/transforms", "ember-data/relationships", "ember-data/setup-container", "ember-data/-private/instance-initializers/initialize-store-service", "ember-data/-private/system/container-proxy", "ember-data/-private/system/relationships/state/relationship"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateFeatures, _emberDataPrivateGlobal, _emberDataPrivateCore, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStore, _emberDataPrivateSystemModel, _emberDataModel, _emberDataPrivateSystemSnapshot, _emberDataAdapter, _emberDataSerializer, _emberDataPrivateSystemDebug, _emberDataAdaptersErrors, _emberDataPrivateSystemRecordArrays, _emberDataPrivateSystemManyArray, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateAdapters, _emberDataPrivateAdaptersBuildUrlMixin, _emberDataPrivateSerializers, _emberInflector, _emberDataSerializersEmbeddedRecordsMixin, _emberDataPrivateTransforms, _emberDataRelationships, _emberDataSetupContainer, _emberDataPrivateInstanceInitializersInitializeStoreService, _emberDataPrivateSystemContainerProxy, _emberDataPrivateSystemRelationshipsStateRelationship) {
|
12893
|
+
|
12937
12894
|
/**
|
12938
12895
|
Ember Data
|
12939
12896
|
@module ember-data
|
@@ -12965,14 +12922,6 @@ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-da
|
|
12965
12922
|
_emberDataPrivateCore.default.TimeoutError = _emberDataAdaptersErrors.TimeoutError;
|
12966
12923
|
_emberDataPrivateCore.default.AbortError = _emberDataAdaptersErrors.AbortError;
|
12967
12924
|
|
12968
|
-
if (false) {
|
12969
|
-
_emberDataPrivateCore.default.UnauthorizedError = _emberDataAdaptersErrors.UnauthorizedError;
|
12970
|
-
_emberDataPrivateCore.default.ForbiddenError = _emberDataAdaptersErrors.ForbiddenError;
|
12971
|
-
_emberDataPrivateCore.default.NotFoundError = _emberDataAdaptersErrors.NotFoundError;
|
12972
|
-
_emberDataPrivateCore.default.ConflictError = _emberDataAdaptersErrors.ConflictError;
|
12973
|
-
_emberDataPrivateCore.default.ServerError = _emberDataAdaptersErrors.ServerError;
|
12974
|
-
}
|
12975
|
-
|
12976
12925
|
_emberDataPrivateCore.default.errorsHashToArray = _emberDataAdaptersErrors.errorsHashToArray;
|
12977
12926
|
_emberDataPrivateCore.default.errorsArrayToHash = _emberDataAdaptersErrors.errorsArrayToHash;
|
12978
12927
|
|
@@ -13021,7 +12970,13 @@ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-da
|
|
13021
12970
|
value: _emberDataPrivateSystemNormalizeModelName.default
|
13022
12971
|
});
|
13023
12972
|
|
13024
|
-
|
12973
|
+
Object.defineProperty(_emberDataPrivateGlobal.default, 'DS', {
|
12974
|
+
configurable: true,
|
12975
|
+
get: function () {
|
12976
|
+
|
12977
|
+
return _emberDataPrivateCore.default;
|
12978
|
+
}
|
12979
|
+
});
|
13025
12980
|
|
13026
12981
|
exports.default = _emberDataPrivateCore.default;
|
13027
12982
|
});
|
@@ -13463,10 +13418,8 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
|
|
13463
13418
|
} else if (this.hasSerializeRecordsOption(attr)) {
|
13464
13419
|
this._serializeEmbeddedHasMany(snapshot, json, relationship);
|
13465
13420
|
} else {
|
13466
|
-
if (
|
13467
|
-
|
13468
|
-
this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);
|
13469
|
-
}
|
13421
|
+
if (this.hasSerializeIdsAndTypesOption(attr)) {
|
13422
|
+
this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);
|
13470
13423
|
}
|
13471
13424
|
}
|
13472
13425
|
},
|
@@ -13830,6 +13783,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
13830
13783
|
_normalizeRelationshipDataHelper: function (relationshipDataHash) {
|
13831
13784
|
var type = this.modelNameFromPayloadKey(relationshipDataHash.type);
|
13832
13785
|
relationshipDataHash.type = type;
|
13786
|
+
|
13833
13787
|
return relationshipDataHash;
|
13834
13788
|
},
|
13835
13789
|
|
@@ -13841,7 +13795,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
13841
13795
|
*/
|
13842
13796
|
_normalizeResourceHelper: function (resourceHash) {
|
13843
13797
|
|
13844
|
-
var modelName =
|
13798
|
+
var modelName = undefined,
|
13799
|
+
usedLookup = undefined;
|
13800
|
+
|
13801
|
+
modelName = this.modelNameFromPayloadKey(resourceHash.type);
|
13802
|
+
usedLookup = 'modelNameFromPayloadKey';
|
13845
13803
|
|
13846
13804
|
if (!this.store._hasModelFor(modelName)) {
|
13847
13805
|
return null;
|
@@ -13864,11 +13822,8 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
13864
13822
|
*/
|
13865
13823
|
pushPayload: function (store, payload) {
|
13866
13824
|
var normalizedPayload = this._normalizeDocumentHelper(payload);
|
13867
|
-
|
13868
|
-
|
13869
|
-
} else {
|
13870
|
-
store.push(normalizedPayload);
|
13871
|
-
}
|
13825
|
+
|
13826
|
+
store.push(normalizedPayload);
|
13872
13827
|
},
|
13873
13828
|
|
13874
13829
|
/**
|
@@ -13907,7 +13862,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
13907
13862
|
if (resourceHash.attributes) {
|
13908
13863
|
modelClass.eachAttribute(function (key) {
|
13909
13864
|
var attributeKey = _this.keyForAttribute(key, 'deserialize');
|
13910
|
-
if (resourceHash.attributes
|
13865
|
+
if (resourceHash.attributes[attributeKey] !== undefined) {
|
13911
13866
|
attributes[key] = resourceHash.attributes[attributeKey];
|
13912
13867
|
}
|
13913
13868
|
});
|
@@ -13955,7 +13910,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
13955
13910
|
if (resourceHash.relationships) {
|
13956
13911
|
modelClass.eachRelationship(function (key, relationshipMeta) {
|
13957
13912
|
var relationshipKey = _this2.keyForRelationship(key, relationshipMeta.kind, 'deserialize');
|
13958
|
-
if (resourceHash.relationships
|
13913
|
+
if (resourceHash.relationships[relationshipKey] !== undefined) {
|
13959
13914
|
|
13960
13915
|
var relationshipHash = resourceHash.relationships[relationshipKey];
|
13961
13916
|
relationships[key] = _this2.extractRelationship(relationshipHash);
|
@@ -13982,6 +13937,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
13982
13937
|
@param {String} key
|
13983
13938
|
@return {String} the model's modelName
|
13984
13939
|
*/
|
13940
|
+
// TODO @deprecated Use modelNameFromPayloadType instead
|
13985
13941
|
modelNameFromPayloadKey: function (key) {
|
13986
13942
|
return (0, _emberInflector.singularize)((0, _emberDataPrivateSystemNormalizeModelName.default)(key));
|
13987
13943
|
},
|
@@ -13991,6 +13947,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
13991
13947
|
@param {String} modelName
|
13992
13948
|
@return {String}
|
13993
13949
|
*/
|
13950
|
+
// TODO @deprecated Use payloadTypeFromModelName instead
|
13994
13951
|
payloadKeyFromModelName: function (modelName) {
|
13995
13952
|
return (0, _emberInflector.pluralize)(modelName);
|
13996
13953
|
},
|
@@ -14081,7 +14038,12 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
14081
14038
|
*/
|
14082
14039
|
serialize: function (snapshot, options) {
|
14083
14040
|
var data = this._super.apply(this, arguments);
|
14084
|
-
|
14041
|
+
|
14042
|
+
var payloadType = undefined;
|
14043
|
+
|
14044
|
+
payloadType = this.payloadKeyFromModelName(snapshot.modelName);
|
14045
|
+
|
14046
|
+
data.type = payloadType;
|
14085
14047
|
return { data: data };
|
14086
14048
|
},
|
14087
14049
|
|
@@ -14101,7 +14063,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
14101
14063
|
var value = snapshot.attr(key);
|
14102
14064
|
if (type) {
|
14103
14065
|
var transform = this.transformFor(type);
|
14104
|
-
value = transform.serialize(value
|
14066
|
+
value = transform.serialize(value);
|
14105
14067
|
}
|
14106
14068
|
|
14107
14069
|
var payloadKey = this._getMappedKey(key, snapshot.type);
|
@@ -14136,8 +14098,12 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
14136
14098
|
|
14137
14099
|
var data = null;
|
14138
14100
|
if (belongsTo) {
|
14101
|
+
var payloadType = undefined;
|
14102
|
+
|
14103
|
+
payloadType = this.payloadKeyFromModelName(belongsTo.modelName);
|
14104
|
+
|
14139
14105
|
data = {
|
14140
|
-
type:
|
14106
|
+
type: payloadType,
|
14141
14107
|
id: belongsTo.id
|
14142
14108
|
};
|
14143
14109
|
}
|
@@ -14155,8 +14121,9 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
14155
14121
|
*/
|
14156
14122
|
serializeHasMany: function (snapshot, json, relationship) {
|
14157
14123
|
var key = relationship.key;
|
14124
|
+
var shouldSerializeHasMany = '_shouldSerializeHasMany';
|
14158
14125
|
|
14159
|
-
if (this
|
14126
|
+
if (this[shouldSerializeHasMany](snapshot, key, relationship)) {
|
14160
14127
|
var hasMany = snapshot.hasMany(key);
|
14161
14128
|
if (hasMany !== undefined) {
|
14162
14129
|
|
@@ -14171,8 +14138,13 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
14171
14138
|
|
14172
14139
|
for (var i = 0; i < hasMany.length; i++) {
|
14173
14140
|
var item = hasMany[i];
|
14141
|
+
|
14142
|
+
var payloadType = undefined;
|
14143
|
+
|
14144
|
+
payloadType = this.payloadKeyFromModelName(item.modelName);
|
14145
|
+
|
14174
14146
|
data[i] = {
|
14175
|
-
type:
|
14147
|
+
type: payloadType,
|
14176
14148
|
id: item.id
|
14177
14149
|
};
|
14178
14150
|
}
|
@@ -14188,7 +14160,80 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
|
|
14188
14160
|
/**
|
14189
14161
|
@module ember-data
|
14190
14162
|
*/
|
14191
|
-
|
14163
|
+
|
14164
|
+
/**
|
14165
|
+
`modelNameFromPayloadType` can be used to change the mapping for a DS model
|
14166
|
+
name, taken from the value in the payload.
|
14167
|
+
Say your API namespaces the type of a model and returns the following
|
14168
|
+
payload for the `post` model:
|
14169
|
+
```javascript
|
14170
|
+
// GET /api/posts/1
|
14171
|
+
{
|
14172
|
+
"data": {
|
14173
|
+
"id": 1,
|
14174
|
+
"type: "api::v1::post"
|
14175
|
+
}
|
14176
|
+
}
|
14177
|
+
```
|
14178
|
+
By overwriting `modelNameFromPayloadType` you can specify that the
|
14179
|
+
`posr` model should be used:
|
14180
|
+
```app/serializers/application.js
|
14181
|
+
import JSONAPISerializer from "ember-data/serializers/json-api";
|
14182
|
+
export default JSONAPISerializer.extend({
|
14183
|
+
modelNameFromPayloadType(payloadType) {
|
14184
|
+
return payloadType.replace('api::v1::', '');
|
14185
|
+
}
|
14186
|
+
});
|
14187
|
+
```
|
14188
|
+
By default the modelName for a model is its singularized name in dasherized
|
14189
|
+
form. Usually, Ember Data can use the correct inflection to do this for
|
14190
|
+
you. Most of the time, you won't need to override
|
14191
|
+
`modelNameFromPayloadType` for this purpose.
|
14192
|
+
Also take a look at
|
14193
|
+
[payloadTypeFromModelName](#method_payloadTypeFromModelName) to customize
|
14194
|
+
how the type of a record should be serialized.
|
14195
|
+
@method modelNameFromPayloadType
|
14196
|
+
@public
|
14197
|
+
@param {String} payloadType type from payload
|
14198
|
+
@return {String} modelName
|
14199
|
+
*/
|
14200
|
+
|
14201
|
+
/**
|
14202
|
+
`payloadTypeFromModelName` can be used to change the mapping for the type in
|
14203
|
+
the payload, taken from the model name.
|
14204
|
+
Say your API namespaces the type of a model and expects the following
|
14205
|
+
payload when you update the `post` model:
|
14206
|
+
```javascript
|
14207
|
+
// POST /api/posts/1
|
14208
|
+
{
|
14209
|
+
"data": {
|
14210
|
+
"id": 1,
|
14211
|
+
"type": "api::v1::post"
|
14212
|
+
}
|
14213
|
+
}
|
14214
|
+
```
|
14215
|
+
By overwriting `payloadTypeFromModelName` you can specify that the
|
14216
|
+
namespaces model name for the `post` should be used:
|
14217
|
+
```app/serializers/application.js
|
14218
|
+
import JSONAPISerializer from "ember-data/serializers/json-api";
|
14219
|
+
export default JSONAPISerializer.extend({
|
14220
|
+
payloadTypeFromModelName(modelName) {
|
14221
|
+
return "api::v1::" + modelName;
|
14222
|
+
}
|
14223
|
+
});
|
14224
|
+
```
|
14225
|
+
By default the payload type is the pluralized model name. Usually, Ember
|
14226
|
+
Data can use the correct inflection to do this for you. Most of the time,
|
14227
|
+
you won't need to override `payloadTypeFromModelName` for this purpose.
|
14228
|
+
Also take a look at
|
14229
|
+
[modelNameFromPayloadType](#method_modelNameFromPayloadType) to customize
|
14230
|
+
how the model name from should be mapped from the payload.
|
14231
|
+
@method payloadTypeFromModelName
|
14232
|
+
@public
|
14233
|
+
@param {String} modelname modelName from the record
|
14234
|
+
@return {String} payloadType
|
14235
|
+
*/
|
14236
|
+
define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/debug', 'ember-data/serializer', 'ember-data/-private/system/coerce-id', 'ember-data/-private/system/normalize-model-name', 'ember-data/-private/utils', 'ember-data/-private/features', 'ember-data/adapters/errors'], function (exports, _ember, _emberDataPrivateDebug, _emberDataSerializer, _emberDataPrivateSystemCoerceId, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateUtils, _emberDataPrivateFeatures, _emberDataAdaptersErrors) {
|
14192
14237
|
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
|
14193
14238
|
|
14194
14239
|
var get = _ember.default.get;
|
@@ -14261,7 +14306,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14261
14306
|
@namespace DS
|
14262
14307
|
@extends DS.Serializer
|
14263
14308
|
*/
|
14264
|
-
|
14309
|
+
var JSONSerializer = _emberDataSerializer.default.extend({
|
14265
14310
|
|
14266
14311
|
/**
|
14267
14312
|
The `primaryKey` is used when serializing and deserializing
|
@@ -14349,23 +14394,16 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14349
14394
|
applyTransforms: function (typeClass, data) {
|
14350
14395
|
var _this = this;
|
14351
14396
|
|
14352
|
-
var attributes =
|
14353
|
-
if (true) {
|
14354
|
-
attributes = get(typeClass, 'attributes');
|
14355
|
-
}
|
14397
|
+
var attributes = get(typeClass, 'attributes');
|
14356
14398
|
|
14357
14399
|
typeClass.eachTransformedAttribute(function (key, typeClass) {
|
14358
|
-
if (
|
14400
|
+
if (data[key] === undefined) {
|
14359
14401
|
return;
|
14360
14402
|
}
|
14361
14403
|
|
14362
14404
|
var transform = _this.transformFor(typeClass);
|
14363
|
-
|
14364
|
-
|
14365
|
-
data[key] = transform.deserialize(data[key], transformMeta.options);
|
14366
|
-
} else {
|
14367
|
-
data[key] = transform.deserialize(data[key]);
|
14368
|
-
}
|
14405
|
+
var transformMeta = attributes.get(key);
|
14406
|
+
data[key] = transform.deserialize(data[key], transformMeta.options);
|
14369
14407
|
});
|
14370
14408
|
|
14371
14409
|
return data;
|
@@ -14729,7 +14767,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14729
14767
|
|
14730
14768
|
modelClass.eachAttribute(function (key) {
|
14731
14769
|
attributeKey = _this2.keyForAttribute(key, 'deserialize');
|
14732
|
-
if (resourceHash
|
14770
|
+
if (resourceHash[attributeKey] !== undefined) {
|
14733
14771
|
attributes[key] = resourceHash[attributeKey];
|
14734
14772
|
}
|
14735
14773
|
});
|
@@ -14804,7 +14842,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14804
14842
|
modelClass.eachRelationship(function (key, relationshipMeta) {
|
14805
14843
|
var relationship = null;
|
14806
14844
|
var relationshipKey = _this3.keyForRelationship(key, relationshipMeta.kind, 'deserialize');
|
14807
|
-
if (resourceHash
|
14845
|
+
if (resourceHash[relationshipKey] !== undefined) {
|
14808
14846
|
var data = null;
|
14809
14847
|
var relationshipHash = resourceHash[relationshipKey];
|
14810
14848
|
if (relationshipMeta.kind === 'belongsTo') {
|
@@ -14830,7 +14868,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14830
14868
|
}
|
14831
14869
|
|
14832
14870
|
var linkKey = _this3.keyForLink(key, relationshipMeta.kind);
|
14833
|
-
if (resourceHash.links && resourceHash.links
|
14871
|
+
if (resourceHash.links && resourceHash.links[linkKey] !== undefined) {
|
14834
14872
|
var related = resourceHash.links[linkKey];
|
14835
14873
|
relationship = relationship || {};
|
14836
14874
|
relationship.links = { related: related };
|
@@ -14849,6 +14887,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14849
14887
|
@param {String} key
|
14850
14888
|
@return {String} the model's modelName
|
14851
14889
|
*/
|
14890
|
+
// TODO @deprecated Use modelNameFromPayloadType instead
|
14852
14891
|
modelNameFromPayloadKey: function (key) {
|
14853
14892
|
return (0, _emberDataPrivateSystemNormalizeModelName.default)(key);
|
14854
14893
|
},
|
@@ -14868,7 +14907,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14868
14907
|
if (key === payloadKey) {
|
14869
14908
|
return;
|
14870
14909
|
}
|
14871
|
-
if (
|
14910
|
+
if (hash[payloadKey] === undefined) {
|
14872
14911
|
return;
|
14873
14912
|
}
|
14874
14913
|
|
@@ -14893,7 +14932,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14893
14932
|
if (key === payloadKey) {
|
14894
14933
|
return;
|
14895
14934
|
}
|
14896
|
-
if (
|
14935
|
+
if (hash[payloadKey] === undefined) {
|
14897
14936
|
return;
|
14898
14937
|
}
|
14899
14938
|
|
@@ -14915,7 +14954,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14915
14954
|
for (key in attrs) {
|
14916
14955
|
normalizedKey = payloadKey = this._getMappedKey(key, modelClass);
|
14917
14956
|
|
14918
|
-
if (
|
14957
|
+
if (hash[payloadKey] === undefined) {
|
14919
14958
|
continue;
|
14920
14959
|
}
|
14921
14960
|
|
@@ -14991,6 +15030,21 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
14991
15030
|
return attrs && attrs[key] && attrs[key].serialize === true;
|
14992
15031
|
},
|
14993
15032
|
|
15033
|
+
/**
|
15034
|
+
Check if the given hasMany relationship should be serialized
|
15035
|
+
@method shouldSerializeHasMany
|
15036
|
+
@param {DS.Snapshot} snapshot
|
15037
|
+
@param {String} key
|
15038
|
+
@param {String} relationshipType
|
15039
|
+
@return {boolean} true if the hasMany relationship should be serialized
|
15040
|
+
*/
|
15041
|
+
|
15042
|
+
shouldSerializeHasMany: function (snapshot, key, relationship) {
|
15043
|
+
if (this._shouldSerializeHasMany !== JSONSerializer.prototype._shouldSerializeHasMany) {}
|
15044
|
+
|
15045
|
+
return this._shouldSerializeHasMany(snapshot, key, relationship);
|
15046
|
+
},
|
15047
|
+
|
14994
15048
|
/**
|
14995
15049
|
Check if the given hasMany relationship should be serialized
|
14996
15050
|
@method _shouldSerializeHasMany
|
@@ -15205,11 +15259,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
15205
15259
|
var value = snapshot.attr(key);
|
15206
15260
|
if (type) {
|
15207
15261
|
var transform = this.transformFor(type);
|
15208
|
-
|
15209
|
-
value = transform.serialize(value, attribute.options);
|
15210
|
-
} else {
|
15211
|
-
value = transform.serialize(value);
|
15212
|
-
}
|
15262
|
+
value = transform.serialize(value, attribute.options);
|
15213
15263
|
}
|
15214
15264
|
|
15215
15265
|
// if provided, use the mapping provided by `attrs` in
|
@@ -15294,8 +15344,9 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
15294
15344
|
*/
|
15295
15345
|
serializeHasMany: function (snapshot, json, relationship) {
|
15296
15346
|
var key = relationship.key;
|
15347
|
+
var shouldSerializeHasMany = '_shouldSerializeHasMany';
|
15297
15348
|
|
15298
|
-
if (this
|
15349
|
+
if (this[shouldSerializeHasMany](snapshot, key, relationship)) {
|
15299
15350
|
var hasMany = snapshot.hasMany(key, { ids: true });
|
15300
15351
|
if (hasMany !== undefined) {
|
15301
15352
|
// if provided, use the mapping provided by `attrs` in
|
@@ -15362,7 +15413,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
15362
15413
|
@param {Object} payload
|
15363
15414
|
*/
|
15364
15415
|
extractMeta: function (store, modelClass, payload) {
|
15365
|
-
if (payload && payload
|
15416
|
+
if (payload && payload['meta'] !== undefined) {
|
15366
15417
|
var meta = payload.meta;
|
15367
15418
|
delete payload.meta;
|
15368
15419
|
return meta;
|
@@ -15452,7 +15503,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
15452
15503
|
|
15453
15504
|
typeClass.eachAttribute(function (name) {
|
15454
15505
|
var key = _this7.keyForAttribute(name, 'deserialize');
|
15455
|
-
if (key !== name && payload
|
15506
|
+
if (key !== name && payload[key] !== undefined) {
|
15456
15507
|
payload[name] = payload[key];
|
15457
15508
|
delete payload[key];
|
15458
15509
|
}
|
@@ -15460,7 +15511,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
15460
15511
|
|
15461
15512
|
typeClass.eachRelationship(function (name) {
|
15462
15513
|
var key = _this7.keyForRelationship(name, 'deserialize');
|
15463
|
-
if (key !== name && payload
|
15514
|
+
if (key !== name && payload[key] !== undefined) {
|
15464
15515
|
payload[name] = payload[key];
|
15465
15516
|
delete payload[key];
|
15466
15517
|
}
|
@@ -15541,7 +15592,16 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
|
|
15541
15592
|
return transform;
|
15542
15593
|
}
|
15543
15594
|
});
|
15595
|
+
|
15596
|
+
exports.default = JSONSerializer;
|
15544
15597
|
});
|
15598
|
+
|
15599
|
+
/**
|
15600
|
+
@method modelNameFromPayloadType
|
15601
|
+
@public
|
15602
|
+
@param {String} type
|
15603
|
+
@return {String} the model's modelName
|
15604
|
+
*/
|
15545
15605
|
define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/debug", "ember-data/serializers/json", "ember-data/-private/system/normalize-model-name", "ember-inflector", "ember-data/-private/system/coerce-id", "ember-data/-private/utils", "ember-data/-private/features"], function (exports, _ember, _emberDataPrivateDebug, _emberDataSerializersJson, _emberDataPrivateSystemNormalizeModelName, _emberInflector, _emberDataPrivateSystemCoerceId, _emberDataPrivateUtils, _emberDataPrivateFeatures) {
|
15546
15606
|
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
|
15547
15607
|
|
@@ -15646,7 +15706,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
15646
15706
|
* With `App.Comment`, `"comments"` and `{ id: 1, body: "FIRST" }`
|
15647
15707
|
* With `App.Comment`, `"comments"` and `{ id: 2, body: "Rails is unagi" }`
|
15648
15708
|
You can use this method, for example, to normalize underscored keys to camelized
|
15649
|
-
or other general-purpose normalizations. You will only need to implement
|
15709
|
+
or other general-purpose normalizations. You will only need to implement
|
15650
15710
|
`normalize` and manipulate the payload as desired.
|
15651
15711
|
For example, if the `IDs` under `"comments"` are provided as `_id` instead of
|
15652
15712
|
`id`, you can specify how to normalize just the comments:
|
@@ -15656,14 +15716,14 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
15656
15716
|
normalize(model, hash, prop) {
|
15657
15717
|
if (prop === 'comments') {
|
15658
15718
|
hash.id = hash._id;
|
15659
|
-
delete hash._id;
|
15719
|
+
delete hash._id;
|
15660
15720
|
}
|
15661
15721
|
return this._super(...arguments);
|
15662
15722
|
}
|
15663
15723
|
});
|
15664
15724
|
```
|
15665
|
-
On each call to the `normalize` method, the third parameter (`prop`) is always
|
15666
|
-
one of the keys that were in the original payload or in the result of another
|
15725
|
+
On each call to the `normalize` method, the third parameter (`prop`) is always
|
15726
|
+
one of the keys that were in the original payload or in the result of another
|
15667
15727
|
normalization as `normalizeResponse`.
|
15668
15728
|
@method normalize
|
15669
15729
|
@param {DS.Model} modelClass
|
@@ -15700,7 +15760,6 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
15700
15760
|
var modelClass = store.modelFor(modelName);
|
15701
15761
|
var serializer = store.serializerFor(modelName);
|
15702
15762
|
|
15703
|
-
/*jshint loopfunc:true*/
|
15704
15763
|
_ember.default.makeArray(arrayHash).forEach(function (hash) {
|
15705
15764
|
var _normalizePolymorphicRecord = _this._normalizePolymorphicRecord(store, hash, prop, modelClass, serializer);
|
15706
15765
|
|
@@ -15719,17 +15778,23 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
15719
15778
|
},
|
15720
15779
|
|
15721
15780
|
_normalizePolymorphicRecord: function (store, hash, prop, primaryModelClass, primarySerializer) {
|
15722
|
-
var serializer =
|
15723
|
-
|
15781
|
+
var serializer = primarySerializer;
|
15782
|
+
var modelClass = primaryModelClass;
|
15783
|
+
|
15724
15784
|
var primaryHasTypeAttribute = (0, _emberDataPrivateUtils.modelHasAttributeOrRelationshipNamedType)(primaryModelClass);
|
15725
|
-
|
15726
|
-
if (!primaryHasTypeAttribute && hash.type
|
15727
|
-
|
15728
|
-
|
15729
|
-
|
15730
|
-
|
15731
|
-
|
15785
|
+
|
15786
|
+
if (!primaryHasTypeAttribute && hash.type) {
|
15787
|
+
// Support polymorphic records in async relationships
|
15788
|
+
var modelName = undefined;
|
15789
|
+
|
15790
|
+
modelName = this.modelNameFromPayloadKey(hash.type);
|
15791
|
+
|
15792
|
+
if (store._hasModelFor(modelName)) {
|
15793
|
+
serializer = store.serializerFor(modelName);
|
15794
|
+
modelClass = store.modelFor(modelName);
|
15795
|
+
}
|
15732
15796
|
}
|
15797
|
+
|
15733
15798
|
return serializer.normalize(modelClass, hash, prop);
|
15734
15799
|
},
|
15735
15800
|
|
@@ -15832,7 +15897,6 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
15832
15897
|
}
|
15833
15898
|
|
15834
15899
|
if (isSingle) {
|
15835
|
-
/*jshint loopfunc:true*/
|
15836
15900
|
data.forEach(function (resource) {
|
15837
15901
|
|
15838
15902
|
/*
|
@@ -15914,7 +15978,6 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
15914
15978
|
var type = store.modelFor(modelName);
|
15915
15979
|
var typeSerializer = store.serializerFor(type.modelName);
|
15916
15980
|
|
15917
|
-
/*jshint loopfunc:true*/
|
15918
15981
|
_ember.default.makeArray(payload[prop]).forEach(function (hash) {
|
15919
15982
|
var _typeSerializer$normalize = typeSerializer.normalize(type, hash, prop);
|
15920
15983
|
|
@@ -15930,11 +15993,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
15930
15993
|
});
|
15931
15994
|
}
|
15932
15995
|
|
15933
|
-
|
15934
|
-
return store.push(documentHash);
|
15935
|
-
} else {
|
15936
|
-
store.push(documentHash);
|
15937
|
-
}
|
15996
|
+
store.push(documentHash);
|
15938
15997
|
},
|
15939
15998
|
|
15940
15999
|
/**
|
@@ -16243,7 +16302,8 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
16243
16302
|
var isPolymorphic = relationshipMeta.options.polymorphic;
|
16244
16303
|
var typeProperty = this.keyForPolymorphicType(key, relationshipType, 'deserialize');
|
16245
16304
|
|
16246
|
-
if (isPolymorphic && resourceHash
|
16305
|
+
if (isPolymorphic && resourceHash[typeProperty] !== undefined && typeof relationshipHash !== 'object') {
|
16306
|
+
|
16247
16307
|
var type = this.modelNameFromPayloadKey(resourceHash[typeProperty]);
|
16248
16308
|
return {
|
16249
16309
|
id: relationshipHash,
|
@@ -16260,6 +16320,82 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
|
|
16260
16320
|
/**
|
16261
16321
|
@module ember-data
|
16262
16322
|
*/
|
16323
|
+
|
16324
|
+
/**
|
16325
|
+
`modelNameFromPayloadType` can be used to change the mapping for a DS model
|
16326
|
+
name, taken from the value in the payload.
|
16327
|
+
Say your API namespaces the type of a model and returns the following
|
16328
|
+
payload for the `post` model, which has a polymorphic `user` relationship:
|
16329
|
+
```javascript
|
16330
|
+
// GET /api/posts/1
|
16331
|
+
{
|
16332
|
+
"post": {
|
16333
|
+
"id": 1,
|
16334
|
+
"user": 1,
|
16335
|
+
"userType: "api::v1::administrator"
|
16336
|
+
}
|
16337
|
+
}
|
16338
|
+
```
|
16339
|
+
By overwriting `modelNameFromPayloadType` you can specify that the
|
16340
|
+
`administrator` model should be used:
|
16341
|
+
```app/serializers/application.js
|
16342
|
+
import RESTSerializer from "ember-data/serializers/rest";
|
16343
|
+
export default RESTSerializer.extend({
|
16344
|
+
modelNameFromPayloadType(payloadType) {
|
16345
|
+
return payloadType.replace('api::v1::', '');
|
16346
|
+
}
|
16347
|
+
});
|
16348
|
+
```
|
16349
|
+
By default the modelName for a model is its name in dasherized form.
|
16350
|
+
Usually, Ember Data can use the correct inflection to do this for you. Most
|
16351
|
+
of the time, you won't need to override `modelNameFromPayloadType` for this
|
16352
|
+
purpose.
|
16353
|
+
Also take a look at
|
16354
|
+
[payloadTypeFromModelName](#method_payloadTypeFromModelName) to customize
|
16355
|
+
how the type of a record should be serialized.
|
16356
|
+
@method modelNameFromPayloadType
|
16357
|
+
@public
|
16358
|
+
@param {String} payloadType type from payload
|
16359
|
+
@return {String} modelName
|
16360
|
+
*/
|
16361
|
+
|
16362
|
+
/**
|
16363
|
+
`payloadTypeFromModelName` can be used to change the mapping for the type in
|
16364
|
+
the payload, taken from the model name.
|
16365
|
+
Say your API namespaces the type of a model and expects the following
|
16366
|
+
payload when you update the `post` model, which has a polymorphic `user`
|
16367
|
+
relationship:
|
16368
|
+
```javascript
|
16369
|
+
// POST /api/posts/1
|
16370
|
+
{
|
16371
|
+
"post": {
|
16372
|
+
"id": 1,
|
16373
|
+
"user": 1,
|
16374
|
+
"userType": "api::v1::administrator"
|
16375
|
+
}
|
16376
|
+
}
|
16377
|
+
```
|
16378
|
+
By overwriting `payloadTypeFromModelName` you can specify that the
|
16379
|
+
namespaces model name for the `administrator` should be used:
|
16380
|
+
```app/serializers/application.js
|
16381
|
+
import RESTSerializer from "ember-data/serializers/rest";
|
16382
|
+
export default RESTSerializer.extend({
|
16383
|
+
payloadTypeFromModelName(modelName) {
|
16384
|
+
return "api::v1::" + modelName;
|
16385
|
+
}
|
16386
|
+
});
|
16387
|
+
```
|
16388
|
+
By default the payload type is the camelized model name. Usually, Ember
|
16389
|
+
Data can use the correct inflection to do this for you. Most of the time,
|
16390
|
+
you won't need to override `payloadTypeFromModelName` for this purpose.
|
16391
|
+
Also take a look at
|
16392
|
+
[modelNameFromPayloadType](#method_modelNameFromPayloadType) to customize
|
16393
|
+
how the model name from should be mapped from the payload.
|
16394
|
+
@method payloadTypeFromModelName
|
16395
|
+
@public
|
16396
|
+
@param {String} modelname modelName from the record
|
16397
|
+
@return {String} payloadType
|
16398
|
+
*/
|
16263
16399
|
define('ember-data/setup-container', ['exports', 'ember-data/-private/initializers/store', 'ember-data/-private/initializers/transforms', 'ember-data/-private/initializers/store-injections', 'ember-data/-private/initializers/data-adapter'], function (exports, _emberDataPrivateInitializersStore, _emberDataPrivateInitializersTransforms, _emberDataPrivateInitializersStoreInjections, _emberDataPrivateInitializersDataAdapter) {
|
16264
16400
|
exports.default = setupContainer;
|
16265
16401
|
|
@@ -16318,12 +16454,13 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
|
|
16318
16454
|
method must return the serialized value.
|
16319
16455
|
Example
|
16320
16456
|
```javascript
|
16321
|
-
serialize: function(deserialized) {
|
16457
|
+
serialize: function(deserialized, options) {
|
16322
16458
|
return Ember.isEmpty(deserialized) ? null : Number(deserialized);
|
16323
16459
|
}
|
16324
16460
|
```
|
16325
16461
|
@method serialize
|
16326
16462
|
@param deserialized The deserialized value
|
16463
|
+
@param options hash of options passed to `DS.attr`
|
16327
16464
|
@return The serialized value
|
16328
16465
|
*/
|
16329
16466
|
serialize: null,
|
@@ -16333,19 +16470,20 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
|
|
16333
16470
|
return the deserialized value for the record attribute.
|
16334
16471
|
Example
|
16335
16472
|
```javascript
|
16336
|
-
deserialize: function(serialized) {
|
16473
|
+
deserialize: function(serialized, options) {
|
16337
16474
|
return empty(serialized) ? null : Number(serialized);
|
16338
16475
|
}
|
16339
16476
|
```
|
16340
16477
|
@method deserialize
|
16341
16478
|
@param serialized The serialized value
|
16479
|
+
@param options hash of options passed to `DS.attr`
|
16342
16480
|
@return The deserialized value
|
16343
16481
|
*/
|
16344
16482
|
deserialize: null
|
16345
16483
|
});
|
16346
16484
|
});
|
16347
16485
|
define("ember-data/version", ["exports"], function (exports) {
|
16348
|
-
exports.default = "2.
|
16486
|
+
exports.default = "2.7.0-beta.1";
|
16349
16487
|
});
|
16350
16488
|
define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
|
16351
16489
|
|
@@ -16740,7 +16878,7 @@ define('ember-inflector/lib/system/inflector', ['exports', 'ember'], function (e
|
|
16740
16878
|
return word;
|
16741
16879
|
}
|
16742
16880
|
|
16743
|
-
for (rule in irregular) {
|
16881
|
+
for (rule in this.rules.irregular) {
|
16744
16882
|
if (lowercase.match(rule + "$")) {
|
16745
16883
|
substitution = irregular[rule];
|
16746
16884
|
|
@@ -16749,7 +16887,7 @@ define('ember-inflector/lib/system/inflector', ['exports', 'ember'], function (e
|
|
16749
16887
|
rule = capitalize(rule);
|
16750
16888
|
}
|
16751
16889
|
|
16752
|
-
return word.replace(
|
16890
|
+
return word.replace(rule, substitution);
|
16753
16891
|
}
|
16754
16892
|
}
|
16755
16893
|
|
@@ -16810,6 +16948,15 @@ define('ember', [], function() {
|
|
16810
16948
|
|
16811
16949
|
|
16812
16950
|
require("ember-data");
|
16951
|
+
;(function() {
|
16952
|
+
var global = require('ember-data/-private/global').default;
|
16953
|
+
var DS = require('ember-data').default;
|
16954
|
+
Object.defineProperty(global, 'DS', {
|
16955
|
+
get: function() {
|
16956
|
+
return DS;
|
16957
|
+
}
|
16958
|
+
});
|
16959
|
+
})();
|
16813
16960
|
})();
|
16814
16961
|
;(function() {
|
16815
16962
|
function processEmberDataShims() {
|
@@ -16849,6 +16996,8 @@ require("ember-data");
|
|
16849
16996
|
processEmberDataShims();
|
16850
16997
|
}
|
16851
16998
|
})();
|
16999
|
+
/* eslint no-extra-semi: "off" */
|
17000
|
+
|
16852
17001
|
;(function() {
|
16853
17002
|
/* globals Ember */
|
16854
17003
|
/* globals DS */
|