@ember-data/model 5.4.0-alpha.23 → 5.4.0-alpha.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/model-YsOraZ6y.js.map +1 -1
- package/package.json +26 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-YsOraZ6y.js","sources":["../src/-private/many-array.ts","../../../node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","../src/-private/promise-proxy-base.js","../src/-private/promise-belongs-to.ts","../src/-private/promise-many-array.ts","../src/-private/debug/assert-polymorphic-type.ts","../src/-private/references/has-many.ts","../src/-private/references/belongs-to.ts","../src/-private/legacy-relationships-support.ts","../../../node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","../src/-private/errors.ts","../src/-private/model-methods.ts","../src/-private/notify-changes.ts","../src/-private/record-state.ts","../src/-private/model.js"],"sourcesContent":["/**\n @module @ember-data/store\n*/\nimport { assert, deprecate } from '@ember/debug';\n\nimport { DEPRECATE_MANY_ARRAY_DUPLICATES } from '@ember-data/deprecations';\nimport type Store from '@ember-data/store';\nimport {\n ARRAY_SIGNAL,\n isStableIdentifier,\n MUTATE,\n notifyArray,\n RecordArray,\n recordIdentifierFor,\n SOURCE,\n} from '@ember-data/store/-private';\nimport type { IdentifierArrayCreateOptions } from '@ember-data/store/-private/record-arrays/identifier-array';\nimport type { CreateRecordProperties } from '@ember-data/store/-private/store-service';\nimport type { Cache } from '@ember-data/store/-types/q/cache';\nimport type { ModelSchema } from '@ember-data/store/-types/q/ds-model';\nimport type { RecordInstance } from '@ember-data/store/-types/q/record-instance';\nimport type { FindOptions } from '@ember-data/store/-types/q/store';\nimport type { Signal } from '@ember-data/tracking/-private';\nimport { addToTransaction } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { Links, PaginationLinks } from '@warp-drive/core-types/spec/raw';\n\nimport type { LegacySupport } from './legacy-relationships-support';\n\nexport interface ManyArrayCreateArgs {\n identifiers: StableRecordIdentifier[];\n type: string;\n store: Store;\n allowMutation: boolean;\n manager: LegacySupport;\n\n identifier: StableRecordIdentifier;\n cache: Cache;\n meta: Record<string, unknown> | null;\n links: Links | PaginationLinks | null;\n key: string;\n isPolymorphic: boolean;\n isAsync: boolean;\n _inverseIsAsync: boolean;\n isLoaded: boolean;\n}\n/**\n A `ManyArray` is a `MutableArray` that represents the contents of a has-many\n relationship.\n\n The `ManyArray` is instantiated lazily the first time the relationship is\n requested.\n\n This class is not intended to be directly instantiated by consuming applications.\n\n ### Inverses\n\n Often, the relationships in Ember Data applications will have\n an inverse. For example, imagine the following models are\n defined:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n\n ```app/models/comment.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @belongsTo('post') post;\n }\n ```\n\n If you created a new instance of `Post` and added\n a `Comment` record to its `comments` has-many\n relationship, you would expect the comment's `post`\n property to be set to the post that contained\n the has-many.\n\n We call the record to which a relationship belongs-to the\n relationship's _owner_.\n\n @class ManyArray\n @public\n*/\nexport default class RelatedCollection extends RecordArray {\n declare isAsync: boolean;\n /**\n The loading state of this array\n\n @property {Boolean} isLoaded\n @public\n */\n\n declare isLoaded: boolean;\n /**\n `true` if the relationship is polymorphic, `false` otherwise.\n\n @property {Boolean} isPolymorphic\n @private\n */\n declare isPolymorphic: boolean;\n declare _inverseIsAsync: boolean;\n /**\n Metadata associated with the request for async hasMany relationships.\n\n Example\n\n Given that the server returns the following JSON payload when fetching a\n hasMany relationship:\n\n ```js\n {\n \"comments\": [{\n \"id\": 1,\n \"comment\": \"This is the first comment\",\n }, {\n // ...\n }],\n\n \"meta\": {\n \"page\": 1,\n \"total\": 5\n }\n }\n ```\n\n You can then access the meta data via the `meta` property:\n\n ```js\n let comments = await post.comments;\n let meta = comments.meta;\n\n // meta.page => 1\n // meta.total => 5\n ```\n\n @property {Object | null} meta\n @public\n */\n declare meta: Record<string, unknown> | null;\n /**\n * Retrieve the links for this relationship\n *\n @property {Object | null} links\n @public\n */\n declare links: Links | PaginationLinks | null;\n declare identifier: StableRecordIdentifier;\n declare cache: Cache;\n // @ts-expect-error\n declare _manager: LegacySupport;\n declare store: Store;\n declare key: string;\n declare type: ModelSchema;\n\n constructor(options: ManyArrayCreateArgs) {\n super(options as unknown as IdentifierArrayCreateOptions);\n this.isLoaded = options.isLoaded || false;\n this.isAsync = options.isAsync || false;\n this.isPolymorphic = options.isPolymorphic || false;\n this.identifier = options.identifier;\n this.key = options.key;\n }\n\n [MUTATE](\n target: StableRecordIdentifier[],\n receiver: typeof Proxy<StableRecordIdentifier[]>,\n prop: string,\n args: unknown[],\n _SIGNAL: Signal\n ): unknown {\n switch (prop) {\n case 'length 0': {\n Reflect.set(target, 'length', 0);\n mutateReplaceRelatedRecords(this, [], _SIGNAL);\n return true;\n }\n case 'replace cell': {\n const [index, prior, value] = args as [number, StableRecordIdentifier, StableRecordIdentifier];\n target[index] = value;\n mutateReplaceRelatedRecord(this, { value, prior, index }, _SIGNAL);\n return true;\n }\n case 'push': {\n const newValues = extractIdentifiersFromRecords(args);\n\n assertNoDuplicates(\n this,\n target,\n (currentState) => currentState.push(...newValues),\n `Cannot push duplicates to a hasMany's state.`\n );\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n // dedupe\n const seen = new Set(target);\n const unique = new Set<RecordInstance>();\n\n args.forEach((item) => {\n const identifier = recordIdentifierFor(item);\n if (!seen.has(identifier)) {\n seen.add(identifier);\n unique.add(item);\n }\n });\n\n const newArgs = Array.from(unique);\n const result = Reflect.apply(target[prop], receiver, newArgs) as RecordInstance[];\n\n if (newArgs.length) {\n mutateAddToRelatedRecords(this, { value: extractIdentifiersFromRecords(newArgs) }, _SIGNAL);\n }\n return result;\n }\n\n // else, no dedupe, error on duplicates\n const result = Reflect.apply(target[prop], receiver, args) as RecordInstance[];\n if (newValues.length) {\n mutateAddToRelatedRecords(this, { value: newValues }, _SIGNAL);\n }\n return result;\n }\n\n case 'pop': {\n const result: unknown = Reflect.apply(target[prop], receiver, args);\n if (result) {\n mutateRemoveFromRelatedRecords(this, { value: recordIdentifierFor(result as RecordInstance) }, _SIGNAL);\n }\n return result;\n }\n\n case 'unshift': {\n const newValues = extractIdentifiersFromRecords(args);\n\n assertNoDuplicates(\n this,\n target,\n (currentState) => currentState.unshift(...newValues),\n `Cannot unshift duplicates to a hasMany's state.`\n );\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n // dedupe\n const seen = new Set(target);\n const unique = new Set<RecordInstance>();\n\n args.forEach((item) => {\n const identifier = recordIdentifierFor(item);\n if (!seen.has(identifier)) {\n seen.add(identifier);\n unique.add(item);\n }\n });\n\n const newArgs = Array.from(unique);\n const result: unknown = Reflect.apply(target[prop], receiver, newArgs);\n\n if (newArgs.length) {\n mutateAddToRelatedRecords(this, { value: extractIdentifiersFromRecords(newArgs), index: 0 }, _SIGNAL);\n }\n return result;\n }\n\n // else, no dedupe, error on duplicates\n const result = Reflect.apply(target[prop], receiver, args) as RecordInstance[];\n if (newValues.length) {\n mutateAddToRelatedRecords(this, { value: newValues, index: 0 }, _SIGNAL);\n }\n return result;\n }\n\n case 'shift': {\n const result: unknown = Reflect.apply(target[prop], receiver, args);\n\n if (result) {\n mutateRemoveFromRelatedRecords(\n this,\n { value: recordIdentifierFor(result as RecordInstance), index: 0 },\n _SIGNAL\n );\n }\n return result;\n }\n\n case 'sort': {\n const result: unknown = Reflect.apply(target[prop], receiver, args);\n mutateSortRelatedRecords(this, (result as RecordInstance[]).map(recordIdentifierFor), _SIGNAL);\n return result;\n }\n\n case 'splice': {\n const [start, deleteCount, ...adds] = args as [number, number, ...RecordInstance[]];\n\n // detect a full replace\n if (start === 0 && deleteCount === this[SOURCE].length) {\n const newValues = extractIdentifiersFromRecords(adds);\n\n assertNoDuplicates(\n this,\n target,\n (currentState) => currentState.splice(start, deleteCount, ...newValues),\n `Cannot replace a hasMany's state with a new state that contains duplicates.`\n );\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n // dedupe\n const current = new Set(adds);\n const unique = Array.from(current);\n const newArgs = ([start, deleteCount] as unknown[]).concat(unique);\n\n const result = Reflect.apply(target[prop], receiver, newArgs) as RecordInstance[];\n\n mutateReplaceRelatedRecords(this, extractIdentifiersFromRecords(unique), _SIGNAL);\n return result;\n }\n\n // else, no dedupe, error on duplicates\n const result = Reflect.apply(target[prop], receiver, args) as RecordInstance[];\n mutateReplaceRelatedRecords(this, newValues, _SIGNAL);\n return result;\n }\n\n const newValues = extractIdentifiersFromRecords(adds);\n assertNoDuplicates(\n this,\n target,\n (currentState) => currentState.splice(start, deleteCount, ...newValues),\n `Cannot splice a hasMany's state with a new state that contains duplicates.`\n );\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n // dedupe\n const currentState = target.slice();\n currentState.splice(start, deleteCount);\n\n const seen = new Set(currentState);\n const unique: RecordInstance[] = [];\n adds.forEach((item) => {\n const identifier = recordIdentifierFor(item);\n if (!seen.has(identifier)) {\n seen.add(identifier);\n unique.push(item);\n }\n });\n\n const newArgs = [start, deleteCount, ...unique];\n const result = Reflect.apply(target[prop], receiver, newArgs) as RecordInstance[];\n\n if (deleteCount > 0) {\n mutateRemoveFromRelatedRecords(this, { value: result.map(recordIdentifierFor), index: start }, _SIGNAL);\n }\n\n if (unique.length > 0) {\n mutateAddToRelatedRecords(this, { value: extractIdentifiersFromRecords(unique), index: start }, _SIGNAL);\n }\n\n return result;\n }\n\n // else, no dedupe, error on duplicates\n const result = Reflect.apply(target[prop], receiver, args) as RecordInstance[];\n if (deleteCount > 0) {\n mutateRemoveFromRelatedRecords(this, { value: result.map(recordIdentifierFor), index: start }, _SIGNAL);\n }\n if (newValues.length > 0) {\n mutateAddToRelatedRecords(this, { value: newValues, index: start }, _SIGNAL);\n }\n return result;\n }\n default:\n assert(`unable to convert ${prop} into a transaction that updates the cache state for this record array`);\n }\n }\n\n notify() {\n const signal = this[ARRAY_SIGNAL];\n signal.shouldReset = true;\n // @ts-expect-error\n notifyArray(this);\n }\n\n /**\n Reloads all of the records in the manyArray. If the manyArray\n holds a relationship that was originally fetched using a links url\n Ember Data will revisit the original links url to repopulate the\n relationship.\n\n If the manyArray holds the result of a `store.query()` reload will\n re-run the original query.\n\n Example\n\n ```javascript\n let user = store.peekRecord('user', '1')\n await login(user);\n\n let permissions = await user.permissions;\n await permissions.reload();\n ```\n\n @method reload\n @public\n */\n reload(options?: FindOptions) {\n // TODO this is odd, we don't ask the store for anything else like this?\n return this._manager.reloadHasMany(this.key, options);\n }\n\n /**\n Saves all of the records in the `ManyArray`.\n\n Example\n\n ```javascript\n let inbox = await store.findRecord('inbox', '1');\n let messages = await inbox.messages;\n messages.forEach((message) => {\n message.isRead = true;\n });\n messages.save();\n ```\n\n @method save\n @public\n @return {PromiseArray} promise\n */\n\n /**\n Create a child record within the owner\n\n @method createRecord\n @public\n @param {Object} hash\n @return {Model} record\n */\n createRecord(hash: CreateRecordProperties): RecordInstance {\n const { store } = this;\n assert(`Expected modelName to be set`, this.modelName);\n const record = store.createRecord(this.modelName, hash);\n this.push(record);\n\n return record;\n }\n\n override destroy() {\n super.destroy(false);\n }\n}\nRelatedCollection.prototype.isAsync = false;\nRelatedCollection.prototype.isPolymorphic = false;\nRelatedCollection.prototype.identifier = null as unknown as StableRecordIdentifier;\nRelatedCollection.prototype.cache = null as unknown as Cache;\nRelatedCollection.prototype._inverseIsAsync = false;\nRelatedCollection.prototype.key = '';\nRelatedCollection.prototype.DEPRECATED_CLASS_NAME = 'ManyArray';\n\ntype PromiseProxyRecord = { then(): void; content: RecordInstance | null | undefined };\n\nfunction assertRecordPassedToHasMany(record: RecordInstance | PromiseProxyRecord) {\n assert(\n `All elements of a hasMany relationship must be instances of Model, you passed $${typeof record}`,\n (function () {\n try {\n recordIdentifierFor(record);\n return true;\n } catch {\n return false;\n }\n })()\n );\n}\n\nfunction extractIdentifiersFromRecords(records: RecordInstance[]): StableRecordIdentifier[] {\n return records.map(extractIdentifierFromRecord);\n}\n\nfunction extractIdentifierFromRecord(recordOrPromiseRecord: PromiseProxyRecord | RecordInstance) {\n assertRecordPassedToHasMany(recordOrPromiseRecord);\n return recordIdentifierFor(recordOrPromiseRecord);\n}\n\nfunction assertNoDuplicates(\n collection: RelatedCollection,\n target: StableRecordIdentifier[],\n callback: (currentState: StableRecordIdentifier[]) => void,\n reason: string\n) {\n const state = target.slice();\n callback(state);\n\n if (state.length !== new Set(state).size) {\n const duplicates = state.filter((currentValue, currentIndex) => state.indexOf(currentValue) !== currentIndex);\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n deprecate(\n `${reason} This behavior is deprecated. Found duplicates for the following records within the new state provided to \\`<${\n collection.identifier.type\n }:${collection.identifier.id || collection.identifier.lid}>.${collection.key}\\`\\n\\t- ${Array.from(\n new Set(duplicates)\n )\n .map((r) => (isStableIdentifier(r) ? r.lid : recordIdentifierFor(r).lid))\n .sort((a, b) => a.localeCompare(b))\n .join('\\n\\t- ')}`,\n false,\n {\n id: 'ember-data:deprecate-many-array-duplicates',\n for: 'ember-data',\n until: '6.0',\n since: {\n enabled: '5.3',\n available: '5.3',\n },\n }\n );\n } else {\n throw new Error(\n `${reason} Found duplicates for the following records within the new state provided to \\`<${\n collection.identifier.type\n }:${collection.identifier.id || collection.identifier.lid}>.${collection.key}\\`\\n\\t- ${Array.from(\n new Set(duplicates)\n )\n .map((r) => (isStableIdentifier(r) ? r.lid : recordIdentifierFor(r).lid))\n .sort((a, b) => a.localeCompare(b))\n .join('\\n\\t- ')}`\n );\n }\n }\n}\n\nfunction mutateAddToRelatedRecords(\n collection: RelatedCollection,\n operationInfo: { value: StableRecordIdentifier | StableRecordIdentifier[]; index?: number },\n _SIGNAL: Signal\n) {\n mutate(\n collection,\n {\n op: 'addToRelatedRecords',\n record: collection.identifier,\n field: collection.key,\n ...operationInfo,\n },\n _SIGNAL\n );\n}\n\nfunction mutateRemoveFromRelatedRecords(\n collection: RelatedCollection,\n operationInfo: { value: StableRecordIdentifier | StableRecordIdentifier[]; index?: number },\n _SIGNAL: Signal\n) {\n mutate(\n collection,\n {\n op: 'removeFromRelatedRecords',\n record: collection.identifier,\n field: collection.key,\n ...operationInfo,\n },\n _SIGNAL\n );\n}\n\nfunction mutateReplaceRelatedRecord(\n collection: RelatedCollection,\n operationInfo: {\n value: StableRecordIdentifier;\n prior: StableRecordIdentifier;\n index: number;\n },\n _SIGNAL: Signal\n) {\n mutate(\n collection,\n {\n op: 'replaceRelatedRecord',\n record: collection.identifier,\n field: collection.key,\n ...operationInfo,\n },\n _SIGNAL\n );\n}\n\nfunction mutateReplaceRelatedRecords(collection: RelatedCollection, value: StableRecordIdentifier[], _SIGNAL: Signal) {\n mutate(\n collection,\n {\n op: 'replaceRelatedRecords',\n record: collection.identifier,\n field: collection.key,\n value,\n },\n _SIGNAL\n );\n}\n\nfunction mutateSortRelatedRecords(collection: RelatedCollection, value: StableRecordIdentifier[], _SIGNAL: Signal) {\n mutate(\n collection,\n {\n op: 'sortRelatedRecords',\n record: collection.identifier,\n field: collection.key,\n value,\n },\n _SIGNAL\n );\n}\n\nfunction mutate(collection: RelatedCollection, mutation: Parameters<LegacySupport['mutate']>[0], _SIGNAL: Signal) {\n collection._manager.mutate(mutation);\n addToTransaction(_SIGNAL);\n}\n","export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n return desc;\n}","import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\nimport ObjectProxy from '@ember/object/proxy';\n\nexport const PromiseObject = ObjectProxy.extend(PromiseProxyMixin);\n","import { assert } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport type PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\nimport type ObjectProxy from '@ember/object/proxy';\n\nimport type Store from '@ember-data/store';\nimport type { RecordInstance } from '@ember-data/store/-types/q/record-instance';\nimport { cached } from '@ember-data/tracking';\n\nimport type { LegacySupport } from './legacy-relationships-support';\nimport { PromiseObject } from './promise-proxy-base';\nimport type BelongsToReference from './references/belongs-to';\n\nexport interface BelongsToProxyMeta {\n key: string;\n store: Store;\n legacySupport: LegacySupport;\n modelName: string;\n}\nexport interface BelongsToProxyCreateArgs {\n promise: Promise<RecordInstance | null>;\n content?: RecordInstance | null;\n _belongsToState: BelongsToProxyMeta;\n}\n\ninterface PromiseObjectType<T> extends PromiseProxyMixin<T | null>, ObjectProxy<T> {\n // eslint-disable-next-line @typescript-eslint/no-misused-new\n new <PT>(...args: unknown[]): PromiseObjectType<PT>;\n}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare class PromiseObjectType<T> {}\n\nconst Extended: PromiseObjectType<RecordInstance> = PromiseObject as unknown as PromiseObjectType<RecordInstance>;\n\n/**\n @module @ember-data/model\n */\n\n/**\n A PromiseBelongsTo is a PromiseObject that also proxies certain method calls\n to the underlying belongsTo model.\n Right now we proxy:\n * `reload()`\n @class PromiseBelongsTo\n @extends PromiseObject\n @private\n*/\nclass PromiseBelongsTo extends Extended<RecordInstance> {\n declare _belongsToState: BelongsToProxyMeta;\n\n @cached\n get id() {\n const { key, legacySupport } = this._belongsToState;\n const ref = legacySupport.referenceFor('belongsTo', key) as BelongsToReference;\n\n return ref.id();\n }\n\n // we don't proxy meta because we would need to proxy it to the relationship state container\n // however, meta on relationships does not trigger change notifications.\n // if you need relationship meta, you should do `record.belongsTo(relationshipName).meta()`\n @computed()\n get meta() {\n // eslint-disable-next-line no-constant-condition\n if (1) {\n assert(\n 'You attempted to access meta on the promise for the async belongsTo relationship ' +\n `${this._belongsToState.modelName}:${this._belongsToState.key}'.` +\n '\\nUse `record.belongsTo(relationshipName).meta()` instead.',\n false\n );\n }\n return;\n }\n\n async reload(options: Record<string, unknown>): Promise<this> {\n assert('You are trying to reload an async belongsTo before it has been created', this.content !== undefined);\n const { key, legacySupport } = this._belongsToState;\n await legacySupport.reloadBelongsTo(key, options);\n return this;\n }\n}\n\nexport default PromiseBelongsTo;\n","import { assert } from '@ember/debug';\n\nimport { DEPRECATE_COMPUTED_CHAINS } from '@ember-data/deprecations';\nimport type { FindOptions } from '@ember-data/store/-types/q/store';\nimport { compat } from '@ember-data/tracking';\nimport { defineSignal } from '@ember-data/tracking/-private';\n\nimport type ManyArray from './many-array';\n\nexport interface HasManyProxyCreateArgs {\n promise: Promise<ManyArray>;\n content?: ManyArray;\n}\n\n/**\n @module @ember-data/model\n */\n/**\n This class is returned as the result of accessing an async hasMany relationship\n on an instance of a Model extending from `@ember-data/model`.\n\n A PromiseManyArray is an iterable proxy that allows templates to consume related\n ManyArrays and update once their contents are no longer pending.\n\n In your JS code you should resolve the promise first.\n\n ```js\n const comments = await post.comments;\n ```\n\n @class PromiseManyArray\n @public\n*/\nexport default class PromiseManyArray {\n declare promise: Promise<ManyArray> | null;\n declare isDestroyed: boolean;\n\n constructor(promise: Promise<ManyArray>, content?: ManyArray) {\n this._update(promise, content);\n this.isDestroyed = false;\n }\n\n //---- Methods/Properties on ArrayProxy that we will keep as our API\n\n declare content: ManyArray | null;\n\n /**\n * Retrieve the length of the content\n * @property length\n * @public\n */\n @compat\n get length(): number {\n // shouldn't be needed, but ends up being needed\n // for computed chains even in 4.x\n if (DEPRECATE_COMPUTED_CHAINS) {\n this['[]'];\n }\n return this.content ? this.content.length : 0;\n }\n\n /**\n * Iterate the proxied content. Called by the glimmer iterator in #each\n * We do not guarantee that forEach will always be available. This\n * may eventually be made to use Symbol.Iterator once glimmer supports it.\n *\n * @method forEach\n * @param cb\n * @return\n * @private\n */\n forEach(cb: Parameters<typeof Array.prototype.forEach>[0]) {\n if (this.content && this.length) {\n this.content.forEach(cb);\n }\n }\n\n /**\n * Reload the relationship\n * @method reload\n * @public\n * @param options\n * @return\n */\n reload(options: FindOptions) {\n assert('You are trying to reload an async manyArray before it has been created', this.content);\n void this.content.reload(options);\n return this;\n }\n\n //---- Properties/Methods from the PromiseProxyMixin that we will keep as our API\n\n /**\n * Whether the loading promise is still pending\n *\n * @property {boolean} isPending\n * @public\n */\n declare isPending: boolean;\n /**\n * Whether the loading promise rejected\n *\n * @property {boolean} isRejected\n * @public\n */\n declare isRejected: boolean;\n /**\n * Whether the loading promise succeeded\n *\n * @property {boolean} isFulfilled\n * @public\n */\n declare isFulfilled: boolean;\n /**\n * Whether the loading promise completed (resolved or rejected)\n *\n * @property {boolean} isSettled\n * @public\n */\n declare isSettled: boolean;\n\n /**\n * chain this promise\n *\n * @method then\n * @public\n * @param success\n * @param fail\n * @return Promise\n */\n then(s: Parameters<typeof Promise.prototype.then>[0], f: Parameters<typeof Promise.prototype.then>[1]) {\n return this.promise!.then(s, f);\n }\n\n /**\n * catch errors thrown by this promise\n * @method catch\n * @public\n * @param callback\n * @return Promise\n */\n catch(cb: Parameters<typeof Promise.prototype.catch>[0]) {\n return this.promise!.catch(cb);\n }\n\n /**\n * run cleanup after this promise completes\n *\n * @method finally\n * @public\n * @param callback\n * @return Promise\n */\n finally(cb: Parameters<typeof Promise.prototype.finally>[0]) {\n return this.promise!.finally(cb);\n }\n\n //---- Methods on EmberObject that we should keep\n\n destroy() {\n this.isDestroyed = true;\n this.content = null;\n this.promise = null;\n }\n\n //---- Methods/Properties on ManyArray that we own and proxy to\n\n /**\n * Retrieve the links for this relationship\n * @property links\n * @public\n */\n @compat\n get links() {\n return this.content ? this.content.links : undefined;\n }\n\n /**\n * Retrieve the meta for this relationship\n * @property meta\n * @public\n */\n @compat\n get meta() {\n return this.content ? this.content.meta : undefined;\n }\n\n //---- Our own stuff\n\n _update(promise: Promise<ManyArray>, content?: ManyArray) {\n if (content !== undefined) {\n this.content = content;\n }\n\n this.promise = tapPromise(this, promise);\n }\n\n static create({ promise, content }: HasManyProxyCreateArgs): PromiseManyArray {\n return new this(promise, content);\n }\n}\ndefineSignal(PromiseManyArray.prototype, 'content', null);\ndefineSignal(PromiseManyArray.prototype, 'isPending', false);\ndefineSignal(PromiseManyArray.prototype, 'isRejected', false);\ndefineSignal(PromiseManyArray.prototype, 'isFulfilled', false);\ndefineSignal(PromiseManyArray.prototype, 'isSettled', false);\n\n// this will error if someone tries to call\n// A(identifierArray) since it is not configurable\n// which is preferrable to the `meta` override we used\n// before which required importing all of Ember\nif (DEPRECATE_COMPUTED_CHAINS) {\n const desc = {\n enumerable: true,\n configurable: false,\n get: function (this: PromiseManyArray) {\n return this.content?.length && this.content;\n },\n };\n compat(desc);\n\n // ember-source < 3.23 (e.g. 3.20 lts)\n // requires that the tag `'[]'` be notified\n // on the ArrayProxy in order for `{{#each}}`\n // to recompute. We entangle the '[]' tag from content\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Object.defineProperty(PromiseManyArray.prototype, '[]', desc);\n}\n\nfunction tapPromise(proxy: PromiseManyArray, promise: Promise<ManyArray>) {\n proxy.isPending = true;\n proxy.isSettled = false;\n proxy.isFulfilled = false;\n proxy.isRejected = false;\n return Promise.resolve(promise).then(\n (content) => {\n proxy.isPending = false;\n proxy.isFulfilled = true;\n proxy.isSettled = true;\n proxy.content = content;\n return content;\n },\n (error) => {\n proxy.isPending = false;\n proxy.isFulfilled = false;\n proxy.isRejected = true;\n proxy.isSettled = true;\n throw error;\n }\n );\n}\n","import { assert } from '@ember/debug';\nimport { DEBUG } from '@ember-data/env';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type Store from '@ember-data/store';\nimport type { UpgradedMeta } from '@ember-data/graph/-private/-edge-definition';\n\n/*\n Assert that `addedRecord` has a valid type so it can be added to the\n relationship of the `record`.\n\n The assert basically checks if the `addedRecord` can be added to the\n relationship (specified via `relationshipMeta`) of the `record`.\n\n This utility should only be used internally, as both record parameters must\n be stable record identifiers and the `relationshipMeta` needs to be the meta\n information about the relationship, retrieved via\n `record.relationshipFor(key)`.\n*/\nlet assertPolymorphicType: (\n parentIdentifier: StableRecordIdentifier,\n parentDefinition: UpgradedMeta,\n addedIdentifier: StableRecordIdentifier,\n store: Store\n) => void;\n\nif (DEBUG) {\n assertPolymorphicType = function assertPolymorphicType(\n parentIdentifier: StableRecordIdentifier,\n parentDefinition: UpgradedMeta,\n addedIdentifier: StableRecordIdentifier,\n store: Store\n ) {\n if (parentDefinition.inverseIsImplicit) {\n return;\n }\n if (parentDefinition.isPolymorphic) {\n let meta = store.getSchemaDefinitionService().relationshipsDefinitionFor(addedIdentifier)[\n parentDefinition.inverseKey\n ];\n assert(\n `The schema for the relationship '${parentDefinition.inverseKey}' on '${addedIdentifier.type}' type does not implement '${parentDefinition.type}' and thus cannot be assigned to the '${parentDefinition.key}' relationship in '${parentIdentifier.type}'. The definition should specify 'as: \"${parentDefinition.type}\"' in options.`,\n meta?.options.as === parentDefinition.type\n );\n }\n };\n}\n\nexport { assertPolymorphicType };\n","import { assert } from '@ember/debug';\n\nimport { DEBUG } from '@ember-data/env';\nimport type { CollectionEdge } from '@ember-data/graph/-private/edges/collection';\nimport type { Graph } from '@ember-data/graph/-private/graph';\nimport type Store from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type { FindOptions } from '@ember-data/store/-types/q/store';\nimport { cached, compat } from '@ember-data/tracking';\nimport { defineSignal } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { CollectionRelationship } from '@warp-drive/core-types/cache/relationship';\nimport type {\n CollectionResourceDocument,\n CollectionResourceRelationship,\n ExistingResourceObject,\n LinkObject,\n Meta,\n PaginationLinks,\n} from '@warp-drive/core-types/spec/raw';\n\nimport { assertPolymorphicType } from '../debug/assert-polymorphic-type';\nimport type { LegacySupport } from '../legacy-relationships-support';\nimport { areAllInverseRecordsLoaded, LEGACY_SUPPORT } from '../legacy-relationships-support';\nimport type ManyArray from '../many-array';\n\n/**\n @module @ember-data/model\n*/\ninterface ResourceIdentifier {\n links?: {\n related?: string | LinkObject;\n };\n meta?: Meta;\n}\n\nfunction isResourceIdentiferWithRelatedLinks(\n value: CollectionResourceRelationship | ResourceIdentifier | null\n): value is ResourceIdentifier & { links: { related: string | LinkObject | null } } {\n return Boolean(value && value.links && value.links.related);\n}\n/**\n A `HasManyReference` is a low-level API that allows access\n and manipulation of a hasMany relationship.\n\n It is especially useful when you're dealing with `async` relationships\n from `@ember-data/model` as it allows synchronous access to\n the relationship data if loaded, as well as APIs for loading, reloading\n the data or accessing available information without triggering a load.\n\n It may also be useful when using `sync` relationships with `@ember-data/model`\n that need to be loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @class HasManyReference\n @public\n */\nexport default class HasManyReference {\n declare graph: Graph;\n declare store: Store;\n declare hasManyRelationship: CollectionEdge;\n /**\n * The field name on the parent record for this has-many relationship.\n *\n * @property {String} key\n * @public\n */\n declare key: string;\n\n /**\n * The type of resource this relationship will contain.\n *\n * @property {String} type\n * @public\n */\n declare type: string;\n\n // unsubscribe tokens given to us by the notification manager\n ___token!: object;\n ___identifier: StableRecordIdentifier;\n ___relatedTokenMap!: Map<StableRecordIdentifier, object>;\n\n declare _ref: number;\n\n constructor(\n store: Store,\n graph: Graph,\n parentIdentifier: StableRecordIdentifier,\n hasManyRelationship: CollectionEdge,\n key: string\n ) {\n this.graph = graph;\n this.key = key;\n this.hasManyRelationship = hasManyRelationship;\n this.type = hasManyRelationship.definition.type;\n\n this.store = store;\n this.___identifier = parentIdentifier;\n this.___token = store.notifications.subscribe(\n parentIdentifier,\n (_: StableRecordIdentifier, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'relationships' && notifiedKey === key) {\n this._ref++;\n }\n }\n );\n this.___relatedTokenMap = new Map();\n // TODO inverse\n }\n\n /**\n * This method should never be called by user code.\n *\n * @internal\n */\n destroy() {\n this.store.notifications.unsubscribe(this.___token);\n this.___relatedTokenMap.forEach((token) => {\n this.store.notifications.unsubscribe(token);\n });\n this.___relatedTokenMap.clear();\n }\n\n /**\n * An array of identifiers for the records that this reference refers to.\n *\n * @property {StableRecordIdentifier[]} identifiers\n * @public\n */\n @cached\n @compat\n get identifiers(): StableRecordIdentifier[] {\n this._ref; // consume the tracked prop\n\n const resource = this._resource();\n\n const map = this.___relatedTokenMap;\n this.___relatedTokenMap = new Map();\n\n if (resource && resource.data) {\n return resource.data.map((resourceIdentifier) => {\n const identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resourceIdentifier);\n let token = map.get(identifier);\n\n if (token) {\n map.delete(identifier);\n } else {\n token = this.store.notifications.subscribe(\n identifier,\n (_: StableRecordIdentifier, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'identity' || (bucket === 'attributes' && notifiedKey === 'id')) {\n this._ref++;\n }\n }\n );\n }\n this.___relatedTokenMap.set(identifier, token);\n\n return identifier;\n });\n }\n\n map.forEach((token) => {\n this.store.notifications.unsubscribe(token);\n });\n map.clear();\n\n return [];\n }\n\n _resource() {\n const cache = this.store.cache;\n return cache.getRelationship(this.___identifier, this.key) as CollectionResourceRelationship;\n }\n\n /**\n This returns a string that represents how the reference will be\n looked up when it is loaded. If the relationship has a link it will\n use the \"link\" otherwise it defaults to \"id\".\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n // get the identifier of the reference\n if (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n } else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n }\n ```\n\n @method remoteType\n @public\n @return {String} The name of the remote type. This should either be `link` or `ids`\n */\n remoteType(): 'link' | 'ids' {\n const value = this._resource();\n if (value && value.links && value.links.related) {\n return 'link';\n }\n\n return 'ids';\n }\n\n /**\n `ids()` returns an array of the record IDs in this relationship.\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n commentsRef.ids(); // ['1']\n ```\n\n @method ids\n @public\n @return {Array} The ids in this has-many relationship\n */\n ids(): Array<string | null> {\n return this.identifiers.map((identifier) => identifier.id);\n }\n\n /**\n The link Ember Data will use to fetch or reload this belongs-to\n relationship. By default it uses only the \"related\" resource linkage.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: '/articles/1/author'\n }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n // get the identifier of the reference\n if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n ```\n\n @method link\n @public\n @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.\n */\n link(): string | null {\n const resource = this._resource();\n\n if (isResourceIdentiferWithRelatedLinks(resource)) {\n if (resource.links) {\n const related = resource.links.related;\n return !related || typeof related === 'string' ? related : related.href;\n }\n }\n return null;\n }\n\n /**\n * any links that have been received for this relationship\n *\n * @method links\n * @public\n * @return\n */\n links(): PaginationLinks | null {\n const resource = this._resource();\n\n return resource && resource.links ? resource.links : null;\n }\n\n /**\n The meta data for the has-many relationship.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { hasMany } from '@ember-data/model';\n export default Model.extend({\n users: hasMany('user', { async: true, inverse: null })\n });\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n users: {\n links: {\n related: {\n href: '/articles/1/authors'\n },\n },\n meta: {\n lastUpdated: 1458014400000\n }\n }\n }\n }\n });\n\n let usersRef = blog.hasMany('user');\n\n usersRef.meta() // { lastUpdated: 1458014400000 }\n ```\n\n @method meta\n @public\n @return {Object|null} The meta information for the belongs-to relationship.\n */\n meta(): Meta | null {\n let meta: Meta | null = null;\n const resource = this._resource();\n if (resource && resource.meta && typeof resource.meta === 'object') {\n meta = resource.meta;\n }\n return meta;\n }\n\n /**\n `push` can be used to update the data in the relationship and EmberData\n will treat the new data as the canonical value of this relationship on\n the backend. An empty array will signify the canonical value should be\n empty.\n\n Example model\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n Setup some initial state, note we haven't loaded the comments yet:\n\n ```js\n const post = store.push({\n data: {\n type: 'post',\n id: '1',\n relationships: {\n comments: {\n data: [{ type: 'comment', id: '1' }]\n }\n }\n }\n });\n\n const commentsRef = post.hasMany('comments');\n commentsRef.ids(); // ['1']\n ```\n\n Update the state using `push`, note we can do this even without\n having loaded these comments yet by providing resource identifiers.\n\n Both full resources and resource identifiers are supported.\n\n ```js\n await commentsRef.push({\n data: [\n { type: 'comment', id: '2' },\n { type: 'comment', id: '3' },\n ]\n });\n\n commentsRef.ids(); // ['2', '3']\n ```\n\n For convenience, you can also pass in an array of resources or resource identifiers\n without wrapping them in the `data` property:\n\n ```js\n await commentsRef.push([\n { type: 'comment', id: '4' },\n { type: 'comment', id: '5' },\n ]);\n\n commentsRef.ids(); // ['4', '5']\n ```\n\n When using the `data` property, you may also include other resource data via included,\n as well as provide new links and meta to the relationship.\n\n ```js\n await commentsRef.push({\n links: {\n related: '/posts/1/comments'\n },\n meta: {\n total: 2\n },\n data: [\n { type: 'comment', id: '4' },\n { type: 'comment', id: '5' },\n ],\n included: [\n { type: 'other-thing', id: '1', attributes: { foo: 'bar' },\n ]\n });\n ```\n\n By default, the store will attempt to fetch any unloaded records before resolving\n the returned promise with the ManyArray.\n\n Alternatively, pass `true` as the second argument to avoid fetching unloaded records\n and instead the promise will resolve with void without attempting to fetch. This is\n particularly useful if you want to update the state of the relationship without\n forcing the load of all of the associated records.\n\n @method push\n @public\n @param {Array|Object} doc a JSONAPI document object describing the new value of this relationship.\n @param {Boolean} [skipFetch] if `true`, do not attempt to fetch unloaded records\n @return {Promise<ManyArray | void>}\n */\n async push(\n doc: ExistingResourceObject[] | CollectionResourceDocument,\n skipFetch?: boolean\n ): Promise<ManyArray | void> {\n const { store } = this;\n const dataDoc = Array.isArray(doc) ? { data: doc } : doc;\n const isResourceData = Array.isArray(dataDoc.data) && dataDoc.data.length > 0 && isMaybeResource(dataDoc.data[0]);\n\n // enforce that one of links, meta or data is present\n assert(\n `You must provide at least one of 'links', 'meta' or 'data' when calling hasManyReference.push`,\n 'links' in dataDoc || 'meta' in dataDoc || 'data' in dataDoc\n );\n\n const identifiers = !Array.isArray(dataDoc.data)\n ? []\n : isResourceData\n ? (store._push(dataDoc, true) as StableRecordIdentifier[])\n : dataDoc.data.map((i) => store.identifierCache.getOrCreateRecordIdentifier(i));\n const { identifier } = this.hasManyRelationship;\n\n if (DEBUG) {\n const relationshipMeta = this.hasManyRelationship.definition;\n\n identifiers.forEach((added) => {\n assertPolymorphicType(identifier, relationshipMeta, added, store);\n });\n }\n\n const newData: CollectionResourceRelationship = {};\n // only set data if it was passed in\n if (Array.isArray(dataDoc.data)) {\n newData.data = identifiers;\n }\n if ('links' in dataDoc) {\n newData.links = dataDoc.links;\n }\n if ('meta' in dataDoc) {\n newData.meta = dataDoc.meta;\n }\n store._join(() => {\n this.graph.push({\n op: 'updateRelationship',\n record: identifier,\n field: this.key,\n value: newData,\n });\n });\n\n if (!skipFetch) return this.load();\n }\n\n _isLoaded() {\n const hasRelationshipDataProperty = this.hasManyRelationship.state.hasReceivedData;\n if (!hasRelationshipDataProperty) {\n return false;\n }\n\n const relationship = this.graph.getData(this.hasManyRelationship.identifier, this.key) as CollectionRelationship;\n\n return relationship.data?.every((identifier) => {\n return this.store._instanceCache.recordIsLoaded(identifier, true) === true;\n });\n }\n\n /**\n `value()` synchronously returns the current value of the has-many\n relationship. Unlike `record.relationshipName`, calling\n `value()` on a reference does not trigger a fetch if the async\n relationship is not yet loaded. If the relationship is not loaded\n it will always return `null`.\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n post.comments.then(function(comments) {\n commentsRef.value() === comments\n })\n ```\n\n @method value\n @public\n @return {ManyArray}\n */\n value(): ManyArray | null {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n\n const loaded = this._isLoaded();\n\n if (!loaded) {\n // subscribe to changes\n // for when we are not loaded yet\n this._ref;\n return null;\n }\n\n return support.getManyArray(this.key);\n }\n\n /**\n Loads the relationship if it is not already loaded. If the\n relationship is already loaded this method does not trigger a new\n load. This causes a request to the specified\n relationship link or reloads all items currently in the relationship.\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n commentsRef.load().then(function(comments) {\n //...\n });\n ```\n\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference.\n\n Example\n\n ```javascript\n commentsRef.load({ adapterOptions: { isPrivate: true } })\n .then(function(comments) {\n //...\n });\n ```\n\n ```app/adapters/comment.js\n export default ApplicationAdapter.extend({\n findMany(store, type, id, snapshots) {\n // In the adapter you will have access to adapterOptions.\n let adapterOptions = snapshots[0].adapterOptions;\n }\n });\n ```\n\n @method load\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the ManyArray in\n this has-many relationship.\n */\n async load(options?: FindOptions): Promise<ManyArray> {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n const fetchSyncRel =\n !this.hasManyRelationship.definition.isAsync && !areAllInverseRecordsLoaded(this.store, this._resource());\n return fetchSyncRel\n ? (support.reloadHasMany(this.key, options) as Promise<ManyArray>)\n : // we cast to fix the return type since typescript and eslint don't understand async functions\n // properly\n (support.getHasMany(this.key, options) as Promise<ManyArray> | ManyArray);\n }\n\n /**\n Reloads this has-many relationship. This causes a request to the specified\n relationship link or reloads all items currently in the relationship.\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n commentsRef.reload().then(function(comments) {\n //...\n });\n ```\n\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference. A full example\n can be found in the `load` method.\n\n Example\n\n ```javascript\n commentsRef.reload({ adapterOptions: { isPrivate: true } })\n ```\n\n @method reload\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the ManyArray in this has-many relationship.\n */\n reload(options?: FindOptions) {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n return support.reloadHasMany(this.key, options);\n }\n}\ndefineSignal(HasManyReference.prototype, '_ref', 0);\n\nexport function isMaybeResource(object: ExistingResourceObject | ResourceIdentifier): object is ExistingResourceObject {\n const keys = Object.keys(object).filter((k) => k !== 'id' && k !== 'type' && k !== 'lid');\n return keys.length > 0;\n}\n","import { DEBUG } from '@ember-data/env';\nimport type { ResourceEdge } from '@ember-data/graph/-private/edges/resource';\nimport type { Graph } from '@ember-data/graph/-private/graph';\nimport type Store from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type { RecordInstance } from '@ember-data/store/-types/q/record-instance';\nimport { cached, compat } from '@ember-data/tracking';\nimport { defineSignal } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { StableExistingRecordIdentifier } from '@warp-drive/core-types/identifier';\nimport type {\n LinkObject,\n Links,\n Meta,\n SingleResourceDocument,\n SingleResourceRelationship,\n} from '@warp-drive/core-types/spec/raw';\n\nimport { assertPolymorphicType } from '../debug/assert-polymorphic-type';\nimport type { LegacySupport } from '../legacy-relationships-support';\nimport { areAllInverseRecordsLoaded, LEGACY_SUPPORT } from '../legacy-relationships-support';\nimport { isMaybeResource } from './has-many';\n\n/**\n @module @ember-data/model\n*/\n\ninterface ResourceIdentifier {\n links?: {\n related?: string | LinkObject;\n };\n meta?: Meta;\n}\n\nfunction isResourceIdentiferWithRelatedLinks(\n value: SingleResourceRelationship | ResourceIdentifier | null\n): value is ResourceIdentifier & { links: { related: string | LinkObject | null } } {\n return Boolean(value && value.links && value.links.related);\n}\n\n/**\n A `BelongsToReference` is a low-level API that allows access\n and manipulation of a belongsTo relationship.\n\n It is especially useful when you're dealing with `async` relationships\n from `@ember-data/model` as it allows synchronous access to\n the relationship data if loaded, as well as APIs for loading, reloading\n the data or accessing available information without triggering a load.\n\n It may also be useful when using `sync` relationships with `@ember-data/model`\n that need to be loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @class BelongsToReference\n @public\n */\nexport default class BelongsToReference {\n declare graph: Graph;\n declare store: Store;\n declare belongsToRelationship: ResourceEdge;\n /**\n * The field name on the parent record for this has-many relationship.\n *\n * @property {String} key\n * @public\n */\n declare key: string;\n\n /**\n * The type of resource this relationship will contain.\n *\n * @property {String} type\n * @public\n */\n declare type: string;\n\n // unsubscribe tokens given to us by the notification manager\n declare ___token: object;\n declare ___identifier: StableRecordIdentifier;\n declare ___relatedToken: object | null;\n\n declare _ref: number;\n\n constructor(\n store: Store,\n graph: Graph,\n parentIdentifier: StableRecordIdentifier,\n belongsToRelationship: ResourceEdge,\n key: string\n ) {\n this.graph = graph;\n this.key = key;\n this.belongsToRelationship = belongsToRelationship;\n this.type = belongsToRelationship.definition.type;\n this.store = store;\n this.___identifier = parentIdentifier;\n this.___relatedToken = null;\n\n this.___token = store.notifications.subscribe(\n parentIdentifier,\n (_: StableRecordIdentifier, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'relationships' && notifiedKey === key) {\n this._ref++;\n }\n }\n );\n\n // TODO inverse\n }\n\n destroy() {\n // TODO @feature we need the notification manager often enough\n // we should potentially just expose it fully public\n this.store.notifications.unsubscribe(this.___token);\n this.___token = null as unknown as object;\n if (this.___relatedToken) {\n this.store.notifications.unsubscribe(this.___relatedToken);\n this.___relatedToken = null;\n }\n }\n\n /**\n * The identifier of the record that this reference refers to.\n * `null` if no related record is known.\n *\n * @property {StableRecordIdentifier | null} identifier\n * @public\n */\n @cached\n @compat\n get identifier(): StableRecordIdentifier | null {\n if (this.___relatedToken) {\n this.store.notifications.unsubscribe(this.___relatedToken);\n this.___relatedToken = null;\n }\n\n const resource = this._resource();\n if (resource && resource.data) {\n const identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resource.data);\n this.___relatedToken = this.store.notifications.subscribe(\n identifier,\n (_: StableRecordIdentifier, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'identity' || (bucket === 'attributes' && notifiedKey === 'id')) {\n this._ref++;\n }\n }\n );\n\n return identifier;\n }\n\n return null;\n }\n\n /**\n The `id` of the record that this reference refers to. Together, the\n `type()` and `id()` methods form a composite key for the identity\n map. This can be used to access the id of an async relationship\n without triggering a fetch that would normally happen if you\n attempted to use `record.relationship.id`.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n // get the identifier of the reference\n if (userRef.remoteType() === \"id\") {\n let id = userRef.id();\n }\n ```\n\n @method id\n @public\n @return {String} The id of the record in this belongsTo relationship.\n */\n id(): string | null {\n return this.identifier?.id || null;\n }\n\n /**\n The link Ember Data will use to fetch or reload this belongs-to\n relationship. By default it uses only the \"related\" resource linkage.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: '/articles/1/author'\n }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n // get the identifier of the reference\n if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n ```\n\n @method link\n @public\n @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.\n */\n link(): string | null {\n const resource = this._resource();\n\n if (isResourceIdentiferWithRelatedLinks(resource)) {\n if (resource.links) {\n const related = resource.links.related;\n return !related || typeof related === 'string' ? related : related.href;\n }\n }\n return null;\n }\n\n /**\n * any links that have been received for this relationship\n *\n * @method links\n * @public\n * @return\n */\n links(): Links | null {\n const resource = this._resource();\n\n return resource && resource.links ? resource.links : null;\n }\n\n /**\n The meta data for the belongs-to relationship.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: {\n href: '/articles/1/author'\n },\n },\n meta: {\n lastUpdated: 1458014400000\n }\n }\n }\n }\n });\n\n let userRef = blog.belongsTo('user');\n\n userRef.meta() // { lastUpdated: 1458014400000 }\n ```\n\n @method meta\n @public\n @return {Object} The meta information for the belongs-to relationship.\n */\n meta(): Meta | null {\n let meta: Meta | null = null;\n const resource = this._resource();\n if (resource && resource.meta && typeof resource.meta === 'object') {\n meta = resource.meta;\n }\n return meta;\n }\n\n _resource() {\n this._ref; // subscribe\n const cache = this.store.cache;\n return cache.getRelationship(this.___identifier, this.key) as SingleResourceRelationship;\n }\n\n /**\n This returns a string that represents how the reference will be\n looked up when it is loaded. If the relationship has a link it will\n use the \"link\" otherwise it defaults to \"id\".\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n // get the identifier of the reference\n if (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n } else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n }\n ```\n\n @method remoteType\n @public\n @return {String} The name of the remote type. This should either be `link` or `id`\n */\n remoteType(): 'link' | 'id' {\n const value = this._resource();\n if (isResourceIdentiferWithRelatedLinks(value)) {\n return 'link';\n }\n return 'id';\n }\n\n /**\n `push` can be used to update the data in the relationship and EmberData\n will treat the new data as the canonical value of this relationship on\n the backend. A value of `null` (e.g. `{ data: null }`) can be passed to\n clear the relationship.\n\n Example model\n\n ```app/models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n ```\n\n Setup some initial state, note we haven't loaded the user yet:\n\n ```js\n const blog = store.push({\n data: {\n type: 'blog',\n id: '1',\n relationships: {\n user: {\n data: { type: 'user', id: '1' }\n }\n }\n }\n });\n\n const userRef = blog.belongsTo('user');\n userRef.id(); // '1'\n ```\n\n Update the state using `push`, note we can do this even without\n having loaded the user yet by providing a resource-identifier.\n\n Both full a resource and a resource-identifier are supported.\n\n ```js\n await userRef.push({\n data: {\n type: 'user',\n id: '2',\n }\n });\n\n userRef.id(); // '2'\n ```\n\n You may also pass in links and meta fore the relationship, and sideload\n additional resources that might be required.\n\n ```js\n await userRef.push({\n data: {\n type: 'user',\n id: '2',\n },\n links: {\n related: '/articles/1/author'\n },\n meta: {\n lastUpdated: Date.now()\n },\n included: [\n {\n type: 'user-preview',\n id: '2',\n attributes: {\n username: '@runspired'\n }\n }\n ]\n });\n ```\n\n By default, the store will attempt to fetch the record if it is not loaded or its\n resource data is not included in the call to `push` before resolving the returned\n promise with the new state..\n\n Alternatively, pass `true` as the second argument to avoid fetching unloaded records\n and instead the promise will resolve with void without attempting to fetch. This is\n particularly useful if you want to update the state of the relationship without\n forcing the load of all of the associated record.\n\n @method push\n @public\n @param {Object} doc a JSONAPI document object describing the new value of this relationship.\n @param {Boolean} [skipFetch] if `true`, do not attempt to fetch unloaded records\n @return {Promise<RecordInstance | null | void>}\n */\n async push(doc: SingleResourceDocument, skipFetch?: boolean): Promise<RecordInstance | null | void> {\n const { store } = this;\n const isResourceData = doc.data && isMaybeResource(doc.data);\n const added = isResourceData\n ? (store._push(doc, true) as StableExistingRecordIdentifier)\n : doc.data\n ? (store.identifierCache.getOrCreateRecordIdentifier(doc.data) as StableExistingRecordIdentifier)\n : null;\n const { identifier } = this.belongsToRelationship;\n\n if (DEBUG) {\n if (added) {\n assertPolymorphicType(identifier, this.belongsToRelationship.definition, added, store);\n }\n }\n\n const newData: SingleResourceRelationship = {};\n\n // only set data if it was passed in\n if (doc.data || doc.data === null) {\n newData.data = added;\n }\n if ('links' in doc) {\n newData.links = doc.links;\n }\n if ('meta' in doc) {\n newData.meta = doc.meta;\n }\n store._join(() => {\n this.graph.push({\n op: 'updateRelationship',\n record: identifier,\n field: this.key,\n value: newData,\n });\n });\n\n if (!skipFetch) return this.load();\n }\n\n /**\n `value()` synchronously returns the current value of the belongs-to\n relationship. Unlike `record.relationshipName`, calling\n `value()` on a reference does not trigger a fetch if the async\n relationship is not yet loaded. If the relationship is not loaded\n it will always return `null`.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n userRef.value(); // null\n\n // provide data for reference\n userRef.push({\n data: {\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value(); // user\n });\n ```\n\n @method value\n @public\n @return {Model} the record in this relationship\n */\n value(): RecordInstance | null {\n const resource = this._resource();\n return resource && resource.data ? this.store.peekRecord(resource.data) : null;\n }\n\n /**\n Loads a record in a belongs-to relationship if it is not already\n loaded. If the relationship is already loaded this method does not\n trigger a new load.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n userRef.value(); // null\n\n userRef.load().then(function(user) {\n userRef.value() === user\n });\n ```\n\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference.\n\n Example\n\n ```javascript\n userRef.load({ adapterOptions: { isPrivate: true } }).then(function(user) {\n userRef.value() === user;\n });\n ```\n ```app/adapters/user.js\n import Adapter from '@ember-data/adapter';\n\n export default class UserAdapter extends Adapter {\n findRecord(store, type, id, snapshot) {\n // In the adapter you will have access to adapterOptions.\n let adapterOptions = snapshot.adapterOptions;\n }\n });\n ```\n\n @method load\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the record in this belongs-to relationship.\n */\n async load(options?: Record<string, unknown>): Promise<RecordInstance | null> {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n const fetchSyncRel =\n !this.belongsToRelationship.definition.isAsync && !areAllInverseRecordsLoaded(this.store, this._resource());\n return fetchSyncRel\n ? support.reloadBelongsTo(this.key, options).then(() => this.value())\n : // we cast to fix the return type since typescript and eslint don't understand async functions\n // properly\n (support.getBelongsTo(this.key, options) as Promise<RecordInstance | null>);\n }\n\n /**\n Triggers a reload of the value in this relationship. If the\n remoteType is `\"link\"` Ember Data will use the relationship link to\n reload the relationship. Otherwise it will reload the record by its\n id.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n userRef.reload().then(function(user) {\n userRef.value() === user\n });\n ```\n\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference. A full example\n can be found in the `load` method.\n\n Example\n\n ```javascript\n userRef.reload({ adapterOptions: { isPrivate: true } })\n ```\n\n @method reload\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the record in this belongs-to relationship after the reload has completed.\n */\n reload(options?: Record<string, unknown>) {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n return support.reloadBelongsTo(this.key, options).then(() => this.value());\n }\n}\ndefineSignal(BelongsToReference.prototype, '_ref', 0);\n","import { assert } from '@ember/debug';\n\nimport { importSync } from '@embroider/macros';\n\nimport { DEBUG } from '@ember-data/env';\nimport type { UpgradedMeta } from '@ember-data/graph/-private/-edge-definition';\nimport type { CollectionEdge } from '@ember-data/graph/-private/edges/collection';\nimport type { ResourceEdge } from '@ember-data/graph/-private/edges/resource';\nimport type { Graph, GraphEdge } from '@ember-data/graph/-private/graph';\nimport { upgradeStore } from '@ember-data/legacy-compat/-private';\nimport { HAS_JSON_API_PACKAGE } from '@ember-data/packages';\nimport type Store from '@ember-data/store';\nimport {\n fastPush,\n isStableIdentifier,\n peekCache,\n recordIdentifierFor,\n SOURCE,\n storeFor,\n} from '@ember-data/store/-private';\nimport type { Cache } from '@ember-data/store/-types/q/cache';\nimport type { JsonApiRelationship } from '@ember-data/store/-types/q/record-data-json-api';\nimport type { RecordInstance } from '@ember-data/store/-types/q/record-instance';\nimport type { FindOptions } from '@ember-data/store/-types/q/store';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { CollectionRelationship } from '@warp-drive/core-types/cache/relationship';\nimport type { LocalRelationshipOperation } from '@warp-drive/core-types/graph';\nimport type { CollectionResourceRelationship, SingleResourceRelationship } from '@warp-drive/core-types/spec/raw';\n\nimport RelatedCollection from './many-array';\nimport type { MinimalLegacyRecord } from './model-methods';\nimport type { BelongsToProxyCreateArgs, BelongsToProxyMeta } from './promise-belongs-to';\nimport PromiseBelongsTo from './promise-belongs-to';\nimport type { HasManyProxyCreateArgs } from './promise-many-array';\nimport PromiseManyArray from './promise-many-array';\nimport BelongsToReference from './references/belongs-to';\nimport HasManyReference from './references/has-many';\n\ntype PromiseBelongsToFactory = { create(args: BelongsToProxyCreateArgs): PromiseBelongsTo };\n\nexport const LEGACY_SUPPORT: Map<StableRecordIdentifier | MinimalLegacyRecord, LegacySupport> = new Map();\n\nexport function lookupLegacySupport(record: MinimalLegacyRecord): LegacySupport {\n const identifier = recordIdentifierFor(record);\n assert(`Expected a record`, identifier);\n let support = LEGACY_SUPPORT.get(identifier);\n\n if (!support) {\n assert(`Memory Leak Detected`, !record.isDestroyed && !record.isDestroying);\n support = new LegacySupport(record);\n LEGACY_SUPPORT.set(identifier, support);\n LEGACY_SUPPORT.set(record, support);\n }\n\n return support;\n}\n\nexport class LegacySupport {\n declare record: MinimalLegacyRecord;\n declare store: Store;\n declare graph: Graph;\n declare cache: Cache;\n declare references: Record<string, BelongsToReference | HasManyReference>;\n declare identifier: StableRecordIdentifier;\n declare _manyArrayCache: Record<string, RelatedCollection>;\n declare _relationshipPromisesCache: Record<string, Promise<RelatedCollection | RecordInstance>>;\n declare _relationshipProxyCache: Record<string, PromiseManyArray | PromiseBelongsTo | undefined>;\n declare _pending: Record<string, Promise<StableRecordIdentifier | null> | undefined>;\n\n declare isDestroying: boolean;\n declare isDestroyed: boolean;\n\n constructor(record: MinimalLegacyRecord) {\n this.record = record;\n this.store = storeFor(record)!;\n this.identifier = recordIdentifierFor(record);\n this.cache = peekCache(record);\n\n if (HAS_JSON_API_PACKAGE) {\n const graphFor = (importSync('@ember-data/graph/-private') as typeof import('@ember-data/graph/-private'))\n .graphFor;\n\n this.graph = graphFor(this.store);\n }\n\n this._manyArrayCache = Object.create(null) as Record<string, RelatedCollection>;\n this._relationshipPromisesCache = Object.create(null) as Record<\n string,\n Promise<RelatedCollection | RecordInstance>\n >;\n this._relationshipProxyCache = Object.create(null) as Record<string, PromiseManyArray | PromiseBelongsTo>;\n this._pending = Object.create(null) as Record<string, Promise<StableRecordIdentifier | null>>;\n this.references = Object.create(null) as Record<string, BelongsToReference>;\n }\n\n _syncArray(array: RelatedCollection) {\n // It’s possible the parent side of the relationship may have been destroyed by this point\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n const currentState = array[SOURCE];\n const identifier = this.identifier;\n\n const [identifiers, jsonApi] = this._getCurrentState(identifier, array.key);\n\n if (jsonApi.meta) {\n array.meta = jsonApi.meta;\n }\n\n if (jsonApi.links) {\n array.links = jsonApi.links;\n }\n\n currentState.length = 0;\n fastPush(currentState, identifiers);\n }\n\n mutate(mutation: LocalRelationshipOperation): void {\n this.cache.mutate(mutation);\n }\n\n _findBelongsTo(\n key: string,\n resource: SingleResourceRelationship,\n relationship: ResourceEdge,\n options?: FindOptions\n ): Promise<RecordInstance | null> {\n // TODO @runspired follow up if parent isNew then we should not be attempting load here\n // TODO @runspired follow up on whether this should be in the relationship requests cache\n return this._findBelongsToByJsonApiResource(resource, this.identifier, relationship, options).then(\n (identifier: StableRecordIdentifier | null) =>\n handleCompletedRelationshipRequest(this, key, relationship, identifier),\n (e: Error) => handleCompletedRelationshipRequest(this, key, relationship, null, e)\n );\n }\n\n reloadBelongsTo(key: string, options?: FindOptions): Promise<RecordInstance | null> {\n const loadingPromise = this._relationshipPromisesCache[key] as Promise<RecordInstance | null> | undefined;\n if (loadingPromise) {\n return loadingPromise;\n }\n\n const relationship = this.graph.get(this.identifier, key);\n assert(`Expected ${key} to be a belongs-to relationship`, isBelongsTo(relationship));\n\n const resource = this.cache.getRelationship(this.identifier, key) as SingleResourceRelationship;\n relationship.state.hasFailedLoadAttempt = false;\n relationship.state.shouldForceReload = true;\n const promise = this._findBelongsTo(key, resource, relationship, options);\n if (this._relationshipProxyCache[key]) {\n // @ts-expect-error\n return this._updatePromiseProxyFor('belongsTo', key, { promise });\n }\n return promise;\n }\n\n getBelongsTo(key: string, options?: FindOptions): PromiseBelongsTo | RecordInstance | null {\n const { identifier, cache } = this;\n const resource = cache.getRelationship(this.identifier, key) as SingleResourceRelationship;\n const relatedIdentifier = resource && resource.data ? resource.data : null;\n assert(`Expected a stable identifier`, !relatedIdentifier || isStableIdentifier(relatedIdentifier));\n\n const store = this.store;\n const relationship = this.graph.get(this.identifier, key);\n assert(`Expected ${key} to be a belongs-to relationship`, isBelongsTo(relationship));\n\n const isAsync = relationship.definition.isAsync;\n const _belongsToState: BelongsToProxyMeta = {\n key,\n store,\n legacySupport: this,\n modelName: relationship.definition.type,\n };\n\n if (isAsync) {\n if (relationship.state.hasFailedLoadAttempt) {\n return this._relationshipProxyCache[key] as PromiseBelongsTo;\n }\n\n const promise = this._findBelongsTo(key, resource, relationship, options);\n const isLoaded = relatedIdentifier && store._instanceCache.recordIsLoaded(relatedIdentifier);\n\n return this._updatePromiseProxyFor('belongsTo', key, {\n promise,\n content: isLoaded ? store._instanceCache.getRecord(relatedIdentifier) : null,\n _belongsToState,\n });\n } else {\n if (relatedIdentifier === null) {\n return null;\n } else {\n const toReturn = store._instanceCache.getRecord(relatedIdentifier);\n assert(\n `You looked up the '${key}' relationship on a '${identifier.type}' with id ${\n identifier.id || 'null'\n } but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async (\\`belongsTo(<type>, { async: true, inverse: <inverse> })\\`)`,\n toReturn === null || store._instanceCache.recordIsLoaded(relatedIdentifier, true)\n );\n return toReturn;\n }\n }\n }\n\n setDirtyBelongsTo(key: string, value: RecordInstance | null) {\n return this.cache.mutate(\n {\n op: 'replaceRelatedRecord',\n record: this.identifier,\n field: key,\n value: extractIdentifierFromRecord(value),\n },\n // @ts-expect-error\n true\n );\n }\n\n _getCurrentState(\n identifier: StableRecordIdentifier,\n field: string\n ): [StableRecordIdentifier[], CollectionRelationship] {\n const jsonApi = this.cache.getRelationship(identifier, field) as CollectionRelationship;\n const cache = this.store._instanceCache;\n const identifiers: StableRecordIdentifier[] = [];\n if (jsonApi.data) {\n for (let i = 0; i < jsonApi.data.length; i++) {\n const relatedIdentifier: StableRecordIdentifier = jsonApi.data[i];\n assert(`Expected a stable identifier`, isStableIdentifier(relatedIdentifier));\n if (cache.recordIsLoaded(relatedIdentifier, true)) {\n identifiers.push(relatedIdentifier);\n }\n }\n }\n\n return [identifiers, jsonApi];\n }\n\n getManyArray(key: string, definition?: UpgradedMeta): RelatedCollection {\n if (HAS_JSON_API_PACKAGE) {\n let manyArray: RelatedCollection | undefined = this._manyArrayCache[key];\n if (!definition) {\n definition = this.graph.get(this.identifier, key).definition;\n }\n\n if (!manyArray) {\n const [identifiers, doc] = this._getCurrentState(this.identifier, key);\n\n manyArray = new RelatedCollection({\n store: this.store,\n type: definition.type,\n identifier: this.identifier,\n cache: this.cache,\n identifiers,\n key,\n meta: doc.meta || null,\n links: doc.links || null,\n isPolymorphic: definition.isPolymorphic,\n isAsync: definition.isAsync,\n _inverseIsAsync: definition.inverseIsAsync,\n manager: this,\n isLoaded: !definition.isAsync,\n allowMutation: true,\n });\n this._manyArrayCache[key] = manyArray;\n }\n\n return manyArray;\n }\n assert('hasMany only works with the @ember-data/json-api package');\n }\n\n fetchAsyncHasMany(\n key: string,\n relationship: CollectionEdge,\n manyArray: RelatedCollection,\n options?: FindOptions\n ): Promise<RelatedCollection> {\n if (HAS_JSON_API_PACKAGE) {\n let loadingPromise = this._relationshipPromisesCache[key] as Promise<RelatedCollection> | undefined;\n if (loadingPromise) {\n return loadingPromise;\n }\n\n const jsonApi = this.cache.getRelationship(this.identifier, key) as CollectionRelationship;\n const promise = this._findHasManyByJsonApiResource(jsonApi, this.identifier, relationship, options);\n\n if (!promise) {\n manyArray.isLoaded = true;\n return Promise.resolve(manyArray);\n }\n\n loadingPromise = promise.then(\n () => handleCompletedRelationshipRequest(this, key, relationship, manyArray),\n (e: Error) => handleCompletedRelationshipRequest(this, key, relationship, manyArray, e)\n );\n this._relationshipPromisesCache[key] = loadingPromise;\n return loadingPromise;\n }\n assert('hasMany only works with the @ember-data/json-api package');\n }\n\n reloadHasMany(key: string, options?: FindOptions) {\n if (HAS_JSON_API_PACKAGE) {\n const loadingPromise = this._relationshipPromisesCache[key];\n if (loadingPromise) {\n return loadingPromise;\n }\n const relationship = this.graph.get(this.identifier, key) as CollectionEdge;\n const { definition, state } = relationship;\n\n state.hasFailedLoadAttempt = false;\n state.shouldForceReload = true;\n const manyArray = this.getManyArray(key, definition);\n const promise = this.fetchAsyncHasMany(key, relationship, manyArray, options);\n\n if (this._relationshipProxyCache[key]) {\n return this._updatePromiseProxyFor('hasMany', key, { promise });\n }\n\n return promise;\n }\n assert(`hasMany only works with the @ember-data/json-api package`);\n }\n\n getHasMany(key: string, options?: FindOptions): PromiseManyArray | RelatedCollection {\n if (HAS_JSON_API_PACKAGE) {\n const relationship = this.graph.get(this.identifier, key) as CollectionEdge;\n const { definition, state } = relationship;\n const manyArray = this.getManyArray(key, definition);\n\n if (definition.isAsync) {\n if (state.hasFailedLoadAttempt) {\n return this._relationshipProxyCache[key] as PromiseManyArray;\n }\n\n const promise = this.fetchAsyncHasMany(key, relationship, manyArray, options);\n\n return this._updatePromiseProxyFor('hasMany', key, { promise, content: manyArray });\n } else {\n assert(\n `You looked up the '${key}' relationship on a '${this.identifier.type}' with id ${\n this.identifier.id || 'null'\n } but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async ('hasMany(<type>, { async: true, inverse: <inverse> })')`,\n !anyUnloaded(this.store, relationship)\n );\n\n return manyArray;\n }\n }\n assert(`hasMany only works with the @ember-data/json-api package`);\n }\n\n _updatePromiseProxyFor(kind: 'hasMany', key: string, args: HasManyProxyCreateArgs): PromiseManyArray;\n _updatePromiseProxyFor(kind: 'belongsTo', key: string, args: BelongsToProxyCreateArgs): PromiseBelongsTo;\n _updatePromiseProxyFor(\n kind: 'belongsTo',\n key: string,\n args: { promise: Promise<RecordInstance | null> }\n ): PromiseBelongsTo;\n _updatePromiseProxyFor(\n kind: 'hasMany' | 'belongsTo',\n key: string,\n args: BelongsToProxyCreateArgs | HasManyProxyCreateArgs | { promise: Promise<RecordInstance | null> }\n ): PromiseBelongsTo | PromiseManyArray {\n let promiseProxy = this._relationshipProxyCache[key];\n if (kind === 'hasMany') {\n const { promise, content } = args as HasManyProxyCreateArgs;\n if (promiseProxy) {\n assert(`Expected a PromiseManyArray`, '_update' in promiseProxy);\n promiseProxy._update(promise, content);\n } else {\n promiseProxy = this._relationshipProxyCache[key] = new PromiseManyArray(promise, content);\n }\n return promiseProxy;\n }\n if (promiseProxy) {\n const { promise, content } = args as BelongsToProxyCreateArgs;\n assert(`Expected a PromiseBelongsTo`, '_belongsToState' in promiseProxy);\n\n if (content !== undefined) {\n promiseProxy.set('content', content);\n }\n void promiseProxy.set('promise', promise);\n } else {\n promiseProxy = (PromiseBelongsTo as unknown as PromiseBelongsToFactory).create(args as BelongsToProxyCreateArgs);\n this._relationshipProxyCache[key] = promiseProxy;\n }\n\n return promiseProxy;\n }\n\n referenceFor(kind: string | null, name: string) {\n let reference = this.references[name];\n\n if (!reference) {\n if (!HAS_JSON_API_PACKAGE) {\n // TODO @runspired while this feels odd, it is not a regression in capability because we do\n // not today support references pulling from RecordDatas other than our own\n // because of the intimate API access involved. This is something we will need to redesign.\n assert(`snapshot.belongsTo only supported for @ember-data/json-api`);\n }\n const { graph, identifier } = this;\n const relationship = graph.get(identifier, name);\n\n if (DEBUG) {\n if (kind) {\n const modelName = identifier.type;\n const actualRelationshipKind = relationship.definition.kind;\n assert(\n `You tried to get the '${name}' relationship on a '${modelName}' via record.${kind}('${name}'), but the relationship is of kind '${actualRelationshipKind}'. Use record.${actualRelationshipKind}('${name}') instead.`,\n actualRelationshipKind === kind\n );\n }\n }\n\n const relationshipKind = relationship.definition.kind;\n\n if (relationshipKind === 'belongsTo') {\n reference = new BelongsToReference(this.store, graph, identifier, relationship as ResourceEdge, name);\n } else if (relationshipKind === 'hasMany') {\n reference = new HasManyReference(this.store, graph, identifier, relationship as CollectionEdge, name);\n }\n\n this.references[name] = reference;\n }\n\n return reference;\n }\n\n _findHasManyByJsonApiResource(\n resource: CollectionResourceRelationship,\n parentIdentifier: StableRecordIdentifier,\n relationship: CollectionEdge,\n options: FindOptions = {}\n ): Promise<void | unknown[]> | void {\n if (HAS_JSON_API_PACKAGE) {\n if (!resource) {\n return;\n }\n const { definition, state } = relationship;\n upgradeStore(this.store);\n const adapter = this.store.adapterFor(definition.type);\n const { isStale, hasDematerializedInverse, hasReceivedData, isEmpty, shouldForceReload } = state;\n const allInverseRecordsAreLoaded = areAllInverseRecordsLoaded(this.store, resource);\n const identifiers = resource.data;\n const shouldFindViaLink =\n resource.links &&\n resource.links.related &&\n (typeof adapter.findHasMany === 'function' || typeof identifiers === 'undefined') &&\n (shouldForceReload || hasDematerializedInverse || isStale || (!allInverseRecordsAreLoaded && !isEmpty));\n\n const relationshipMeta = this.store\n .getSchemaDefinitionService()\n .relationshipsDefinitionFor({ type: definition.inverseType })[definition.key];\n\n const request = {\n useLink: shouldFindViaLink,\n field: relationshipMeta,\n links: resource.links,\n meta: resource.meta,\n options,\n record: parentIdentifier,\n };\n\n // fetch via link\n if (shouldFindViaLink) {\n assert(`Expected collection to be an array`, !identifiers || Array.isArray(identifiers));\n assert(`Expected stable identifiers`, !identifiers || identifiers.every(isStableIdentifier));\n\n return this.store.request({\n op: 'findHasMany',\n records: identifiers || [],\n data: request,\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n }) as unknown as Promise<void>;\n }\n\n const preferLocalCache = hasReceivedData && !isEmpty;\n const hasLocalPartialData =\n hasDematerializedInverse || (isEmpty && Array.isArray(identifiers) && identifiers.length > 0);\n const attemptLocalCache = !shouldForceReload && !isStale && (preferLocalCache || hasLocalPartialData);\n\n if (attemptLocalCache && allInverseRecordsAreLoaded) {\n return;\n }\n\n const hasData = hasReceivedData && !isEmpty;\n if (attemptLocalCache || hasData || hasLocalPartialData) {\n assert(`Expected collection to be an array`, Array.isArray(identifiers));\n assert(`Expected stable identifiers`, identifiers.every(isStableIdentifier));\n\n options.reload = options.reload || !attemptLocalCache || undefined;\n return this.store.request({\n op: 'findHasMany',\n records: identifiers,\n data: request,\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n }) as unknown as Promise<void>;\n }\n\n // we were explicitly told we have no data and no links.\n // TODO if the relationshipIsStale, should we hit the adapter anyway?\n return;\n }\n assert(`hasMany only works with the @ember-data/json-api package`);\n }\n\n _findBelongsToByJsonApiResource(\n resource: SingleResourceRelationship,\n parentIdentifier: StableRecordIdentifier,\n relationship: ResourceEdge,\n options: FindOptions = {}\n ): Promise<StableRecordIdentifier | null> {\n if (!resource) {\n return Promise.resolve(null);\n }\n const key = relationship.definition.key;\n\n // interleaved promises mean that we MUST cache this here\n // in order to prevent infinite re-render if the request\n // fails.\n if (this._pending[key]) {\n return this._pending[key]!;\n }\n\n const identifier = resource.data ? resource.data : null;\n assert(`Expected a stable identifier`, !identifier || isStableIdentifier(identifier));\n\n const { isStale, hasDematerializedInverse, hasReceivedData, isEmpty, shouldForceReload } = relationship.state;\n\n const allInverseRecordsAreLoaded = areAllInverseRecordsLoaded(this.store, resource);\n const shouldFindViaLink =\n resource.links?.related &&\n (shouldForceReload || hasDematerializedInverse || isStale || (!allInverseRecordsAreLoaded && !isEmpty));\n\n const relationshipMeta = this.store.getSchemaDefinitionService().relationshipsDefinitionFor(this.identifier)[\n relationship.definition.key\n ];\n assert(`Attempted to access a belongsTo relationship but no definition exists for it`, relationshipMeta);\n const request = {\n useLink: shouldFindViaLink,\n field: relationshipMeta,\n links: resource.links,\n meta: resource.meta,\n options,\n record: parentIdentifier,\n };\n\n // fetch via link\n if (shouldFindViaLink) {\n const future = this.store.request<StableRecordIdentifier | null>({\n op: 'findBelongsTo',\n records: identifier ? [identifier] : [],\n data: request,\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n });\n this._pending[key] = future\n .then((doc) => doc.content)\n .finally(() => {\n this._pending[key] = undefined;\n });\n return this._pending[key]!;\n }\n\n const preferLocalCache = hasReceivedData && allInverseRecordsAreLoaded && !isEmpty;\n const hasLocalPartialData = hasDematerializedInverse || (isEmpty && resource.data);\n // null is explicit empty, undefined is \"we don't know anything\"\n const localDataIsEmpty = !identifier;\n const attemptLocalCache = !shouldForceReload && !isStale && (preferLocalCache || hasLocalPartialData);\n\n // we dont need to fetch and are empty\n if (attemptLocalCache && localDataIsEmpty) {\n return Promise.resolve(null);\n }\n\n // we dont need to fetch because we are local state\n const resourceIsLocal = identifier?.id === null;\n if ((attemptLocalCache && allInverseRecordsAreLoaded) || resourceIsLocal) {\n return Promise.resolve(identifier);\n }\n\n // we may need to fetch\n if (identifier) {\n assert(`Cannot fetch belongs-to relationship with no information`, identifier);\n options.reload = options.reload || !attemptLocalCache || undefined;\n\n this._pending[key] = this.store\n .request<StableRecordIdentifier | null>({\n op: 'findBelongsTo',\n records: [identifier],\n data: request,\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n })\n .then((doc) => doc.content)\n .finally(() => {\n this._pending[key] = undefined;\n });\n return this._pending[key]!;\n }\n\n // we were explicitly told we have no data and no links.\n // TODO if the relationshipIsStale, should we hit the adapter anyway?\n return Promise.resolve(null);\n }\n\n destroy() {\n this.isDestroying = true;\n\n let cache: Record<string, { destroy(): void } | undefined> = this._manyArrayCache;\n this._manyArrayCache = Object.create(null) as Record<string, RelatedCollection>;\n Object.keys(cache).forEach((key) => {\n cache[key]!.destroy();\n });\n\n cache = this._relationshipProxyCache;\n this._relationshipProxyCache = Object.create(null) as Record<string, PromiseManyArray | PromiseBelongsTo>;\n Object.keys(cache).forEach((key) => {\n const proxy = cache[key]!;\n if (proxy.destroy) {\n proxy.destroy();\n }\n });\n\n cache = this.references;\n this.references = Object.create(null) as Record<string, BelongsToReference | HasManyReference>;\n Object.keys(cache).forEach((key) => {\n cache[key]!.destroy();\n });\n this.isDestroyed = true;\n }\n}\n\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: ResourceEdge,\n value: StableRecordIdentifier | null\n): RecordInstance | null;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: CollectionEdge,\n value: RelatedCollection\n): RelatedCollection;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: ResourceEdge,\n value: null,\n error: Error\n): never;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: CollectionEdge,\n value: RelatedCollection,\n error: Error\n): never;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: ResourceEdge | CollectionEdge,\n value: RelatedCollection | StableRecordIdentifier | null,\n error?: Error\n): RelatedCollection | RecordInstance | null {\n delete recordExt._relationshipPromisesCache[key];\n relationship.state.shouldForceReload = false;\n const isHasMany = relationship.definition.kind === 'hasMany';\n\n if (isHasMany) {\n // we don't notify the record property here to avoid refetch\n // only the many array\n (value as RelatedCollection).notify();\n }\n\n if (error) {\n relationship.state.hasFailedLoadAttempt = true;\n const proxy = recordExt._relationshipProxyCache[key];\n // belongsTo relationships are sometimes unloaded\n // when a load fails, in this case we need\n // to make sure that we aren't proxying\n // to destroyed content\n // for the sync belongsTo reload case there will be no proxy\n // for the async reload case there will be no proxy if the ui\n // has never been accessed\n if (proxy && !isHasMany) {\n // @ts-expect-error unsure why this is not resolving the boolean but async belongsTo is weird\n if (proxy.content && proxy.content.isDestroying) {\n (proxy as PromiseBelongsTo).set('content', null);\n }\n recordExt.store.notifications._flush();\n }\n\n throw error;\n }\n\n if (isHasMany) {\n (value as RelatedCollection).isLoaded = true;\n } else {\n recordExt.store.notifications._flush();\n }\n\n relationship.state.hasFailedLoadAttempt = false;\n // only set to not stale if no error is thrown\n relationship.state.isStale = false;\n\n return isHasMany || !value\n ? (value as RelatedCollection | null)\n : recordExt.store.peekRecord(value as StableRecordIdentifier);\n}\n\ntype PromiseProxyRecord = { then(): void; content: RecordInstance | null | undefined };\n\nfunction extractIdentifierFromRecord(record: PromiseProxyRecord | RecordInstance | null) {\n if (!record) {\n return null;\n }\n\n return recordIdentifierFor(record);\n}\n\nfunction anyUnloaded(store: Store, relationship: CollectionEdge) {\n const graph = store._graph;\n assert(`Expected a Graph instance to be available`, graph);\n const relationshipData = graph.getData(\n relationship.identifier,\n relationship.definition.key\n ) as CollectionRelationship;\n const state = relationshipData.data;\n const cache = store._instanceCache;\n const unloaded = state?.find((s) => {\n const isLoaded = cache.recordIsLoaded(s, true);\n return !isLoaded;\n });\n\n return unloaded || false;\n}\n\nexport function areAllInverseRecordsLoaded(store: Store, resource: JsonApiRelationship): boolean {\n const instanceCache = store._instanceCache;\n const identifiers = resource.data;\n\n if (Array.isArray(identifiers)) {\n assert(`Expected stable identifiers`, identifiers.every(isStableIdentifier));\n // treat as collection\n // check for unloaded records\n return identifiers.every((identifier: StableRecordIdentifier) => instanceCache.recordIsLoaded(identifier));\n }\n\n // treat as single resource\n if (!identifiers) return true;\n\n assert(`Expected stable identifiers`, isStableIdentifier(identifiers));\n return instanceCache.recordIsLoaded(identifiers);\n}\n\nfunction isBelongsTo(relationship: GraphEdge): relationship is ResourceEdge {\n return relationship.definition.kind === 'belongsTo';\n}\n","export default function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}","import { A, type NativeArray } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\nimport { computed, get } from '@ember/object';\nimport { mapBy, not } from '@ember/object/computed';\n\nimport type RecordState from './record-state';\n\ntype ValidationError = {\n attribute: string;\n message: string;\n};\n/**\n @module @ember-data/model\n*/\ninterface ArrayProxyWithCustomOverrides<T> extends Omit<ArrayProxy<T>, 'clear' | 'content'> {\n // Omit causes `content` to be merged with the class def for ArrayProxy\n // which then causes it to be seen as a property, disallowing defining it\n // as an accessor. This restores our ability to define it as an accessor.\n content: NativeArray<T>;\n clear(): void;\n _has(name: string): boolean;\n}\n\n// we force the type here to our own construct because mixin and extend patterns\n// lose generic signatures. We also do this because we need to Omit `clear` from\n// the type of ArrayProxy as we override it's signature.\nconst ArrayProxyWithCustomOverrides = ArrayProxy as unknown as new <T>() => ArrayProxyWithCustomOverrides<T>;\n\n/**\n Holds validation errors for a given record, organized by attribute names.\n\n This class is not directly instantiable.\n\n Every `Model` has an `errors` property that is an instance of\n `Errors`. This can be used to display validation error\n messages returned from the server when a `record.save()` rejects.\n\n For Example, if you had a `User` model that looked like this:\n\n ```app/models/user.js\n import Model, { attr } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @attr('string') username;\n @attr('string') email;\n }\n ```\n And you attempted to save a record that did not validate on the backend:\n\n ```javascript\n let user = store.createRecord('user', {\n username: 'tomster',\n email: 'invalidEmail'\n });\n user.save();\n ```\n\n Your backend would be expected to return an error response that described\n the problem, so that error messages can be generated on the app.\n\n API responses will be translated into instances of `Errors` differently,\n depending on the specific combination of adapter and serializer used. You\n may want to check the documentation or the source code of the libraries\n that you are using, to know how they expect errors to be communicated.\n\n Errors can be displayed to the user by accessing their property name\n to get an array of all the error objects for that property. Each\n error object is a JavaScript object with two keys:\n\n - `message` A string containing the error message from the backend\n - `attribute` The name of the property associated with this error message\n\n ```handlebars\n <label>Username: <Input @value={{@model.username}} /> </label>\n {{#each @model.errors.username as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n\n <label>Email: <Input @value={{@model.email}} /> </label>\n {{#each @model.errors.email as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n ```\n\n You can also access the special `messages` property on the error\n object to get an array of all the error strings.\n\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n <div class=\"error\">\n {{message}}\n </div>\n {{/each}}\n ```\n\n @class Errors\n @public\n @extends Ember.ArrayProxy\n */\nclass Errors extends ArrayProxyWithCustomOverrides<ValidationError> {\n declare __record: { currentState: RecordState };\n /**\n @property errorsByAttributeName\n @type {MapWithDefault}\n @private\n */\n @computed()\n get errorsByAttributeName(): Map<string, NativeArray<ValidationError>> {\n return new Map();\n }\n\n /**\n Returns errors for a given attribute\n\n ```javascript\n let user = store.createRecord('user', {\n username: 'tomster',\n email: 'invalidEmail'\n });\n user.save().catch(function(){\n user.errors.errorsFor('email'); // returns:\n // [{attribute: \"email\", message: \"Doesn't look like a valid email.\"}]\n });\n ```\n\n @method errorsFor\n @public\n @param {String} attribute\n @return {Array}\n */\n errorsFor(attribute: string): NativeArray<ValidationError> {\n const map = this.errorsByAttributeName;\n\n let errors = map.get(attribute);\n\n if (errors === undefined) {\n errors = A<ValidationError>();\n map.set(attribute, errors);\n }\n\n // Errors may be a native array with extensions turned on. Since we access\n // the array via a method, and not a computed or using `Ember.get`, it does\n // not entangle properly with autotracking, so we entangle manually by\n // getting the `[]` property.\n get(errors, '[]');\n\n return errors;\n }\n\n /**\n An array containing all of the error messages for this\n record. This is useful for displaying all errors to the user.\n\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n <div class=\"error\">\n {{message}}\n </div>\n {{/each}}\n ```\n\n @property messages\n @public\n @type {Array}\n */\n @mapBy('content', 'message')\n declare messages: string[];\n\n /**\n @property content\n @type {Array}\n @private\n */\n @computed()\n override get content(): NativeArray<ValidationError> {\n return A();\n }\n\n /**\n @method unknownProperty\n @private\n */\n unknownProperty(attribute: string) {\n const errors = this.errorsFor(attribute);\n if (errors.length === 0) {\n return undefined;\n }\n return errors;\n }\n\n /**\n Total number of errors.\n\n @property length\n @type {Number}\n @public\n @readOnly\n */\n\n /**\n `true` if we have no errors.\n\n @property isEmpty\n @type {Boolean}\n @public\n @readOnly\n */\n @not('length')\n declare isEmpty: boolean;\n\n /**\n Manually adds errors to the record. This will trigger the `becameInvalid` event/ lifecycle method on\n the record and transition the record into an `invalid` state.\n\n Example\n ```javascript\n let errors = user.errors;\n\n // add multiple errors\n errors.add('password', [\n 'Must be at least 12 characters',\n 'Must contain at least one symbol',\n 'Cannot contain your name'\n ]);\n\n errors.errorsFor('password');\n // =>\n // [\n // { attribute: 'password', message: 'Must be at least 12 characters' },\n // { attribute: 'password', message: 'Must contain at least one symbol' },\n // { attribute: 'password', message: 'Cannot contain your name' },\n // ]\n\n // add a single error\n errors.add('username', 'This field is required');\n\n errors.errorsFor('username');\n // =>\n // [\n // { attribute: 'username', message: 'This field is required' },\n // ]\n ```\n @method add\n @public\n @param {string} attribute - the property name of an attribute or relationship\n @param {string[]|string} messages - an error message or array of error messages for the attribute\n */\n add(attribute: string, messages: string[] | string): void {\n const errors = this._findOrCreateMessages(attribute, messages);\n this.addObjects(errors);\n\n this.errorsFor(attribute).addObjects(errors);\n this.__record.currentState.notify('isValid');\n\n this.notifyPropertyChange(attribute);\n }\n\n /**\n @method _findOrCreateMessages\n @private\n */\n _findOrCreateMessages(attribute: string, messages: string | string[]): ValidationError[] {\n const errors = this.errorsFor(attribute);\n const messagesArray = Array.isArray(messages) ? messages : [messages];\n const _messages: ValidationError[] = new Array(messagesArray.length) as ValidationError[];\n\n for (let i = 0; i < messagesArray.length; i++) {\n const message = messagesArray[i];\n const err = errors.findBy('message', message);\n if (err) {\n _messages[i] = err;\n } else {\n _messages[i] = {\n attribute: attribute,\n message,\n };\n }\n }\n\n return _messages;\n }\n\n /**\n Manually removes all errors for a given member from the record.\n This will transition the record into a `valid` state, and\n triggers the `becameValid` event and lifecycle method.\n\n Example:\n\n ```javascript\n let errors = user.errors;\n errors.add('phone', ['error-1', 'error-2']);\n\n errors.errorsFor('phone');\n // =>\n // [\n // { attribute: 'phone', message: 'error-1' },\n // { attribute: 'phone', message: 'error-2' },\n // ]\n\n errors.remove('phone');\n\n errors.errorsFor('phone');\n // => undefined\n ```\n @method remove\n @public\n @param {string} member - the property name of an attribute or relationship\n */\n remove(attribute: string) {\n if (this.isEmpty) {\n return;\n }\n\n const content = this.rejectBy('attribute', attribute);\n this.content.setObjects(content);\n\n // Although errorsByAttributeName.delete is technically enough to sync errors state, we also\n // must mutate the array as well for autotracking\n const errors = this.errorsFor(attribute);\n for (let i = 0; i < errors.length; i++) {\n if (errors[i].attribute === attribute) {\n // .replace from Ember.NativeArray is necessary. JS splice will not work.\n errors.replace(i, 1);\n }\n }\n this.errorsByAttributeName.delete(attribute);\n\n this.__record.currentState.notify('isValid');\n this.notifyPropertyChange(attribute);\n this.notifyPropertyChange('length');\n }\n\n /**\n Manually clears all errors for the record.\n This will transition the record into a `valid` state, and\n will trigger the `becameValid` event and lifecycle method.\n\n Example:\n\n ```javascript\n let errors = user.errors;\n errors.add('username', ['error-a']);\n errors.add('phone', ['error-1', 'error-2']);\n\n errors.errorsFor('username');\n // =>\n // [\n // { attribute: 'username', message: 'error-a' },\n // ]\n\n errors.errorsFor('phone');\n // =>\n // [\n // { attribute: 'phone', message: 'error-1' },\n // { attribute: 'phone', message: 'error-2' },\n // ]\n\n errors.clear();\n\n errors.errorsFor('username');\n // => undefined\n\n errors.errorsFor('phone');\n // => undefined\n\n errors.messages\n // => []\n ```\n @method clear\n @public\n */\n override clear(): void {\n if (this.isEmpty) {\n return;\n }\n\n const errorsByAttributeName = this.errorsByAttributeName;\n const attributes: string[] = [];\n\n errorsByAttributeName.forEach(function (_, attribute) {\n attributes.push(attribute);\n });\n\n errorsByAttributeName.clear();\n attributes.forEach((attribute) => {\n this.notifyPropertyChange(attribute);\n });\n\n this.__record.currentState.notify('isValid');\n super.clear();\n }\n\n /**\n Checks if there are error messages for the given attribute.\n\n ```app/controllers/user/edit.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n\n export default class UserEditController extends Controller {\n @action\n save(user) {\n if (user.errors.has('email')) {\n return alert('Please update your email before attempting to save.');\n }\n user.save();\n }\n }\n ```\n\n @method has\n @public\n @param {String} attribute\n @return {Boolean} true if there some errors on given attribute\n */\n has(attribute: string): boolean {\n return this.errorsFor(attribute).length > 0;\n }\n}\n\nexport default Errors;\n","import { assert } from '@ember/debug';\n\nimport { importSync } from '@embroider/macros';\n\nimport { upgradeStore } from '@ember-data/legacy-compat/-private';\nimport type Store from '@ember-data/store';\nimport { recordIdentifierFor } from '@ember-data/store';\nimport { peekCache } from '@ember-data/store/-private';\nimport { RecordStore } from '@warp-drive/core-types/symbols';\n\nimport type Errors from './errors';\nimport { lookupLegacySupport } from './legacy-relationships-support';\nimport type RecordState from './record-state';\n\nexport interface MinimalLegacyRecord {\n errors: Errors;\n ___recordState: RecordState;\n currentState: RecordState;\n isDestroyed: boolean;\n isDestroying: boolean;\n isReloading: boolean;\n [RecordStore]: Store;\n\n deleteRecord(): void;\n unloadRecord(): void;\n save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;\n destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;\n}\n\nexport function rollbackAttributes(this: MinimalLegacyRecord) {\n const { currentState } = this;\n const { isNew } = currentState;\n\n this[RecordStore]._join(() => {\n peekCache(this).rollbackAttrs(recordIdentifierFor(this));\n this.errors.clear();\n currentState.cleanErrorRequests();\n if (isNew) {\n this.unloadRecord();\n }\n });\n}\n\nexport function unloadRecord(this: MinimalLegacyRecord) {\n if (this.currentState.isNew && (this.isDestroyed || this.isDestroying)) {\n return;\n }\n this[RecordStore].unloadRecord(this);\n}\n\nexport function belongsTo(this: MinimalLegacyRecord, prop: string) {\n return lookupLegacySupport(this).referenceFor('belongsTo', prop);\n}\n\nexport function hasMany(this: MinimalLegacyRecord, prop: string) {\n return lookupLegacySupport(this).referenceFor('hasMany', prop);\n}\n\nexport function reload(this: MinimalLegacyRecord, options: Record<string, unknown> = {}) {\n options.isReloading = true;\n options.reload = true;\n\n const identifier = recordIdentifierFor(this);\n assert(`You cannot reload a record without an ID`, identifier.id);\n\n this.isReloading = true;\n const promise = this[RecordStore].request({\n op: 'findRecord',\n data: {\n options,\n record: identifier,\n },\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n })\n .then(() => this)\n .finally(() => {\n this.isReloading = false;\n });\n\n return promise;\n}\n\nexport function changedAttributes(this: MinimalLegacyRecord) {\n return peekCache(this).changedAttrs(recordIdentifierFor(this));\n}\n\nexport function serialize(this: MinimalLegacyRecord, options?: Record<string, unknown>) {\n upgradeStore(this[RecordStore]);\n return this[RecordStore].serializeRecord(this, options);\n}\n\nexport function deleteRecord(this: MinimalLegacyRecord) {\n // ensure we've populated currentState prior to deleting a new record\n if (this.currentState) {\n this[RecordStore].deleteRecord(this);\n }\n}\n\nexport function save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T> {\n let promise: Promise<T>;\n\n if (this.currentState.isNew && this.currentState.isDeleted) {\n promise = Promise.resolve(this);\n } else {\n this.errors.clear();\n promise = this[RecordStore].saveRecord(this, options) as Promise<T>;\n }\n\n return promise;\n}\n\nexport function destroyRecord(this: MinimalLegacyRecord, options?: Record<string, unknown>) {\n const { isNew } = this.currentState;\n this.deleteRecord();\n if (isNew) {\n return Promise.resolve(this);\n }\n return this.save(options).then((_) => {\n this.unloadRecord();\n return this;\n });\n}\n\nexport function createSnapshot(this: MinimalLegacyRecord) {\n const store = this[RecordStore];\n\n upgradeStore(store);\n if (!store._fetchManager) {\n const FetchManager = (\n importSync('@ember-data/legacy-compat/-private') as typeof import('@ember-data/legacy-compat/-private')\n ).FetchManager;\n store._fetchManager = new FetchManager(store);\n }\n\n return store._fetchManager.createSnapshot(recordIdentifierFor(this));\n}\n","import { assert } from '@ember/debug';\nimport { cacheFor } from '@ember/object/internals';\n\nimport type Store from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { RelationshipSchema } from '@warp-drive/core-types/schema';\n\nimport { LEGACY_SUPPORT } from './legacy-relationships-support';\nimport type Model from './model';\n\nexport default function notifyChanges(\n identifier: StableRecordIdentifier,\n value: NotificationType,\n key: string | undefined,\n record: Model,\n store: Store\n) {\n if (value === 'attributes') {\n if (key) {\n notifyAttribute(store, identifier, key, record);\n } else {\n record.eachAttribute((name) => {\n notifyAttribute(store, identifier, name, record);\n });\n }\n } else if (value === 'relationships') {\n if (key) {\n const meta = record.constructor.relationshipsByName.get(key);\n assert(`Expected to find a relationship for ${key} on ${identifier.type}`, meta);\n notifyRelationship(identifier, key, record, meta);\n } else {\n record.eachRelationship((name, meta) => {\n notifyRelationship(identifier, name, record, meta);\n });\n }\n } else if (value === 'identity') {\n record.notifyPropertyChange('id');\n }\n}\n\nfunction notifyRelationship(identifier: StableRecordIdentifier, key: string, record: Model, meta: RelationshipSchema) {\n if (meta.kind === 'belongsTo') {\n record.notifyPropertyChange(key);\n } else if (meta.kind === 'hasMany') {\n const support = LEGACY_SUPPORT.get(identifier);\n const manyArray = support && support._manyArrayCache[key];\n const hasPromise = support && support._relationshipPromisesCache[key];\n\n if (manyArray && hasPromise) {\n // do nothing, we will notify the ManyArray directly\n // once the fetch has completed.\n return;\n }\n\n if (manyArray) {\n manyArray.notify();\n\n //We need to notifyPropertyChange in the adding case because we need to make sure\n //we fetch the newly added record in case it is unloaded\n //TODO(Igor): Consider whether we could do this only if the record state is unloaded\n assert(`Expected options to exist on relationship meta`, meta.options);\n assert(`Expected async to exist on relationship meta options`, 'async' in meta.options);\n if (meta.options.async) {\n record.notifyPropertyChange(key);\n }\n }\n }\n}\n\nfunction notifyAttribute(store: Store, identifier: StableRecordIdentifier, key: string, record: Model) {\n const currentValue = cacheFor(record, key);\n const cache = store.cache;\n if (currentValue !== cache.getAttr(identifier, key)) {\n record.notifyPropertyChange(key);\n }\n}\n","import { assert } from '@ember/debug';\n\nimport type Store from '@ember-data/store';\nimport { storeFor } from '@ember-data/store';\nimport { recordIdentifierFor } from '@ember-data/store/-private';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type RequestStateService from '@ember-data/store/-private/network/request-cache';\nimport type { RequestState } from '@ember-data/store/-private/network/request-cache';\nimport type { Cache } from '@ember-data/store/-types/q/cache';\nimport { cached, compat } from '@ember-data/tracking';\nimport { addToTransaction, defineSignal, getSignal, peekSignal, subscribe } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\n\nimport type Errors from './errors';\nimport type { MinimalLegacyRecord } from './model-methods';\n\nconst SOURCE_POINTER_REGEXP = /^\\/?data\\/(attributes|relationships)\\/(.*)/;\nconst SOURCE_POINTER_PRIMARY_REGEXP = /^\\/?data/;\nconst PRIMARY_ATTRIBUTE_KEY = 'base';\nfunction isInvalidError(error: unknown): error is Error & { isAdapterError: true; code: 'InvalidError' } {\n return (\n !!error &&\n error instanceof Error &&\n 'isAdapterError' in error &&\n error.isAdapterError === true &&\n 'code' in error &&\n error.code === 'InvalidError'\n );\n}\n\n/**\n * A decorator that caches a getter while\n * providing the ability to bust that cache\n * when we so choose in a way that notifies\n * tracking systems.\n *\n * @internal\n */\nexport function tagged<T extends object, K extends keyof T & string>(_target: T, key: K, desc: PropertyDescriptor) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const getter = desc.get as (this: T) => unknown;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const setter = desc.set as (this: T, v: unknown) => void;\n\n desc.get = function (this: T) {\n const signal = getSignal(this, key, true);\n subscribe(signal);\n\n if (signal.shouldReset) {\n signal.shouldReset = false;\n signal.lastValue = getter.call(this);\n }\n\n return signal.lastValue;\n };\n desc.set = function (this: T, v: unknown) {\n getSignal(this, key, true); // ensure signal is setup in case we want to use it.\n // probably notify here but not yet.\n setter.call(this, v);\n };\n compat(desc);\n return desc;\n}\n\nexport function notifySignal<T extends object, K extends keyof T & string>(obj: T, key: K) {\n const signal = peekSignal(obj, key);\n if (signal) {\n signal.shouldReset = true;\n addToTransaction(signal);\n }\n}\n\n/**\nHistorically EmberData managed a state machine\nfor each record, the localState for which\nwas reflected onto Model.\n\nThis implements the flags and stateName for backwards compat\nwith the state tree that used to be possible (listed below).\n\nstateName and dirtyType are candidates for deprecation.\n\nroot\n empty\n deleted // hidden from stateName\n preloaded // hidden from stateName\n\n loading\n empty // hidden from stateName\n preloaded // hidden from stateName\n\n loaded\n saved\n updated\n uncommitted\n invalid\n inFlight\n created\n uncommitted\n invalid\n inFlight\n\n deleted\n saved\n new // hidden from stateName\n uncommitted\n invalid\n inFlight\n\n @internal\n*/\nexport default class RecordState {\n declare store: Store;\n declare identifier: StableRecordIdentifier;\n declare record: MinimalLegacyRecord;\n declare rs: RequestStateService;\n\n declare pendingCount: number;\n declare fulfilledCount: number;\n declare rejectedCount: number;\n declare cache: Cache;\n declare _errorRequests: RequestState[];\n declare _lastError: RequestState | null;\n declare handler: object;\n\n constructor(record: MinimalLegacyRecord) {\n const store = storeFor(record)!;\n const identity = recordIdentifierFor(record);\n\n this.identifier = identity;\n this.record = record;\n this.cache = store.cache;\n\n this.pendingCount = 0;\n this.fulfilledCount = 0;\n this.rejectedCount = 0;\n this._errorRequests = [];\n this._lastError = null;\n\n const requests = store.getRequestStateService();\n const notifications = store.notifications;\n\n const handleRequest = (req: RequestState) => {\n if (req.type === 'mutation') {\n switch (req.state) {\n case 'pending':\n this.isSaving = true;\n break;\n case 'rejected':\n this.isSaving = false;\n this._lastError = req;\n if (!(req.response && isInvalidError(req.response.data))) {\n this._errorRequests.push(req);\n }\n\n notifyErrorsStateChanged(this);\n break;\n case 'fulfilled':\n this._errorRequests = [];\n this._lastError = null;\n this.isSaving = false;\n this.notify('isDirty');\n notifyErrorsStateChanged(this);\n break;\n }\n } else {\n switch (req.state) {\n case 'pending':\n this.pendingCount++;\n this.notify('isLoading');\n break;\n case 'rejected':\n this.pendingCount--;\n this._lastError = req;\n if (!(req.response && isInvalidError(req.response.data))) {\n this._errorRequests.push(req);\n }\n this.notify('isLoading');\n notifyErrorsStateChanged(this);\n break;\n case 'fulfilled':\n this.pendingCount--;\n this.fulfilledCount++;\n this.notify('isLoading');\n this.notify('isDirty');\n notifyErrorsStateChanged(this);\n this._errorRequests = [];\n this._lastError = null;\n break;\n }\n }\n };\n\n requests.subscribeForRecord(identity, handleRequest);\n\n // we instantiate lazily\n // so we grab anything we don't have yet\n const lastRequest = requests.getLastRequestForRecord(identity);\n if (lastRequest) {\n handleRequest(lastRequest);\n }\n\n this.handler = notifications.subscribe(\n identity,\n (identifier: StableRecordIdentifier, type: NotificationType, key?: string) => {\n switch (type) {\n case 'state':\n this.notify('isSaved');\n this.notify('isNew');\n this.notify('isDeleted');\n this.notify('isDirty');\n break;\n case 'attributes':\n this.notify('isEmpty');\n this.notify('isDirty');\n break;\n case 'errors':\n this.updateInvalidErrors(this.record.errors);\n this.notify('isValid');\n break;\n }\n }\n );\n }\n\n destroy() {\n storeFor(this.record)!.notifications.unsubscribe(this.handler);\n }\n\n notify(key: keyof this & string) {\n notifySignal(this, key);\n }\n\n updateInvalidErrors(errors: Errors) {\n assert(\n `Expected the Cache instance for ${this.identifier.lid} to implement getErrors(identifier)`,\n typeof this.cache.getErrors === 'function'\n );\n const jsonApiErrors = this.cache.getErrors(this.identifier);\n\n errors.clear();\n\n for (let i = 0; i < jsonApiErrors.length; i++) {\n const error = jsonApiErrors[i];\n\n if (error.source && error.source.pointer) {\n const keyMatch = error.source.pointer.match(SOURCE_POINTER_REGEXP);\n let key: string | undefined;\n\n if (keyMatch) {\n key = keyMatch[2];\n } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {\n key = PRIMARY_ATTRIBUTE_KEY;\n }\n\n if (key) {\n const errMsg = error.detail || error.title;\n assert(`Expected field error to have a detail or title to use as the message`, errMsg);\n errors.add(key, errMsg);\n }\n }\n }\n }\n\n cleanErrorRequests() {\n this.notify('isValid');\n this.notify('isError');\n this.notify('adapterError');\n this._errorRequests = [];\n this._lastError = null;\n }\n\n declare isSaving: boolean;\n\n @tagged\n get isLoading() {\n return !this.isLoaded && this.pendingCount > 0 && this.fulfilledCount === 0;\n }\n\n @tagged\n get isLoaded() {\n if (this.isNew) {\n return true;\n }\n return this.fulfilledCount > 0 || !this.isEmpty;\n }\n\n @tagged\n get isSaved() {\n const rd = this.cache;\n if (this.isDeleted) {\n assert(`Expected Cache to implement isDeletionCommitted()`, typeof rd.isDeletionCommitted === 'function');\n return rd.isDeletionCommitted(this.identifier);\n }\n if (this.isNew || this.isEmpty || !this.isValid || this.isDirty || this.isLoading) {\n return false;\n }\n return true;\n }\n\n @tagged\n get isEmpty() {\n const rd = this.cache;\n // TODO this is not actually an RFC'd concept. Determine the\n // correct heuristic to replace this with.\n assert(`Expected Cache to implement isEmpty()`, typeof rd.isEmpty === 'function');\n return !this.isNew && rd.isEmpty(this.identifier);\n }\n\n @tagged\n get isNew() {\n const rd = this.cache;\n assert(`Expected Cache to implement isNew()`, typeof rd.isNew === 'function');\n return rd.isNew(this.identifier);\n }\n\n @tagged\n get isDeleted() {\n const rd = this.cache;\n assert(`Expected Cache to implement isDeleted()`, typeof rd.isDeleted === 'function');\n return rd.isDeleted(this.identifier);\n }\n\n @tagged\n get isValid() {\n return this.record.errors.length === 0;\n }\n\n @tagged\n get isDirty() {\n const rd = this.cache;\n if (this.isEmpty || rd.isDeletionCommitted(this.identifier) || (this.isDeleted && this.isNew)) {\n return false;\n }\n return this.isDeleted || this.isNew || rd.hasChangedAttrs(this.identifier);\n }\n\n @tagged\n get isError() {\n const errorReq = this._errorRequests[this._errorRequests.length - 1];\n if (!errorReq) {\n return false;\n } else {\n return true;\n }\n }\n\n @tagged\n get adapterError() {\n const request = this._lastError;\n if (!request) {\n return null;\n }\n return request.state === 'rejected' && request.response!.data;\n }\n\n @cached\n get isPreloaded() {\n return !this.isEmpty && this.isLoading;\n }\n\n @cached\n get stateName() {\n // we might be empty while loading so check this first\n if (this.isLoading) {\n return 'root.loading';\n\n // got nothing yet or were unloaded\n } else if (this.isEmpty) {\n return 'root.empty';\n\n // deleted substates\n } else if (this.isDeleted) {\n if (this.isSaving) {\n return 'root.deleted.inFlight';\n } else if (this.isSaved) {\n // TODO ensure isSaved isn't true from previous requests\n return 'root.deleted.saved';\n } else if (!this.isValid) {\n return 'root.deleted.invalid';\n } else {\n return 'root.deleted.uncommitted';\n }\n\n // loaded.created substates\n } else if (this.isNew) {\n if (this.isSaving) {\n return 'root.loaded.created.inFlight';\n } else if (!this.isValid) {\n return 'root.loaded.created.invalid';\n }\n return 'root.loaded.created.uncommitted';\n\n // loaded.updated substates\n } else if (this.isSaving) {\n return 'root.loaded.updated.inFlight';\n } else if (!this.isValid) {\n return 'root.loaded.updated.invalid';\n } else if (this.isDirty) {\n return 'root.loaded.updated.uncommitted';\n\n // if nothing remains, we are loaded saved!\n } else {\n return 'root.loaded.saved';\n }\n }\n\n @cached\n get dirtyType() {\n // we might be empty while loading so check this first\n if (this.isLoading || this.isEmpty) {\n return '';\n\n // deleted substates\n } else if (this.isDirty && this.isDeleted) {\n return 'deleted';\n\n // loaded.created substates\n } else if (this.isNew) {\n return 'created';\n\n // loaded.updated substates\n } else if (this.isSaving || !this.isValid || this.isDirty) {\n return 'updated';\n\n // if nothing remains, we are loaded saved!\n } else {\n return '';\n }\n }\n}\ndefineSignal(RecordState.prototype, 'isSaving', false);\n\nfunction notifyErrorsStateChanged(state: RecordState) {\n state.notify('isValid');\n state.notify('isError');\n state.notify('adapterError');\n}\n","/**\n @module @ember-data/model\n */\n\nimport { assert, warn } from '@ember/debug';\nimport EmberObject from '@ember/object';\n\nimport { DEBUG } from '@ember-data/env';\nimport { HAS_DEBUG_PACKAGE } from '@ember-data/packages';\nimport { recordIdentifierFor, storeFor } from '@ember-data/store';\nimport { coerceId } from '@ember-data/store/-private';\nimport { compat } from '@ember-data/tracking';\nimport { defineSignal } from '@ember-data/tracking/-private';\nimport { RecordStore } from '@warp-drive/core-types/symbols';\n\nimport Errors from './errors';\nimport { LEGACY_SUPPORT } from './legacy-relationships-support';\nimport {\n belongsTo,\n changedAttributes,\n createSnapshot,\n deleteRecord,\n destroyRecord,\n hasMany,\n reload,\n rollbackAttributes,\n save,\n serialize,\n unloadRecord,\n} from './model-methods';\nimport notifyChanges from './notify-changes';\nimport RecordState, { notifySignal, tagged } from './record-state';\n\nfunction findPossibleInverses(type, inverseType, name, relationshipsSoFar) {\n const possibleRelationships = relationshipsSoFar || [];\n\n const relationshipMap = inverseType.relationships;\n if (!relationshipMap) {\n return possibleRelationships;\n }\n\n const relationshipsForType = relationshipMap.get(type.modelName);\n const relationships = Array.isArray(relationshipsForType)\n ? relationshipsForType.filter((relationship) => {\n const optionsForRelationship = relationship.options;\n\n if (!optionsForRelationship.inverse && optionsForRelationship.inverse !== null) {\n return true;\n }\n\n return name === optionsForRelationship.inverse;\n })\n : null;\n\n if (relationships) {\n possibleRelationships.push.apply(possibleRelationships, relationships);\n }\n\n //Recurse to support polymorphism\n if (type.superclass) {\n findPossibleInverses(type.superclass, inverseType, name, possibleRelationships);\n }\n\n return possibleRelationships;\n}\n\n/*\n * This decorator allows us to lazily compute\n * an expensive getter on first-access and thereafter\n * never recompute it.\n */\nfunction computeOnce(target, propertyName, desc) {\n const cache = new WeakMap();\n const getter = desc.get;\n desc.get = function () {\n let meta = cache.get(this);\n\n if (!meta) {\n meta = { hasComputed: false, value: undefined };\n cache.set(this, meta);\n }\n\n if (!meta.hasComputed) {\n meta.value = getter.call(this);\n meta.hasComputed = true;\n }\n\n return meta.value;\n };\n return desc;\n}\n\n/**\n Base class from which Models can be defined.\n\n ```js\n import Model, { attr } from '@ember-data/model';\n\n export default class User extends Model {\n @attr name;\n }\n ```\n\n Models are used both to define the static schema for a\n particular resource type as well as the class to instantiate\n to present that data from cache.\n\n @class Model\n @public\n @extends Ember.EmberObject\n*/\nclass Model extends EmberObject {\n ___private_notifications;\n\n init(options = {}) {\n if (DEBUG) {\n if (!options._secretInit && !options._createProps) {\n throw new Error(\n 'You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.'\n );\n }\n }\n const createProps = options._createProps;\n const _secretInit = options._secretInit;\n options._createProps = null;\n options._secretInit = null;\n\n const store = (this.store = _secretInit.store);\n super.init(options);\n\n this[RecordStore] = store;\n\n const identity = _secretInit.identifier;\n _secretInit.cb(this, _secretInit.cache, identity, _secretInit.store);\n\n this.___recordState = DEBUG ? new RecordState(this) : null;\n\n this.setProperties(createProps);\n\n const notifications = store.notifications;\n this.___private_notifications = notifications.subscribe(identity, (identifier, type, field) => {\n notifyChanges(identifier, type, field, this, store);\n });\n }\n\n destroy() {\n const identifier = recordIdentifierFor(this);\n this.___recordState?.destroy();\n const store = storeFor(this);\n store.notifications.unsubscribe(this.___private_notifications);\n // Legacy behavior is to notify the relationships on destroy\n // such that they \"clear\". It's uncertain this behavior would\n // be good for a new model paradigm, likely cheaper and safer\n // to simply not notify, for this reason the store does not itself\n // notify individual changes once the delete has been signaled,\n // this decision is left to model instances.\n\n this.eachRelationship((name, meta) => {\n if (meta.kind === 'belongsTo') {\n this.notifyPropertyChange(name);\n }\n });\n LEGACY_SUPPORT.get(this)?.destroy();\n LEGACY_SUPPORT.delete(this);\n LEGACY_SUPPORT.delete(identifier);\n\n super.destroy();\n }\n\n /**\n If this property is `true` the record is in the `empty`\n state. Empty is the first state all records enter after they have\n been created. Most records created by the store will quickly\n transition to the `loading` state if data needs to be fetched from\n the server or the `created` state if the record is created on the\n client. A record can also enter the empty state if the adapter is\n unable to locate the record.\n\n @property isEmpty\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isEmpty() {\n return this.currentState.isEmpty;\n }\n\n /**\n If this property is `true` the record is in the `loading` state. A\n record enters this state when the store asks the adapter for its\n data. It remains in this state until the adapter provides the\n requested data.\n\n @property isLoading\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isLoading() {\n return this.currentState.isLoading;\n }\n\n /**\n If this property is `true` the record is in the `loaded` state. A\n record enters this state when its data is populated. Most of a\n record's lifecycle is spent inside substates of the `loaded`\n state.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isLoaded; // true\n\n store.findRecord('model', 1).then(function(model) {\n model.isLoaded; // true\n });\n ```\n\n @property isLoaded\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isLoaded() {\n return this.currentState.isLoaded;\n }\n\n /**\n If this property is `true` the record is in the `dirty` state. The\n record has local changes that have not yet been saved by the\n adapter. This includes records that have been created (but not yet\n saved) or deleted.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.hasDirtyAttributes; // true\n\n store.findRecord('model', 1).then(function(model) {\n model.hasDirtyAttributes; // false\n model.set('foo', 'some value');\n model.hasDirtyAttributes; // true\n });\n ```\n\n @since 1.13.0\n @property hasDirtyAttributes\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get hasDirtyAttributes() {\n return this.currentState.isDirty;\n }\n\n /**\n If this property is `true` the record is in the `saving` state. A\n record enters the saving state when `save` is called, but the\n adapter has not yet acknowledged that the changes have been\n persisted to the backend.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isSaving; // false\n let promise = record.save();\n record.isSaving; // true\n promise.then(function() {\n record.isSaving; // false\n });\n ```\n\n @property isSaving\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isSaving() {\n return this.currentState.isSaving;\n }\n\n /**\n If this property is `true` the record is in the `deleted` state\n and has been marked for deletion. When `isDeleted` is true and\n `hasDirtyAttributes` is true, the record is deleted locally but the deletion\n was not yet persisted. When `isSaving` is true, the change is\n in-flight. When both `hasDirtyAttributes` and `isSaving` are false, the\n change has persisted.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isDeleted; // false\n record.deleteRecord();\n\n // Locally deleted\n record.isDeleted; // true\n record.hasDirtyAttributes; // true\n record.isSaving; // false\n\n // Persisting the deletion\n let promise = record.save();\n record.isDeleted; // true\n record.isSaving; // true\n\n // Deletion Persisted\n promise.then(function() {\n record.isDeleted; // true\n record.isSaving; // false\n record.hasDirtyAttributes; // false\n });\n ```\n\n @property isDeleted\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isDeleted() {\n return this.currentState.isDeleted;\n }\n\n /**\n If this property is `true` the record is in the `new` state. A\n record will be in the `new` state when it has been created on the\n client and the adapter has not yet report that it was successfully\n saved.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isNew; // true\n\n record.save().then(function(model) {\n model.isNew; // false\n });\n ```\n\n @property isNew\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isNew() {\n return this.currentState.isNew;\n }\n\n /**\n If this property is `true` the record is in the `valid` state.\n\n A record will be in the `valid` state when the adapter did not report any\n server-side validation failures.\n\n @property isValid\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isValid() {\n return this.currentState.isValid;\n }\n\n /**\n If the record is in the dirty state this property will report what\n kind of change has caused it to move into the dirty\n state. Possible values are:\n\n - `created` The record has been created by the client and not yet saved to the adapter.\n - `updated` The record has been updated by the client and not yet saved to the adapter.\n - `deleted` The record has been deleted by the client and not yet saved to the adapter.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.dirtyType; // 'created'\n ```\n\n @property dirtyType\n @public\n @type {String}\n @readOnly\n */\n @compat\n get dirtyType() {\n return this.currentState.dirtyType;\n }\n\n /**\n If `true` the adapter reported that it was unable to save local\n changes to the backend for any reason other than a server-side\n validation error.\n\n Example\n\n ```javascript\n record.isError; // false\n record.set('foo', 'valid value');\n record.save().then(null, function() {\n record.isError; // true\n });\n ```\n\n @property isError\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isError() {\n return this.currentState.isError;\n }\n set isError(v) {\n if (DEBUG) {\n throw new Error(`isError is not directly settable`);\n }\n }\n\n /**\n If `true` the store is attempting to reload the record from the adapter.\n\n Example\n\n ```javascript\n record.isReloading; // false\n record.reload();\n record.isReloading; // true\n ```\n\n @property isReloading\n @public\n @type {Boolean}\n @readOnly\n */\n\n /**\n All ember models have an id property. This is an identifier\n managed by an external source. These are always coerced to be\n strings before being used internally. Note when declaring the\n attributes for a model it is an error to declare an id\n attribute.\n\n ```javascript\n let record = store.createRecord('model');\n record.id; // null\n\n store.findRecord('model', 1).then(function(model) {\n model.id; // '1'\n });\n ```\n\n @property id\n @public\n @type {String}\n */\n @tagged\n get id() {\n // this guard exists, because some dev-only deprecation code\n // (addListener via validatePropertyInjections) invokes toString before the\n // object is real.\n if (DEBUG) {\n try {\n return recordIdentifierFor(this).id;\n } catch {\n return void 0;\n }\n }\n return recordIdentifierFor(this).id;\n }\n set id(id) {\n const normalizedId = coerceId(id);\n const identifier = recordIdentifierFor(this);\n const didChange = normalizedId !== identifier.id;\n assert(\n `Cannot set ${identifier.type} record's id to ${id}, because id is already ${identifier.id}`,\n !didChange || identifier.id === null\n );\n\n if (normalizedId !== null && didChange) {\n this.store._instanceCache.setRecordId(identifier, normalizedId);\n this.store.notifications.notify(identifier, 'identity');\n }\n }\n\n toString() {\n return `<model::${this.constructor.modelName}:${this.id}>`;\n }\n\n /**\n @property currentState\n @private\n @type {Object}\n */\n // TODO we can probably make this a computeOnce\n // we likely do not need to notify the currentState root anymore\n @tagged\n get currentState() {\n // descriptors are called with the wrong `this` context during mergeMixins\n // when using legacy/classic ember classes. Basically: lazy in prod and eager in dev.\n // so we do this to try to steer folks to the nicer \"dont user currentState\"\n // error.\n if (!DEBUG) {\n if (!this.___recordState) {\n this.___recordState = new RecordState(this);\n }\n }\n return this.___recordState;\n }\n set currentState(_v) {\n throw new Error('cannot set currentState');\n }\n\n /**\n The store service instance which created this record instance\n\n @property store\n @public\n */\n\n /**\n When the record is in the `invalid` state this object will contain\n any errors returned by the adapter. When present the errors hash\n contains keys corresponding to the invalid property names\n and values which are arrays of Javascript objects with two keys:\n\n - `message` A string containing the error message from the backend\n - `attribute` The name of the property associated with this error message\n\n ```javascript\n record.errors.length; // 0\n record.set('foo', 'invalid value');\n record.save().catch(function() {\n record.errors.foo;\n // [{message: 'foo should be a number.', attribute: 'foo'}]\n });\n ```\n\n The `errors` property is useful for displaying error messages to\n the user.\n\n ```handlebars\n <label>Username: <Input @value={{@model.username}} /> </label>\n {{#each @model.errors.username as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n <label>Email: <Input @value={{@model.email}} /> </label>\n {{#each @model.errors.email as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n ```\n\n\n You can also access the special `messages` property on the error\n object to get an array of all the error strings.\n\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n <div class=\"error\">\n {{message}}\n </div>\n {{/each}}\n ```\n\n @property errors\n @public\n @type {Errors}\n */\n @computeOnce\n get errors() {\n const errors = Errors.create({ __record: this });\n this.currentState.updateInvalidErrors(errors);\n return errors;\n }\n\n /**\n This property holds the `AdapterError` object with which\n last adapter operation was rejected.\n\n @property adapterError\n @public\n @type {AdapterError}\n */\n @compat\n get adapterError() {\n return this.currentState.adapterError;\n }\n set adapterError(v) {\n throw new Error(`adapterError is not directly settable`);\n }\n\n /**\n Create a JSON representation of the record, using the serialization\n strategy of the store's adapter.\n\n `serialize` takes an optional hash as a parameter, currently\n supported options are:\n\n - `includeId`: `true` if the record's ID should be included in the\n JSON representation.\n\n @method serialize\n @public\n @param {Object} options\n @return {Object} an object whose values are primitive JSON values only\n */\n\n /*\n We hook the default implementation to ensure\n our tagged properties are properly notified\n as well. We still super for everything because\n sync observers require a direct call occuring\n to trigger their flush. We wouldn't need to\n super in 4.0+ where sync observers are removed.\n */\n notifyPropertyChange(prop) {\n notifySignal(this, prop);\n super.notifyPropertyChange(prop);\n }\n\n /**\n Marks the record as deleted but does not save it. You must call\n `save` afterwards if you want to persist it. You might use this\n method if you want to allow the user to still `rollbackAttributes()`\n after a delete was made.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n softDelete = () => {\n this.args.model.deleteRecord();\n }\n\n confirm = () => {\n this.args.model.save();\n }\n\n undo = () => {\n this.args.model.rollbackAttributes();\n }\n }\n ```\n\n @method deleteRecord\n @public\n */\n\n /**\n Same as `deleteRecord`, but saves the record immediately.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n delete = () => {\n this.args.model.destroyRecord().then(function() {\n this.transitionToRoute('model.index');\n });\n }\n }\n ```\n\n If you pass an object on the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot\n\n ```js\n record.destroyRecord({ adapterOptions: { subscribe: false } });\n ```\n\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n\n export default class PostAdapter extends MyCustomAdapter {\n deleteRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n\n @method destroyRecord\n @public\n @param {Object} options\n @return {Promise} a promise that will be resolved when the adapter returns\n successfully or rejected if the adapter returns with an error.\n */\n\n /**\n Unloads the record from the store. This will not send a delete request\n to your server, it just unloads the record from memory.\n\n @method unloadRecord\n @public\n */\n\n /**\n Returns an object, whose keys are changed properties, and value is\n an [oldProp, newProp] array.\n\n The array represents the diff of the canonical state with the local state\n of the model. Note: if the model is created locally, the canonical state is\n empty since the adapter hasn't acknowledged the attributes yet:\n\n Example\n\n ```app/models/mascot.js\n import Model, { attr } from '@ember-data/model';\n\n export default class MascotModel extends Model {\n @attr('string') name;\n @attr('boolean', {\n defaultValue: false\n })\n isAdmin;\n }\n ```\n\n ```javascript\n let mascot = store.createRecord('mascot');\n\n mascot.changedAttributes(); // {}\n\n mascot.set('name', 'Tomster');\n mascot.changedAttributes(); // { name: [undefined, 'Tomster'] }\n\n mascot.set('isAdmin', true);\n mascot.changedAttributes(); // { isAdmin: [undefined, true], name: [undefined, 'Tomster'] }\n\n mascot.save().then(function() {\n mascot.changedAttributes(); // {}\n\n mascot.set('isAdmin', false);\n mascot.changedAttributes(); // { isAdmin: [true, false] }\n });\n ```\n\n @method changedAttributes\n @public\n @return {Object} an object, whose keys are changed properties,\n and value is an [oldProp, newProp] array.\n */\n\n /**\n If the model `hasDirtyAttributes` this function will discard any unsaved\n changes. If the model `isNew` it will be removed from the store.\n\n Example\n\n ```javascript\n record.name; // 'Untitled Document'\n record.set('name', 'Doc 1');\n record.name; // 'Doc 1'\n record.rollbackAttributes();\n record.name; // 'Untitled Document'\n ```\n\n @since 1.13.0\n @method rollbackAttributes\n @public\n */\n\n /**\n @method _createSnapshot\n @private\n */\n // TODO @deprecate in favor of a public API or examples of how to test successfully\n\n /**\n Save the record and persist any changes to the record to an\n external source via the adapter.\n\n Example\n\n ```javascript\n record.set('name', 'Tomster');\n record.save().then(function() {\n // Success callback\n }, function() {\n // Error callback\n });\n ```\n\n If you pass an object using the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot.\n\n ```js\n record.save({ adapterOptions: { subscribe: false } });\n ```\n\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n\n export default class PostAdapter extends MyCustomAdapter {\n updateRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n\n @method save\n @public\n @param {Object} options\n @return {Promise} a promise that will be resolved when the adapter returns\n successfully or rejected if the adapter returns with an error.\n */\n\n /**\n Reload the record from the adapter.\n\n This will only work if the record has already finished loading.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n async reload = () => {\n await this.args.model.reload();\n // do something with the reloaded model\n }\n }\n ```\n\n @method reload\n @public\n @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter request\n\n @return {Promise} a promise that will be resolved with the record when the\n adapter returns successfully or rejected if the adapter returns\n with an error.\n */\n\n attr() {\n assert(\n 'The `attr` method is not available on Model, a Snapshot was probably expected. Are you passing a Model instead of a Snapshot to your serializer?',\n false\n );\n }\n\n /**\n Get the reference for the specified belongsTo relationship.\n\n For instance, given the following model\n\n ```app/models/blog-post.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogPost extends Model {\n @belongsTo('user', { async: true, inverse: null }) author;\n }\n ```\n\n Then the reference for the author relationship would be\n retrieved from a record instance like so:\n\n ```js\n blogPost.belongsTo('author');\n ```\n\n A `BelongsToReference` is a low-level API that allows access\n and manipulation of a belongsTo relationship.\n\n It is especially useful when you're dealing with `async` relationships\n as it allows synchronous access to the relationship data if loaded, as\n well as APIs for loading, reloading the data or accessing available\n information without triggering a load.\n\n It may also be useful when using `sync` relationships that need to be\n loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @method belongsTo\n @public\n @param {String} name of the relationship\n @since 2.5.0\n @return {BelongsToReference} reference for this relationship\n */\n\n /**\n Get the reference for the specified hasMany relationship.\n\n For instance, given the following model\n\n ```app/models/blog-post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class BlogPost extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n Then the reference for the comments relationship would be\n retrieved from a record instance like so:\n\n ```js\n blogPost.hasMany('comments');\n ```\n\n A `HasManyReference` is a low-level API that allows access\n and manipulation of a hasMany relationship.\n\n It is especially useful when you are dealing with `async` relationships\n as it allows synchronous access to the relationship data if loaded, as\n well as APIs for loading, reloading the data or accessing available\n information without triggering a load.\n\n It may also be useful when using `sync` relationships with `@ember-data/model`\n that need to be loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @method hasMany\n @public\n @param {String} name of the relationship\n @since 2.5.0\n @return {HasManyReference} reference for this relationship\n */\n\n /**\n Given a callback, iterates over each of the relationships in the model,\n invoking the callback with the name of each relationship and its relationship\n descriptor.\n\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, descriptor);\n ```\n\n - `name` the name of the current property in the iteration\n - `descriptor` the meta object that describes this relationship\n\n The relationship descriptor argument is an object with the following properties.\n\n - **name** <span class=\"type\">String</span> the name of this relationship on the Model\n - **kind** <span class=\"type\">String</span> \"hasMany\" or \"belongsTo\"\n - **options** <span class=\"type\">Object</span> the original options hash passed when the relationship was declared\n - **parentType** <span class=\"type\">Model</span> the type of the Model that owns this relationship\n - **type** <span class=\"type\">String</span> the type name of the related Model\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class ApplicationSerializer extends JSONSerializer {\n serialize(record, options) {\n let json = {};\n\n record.eachRelationship(function(name, descriptor) {\n if (descriptor.kind === 'hasMany') {\n let serializedHasManyName = name.toUpperCase() + '_IDS';\n json[serializedHasManyName] = record.get(name).map(r => r.id);\n }\n });\n\n return json;\n }\n }\n ```\n\n @method eachRelationship\n @public\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n eachRelationship(callback, binding) {\n this.constructor.eachRelationship(callback, binding);\n }\n\n relationshipFor(name) {\n return this.constructor.relationshipsByName.get(name);\n }\n\n inverseFor(name) {\n return this.constructor.inverseFor(name, storeFor(this));\n }\n\n eachAttribute(callback, binding) {\n this.constructor.eachAttribute(callback, binding);\n }\n\n static isModel = true;\n\n /**\n Create should only ever be called by the store. To create an instance of a\n `Model` in a dirty state use `store.createRecord`.\n\n To create instances of `Model` in a clean state, use `store.push`\n\n @method create\n @private\n @static\n */\n\n /**\n Represents the model's class name as a string. This can be used to look up the model's class name through\n `Store`'s modelFor method.\n\n `modelName` is generated for you by EmberData. It will be a lowercased, dasherized string.\n For example:\n\n ```javascript\n store.modelFor('post').modelName; // 'post'\n store.modelFor('blog-post').modelName; // 'blog-post'\n ```\n\n The most common place you'll want to access `modelName` is in your serializer's `payloadKeyFromModelName` method. For example, to change payload\n keys to underscore (instead of dasherized), you might use the following code:\n\n ```javascript\n import RESTSerializer from '@ember-data/serializer/rest';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default const PostSerializer = RESTSerializer.extend({\n payloadKeyFromModelName(modelName) {\n return underscore(modelName);\n }\n });\n ```\n @property modelName\n @public\n @type String\n @readonly\n @static\n */\n static modelName = null;\n\n /*\n These class methods below provide relationship\n introspection abilities about relationships.\n\n A note about the computed properties contained here:\n\n **These properties are effectively sealed once called for the first time.**\n To avoid repeatedly doing expensive iteration over a model's fields, these\n values are computed once and then cached for the remainder of the runtime of\n your application.\n\n If your application needs to modify a class after its initial definition\n (for example, using `reopen()` to add additional attributes), make sure you\n do it before using your model with the store, which uses these properties\n extensively.\n */\n\n /**\n For a given relationship name, returns the model type of the relationship.\n\n For example, if you define a model like this:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n\n Calling `store.modelFor('post').typeForRelationship('comments', store)` will return `Comment`.\n\n @method typeForRelationship\n @public\n @static\n @param {String} name the name of the relationship\n @param {store} store an instance of Store\n @return {Model} the type of the relationship, or undefined\n */\n static typeForRelationship(name, store) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationship = this.relationshipsByName.get(name);\n return relationship && store.modelFor(relationship.type);\n }\n\n @computeOnce\n static get inverseMap() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n return Object.create(null);\n }\n\n /**\n Find the relationship which is the inverse of the one asked for.\n\n For example, if you define models like this:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('message') comments;\n }\n ```\n\n ```app/models/message.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class MessageModel extends Model {\n @belongsTo('post') owner;\n }\n ```\n\n ``` js\n store.modelFor('post').inverseFor('comments', store) // { type: App.Message, name: 'owner', kind: 'belongsTo' }\n store.modelFor('message').inverseFor('owner', store) // { type: App.Post, name: 'comments', kind: 'hasMany' }\n ```\n\n @method inverseFor\n @public\n @static\n @param {String} name the name of the relationship\n @param {Store} store\n @return {Object} the inverse relationship, or null\n */\n static inverseFor(name, store) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const inverseMap = this.inverseMap;\n if (inverseMap[name]) {\n return inverseMap[name];\n } else {\n const inverse = this._findInverseFor(name, store);\n inverseMap[name] = inverse;\n return inverse;\n }\n }\n\n //Calculate the inverse, ignoring the cache\n static _findInverseFor(name, store) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationship = this.relationshipsByName.get(name);\n const { options } = relationship;\n const isPolymorphic = options.polymorphic;\n\n //If inverse is manually specified to be null, like `comments: hasMany('message', { inverse: null })`\n const isExplicitInverseNull = options.inverse === null;\n const isAbstractType =\n !isExplicitInverseNull && isPolymorphic && !store.getSchemaDefinitionService().doesTypeExist(relationship.type);\n\n if (isExplicitInverseNull || isAbstractType) {\n assert(\n `No schema for the abstract type '${relationship.type}' for the polymorphic relationship '${name}' on '${this.modelName}' was provided by the SchemaDefinitionService.`,\n !isPolymorphic || isExplicitInverseNull\n );\n return null;\n }\n\n let fieldOnInverse, inverseKind, inverseRelationship, inverseOptions;\n const inverseSchema = this.typeForRelationship(name, store);\n\n // if the type does not exist and we are not polymorphic\n //If inverse is specified manually, return the inverse\n if (options.inverse !== undefined) {\n fieldOnInverse = options.inverse;\n inverseRelationship = inverseSchema && inverseSchema.relationshipsByName.get(fieldOnInverse);\n\n assert(\n `We found no field named '${fieldOnInverse}' on the schema for '${inverseSchema.modelName}' to be the inverse of the '${name}' relationship on '${this.modelName}'. This is most likely due to a missing field on your model definition.`,\n inverseRelationship\n );\n\n // TODO probably just return the whole inverse here\n inverseKind = inverseRelationship.kind;\n inverseOptions = inverseRelationship.options;\n } else {\n //No inverse was specified manually, we need to use a heuristic to guess one\n if (relationship.type === relationship.parentModelName) {\n warn(\n `Detected a reflexive relationship named '${name}' on the schema for '${relationship.type}' without an inverse option. Look at https://guides.emberjs.com/current/models/relationships/#toc_reflexive-relations for how to explicitly specify inverses.`,\n false,\n {\n id: 'ds.model.reflexive-relationship-without-inverse',\n }\n );\n }\n\n let possibleRelationships = findPossibleInverses(this, inverseSchema, name);\n\n if (possibleRelationships.length === 0) {\n return null;\n }\n\n if (DEBUG) {\n const filteredRelationships = possibleRelationships.filter((possibleRelationship) => {\n const optionsForRelationship = possibleRelationship.options;\n return name === optionsForRelationship.inverse;\n });\n\n assert(\n \"You defined the '\" +\n name +\n \"' relationship on \" +\n this +\n ', but you defined the inverse relationships of type ' +\n inverseSchema.toString() +\n ' multiple times. Look at https://guides.emberjs.com/current/models/relationships/#toc_explicit-inverses for how to explicitly specify inverses',\n filteredRelationships.length < 2\n );\n }\n\n const explicitRelationship = possibleRelationships.find((relationship) => relationship.options.inverse === name);\n if (explicitRelationship) {\n possibleRelationships = [explicitRelationship];\n }\n\n assert(\n \"You defined the '\" +\n name +\n \"' relationship on \" +\n this +\n ', but multiple possible inverse relationships of type ' +\n this +\n ' were found on ' +\n inverseSchema +\n '. Look at https://guides.emberjs.com/current/models/relationships/#toc_explicit-inverses for how to explicitly specify inverses',\n possibleRelationships.length === 1\n );\n\n fieldOnInverse = possibleRelationships[0].name;\n inverseKind = possibleRelationships[0].kind;\n inverseOptions = possibleRelationships[0].options;\n }\n\n // ensure inverse is properly configured\n if (DEBUG) {\n if (isPolymorphic) {\n assert(\n `Relationships that satisfy polymorphic relationships MUST define which abstract-type they are satisfying using 'as'. The field '${fieldOnInverse}' on type '${inverseSchema.modelName}' is misconfigured.`,\n inverseOptions.as\n );\n assert(\n `options.as should match the expected type of the polymorphic relationship. Expected field '${fieldOnInverse}' on type '${inverseSchema.modelName}' to specify '${relationship.type}' but found '${inverseOptions.as}'`,\n !!inverseOptions.as && relationship.type === inverseOptions.as\n );\n }\n }\n\n // ensure we are properly configured\n if (DEBUG) {\n if (inverseOptions.polymorphic) {\n assert(\n `Relationships that satisfy polymorphic relationships MUST define which abstract-type they are satisfying using 'as'. The field '${name}' on type '${this.modelName}' is misconfigured.`,\n options.as\n );\n assert(\n `options.as should match the expected type of the polymorphic relationship. Expected field '${name}' on type '${this.modelName}' to specify '${inverseRelationship.type}' but found '${options.as}'`,\n !!options.as && inverseRelationship.type === options.as\n );\n }\n }\n\n assert(\n `The ${inverseSchema.modelName}:${fieldOnInverse} relationship declares 'inverse: null', but it was resolved as the inverse for ${this.modelName}:${name}.`,\n inverseOptions.inverse !== null\n );\n\n return {\n type: inverseSchema,\n name: fieldOnInverse,\n kind: inverseKind,\n options: inverseOptions,\n };\n }\n\n /**\n The model's relationships as a map, keyed on the type of the\n relationship. The value of each entry is an array containing a descriptor\n for each relationship with that type, describing the name of the relationship\n as well as the type.\n\n For example, given the following model definition:\n\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n @hasMany('post') posts;\n }\n ```\n\n This computed property would return a map describing these\n relationships, like this:\n\n ```javascript\n import Blog from 'app/models/blog';\n import User from 'app/models/user';\n import Post from 'app/models/post';\n\n let relationships = Blog.relationships;\n relationships.user;\n //=> [ { name: 'users', kind: 'hasMany' },\n // { name: 'owner', kind: 'belongsTo' } ]\n relationships.post;\n //=> [ { name: 'posts', kind: 'hasMany' } ]\n ```\n\n @property relationships\n @public\n @static\n @type Map\n @readOnly\n */\n\n @computeOnce\n static get relationships() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map();\n const relationshipsByName = this.relationshipsByName;\n\n // Loop through each computed property on the class\n relationshipsByName.forEach((desc) => {\n const { type } = desc;\n\n if (!map.has(type)) {\n map.set(type, []);\n }\n\n map.get(type).push(desc);\n });\n\n return map;\n }\n\n /**\n A hash containing lists of the model's relationships, grouped\n by the relationship kind. For example, given a model with this\n definition:\n\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relationshipNames = Blog.relationshipNames;\n relationshipNames.hasMany;\n //=> ['users', 'posts']\n relationshipNames.belongsTo;\n //=> ['owner']\n ```\n\n @property relationshipNames\n @public\n @static\n @type Object\n @readOnly\n */\n @computeOnce\n static get relationshipNames() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const names = {\n hasMany: [],\n belongsTo: [],\n };\n\n this.eachComputedProperty((name, meta) => {\n if (meta.kind === 'hasMany' || meta.kind === 'belongsTo') {\n names[meta.kind].push(name);\n }\n });\n\n return names;\n }\n\n /**\n An array of types directly related to a model. Each type will be\n included once, regardless of the number of relationships it has with\n the model.\n\n For example, given a model with this definition:\n\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relatedTypes = Blog.relatedTypes');\n //=> ['user', 'post']\n ```\n\n @property relatedTypes\n @public\n @static\n @type Array\n @readOnly\n */\n @computeOnce\n static get relatedTypes() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const types = [];\n\n const rels = this.relationshipsObject;\n const relationships = Object.keys(rels);\n\n // create an array of the unique types involved\n // in relationships\n for (let i = 0; i < relationships.length; i++) {\n const name = relationships[i];\n const meta = rels[name];\n const modelName = meta.type;\n\n if (types.indexOf(modelName) === -1) {\n types.push(modelName);\n }\n }\n\n return types;\n }\n\n /**\n A map whose keys are the relationships of a model and whose values are\n relationship descriptors.\n\n For example, given a model with this\n definition:\n\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relationshipsByName = Blog.relationshipsByName;\n relationshipsByName.users;\n //=> { name: 'users', kind: 'hasMany', type: 'user', options: Object }\n relationshipsByName.owner;\n //=> { name: 'owner', kind: 'belongsTo', type: 'user', options: Object }\n ```\n\n @property relationshipsByName\n @public\n @static\n @type Map\n @readOnly\n */\n @computeOnce\n static get relationshipsByName() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const map = new Map();\n const rels = this.relationshipsObject;\n const relationships = Object.keys(rels);\n\n for (let i = 0; i < relationships.length; i++) {\n const name = relationships[i];\n const value = rels[name];\n\n map.set(value.name, value);\n }\n\n return map;\n }\n\n @computeOnce\n static get relationshipsObject() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationships = Object.create(null);\n const modelName = this.modelName;\n this.eachComputedProperty((name, meta) => {\n if (meta.kind === 'hasMany' || meta.kind === 'belongsTo') {\n // TODO deprecate key being here\n meta.key = name;\n meta.name = name;\n meta.parentModelName = modelName;\n relationships[name] = meta;\n\n assert(\n `You should not specify both options.as and options.inverse as null on ${modelName}.${meta.name}, as if there is no inverse field there is no abstract type to conform to. You may have intended for this relationship to be polymorphic, or you may have mistakenly set inverse to null.`,\n !(meta.options.inverse === null && meta.options.as?.length > 0)\n );\n }\n });\n return relationships;\n }\n\n /**\n A map whose keys are the fields of the model and whose values are strings\n describing the kind of the field. A model's fields are the union of all of its\n attributes and relationships.\n\n For example:\n\n ```app/models/blog.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n\n @attr('string') title;\n }\n ```\n\n ```js\n import Blog from 'app/models/blog'\n\n let fields = Blog.fields;\n fields.forEach(function(kind, field) {\n // do thing\n });\n\n // prints:\n // users, hasMany\n // owner, belongsTo\n // posts, hasMany\n // title, attribute\n ```\n\n @property fields\n @public\n @static\n @type Map\n @readOnly\n */\n @computeOnce\n static get fields() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const map = new Map();\n\n this.eachComputedProperty((name, meta) => {\n if (meta.kind === 'hasMany' || meta.kind === 'belongsTo') {\n map.set(name, meta.kind);\n } else if (meta.kind === 'attribute') {\n map.set(name, 'attribute');\n }\n });\n\n return map;\n }\n\n /**\n Given a callback, iterates over each of the relationships in the model,\n invoking the callback with the name of each relationship and its relationship\n descriptor.\n\n @method eachRelationship\n @public\n @static\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n static eachRelationship(callback, binding) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.relationshipsByName.forEach((relationship, name) => {\n callback.call(binding, name, relationship);\n });\n }\n\n /**\n Given a callback, iterates over each of the types related to a model,\n invoking the callback with the related type's class. Each type will be\n returned just once, regardless of how many different relationships it has\n with a model.\n\n @method eachRelatedType\n @public\n @static\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n static eachRelatedType(callback, binding) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationshipTypes = this.relatedTypes;\n\n for (let i = 0; i < relationshipTypes.length; i++) {\n const type = relationshipTypes[i];\n callback.call(binding, type);\n }\n }\n\n static determineRelationshipType(knownSide, store) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const knownKey = knownSide.name;\n const knownKind = knownSide.kind;\n const inverse = this.inverseFor(knownKey, store);\n // let key;\n\n if (!inverse) {\n return knownKind === 'belongsTo' ? 'oneToNone' : 'manyToNone';\n }\n\n // key = inverse.name;\n const otherKind = inverse.kind;\n\n if (otherKind === 'belongsTo') {\n return knownKind === 'belongsTo' ? 'oneToOne' : 'manyToOne';\n } else {\n return knownKind === 'belongsTo' ? 'oneToMany' : 'manyToMany';\n }\n }\n\n /**\n A map whose keys are the attributes of the model (properties\n described by attr) and whose values are the meta object for the\n property.\n\n Example\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n ```\n\n ```javascript\n import Person from 'app/models/person'\n\n let attributes = Person.attributes\n\n attributes.forEach(function(meta, name) {\n // do thing\n });\n\n // prints:\n // firstName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", kind: 'attribute', options: Object, parentType: function, name: \"birthday\"}\n ```\n\n @property attributes\n @public\n @static\n @type {Map}\n @readOnly\n */\n @computeOnce\n static get attributes() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map();\n\n this.eachComputedProperty((name, meta) => {\n if (meta.kind === 'attribute') {\n assert(\n \"You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: attr('<type>')` from \" +\n this.toString(),\n name !== 'id'\n );\n\n // TODO deprecate key being here\n meta.key = name;\n meta.name = name;\n map.set(name, meta);\n }\n });\n\n return map;\n }\n\n /**\n A map whose keys are the attributes of the model (properties\n described by attr) and whose values are type of transformation\n applied to each attribute. This map does not include any\n attributes that do not have an transformation type.\n\n Example\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PersonModel extends Model {\n @attr firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n ```\n\n ```javascript\n import Person from 'app/models/person';\n\n let transformedAttributes = Person.transformedAttributes\n\n transformedAttributes.forEach(function(field, type) {\n // do thing\n });\n\n // prints:\n // lastName string\n // birthday date\n ```\n\n @property transformedAttributes\n @public\n @static\n @type {Map}\n @readOnly\n */\n @computeOnce\n static get transformedAttributes() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map();\n\n this.eachAttribute((name, meta) => {\n if (meta.type) {\n map.set(name, meta.type);\n }\n });\n\n return map;\n }\n\n /**\n Iterates through the attributes of the model, calling the passed function on each\n attribute.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, meta);\n ```\n\n - `name` the name of the current property in the iteration\n - `meta` the meta object for the attribute property in the iteration\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```javascript\n import Model, { attr } from '@ember-data/model';\n\n class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n\n PersonModel.eachAttribute(function(name, meta) {\n // do thing\n });\n\n // prints:\n // firstName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", kind: 'attribute', options: Object, parentType: function, name: \"birthday\"}\n ```\n\n @method eachAttribute\n @public\n @param {Function} callback The callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @static\n */\n static eachAttribute(callback, binding) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.attributes.forEach((meta, name) => {\n callback.call(binding, name, meta);\n });\n }\n\n /**\n Iterates through the transformedAttributes of the model, calling\n the passed function on each attribute. Note the callback will not be\n called for any attributes that do not have an transformation type.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, type);\n ```\n\n - `name` the name of the current property in the iteration\n - `type` a string containing the name of the type of transformed\n applied to the attribute\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```javascript\n import Model, { attr } from '@ember-data/model';\n\n let Person = Model.extend({\n firstName: attr(),\n lastName: attr('string'),\n birthday: attr('date')\n });\n\n Person.eachTransformedAttribute(function(name, type) {\n // do thing\n });\n\n // prints:\n // lastName string\n // birthday date\n ```\n\n @method eachTransformedAttribute\n @public\n @param {Function} callback The callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @static\n */\n static eachTransformedAttribute(callback, binding) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.transformedAttributes.forEach((type, name) => {\n callback.call(binding, name, type);\n });\n }\n\n /**\n Returns the name of the model class.\n\n @method toString\n @public\n @static\n */\n static toString() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n return `model:${this.modelName}`;\n }\n}\n\nModel.prototype.save = save;\nModel.prototype.destroyRecord = destroyRecord;\nModel.prototype.unloadRecord = unloadRecord;\nModel.prototype.hasMany = hasMany;\nModel.prototype.belongsTo = belongsTo;\nModel.prototype.serialize = serialize;\nModel.prototype._createSnapshot = createSnapshot;\nModel.prototype.deleteRecord = deleteRecord;\nModel.prototype.changedAttributes = changedAttributes;\nModel.prototype.rollbackAttributes = rollbackAttributes;\nModel.prototype.reload = reload;\n\ndefineSignal(Model.prototype, 'isReloading', false);\n\n// this is required to prevent `init` from passing\n// the values initialized during create to `setUnknownProperty`\nModel.prototype._createProps = null;\nModel.prototype._secretInit = null;\n\nif (HAS_DEBUG_PACKAGE) {\n /**\n Provides info about the model for debugging purposes\n by grouping the properties into more semantic groups.\n\n Meant to be used by debugging tools such as the Chrome Ember Extension.\n\n - Groups all attributes in \"Attributes\" group.\n - Groups all belongsTo relationships in \"Belongs To\" group.\n - Groups all hasMany relationships in \"Has Many\" group.\n - Groups all flags in \"Flags\" group.\n - Flags relationship CPs as expensive properties.\n\n @method _debugInfo\n @for Model\n @private\n */\n Model.prototype._debugInfo = function () {\n const relationships = {};\n const expensiveProperties = [];\n\n const identifier = recordIdentifierFor(this);\n const schema = this.store.getSchemaDefinitionService();\n const attrDefs = schema.attributesDefinitionFor(identifier);\n const relDefs = schema.relationshipsDefinitionFor(identifier);\n\n const attributes = Object.keys(attrDefs);\n attributes.unshift('id');\n\n const groups = [\n {\n name: 'Attributes',\n properties: attributes,\n expand: true,\n },\n ];\n\n Object.keys(relDefs).forEach((name) => {\n const relationship = relDefs[name];\n\n let properties = relationships[relationship.kind];\n\n if (properties === undefined) {\n properties = relationships[relationship.kind] = [];\n groups.push({\n name: relationship.kind,\n properties,\n expand: true,\n });\n }\n properties.push(name);\n expensiveProperties.push(name);\n });\n\n groups.push({\n name: 'Flags',\n properties: ['isLoaded', 'hasDirtyAttributes', 'isSaving', 'isDeleted', 'isError', 'isNew', 'isValid'],\n });\n\n return {\n propertyInfo: {\n // include all other mixins / properties (not just the grouped ones)\n includeOtherProperties: true,\n groups: groups,\n // don't pre-calculate unless cached\n expensiveProperties: expensiveProperties,\n },\n };\n };\n}\n\nif (DEBUG) {\n const lookupDescriptor = function lookupDescriptor(obj, keyName) {\n let current = obj;\n do {\n const descriptor = Object.getOwnPropertyDescriptor(current, keyName);\n if (descriptor !== undefined) {\n return descriptor;\n }\n current = Object.getPrototypeOf(current);\n } while (current !== null);\n return null;\n };\n\n Model.reopen({\n init() {\n this._super(...arguments);\n\n const ourDescriptor = lookupDescriptor(Model.prototype, 'currentState');\n const theirDescriptor = lookupDescriptor(this, 'currentState');\n const realState = this.___recordState;\n if (ourDescriptor.get !== theirDescriptor.get || realState !== this.currentState) {\n throw new Error(\n `'currentState' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`\n );\n }\n\n const ID_DESCRIPTOR = lookupDescriptor(Model.prototype, 'id');\n const idDesc = lookupDescriptor(this, 'id');\n\n if (idDesc.get !== ID_DESCRIPTOR.get) {\n throw new Error(\n `You may not set 'id' as an attribute on your model. Please remove any lines that look like: \\`id: attr('<type>')\\` from ${this.constructor.toString()}`\n );\n }\n },\n });\n\n Model.reopen = function deprecatedReopen() {\n assert(`Model.reopen is deprecated. Use Foo extends Model to extend your class instead.`);\n };\n\n Model.reopenClass = function deprecatedReopenClass() {\n assert(\n `Model.reopenClass is deprecated. Use Foo extends Model to add static methods and properties to your class instead.`\n );\n };\n}\n\nexport default Model;\n"],"names":["RelatedCollection","RecordArray","constructor","options","isLoaded","isAsync","isPolymorphic","identifier","key","MUTATE","target","receiver","prop","args","_SIGNAL","Reflect","set","mutateReplaceRelatedRecords","index","prior","value","mutateReplaceRelatedRecord","newValues","extractIdentifiersFromRecords","assertNoDuplicates","currentState","push","macroCondition","getOwnConfig","deprecations","DEPRECATE_MANY_ARRAY_DUPLICATES","seen","Set","unique","forEach","item","recordIdentifierFor","has","add","newArgs","Array","from","result","apply","length","mutateAddToRelatedRecords","mutateRemoveFromRelatedRecords","unshift","mutateSortRelatedRecords","map","start","deleteCount","adds","SOURCE","splice","current","concat","slice","assert","notify","signal","ARRAY_SIGNAL","shouldReset","notifyArray","reload","_manager","reloadHasMany","createRecord","hash","store","modelName","record","destroy","prototype","cache","_inverseIsAsync","DEPRECATED_CLASS_NAME","assertRecordPassedToHasMany","records","extractIdentifierFromRecord","recordOrPromiseRecord","collection","callback","reason","state","size","duplicates","filter","currentValue","currentIndex","indexOf","deprecate","type","id","lid","r","isStableIdentifier","sort","a","b","localeCompare","join","for","until","since","enabled","available","Error","operationInfo","mutate","op","field","mutation","addToTransaction","_applyDecoratedDescriptor","property","decorators","descriptor","context","desc","Object","keys","enumerable","configurable","initializer","writable","reverse","reduce","decorator","call","undefined","defineProperty","PromiseObject","ObjectProxy","extend","PromiseProxyMixin","Extended","PromiseBelongsTo","_dec","computed","_class","legacySupport","_belongsToState","ref","referenceFor","meta","content","reloadBelongsTo","cached","getOwnPropertyDescriptor","PromiseManyArray","promise","_update","isDestroyed","DEPRECATE_COMPUTED_CHAINS","cb","then","s","f","catch","finally","links","tapPromise","create","compat","defineSignal","get","proxy","isPending","isSettled","isFulfilled","isRejected","Promise","resolve","error","assertPolymorphicType","env","DEBUG","parentIdentifier","parentDefinition","addedIdentifier","inverseIsImplicit","getSchemaDefinitionService","relationshipsDefinitionFor","inverseKey","as","isResourceIdentiferWithRelatedLinks","Boolean","related","HasManyReference","graph","hasManyRelationship","___token","___identifier","___relatedTokenMap","definition","notifications","subscribe","_","bucket","notifiedKey","_ref","Map","unsubscribe","token","clear","identifiers","resource","_resource","data","resourceIdentifier","identifierCache","getOrCreateRecordIdentifier","delete","getRelationship","remoteType","ids","link","href","doc","skipFetch","dataDoc","isArray","isResourceData","isMaybeResource","_push","i","relationshipMeta","added","newData","_join","load","_isLoaded","hasRelationshipDataProperty","hasReceivedData","relationship","getData","every","_instanceCache","recordIsLoaded","support","LEGACY_SUPPORT","loaded","getManyArray","fetchSyncRel","areAllInverseRecordsLoaded","getHasMany","object","k","BelongsToReference","belongsToRelationship","___relatedToken","peekRecord","getBelongsTo","lookupLegacySupport","isDestroying","LegacySupport","storeFor","peekCache","packages","HAS_JSON_API_PACKAGE","graphFor","importSync","_manyArrayCache","_relationshipPromisesCache","_relationshipProxyCache","_pending","references","_syncArray","array","jsonApi","_getCurrentState","fastPush","_findBelongsTo","_findBelongsToByJsonApiResource","handleCompletedRelationshipRequest","e","loadingPromise","isBelongsTo","hasFailedLoadAttempt","shouldForceReload","_updatePromiseProxyFor","relatedIdentifier","getRecord","toReturn","setDirtyBelongsTo","manyArray","inverseIsAsync","manager","allowMutation","fetchAsyncHasMany","_findHasManyByJsonApiResource","anyUnloaded","kind","promiseProxy","name","reference","actualRelationshipKind","relationshipKind","upgradeStore","adapter","adapterFor","isStale","hasDematerializedInverse","isEmpty","allInverseRecordsAreLoaded","shouldFindViaLink","findHasMany","inverseType","request","useLink","cacheOptions","Symbol","preferLocalCache","hasLocalPartialData","attemptLocalCache","hasData","future","localDataIsEmpty","resourceIsLocal","recordExt","isHasMany","_flush","_graph","relationshipData","unloaded","find","instanceCache","_initializerDefineProperty","ArrayProxyWithCustomOverrides","ArrayProxy","Errors","_dec2","mapBy","_dec3","_dec4","not","_descriptor","_descriptor2","errorsByAttributeName","errorsFor","attribute","errors","A","unknownProperty","messages","_findOrCreateMessages","addObjects","__record","notifyPropertyChange","messagesArray","_messages","message","err","findBy","remove","rejectBy","setObjects","replace","attributes","rollbackAttributes","isNew","RecordStore","rollbackAttrs","cleanErrorRequests","unloadRecord","belongsTo","hasMany","isReloading","changedAttributes","changedAttrs","serialize","serializeRecord","deleteRecord","save","isDeleted","saveRecord","destroyRecord","createSnapshot","_fetchManager","FetchManager","notifyChanges","notifyAttribute","eachAttribute","relationshipsByName","notifyRelationship","eachRelationship","hasPromise","async","cacheFor","getAttr","SOURCE_POINTER_REGEXP","SOURCE_POINTER_PRIMARY_REGEXP","PRIMARY_ATTRIBUTE_KEY","isInvalidError","isAdapterError","code","tagged","_target","getter","setter","getSignal","lastValue","v","notifySignal","obj","peekSignal","RecordState","identity","pendingCount","fulfilledCount","rejectedCount","_errorRequests","_lastError","requests","getRequestStateService","handleRequest","req","isSaving","response","notifyErrorsStateChanged","subscribeForRecord","lastRequest","getLastRequestForRecord","handler","updateInvalidErrors","getErrors","jsonApiErrors","source","pointer","keyMatch","match","search","errMsg","detail","title","isLoading","isSaved","rd","isDeletionCommitted","isValid","isDirty","hasChangedAttrs","isError","errorReq","adapterError","isPreloaded","stateName","dirtyType","findPossibleInverses","relationshipsSoFar","possibleRelationships","relationshipMap","relationships","relationshipsForType","optionsForRelationship","inverse","superclass","computeOnce","propertyName","WeakMap","hasComputed","Model","_class2","EmberObject","___private_notifications","init","_secretInit","_createProps","createProps","___recordState","setProperties","hasDirtyAttributes","normalizedId","coerceId","didChange","setRecordId","toString","_v","attr","binding","relationshipFor","inverseFor","typeForRelationship","modelFor","inverseMap","_findInverseFor","polymorphic","isExplicitInverseNull","isAbstractType","doesTypeExist","fieldOnInverse","inverseKind","inverseRelationship","inverseOptions","inverseSchema","parentModelName","warn","filteredRelationships","possibleRelationship","explicitRelationship","relationshipNames","names","eachComputedProperty","relatedTypes","types","rels","relationshipsObject","fields","eachRelatedType","relationshipTypes","determineRelationshipType","knownSide","knownKey","knownKind","otherKind","transformedAttributes","eachTransformedAttribute","isModel","_createSnapshot","includeDataAdapter","_debugInfo","expensiveProperties","schema","attrDefs","attributesDefinitionFor","relDefs","groups","properties","expand","propertyInfo","includeOtherProperties","lookupDescriptor","keyName","getPrototypeOf","reopen","_super","arguments","ourDescriptor","theirDescriptor","realState","ID_DESCRIPTOR","idDesc","deprecatedReopen","reopenClass","deprecatedReopenClass"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AA4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMA,iBAAiB,SAASC,WAAW,CAAC;AAEzD;AACF;AACA;AACA;AACA;;AAIE;AACF;AACA;AACA;AACA;;AAIE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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CAACC,SAAS,EAAE,CAAA;IAEjC,OAAOD,QAAQ,IAAIA,QAAQ,CAAC9C,KAAK,GAAG8C,QAAQ,CAAC9C,KAAK,GAAG,IAAI,CAAA;AAC3D,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOEhB,EAAAA,IAAIA,GAAgB;IAClB,IAAIA,IAAiB,GAAG,IAAI,CAAA;AAC5B,IAAA,MAAM8D,QAAQ,GAAG,IAAI,CAACC,SAAS,EAAE,CAAA;AACjC,IAAA,IAAID,QAAQ,IAAIA,QAAQ,CAAC9D,IAAI,IAAI,OAAO8D,QAAQ,CAAC9D,IAAI,KAAK,QAAQ,EAAE;MAClEA,IAAI,GAAG8D,QAAQ,CAAC9D,IAAI,CAAA;AACtB,KAAA;AACA,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmBE,EAAA,MAAMvH,IAAIA,CACRiM,GAA0D,EAC1DC,SAAmB,EACQ;IAC3B,MAAM;AAAEvJ,MAAAA,KAAAA;AAAM,KAAC,GAAG,IAAI,CAAA;IACtB,MAAMwJ,OAAO,GAAGrL,KAAK,CAACsL,OAAO,CAACH,GAAG,CAA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AEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQEa,EAAAA,KAAKA,GAAqB;IACxB,MAAM4N,OAAsB,GAAIC,cAAc,CAAgD3E,GAAG,CAC/F,IAAI,CAAC2B,aACP,CAAE,CAAA;AAEF,IAAA,MAAMiD,MAAM,GAAG,IAAI,CAACV,SAAS,EAAE,CAAA;IAE/B,IAAI,CAACU,MAAM,EAAE;AACX;AACA;AACA,MAAA,IAAI,CAACzC,IAAI,CAAA;AACT,MAAA,OAAO,IAAI,CAAA;AACb,KAAA;AAEA,IAAA,OAAOuC,OAAO,CAACG,YAAY,CAAC,IAAI,CAAC3O,GAAG,CAAC,CAAA;AACvC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAYE,MAAM+N,IAAIA,CAACpO,OAAqB,EAAsB;IACpD,MAAM6O,OAAsB,GAAIC,cAAc,CAAgD3E,GAAG,CAC/F,IAAI,CAAC2B,aACP,CAAE,CAAA;IACF,MAAMmD,YAAY,GAChB,CAAC,IAAI,CAACrD,mBAAmB,CAACI,UAAU,CAAC9L,OAAO,IAAI,CAACgP,0BAA0B,CAAC,IAAI,CAAChL,KAAK,EAAE,IAAI,CAAC2I,SAAS,EAAE,CAAC,CAAA;IAC3G,OAAOoC,YAAY,GACdJ,OAAO,CAAC9K,aAAa,CAAC,IAAI,CAAC1D,GAAG,EAAEL,OAAO,CAAC;AACzC;AACA;IACC6O,OAAO,CA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AA,MAAM8D,QAAQ,GAAG,IAAI,CAACC,SAAS,EAAE,CAAA;AACjC,IAAA,IAAID,QAAQ,IAAIA,QAAQ,CAAC9D,IAAI,IAAI,OAAO8D,QAAQ,CAAC9D,IAAI,KAAK,QAAQ,EAAE;MAClEA,IAAI,GAAG8D,QAAQ,CAAC9D,IAAI,CAAA;AACtB,KAAA;AACA,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;AAEA+D,EAAAA,SAASA,GAAG;IACV,IAAI,CAACP,IAAI,CAAC;AACV,IAAA,MAAM/H,KAAK,GAAG,IAAI,CAACL,KAAK,CAACK,KAAK,CAAA;IAC9B,OAAOA,KAAK,CAAC4I,eAAe,CAAC,IAAI,CAACrB,aAAa,EAAE,IAAI,CAACzL,GAAG,CAAC,CAAA;AAC5D,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQE+M,EAAAA,UAAUA,GAAkB;AAC1B,IAAA,MAAMnM,KAAK,GAAG,IAAI,CAAC4L,SAAS,EAAE,CAAA;AAC9B,IAAA,IAAItB,mCAAmC,CAACtK,KAAK,CAAC,EAAE;AAC9C,MAAA,OAAO,MAAM,CAAA;AACf,KAAA;AACA,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAA;IACA5E,KAAK,CAACiK,KAAK,CAAC,MAAM;AAChB,MAAA,IAAI,CAACxC,KAAK,CAACpK,IAAI,CAAC;AACdoF,QAAAA,EAAE,EAAE,oBAAoB;AACxBvC,QAAAA,MAAM,EAAEhE,UAAU;QAClBwG,KAAK,EAAE,IAAI,CAACvG,GAAG;AACfY,QAAAA,KAAK,EAAEiN,OAAAA;AACT,OAAC,CAAC,CAAA;AACJ,KAAC,CAAC,CAAA;IAEF,IAAI,CAACT,SAAS,EAAE,OAAO,IAAI,CAACW,IAAI,EAAE,CAAA;AACpC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQEnN,EAAAA,KAAKA,GAA0B;AAC7B,IAAA,MAAM2L,QAAQ,GAAG,IAAI,CAACC,SAAS,EAAE,CAAA;AACjC,IAAA,OAAOD,QAAQ,IAAIA,QAAQ,CAACE,IAAI,GAAG,IAAI,CAAC5I,KAAK,CAACuL,UAAU,CAAC7C,QAAQ,CAACE,IAAI,CAAC,GAAG,IAAI,CAAA;AAChF,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAYE,MAAMsB,IAAIA,CAACpO,OAAiC,EAAkC;IAC5E,MAAM6O,OAAsB,GAAIC,cAAc,CAAgD3E,GAAG,CAC/F,IAAI,CAAC2B,aACP,CAAE,CAAA;IACF,MAAMmD,YAAY,GAChB,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AACQ,QAAQ;AAC7BzG,IAAAA,KAAK,EAAEiG,UAAU,CAACO,WAAW,GAAGP,UAAU,CAACO,WAAW,CAACK,IAAI,CAACX,OAAO,CAAC,GAAG,KAAK,CAAA;AAC9E,GAAC,CAAC,CAAA;AACJ;;;;ACGA;AACA;AACA;;AAUA;AACA;AACA;AACA,MAAMmN,6BAA6B,GAAGC,UAAsE,CAAA;;AAE5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1EA,IA2EMC,MAAM,IAAAjM,IAAA,GAOTC,QAAQ,EAAE,EAAAiM,KAAA,GA2DVC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,EAAAC,KAAA,GAQ3BnM,QAAQ,EAAE,EAAAoM,KAAA,GAkCVC,GAAG,CAAC,QAAQ,CAAC,GAAApM,QAAA,GA5GhB,MAAM+L,MAAM,SAASF,6BAA6B,CAAkB;AAAAvU,EAAAA,WAAAA,CAAA,GAAAW,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAkDlE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAbE2T,IAAAA,0BAAA,mBAAAS,WAAA,EAAA,IAAA,CAAA,CAAA;AAyCA;AACF;AACA;AACA;AACA;AACA;AACA;AAGE;AACF;AACA;AACA;AACA;AACA;AACA;AANET,IAAAA,0BAAA,kBAAAU,YAAA,EAAA,IAAA,CAAA,CAAA;AAAA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AI,KAAK,WAAW,EAAE;AAC7B,QAAA,IAAI,CAACwD,oBAAoB,CAACtD,IAAI,CAAC,CAAA;AACjC,OAAA;AACF,KAAC,CAAC,CAAA;IACFtD,cAAc,CAAC3E,GAAG,CAAC,IAAI,CAAC,EAAE9F,OAAO,EAAE,CAAA;AACnCyK,IAAAA,cAAc,CAAC5B,MAAM,CAAC,IAAI,CAAC,CAAA;AAC3B4B,IAAAA,cAAc,CAAC5B,MAAM,CAAC9M,UAAU,CAAC,CAAA;IAEjC,KAAK,CAACiE,OAAO,EAAE,CAAA;AACjB,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAEE,IACIwO,OAAOA,GAAG;AACZ,IAAA,OAAO,IAAI,CAACvR,YAAY,CAACuR,OAAO,CAAA;AAClC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAEE,IACIoI,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAAC3Z,YAAY,CAAC2Z,SAAS,CAAA;AACpC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACIhb,QAAQA,GAAG;AACb,IAAA,OAAO,IAAI,CAACqB,YAAY,CAACrB,QAAQ,CAAA;AACnC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACIod,kBAAkBA,GAAG;AACvB,IAAA,OAAO,IAAI,CAAC/b,YAAY,CAACga,OAAO,CAAA;AAClC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAIE,IACIvB,QAAQA,GAAG;AACb,IAAA,OAAO,IAAI,CAACzY,YAAY,CAACyY,QAAQ,CAAA;AACnC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAOE,IACI3C,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAAC9V,YAAY,CAAC8V,SAAS,CAAA;AACpC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACId,KAAKA,GAAG;AACV,IAAA,OAAO,IAAI,CAAChV,YAAY,CAACgV,KAAK,CAAA;AAChC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAGE,IACI+E,OAAOA,GAAG;AACZ,IAAA,OAAO,IAAI,CAAC/Z,YAAY,CAAC+Z,OAAO,CAAA;AAClC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACIQ,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAACva,YAAY,CAACua,SAAS,CAAA;AACpC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAIE,IACIL,OAAOA,GAAG;AACZ,IAAA,OAAO,IAAI,CAACla,YAAY,CAACka,OAAO,CAAA;AAClC,GAAA;EACA,IAAIA,OAAOA,CAACxC,CAAC,EAAE;AACb,IAAA,IAAAxX,cAAA,CAAAC,YAAA,GAAAoJ,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,MAAA,MAAM,IAAItE,KAAK,CAAE,CAAA,gCAAA,CAAiC,CAAC,CAAA;AACrD,KAAA;AACF,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKE;AACF;A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K,CAAE,CAAA,qCAAA,CAAsC,CAAC,CAAA;AAC1D,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEkP,oBAAoBA,CAACjV,IAAI,EAAE;AACzBwY,IAAAA,YAAY,CAAC,IAAI,EAAExY,IAAI,CAAC,CAAA;AACxB,IAAA,KAAK,CAACiV,oBAAoB,CAACjV,IAAI,CAAC,CAAA;AAClC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUE;AACF;AACA;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKE;AACF;AACA;AACA;AACE;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQEmd,EAAAA,IAAIA,GAAG;AACLra,IAAAA,MAAM,CACJ,kJAAkJ,EAClJ,KACF,CAAC,CAAA;AACH,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcEwU,EAAAA,gBAAgBA,CAAChT,QAAQ,EAAE8Y,OAAO,EAAE;IAClC,IAAI,CAAC9d,WAAW,CAACgY,gBAAgB,CAAChT,QAAQ,EAAE8Y,OAAO,CAAC,CAAA;AACtD,GAAA;EAEAC,eAAeA,CAAC1L,IAAI,EAAE;IACpB,OAAO,IAAI,CAACrS,WAAW,CAAC8X,mBAAmB,CAAC1N,GAAG,CAACiI,IAAI,CAAC,CAAA;AACvD,GAAA;EAEA2L,UAAUA,CAAC3L,IAAI,EAAE;AACf,IAAA,OAAO,IAAI,CAACrS,WAAW,CAACge,UAAU,CAAC3L,IAAI,EAAEtC,UAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AAC1D,GAAA;AAEA8H,EAAAA,aAAaA,CAAC7S,QAAQ,EAAE8Y,OAAO,EAAE;IAC/B,IAAI,CAAC9d,WAAW,CAAC6X,aAAa,CAAC7S,QAAQ,EAAE8Y,OAAO,CAAC,CAAA;AACnD,GAAA;AAgDA;AACF;AACA;AAC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AAK,CACZ,CAAA,gIAAA,EAAkI,IAAI,CAACzG,WAAW,CAAC2d,QAAQ,EAAG,CAAA,CACjK,CAAC,CAAA;AACH,OAAA;MAEA,MAAMgE,aAAa,GAAGT,gBAAgB,CAACtE,KAAK,CAACrY,SAAS,EAAE,IAAI,CAAC,CAAA;AAC7D,MAAA,MAAMqd,MAAM,GAAGV,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAE3C,MAAA,IAAIU,MAAM,CAACxX,GAAG,KAAKuX,aAAa,CAACvX,GAAG,EAAE;AACpC,QAAA,MAAM,IAAI3D,KAAK,CACZ,CAAA,wHAAA,EAA0H,IAAI,CAACzG,WAAW,CAAC2d,QAAQ,EAAG,CAAA,CACzJ,CAAC,CAAA;AACH,OAAA;AACF,KAAA;AACF,GAAC,CAAC,CAAA;AAEFf,EAAAA,KAAK,CAACyE,MAAM,GAAG,SAASQ,gBAAgBA,GAAG;IACzCre,MAAM,CAAE,iFAAgF,CAAC,CAAA;GAC1F,CAAA;AAEDoZ,EAAAA,KAAK,CAACkF,WAAW,GAAG,SAASC,qBAAqBA,GAAG;IACnDve,MAAM,CACH,oHACH,CAAC,CAAA;GACF,CAAA;AACH;;;;","x_google_ignoreList":[1,9]}
|
|
1
|
+
{"version":3,"file":"model-YsOraZ6y.js","sources":["../src/-private/many-array.ts","../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","../src/-private/promise-proxy-base.js","../src/-private/promise-belongs-to.ts","../src/-private/promise-many-array.ts","../src/-private/debug/assert-polymorphic-type.ts","../src/-private/references/has-many.ts","../src/-private/references/belongs-to.ts","../src/-private/legacy-relationships-support.ts","../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","../src/-private/errors.ts","../src/-private/model-methods.ts","../src/-private/notify-changes.ts","../src/-private/record-state.ts","../src/-private/model.js"],"sourcesContent":["/**\n @module @ember-data/store\n*/\nimport { assert, deprecate } from '@ember/debug';\n\nimport { DEPRECATE_MANY_ARRAY_DUPLICATES } from '@ember-data/deprecations';\nimport type Store from '@ember-data/store';\nimport {\n ARRAY_SIGNAL,\n isStableIdentifier,\n MUTATE,\n notifyArray,\n RecordArray,\n recordIdentifierFor,\n SOURCE,\n} from '@ember-data/store/-private';\nimport type { IdentifierArrayCreateOptions } from '@ember-data/store/-private/record-arrays/identifier-array';\nimport type { CreateRecordProperties } from '@ember-data/store/-private/store-service';\nimport type { Cache } from '@ember-data/store/-types/q/cache';\nimport type { ModelSchema } from '@ember-data/store/-types/q/ds-model';\nimport type { RecordInstance } from '@ember-data/store/-types/q/record-instance';\nimport type { FindOptions } from '@ember-data/store/-types/q/store';\nimport type { Signal } from '@ember-data/tracking/-private';\nimport { addToTransaction } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { Links, PaginationLinks } from '@warp-drive/core-types/spec/raw';\n\nimport type { LegacySupport } from './legacy-relationships-support';\n\nexport interface ManyArrayCreateArgs {\n identifiers: StableRecordIdentifier[];\n type: string;\n store: Store;\n allowMutation: boolean;\n manager: LegacySupport;\n\n identifier: StableRecordIdentifier;\n cache: Cache;\n meta: Record<string, unknown> | null;\n links: Links | PaginationLinks | null;\n key: string;\n isPolymorphic: boolean;\n isAsync: boolean;\n _inverseIsAsync: boolean;\n isLoaded: boolean;\n}\n/**\n A `ManyArray` is a `MutableArray` that represents the contents of a has-many\n relationship.\n\n The `ManyArray` is instantiated lazily the first time the relationship is\n requested.\n\n This class is not intended to be directly instantiated by consuming applications.\n\n ### Inverses\n\n Often, the relationships in Ember Data applications will have\n an inverse. For example, imagine the following models are\n defined:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n\n ```app/models/comment.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @belongsTo('post') post;\n }\n ```\n\n If you created a new instance of `Post` and added\n a `Comment` record to its `comments` has-many\n relationship, you would expect the comment's `post`\n property to be set to the post that contained\n the has-many.\n\n We call the record to which a relationship belongs-to the\n relationship's _owner_.\n\n @class ManyArray\n @public\n*/\nexport default class RelatedCollection extends RecordArray {\n declare isAsync: boolean;\n /**\n The loading state of this array\n\n @property {Boolean} isLoaded\n @public\n */\n\n declare isLoaded: boolean;\n /**\n `true` if the relationship is polymorphic, `false` otherwise.\n\n @property {Boolean} isPolymorphic\n @private\n */\n declare isPolymorphic: boolean;\n declare _inverseIsAsync: boolean;\n /**\n Metadata associated with the request for async hasMany relationships.\n\n Example\n\n Given that the server returns the following JSON payload when fetching a\n hasMany relationship:\n\n ```js\n {\n \"comments\": [{\n \"id\": 1,\n \"comment\": \"This is the first comment\",\n }, {\n // ...\n }],\n\n \"meta\": {\n \"page\": 1,\n \"total\": 5\n }\n }\n ```\n\n You can then access the meta data via the `meta` property:\n\n ```js\n let comments = await post.comments;\n let meta = comments.meta;\n\n // meta.page => 1\n // meta.total => 5\n ```\n\n @property {Object | null} meta\n @public\n */\n declare meta: Record<string, unknown> | null;\n /**\n * Retrieve the links for this relationship\n *\n @property {Object | null} links\n @public\n */\n declare links: Links | PaginationLinks | null;\n declare identifier: StableRecordIdentifier;\n declare cache: Cache;\n // @ts-expect-error\n declare _manager: LegacySupport;\n declare store: Store;\n declare key: string;\n declare type: ModelSchema;\n\n constructor(options: ManyArrayCreateArgs) {\n super(options as unknown as IdentifierArrayCreateOptions);\n this.isLoaded = options.isLoaded || false;\n this.isAsync = options.isAsync || false;\n this.isPolymorphic = options.isPolymorphic || false;\n this.identifier = options.identifier;\n this.key = options.key;\n }\n\n [MUTATE](\n target: StableRecordIdentifier[],\n receiver: typeof Proxy<StableRecordIdentifier[]>,\n prop: string,\n args: unknown[],\n _SIGNAL: Signal\n ): unknown {\n switch (prop) {\n case 'length 0': {\n Reflect.set(target, 'length', 0);\n mutateReplaceRelatedRecords(this, [], _SIGNAL);\n return true;\n }\n case 'replace cell': {\n const [index, prior, value] = args as [number, StableRecordIdentifier, StableRecordIdentifier];\n target[index] = value;\n mutateReplaceRelatedRecord(this, { value, prior, index }, _SIGNAL);\n return true;\n }\n case 'push': {\n const newValues = extractIdentifiersFromRecords(args);\n\n assertNoDuplicates(\n this,\n target,\n (currentState) => currentState.push(...newValues),\n `Cannot push duplicates to a hasMany's state.`\n );\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n // dedupe\n const seen = new Set(target);\n const unique = new Set<RecordInstance>();\n\n args.forEach((item) => {\n const identifier = recordIdentifierFor(item);\n if (!seen.has(identifier)) {\n seen.add(identifier);\n unique.add(item);\n }\n });\n\n const newArgs = Array.from(unique);\n const result = Reflect.apply(target[prop], receiver, newArgs) as RecordInstance[];\n\n if (newArgs.length) {\n mutateAddToRelatedRecords(this, { value: extractIdentifiersFromRecords(newArgs) }, _SIGNAL);\n }\n return result;\n }\n\n // else, no dedupe, error on duplicates\n const result = Reflect.apply(target[prop], receiver, args) as RecordInstance[];\n if (newValues.length) {\n mutateAddToRelatedRecords(this, { value: newValues }, _SIGNAL);\n }\n return result;\n }\n\n case 'pop': {\n const result: unknown = Reflect.apply(target[prop], receiver, args);\n if (result) {\n mutateRemoveFromRelatedRecords(this, { value: recordIdentifierFor(result as RecordInstance) }, _SIGNAL);\n }\n return result;\n }\n\n case 'unshift': {\n const newValues = extractIdentifiersFromRecords(args);\n\n assertNoDuplicates(\n this,\n target,\n (currentState) => currentState.unshift(...newValues),\n `Cannot unshift duplicates to a hasMany's state.`\n );\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n // dedupe\n const seen = new Set(target);\n const unique = new Set<RecordInstance>();\n\n args.forEach((item) => {\n const identifier = recordIdentifierFor(item);\n if (!seen.has(identifier)) {\n seen.add(identifier);\n unique.add(item);\n }\n });\n\n const newArgs = Array.from(unique);\n const result: unknown = Reflect.apply(target[prop], receiver, newArgs);\n\n if (newArgs.length) {\n mutateAddToRelatedRecords(this, { value: extractIdentifiersFromRecords(newArgs), index: 0 }, _SIGNAL);\n }\n return result;\n }\n\n // else, no dedupe, error on duplicates\n const result = Reflect.apply(target[prop], receiver, args) as RecordInstance[];\n if (newValues.length) {\n mutateAddToRelatedRecords(this, { value: newValues, index: 0 }, _SIGNAL);\n }\n return result;\n }\n\n case 'shift': {\n const result: unknown = Reflect.apply(target[prop], receiver, args);\n\n if (result) {\n mutateRemoveFromRelatedRecords(\n this,\n { value: recordIdentifierFor(result as RecordInstance), index: 0 },\n _SIGNAL\n );\n }\n return result;\n }\n\n case 'sort': {\n const result: unknown = Reflect.apply(target[prop], receiver, args);\n mutateSortRelatedRecords(this, (result as RecordInstance[]).map(recordIdentifierFor), _SIGNAL);\n return result;\n }\n\n case 'splice': {\n const [start, deleteCount, ...adds] = args as [number, number, ...RecordInstance[]];\n\n // detect a full replace\n if (start === 0 && deleteCount === this[SOURCE].length) {\n const newValues = extractIdentifiersFromRecords(adds);\n\n assertNoDuplicates(\n this,\n target,\n (currentState) => currentState.splice(start, deleteCount, ...newValues),\n `Cannot replace a hasMany's state with a new state that contains duplicates.`\n );\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n // dedupe\n const current = new Set(adds);\n const unique = Array.from(current);\n const newArgs = ([start, deleteCount] as unknown[]).concat(unique);\n\n const result = Reflect.apply(target[prop], receiver, newArgs) as RecordInstance[];\n\n mutateReplaceRelatedRecords(this, extractIdentifiersFromRecords(unique), _SIGNAL);\n return result;\n }\n\n // else, no dedupe, error on duplicates\n const result = Reflect.apply(target[prop], receiver, args) as RecordInstance[];\n mutateReplaceRelatedRecords(this, newValues, _SIGNAL);\n return result;\n }\n\n const newValues = extractIdentifiersFromRecords(adds);\n assertNoDuplicates(\n this,\n target,\n (currentState) => currentState.splice(start, deleteCount, ...newValues),\n `Cannot splice a hasMany's state with a new state that contains duplicates.`\n );\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n // dedupe\n const currentState = target.slice();\n currentState.splice(start, deleteCount);\n\n const seen = new Set(currentState);\n const unique: RecordInstance[] = [];\n adds.forEach((item) => {\n const identifier = recordIdentifierFor(item);\n if (!seen.has(identifier)) {\n seen.add(identifier);\n unique.push(item);\n }\n });\n\n const newArgs = [start, deleteCount, ...unique];\n const result = Reflect.apply(target[prop], receiver, newArgs) as RecordInstance[];\n\n if (deleteCount > 0) {\n mutateRemoveFromRelatedRecords(this, { value: result.map(recordIdentifierFor), index: start }, _SIGNAL);\n }\n\n if (unique.length > 0) {\n mutateAddToRelatedRecords(this, { value: extractIdentifiersFromRecords(unique), index: start }, _SIGNAL);\n }\n\n return result;\n }\n\n // else, no dedupe, error on duplicates\n const result = Reflect.apply(target[prop], receiver, args) as RecordInstance[];\n if (deleteCount > 0) {\n mutateRemoveFromRelatedRecords(this, { value: result.map(recordIdentifierFor), index: start }, _SIGNAL);\n }\n if (newValues.length > 0) {\n mutateAddToRelatedRecords(this, { value: newValues, index: start }, _SIGNAL);\n }\n return result;\n }\n default:\n assert(`unable to convert ${prop} into a transaction that updates the cache state for this record array`);\n }\n }\n\n notify() {\n const signal = this[ARRAY_SIGNAL];\n signal.shouldReset = true;\n // @ts-expect-error\n notifyArray(this);\n }\n\n /**\n Reloads all of the records in the manyArray. If the manyArray\n holds a relationship that was originally fetched using a links url\n Ember Data will revisit the original links url to repopulate the\n relationship.\n\n If the manyArray holds the result of a `store.query()` reload will\n re-run the original query.\n\n Example\n\n ```javascript\n let user = store.peekRecord('user', '1')\n await login(user);\n\n let permissions = await user.permissions;\n await permissions.reload();\n ```\n\n @method reload\n @public\n */\n reload(options?: FindOptions) {\n // TODO this is odd, we don't ask the store for anything else like this?\n return this._manager.reloadHasMany(this.key, options);\n }\n\n /**\n Saves all of the records in the `ManyArray`.\n\n Example\n\n ```javascript\n let inbox = await store.findRecord('inbox', '1');\n let messages = await inbox.messages;\n messages.forEach((message) => {\n message.isRead = true;\n });\n messages.save();\n ```\n\n @method save\n @public\n @return {PromiseArray} promise\n */\n\n /**\n Create a child record within the owner\n\n @method createRecord\n @public\n @param {Object} hash\n @return {Model} record\n */\n createRecord(hash: CreateRecordProperties): RecordInstance {\n const { store } = this;\n assert(`Expected modelName to be set`, this.modelName);\n const record = store.createRecord(this.modelName, hash);\n this.push(record);\n\n return record;\n }\n\n override destroy() {\n super.destroy(false);\n }\n}\nRelatedCollection.prototype.isAsync = false;\nRelatedCollection.prototype.isPolymorphic = false;\nRelatedCollection.prototype.identifier = null as unknown as StableRecordIdentifier;\nRelatedCollection.prototype.cache = null as unknown as Cache;\nRelatedCollection.prototype._inverseIsAsync = false;\nRelatedCollection.prototype.key = '';\nRelatedCollection.prototype.DEPRECATED_CLASS_NAME = 'ManyArray';\n\ntype PromiseProxyRecord = { then(): void; content: RecordInstance | null | undefined };\n\nfunction assertRecordPassedToHasMany(record: RecordInstance | PromiseProxyRecord) {\n assert(\n `All elements of a hasMany relationship must be instances of Model, you passed $${typeof record}`,\n (function () {\n try {\n recordIdentifierFor(record);\n return true;\n } catch {\n return false;\n }\n })()\n );\n}\n\nfunction extractIdentifiersFromRecords(records: RecordInstance[]): StableRecordIdentifier[] {\n return records.map(extractIdentifierFromRecord);\n}\n\nfunction extractIdentifierFromRecord(recordOrPromiseRecord: PromiseProxyRecord | RecordInstance) {\n assertRecordPassedToHasMany(recordOrPromiseRecord);\n return recordIdentifierFor(recordOrPromiseRecord);\n}\n\nfunction assertNoDuplicates(\n collection: RelatedCollection,\n target: StableRecordIdentifier[],\n callback: (currentState: StableRecordIdentifier[]) => void,\n reason: string\n) {\n const state = target.slice();\n callback(state);\n\n if (state.length !== new Set(state).size) {\n const duplicates = state.filter((currentValue, currentIndex) => state.indexOf(currentValue) !== currentIndex);\n\n if (DEPRECATE_MANY_ARRAY_DUPLICATES) {\n deprecate(\n `${reason} This behavior is deprecated. Found duplicates for the following records within the new state provided to \\`<${\n collection.identifier.type\n }:${collection.identifier.id || collection.identifier.lid}>.${collection.key}\\`\\n\\t- ${Array.from(\n new Set(duplicates)\n )\n .map((r) => (isStableIdentifier(r) ? r.lid : recordIdentifierFor(r).lid))\n .sort((a, b) => a.localeCompare(b))\n .join('\\n\\t- ')}`,\n false,\n {\n id: 'ember-data:deprecate-many-array-duplicates',\n for: 'ember-data',\n until: '6.0',\n since: {\n enabled: '5.3',\n available: '5.3',\n },\n }\n );\n } else {\n throw new Error(\n `${reason} Found duplicates for the following records within the new state provided to \\`<${\n collection.identifier.type\n }:${collection.identifier.id || collection.identifier.lid}>.${collection.key}\\`\\n\\t- ${Array.from(\n new Set(duplicates)\n )\n .map((r) => (isStableIdentifier(r) ? r.lid : recordIdentifierFor(r).lid))\n .sort((a, b) => a.localeCompare(b))\n .join('\\n\\t- ')}`\n );\n }\n }\n}\n\nfunction mutateAddToRelatedRecords(\n collection: RelatedCollection,\n operationInfo: { value: StableRecordIdentifier | StableRecordIdentifier[]; index?: number },\n _SIGNAL: Signal\n) {\n mutate(\n collection,\n {\n op: 'addToRelatedRecords',\n record: collection.identifier,\n field: collection.key,\n ...operationInfo,\n },\n _SIGNAL\n );\n}\n\nfunction mutateRemoveFromRelatedRecords(\n collection: RelatedCollection,\n operationInfo: { value: StableRecordIdentifier | StableRecordIdentifier[]; index?: number },\n _SIGNAL: Signal\n) {\n mutate(\n collection,\n {\n op: 'removeFromRelatedRecords',\n record: collection.identifier,\n field: collection.key,\n ...operationInfo,\n },\n _SIGNAL\n );\n}\n\nfunction mutateReplaceRelatedRecord(\n collection: RelatedCollection,\n operationInfo: {\n value: StableRecordIdentifier;\n prior: StableRecordIdentifier;\n index: number;\n },\n _SIGNAL: Signal\n) {\n mutate(\n collection,\n {\n op: 'replaceRelatedRecord',\n record: collection.identifier,\n field: collection.key,\n ...operationInfo,\n },\n _SIGNAL\n );\n}\n\nfunction mutateReplaceRelatedRecords(collection: RelatedCollection, value: StableRecordIdentifier[], _SIGNAL: Signal) {\n mutate(\n collection,\n {\n op: 'replaceRelatedRecords',\n record: collection.identifier,\n field: collection.key,\n value,\n },\n _SIGNAL\n );\n}\n\nfunction mutateSortRelatedRecords(collection: RelatedCollection, value: StableRecordIdentifier[], _SIGNAL: Signal) {\n mutate(\n collection,\n {\n op: 'sortRelatedRecords',\n record: collection.identifier,\n field: collection.key,\n value,\n },\n _SIGNAL\n );\n}\n\nfunction mutate(collection: RelatedCollection, mutation: Parameters<LegacySupport['mutate']>[0], _SIGNAL: Signal) {\n collection._manager.mutate(mutation);\n addToTransaction(_SIGNAL);\n}\n","export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n return desc;\n}","import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\nimport ObjectProxy from '@ember/object/proxy';\n\nexport const PromiseObject = ObjectProxy.extend(PromiseProxyMixin);\n","import { assert } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport type PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\nimport type ObjectProxy from '@ember/object/proxy';\n\nimport type Store from '@ember-data/store';\nimport type { RecordInstance } from '@ember-data/store/-types/q/record-instance';\nimport { cached } from '@ember-data/tracking';\n\nimport type { LegacySupport } from './legacy-relationships-support';\nimport { PromiseObject } from './promise-proxy-base';\nimport type BelongsToReference from './references/belongs-to';\n\nexport interface BelongsToProxyMeta {\n key: string;\n store: Store;\n legacySupport: LegacySupport;\n modelName: string;\n}\nexport interface BelongsToProxyCreateArgs {\n promise: Promise<RecordInstance | null>;\n content?: RecordInstance | null;\n _belongsToState: BelongsToProxyMeta;\n}\n\ninterface PromiseObjectType<T> extends PromiseProxyMixin<T | null>, ObjectProxy<T> {\n // eslint-disable-next-line @typescript-eslint/no-misused-new\n new <PT>(...args: unknown[]): PromiseObjectType<PT>;\n}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare class PromiseObjectType<T> {}\n\nconst Extended: PromiseObjectType<RecordInstance> = PromiseObject as unknown as PromiseObjectType<RecordInstance>;\n\n/**\n @module @ember-data/model\n */\n\n/**\n A PromiseBelongsTo is a PromiseObject that also proxies certain method calls\n to the underlying belongsTo model.\n Right now we proxy:\n * `reload()`\n @class PromiseBelongsTo\n @extends PromiseObject\n @private\n*/\nclass PromiseBelongsTo extends Extended<RecordInstance> {\n declare _belongsToState: BelongsToProxyMeta;\n\n @cached\n get id() {\n const { key, legacySupport } = this._belongsToState;\n const ref = legacySupport.referenceFor('belongsTo', key) as BelongsToReference;\n\n return ref.id();\n }\n\n // we don't proxy meta because we would need to proxy it to the relationship state container\n // however, meta on relationships does not trigger change notifications.\n // if you need relationship meta, you should do `record.belongsTo(relationshipName).meta()`\n @computed()\n get meta() {\n // eslint-disable-next-line no-constant-condition\n if (1) {\n assert(\n 'You attempted to access meta on the promise for the async belongsTo relationship ' +\n `${this._belongsToState.modelName}:${this._belongsToState.key}'.` +\n '\\nUse `record.belongsTo(relationshipName).meta()` instead.',\n false\n );\n }\n return;\n }\n\n async reload(options: Record<string, unknown>): Promise<this> {\n assert('You are trying to reload an async belongsTo before it has been created', this.content !== undefined);\n const { key, legacySupport } = this._belongsToState;\n await legacySupport.reloadBelongsTo(key, options);\n return this;\n }\n}\n\nexport default PromiseBelongsTo;\n","import { assert } from '@ember/debug';\n\nimport { DEPRECATE_COMPUTED_CHAINS } from '@ember-data/deprecations';\nimport type { FindOptions } from '@ember-data/store/-types/q/store';\nimport { compat } from '@ember-data/tracking';\nimport { defineSignal } from '@ember-data/tracking/-private';\n\nimport type ManyArray from './many-array';\n\nexport interface HasManyProxyCreateArgs {\n promise: Promise<ManyArray>;\n content?: ManyArray;\n}\n\n/**\n @module @ember-data/model\n */\n/**\n This class is returned as the result of accessing an async hasMany relationship\n on an instance of a Model extending from `@ember-data/model`.\n\n A PromiseManyArray is an iterable proxy that allows templates to consume related\n ManyArrays and update once their contents are no longer pending.\n\n In your JS code you should resolve the promise first.\n\n ```js\n const comments = await post.comments;\n ```\n\n @class PromiseManyArray\n @public\n*/\nexport default class PromiseManyArray {\n declare promise: Promise<ManyArray> | null;\n declare isDestroyed: boolean;\n\n constructor(promise: Promise<ManyArray>, content?: ManyArray) {\n this._update(promise, content);\n this.isDestroyed = false;\n }\n\n //---- Methods/Properties on ArrayProxy that we will keep as our API\n\n declare content: ManyArray | null;\n\n /**\n * Retrieve the length of the content\n * @property length\n * @public\n */\n @compat\n get length(): number {\n // shouldn't be needed, but ends up being needed\n // for computed chains even in 4.x\n if (DEPRECATE_COMPUTED_CHAINS) {\n this['[]'];\n }\n return this.content ? this.content.length : 0;\n }\n\n /**\n * Iterate the proxied content. Called by the glimmer iterator in #each\n * We do not guarantee that forEach will always be available. This\n * may eventually be made to use Symbol.Iterator once glimmer supports it.\n *\n * @method forEach\n * @param cb\n * @return\n * @private\n */\n forEach(cb: Parameters<typeof Array.prototype.forEach>[0]) {\n if (this.content && this.length) {\n this.content.forEach(cb);\n }\n }\n\n /**\n * Reload the relationship\n * @method reload\n * @public\n * @param options\n * @return\n */\n reload(options: FindOptions) {\n assert('You are trying to reload an async manyArray before it has been created', this.content);\n void this.content.reload(options);\n return this;\n }\n\n //---- Properties/Methods from the PromiseProxyMixin that we will keep as our API\n\n /**\n * Whether the loading promise is still pending\n *\n * @property {boolean} isPending\n * @public\n */\n declare isPending: boolean;\n /**\n * Whether the loading promise rejected\n *\n * @property {boolean} isRejected\n * @public\n */\n declare isRejected: boolean;\n /**\n * Whether the loading promise succeeded\n *\n * @property {boolean} isFulfilled\n * @public\n */\n declare isFulfilled: boolean;\n /**\n * Whether the loading promise completed (resolved or rejected)\n *\n * @property {boolean} isSettled\n * @public\n */\n declare isSettled: boolean;\n\n /**\n * chain this promise\n *\n * @method then\n * @public\n * @param success\n * @param fail\n * @return Promise\n */\n then(s: Parameters<typeof Promise.prototype.then>[0], f: Parameters<typeof Promise.prototype.then>[1]) {\n return this.promise!.then(s, f);\n }\n\n /**\n * catch errors thrown by this promise\n * @method catch\n * @public\n * @param callback\n * @return Promise\n */\n catch(cb: Parameters<typeof Promise.prototype.catch>[0]) {\n return this.promise!.catch(cb);\n }\n\n /**\n * run cleanup after this promise completes\n *\n * @method finally\n * @public\n * @param callback\n * @return Promise\n */\n finally(cb: Parameters<typeof Promise.prototype.finally>[0]) {\n return this.promise!.finally(cb);\n }\n\n //---- Methods on EmberObject that we should keep\n\n destroy() {\n this.isDestroyed = true;\n this.content = null;\n this.promise = null;\n }\n\n //---- Methods/Properties on ManyArray that we own and proxy to\n\n /**\n * Retrieve the links for this relationship\n * @property links\n * @public\n */\n @compat\n get links() {\n return this.content ? this.content.links : undefined;\n }\n\n /**\n * Retrieve the meta for this relationship\n * @property meta\n * @public\n */\n @compat\n get meta() {\n return this.content ? this.content.meta : undefined;\n }\n\n //---- Our own stuff\n\n _update(promise: Promise<ManyArray>, content?: ManyArray) {\n if (content !== undefined) {\n this.content = content;\n }\n\n this.promise = tapPromise(this, promise);\n }\n\n static create({ promise, content }: HasManyProxyCreateArgs): PromiseManyArray {\n return new this(promise, content);\n }\n}\ndefineSignal(PromiseManyArray.prototype, 'content', null);\ndefineSignal(PromiseManyArray.prototype, 'isPending', false);\ndefineSignal(PromiseManyArray.prototype, 'isRejected', false);\ndefineSignal(PromiseManyArray.prototype, 'isFulfilled', false);\ndefineSignal(PromiseManyArray.prototype, 'isSettled', false);\n\n// this will error if someone tries to call\n// A(identifierArray) since it is not configurable\n// which is preferrable to the `meta` override we used\n// before which required importing all of Ember\nif (DEPRECATE_COMPUTED_CHAINS) {\n const desc = {\n enumerable: true,\n configurable: false,\n get: function (this: PromiseManyArray) {\n return this.content?.length && this.content;\n },\n };\n compat(desc);\n\n // ember-source < 3.23 (e.g. 3.20 lts)\n // requires that the tag `'[]'` be notified\n // on the ArrayProxy in order for `{{#each}}`\n // to recompute. We entangle the '[]' tag from content\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Object.defineProperty(PromiseManyArray.prototype, '[]', desc);\n}\n\nfunction tapPromise(proxy: PromiseManyArray, promise: Promise<ManyArray>) {\n proxy.isPending = true;\n proxy.isSettled = false;\n proxy.isFulfilled = false;\n proxy.isRejected = false;\n return Promise.resolve(promise).then(\n (content) => {\n proxy.isPending = false;\n proxy.isFulfilled = true;\n proxy.isSettled = true;\n proxy.content = content;\n return content;\n },\n (error) => {\n proxy.isPending = false;\n proxy.isFulfilled = false;\n proxy.isRejected = true;\n proxy.isSettled = true;\n throw error;\n }\n );\n}\n","import { assert } from '@ember/debug';\nimport { DEBUG } from '@ember-data/env';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type Store from '@ember-data/store';\nimport type { UpgradedMeta } from '@ember-data/graph/-private/-edge-definition';\n\n/*\n Assert that `addedRecord` has a valid type so it can be added to the\n relationship of the `record`.\n\n The assert basically checks if the `addedRecord` can be added to the\n relationship (specified via `relationshipMeta`) of the `record`.\n\n This utility should only be used internally, as both record parameters must\n be stable record identifiers and the `relationshipMeta` needs to be the meta\n information about the relationship, retrieved via\n `record.relationshipFor(key)`.\n*/\nlet assertPolymorphicType: (\n parentIdentifier: StableRecordIdentifier,\n parentDefinition: UpgradedMeta,\n addedIdentifier: StableRecordIdentifier,\n store: Store\n) => void;\n\nif (DEBUG) {\n assertPolymorphicType = function assertPolymorphicType(\n parentIdentifier: StableRecordIdentifier,\n parentDefinition: UpgradedMeta,\n addedIdentifier: StableRecordIdentifier,\n store: Store\n ) {\n if (parentDefinition.inverseIsImplicit) {\n return;\n }\n if (parentDefinition.isPolymorphic) {\n let meta = store.getSchemaDefinitionService().relationshipsDefinitionFor(addedIdentifier)[\n parentDefinition.inverseKey\n ];\n assert(\n `The schema for the relationship '${parentDefinition.inverseKey}' on '${addedIdentifier.type}' type does not implement '${parentDefinition.type}' and thus cannot be assigned to the '${parentDefinition.key}' relationship in '${parentIdentifier.type}'. The definition should specify 'as: \"${parentDefinition.type}\"' in options.`,\n meta?.options.as === parentDefinition.type\n );\n }\n };\n}\n\nexport { assertPolymorphicType };\n","import { assert } from '@ember/debug';\n\nimport { DEBUG } from '@ember-data/env';\nimport type { CollectionEdge } from '@ember-data/graph/-private/edges/collection';\nimport type { Graph } from '@ember-data/graph/-private/graph';\nimport type Store from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type { FindOptions } from '@ember-data/store/-types/q/store';\nimport { cached, compat } from '@ember-data/tracking';\nimport { defineSignal } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { CollectionRelationship } from '@warp-drive/core-types/cache/relationship';\nimport type {\n CollectionResourceDocument,\n CollectionResourceRelationship,\n ExistingResourceObject,\n LinkObject,\n Meta,\n PaginationLinks,\n} from '@warp-drive/core-types/spec/raw';\n\nimport { assertPolymorphicType } from '../debug/assert-polymorphic-type';\nimport type { LegacySupport } from '../legacy-relationships-support';\nimport { areAllInverseRecordsLoaded, LEGACY_SUPPORT } from '../legacy-relationships-support';\nimport type ManyArray from '../many-array';\n\n/**\n @module @ember-data/model\n*/\ninterface ResourceIdentifier {\n links?: {\n related?: string | LinkObject;\n };\n meta?: Meta;\n}\n\nfunction isResourceIdentiferWithRelatedLinks(\n value: CollectionResourceRelationship | ResourceIdentifier | null\n): value is ResourceIdentifier & { links: { related: string | LinkObject | null } } {\n return Boolean(value && value.links && value.links.related);\n}\n/**\n A `HasManyReference` is a low-level API that allows access\n and manipulation of a hasMany relationship.\n\n It is especially useful when you're dealing with `async` relationships\n from `@ember-data/model` as it allows synchronous access to\n the relationship data if loaded, as well as APIs for loading, reloading\n the data or accessing available information without triggering a load.\n\n It may also be useful when using `sync` relationships with `@ember-data/model`\n that need to be loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @class HasManyReference\n @public\n */\nexport default class HasManyReference {\n declare graph: Graph;\n declare store: Store;\n declare hasManyRelationship: CollectionEdge;\n /**\n * The field name on the parent record for this has-many relationship.\n *\n * @property {String} key\n * @public\n */\n declare key: string;\n\n /**\n * The type of resource this relationship will contain.\n *\n * @property {String} type\n * @public\n */\n declare type: string;\n\n // unsubscribe tokens given to us by the notification manager\n ___token!: object;\n ___identifier: StableRecordIdentifier;\n ___relatedTokenMap!: Map<StableRecordIdentifier, object>;\n\n declare _ref: number;\n\n constructor(\n store: Store,\n graph: Graph,\n parentIdentifier: StableRecordIdentifier,\n hasManyRelationship: CollectionEdge,\n key: string\n ) {\n this.graph = graph;\n this.key = key;\n this.hasManyRelationship = hasManyRelationship;\n this.type = hasManyRelationship.definition.type;\n\n this.store = store;\n this.___identifier = parentIdentifier;\n this.___token = store.notifications.subscribe(\n parentIdentifier,\n (_: StableRecordIdentifier, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'relationships' && notifiedKey === key) {\n this._ref++;\n }\n }\n );\n this.___relatedTokenMap = new Map();\n // TODO inverse\n }\n\n /**\n * This method should never be called by user code.\n *\n * @internal\n */\n destroy() {\n this.store.notifications.unsubscribe(this.___token);\n this.___relatedTokenMap.forEach((token) => {\n this.store.notifications.unsubscribe(token);\n });\n this.___relatedTokenMap.clear();\n }\n\n /**\n * An array of identifiers for the records that this reference refers to.\n *\n * @property {StableRecordIdentifier[]} identifiers\n * @public\n */\n @cached\n @compat\n get identifiers(): StableRecordIdentifier[] {\n this._ref; // consume the tracked prop\n\n const resource = this._resource();\n\n const map = this.___relatedTokenMap;\n this.___relatedTokenMap = new Map();\n\n if (resource && resource.data) {\n return resource.data.map((resourceIdentifier) => {\n const identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resourceIdentifier);\n let token = map.get(identifier);\n\n if (token) {\n map.delete(identifier);\n } else {\n token = this.store.notifications.subscribe(\n identifier,\n (_: StableRecordIdentifier, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'identity' || (bucket === 'attributes' && notifiedKey === 'id')) {\n this._ref++;\n }\n }\n );\n }\n this.___relatedTokenMap.set(identifier, token);\n\n return identifier;\n });\n }\n\n map.forEach((token) => {\n this.store.notifications.unsubscribe(token);\n });\n map.clear();\n\n return [];\n }\n\n _resource() {\n const cache = this.store.cache;\n return cache.getRelationship(this.___identifier, this.key) as CollectionResourceRelationship;\n }\n\n /**\n This returns a string that represents how the reference will be\n looked up when it is loaded. If the relationship has a link it will\n use the \"link\" otherwise it defaults to \"id\".\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n // get the identifier of the reference\n if (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n } else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n }\n ```\n\n @method remoteType\n @public\n @return {String} The name of the remote type. This should either be `link` or `ids`\n */\n remoteType(): 'link' | 'ids' {\n const value = this._resource();\n if (value && value.links && value.links.related) {\n return 'link';\n }\n\n return 'ids';\n }\n\n /**\n `ids()` returns an array of the record IDs in this relationship.\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n commentsRef.ids(); // ['1']\n ```\n\n @method ids\n @public\n @return {Array} The ids in this has-many relationship\n */\n ids(): Array<string | null> {\n return this.identifiers.map((identifier) => identifier.id);\n }\n\n /**\n The link Ember Data will use to fetch or reload this belongs-to\n relationship. By default it uses only the \"related\" resource linkage.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: '/articles/1/author'\n }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n // get the identifier of the reference\n if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n ```\n\n @method link\n @public\n @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.\n */\n link(): string | null {\n const resource = this._resource();\n\n if (isResourceIdentiferWithRelatedLinks(resource)) {\n if (resource.links) {\n const related = resource.links.related;\n return !related || typeof related === 'string' ? related : related.href;\n }\n }\n return null;\n }\n\n /**\n * any links that have been received for this relationship\n *\n * @method links\n * @public\n * @return\n */\n links(): PaginationLinks | null {\n const resource = this._resource();\n\n return resource && resource.links ? resource.links : null;\n }\n\n /**\n The meta data for the has-many relationship.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { hasMany } from '@ember-data/model';\n export default Model.extend({\n users: hasMany('user', { async: true, inverse: null })\n });\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n users: {\n links: {\n related: {\n href: '/articles/1/authors'\n },\n },\n meta: {\n lastUpdated: 1458014400000\n }\n }\n }\n }\n });\n\n let usersRef = blog.hasMany('user');\n\n usersRef.meta() // { lastUpdated: 1458014400000 }\n ```\n\n @method meta\n @public\n @return {Object|null} The meta information for the belongs-to relationship.\n */\n meta(): Meta | null {\n let meta: Meta | null = null;\n const resource = this._resource();\n if (resource && resource.meta && typeof resource.meta === 'object') {\n meta = resource.meta;\n }\n return meta;\n }\n\n /**\n `push` can be used to update the data in the relationship and EmberData\n will treat the new data as the canonical value of this relationship on\n the backend. An empty array will signify the canonical value should be\n empty.\n\n Example model\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n Setup some initial state, note we haven't loaded the comments yet:\n\n ```js\n const post = store.push({\n data: {\n type: 'post',\n id: '1',\n relationships: {\n comments: {\n data: [{ type: 'comment', id: '1' }]\n }\n }\n }\n });\n\n const commentsRef = post.hasMany('comments');\n commentsRef.ids(); // ['1']\n ```\n\n Update the state using `push`, note we can do this even without\n having loaded these comments yet by providing resource identifiers.\n\n Both full resources and resource identifiers are supported.\n\n ```js\n await commentsRef.push({\n data: [\n { type: 'comment', id: '2' },\n { type: 'comment', id: '3' },\n ]\n });\n\n commentsRef.ids(); // ['2', '3']\n ```\n\n For convenience, you can also pass in an array of resources or resource identifiers\n without wrapping them in the `data` property:\n\n ```js\n await commentsRef.push([\n { type: 'comment', id: '4' },\n { type: 'comment', id: '5' },\n ]);\n\n commentsRef.ids(); // ['4', '5']\n ```\n\n When using the `data` property, you may also include other resource data via included,\n as well as provide new links and meta to the relationship.\n\n ```js\n await commentsRef.push({\n links: {\n related: '/posts/1/comments'\n },\n meta: {\n total: 2\n },\n data: [\n { type: 'comment', id: '4' },\n { type: 'comment', id: '5' },\n ],\n included: [\n { type: 'other-thing', id: '1', attributes: { foo: 'bar' },\n ]\n });\n ```\n\n By default, the store will attempt to fetch any unloaded records before resolving\n the returned promise with the ManyArray.\n\n Alternatively, pass `true` as the second argument to avoid fetching unloaded records\n and instead the promise will resolve with void without attempting to fetch. This is\n particularly useful if you want to update the state of the relationship without\n forcing the load of all of the associated records.\n\n @method push\n @public\n @param {Array|Object} doc a JSONAPI document object describing the new value of this relationship.\n @param {Boolean} [skipFetch] if `true`, do not attempt to fetch unloaded records\n @return {Promise<ManyArray | void>}\n */\n async push(\n doc: ExistingResourceObject[] | CollectionResourceDocument,\n skipFetch?: boolean\n ): Promise<ManyArray | void> {\n const { store } = this;\n const dataDoc = Array.isArray(doc) ? { data: doc } : doc;\n const isResourceData = Array.isArray(dataDoc.data) && dataDoc.data.length > 0 && isMaybeResource(dataDoc.data[0]);\n\n // enforce that one of links, meta or data is present\n assert(\n `You must provide at least one of 'links', 'meta' or 'data' when calling hasManyReference.push`,\n 'links' in dataDoc || 'meta' in dataDoc || 'data' in dataDoc\n );\n\n const identifiers = !Array.isArray(dataDoc.data)\n ? []\n : isResourceData\n ? (store._push(dataDoc, true) as StableRecordIdentifier[])\n : dataDoc.data.map((i) => store.identifierCache.getOrCreateRecordIdentifier(i));\n const { identifier } = this.hasManyRelationship;\n\n if (DEBUG) {\n const relationshipMeta = this.hasManyRelationship.definition;\n\n identifiers.forEach((added) => {\n assertPolymorphicType(identifier, relationshipMeta, added, store);\n });\n }\n\n const newData: CollectionResourceRelationship = {};\n // only set data if it was passed in\n if (Array.isArray(dataDoc.data)) {\n newData.data = identifiers;\n }\n if ('links' in dataDoc) {\n newData.links = dataDoc.links;\n }\n if ('meta' in dataDoc) {\n newData.meta = dataDoc.meta;\n }\n store._join(() => {\n this.graph.push({\n op: 'updateRelationship',\n record: identifier,\n field: this.key,\n value: newData,\n });\n });\n\n if (!skipFetch) return this.load();\n }\n\n _isLoaded() {\n const hasRelationshipDataProperty = this.hasManyRelationship.state.hasReceivedData;\n if (!hasRelationshipDataProperty) {\n return false;\n }\n\n const relationship = this.graph.getData(this.hasManyRelationship.identifier, this.key) as CollectionRelationship;\n\n return relationship.data?.every((identifier) => {\n return this.store._instanceCache.recordIsLoaded(identifier, true) === true;\n });\n }\n\n /**\n `value()` synchronously returns the current value of the has-many\n relationship. Unlike `record.relationshipName`, calling\n `value()` on a reference does not trigger a fetch if the async\n relationship is not yet loaded. If the relationship is not loaded\n it will always return `null`.\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n post.comments.then(function(comments) {\n commentsRef.value() === comments\n })\n ```\n\n @method value\n @public\n @return {ManyArray}\n */\n value(): ManyArray | null {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n\n const loaded = this._isLoaded();\n\n if (!loaded) {\n // subscribe to changes\n // for when we are not loaded yet\n this._ref;\n return null;\n }\n\n return support.getManyArray(this.key);\n }\n\n /**\n Loads the relationship if it is not already loaded. If the\n relationship is already loaded this method does not trigger a new\n load. This causes a request to the specified\n relationship link or reloads all items currently in the relationship.\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n commentsRef.load().then(function(comments) {\n //...\n });\n ```\n\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference.\n\n Example\n\n ```javascript\n commentsRef.load({ adapterOptions: { isPrivate: true } })\n .then(function(comments) {\n //...\n });\n ```\n\n ```app/adapters/comment.js\n export default ApplicationAdapter.extend({\n findMany(store, type, id, snapshots) {\n // In the adapter you will have access to adapterOptions.\n let adapterOptions = snapshots[0].adapterOptions;\n }\n });\n ```\n\n @method load\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the ManyArray in\n this has-many relationship.\n */\n async load(options?: FindOptions): Promise<ManyArray> {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n const fetchSyncRel =\n !this.hasManyRelationship.definition.isAsync && !areAllInverseRecordsLoaded(this.store, this._resource());\n return fetchSyncRel\n ? (support.reloadHasMany(this.key, options) as Promise<ManyArray>)\n : // we cast to fix the return type since typescript and eslint don't understand async functions\n // properly\n (support.getHasMany(this.key, options) as Promise<ManyArray> | ManyArray);\n }\n\n /**\n Reloads this has-many relationship. This causes a request to the specified\n relationship link or reloads all items currently in the relationship.\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n commentsRef.reload().then(function(comments) {\n //...\n });\n ```\n\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference. A full example\n can be found in the `load` method.\n\n Example\n\n ```javascript\n commentsRef.reload({ adapterOptions: { isPrivate: true } })\n ```\n\n @method reload\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the ManyArray in this has-many relationship.\n */\n reload(options?: FindOptions) {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n return support.reloadHasMany(this.key, options);\n }\n}\ndefineSignal(HasManyReference.prototype, '_ref', 0);\n\nexport function isMaybeResource(object: ExistingResourceObject | ResourceIdentifier): object is ExistingResourceObject {\n const keys = Object.keys(object).filter((k) => k !== 'id' && k !== 'type' && k !== 'lid');\n return keys.length > 0;\n}\n","import { DEBUG } from '@ember-data/env';\nimport type { ResourceEdge } from '@ember-data/graph/-private/edges/resource';\nimport type { Graph } from '@ember-data/graph/-private/graph';\nimport type Store from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type { RecordInstance } from '@ember-data/store/-types/q/record-instance';\nimport { cached, compat } from '@ember-data/tracking';\nimport { defineSignal } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { StableExistingRecordIdentifier } from '@warp-drive/core-types/identifier';\nimport type {\n LinkObject,\n Links,\n Meta,\n SingleResourceDocument,\n SingleResourceRelationship,\n} from '@warp-drive/core-types/spec/raw';\n\nimport { assertPolymorphicType } from '../debug/assert-polymorphic-type';\nimport type { LegacySupport } from '../legacy-relationships-support';\nimport { areAllInverseRecordsLoaded, LEGACY_SUPPORT } from '../legacy-relationships-support';\nimport { isMaybeResource } from './has-many';\n\n/**\n @module @ember-data/model\n*/\n\ninterface ResourceIdentifier {\n links?: {\n related?: string | LinkObject;\n };\n meta?: Meta;\n}\n\nfunction isResourceIdentiferWithRelatedLinks(\n value: SingleResourceRelationship | ResourceIdentifier | null\n): value is ResourceIdentifier & { links: { related: string | LinkObject | null } } {\n return Boolean(value && value.links && value.links.related);\n}\n\n/**\n A `BelongsToReference` is a low-level API that allows access\n and manipulation of a belongsTo relationship.\n\n It is especially useful when you're dealing with `async` relationships\n from `@ember-data/model` as it allows synchronous access to\n the relationship data if loaded, as well as APIs for loading, reloading\n the data or accessing available information without triggering a load.\n\n It may also be useful when using `sync` relationships with `@ember-data/model`\n that need to be loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @class BelongsToReference\n @public\n */\nexport default class BelongsToReference {\n declare graph: Graph;\n declare store: Store;\n declare belongsToRelationship: ResourceEdge;\n /**\n * The field name on the parent record for this has-many relationship.\n *\n * @property {String} key\n * @public\n */\n declare key: string;\n\n /**\n * The type of resource this relationship will contain.\n *\n * @property {String} type\n * @public\n */\n declare type: string;\n\n // unsubscribe tokens given to us by the notification manager\n declare ___token: object;\n declare ___identifier: StableRecordIdentifier;\n declare ___relatedToken: object | null;\n\n declare _ref: number;\n\n constructor(\n store: Store,\n graph: Graph,\n parentIdentifier: StableRecordIdentifier,\n belongsToRelationship: ResourceEdge,\n key: string\n ) {\n this.graph = graph;\n this.key = key;\n this.belongsToRelationship = belongsToRelationship;\n this.type = belongsToRelationship.definition.type;\n this.store = store;\n this.___identifier = parentIdentifier;\n this.___relatedToken = null;\n\n this.___token = store.notifications.subscribe(\n parentIdentifier,\n (_: StableRecordIdentifier, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'relationships' && notifiedKey === key) {\n this._ref++;\n }\n }\n );\n\n // TODO inverse\n }\n\n destroy() {\n // TODO @feature we need the notification manager often enough\n // we should potentially just expose it fully public\n this.store.notifications.unsubscribe(this.___token);\n this.___token = null as unknown as object;\n if (this.___relatedToken) {\n this.store.notifications.unsubscribe(this.___relatedToken);\n this.___relatedToken = null;\n }\n }\n\n /**\n * The identifier of the record that this reference refers to.\n * `null` if no related record is known.\n *\n * @property {StableRecordIdentifier | null} identifier\n * @public\n */\n @cached\n @compat\n get identifier(): StableRecordIdentifier | null {\n if (this.___relatedToken) {\n this.store.notifications.unsubscribe(this.___relatedToken);\n this.___relatedToken = null;\n }\n\n const resource = this._resource();\n if (resource && resource.data) {\n const identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resource.data);\n this.___relatedToken = this.store.notifications.subscribe(\n identifier,\n (_: StableRecordIdentifier, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'identity' || (bucket === 'attributes' && notifiedKey === 'id')) {\n this._ref++;\n }\n }\n );\n\n return identifier;\n }\n\n return null;\n }\n\n /**\n The `id` of the record that this reference refers to. Together, the\n `type()` and `id()` methods form a composite key for the identity\n map. This can be used to access the id of an async relationship\n without triggering a fetch that would normally happen if you\n attempted to use `record.relationship.id`.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n // get the identifier of the reference\n if (userRef.remoteType() === \"id\") {\n let id = userRef.id();\n }\n ```\n\n @method id\n @public\n @return {String} The id of the record in this belongsTo relationship.\n */\n id(): string | null {\n return this.identifier?.id || null;\n }\n\n /**\n The link Ember Data will use to fetch or reload this belongs-to\n relationship. By default it uses only the \"related\" resource linkage.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: '/articles/1/author'\n }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n // get the identifier of the reference\n if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n ```\n\n @method link\n @public\n @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.\n */\n link(): string | null {\n const resource = this._resource();\n\n if (isResourceIdentiferWithRelatedLinks(resource)) {\n if (resource.links) {\n const related = resource.links.related;\n return !related || typeof related === 'string' ? related : related.href;\n }\n }\n return null;\n }\n\n /**\n * any links that have been received for this relationship\n *\n * @method links\n * @public\n * @return\n */\n links(): Links | null {\n const resource = this._resource();\n\n return resource && resource.links ? resource.links : null;\n }\n\n /**\n The meta data for the belongs-to relationship.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: {\n href: '/articles/1/author'\n },\n },\n meta: {\n lastUpdated: 1458014400000\n }\n }\n }\n }\n });\n\n let userRef = blog.belongsTo('user');\n\n userRef.meta() // { lastUpdated: 1458014400000 }\n ```\n\n @method meta\n @public\n @return {Object} The meta information for the belongs-to relationship.\n */\n meta(): Meta | null {\n let meta: Meta | null = null;\n const resource = this._resource();\n if (resource && resource.meta && typeof resource.meta === 'object') {\n meta = resource.meta;\n }\n return meta;\n }\n\n _resource() {\n this._ref; // subscribe\n const cache = this.store.cache;\n return cache.getRelationship(this.___identifier, this.key) as SingleResourceRelationship;\n }\n\n /**\n This returns a string that represents how the reference will be\n looked up when it is loaded. If the relationship has a link it will\n use the \"link\" otherwise it defaults to \"id\".\n\n Example\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n\n let commentsRef = post.hasMany('comments');\n\n // get the identifier of the reference\n if (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n } else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n }\n ```\n\n @method remoteType\n @public\n @return {String} The name of the remote type. This should either be `link` or `id`\n */\n remoteType(): 'link' | 'id' {\n const value = this._resource();\n if (isResourceIdentiferWithRelatedLinks(value)) {\n return 'link';\n }\n return 'id';\n }\n\n /**\n `push` can be used to update the data in the relationship and EmberData\n will treat the new data as the canonical value of this relationship on\n the backend. A value of `null` (e.g. `{ data: null }`) can be passed to\n clear the relationship.\n\n Example model\n\n ```app/models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n ```\n\n Setup some initial state, note we haven't loaded the user yet:\n\n ```js\n const blog = store.push({\n data: {\n type: 'blog',\n id: '1',\n relationships: {\n user: {\n data: { type: 'user', id: '1' }\n }\n }\n }\n });\n\n const userRef = blog.belongsTo('user');\n userRef.id(); // '1'\n ```\n\n Update the state using `push`, note we can do this even without\n having loaded the user yet by providing a resource-identifier.\n\n Both full a resource and a resource-identifier are supported.\n\n ```js\n await userRef.push({\n data: {\n type: 'user',\n id: '2',\n }\n });\n\n userRef.id(); // '2'\n ```\n\n You may also pass in links and meta fore the relationship, and sideload\n additional resources that might be required.\n\n ```js\n await userRef.push({\n data: {\n type: 'user',\n id: '2',\n },\n links: {\n related: '/articles/1/author'\n },\n meta: {\n lastUpdated: Date.now()\n },\n included: [\n {\n type: 'user-preview',\n id: '2',\n attributes: {\n username: '@runspired'\n }\n }\n ]\n });\n ```\n\n By default, the store will attempt to fetch the record if it is not loaded or its\n resource data is not included in the call to `push` before resolving the returned\n promise with the new state..\n\n Alternatively, pass `true` as the second argument to avoid fetching unloaded records\n and instead the promise will resolve with void without attempting to fetch. This is\n particularly useful if you want to update the state of the relationship without\n forcing the load of all of the associated record.\n\n @method push\n @public\n @param {Object} doc a JSONAPI document object describing the new value of this relationship.\n @param {Boolean} [skipFetch] if `true`, do not attempt to fetch unloaded records\n @return {Promise<RecordInstance | null | void>}\n */\n async push(doc: SingleResourceDocument, skipFetch?: boolean): Promise<RecordInstance | null | void> {\n const { store } = this;\n const isResourceData = doc.data && isMaybeResource(doc.data);\n const added = isResourceData\n ? (store._push(doc, true) as StableExistingRecordIdentifier)\n : doc.data\n ? (store.identifierCache.getOrCreateRecordIdentifier(doc.data) as StableExistingRecordIdentifier)\n : null;\n const { identifier } = this.belongsToRelationship;\n\n if (DEBUG) {\n if (added) {\n assertPolymorphicType(identifier, this.belongsToRelationship.definition, added, store);\n }\n }\n\n const newData: SingleResourceRelationship = {};\n\n // only set data if it was passed in\n if (doc.data || doc.data === null) {\n newData.data = added;\n }\n if ('links' in doc) {\n newData.links = doc.links;\n }\n if ('meta' in doc) {\n newData.meta = doc.meta;\n }\n store._join(() => {\n this.graph.push({\n op: 'updateRelationship',\n record: identifier,\n field: this.key,\n value: newData,\n });\n });\n\n if (!skipFetch) return this.load();\n }\n\n /**\n `value()` synchronously returns the current value of the belongs-to\n relationship. Unlike `record.relationshipName`, calling\n `value()` on a reference does not trigger a fetch if the async\n relationship is not yet loaded. If the relationship is not loaded\n it will always return `null`.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n userRef.value(); // null\n\n // provide data for reference\n userRef.push({\n data: {\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value(); // user\n });\n ```\n\n @method value\n @public\n @return {Model} the record in this relationship\n */\n value(): RecordInstance | null {\n const resource = this._resource();\n return resource && resource.data ? this.store.peekRecord(resource.data) : null;\n }\n\n /**\n Loads a record in a belongs-to relationship if it is not already\n loaded. If the relationship is already loaded this method does not\n trigger a new load.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n userRef.value(); // null\n\n userRef.load().then(function(user) {\n userRef.value() === user\n });\n ```\n\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference.\n\n Example\n\n ```javascript\n userRef.load({ adapterOptions: { isPrivate: true } }).then(function(user) {\n userRef.value() === user;\n });\n ```\n ```app/adapters/user.js\n import Adapter from '@ember-data/adapter';\n\n export default class UserAdapter extends Adapter {\n findRecord(store, type, id, snapshot) {\n // In the adapter you will have access to adapterOptions.\n let adapterOptions = snapshot.adapterOptions;\n }\n });\n ```\n\n @method load\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the record in this belongs-to relationship.\n */\n async load(options?: Record<string, unknown>): Promise<RecordInstance | null> {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n const fetchSyncRel =\n !this.belongsToRelationship.definition.isAsync && !areAllInverseRecordsLoaded(this.store, this._resource());\n return fetchSyncRel\n ? support.reloadBelongsTo(this.key, options).then(() => this.value())\n : // we cast to fix the return type since typescript and eslint don't understand async functions\n // properly\n (support.getBelongsTo(this.key, options) as Promise<RecordInstance | null>);\n }\n\n /**\n Triggers a reload of the value in this relationship. If the\n remoteType is `\"link\"` Ember Data will use the relationship link to\n reload the relationship. Otherwise it will reload the record by its\n id.\n\n Example\n\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @belongsTo('user', { async: true, inverse: null }) user;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n\n userRef.reload().then(function(user) {\n userRef.value() === user\n });\n ```\n\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference. A full example\n can be found in the `load` method.\n\n Example\n\n ```javascript\n userRef.reload({ adapterOptions: { isPrivate: true } })\n ```\n\n @method reload\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the record in this belongs-to relationship after the reload has completed.\n */\n reload(options?: Record<string, unknown>) {\n const support: LegacySupport = (LEGACY_SUPPORT as Map<StableRecordIdentifier, LegacySupport>).get(\n this.___identifier\n )!;\n return support.reloadBelongsTo(this.key, options).then(() => this.value());\n }\n}\ndefineSignal(BelongsToReference.prototype, '_ref', 0);\n","import { assert } from '@ember/debug';\n\nimport { importSync } from '@embroider/macros';\n\nimport { DEBUG } from '@ember-data/env';\nimport type { UpgradedMeta } from '@ember-data/graph/-private/-edge-definition';\nimport type { CollectionEdge } from '@ember-data/graph/-private/edges/collection';\nimport type { ResourceEdge } from '@ember-data/graph/-private/edges/resource';\nimport type { Graph, GraphEdge } from '@ember-data/graph/-private/graph';\nimport { upgradeStore } from '@ember-data/legacy-compat/-private';\nimport { HAS_JSON_API_PACKAGE } from '@ember-data/packages';\nimport type Store from '@ember-data/store';\nimport {\n fastPush,\n isStableIdentifier,\n peekCache,\n recordIdentifierFor,\n SOURCE,\n storeFor,\n} from '@ember-data/store/-private';\nimport type { Cache } from '@ember-data/store/-types/q/cache';\nimport type { JsonApiRelationship } from '@ember-data/store/-types/q/record-data-json-api';\nimport type { RecordInstance } from '@ember-data/store/-types/q/record-instance';\nimport type { FindOptions } from '@ember-data/store/-types/q/store';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { CollectionRelationship } from '@warp-drive/core-types/cache/relationship';\nimport type { LocalRelationshipOperation } from '@warp-drive/core-types/graph';\nimport type { CollectionResourceRelationship, SingleResourceRelationship } from '@warp-drive/core-types/spec/raw';\n\nimport RelatedCollection from './many-array';\nimport type { MinimalLegacyRecord } from './model-methods';\nimport type { BelongsToProxyCreateArgs, BelongsToProxyMeta } from './promise-belongs-to';\nimport PromiseBelongsTo from './promise-belongs-to';\nimport type { HasManyProxyCreateArgs } from './promise-many-array';\nimport PromiseManyArray from './promise-many-array';\nimport BelongsToReference from './references/belongs-to';\nimport HasManyReference from './references/has-many';\n\ntype PromiseBelongsToFactory = { create(args: BelongsToProxyCreateArgs): PromiseBelongsTo };\n\nexport const LEGACY_SUPPORT: Map<StableRecordIdentifier | MinimalLegacyRecord, LegacySupport> = new Map();\n\nexport function lookupLegacySupport(record: MinimalLegacyRecord): LegacySupport {\n const identifier = recordIdentifierFor(record);\n assert(`Expected a record`, identifier);\n let support = LEGACY_SUPPORT.get(identifier);\n\n if (!support) {\n assert(`Memory Leak Detected`, !record.isDestroyed && !record.isDestroying);\n support = new LegacySupport(record);\n LEGACY_SUPPORT.set(identifier, support);\n LEGACY_SUPPORT.set(record, support);\n }\n\n return support;\n}\n\nexport class LegacySupport {\n declare record: MinimalLegacyRecord;\n declare store: Store;\n declare graph: Graph;\n declare cache: Cache;\n declare references: Record<string, BelongsToReference | HasManyReference>;\n declare identifier: StableRecordIdentifier;\n declare _manyArrayCache: Record<string, RelatedCollection>;\n declare _relationshipPromisesCache: Record<string, Promise<RelatedCollection | RecordInstance>>;\n declare _relationshipProxyCache: Record<string, PromiseManyArray | PromiseBelongsTo | undefined>;\n declare _pending: Record<string, Promise<StableRecordIdentifier | null> | undefined>;\n\n declare isDestroying: boolean;\n declare isDestroyed: boolean;\n\n constructor(record: MinimalLegacyRecord) {\n this.record = record;\n this.store = storeFor(record)!;\n this.identifier = recordIdentifierFor(record);\n this.cache = peekCache(record);\n\n if (HAS_JSON_API_PACKAGE) {\n const graphFor = (importSync('@ember-data/graph/-private') as typeof import('@ember-data/graph/-private'))\n .graphFor;\n\n this.graph = graphFor(this.store);\n }\n\n this._manyArrayCache = Object.create(null) as Record<string, RelatedCollection>;\n this._relationshipPromisesCache = Object.create(null) as Record<\n string,\n Promise<RelatedCollection | RecordInstance>\n >;\n this._relationshipProxyCache = Object.create(null) as Record<string, PromiseManyArray | PromiseBelongsTo>;\n this._pending = Object.create(null) as Record<string, Promise<StableRecordIdentifier | null>>;\n this.references = Object.create(null) as Record<string, BelongsToReference>;\n }\n\n _syncArray(array: RelatedCollection) {\n // It’s possible the parent side of the relationship may have been destroyed by this point\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n const currentState = array[SOURCE];\n const identifier = this.identifier;\n\n const [identifiers, jsonApi] = this._getCurrentState(identifier, array.key);\n\n if (jsonApi.meta) {\n array.meta = jsonApi.meta;\n }\n\n if (jsonApi.links) {\n array.links = jsonApi.links;\n }\n\n currentState.length = 0;\n fastPush(currentState, identifiers);\n }\n\n mutate(mutation: LocalRelationshipOperation): void {\n this.cache.mutate(mutation);\n }\n\n _findBelongsTo(\n key: string,\n resource: SingleResourceRelationship,\n relationship: ResourceEdge,\n options?: FindOptions\n ): Promise<RecordInstance | null> {\n // TODO @runspired follow up if parent isNew then we should not be attempting load here\n // TODO @runspired follow up on whether this should be in the relationship requests cache\n return this._findBelongsToByJsonApiResource(resource, this.identifier, relationship, options).then(\n (identifier: StableRecordIdentifier | null) =>\n handleCompletedRelationshipRequest(this, key, relationship, identifier),\n (e: Error) => handleCompletedRelationshipRequest(this, key, relationship, null, e)\n );\n }\n\n reloadBelongsTo(key: string, options?: FindOptions): Promise<RecordInstance | null> {\n const loadingPromise = this._relationshipPromisesCache[key] as Promise<RecordInstance | null> | undefined;\n if (loadingPromise) {\n return loadingPromise;\n }\n\n const relationship = this.graph.get(this.identifier, key);\n assert(`Expected ${key} to be a belongs-to relationship`, isBelongsTo(relationship));\n\n const resource = this.cache.getRelationship(this.identifier, key) as SingleResourceRelationship;\n relationship.state.hasFailedLoadAttempt = false;\n relationship.state.shouldForceReload = true;\n const promise = this._findBelongsTo(key, resource, relationship, options);\n if (this._relationshipProxyCache[key]) {\n // @ts-expect-error\n return this._updatePromiseProxyFor('belongsTo', key, { promise });\n }\n return promise;\n }\n\n getBelongsTo(key: string, options?: FindOptions): PromiseBelongsTo | RecordInstance | null {\n const { identifier, cache } = this;\n const resource = cache.getRelationship(this.identifier, key) as SingleResourceRelationship;\n const relatedIdentifier = resource && resource.data ? resource.data : null;\n assert(`Expected a stable identifier`, !relatedIdentifier || isStableIdentifier(relatedIdentifier));\n\n const store = this.store;\n const relationship = this.graph.get(this.identifier, key);\n assert(`Expected ${key} to be a belongs-to relationship`, isBelongsTo(relationship));\n\n const isAsync = relationship.definition.isAsync;\n const _belongsToState: BelongsToProxyMeta = {\n key,\n store,\n legacySupport: this,\n modelName: relationship.definition.type,\n };\n\n if (isAsync) {\n if (relationship.state.hasFailedLoadAttempt) {\n return this._relationshipProxyCache[key] as PromiseBelongsTo;\n }\n\n const promise = this._findBelongsTo(key, resource, relationship, options);\n const isLoaded = relatedIdentifier && store._instanceCache.recordIsLoaded(relatedIdentifier);\n\n return this._updatePromiseProxyFor('belongsTo', key, {\n promise,\n content: isLoaded ? store._instanceCache.getRecord(relatedIdentifier) : null,\n _belongsToState,\n });\n } else {\n if (relatedIdentifier === null) {\n return null;\n } else {\n const toReturn = store._instanceCache.getRecord(relatedIdentifier);\n assert(\n `You looked up the '${key}' relationship on a '${identifier.type}' with id ${\n identifier.id || 'null'\n } but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async (\\`belongsTo(<type>, { async: true, inverse: <inverse> })\\`)`,\n toReturn === null || store._instanceCache.recordIsLoaded(relatedIdentifier, true)\n );\n return toReturn;\n }\n }\n }\n\n setDirtyBelongsTo(key: string, value: RecordInstance | null) {\n return this.cache.mutate(\n {\n op: 'replaceRelatedRecord',\n record: this.identifier,\n field: key,\n value: extractIdentifierFromRecord(value),\n },\n // @ts-expect-error\n true\n );\n }\n\n _getCurrentState(\n identifier: StableRecordIdentifier,\n field: string\n ): [StableRecordIdentifier[], CollectionRelationship] {\n const jsonApi = this.cache.getRelationship(identifier, field) as CollectionRelationship;\n const cache = this.store._instanceCache;\n const identifiers: StableRecordIdentifier[] = [];\n if (jsonApi.data) {\n for (let i = 0; i < jsonApi.data.length; i++) {\n const relatedIdentifier: StableRecordIdentifier = jsonApi.data[i];\n assert(`Expected a stable identifier`, isStableIdentifier(relatedIdentifier));\n if (cache.recordIsLoaded(relatedIdentifier, true)) {\n identifiers.push(relatedIdentifier);\n }\n }\n }\n\n return [identifiers, jsonApi];\n }\n\n getManyArray(key: string, definition?: UpgradedMeta): RelatedCollection {\n if (HAS_JSON_API_PACKAGE) {\n let manyArray: RelatedCollection | undefined = this._manyArrayCache[key];\n if (!definition) {\n definition = this.graph.get(this.identifier, key).definition;\n }\n\n if (!manyArray) {\n const [identifiers, doc] = this._getCurrentState(this.identifier, key);\n\n manyArray = new RelatedCollection({\n store: this.store,\n type: definition.type,\n identifier: this.identifier,\n cache: this.cache,\n identifiers,\n key,\n meta: doc.meta || null,\n links: doc.links || null,\n isPolymorphic: definition.isPolymorphic,\n isAsync: definition.isAsync,\n _inverseIsAsync: definition.inverseIsAsync,\n manager: this,\n isLoaded: !definition.isAsync,\n allowMutation: true,\n });\n this._manyArrayCache[key] = manyArray;\n }\n\n return manyArray;\n }\n assert('hasMany only works with the @ember-data/json-api package');\n }\n\n fetchAsyncHasMany(\n key: string,\n relationship: CollectionEdge,\n manyArray: RelatedCollection,\n options?: FindOptions\n ): Promise<RelatedCollection> {\n if (HAS_JSON_API_PACKAGE) {\n let loadingPromise = this._relationshipPromisesCache[key] as Promise<RelatedCollection> | undefined;\n if (loadingPromise) {\n return loadingPromise;\n }\n\n const jsonApi = this.cache.getRelationship(this.identifier, key) as CollectionRelationship;\n const promise = this._findHasManyByJsonApiResource(jsonApi, this.identifier, relationship, options);\n\n if (!promise) {\n manyArray.isLoaded = true;\n return Promise.resolve(manyArray);\n }\n\n loadingPromise = promise.then(\n () => handleCompletedRelationshipRequest(this, key, relationship, manyArray),\n (e: Error) => handleCompletedRelationshipRequest(this, key, relationship, manyArray, e)\n );\n this._relationshipPromisesCache[key] = loadingPromise;\n return loadingPromise;\n }\n assert('hasMany only works with the @ember-data/json-api package');\n }\n\n reloadHasMany(key: string, options?: FindOptions) {\n if (HAS_JSON_API_PACKAGE) {\n const loadingPromise = this._relationshipPromisesCache[key];\n if (loadingPromise) {\n return loadingPromise;\n }\n const relationship = this.graph.get(this.identifier, key) as CollectionEdge;\n const { definition, state } = relationship;\n\n state.hasFailedLoadAttempt = false;\n state.shouldForceReload = true;\n const manyArray = this.getManyArray(key, definition);\n const promise = this.fetchAsyncHasMany(key, relationship, manyArray, options);\n\n if (this._relationshipProxyCache[key]) {\n return this._updatePromiseProxyFor('hasMany', key, { promise });\n }\n\n return promise;\n }\n assert(`hasMany only works with the @ember-data/json-api package`);\n }\n\n getHasMany(key: string, options?: FindOptions): PromiseManyArray | RelatedCollection {\n if (HAS_JSON_API_PACKAGE) {\n const relationship = this.graph.get(this.identifier, key) as CollectionEdge;\n const { definition, state } = relationship;\n const manyArray = this.getManyArray(key, definition);\n\n if (definition.isAsync) {\n if (state.hasFailedLoadAttempt) {\n return this._relationshipProxyCache[key] as PromiseManyArray;\n }\n\n const promise = this.fetchAsyncHasMany(key, relationship, manyArray, options);\n\n return this._updatePromiseProxyFor('hasMany', key, { promise, content: manyArray });\n } else {\n assert(\n `You looked up the '${key}' relationship on a '${this.identifier.type}' with id ${\n this.identifier.id || 'null'\n } but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async ('hasMany(<type>, { async: true, inverse: <inverse> })')`,\n !anyUnloaded(this.store, relationship)\n );\n\n return manyArray;\n }\n }\n assert(`hasMany only works with the @ember-data/json-api package`);\n }\n\n _updatePromiseProxyFor(kind: 'hasMany', key: string, args: HasManyProxyCreateArgs): PromiseManyArray;\n _updatePromiseProxyFor(kind: 'belongsTo', key: string, args: BelongsToProxyCreateArgs): PromiseBelongsTo;\n _updatePromiseProxyFor(\n kind: 'belongsTo',\n key: string,\n args: { promise: Promise<RecordInstance | null> }\n ): PromiseBelongsTo;\n _updatePromiseProxyFor(\n kind: 'hasMany' | 'belongsTo',\n key: string,\n args: BelongsToProxyCreateArgs | HasManyProxyCreateArgs | { promise: Promise<RecordInstance | null> }\n ): PromiseBelongsTo | PromiseManyArray {\n let promiseProxy = this._relationshipProxyCache[key];\n if (kind === 'hasMany') {\n const { promise, content } = args as HasManyProxyCreateArgs;\n if (promiseProxy) {\n assert(`Expected a PromiseManyArray`, '_update' in promiseProxy);\n promiseProxy._update(promise, content);\n } else {\n promiseProxy = this._relationshipProxyCache[key] = new PromiseManyArray(promise, content);\n }\n return promiseProxy;\n }\n if (promiseProxy) {\n const { promise, content } = args as BelongsToProxyCreateArgs;\n assert(`Expected a PromiseBelongsTo`, '_belongsToState' in promiseProxy);\n\n if (content !== undefined) {\n promiseProxy.set('content', content);\n }\n void promiseProxy.set('promise', promise);\n } else {\n promiseProxy = (PromiseBelongsTo as unknown as PromiseBelongsToFactory).create(args as BelongsToProxyCreateArgs);\n this._relationshipProxyCache[key] = promiseProxy;\n }\n\n return promiseProxy;\n }\n\n referenceFor(kind: string | null, name: string) {\n let reference = this.references[name];\n\n if (!reference) {\n if (!HAS_JSON_API_PACKAGE) {\n // TODO @runspired while this feels odd, it is not a regression in capability because we do\n // not today support references pulling from RecordDatas other than our own\n // because of the intimate API access involved. This is something we will need to redesign.\n assert(`snapshot.belongsTo only supported for @ember-data/json-api`);\n }\n const { graph, identifier } = this;\n const relationship = graph.get(identifier, name);\n\n if (DEBUG) {\n if (kind) {\n const modelName = identifier.type;\n const actualRelationshipKind = relationship.definition.kind;\n assert(\n `You tried to get the '${name}' relationship on a '${modelName}' via record.${kind}('${name}'), but the relationship is of kind '${actualRelationshipKind}'. Use record.${actualRelationshipKind}('${name}') instead.`,\n actualRelationshipKind === kind\n );\n }\n }\n\n const relationshipKind = relationship.definition.kind;\n\n if (relationshipKind === 'belongsTo') {\n reference = new BelongsToReference(this.store, graph, identifier, relationship as ResourceEdge, name);\n } else if (relationshipKind === 'hasMany') {\n reference = new HasManyReference(this.store, graph, identifier, relationship as CollectionEdge, name);\n }\n\n this.references[name] = reference;\n }\n\n return reference;\n }\n\n _findHasManyByJsonApiResource(\n resource: CollectionResourceRelationship,\n parentIdentifier: StableRecordIdentifier,\n relationship: CollectionEdge,\n options: FindOptions = {}\n ): Promise<void | unknown[]> | void {\n if (HAS_JSON_API_PACKAGE) {\n if (!resource) {\n return;\n }\n const { definition, state } = relationship;\n upgradeStore(this.store);\n const adapter = this.store.adapterFor(definition.type);\n const { isStale, hasDematerializedInverse, hasReceivedData, isEmpty, shouldForceReload } = state;\n const allInverseRecordsAreLoaded = areAllInverseRecordsLoaded(this.store, resource);\n const identifiers = resource.data;\n const shouldFindViaLink =\n resource.links &&\n resource.links.related &&\n (typeof adapter.findHasMany === 'function' || typeof identifiers === 'undefined') &&\n (shouldForceReload || hasDematerializedInverse || isStale || (!allInverseRecordsAreLoaded && !isEmpty));\n\n const relationshipMeta = this.store\n .getSchemaDefinitionService()\n .relationshipsDefinitionFor({ type: definition.inverseType })[definition.key];\n\n const request = {\n useLink: shouldFindViaLink,\n field: relationshipMeta,\n links: resource.links,\n meta: resource.meta,\n options,\n record: parentIdentifier,\n };\n\n // fetch via link\n if (shouldFindViaLink) {\n assert(`Expected collection to be an array`, !identifiers || Array.isArray(identifiers));\n assert(`Expected stable identifiers`, !identifiers || identifiers.every(isStableIdentifier));\n\n return this.store.request({\n op: 'findHasMany',\n records: identifiers || [],\n data: request,\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n }) as unknown as Promise<void>;\n }\n\n const preferLocalCache = hasReceivedData && !isEmpty;\n const hasLocalPartialData =\n hasDematerializedInverse || (isEmpty && Array.isArray(identifiers) && identifiers.length > 0);\n const attemptLocalCache = !shouldForceReload && !isStale && (preferLocalCache || hasLocalPartialData);\n\n if (attemptLocalCache && allInverseRecordsAreLoaded) {\n return;\n }\n\n const hasData = hasReceivedData && !isEmpty;\n if (attemptLocalCache || hasData || hasLocalPartialData) {\n assert(`Expected collection to be an array`, Array.isArray(identifiers));\n assert(`Expected stable identifiers`, identifiers.every(isStableIdentifier));\n\n options.reload = options.reload || !attemptLocalCache || undefined;\n return this.store.request({\n op: 'findHasMany',\n records: identifiers,\n data: request,\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n }) as unknown as Promise<void>;\n }\n\n // we were explicitly told we have no data and no links.\n // TODO if the relationshipIsStale, should we hit the adapter anyway?\n return;\n }\n assert(`hasMany only works with the @ember-data/json-api package`);\n }\n\n _findBelongsToByJsonApiResource(\n resource: SingleResourceRelationship,\n parentIdentifier: StableRecordIdentifier,\n relationship: ResourceEdge,\n options: FindOptions = {}\n ): Promise<StableRecordIdentifier | null> {\n if (!resource) {\n return Promise.resolve(null);\n }\n const key = relationship.definition.key;\n\n // interleaved promises mean that we MUST cache this here\n // in order to prevent infinite re-render if the request\n // fails.\n if (this._pending[key]) {\n return this._pending[key]!;\n }\n\n const identifier = resource.data ? resource.data : null;\n assert(`Expected a stable identifier`, !identifier || isStableIdentifier(identifier));\n\n const { isStale, hasDematerializedInverse, hasReceivedData, isEmpty, shouldForceReload } = relationship.state;\n\n const allInverseRecordsAreLoaded = areAllInverseRecordsLoaded(this.store, resource);\n const shouldFindViaLink =\n resource.links?.related &&\n (shouldForceReload || hasDematerializedInverse || isStale || (!allInverseRecordsAreLoaded && !isEmpty));\n\n const relationshipMeta = this.store.getSchemaDefinitionService().relationshipsDefinitionFor(this.identifier)[\n relationship.definition.key\n ];\n assert(`Attempted to access a belongsTo relationship but no definition exists for it`, relationshipMeta);\n const request = {\n useLink: shouldFindViaLink,\n field: relationshipMeta,\n links: resource.links,\n meta: resource.meta,\n options,\n record: parentIdentifier,\n };\n\n // fetch via link\n if (shouldFindViaLink) {\n const future = this.store.request<StableRecordIdentifier | null>({\n op: 'findBelongsTo',\n records: identifier ? [identifier] : [],\n data: request,\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n });\n this._pending[key] = future\n .then((doc) => doc.content)\n .finally(() => {\n this._pending[key] = undefined;\n });\n return this._pending[key]!;\n }\n\n const preferLocalCache = hasReceivedData && allInverseRecordsAreLoaded && !isEmpty;\n const hasLocalPartialData = hasDematerializedInverse || (isEmpty && resource.data);\n // null is explicit empty, undefined is \"we don't know anything\"\n const localDataIsEmpty = !identifier;\n const attemptLocalCache = !shouldForceReload && !isStale && (preferLocalCache || hasLocalPartialData);\n\n // we dont need to fetch and are empty\n if (attemptLocalCache && localDataIsEmpty) {\n return Promise.resolve(null);\n }\n\n // we dont need to fetch because we are local state\n const resourceIsLocal = identifier?.id === null;\n if ((attemptLocalCache && allInverseRecordsAreLoaded) || resourceIsLocal) {\n return Promise.resolve(identifier);\n }\n\n // we may need to fetch\n if (identifier) {\n assert(`Cannot fetch belongs-to relationship with no information`, identifier);\n options.reload = options.reload || !attemptLocalCache || undefined;\n\n this._pending[key] = this.store\n .request<StableRecordIdentifier | null>({\n op: 'findBelongsTo',\n records: [identifier],\n data: request,\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n })\n .then((doc) => doc.content)\n .finally(() => {\n this._pending[key] = undefined;\n });\n return this._pending[key]!;\n }\n\n // we were explicitly told we have no data and no links.\n // TODO if the relationshipIsStale, should we hit the adapter anyway?\n return Promise.resolve(null);\n }\n\n destroy() {\n this.isDestroying = true;\n\n let cache: Record<string, { destroy(): void } | undefined> = this._manyArrayCache;\n this._manyArrayCache = Object.create(null) as Record<string, RelatedCollection>;\n Object.keys(cache).forEach((key) => {\n cache[key]!.destroy();\n });\n\n cache = this._relationshipProxyCache;\n this._relationshipProxyCache = Object.create(null) as Record<string, PromiseManyArray | PromiseBelongsTo>;\n Object.keys(cache).forEach((key) => {\n const proxy = cache[key]!;\n if (proxy.destroy) {\n proxy.destroy();\n }\n });\n\n cache = this.references;\n this.references = Object.create(null) as Record<string, BelongsToReference | HasManyReference>;\n Object.keys(cache).forEach((key) => {\n cache[key]!.destroy();\n });\n this.isDestroyed = true;\n }\n}\n\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: ResourceEdge,\n value: StableRecordIdentifier | null\n): RecordInstance | null;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: CollectionEdge,\n value: RelatedCollection\n): RelatedCollection;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: ResourceEdge,\n value: null,\n error: Error\n): never;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: CollectionEdge,\n value: RelatedCollection,\n error: Error\n): never;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: ResourceEdge | CollectionEdge,\n value: RelatedCollection | StableRecordIdentifier | null,\n error?: Error\n): RelatedCollection | RecordInstance | null {\n delete recordExt._relationshipPromisesCache[key];\n relationship.state.shouldForceReload = false;\n const isHasMany = relationship.definition.kind === 'hasMany';\n\n if (isHasMany) {\n // we don't notify the record property here to avoid refetch\n // only the many array\n (value as RelatedCollection).notify();\n }\n\n if (error) {\n relationship.state.hasFailedLoadAttempt = true;\n const proxy = recordExt._relationshipProxyCache[key];\n // belongsTo relationships are sometimes unloaded\n // when a load fails, in this case we need\n // to make sure that we aren't proxying\n // to destroyed content\n // for the sync belongsTo reload case there will be no proxy\n // for the async reload case there will be no proxy if the ui\n // has never been accessed\n if (proxy && !isHasMany) {\n // @ts-expect-error unsure why this is not resolving the boolean but async belongsTo is weird\n if (proxy.content && proxy.content.isDestroying) {\n (proxy as PromiseBelongsTo).set('content', null);\n }\n recordExt.store.notifications._flush();\n }\n\n throw error;\n }\n\n if (isHasMany) {\n (value as RelatedCollection).isLoaded = true;\n } else {\n recordExt.store.notifications._flush();\n }\n\n relationship.state.hasFailedLoadAttempt = false;\n // only set to not stale if no error is thrown\n relationship.state.isStale = false;\n\n return isHasMany || !value\n ? (value as RelatedCollection | null)\n : recordExt.store.peekRecord(value as StableRecordIdentifier);\n}\n\ntype PromiseProxyRecord = { then(): void; content: RecordInstance | null | undefined };\n\nfunction extractIdentifierFromRecord(record: PromiseProxyRecord | RecordInstance | null) {\n if (!record) {\n return null;\n }\n\n return recordIdentifierFor(record);\n}\n\nfunction anyUnloaded(store: Store, relationship: CollectionEdge) {\n const graph = store._graph;\n assert(`Expected a Graph instance to be available`, graph);\n const relationshipData = graph.getData(\n relationship.identifier,\n relationship.definition.key\n ) as CollectionRelationship;\n const state = relationshipData.data;\n const cache = store._instanceCache;\n const unloaded = state?.find((s) => {\n const isLoaded = cache.recordIsLoaded(s, true);\n return !isLoaded;\n });\n\n return unloaded || false;\n}\n\nexport function areAllInverseRecordsLoaded(store: Store, resource: JsonApiRelationship): boolean {\n const instanceCache = store._instanceCache;\n const identifiers = resource.data;\n\n if (Array.isArray(identifiers)) {\n assert(`Expected stable identifiers`, identifiers.every(isStableIdentifier));\n // treat as collection\n // check for unloaded records\n return identifiers.every((identifier: StableRecordIdentifier) => instanceCache.recordIsLoaded(identifier));\n }\n\n // treat as single resource\n if (!identifiers) return true;\n\n assert(`Expected stable identifiers`, isStableIdentifier(identifiers));\n return instanceCache.recordIsLoaded(identifiers);\n}\n\nfunction isBelongsTo(relationship: GraphEdge): relationship is ResourceEdge {\n return relationship.definition.kind === 'belongsTo';\n}\n","export default function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}","import { A, type NativeArray } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\nimport { computed, get } from '@ember/object';\nimport { mapBy, not } from '@ember/object/computed';\n\nimport type RecordState from './record-state';\n\ntype ValidationError = {\n attribute: string;\n message: string;\n};\n/**\n @module @ember-data/model\n*/\ninterface ArrayProxyWithCustomOverrides<T> extends Omit<ArrayProxy<T>, 'clear' | 'content'> {\n // Omit causes `content` to be merged with the class def for ArrayProxy\n // which then causes it to be seen as a property, disallowing defining it\n // as an accessor. This restores our ability to define it as an accessor.\n content: NativeArray<T>;\n clear(): void;\n _has(name: string): boolean;\n}\n\n// we force the type here to our own construct because mixin and extend patterns\n// lose generic signatures. We also do this because we need to Omit `clear` from\n// the type of ArrayProxy as we override it's signature.\nconst ArrayProxyWithCustomOverrides = ArrayProxy as unknown as new <T>() => ArrayProxyWithCustomOverrides<T>;\n\n/**\n Holds validation errors for a given record, organized by attribute names.\n\n This class is not directly instantiable.\n\n Every `Model` has an `errors` property that is an instance of\n `Errors`. This can be used to display validation error\n messages returned from the server when a `record.save()` rejects.\n\n For Example, if you had a `User` model that looked like this:\n\n ```app/models/user.js\n import Model, { attr } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @attr('string') username;\n @attr('string') email;\n }\n ```\n And you attempted to save a record that did not validate on the backend:\n\n ```javascript\n let user = store.createRecord('user', {\n username: 'tomster',\n email: 'invalidEmail'\n });\n user.save();\n ```\n\n Your backend would be expected to return an error response that described\n the problem, so that error messages can be generated on the app.\n\n API responses will be translated into instances of `Errors` differently,\n depending on the specific combination of adapter and serializer used. You\n may want to check the documentation or the source code of the libraries\n that you are using, to know how they expect errors to be communicated.\n\n Errors can be displayed to the user by accessing their property name\n to get an array of all the error objects for that property. Each\n error object is a JavaScript object with two keys:\n\n - `message` A string containing the error message from the backend\n - `attribute` The name of the property associated with this error message\n\n ```handlebars\n <label>Username: <Input @value={{@model.username}} /> </label>\n {{#each @model.errors.username as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n\n <label>Email: <Input @value={{@model.email}} /> </label>\n {{#each @model.errors.email as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n ```\n\n You can also access the special `messages` property on the error\n object to get an array of all the error strings.\n\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n <div class=\"error\">\n {{message}}\n </div>\n {{/each}}\n ```\n\n @class Errors\n @public\n @extends Ember.ArrayProxy\n */\nclass Errors extends ArrayProxyWithCustomOverrides<ValidationError> {\n declare __record: { currentState: RecordState };\n /**\n @property errorsByAttributeName\n @type {MapWithDefault}\n @private\n */\n @computed()\n get errorsByAttributeName(): Map<string, NativeArray<ValidationError>> {\n return new Map();\n }\n\n /**\n Returns errors for a given attribute\n\n ```javascript\n let user = store.createRecord('user', {\n username: 'tomster',\n email: 'invalidEmail'\n });\n user.save().catch(function(){\n user.errors.errorsFor('email'); // returns:\n // [{attribute: \"email\", message: \"Doesn't look like a valid email.\"}]\n });\n ```\n\n @method errorsFor\n @public\n @param {String} attribute\n @return {Array}\n */\n errorsFor(attribute: string): NativeArray<ValidationError> {\n const map = this.errorsByAttributeName;\n\n let errors = map.get(attribute);\n\n if (errors === undefined) {\n errors = A<ValidationError>();\n map.set(attribute, errors);\n }\n\n // Errors may be a native array with extensions turned on. Since we access\n // the array via a method, and not a computed or using `Ember.get`, it does\n // not entangle properly with autotracking, so we entangle manually by\n // getting the `[]` property.\n get(errors, '[]');\n\n return errors;\n }\n\n /**\n An array containing all of the error messages for this\n record. This is useful for displaying all errors to the user.\n\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n <div class=\"error\">\n {{message}}\n </div>\n {{/each}}\n ```\n\n @property messages\n @public\n @type {Array}\n */\n @mapBy('content', 'message')\n declare messages: string[];\n\n /**\n @property content\n @type {Array}\n @private\n */\n @computed()\n override get content(): NativeArray<ValidationError> {\n return A();\n }\n\n /**\n @method unknownProperty\n @private\n */\n unknownProperty(attribute: string) {\n const errors = this.errorsFor(attribute);\n if (errors.length === 0) {\n return undefined;\n }\n return errors;\n }\n\n /**\n Total number of errors.\n\n @property length\n @type {Number}\n @public\n @readOnly\n */\n\n /**\n `true` if we have no errors.\n\n @property isEmpty\n @type {Boolean}\n @public\n @readOnly\n */\n @not('length')\n declare isEmpty: boolean;\n\n /**\n Manually adds errors to the record. This will trigger the `becameInvalid` event/ lifecycle method on\n the record and transition the record into an `invalid` state.\n\n Example\n ```javascript\n let errors = user.errors;\n\n // add multiple errors\n errors.add('password', [\n 'Must be at least 12 characters',\n 'Must contain at least one symbol',\n 'Cannot contain your name'\n ]);\n\n errors.errorsFor('password');\n // =>\n // [\n // { attribute: 'password', message: 'Must be at least 12 characters' },\n // { attribute: 'password', message: 'Must contain at least one symbol' },\n // { attribute: 'password', message: 'Cannot contain your name' },\n // ]\n\n // add a single error\n errors.add('username', 'This field is required');\n\n errors.errorsFor('username');\n // =>\n // [\n // { attribute: 'username', message: 'This field is required' },\n // ]\n ```\n @method add\n @public\n @param {string} attribute - the property name of an attribute or relationship\n @param {string[]|string} messages - an error message or array of error messages for the attribute\n */\n add(attribute: string, messages: string[] | string): void {\n const errors = this._findOrCreateMessages(attribute, messages);\n this.addObjects(errors);\n\n this.errorsFor(attribute).addObjects(errors);\n this.__record.currentState.notify('isValid');\n\n this.notifyPropertyChange(attribute);\n }\n\n /**\n @method _findOrCreateMessages\n @private\n */\n _findOrCreateMessages(attribute: string, messages: string | string[]): ValidationError[] {\n const errors = this.errorsFor(attribute);\n const messagesArray = Array.isArray(messages) ? messages : [messages];\n const _messages: ValidationError[] = new Array(messagesArray.length) as ValidationError[];\n\n for (let i = 0; i < messagesArray.length; i++) {\n const message = messagesArray[i];\n const err = errors.findBy('message', message);\n if (err) {\n _messages[i] = err;\n } else {\n _messages[i] = {\n attribute: attribute,\n message,\n };\n }\n }\n\n return _messages;\n }\n\n /**\n Manually removes all errors for a given member from the record.\n This will transition the record into a `valid` state, and\n triggers the `becameValid` event and lifecycle method.\n\n Example:\n\n ```javascript\n let errors = user.errors;\n errors.add('phone', ['error-1', 'error-2']);\n\n errors.errorsFor('phone');\n // =>\n // [\n // { attribute: 'phone', message: 'error-1' },\n // { attribute: 'phone', message: 'error-2' },\n // ]\n\n errors.remove('phone');\n\n errors.errorsFor('phone');\n // => undefined\n ```\n @method remove\n @public\n @param {string} member - the property name of an attribute or relationship\n */\n remove(attribute: string) {\n if (this.isEmpty) {\n return;\n }\n\n const content = this.rejectBy('attribute', attribute);\n this.content.setObjects(content);\n\n // Although errorsByAttributeName.delete is technically enough to sync errors state, we also\n // must mutate the array as well for autotracking\n const errors = this.errorsFor(attribute);\n for (let i = 0; i < errors.length; i++) {\n if (errors[i].attribute === attribute) {\n // .replace from Ember.NativeArray is necessary. JS splice will not work.\n errors.replace(i, 1);\n }\n }\n this.errorsByAttributeName.delete(attribute);\n\n this.__record.currentState.notify('isValid');\n this.notifyPropertyChange(attribute);\n this.notifyPropertyChange('length');\n }\n\n /**\n Manually clears all errors for the record.\n This will transition the record into a `valid` state, and\n will trigger the `becameValid` event and lifecycle method.\n\n Example:\n\n ```javascript\n let errors = user.errors;\n errors.add('username', ['error-a']);\n errors.add('phone', ['error-1', 'error-2']);\n\n errors.errorsFor('username');\n // =>\n // [\n // { attribute: 'username', message: 'error-a' },\n // ]\n\n errors.errorsFor('phone');\n // =>\n // [\n // { attribute: 'phone', message: 'error-1' },\n // { attribute: 'phone', message: 'error-2' },\n // ]\n\n errors.clear();\n\n errors.errorsFor('username');\n // => undefined\n\n errors.errorsFor('phone');\n // => undefined\n\n errors.messages\n // => []\n ```\n @method clear\n @public\n */\n override clear(): void {\n if (this.isEmpty) {\n return;\n }\n\n const errorsByAttributeName = this.errorsByAttributeName;\n const attributes: string[] = [];\n\n errorsByAttributeName.forEach(function (_, attribute) {\n attributes.push(attribute);\n });\n\n errorsByAttributeName.clear();\n attributes.forEach((attribute) => {\n this.notifyPropertyChange(attribute);\n });\n\n this.__record.currentState.notify('isValid');\n super.clear();\n }\n\n /**\n Checks if there are error messages for the given attribute.\n\n ```app/controllers/user/edit.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n\n export default class UserEditController extends Controller {\n @action\n save(user) {\n if (user.errors.has('email')) {\n return alert('Please update your email before attempting to save.');\n }\n user.save();\n }\n }\n ```\n\n @method has\n @public\n @param {String} attribute\n @return {Boolean} true if there some errors on given attribute\n */\n has(attribute: string): boolean {\n return this.errorsFor(attribute).length > 0;\n }\n}\n\nexport default Errors;\n","import { assert } from '@ember/debug';\n\nimport { importSync } from '@embroider/macros';\n\nimport { upgradeStore } from '@ember-data/legacy-compat/-private';\nimport type Store from '@ember-data/store';\nimport { recordIdentifierFor } from '@ember-data/store';\nimport { peekCache } from '@ember-data/store/-private';\nimport { RecordStore } from '@warp-drive/core-types/symbols';\n\nimport type Errors from './errors';\nimport { lookupLegacySupport } from './legacy-relationships-support';\nimport type RecordState from './record-state';\n\nexport interface MinimalLegacyRecord {\n errors: Errors;\n ___recordState: RecordState;\n currentState: RecordState;\n isDestroyed: boolean;\n isDestroying: boolean;\n isReloading: boolean;\n [RecordStore]: Store;\n\n deleteRecord(): void;\n unloadRecord(): void;\n save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;\n destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;\n}\n\nexport function rollbackAttributes(this: MinimalLegacyRecord) {\n const { currentState } = this;\n const { isNew } = currentState;\n\n this[RecordStore]._join(() => {\n peekCache(this).rollbackAttrs(recordIdentifierFor(this));\n this.errors.clear();\n currentState.cleanErrorRequests();\n if (isNew) {\n this.unloadRecord();\n }\n });\n}\n\nexport function unloadRecord(this: MinimalLegacyRecord) {\n if (this.currentState.isNew && (this.isDestroyed || this.isDestroying)) {\n return;\n }\n this[RecordStore].unloadRecord(this);\n}\n\nexport function belongsTo(this: MinimalLegacyRecord, prop: string) {\n return lookupLegacySupport(this).referenceFor('belongsTo', prop);\n}\n\nexport function hasMany(this: MinimalLegacyRecord, prop: string) {\n return lookupLegacySupport(this).referenceFor('hasMany', prop);\n}\n\nexport function reload(this: MinimalLegacyRecord, options: Record<string, unknown> = {}) {\n options.isReloading = true;\n options.reload = true;\n\n const identifier = recordIdentifierFor(this);\n assert(`You cannot reload a record without an ID`, identifier.id);\n\n this.isReloading = true;\n const promise = this[RecordStore].request({\n op: 'findRecord',\n data: {\n options,\n record: identifier,\n },\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n })\n .then(() => this)\n .finally(() => {\n this.isReloading = false;\n });\n\n return promise;\n}\n\nexport function changedAttributes(this: MinimalLegacyRecord) {\n return peekCache(this).changedAttrs(recordIdentifierFor(this));\n}\n\nexport function serialize(this: MinimalLegacyRecord, options?: Record<string, unknown>) {\n upgradeStore(this[RecordStore]);\n return this[RecordStore].serializeRecord(this, options);\n}\n\nexport function deleteRecord(this: MinimalLegacyRecord) {\n // ensure we've populated currentState prior to deleting a new record\n if (this.currentState) {\n this[RecordStore].deleteRecord(this);\n }\n}\n\nexport function save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T> {\n let promise: Promise<T>;\n\n if (this.currentState.isNew && this.currentState.isDeleted) {\n promise = Promise.resolve(this);\n } else {\n this.errors.clear();\n promise = this[RecordStore].saveRecord(this, options) as Promise<T>;\n }\n\n return promise;\n}\n\nexport function destroyRecord(this: MinimalLegacyRecord, options?: Record<string, unknown>) {\n const { isNew } = this.currentState;\n this.deleteRecord();\n if (isNew) {\n return Promise.resolve(this);\n }\n return this.save(options).then((_) => {\n this.unloadRecord();\n return this;\n });\n}\n\nexport function createSnapshot(this: MinimalLegacyRecord) {\n const store = this[RecordStore];\n\n upgradeStore(store);\n if (!store._fetchManager) {\n const FetchManager = (\n importSync('@ember-data/legacy-compat/-private') as typeof import('@ember-data/legacy-compat/-private')\n ).FetchManager;\n store._fetchManager = new FetchManager(store);\n }\n\n return store._fetchManager.createSnapshot(recordIdentifierFor(this));\n}\n","import { assert } from '@ember/debug';\nimport { cacheFor } from '@ember/object/internals';\n\nimport type Store from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { RelationshipSchema } from '@warp-drive/core-types/schema';\n\nimport { LEGACY_SUPPORT } from './legacy-relationships-support';\nimport type Model from './model';\n\nexport default function notifyChanges(\n identifier: StableRecordIdentifier,\n value: NotificationType,\n key: string | undefined,\n record: Model,\n store: Store\n) {\n if (value === 'attributes') {\n if (key) {\n notifyAttribute(store, identifier, key, record);\n } else {\n record.eachAttribute((name) => {\n notifyAttribute(store, identifier, name, record);\n });\n }\n } else if (value === 'relationships') {\n if (key) {\n const meta = record.constructor.relationshipsByName.get(key);\n assert(`Expected to find a relationship for ${key} on ${identifier.type}`, meta);\n notifyRelationship(identifier, key, record, meta);\n } else {\n record.eachRelationship((name, meta) => {\n notifyRelationship(identifier, name, record, meta);\n });\n }\n } else if (value === 'identity') {\n record.notifyPropertyChange('id');\n }\n}\n\nfunction notifyRelationship(identifier: StableRecordIdentifier, key: string, record: Model, meta: RelationshipSchema) {\n if (meta.kind === 'belongsTo') {\n record.notifyPropertyChange(key);\n } else if (meta.kind === 'hasMany') {\n const support = LEGACY_SUPPORT.get(identifier);\n const manyArray = support && support._manyArrayCache[key];\n const hasPromise = support && support._relationshipPromisesCache[key];\n\n if (manyArray && hasPromise) {\n // do nothing, we will notify the ManyArray directly\n // once the fetch has completed.\n return;\n }\n\n if (manyArray) {\n manyArray.notify();\n\n //We need to notifyPropertyChange in the adding case because we need to make sure\n //we fetch the newly added record in case it is unloaded\n //TODO(Igor): Consider whether we could do this only if the record state is unloaded\n assert(`Expected options to exist on relationship meta`, meta.options);\n assert(`Expected async to exist on relationship meta options`, 'async' in meta.options);\n if (meta.options.async) {\n record.notifyPropertyChange(key);\n }\n }\n }\n}\n\nfunction notifyAttribute(store: Store, identifier: StableRecordIdentifier, key: string, record: Model) {\n const currentValue = cacheFor(record, key);\n const cache = store.cache;\n if (currentValue !== cache.getAttr(identifier, key)) {\n record.notifyPropertyChange(key);\n }\n}\n","import { assert } from '@ember/debug';\n\nimport type Store from '@ember-data/store';\nimport { storeFor } from '@ember-data/store';\nimport { recordIdentifierFor } from '@ember-data/store/-private';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type RequestStateService from '@ember-data/store/-private/network/request-cache';\nimport type { RequestState } from '@ember-data/store/-private/network/request-cache';\nimport type { Cache } from '@ember-data/store/-types/q/cache';\nimport { cached, compat } from '@ember-data/tracking';\nimport { addToTransaction, defineSignal, getSignal, peekSignal, subscribe } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\n\nimport type Errors from './errors';\nimport type { MinimalLegacyRecord } from './model-methods';\n\nconst SOURCE_POINTER_REGEXP = /^\\/?data\\/(attributes|relationships)\\/(.*)/;\nconst SOURCE_POINTER_PRIMARY_REGEXP = /^\\/?data/;\nconst PRIMARY_ATTRIBUTE_KEY = 'base';\nfunction isInvalidError(error: unknown): error is Error & { isAdapterError: true; code: 'InvalidError' } {\n return (\n !!error &&\n error instanceof Error &&\n 'isAdapterError' in error &&\n error.isAdapterError === true &&\n 'code' in error &&\n error.code === 'InvalidError'\n );\n}\n\n/**\n * A decorator that caches a getter while\n * providing the ability to bust that cache\n * when we so choose in a way that notifies\n * tracking systems.\n *\n * @internal\n */\nexport function tagged<T extends object, K extends keyof T & string>(_target: T, key: K, desc: PropertyDescriptor) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const getter = desc.get as (this: T) => unknown;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const setter = desc.set as (this: T, v: unknown) => void;\n\n desc.get = function (this: T) {\n const signal = getSignal(this, key, true);\n subscribe(signal);\n\n if (signal.shouldReset) {\n signal.shouldReset = false;\n signal.lastValue = getter.call(this);\n }\n\n return signal.lastValue;\n };\n desc.set = function (this: T, v: unknown) {\n getSignal(this, key, true); // ensure signal is setup in case we want to use it.\n // probably notify here but not yet.\n setter.call(this, v);\n };\n compat(desc);\n return desc;\n}\n\nexport function notifySignal<T extends object, K extends keyof T & string>(obj: T, key: K) {\n const signal = peekSignal(obj, key);\n if (signal) {\n signal.shouldReset = true;\n addToTransaction(signal);\n }\n}\n\n/**\nHistorically EmberData managed a state machine\nfor each record, the localState for which\nwas reflected onto Model.\n\nThis implements the flags and stateName for backwards compat\nwith the state tree that used to be possible (listed below).\n\nstateName and dirtyType are candidates for deprecation.\n\nroot\n empty\n deleted // hidden from stateName\n preloaded // hidden from stateName\n\n loading\n empty // hidden from stateName\n preloaded // hidden from stateName\n\n loaded\n saved\n updated\n uncommitted\n invalid\n inFlight\n created\n uncommitted\n invalid\n inFlight\n\n deleted\n saved\n new // hidden from stateName\n uncommitted\n invalid\n inFlight\n\n @internal\n*/\nexport default class RecordState {\n declare store: Store;\n declare identifier: StableRecordIdentifier;\n declare record: MinimalLegacyRecord;\n declare rs: RequestStateService;\n\n declare pendingCount: number;\n declare fulfilledCount: number;\n declare rejectedCount: number;\n declare cache: Cache;\n declare _errorRequests: RequestState[];\n declare _lastError: RequestState | null;\n declare handler: object;\n\n constructor(record: MinimalLegacyRecord) {\n const store = storeFor(record)!;\n const identity = recordIdentifierFor(record);\n\n this.identifier = identity;\n this.record = record;\n this.cache = store.cache;\n\n this.pendingCount = 0;\n this.fulfilledCount = 0;\n this.rejectedCount = 0;\n this._errorRequests = [];\n this._lastError = null;\n\n const requests = store.getRequestStateService();\n const notifications = store.notifications;\n\n const handleRequest = (req: RequestState) => {\n if (req.type === 'mutation') {\n switch (req.state) {\n case 'pending':\n this.isSaving = true;\n break;\n case 'rejected':\n this.isSaving = false;\n this._lastError = req;\n if (!(req.response && isInvalidError(req.response.data))) {\n this._errorRequests.push(req);\n }\n\n notifyErrorsStateChanged(this);\n break;\n case 'fulfilled':\n this._errorRequests = [];\n this._lastError = null;\n this.isSaving = false;\n this.notify('isDirty');\n notifyErrorsStateChanged(this);\n break;\n }\n } else {\n switch (req.state) {\n case 'pending':\n this.pendingCount++;\n this.notify('isLoading');\n break;\n case 'rejected':\n this.pendingCount--;\n this._lastError = req;\n if (!(req.response && isInvalidError(req.response.data))) {\n this._errorRequests.push(req);\n }\n this.notify('isLoading');\n notifyErrorsStateChanged(this);\n break;\n case 'fulfilled':\n this.pendingCount--;\n this.fulfilledCount++;\n this.notify('isLoading');\n this.notify('isDirty');\n notifyErrorsStateChanged(this);\n this._errorRequests = [];\n this._lastError = null;\n break;\n }\n }\n };\n\n requests.subscribeForRecord(identity, handleRequest);\n\n // we instantiate lazily\n // so we grab anything we don't have yet\n const lastRequest = requests.getLastRequestForRecord(identity);\n if (lastRequest) {\n handleRequest(lastRequest);\n }\n\n this.handler = notifications.subscribe(\n identity,\n (identifier: StableRecordIdentifier, type: NotificationType, key?: string) => {\n switch (type) {\n case 'state':\n this.notify('isSaved');\n this.notify('isNew');\n this.notify('isDeleted');\n this.notify('isDirty');\n break;\n case 'attributes':\n this.notify('isEmpty');\n this.notify('isDirty');\n break;\n case 'errors':\n this.updateInvalidErrors(this.record.errors);\n this.notify('isValid');\n break;\n }\n }\n );\n }\n\n destroy() {\n storeFor(this.record)!.notifications.unsubscribe(this.handler);\n }\n\n notify(key: keyof this & string) {\n notifySignal(this, key);\n }\n\n updateInvalidErrors(errors: Errors) {\n assert(\n `Expected the Cache instance for ${this.identifier.lid} to implement getErrors(identifier)`,\n typeof this.cache.getErrors === 'function'\n );\n const jsonApiErrors = this.cache.getErrors(this.identifier);\n\n errors.clear();\n\n for (let i = 0; i < jsonApiErrors.length; i++) {\n const error = jsonApiErrors[i];\n\n if (error.source && error.source.pointer) {\n const keyMatch = error.source.pointer.match(SOURCE_POINTER_REGEXP);\n let key: string | undefined;\n\n if (keyMatch) {\n key = keyMatch[2];\n } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {\n key = PRIMARY_ATTRIBUTE_KEY;\n }\n\n if (key) {\n const errMsg = error.detail || error.title;\n assert(`Expected field error to have a detail or title to use as the message`, errMsg);\n errors.add(key, errMsg);\n }\n }\n }\n }\n\n cleanErrorRequests() {\n this.notify('isValid');\n this.notify('isError');\n this.notify('adapterError');\n this._errorRequests = [];\n this._lastError = null;\n }\n\n declare isSaving: boolean;\n\n @tagged\n get isLoading() {\n return !this.isLoaded && this.pendingCount > 0 && this.fulfilledCount === 0;\n }\n\n @tagged\n get isLoaded() {\n if (this.isNew) {\n return true;\n }\n return this.fulfilledCount > 0 || !this.isEmpty;\n }\n\n @tagged\n get isSaved() {\n const rd = this.cache;\n if (this.isDeleted) {\n assert(`Expected Cache to implement isDeletionCommitted()`, typeof rd.isDeletionCommitted === 'function');\n return rd.isDeletionCommitted(this.identifier);\n }\n if (this.isNew || this.isEmpty || !this.isValid || this.isDirty || this.isLoading) {\n return false;\n }\n return true;\n }\n\n @tagged\n get isEmpty() {\n const rd = this.cache;\n // TODO this is not actually an RFC'd concept. Determine the\n // correct heuristic to replace this with.\n assert(`Expected Cache to implement isEmpty()`, typeof rd.isEmpty === 'function');\n return !this.isNew && rd.isEmpty(this.identifier);\n }\n\n @tagged\n get isNew() {\n const rd = this.cache;\n assert(`Expected Cache to implement isNew()`, typeof rd.isNew === 'function');\n return rd.isNew(this.identifier);\n }\n\n @tagged\n get isDeleted() {\n const rd = this.cache;\n assert(`Expected Cache to implement isDeleted()`, typeof rd.isDeleted === 'function');\n return rd.isDeleted(this.identifier);\n }\n\n @tagged\n get isValid() {\n return this.record.errors.length === 0;\n }\n\n @tagged\n get isDirty() {\n const rd = this.cache;\n if (this.isEmpty || rd.isDeletionCommitted(this.identifier) || (this.isDeleted && this.isNew)) {\n return false;\n }\n return this.isDeleted || this.isNew || rd.hasChangedAttrs(this.identifier);\n }\n\n @tagged\n get isError() {\n const errorReq = this._errorRequests[this._errorRequests.length - 1];\n if (!errorReq) {\n return false;\n } else {\n return true;\n }\n }\n\n @tagged\n get adapterError() {\n const request = this._lastError;\n if (!request) {\n return null;\n }\n return request.state === 'rejected' && request.response!.data;\n }\n\n @cached\n get isPreloaded() {\n return !this.isEmpty && this.isLoading;\n }\n\n @cached\n get stateName() {\n // we might be empty while loading so check this first\n if (this.isLoading) {\n return 'root.loading';\n\n // got nothing yet or were unloaded\n } else if (this.isEmpty) {\n return 'root.empty';\n\n // deleted substates\n } else if (this.isDeleted) {\n if (this.isSaving) {\n return 'root.deleted.inFlight';\n } else if (this.isSaved) {\n // TODO ensure isSaved isn't true from previous requests\n return 'root.deleted.saved';\n } else if (!this.isValid) {\n return 'root.deleted.invalid';\n } else {\n return 'root.deleted.uncommitted';\n }\n\n // loaded.created substates\n } else if (this.isNew) {\n if (this.isSaving) {\n return 'root.loaded.created.inFlight';\n } else if (!this.isValid) {\n return 'root.loaded.created.invalid';\n }\n return 'root.loaded.created.uncommitted';\n\n // loaded.updated substates\n } else if (this.isSaving) {\n return 'root.loaded.updated.inFlight';\n } else if (!this.isValid) {\n return 'root.loaded.updated.invalid';\n } else if (this.isDirty) {\n return 'root.loaded.updated.uncommitted';\n\n // if nothing remains, we are loaded saved!\n } else {\n return 'root.loaded.saved';\n }\n }\n\n @cached\n get dirtyType() {\n // we might be empty while loading so check this first\n if (this.isLoading || this.isEmpty) {\n return '';\n\n // deleted substates\n } else if (this.isDirty && this.isDeleted) {\n return 'deleted';\n\n // loaded.created substates\n } else if (this.isNew) {\n return 'created';\n\n // loaded.updated substates\n } else if (this.isSaving || !this.isValid || this.isDirty) {\n return 'updated';\n\n // if nothing remains, we are loaded saved!\n } else {\n return '';\n }\n }\n}\ndefineSignal(RecordState.prototype, 'isSaving', false);\n\nfunction notifyErrorsStateChanged(state: RecordState) {\n state.notify('isValid');\n state.notify('isError');\n state.notify('adapterError');\n}\n","/**\n @module @ember-data/model\n */\n\nimport { assert, warn } from '@ember/debug';\nimport EmberObject from '@ember/object';\n\nimport { DEBUG } from '@ember-data/env';\nimport { HAS_DEBUG_PACKAGE } from '@ember-data/packages';\nimport { recordIdentifierFor, storeFor } from '@ember-data/store';\nimport { coerceId } from '@ember-data/store/-private';\nimport { compat } from '@ember-data/tracking';\nimport { defineSignal } from '@ember-data/tracking/-private';\nimport { RecordStore } from '@warp-drive/core-types/symbols';\n\nimport Errors from './errors';\nimport { LEGACY_SUPPORT } from './legacy-relationships-support';\nimport {\n belongsTo,\n changedAttributes,\n createSnapshot,\n deleteRecord,\n destroyRecord,\n hasMany,\n reload,\n rollbackAttributes,\n save,\n serialize,\n unloadRecord,\n} from './model-methods';\nimport notifyChanges from './notify-changes';\nimport RecordState, { notifySignal, tagged } from './record-state';\n\nfunction findPossibleInverses(type, inverseType, name, relationshipsSoFar) {\n const possibleRelationships = relationshipsSoFar || [];\n\n const relationshipMap = inverseType.relationships;\n if (!relationshipMap) {\n return possibleRelationships;\n }\n\n const relationshipsForType = relationshipMap.get(type.modelName);\n const relationships = Array.isArray(relationshipsForType)\n ? relationshipsForType.filter((relationship) => {\n const optionsForRelationship = relationship.options;\n\n if (!optionsForRelationship.inverse && optionsForRelationship.inverse !== null) {\n return true;\n }\n\n return name === optionsForRelationship.inverse;\n })\n : null;\n\n if (relationships) {\n possibleRelationships.push.apply(possibleRelationships, relationships);\n }\n\n //Recurse to support polymorphism\n if (type.superclass) {\n findPossibleInverses(type.superclass, inverseType, name, possibleRelationships);\n }\n\n return possibleRelationships;\n}\n\n/*\n * This decorator allows us to lazily compute\n * an expensive getter on first-access and thereafter\n * never recompute it.\n */\nfunction computeOnce(target, propertyName, desc) {\n const cache = new WeakMap();\n const getter = desc.get;\n desc.get = function () {\n let meta = cache.get(this);\n\n if (!meta) {\n meta = { hasComputed: false, value: undefined };\n cache.set(this, meta);\n }\n\n if (!meta.hasComputed) {\n meta.value = getter.call(this);\n meta.hasComputed = true;\n }\n\n return meta.value;\n };\n return desc;\n}\n\n/**\n Base class from which Models can be defined.\n\n ```js\n import Model, { attr } from '@ember-data/model';\n\n export default class User extends Model {\n @attr name;\n }\n ```\n\n Models are used both to define the static schema for a\n particular resource type as well as the class to instantiate\n to present that data from cache.\n\n @class Model\n @public\n @extends Ember.EmberObject\n*/\nclass Model extends EmberObject {\n ___private_notifications;\n\n init(options = {}) {\n if (DEBUG) {\n if (!options._secretInit && !options._createProps) {\n throw new Error(\n 'You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.'\n );\n }\n }\n const createProps = options._createProps;\n const _secretInit = options._secretInit;\n options._createProps = null;\n options._secretInit = null;\n\n const store = (this.store = _secretInit.store);\n super.init(options);\n\n this[RecordStore] = store;\n\n const identity = _secretInit.identifier;\n _secretInit.cb(this, _secretInit.cache, identity, _secretInit.store);\n\n this.___recordState = DEBUG ? new RecordState(this) : null;\n\n this.setProperties(createProps);\n\n const notifications = store.notifications;\n this.___private_notifications = notifications.subscribe(identity, (identifier, type, field) => {\n notifyChanges(identifier, type, field, this, store);\n });\n }\n\n destroy() {\n const identifier = recordIdentifierFor(this);\n this.___recordState?.destroy();\n const store = storeFor(this);\n store.notifications.unsubscribe(this.___private_notifications);\n // Legacy behavior is to notify the relationships on destroy\n // such that they \"clear\". It's uncertain this behavior would\n // be good for a new model paradigm, likely cheaper and safer\n // to simply not notify, for this reason the store does not itself\n // notify individual changes once the delete has been signaled,\n // this decision is left to model instances.\n\n this.eachRelationship((name, meta) => {\n if (meta.kind === 'belongsTo') {\n this.notifyPropertyChange(name);\n }\n });\n LEGACY_SUPPORT.get(this)?.destroy();\n LEGACY_SUPPORT.delete(this);\n LEGACY_SUPPORT.delete(identifier);\n\n super.destroy();\n }\n\n /**\n If this property is `true` the record is in the `empty`\n state. Empty is the first state all records enter after they have\n been created. Most records created by the store will quickly\n transition to the `loading` state if data needs to be fetched from\n the server or the `created` state if the record is created on the\n client. A record can also enter the empty state if the adapter is\n unable to locate the record.\n\n @property isEmpty\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isEmpty() {\n return this.currentState.isEmpty;\n }\n\n /**\n If this property is `true` the record is in the `loading` state. A\n record enters this state when the store asks the adapter for its\n data. It remains in this state until the adapter provides the\n requested data.\n\n @property isLoading\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isLoading() {\n return this.currentState.isLoading;\n }\n\n /**\n If this property is `true` the record is in the `loaded` state. A\n record enters this state when its data is populated. Most of a\n record's lifecycle is spent inside substates of the `loaded`\n state.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isLoaded; // true\n\n store.findRecord('model', 1).then(function(model) {\n model.isLoaded; // true\n });\n ```\n\n @property isLoaded\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isLoaded() {\n return this.currentState.isLoaded;\n }\n\n /**\n If this property is `true` the record is in the `dirty` state. The\n record has local changes that have not yet been saved by the\n adapter. This includes records that have been created (but not yet\n saved) or deleted.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.hasDirtyAttributes; // true\n\n store.findRecord('model', 1).then(function(model) {\n model.hasDirtyAttributes; // false\n model.set('foo', 'some value');\n model.hasDirtyAttributes; // true\n });\n ```\n\n @since 1.13.0\n @property hasDirtyAttributes\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get hasDirtyAttributes() {\n return this.currentState.isDirty;\n }\n\n /**\n If this property is `true` the record is in the `saving` state. A\n record enters the saving state when `save` is called, but the\n adapter has not yet acknowledged that the changes have been\n persisted to the backend.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isSaving; // false\n let promise = record.save();\n record.isSaving; // true\n promise.then(function() {\n record.isSaving; // false\n });\n ```\n\n @property isSaving\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isSaving() {\n return this.currentState.isSaving;\n }\n\n /**\n If this property is `true` the record is in the `deleted` state\n and has been marked for deletion. When `isDeleted` is true and\n `hasDirtyAttributes` is true, the record is deleted locally but the deletion\n was not yet persisted. When `isSaving` is true, the change is\n in-flight. When both `hasDirtyAttributes` and `isSaving` are false, the\n change has persisted.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isDeleted; // false\n record.deleteRecord();\n\n // Locally deleted\n record.isDeleted; // true\n record.hasDirtyAttributes; // true\n record.isSaving; // false\n\n // Persisting the deletion\n let promise = record.save();\n record.isDeleted; // true\n record.isSaving; // true\n\n // Deletion Persisted\n promise.then(function() {\n record.isDeleted; // true\n record.isSaving; // false\n record.hasDirtyAttributes; // false\n });\n ```\n\n @property isDeleted\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isDeleted() {\n return this.currentState.isDeleted;\n }\n\n /**\n If this property is `true` the record is in the `new` state. A\n record will be in the `new` state when it has been created on the\n client and the adapter has not yet report that it was successfully\n saved.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isNew; // true\n\n record.save().then(function(model) {\n model.isNew; // false\n });\n ```\n\n @property isNew\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isNew() {\n return this.currentState.isNew;\n }\n\n /**\n If this property is `true` the record is in the `valid` state.\n\n A record will be in the `valid` state when the adapter did not report any\n server-side validation failures.\n\n @property isValid\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isValid() {\n return this.currentState.isValid;\n }\n\n /**\n If the record is in the dirty state this property will report what\n kind of change has caused it to move into the dirty\n state. Possible values are:\n\n - `created` The record has been created by the client and not yet saved to the adapter.\n - `updated` The record has been updated by the client and not yet saved to the adapter.\n - `deleted` The record has been deleted by the client and not yet saved to the adapter.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.dirtyType; // 'created'\n ```\n\n @property dirtyType\n @public\n @type {String}\n @readOnly\n */\n @compat\n get dirtyType() {\n return this.currentState.dirtyType;\n }\n\n /**\n If `true` the adapter reported that it was unable to save local\n changes to the backend for any reason other than a server-side\n validation error.\n\n Example\n\n ```javascript\n record.isError; // false\n record.set('foo', 'valid value');\n record.save().then(null, function() {\n record.isError; // true\n });\n ```\n\n @property isError\n @public\n @type {Boolean}\n @readOnly\n */\n @compat\n get isError() {\n return this.currentState.isError;\n }\n set isError(v) {\n if (DEBUG) {\n throw new Error(`isError is not directly settable`);\n }\n }\n\n /**\n If `true` the store is attempting to reload the record from the adapter.\n\n Example\n\n ```javascript\n record.isReloading; // false\n record.reload();\n record.isReloading; // true\n ```\n\n @property isReloading\n @public\n @type {Boolean}\n @readOnly\n */\n\n /**\n All ember models have an id property. This is an identifier\n managed by an external source. These are always coerced to be\n strings before being used internally. Note when declaring the\n attributes for a model it is an error to declare an id\n attribute.\n\n ```javascript\n let record = store.createRecord('model');\n record.id; // null\n\n store.findRecord('model', 1).then(function(model) {\n model.id; // '1'\n });\n ```\n\n @property id\n @public\n @type {String}\n */\n @tagged\n get id() {\n // this guard exists, because some dev-only deprecation code\n // (addListener via validatePropertyInjections) invokes toString before the\n // object is real.\n if (DEBUG) {\n try {\n return recordIdentifierFor(this).id;\n } catch {\n return void 0;\n }\n }\n return recordIdentifierFor(this).id;\n }\n set id(id) {\n const normalizedId = coerceId(id);\n const identifier = recordIdentifierFor(this);\n const didChange = normalizedId !== identifier.id;\n assert(\n `Cannot set ${identifier.type} record's id to ${id}, because id is already ${identifier.id}`,\n !didChange || identifier.id === null\n );\n\n if (normalizedId !== null && didChange) {\n this.store._instanceCache.setRecordId(identifier, normalizedId);\n this.store.notifications.notify(identifier, 'identity');\n }\n }\n\n toString() {\n return `<model::${this.constructor.modelName}:${this.id}>`;\n }\n\n /**\n @property currentState\n @private\n @type {Object}\n */\n // TODO we can probably make this a computeOnce\n // we likely do not need to notify the currentState root anymore\n @tagged\n get currentState() {\n // descriptors are called with the wrong `this` context during mergeMixins\n // when using legacy/classic ember classes. Basically: lazy in prod and eager in dev.\n // so we do this to try to steer folks to the nicer \"dont user currentState\"\n // error.\n if (!DEBUG) {\n if (!this.___recordState) {\n this.___recordState = new RecordState(this);\n }\n }\n return this.___recordState;\n }\n set currentState(_v) {\n throw new Error('cannot set currentState');\n }\n\n /**\n The store service instance which created this record instance\n\n @property store\n @public\n */\n\n /**\n When the record is in the `invalid` state this object will contain\n any errors returned by the adapter. When present the errors hash\n contains keys corresponding to the invalid property names\n and values which are arrays of Javascript objects with two keys:\n\n - `message` A string containing the error message from the backend\n - `attribute` The name of the property associated with this error message\n\n ```javascript\n record.errors.length; // 0\n record.set('foo', 'invalid value');\n record.save().catch(function() {\n record.errors.foo;\n // [{message: 'foo should be a number.', attribute: 'foo'}]\n });\n ```\n\n The `errors` property is useful for displaying error messages to\n the user.\n\n ```handlebars\n <label>Username: <Input @value={{@model.username}} /> </label>\n {{#each @model.errors.username as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n <label>Email: <Input @value={{@model.email}} /> </label>\n {{#each @model.errors.email as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n ```\n\n\n You can also access the special `messages` property on the error\n object to get an array of all the error strings.\n\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n <div class=\"error\">\n {{message}}\n </div>\n {{/each}}\n ```\n\n @property errors\n @public\n @type {Errors}\n */\n @computeOnce\n get errors() {\n const errors = Errors.create({ __record: this });\n this.currentState.updateInvalidErrors(errors);\n return errors;\n }\n\n /**\n This property holds the `AdapterError` object with which\n last adapter operation was rejected.\n\n @property adapterError\n @public\n @type {AdapterError}\n */\n @compat\n get adapterError() {\n return this.currentState.adapterError;\n }\n set adapterError(v) {\n throw new Error(`adapterError is not directly settable`);\n }\n\n /**\n Create a JSON representation of the record, using the serialization\n strategy of the store's adapter.\n\n `serialize` takes an optional hash as a parameter, currently\n supported options are:\n\n - `includeId`: `true` if the record's ID should be included in the\n JSON representation.\n\n @method serialize\n @public\n @param {Object} options\n @return {Object} an object whose values are primitive JSON values only\n */\n\n /*\n We hook the default implementation to ensure\n our tagged properties are properly notified\n as well. We still super for everything because\n sync observers require a direct call occuring\n to trigger their flush. We wouldn't need to\n super in 4.0+ where sync observers are removed.\n */\n notifyPropertyChange(prop) {\n notifySignal(this, prop);\n super.notifyPropertyChange(prop);\n }\n\n /**\n Marks the record as deleted but does not save it. You must call\n `save` afterwards if you want to persist it. You might use this\n method if you want to allow the user to still `rollbackAttributes()`\n after a delete was made.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n softDelete = () => {\n this.args.model.deleteRecord();\n }\n\n confirm = () => {\n this.args.model.save();\n }\n\n undo = () => {\n this.args.model.rollbackAttributes();\n }\n }\n ```\n\n @method deleteRecord\n @public\n */\n\n /**\n Same as `deleteRecord`, but saves the record immediately.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n delete = () => {\n this.args.model.destroyRecord().then(function() {\n this.transitionToRoute('model.index');\n });\n }\n }\n ```\n\n If you pass an object on the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot\n\n ```js\n record.destroyRecord({ adapterOptions: { subscribe: false } });\n ```\n\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n\n export default class PostAdapter extends MyCustomAdapter {\n deleteRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n\n @method destroyRecord\n @public\n @param {Object} options\n @return {Promise} a promise that will be resolved when the adapter returns\n successfully or rejected if the adapter returns with an error.\n */\n\n /**\n Unloads the record from the store. This will not send a delete request\n to your server, it just unloads the record from memory.\n\n @method unloadRecord\n @public\n */\n\n /**\n Returns an object, whose keys are changed properties, and value is\n an [oldProp, newProp] array.\n\n The array represents the diff of the canonical state with the local state\n of the model. Note: if the model is created locally, the canonical state is\n empty since the adapter hasn't acknowledged the attributes yet:\n\n Example\n\n ```app/models/mascot.js\n import Model, { attr } from '@ember-data/model';\n\n export default class MascotModel extends Model {\n @attr('string') name;\n @attr('boolean', {\n defaultValue: false\n })\n isAdmin;\n }\n ```\n\n ```javascript\n let mascot = store.createRecord('mascot');\n\n mascot.changedAttributes(); // {}\n\n mascot.set('name', 'Tomster');\n mascot.changedAttributes(); // { name: [undefined, 'Tomster'] }\n\n mascot.set('isAdmin', true);\n mascot.changedAttributes(); // { isAdmin: [undefined, true], name: [undefined, 'Tomster'] }\n\n mascot.save().then(function() {\n mascot.changedAttributes(); // {}\n\n mascot.set('isAdmin', false);\n mascot.changedAttributes(); // { isAdmin: [true, false] }\n });\n ```\n\n @method changedAttributes\n @public\n @return {Object} an object, whose keys are changed properties,\n and value is an [oldProp, newProp] array.\n */\n\n /**\n If the model `hasDirtyAttributes` this function will discard any unsaved\n changes. If the model `isNew` it will be removed from the store.\n\n Example\n\n ```javascript\n record.name; // 'Untitled Document'\n record.set('name', 'Doc 1');\n record.name; // 'Doc 1'\n record.rollbackAttributes();\n record.name; // 'Untitled Document'\n ```\n\n @since 1.13.0\n @method rollbackAttributes\n @public\n */\n\n /**\n @method _createSnapshot\n @private\n */\n // TODO @deprecate in favor of a public API or examples of how to test successfully\n\n /**\n Save the record and persist any changes to the record to an\n external source via the adapter.\n\n Example\n\n ```javascript\n record.set('name', 'Tomster');\n record.save().then(function() {\n // Success callback\n }, function() {\n // Error callback\n });\n ```\n\n If you pass an object using the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot.\n\n ```js\n record.save({ adapterOptions: { subscribe: false } });\n ```\n\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n\n export default class PostAdapter extends MyCustomAdapter {\n updateRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n\n @method save\n @public\n @param {Object} options\n @return {Promise} a promise that will be resolved when the adapter returns\n successfully or rejected if the adapter returns with an error.\n */\n\n /**\n Reload the record from the adapter.\n\n This will only work if the record has already finished loading.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n async reload = () => {\n await this.args.model.reload();\n // do something with the reloaded model\n }\n }\n ```\n\n @method reload\n @public\n @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter request\n\n @return {Promise} a promise that will be resolved with the record when the\n adapter returns successfully or rejected if the adapter returns\n with an error.\n */\n\n attr() {\n assert(\n 'The `attr` method is not available on Model, a Snapshot was probably expected. Are you passing a Model instead of a Snapshot to your serializer?',\n false\n );\n }\n\n /**\n Get the reference for the specified belongsTo relationship.\n\n For instance, given the following model\n\n ```app/models/blog-post.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class BlogPost extends Model {\n @belongsTo('user', { async: true, inverse: null }) author;\n }\n ```\n\n Then the reference for the author relationship would be\n retrieved from a record instance like so:\n\n ```js\n blogPost.belongsTo('author');\n ```\n\n A `BelongsToReference` is a low-level API that allows access\n and manipulation of a belongsTo relationship.\n\n It is especially useful when you're dealing with `async` relationships\n as it allows synchronous access to the relationship data if loaded, as\n well as APIs for loading, reloading the data or accessing available\n information without triggering a load.\n\n It may also be useful when using `sync` relationships that need to be\n loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @method belongsTo\n @public\n @param {String} name of the relationship\n @since 2.5.0\n @return {BelongsToReference} reference for this relationship\n */\n\n /**\n Get the reference for the specified hasMany relationship.\n\n For instance, given the following model\n\n ```app/models/blog-post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class BlogPost extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n Then the reference for the comments relationship would be\n retrieved from a record instance like so:\n\n ```js\n blogPost.hasMany('comments');\n ```\n\n A `HasManyReference` is a low-level API that allows access\n and manipulation of a hasMany relationship.\n\n It is especially useful when you are dealing with `async` relationships\n as it allows synchronous access to the relationship data if loaded, as\n well as APIs for loading, reloading the data or accessing available\n information without triggering a load.\n\n It may also be useful when using `sync` relationships with `@ember-data/model`\n that need to be loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @method hasMany\n @public\n @param {String} name of the relationship\n @since 2.5.0\n @return {HasManyReference} reference for this relationship\n */\n\n /**\n Given a callback, iterates over each of the relationships in the model,\n invoking the callback with the name of each relationship and its relationship\n descriptor.\n\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, descriptor);\n ```\n\n - `name` the name of the current property in the iteration\n - `descriptor` the meta object that describes this relationship\n\n The relationship descriptor argument is an object with the following properties.\n\n - **name** <span class=\"type\">String</span> the name of this relationship on the Model\n - **kind** <span class=\"type\">String</span> \"hasMany\" or \"belongsTo\"\n - **options** <span class=\"type\">Object</span> the original options hash passed when the relationship was declared\n - **parentType** <span class=\"type\">Model</span> the type of the Model that owns this relationship\n - **type** <span class=\"type\">String</span> the type name of the related Model\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class ApplicationSerializer extends JSONSerializer {\n serialize(record, options) {\n let json = {};\n\n record.eachRelationship(function(name, descriptor) {\n if (descriptor.kind === 'hasMany') {\n let serializedHasManyName = name.toUpperCase() + '_IDS';\n json[serializedHasManyName] = record.get(name).map(r => r.id);\n }\n });\n\n return json;\n }\n }\n ```\n\n @method eachRelationship\n @public\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n eachRelationship(callback, binding) {\n this.constructor.eachRelationship(callback, binding);\n }\n\n relationshipFor(name) {\n return this.constructor.relationshipsByName.get(name);\n }\n\n inverseFor(name) {\n return this.constructor.inverseFor(name, storeFor(this));\n }\n\n eachAttribute(callback, binding) {\n this.constructor.eachAttribute(callback, binding);\n }\n\n static isModel = true;\n\n /**\n Create should only ever be called by the store. To create an instance of a\n `Model` in a dirty state use `store.createRecord`.\n\n To create instances of `Model` in a clean state, use `store.push`\n\n @method create\n @private\n @static\n */\n\n /**\n Represents the model's class name as a string. This can be used to look up the model's class name through\n `Store`'s modelFor method.\n\n `modelName` is generated for you by EmberData. It will be a lowercased, dasherized string.\n For example:\n\n ```javascript\n store.modelFor('post').modelName; // 'post'\n store.modelFor('blog-post').modelName; // 'blog-post'\n ```\n\n The most common place you'll want to access `modelName` is in your serializer's `payloadKeyFromModelName` method. For example, to change payload\n keys to underscore (instead of dasherized), you might use the following code:\n\n ```javascript\n import RESTSerializer from '@ember-data/serializer/rest';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default const PostSerializer = RESTSerializer.extend({\n payloadKeyFromModelName(modelName) {\n return underscore(modelName);\n }\n });\n ```\n @property modelName\n @public\n @type String\n @readonly\n @static\n */\n static modelName = null;\n\n /*\n These class methods below provide relationship\n introspection abilities about relationships.\n\n A note about the computed properties contained here:\n\n **These properties are effectively sealed once called for the first time.**\n To avoid repeatedly doing expensive iteration over a model's fields, these\n values are computed once and then cached for the remainder of the runtime of\n your application.\n\n If your application needs to modify a class after its initial definition\n (for example, using `reopen()` to add additional attributes), make sure you\n do it before using your model with the store, which uses these properties\n extensively.\n */\n\n /**\n For a given relationship name, returns the model type of the relationship.\n\n For example, if you define a model like this:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n\n Calling `store.modelFor('post').typeForRelationship('comments', store)` will return `Comment`.\n\n @method typeForRelationship\n @public\n @static\n @param {String} name the name of the relationship\n @param {store} store an instance of Store\n @return {Model} the type of the relationship, or undefined\n */\n static typeForRelationship(name, store) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationship = this.relationshipsByName.get(name);\n return relationship && store.modelFor(relationship.type);\n }\n\n @computeOnce\n static get inverseMap() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n return Object.create(null);\n }\n\n /**\n Find the relationship which is the inverse of the one asked for.\n\n For example, if you define models like this:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('message') comments;\n }\n ```\n\n ```app/models/message.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class MessageModel extends Model {\n @belongsTo('post') owner;\n }\n ```\n\n ``` js\n store.modelFor('post').inverseFor('comments', store) // { type: App.Message, name: 'owner', kind: 'belongsTo' }\n store.modelFor('message').inverseFor('owner', store) // { type: App.Post, name: 'comments', kind: 'hasMany' }\n ```\n\n @method inverseFor\n @public\n @static\n @param {String} name the name of the relationship\n @param {Store} store\n @return {Object} the inverse relationship, or null\n */\n static inverseFor(name, store) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const inverseMap = this.inverseMap;\n if (inverseMap[name]) {\n return inverseMap[name];\n } else {\n const inverse = this._findInverseFor(name, store);\n inverseMap[name] = inverse;\n return inverse;\n }\n }\n\n //Calculate the inverse, ignoring the cache\n static _findInverseFor(name, store) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationship = this.relationshipsByName.get(name);\n const { options } = relationship;\n const isPolymorphic = options.polymorphic;\n\n //If inverse is manually specified to be null, like `comments: hasMany('message', { inverse: null })`\n const isExplicitInverseNull = options.inverse === null;\n const isAbstractType =\n !isExplicitInverseNull && isPolymorphic && !store.getSchemaDefinitionService().doesTypeExist(relationship.type);\n\n if (isExplicitInverseNull || isAbstractType) {\n assert(\n `No schema for the abstract type '${relationship.type}' for the polymorphic relationship '${name}' on '${this.modelName}' was provided by the SchemaDefinitionService.`,\n !isPolymorphic || isExplicitInverseNull\n );\n return null;\n }\n\n let fieldOnInverse, inverseKind, inverseRelationship, inverseOptions;\n const inverseSchema = this.typeForRelationship(name, store);\n\n // if the type does not exist and we are not polymorphic\n //If inverse is specified manually, return the inverse\n if (options.inverse !== undefined) {\n fieldOnInverse = options.inverse;\n inverseRelationship = inverseSchema && inverseSchema.relationshipsByName.get(fieldOnInverse);\n\n assert(\n `We found no field named '${fieldOnInverse}' on the schema for '${inverseSchema.modelName}' to be the inverse of the '${name}' relationship on '${this.modelName}'. This is most likely due to a missing field on your model definition.`,\n inverseRelationship\n );\n\n // TODO probably just return the whole inverse here\n inverseKind = inverseRelationship.kind;\n inverseOptions = inverseRelationship.options;\n } else {\n //No inverse was specified manually, we need to use a heuristic to guess one\n if (relationship.type === relationship.parentModelName) {\n warn(\n `Detected a reflexive relationship named '${name}' on the schema for '${relationship.type}' without an inverse option. Look at https://guides.emberjs.com/current/models/relationships/#toc_reflexive-relations for how to explicitly specify inverses.`,\n false,\n {\n id: 'ds.model.reflexive-relationship-without-inverse',\n }\n );\n }\n\n let possibleRelationships = findPossibleInverses(this, inverseSchema, name);\n\n if (possibleRelationships.length === 0) {\n return null;\n }\n\n if (DEBUG) {\n const filteredRelationships = possibleRelationships.filter((possibleRelationship) => {\n const optionsForRelationship = possibleRelationship.options;\n return name === optionsForRelationship.inverse;\n });\n\n assert(\n \"You defined the '\" +\n name +\n \"' relationship on \" +\n this +\n ', but you defined the inverse relationships of type ' +\n inverseSchema.toString() +\n ' multiple times. Look at https://guides.emberjs.com/current/models/relationships/#toc_explicit-inverses for how to explicitly specify inverses',\n filteredRelationships.length < 2\n );\n }\n\n const explicitRelationship = possibleRelationships.find((relationship) => relationship.options.inverse === name);\n if (explicitRelationship) {\n possibleRelationships = [explicitRelationship];\n }\n\n assert(\n \"You defined the '\" +\n name +\n \"' relationship on \" +\n this +\n ', but multiple possible inverse relationships of type ' +\n this +\n ' were found on ' +\n inverseSchema +\n '. Look at https://guides.emberjs.com/current/models/relationships/#toc_explicit-inverses for how to explicitly specify inverses',\n possibleRelationships.length === 1\n );\n\n fieldOnInverse = possibleRelationships[0].name;\n inverseKind = possibleRelationships[0].kind;\n inverseOptions = possibleRelationships[0].options;\n }\n\n // ensure inverse is properly configured\n if (DEBUG) {\n if (isPolymorphic) {\n assert(\n `Relationships that satisfy polymorphic relationships MUST define which abstract-type they are satisfying using 'as'. The field '${fieldOnInverse}' on type '${inverseSchema.modelName}' is misconfigured.`,\n inverseOptions.as\n );\n assert(\n `options.as should match the expected type of the polymorphic relationship. Expected field '${fieldOnInverse}' on type '${inverseSchema.modelName}' to specify '${relationship.type}' but found '${inverseOptions.as}'`,\n !!inverseOptions.as && relationship.type === inverseOptions.as\n );\n }\n }\n\n // ensure we are properly configured\n if (DEBUG) {\n if (inverseOptions.polymorphic) {\n assert(\n `Relationships that satisfy polymorphic relationships MUST define which abstract-type they are satisfying using 'as'. The field '${name}' on type '${this.modelName}' is misconfigured.`,\n options.as\n );\n assert(\n `options.as should match the expected type of the polymorphic relationship. Expected field '${name}' on type '${this.modelName}' to specify '${inverseRelationship.type}' but found '${options.as}'`,\n !!options.as && inverseRelationship.type === options.as\n );\n }\n }\n\n assert(\n `The ${inverseSchema.modelName}:${fieldOnInverse} relationship declares 'inverse: null', but it was resolved as the inverse for ${this.modelName}:${name}.`,\n inverseOptions.inverse !== null\n );\n\n return {\n type: inverseSchema,\n name: fieldOnInverse,\n kind: inverseKind,\n options: inverseOptions,\n };\n }\n\n /**\n The model's relationships as a map, keyed on the type of the\n relationship. The value of each entry is an array containing a descriptor\n for each relationship with that type, describing the name of the relationship\n as well as the type.\n\n For example, given the following model definition:\n\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n @hasMany('post') posts;\n }\n ```\n\n This computed property would return a map describing these\n relationships, like this:\n\n ```javascript\n import Blog from 'app/models/blog';\n import User from 'app/models/user';\n import Post from 'app/models/post';\n\n let relationships = Blog.relationships;\n relationships.user;\n //=> [ { name: 'users', kind: 'hasMany' },\n // { name: 'owner', kind: 'belongsTo' } ]\n relationships.post;\n //=> [ { name: 'posts', kind: 'hasMany' } ]\n ```\n\n @property relationships\n @public\n @static\n @type Map\n @readOnly\n */\n\n @computeOnce\n static get relationships() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map();\n const relationshipsByName = this.relationshipsByName;\n\n // Loop through each computed property on the class\n relationshipsByName.forEach((desc) => {\n const { type } = desc;\n\n if (!map.has(type)) {\n map.set(type, []);\n }\n\n map.get(type).push(desc);\n });\n\n return map;\n }\n\n /**\n A hash containing lists of the model's relationships, grouped\n by the relationship kind. For example, given a model with this\n definition:\n\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relationshipNames = Blog.relationshipNames;\n relationshipNames.hasMany;\n //=> ['users', 'posts']\n relationshipNames.belongsTo;\n //=> ['owner']\n ```\n\n @property relationshipNames\n @public\n @static\n @type Object\n @readOnly\n */\n @computeOnce\n static get relationshipNames() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const names = {\n hasMany: [],\n belongsTo: [],\n };\n\n this.eachComputedProperty((name, meta) => {\n if (meta.kind === 'hasMany' || meta.kind === 'belongsTo') {\n names[meta.kind].push(name);\n }\n });\n\n return names;\n }\n\n /**\n An array of types directly related to a model. Each type will be\n included once, regardless of the number of relationships it has with\n the model.\n\n For example, given a model with this definition:\n\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relatedTypes = Blog.relatedTypes');\n //=> ['user', 'post']\n ```\n\n @property relatedTypes\n @public\n @static\n @type Array\n @readOnly\n */\n @computeOnce\n static get relatedTypes() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const types = [];\n\n const rels = this.relationshipsObject;\n const relationships = Object.keys(rels);\n\n // create an array of the unique types involved\n // in relationships\n for (let i = 0; i < relationships.length; i++) {\n const name = relationships[i];\n const meta = rels[name];\n const modelName = meta.type;\n\n if (types.indexOf(modelName) === -1) {\n types.push(modelName);\n }\n }\n\n return types;\n }\n\n /**\n A map whose keys are the relationships of a model and whose values are\n relationship descriptors.\n\n For example, given a model with this\n definition:\n\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relationshipsByName = Blog.relationshipsByName;\n relationshipsByName.users;\n //=> { name: 'users', kind: 'hasMany', type: 'user', options: Object }\n relationshipsByName.owner;\n //=> { name: 'owner', kind: 'belongsTo', type: 'user', options: Object }\n ```\n\n @property relationshipsByName\n @public\n @static\n @type Map\n @readOnly\n */\n @computeOnce\n static get relationshipsByName() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const map = new Map();\n const rels = this.relationshipsObject;\n const relationships = Object.keys(rels);\n\n for (let i = 0; i < relationships.length; i++) {\n const name = relationships[i];\n const value = rels[name];\n\n map.set(value.name, value);\n }\n\n return map;\n }\n\n @computeOnce\n static get relationshipsObject() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationships = Object.create(null);\n const modelName = this.modelName;\n this.eachComputedProperty((name, meta) => {\n if (meta.kind === 'hasMany' || meta.kind === 'belongsTo') {\n // TODO deprecate key being here\n meta.key = name;\n meta.name = name;\n meta.parentModelName = modelName;\n relationships[name] = meta;\n\n assert(\n `You should not specify both options.as and options.inverse as null on ${modelName}.${meta.name}, as if there is no inverse field there is no abstract type to conform to. You may have intended for this relationship to be polymorphic, or you may have mistakenly set inverse to null.`,\n !(meta.options.inverse === null && meta.options.as?.length > 0)\n );\n }\n });\n return relationships;\n }\n\n /**\n A map whose keys are the fields of the model and whose values are strings\n describing the kind of the field. A model's fields are the union of all of its\n attributes and relationships.\n\n For example:\n\n ```app/models/blog.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n\n @attr('string') title;\n }\n ```\n\n ```js\n import Blog from 'app/models/blog'\n\n let fields = Blog.fields;\n fields.forEach(function(kind, field) {\n // do thing\n });\n\n // prints:\n // users, hasMany\n // owner, belongsTo\n // posts, hasMany\n // title, attribute\n ```\n\n @property fields\n @public\n @static\n @type Map\n @readOnly\n */\n @computeOnce\n static get fields() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const map = new Map();\n\n this.eachComputedProperty((name, meta) => {\n if (meta.kind === 'hasMany' || meta.kind === 'belongsTo') {\n map.set(name, meta.kind);\n } else if (meta.kind === 'attribute') {\n map.set(name, 'attribute');\n }\n });\n\n return map;\n }\n\n /**\n Given a callback, iterates over each of the relationships in the model,\n invoking the callback with the name of each relationship and its relationship\n descriptor.\n\n @method eachRelationship\n @public\n @static\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n static eachRelationship(callback, binding) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.relationshipsByName.forEach((relationship, name) => {\n callback.call(binding, name, relationship);\n });\n }\n\n /**\n Given a callback, iterates over each of the types related to a model,\n invoking the callback with the related type's class. Each type will be\n returned just once, regardless of how many different relationships it has\n with a model.\n\n @method eachRelatedType\n @public\n @static\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n static eachRelatedType(callback, binding) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationshipTypes = this.relatedTypes;\n\n for (let i = 0; i < relationshipTypes.length; i++) {\n const type = relationshipTypes[i];\n callback.call(binding, type);\n }\n }\n\n static determineRelationshipType(knownSide, store) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const knownKey = knownSide.name;\n const knownKind = knownSide.kind;\n const inverse = this.inverseFor(knownKey, store);\n // let key;\n\n if (!inverse) {\n return knownKind === 'belongsTo' ? 'oneToNone' : 'manyToNone';\n }\n\n // key = inverse.name;\n const otherKind = inverse.kind;\n\n if (otherKind === 'belongsTo') {\n return knownKind === 'belongsTo' ? 'oneToOne' : 'manyToOne';\n } else {\n return knownKind === 'belongsTo' ? 'oneToMany' : 'manyToMany';\n }\n }\n\n /**\n A map whose keys are the attributes of the model (properties\n described by attr) and whose values are the meta object for the\n property.\n\n Example\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n ```\n\n ```javascript\n import Person from 'app/models/person'\n\n let attributes = Person.attributes\n\n attributes.forEach(function(meta, name) {\n // do thing\n });\n\n // prints:\n // firstName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", kind: 'attribute', options: Object, parentType: function, name: \"birthday\"}\n ```\n\n @property attributes\n @public\n @static\n @type {Map}\n @readOnly\n */\n @computeOnce\n static get attributes() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map();\n\n this.eachComputedProperty((name, meta) => {\n if (meta.kind === 'attribute') {\n assert(\n \"You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: attr('<type>')` from \" +\n this.toString(),\n name !== 'id'\n );\n\n // TODO deprecate key being here\n meta.key = name;\n meta.name = name;\n map.set(name, meta);\n }\n });\n\n return map;\n }\n\n /**\n A map whose keys are the attributes of the model (properties\n described by attr) and whose values are type of transformation\n applied to each attribute. This map does not include any\n attributes that do not have an transformation type.\n\n Example\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PersonModel extends Model {\n @attr firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n ```\n\n ```javascript\n import Person from 'app/models/person';\n\n let transformedAttributes = Person.transformedAttributes\n\n transformedAttributes.forEach(function(field, type) {\n // do thing\n });\n\n // prints:\n // lastName string\n // birthday date\n ```\n\n @property transformedAttributes\n @public\n @static\n @type {Map}\n @readOnly\n */\n @computeOnce\n static get transformedAttributes() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map();\n\n this.eachAttribute((name, meta) => {\n if (meta.type) {\n map.set(name, meta.type);\n }\n });\n\n return map;\n }\n\n /**\n Iterates through the attributes of the model, calling the passed function on each\n attribute.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, meta);\n ```\n\n - `name` the name of the current property in the iteration\n - `meta` the meta object for the attribute property in the iteration\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```javascript\n import Model, { attr } from '@ember-data/model';\n\n class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n\n PersonModel.eachAttribute(function(name, meta) {\n // do thing\n });\n\n // prints:\n // firstName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", kind: 'attribute', options: Object, parentType: function, name: \"birthday\"}\n ```\n\n @method eachAttribute\n @public\n @param {Function} callback The callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @static\n */\n static eachAttribute(callback, binding) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.attributes.forEach((meta, name) => {\n callback.call(binding, name, meta);\n });\n }\n\n /**\n Iterates through the transformedAttributes of the model, calling\n the passed function on each attribute. Note the callback will not be\n called for any attributes that do not have an transformation type.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, type);\n ```\n\n - `name` the name of the current property in the iteration\n - `type` a string containing the name of the type of transformed\n applied to the attribute\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```javascript\n import Model, { attr } from '@ember-data/model';\n\n let Person = Model.extend({\n firstName: attr(),\n lastName: attr('string'),\n birthday: attr('date')\n });\n\n Person.eachTransformedAttribute(function(name, type) {\n // do thing\n });\n\n // prints:\n // lastName string\n // birthday date\n ```\n\n @method eachTransformedAttribute\n @public\n @param {Function} callback The callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @static\n */\n static eachTransformedAttribute(callback, binding) {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.transformedAttributes.forEach((type, name) => {\n callback.call(binding, name, type);\n });\n }\n\n /**\n Returns the name of the model class.\n\n @method toString\n @public\n @static\n */\n static toString() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n return `model:${this.modelName}`;\n }\n}\n\nModel.prototype.save = save;\nModel.prototype.destroyRecord = destroyRecord;\nModel.prototype.unloadRecord = unloadRecord;\nModel.prototype.hasMany = hasMany;\nModel.prototype.belongsTo = belongsTo;\nModel.prototype.serialize = serialize;\nModel.prototype._createSnapshot = createSnapshot;\nModel.prototype.deleteRecord = deleteRecord;\nModel.prototype.changedAttributes = changedAttributes;\nModel.prototype.rollbackAttributes = rollbackAttributes;\nModel.prototype.reload = reload;\n\ndefineSignal(Model.prototype, 'isReloading', false);\n\n// this is required to prevent `init` from passing\n// the values initialized during create to `setUnknownProperty`\nModel.prototype._createProps = null;\nModel.prototype._secretInit = null;\n\nif (HAS_DEBUG_PACKAGE) {\n /**\n Provides info about the model for debugging purposes\n by grouping the properties into more semantic groups.\n\n Meant to be used by debugging tools such as the Chrome Ember Extension.\n\n - Groups all attributes in \"Attributes\" group.\n - Groups all belongsTo relationships in \"Belongs To\" group.\n - Groups all hasMany relationships in \"Has Many\" group.\n - Groups all flags in \"Flags\" group.\n - Flags relationship CPs as expensive properties.\n\n @method _debugInfo\n @for Model\n @private\n */\n Model.prototype._debugInfo = function () {\n const relationships = {};\n const expensiveProperties = [];\n\n const identifier = recordIdentifierFor(this);\n const schema = this.store.getSchemaDefinitionService();\n const attrDefs = schema.attributesDefinitionFor(identifier);\n const relDefs = schema.relationshipsDefinitionFor(identifier);\n\n const attributes = Object.keys(attrDefs);\n attributes.unshift('id');\n\n const groups = [\n {\n name: 'Attributes',\n properties: attributes,\n expand: true,\n },\n ];\n\n Object.keys(relDefs).forEach((name) => {\n const relationship = relDefs[name];\n\n let properties = relationships[relationship.kind];\n\n if (properties === undefined) {\n properties = relationships[relationship.kind] = [];\n groups.push({\n name: relationship.kind,\n properties,\n expand: true,\n });\n }\n properties.push(name);\n expensiveProperties.push(name);\n });\n\n groups.push({\n name: 'Flags',\n properties: ['isLoaded', 'hasDirtyAttributes', 'isSaving', 'isDeleted', 'isError', 'isNew', 'isValid'],\n });\n\n return {\n propertyInfo: {\n // include all other mixins / properties (not just the grouped ones)\n includeOtherProperties: true,\n groups: groups,\n // don't pre-calculate unless cached\n expensiveProperties: expensiveProperties,\n },\n };\n };\n}\n\nif (DEBUG) {\n const lookupDescriptor = function lookupDescriptor(obj, keyName) {\n let current = obj;\n do {\n const descriptor = Object.getOwnPropertyDescriptor(current, keyName);\n if (descriptor !== undefined) {\n return descriptor;\n }\n current = Object.getPrototypeOf(current);\n } while (current !== null);\n return null;\n };\n\n Model.reopen({\n init() {\n this._super(...arguments);\n\n const ourDescriptor = lookupDescriptor(Model.prototype, 'currentState');\n const theirDescriptor = lookupDescriptor(this, 'currentState');\n const realState = this.___recordState;\n if (ourDescriptor.get !== theirDescriptor.get || realState !== this.currentState) {\n throw new Error(\n `'currentState' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`\n );\n }\n\n const ID_DESCRIPTOR = lookupDescriptor(Model.prototype, 'id');\n const idDesc = lookupDescriptor(this, 'id');\n\n if (idDesc.get !== ID_DESCRIPTOR.get) {\n throw new Error(\n `You may not set 'id' as an attribute on your model. Please remove any lines that look like: \\`id: attr('<type>')\\` from ${this.constructor.toString()}`\n );\n }\n },\n });\n\n Model.reopen = function deprecatedReopen() {\n assert(`Model.reopen is deprecated. Use Foo extends Model to extend your class instead.`);\n };\n\n Model.reopenClass = function deprecatedReopenClass() {\n assert(\n `Model.reopenClass is deprecated. Use Foo extends Model to add static methods and properties to your class instead.`\n );\n };\n}\n\nexport default Model;\n"],"names":["RelatedCollection","RecordArray","constructor","options","isLoaded","isAsync","isPolymorphic","identifier","key","MUTATE","target","receiver","prop","args","_SIGNAL","Reflect","set","mutateReplaceRelatedRecords","index","prior","value","mutateReplaceRelatedRecord","newValues","extractIdentifiersFromRecords","assertNoDuplicates","currentState","push","macroCondition","getOwnConfig","deprecations","DEPRECATE_MANY_ARRAY_DUPLICATES","seen","Set","unique","forEach","item","recordIdentifierFor","has","add","newArgs","Array","from","result","apply","length","mutateAddToRelatedRecords","mutateRemoveFromRelatedRecords","unshift","mutateSortRelatedRecords","map","start","deleteCount","adds","SOURCE","splice","current","concat","slice","assert","notify","signal","ARRAY_SIGNAL","shouldReset","notifyArray","reload","_manager","reloadHasMany","createRecord","hash","store","modelName","record","destroy","prototype","cache","_inverseIsAsync","DEPRECATED_CLASS_NAME","assertRecordPassedToHasMany","records","extractIdentifierFromRecord","recordOrPromiseRecord","collection","callback","reason","state","size","duplicates","filter","currentValue","currentIndex","indexOf","deprecate","type","id","lid","r","isStableIdentifier","sort","a","b","localeCompare","join","for","until","since","enabled","available","Error","operationInfo","mutate","op","field","mutation","addToTransaction","_applyDecoratedDescriptor","property","decorators","descriptor","context","desc","Object","keys","enumerable","configurable","initializer","writable","reverse","reduce","decorator","call","undefined","defineProperty","PromiseObject","ObjectProxy","extend","PromiseProxyMixin","Extended","PromiseBelongsTo","_dec","computed","_class","legacySupport","_belongsToState","ref","referenceFor","meta","content","reloadBelongsTo","cached","getOwnPropertyDescriptor","PromiseManyArray","promise","_update","isDestroyed","DEPRECATE_COMPUTED_CHAINS","cb","then","s","f","catch","finally","links","tapPromise","create","compat","defineSignal","get","proxy","isPending","isSettled","isFulfilled","isRejected","Promise","resolve","error","assertPolymorphicType","env","DEBUG","parentIdentifier","parentDefinition","addedIdentifier","inverseIsImplicit","getSchemaDefinitionService","relationshipsDefinitionFor","inverseKey","as","isResourceIdentiferWithRelatedLinks","Boolean","related","HasManyReference","graph","hasManyRelationship","___token","___identifier","___relatedTokenMap","definition","notifications","subscribe","_","bucket","notifiedKey","_ref","Map","unsubscribe","token","clear","identifiers","resource","_resource","data","resourceIdentifier","identifierCache","getOrCreateRecordIdentifier","delete","getRelationship","remoteType","ids","link","href","doc","skipFetch","dataDoc","isArray","isResourceData","isMaybeResource","_push","i","relationshipMeta","added","newData","_join","load","_isLoaded","hasRelationshipDataProperty","hasReceivedData","relationship","getData","every","_instanceCache","recordIsLoaded","support","LEGACY_SUPPORT","loaded","getManyArray","fetchSyncRel","areAllInverseRecordsLoaded","getHasMany","object","k","BelongsToReference","belongsToRelationship","___relatedToken","peekRecord","getBelongsTo","lookupLegacySupport","isDestroying","LegacySupport","storeFor","peekCache","packages","HAS_JSON_API_PACKAGE","graphFor","importSync","_manyArrayCache","_relationshipPromisesCache","_relationshipProxyCache","_pending","references","_syncArray","array","jsonApi","_getCurrentState","fastPush","_findBelongsTo","_findBelongsToByJsonApiResource","handleCompletedRelationshipRequest","e","loadingPromise","isBelongsTo","hasFailedLoadAttempt","shouldForceReload","_updatePromiseProxyFor","relatedIdentifier","getRecord","toReturn","setDirtyBelongsTo","manyArray","inverseIsAsync","manager","allowMutation","fetchAsyncHasMany","_findHasManyByJsonApiResource","anyUnloaded","kind","promiseProxy","name","reference","actualRelationshipKind","relationshipKind","upgradeStore","adapter","adapterFor","isStale","hasDematerializedInverse","isEmpty","allInverseRecordsAreLoaded","shouldFindViaLink","findHasMany","inverseType","request","useLink","cacheOptions","Symbol","preferLocalCache","hasLocalPartialData","attemptLocalCache","hasData","future","localDataIsEmpty","resourceIsLocal","recordExt","isHasMany","_flush","_graph","relationshipData","unloaded","find","instanceCache","_initializerDefineProperty","ArrayProxyWithCustomOverrides","ArrayProxy","Errors","_dec2","mapBy","_dec3","_dec4","not","_descriptor","_descriptor2","errorsByAttributeName","errorsFor","attribute","errors","A","unknownProperty","messages","_findOrCreateMessages","addObjects","__record","notifyPropertyChange","messagesArray","_messages","message","err","findBy","remove","rejectBy","setObjects","replace","attributes","rollbackAttributes","isNew","RecordStore","rollbackAttrs","cleanErrorRequests","unloadRecord","belongsTo","hasMany","isReloading","changedAttributes","changedAttrs","serialize","serializeRecord","deleteRecord","save","isDeleted","saveRecord","destroyRecord","createSnapshot","_fetchManager","FetchManager","notifyChanges","notifyAttribute","eachAttribute","relationshipsByName","notifyRelationship","eachRelationship","hasPromise","async","cacheFor","getAttr","SOURCE_POINTER_REGEXP","SOURCE_POINTER_PRIMARY_REGEXP","PRIMARY_ATTRIBUTE_KEY","isInvalidError","isAdapterError","code","tagged","_target","getter","setter","getSignal","lastValue","v","notifySignal","obj","peekSignal","RecordState","identity","pendingCount","fulfilledCount","rejectedCount","_errorRequests","_lastError","requests","getRequestStateService","handleRequest","req","isSaving","response","notifyErrorsStateChanged","subscribeForRecord","lastRequest","getLastRequestForRecord","handler","updateInvalidErrors","getErrors","jsonApiErrors","source","pointer","keyMatch","match","search","errMsg","detail","title","isLoading","isSaved","rd","isDeletionCommitted","isValid","isDirty","hasChangedAttrs","isError","errorReq","adapterError","isPreloaded","stateName","dirtyType","findPossibleInverses","relationshipsSoFar","possibleRelationships","relationshipMap","relationships","relationshipsForType","optionsForRelationship","inverse","superclass","computeOnce","propertyName","WeakMap","hasComputed","Model","_class2","EmberObject","___private_notifications","init","_secretInit","_createProps","createProps","___recordState","setProperties","hasDirtyAttributes","normalizedId","coerceId","didChange","setRecordId","toString","_v","attr","binding","relationshipFor","inverseFor","typeForRelationship","modelFor","inverseMap","_findInverseFor","polymorphic","isExplicitInverseNull","isAbstractType","doesTypeExist","fieldOnInverse","inverseKind","inverseRelationship","inverseOptions","inverseSchema","parentModelName","warn","filteredRelationships","possibleRelationship","explicitRelationship","relationshipNames","names","eachComputedProperty","relatedTypes","types","rels","relationshipsObject","fields","eachRelatedType","relationshipTypes","determineRelationshipType","knownSide","knownKey","knownKind","otherKind","transformedAttributes","eachTransformedAttribute","isModel","_createSnapshot","includeDataAdapter","_debugInfo","expensiveProperties","schema","attrDefs","attributesDefinitionFor","relDefs","groups","properties","expand","propertyInfo","includeOtherProperties","lookupDescriptor","keyName","getPrototypeOf","reopen","_super","arguments","ourDescriptor","theirDescriptor","realState","ID_DESCRIPTOR","idDesc","deprecatedReopen","reopenClass","deprecatedReopenClass"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AA4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMA,iBAAiB,SAASC,WAAW,CAAC;AAEzD;AACF;AACA;AACA;AACA;;AAIE;AACF;AACA;AACA;AACA;;AAIE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUE;AACF;AACA;AACA;AACA;AACA;;AAIE;;EAMAC,WAAWA,CAACC,OAA4B,EAAE;IACxC,KAAK,CAACA,OAAkD,CAAC,CAAA;AACzD,IAAA,IAAI,CAACC,QAAQ,GAAGD,OAAO,CAACC,QAAQ,IAAI,KAAK,CAAA;AACzC,IAAA,IAAI,CAACC,OAAO,GAAGF,OAAO,CAACE,OAAO,IAAI,KAAK,CAAA;AACvC,IAAA,IAAI,CAACC,aAAa,GAAGH,OAAO,CAACG,aAAa,IAAI,KAAK,CAAA;AACnD,IAAA,IAAI,CAACC,UAAU,GAAGJ,OAAO,CAACI,UAAU,CAAA;AACpC,IAAA,IAAI,CAACC,GAAG,GAAGL,OAAO,CAACK,GAAG,CAAA;AACxB,GAAA;EAEA,CAACC,MAAM,CACLC,CAAAA,MAAgC,EAChCC,QAAgD,EAChDC,IAAY,EACZC,IAAe,EACfC,OAAe,EACN;AACT,IAAA,QAAQF,IAAI;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C,SAAS,EAAE,CAAA;AACjC,IAAA,OAAOD,QAAQ,IAAIA,QAAQ,CAACE,IAAI,GAAG,IAAI,CAAC5I,KAAK,CAACuL,UAAU,CAAC7C,QAAQ,CAACE,IAAI,CAAC,GAAG,IAAI,CAAA;AAChF,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAYE,MAAMsB,IAAIA,CAACpO,OAAiC,EAAkC;IAC5E,MAAM6O,OAAsB,GAAIC,cAAc,CAAgD3E,GAAG,CAC/F,IAAI,CAAC2B,aACP,CAAE,CAAA;IACF,MAAMmD,YAAY,GAChB,CAAC,IAAI,CAACM,qBAAqB,CAACvD,UAAU,CAAC9L,OAAO,IAAI,CAACgP,0BAA0B,CAAC,IAAI,CAAChL,KAAK,EAAE,IAAI,CAAC2I,SAAS,EAAE,CAAC,CAAA;IAC7G,OAAOoC,YAAY,GACfJ,OAAO,CAAC7F,eAAe,CAAC,IAAI,CAAC3I,GAAG,EAAEL,OAAO,CAAC,CAACyJ,IAAI,CAAC,MAAM,IAAI,CAACxI,KAAK,EAAE,CAAC;AACnE;AACA;IACC4N,OAAO,CAACa,YAAY,CAAC,IAAI,CAACrP,GAAG,EAAEL,OAAO,CAAoC,CAAA;AACjF,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAUE6D,MAAMA,CAAC7D,OAAiC,EAAE;IACxC,MAAM6O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AAS,CAAA;AACpC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACIhb,QAAQA,GAAG;AACb,IAAA,OAAO,IAAI,CAACqB,YAAY,CAACrB,QAAQ,CAAA;AACnC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACIod,kBAAkBA,GAAG;AACvB,IAAA,OAAO,IAAI,CAAC/b,YAAY,CAACga,OAAO,CAAA;AAClC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAIE,IACIvB,QAAQA,GAAG;AACb,IAAA,OAAO,IAAI,CAACzY,YAAY,CAACyY,QAAQ,CAAA;AACnC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAOE,IACI3C,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAAC9V,YAAY,CAAC8V,SAAS,CAAA;AACpC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACId,KAAKA,GAAG;AACV,IAAA,OAAO,IAAI,CAAChV,YAAY,CAACgV,KAAK,CAAA;AAChC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAGE,IACI+E,OAAOA,GAAG;AACZ,IAAA,OAAO,IAAI,CAAC/Z,YAAY,CAAC+Z,OAAO,CAAA;AAClC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EASE,IACI2O,MAAMA,GAAG;AACX,IAAA,MAAMA,MAAM,GAAGX,MAAM,CAACxK,MAAM,CAAC;AAAEyL,MAAAA,QAAQ,EAAE,IAAA;AAAK,KAAC,CAAC,CAAA;AAChD,IAAA,IAAI,CAACnU,YAAY,CAACgZ,mBAAmB,CAACnF,MAAM,CAAC,CAAA;AAC7C,IAAA,OAAOA,MAAM,CAAA;AACf,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;EAEE,IACIuG,YAAYA,GAAG;AACjB,IAAA,OAAO,IAAI,CAACpa,YAAY,CAACoa,YAAY,CAAA;AACvC,GAAA;EACA,IAAIA,YAAYA,CAAC1C,CAAC,EAAE;AAClB,IAAA,MAAM,IAAIxS,KAAK,CAAE,CAAA,qCAAA,CAAsC,CAAC,CAAA;AAC1D,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEkP,oBAAoBA,CAACjV,IAAI,EAAE;AACzBwY,IAAAA,YAAY,CAAC,IAAI,EAAExY,IAAI,CAAC,CAAA;AACxB,IAAA,KAAK,CAACiV,oBAAoB,CAACjV,IAAI,CAAC,CAAA;AAClC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUE;AACF;AACA;AACA;AACA;AACA;;AAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKE;AACF;AACA;AACA;AACE;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQEmd,EAAAA,IAAIA,GAAG;AACLra,IAAAA,MAAM,CACJ,kJAAkJ,EAClJ,KACF,CAAC,CAAA;AACH,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcEwU,EAAAA,gBAAgBA,CAAChT,QAAQ,EAA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