@ember-data/model 4.12.1 → 4.12.2
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-many-26d79228.js","sources":["../src/-private/util.ts","../src/-private/attr.js","../../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","../../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","../src/-private/promise-proxy-base.js","../src/-private/deprecated-promise-proxy.ts","../src/-private/errors.ts","../src/-private/many-array.ts","../src/-private/promise-belongs-to.ts","../src/-private/promise-many-array.ts","../src/-private/debug/assert-polymorphic-type.js","../src/-private/references/belongs-to.ts","../src/-private/references/has-many.ts","../src/-private/legacy-relationships-support.ts","../src/-private/notify-changes.ts","../src/-private/record-state.ts","../src/-private/relationship-meta.ts","../src/-private/model.js","../src/-private/belongs-to.js","../src/-private/has-many.js"],"sourcesContent":["export type DecoratorPropertyDescriptor = (PropertyDescriptor & { initializer?: any }) | undefined;\n\nexport function isElementDescriptor(args: any[]): args is [object, string, DecoratorPropertyDescriptor] {\n let [maybeTarget, maybeKey, maybeDesc] = args;\n\n return (\n // Ensure we have the right number of args\n args.length === 3 &&\n // Make sure the target is a class or object (prototype)\n (typeof maybeTarget === 'function' || (typeof maybeTarget === 'object' && maybeTarget !== null)) &&\n // Make sure the key is a string\n typeof maybeKey === 'string' &&\n // Make sure the descriptor is the right shape\n ((typeof maybeDesc === 'object' &&\n maybeDesc !== null &&\n 'enumerable' in maybeDesc &&\n 'configurable' in maybeDesc) ||\n // TS compatibility\n maybeDesc === undefined)\n );\n}\n\nexport function computedMacroWithOptionalParams(fn) {\n return (...maybeDesc: any[]) => (isElementDescriptor(maybeDesc) ? fn()(...maybeDesc) : fn(...maybeDesc));\n}\n","import { assert } from '@ember/debug';\nimport { computed } from '@ember/object';\n\nimport { DEBUG } from '@ember-data/env';\nimport { recordIdentifierFor } from '@ember-data/store';\nimport { peekCache } from '@ember-data/store/-private';\n\nimport { computedMacroWithOptionalParams } from './util';\n\n/**\n @module @ember-data/model\n*/\n\n/**\n `attr` defines an attribute on a [Model](/ember-data/release/classes/Model).\n By default, attributes are passed through as-is, however you can specify an\n optional type to have the value automatically transformed.\n Ember Data ships with four basic transform types: `string`, `number`,\n `boolean` and `date`. You can define your own transforms by subclassing\n [Transform](/ember-data/release/classes/Transform).\n\n Note that you cannot use `attr` to define an attribute of `id`.\n\n `attr` takes an optional hash as a second parameter, currently\n supported options are:\n\n - `defaultValue`: Pass a string or a function to be called to set the attribute\n to a default value if and only if the key is absent from the payload response.\n\n Example\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 @attr('boolean', { defaultValue: false }) verified;\n }\n ```\n\n Default value can also be a function. This is useful it you want to return\n a new object for each attribute.\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 @attr({\n defaultValue() {\n return {};\n }\n })\n settings;\n }\n ```\n\n The `options` hash is passed as second argument to a transforms'\n `serialize` and `deserialize` method. This allows to configure a\n transformation and adapt the corresponding value, based on the config:\n\n ```app/models/post.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @attr('text', {\n uppercase: true\n })\n text;\n }\n ```\n\n ```app/transforms/text.js\n export default class TextTransform {\n serialize(value, options) {\n if (options.uppercase) {\n return value.toUpperCase();\n }\n\n return value;\n }\n\n deserialize(value) {\n return value;\n }\n\n static create() {\n return new this();\n }\n }\n ```\n\n @method attr\n @public\n @static\n @for @ember-data/model\n @param {String|Object} type the attribute type\n @param {Object} options a hash of options\n @return {Attribute}\n*/\nfunction attr(type, options) {\n if (typeof type === 'object') {\n options = type;\n type = undefined;\n } else {\n options = options || {};\n }\n\n let meta = {\n type: type,\n isAttribute: true,\n options: options,\n };\n\n return computed({\n get(key) {\n if (DEBUG) {\n if (['currentState'].indexOf(key) !== -1) {\n throw new Error(\n `'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your attr on ${this.constructor.toString()}`\n );\n }\n }\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n return peekCache(this).getAttr(recordIdentifierFor(this), key);\n },\n set(key, value) {\n if (DEBUG) {\n if (['currentState'].indexOf(key) !== -1) {\n throw new Error(\n `'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your attr on ${this.constructor.toString()}`\n );\n }\n }\n assert(\n `Attempted to set '${key}' on the deleted record ${recordIdentifierFor(this)}`,\n !this.currentState.isDeleted\n );\n const identifier = recordIdentifierFor(this);\n const cache = peekCache(this);\n\n let currentValue = cache.getAttr(identifier, key);\n if (currentValue !== value) {\n cache.setAttr(identifier, key, value);\n\n if (!this.isValid) {\n const { errors } = this;\n if (errors.get(key)) {\n errors.remove(key);\n this.currentState.cleanErrorRequests();\n }\n }\n }\n\n return value;\n },\n }).meta(meta);\n}\n\nexport default computedMacroWithOptionalParams(attr);\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}","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 { deprecate } from '@ember/debug';\nimport { get } from '@ember/object';\n\nimport { DEBUG } from '@ember-data/env';\n\nimport { PromiseObject } from './promise-proxy-base';\n\nfunction promiseObject<T>(promise: Promise<T>): PromiseObject<T> {\n return PromiseObject.create({ promise }) as PromiseObject<T>;\n}\n\n// constructor is accessed in some internals but not including it in the copyright for the deprecation\nconst ALLOWABLE_METHODS = ['constructor', 'then', 'catch', 'finally'];\nconst ALLOWABLE_PROPS = ['__ec_yieldable__', '__ec_cancel__'];\nconst PROXIED_OBJECT_PROPS = ['content', 'isPending', 'isSettled', 'isRejected', 'isFulfilled', 'promise', 'reason'];\n\nconst ProxySymbolString = String(Symbol.for('PROXY_CONTENT'));\n\nexport function deprecatedPromiseObject<T>(promise: Promise<T>): PromiseObject<T> {\n const promiseObjectProxy: PromiseObject<T> = promiseObject(promise);\n if (!DEBUG) {\n return promiseObjectProxy;\n }\n const handler = {\n get(target: object, prop: string, receiver: object): unknown {\n if (typeof prop === 'symbol') {\n if (String(prop) === ProxySymbolString) {\n return;\n }\n return Reflect.get(target, prop, receiver);\n }\n\n if (prop === 'constructor') {\n return target.constructor;\n }\n\n if (ALLOWABLE_PROPS.includes(prop)) {\n return target[prop];\n }\n\n if (!ALLOWABLE_METHODS.includes(prop)) {\n deprecate(\n `Accessing ${prop} is deprecated. The return type is being changed from PromiseObjectProxy to a Promise. The only available methods to access on this promise are .then, .catch and .finally`,\n false,\n {\n id: 'ember-data:model-save-promise',\n until: '5.0',\n for: '@ember-data/store',\n since: {\n available: '4.4',\n enabled: '4.4',\n },\n }\n );\n } else {\n return (target[prop] as () => unknown).bind(target);\n }\n\n if (PROXIED_OBJECT_PROPS.includes(prop)) {\n return target[prop];\n }\n\n const value: unknown = get(target, prop);\n if (value && typeof value === 'function' && typeof value.bind === 'function') {\n return value.bind(receiver);\n }\n\n return undefined;\n },\n };\n\n return new Proxy(promiseObjectProxy, handler);\n}\n","import { A } from '@ember/array';\nimport type NativeArray from '@ember/array/-private/native-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, M = T> extends Omit<ArrayProxy<T, M>, '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, M = T>() => ArrayProxyWithCustomOverrides<T, M>;\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 */\nexport default class 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 let 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 get content(): NativeArray<ValidationError> {\n return A();\n }\n\n /**\n @method unknownProperty\n @private\n */\n unknownProperty(attribute: string) {\n let 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 let errors = this.errorsFor(attribute);\n let messagesArray = Array.isArray(messages) ? messages : [messages];\n let _messages: ValidationError[] = new Array(messagesArray.length) as ValidationError[];\n\n for (let i = 0; i < messagesArray.length; i++) {\n let message = messagesArray[i];\n let 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 let 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 let 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 clear(): void {\n if (this.isEmpty) {\n return;\n }\n\n let errorsByAttributeName = this.errorsByAttributeName;\n let 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","/**\n @module @ember-data/store\n*/\nimport { assert, deprecate } from '@ember/debug';\n\nimport { DEPRECATE_PROMISE_PROXIES } from '@ember-data/deprecations';\nimport type Store from '@ember-data/store';\nimport {\n IDENTIFIER_ARRAY_TAG,\n MUTATE,\n notifyArray,\n RecordArray,\n recordIdentifierFor,\n SOURCE,\n} from '@ember-data/store/-private';\nimport type ShimModelClass from '@ember-data/store/-private/legacy-model-support/shim-model-class';\nimport { 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/types/q/cache';\nimport type { Links, PaginationLinks } from '@ember-data/types/q/ember-data-json-api';\nimport type { StableRecordIdentifier } from '@ember-data/types/q/identifier';\nimport type { RecordInstance } from '@ember-data/types/q/record-instance';\nimport type { FindOptions } from '@ember-data/types/q/store';\nimport type { Dict } from '@ember-data/types/q/utils';\n\nimport { 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: Dict<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: Dict<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: ShimModelClass;\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](prop: string, args: unknown[], result?: unknown) {\n switch (prop) {\n case 'length 0': {\n this._manager.mutate({\n op: 'replaceRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: [],\n });\n break;\n }\n case 'replace cell': {\n const [index, prior, value] = args as [number, StableRecordIdentifier, StableRecordIdentifier];\n this._manager.mutate({\n op: 'replaceRelatedRecord',\n record: this.identifier,\n field: this.key,\n value,\n prior,\n index,\n });\n break;\n }\n case 'push':\n this._manager.mutate({\n op: 'addToRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: extractIdentifiersFromRecords(args as RecordInstance[]),\n });\n break;\n case 'pop':\n if (result) {\n this._manager.mutate({\n op: 'removeFromRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: recordIdentifierFor(result as RecordInstance),\n });\n }\n break;\n\n case 'unshift':\n this._manager.mutate({\n op: 'addToRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: extractIdentifiersFromRecords(args as RecordInstance[]),\n index: 0,\n });\n break;\n\n case 'shift':\n if (result) {\n this._manager.mutate({\n op: 'removeFromRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: recordIdentifierFor(result as RecordInstance),\n index: 0,\n });\n }\n break;\n\n case 'sort':\n this._manager.mutate({\n op: 'sortRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: (result as RecordInstance[]).map(recordIdentifierFor),\n });\n break;\n\n case 'splice': {\n const [start, removeCount, ...adds] = args as [number, number, RecordInstance];\n // detect a full replace\n if (removeCount > 0 && adds.length === this[SOURCE].length) {\n this._manager.mutate({\n op: 'replaceRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: extractIdentifiersFromRecords(adds),\n });\n return;\n }\n if (removeCount > 0) {\n this._manager.mutate({\n op: 'removeFromRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: (result as RecordInstance[]).map(recordIdentifierFor),\n index: start,\n });\n }\n if (adds?.length) {\n this._manager.mutate({\n op: 'addToRelatedRecords',\n record: this.identifier,\n field: this.key,\n value: extractIdentifiersFromRecords(adds),\n index: start,\n });\n }\n\n break;\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 tag = this[IDENTIFIER_ARRAY_TAG];\n tag.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}\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 if (DEPRECATE_PROMISE_PROXIES) {\n if (isPromiseRecord(recordOrPromiseRecord)) {\n let content = recordOrPromiseRecord.content;\n assert(\n 'You passed in a promise that did not originate from an EmberData relationship. You can only pass promises that come from a belongsTo relationship.',\n content !== undefined && content !== null\n );\n deprecate(\n `You passed in a PromiseProxy to a Relationship API that now expects a resolved value. await the value before setting it.`,\n false,\n {\n id: 'ember-data:deprecate-promise-proxies',\n until: '5.0',\n since: {\n enabled: '4.7',\n available: '4.7',\n },\n for: 'ember-data',\n }\n );\n assertRecordPassedToHasMany(content);\n return recordIdentifierFor(content);\n }\n }\n\n assertRecordPassedToHasMany(recordOrPromiseRecord);\n return recordIdentifierFor(recordOrPromiseRecord);\n}\n\nfunction isPromiseRecord(record: PromiseProxyRecord | RecordInstance): record is PromiseProxyRecord {\n return !!record.then;\n}\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';\nimport { cached } from '@glimmer/tracking';\n\nimport type Store from '@ember-data/store';\nimport type { RecordInstance } from '@ember-data/types/q/record-instance';\nimport type { Dict } from '@ember-data/types/q/utils';\n\nimport { 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 object> extends PromiseProxyMixin<T | null>, ObjectProxy<T> {\n new <T extends object>(...args: unknown[]): PromiseObjectType<T>;\n}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare class PromiseObjectType<T extends object> {}\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.get('_belongsToState').modelName}:${this.get('_belongsToState').key}'.` +\n '\\nUse `record.belongsTo(relationshipName).meta()` instead.',\n false\n );\n }\n return;\n }\n\n async reload(options: Dict<unknown>): Promise<this> {\n assert('You are trying to reload an async belongsTo before it has been created', this.content !== undefined);\n let { key, legacySupport } = this._belongsToState;\n await legacySupport.reloadBelongsTo(key, options);\n return this;\n }\n}\n\nexport default PromiseBelongsTo;\n","import ArrayMixin, { NativeArray } from '@ember/array';\nimport type ArrayProxy from '@ember/array/proxy';\nimport { assert, deprecate } from '@ember/debug';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { tracked } from '@glimmer/tracking';\nimport Ember from 'ember';\n\nimport {\n DEPRECATE_A_USAGE,\n DEPRECATE_COMPUTED_CHAINS,\n DEPRECATE_PROMISE_MANY_ARRAY_BEHAVIORS,\n} from '@ember-data/deprecations';\nimport { DEBUG } from '@ember-data/env';\nimport { StableRecordIdentifier } from '@ember-data/types/q/identifier';\nimport type { RecordInstance } from '@ember-data/types/q/record-instance';\nimport { FindOptions } from '@ember-data/types/q/store';\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 interface PromiseManyArray extends Omit<ArrayProxy<StableRecordIdentifier, RecordInstance>, 'destroy'> {\n createRecord(): RecordInstance;\n reload(options: FindOptions): PromiseManyArray;\n}\nexport default class PromiseManyArray {\n declare promise: Promise<ManyArray> | null;\n declare isDestroyed: boolean;\n // @deprecated (isDestroyed is not deprecated)\n declare isDestroying: boolean;\n\n constructor(promise: Promise<ManyArray>, content?: ManyArray) {\n this._update(promise, content);\n this.isDestroyed = false;\n this.isDestroying = false;\n\n if (DEPRECATE_A_USAGE) {\n const meta = Ember.meta(this);\n meta.hasMixin = (mixin: Object) => {\n deprecate(`Do not use A() on an EmberData PromiseManyArray`, false, {\n id: 'ember-data:no-a-with-array-like',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n for: 'ember-data',\n });\n // @ts-expect-error ArrayMixin is more than a type\n if (mixin === NativeArray || mixin === ArrayMixin) {\n return true;\n }\n return false;\n };\n } else if (DEBUG) {\n const meta = Ember.meta(this);\n meta.hasMixin = (mixin: Object) => {\n assert(`Do not use A() on an EmberData PromiseManyArray`);\n };\n }\n }\n\n //---- Methods/Properties on ArrayProxy that we will keep as our API\n\n @tracked content: any | null = null;\n\n /**\n * Retrieve the length of the content\n * @property length\n * @public\n */\n @dependentKeyCompat\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 // 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\n @dependentKeyCompat\n get '[]'() {\n if (DEPRECATE_COMPUTED_CHAINS) {\n return this.content?.length && this.content;\n }\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 * @returns\n * @private\n */\n forEach(cb) {\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 * @returns\n */\n reload(options: FindOptions) {\n assert('You are trying to reload an async manyArray before it has been created', this.content);\n 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 @tracked isPending: boolean = false;\n /**\n * Whether the loading promise rejected\n *\n * @property {boolean} isRejected\n * @public\n */\n @tracked isRejected: boolean = false;\n /**\n * Whether the loading promise succeeded\n *\n * @property {boolean} isFulfilled\n * @public\n */\n @tracked isFulfilled: boolean = false;\n /**\n * Whether the loading promise completed (resolved or rejected)\n *\n * @property {boolean} isSettled\n * @public\n */\n @tracked isSettled: boolean = false;\n\n /**\n * chain this promise\n *\n * @method then\n * @public\n * @param success\n * @param fail\n * @returns Promise\n */\n then(s, f) {\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 * @returns Promise\n */\n catch(cb) {\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 * @returns Promise\n */\n finally(cb) {\n return this.promise!.finally(cb);\n }\n\n //---- Methods on EmberObject that we should keep\n\n destroy() {\n this.isDestroying = true;\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 @dependentKeyCompat\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 @dependentKeyCompat\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}\n\nif (DEPRECATE_PROMISE_MANY_ARRAY_BEHAVIORS) {\n PromiseManyArray.prototype.createRecord = function createRecord(...args) {\n deprecate(\n `The createRecord method on ember-data's PromiseManyArray is deprecated. await the promise and work with the ManyArray directly.`,\n false,\n {\n id: 'ember-data:deprecate-promise-many-array-behaviors',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n for: 'ember-data',\n }\n );\n assert('You are trying to createRecord on an async manyArray before it has been created', this.content);\n return this.content.createRecord(...args);\n };\n\n Object.defineProperty(PromiseManyArray.prototype, 'firstObject', {\n get() {\n deprecate(\n `The firstObject property on ember-data's PromiseManyArray is deprecated. await the promise and work with the ManyArray directly.`,\n false,\n {\n id: 'ember-data:deprecate-promise-many-array-behaviors',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n for: 'ember-data',\n }\n );\n return this.content ? this.content.firstObject : undefined;\n },\n });\n\n Object.defineProperty(PromiseManyArray.prototype, 'lastObject', {\n get() {\n deprecate(\n `The lastObject property on ember-data's PromiseManyArray is deprecated. await the promise and work with the ManyArray directly.`,\n false,\n {\n id: 'ember-data:deprecate-promise-many-array-behaviors',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n for: 'ember-data',\n }\n );\n return this.content ? this.content.lastObject : undefined;\n },\n });\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\nif (DEPRECATE_PROMISE_MANY_ARRAY_BEHAVIORS) {\n const EmberObjectMethods = [\n 'addObserver',\n 'cacheFor',\n 'decrementProperty',\n 'get',\n 'getProperties',\n 'incrementProperty',\n 'notifyPropertyChange',\n 'removeObserver',\n 'set',\n 'setProperties',\n 'toggleProperty',\n ];\n EmberObjectMethods.forEach((method) => {\n PromiseManyArray.prototype[method] = function delegatedMethod(...args) {\n deprecate(\n `The ${method} method on ember-data's PromiseManyArray is deprecated. await the promise and work with the ManyArray directly.`,\n false,\n {\n id: 'ember-data:deprecate-promise-many-array-behaviors',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n for: 'ember-data',\n }\n );\n return Ember[method](this, ...args);\n };\n });\n\n const InheritedProxyMethods = [\n 'addArrayObserver',\n 'addObject',\n 'addObjects',\n 'any',\n 'arrayContentDidChange',\n 'arrayContentWillChange',\n 'clear',\n 'compact',\n 'every',\n 'filter',\n 'filterBy',\n 'find',\n 'findBy',\n 'getEach',\n 'includes',\n 'indexOf',\n 'insertAt',\n 'invoke',\n 'isAny',\n 'isEvery',\n 'lastIndexOf',\n 'map',\n 'mapBy',\n // TODO update RFC to note objectAt was deprecated (forEach was left for iteration)\n 'objectAt',\n 'objectsAt',\n 'popObject',\n 'pushObject',\n 'pushObjects',\n 'reduce',\n 'reject',\n 'rejectBy',\n 'removeArrayObserver',\n 'removeAt',\n 'removeObject',\n 'removeObjects',\n 'replace',\n 'reverseObjects',\n 'setEach',\n 'setObjects',\n 'shiftObject',\n 'slice',\n 'sortBy',\n 'toArray',\n 'uniq',\n 'uniqBy',\n 'unshiftObject',\n 'unshiftObjects',\n 'without',\n ];\n InheritedProxyMethods.forEach((method) => {\n PromiseManyArray.prototype[method] = function proxiedMethod(...args) {\n deprecate(\n `The ${method} method on ember-data's PromiseManyArray is deprecated. await the promise and work with the ManyArray directly.`,\n false,\n {\n id: 'ember-data:deprecate-promise-many-array-behaviors',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n for: 'ember-data',\n }\n );\n assert(`Cannot call ${method} before content is assigned.`, this.content);\n return this.content[method](...args);\n };\n });\n}\n","import { assert } from '@ember/debug';\nimport { DEBUG } from '@ember-data/env';\n\nimport { DEPRECATE_NON_EXPLICIT_POLYMORPHISM } from '@ember-data/deprecations';\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\nif (DEBUG) {\n let checkPolymorphic = function checkPolymorphic(modelClass, addedModelClass) {\n if (modelClass.__isMixin) {\n return (\n modelClass.__mixin.detect(addedModelClass.PrototypeMixin) ||\n // handle native class extension e.g. `class Post extends Model.extend(Commentable) {}`\n modelClass.__mixin.detect(Object.getPrototypeOf(addedModelClass).PrototypeMixin)\n );\n }\n\n return addedModelClass.prototype instanceof modelClass || modelClass.detect(addedModelClass);\n };\n\n assertPolymorphicType = function assertPolymorphicType(parentIdentifier, parentDefinition, addedIdentifier, store) {\n let asserted = false;\n\n if (parentDefinition.inverseIsImplicit) {\n return;\n }\n if (parentDefinition.isPolymorphic) {\n let meta = store.getSchemaDefinitionService().relationshipsDefinitionFor(addedIdentifier)[\n parentDefinition.inverseKey\n ];\n if (!DEPRECATE_NON_EXPLICIT_POLYMORPHISM) {\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 } else if (meta?.options?.as?.length > 0) {\n asserted = true;\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 if (DEPRECATE_NON_EXPLICIT_POLYMORPHISM) {\n if (!asserted) {\n store = store._store ? store._store : store; // allow usage with storeWrapper\n let addedModelName = addedIdentifier.type;\n let parentModelName = parentIdentifier.type;\n let key = parentDefinition.key;\n let relationshipModelName = parentDefinition.type;\n let relationshipClass = store.modelFor(relationshipModelName);\n let addedClass = store.modelFor(addedModelName);\n\n let assertionMessage = `The '${addedModelName}' type does not implement '${relationshipModelName}' and thus cannot be assigned to the '${key}' relationship in '${parentModelName}'. Make it a descendant of '${relationshipModelName}' or use a mixin of the same name.`;\n let isPolymorphic = checkPolymorphic(relationshipClass, addedClass);\n\n assert(assertionMessage, isPolymorphic);\n }\n }\n };\n}\n\nexport { assertPolymorphicType };\n","import { deprecate } from '@ember/debug';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { cached, tracked } from '@glimmer/tracking';\n\nimport type { Object as JSONObject, Value as JSONValue } from 'json-typescript';\n\nimport { DEPRECATE_PROMISE_PROXIES, DEPRECATE_V1_RECORD_DATA } from '@ember-data/deprecations';\nimport { DEBUG } from '@ember-data/env';\nimport type { Graph } from '@ember-data/graph/-private/graph/graph';\nimport type BelongsToRelationship from '@ember-data/graph/-private/relationships/state/belongs-to';\nimport type Store from '@ember-data/store';\nimport { recordIdentifierFor } from '@ember-data/store/-private';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type {\n LinkObject,\n Links,\n SingleResourceDocument,\n SingleResourceRelationship,\n} from '@ember-data/types/q/ember-data-json-api';\nimport type { StableRecordIdentifier } from '@ember-data/types/q/identifier';\nimport type { RecordInstance } from '@ember-data/types/q/record-instance';\nimport type { Dict } from '@ember-data/types/q/utils';\n\nimport { assertPolymorphicType } from '../debug/assert-polymorphic-type';\nimport { areAllInverseRecordsLoaded, LegacySupport } from '../legacy-relationships-support';\nimport { LEGACY_SUPPORT } from '../model';\n\n/**\n @module @ember-data/model\n*/\n\ninterface ResourceIdentifier {\n links?: {\n related?: string | LinkObject;\n };\n meta?: JSONObject;\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 users and\n addon authors to perform meta-operations on a belongs-to\n relationship.\n\n @class BelongsToReference\n @public\n */\nexport default class BelongsToReference {\n declare key: string;\n declare belongsToRelationship: BelongsToRelationship;\n declare type: string;\n ___identifier: StableRecordIdentifier;\n declare store: Store;\n declare graph: Graph;\n\n // unsubscribe tokens given to us by the notification manager\n ___token!: object;\n ___relatedToken: object | null = null;\n\n @tracked _ref = 0;\n\n constructor(\n store: Store,\n graph: Graph,\n parentIdentifier: StableRecordIdentifier,\n belongsToRelationship: BelongsToRelationship,\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\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 @dependentKeyCompat\n get identifier(): StableRecordIdentifier | null {\n if (this.___relatedToken) {\n this.store.notifications.unsubscribe(this.___relatedToken);\n this.___relatedToken = null;\n }\n\n let 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 let resource = this._resource();\n\n if (isResourceIdentiferWithRelatedLinks(resource)) {\n if (resource.links) {\n let 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 * @returns\n */\n links(): Links | null {\n let 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() {\n let meta: Dict<JSONValue> | null = null;\n let 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 = DEPRECATE_V1_RECORD_DATA\n ? this.store._instanceCache.getResourceCache(this.___identifier)\n : 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 let 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 Ember\n Data will treat the new data as the canonical value of this\n relationship on the backend.\n\n Example\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 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 // 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 push\n @public\n @param {Object|Promise} objectOrPromise a promise that resolves to a JSONAPI document object describing the new value of this relationship.\n @return {Promise<record>} A promise that resolves with the new value in this belongs-to relationship.\n */\n async push(data: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<RecordInstance> {\n let jsonApiDoc: SingleResourceDocument = data as SingleResourceDocument;\n if (DEPRECATE_PROMISE_PROXIES) {\n if ((data as { then: unknown }).then) {\n jsonApiDoc = await data;\n if (jsonApiDoc !== data) {\n deprecate(\n `You passed in a Promise to a Reference API that now expects a resolved value. await the value before setting it.`,\n false,\n {\n id: 'ember-data:deprecate-promise-proxies',\n until: '5.0',\n since: {\n enabled: '4.7',\n available: '4.7',\n },\n for: 'ember-data',\n }\n );\n }\n }\n }\n let record = this.store.push(jsonApiDoc);\n\n if (DEBUG) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n assertPolymorphicType(\n this.belongsToRelationship.identifier,\n this.belongsToRelationship.definition,\n recordIdentifierFor(record),\n this.store\n );\n }\n\n const { identifier } = this.belongsToRelationship;\n this.store._join(() => {\n this.graph.push({\n op: 'replaceRelatedRecord',\n record: identifier,\n field: this.key,\n value: recordIdentifierFor(record),\n });\n });\n\n return record;\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 let 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 load(options?: Dict<unknown>) {\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 : support.getBelongsTo(this.key, options);\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?: Dict<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}\n","import { deprecate } from '@ember/debug';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { cached, tracked } from '@glimmer/tracking';\n\nimport type { Object as JSONObject, Value as JSONValue } from 'json-typescript';\n\nimport { ManyArray } from 'ember-data/-private';\n\nimport { DEPRECATE_PROMISE_PROXIES, DEPRECATE_V1_RECORD_DATA } from '@ember-data/deprecations';\nimport { DEBUG } from '@ember-data/env';\nimport type { Graph } from '@ember-data/graph/-private/graph/graph';\nimport type ManyRelationship from '@ember-data/graph/-private/relationships/state/has-many';\nimport type Store from '@ember-data/store';\nimport { recordIdentifierFor } from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type {\n CollectionResourceDocument,\n CollectionResourceRelationship,\n ExistingResourceObject,\n LinkObject,\n PaginationLinks,\n SingleResourceDocument,\n} from '@ember-data/types/q/ember-data-json-api';\nimport type { StableRecordIdentifier } from '@ember-data/types/q/identifier';\nimport type { RecordInstance } from '@ember-data/types/q/record-instance';\nimport type { FindOptions } from '@ember-data/types/q/store';\nimport type { Dict } from '@ember-data/types/q/utils';\n\nimport { assertPolymorphicType } from '../debug/assert-polymorphic-type';\nimport { areAllInverseRecordsLoaded, LegacySupport } from '../legacy-relationships-support';\nimport { LEGACY_SUPPORT } from '../model';\n\n/**\n @module @ember-data/model\n*/\ninterface ResourceIdentifier {\n links?: {\n related?: string | LinkObject;\n };\n meta?: JSONObject;\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 users and addon\n authors to perform meta-operations on a has-many relationship.\n\n @class HasManyReference\n @public\n @extends Reference\n */\nexport default class HasManyReference {\n declare graph: Graph;\n declare key: string;\n declare hasManyRelationship: ManyRelationship;\n declare type: string;\n declare store: Store;\n\n // unsubscribe tokens given to us by the notification manager\n ___token!: Object;\n ___identifier: StableRecordIdentifier;\n ___relatedTokenMap!: Map<StableRecordIdentifier, Object>;\n\n @tracked _ref = 0;\n\n constructor(\n store: Store,\n graph: Graph,\n parentIdentifier: StableRecordIdentifier,\n hasManyRelationship: ManyRelationship,\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 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 @dependentKeyCompat\n get identifiers(): StableRecordIdentifier[] {\n this._ref; // consume the tracked prop\n\n let resource = this._resource();\n\n let 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 = DEPRECATE_V1_RECORD_DATA\n ? this.store._instanceCache.getResourceCache(this.___identifier)\n : 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 let 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 let resource = this._resource();\n\n if (isResourceIdentiferWithRelatedLinks(resource)) {\n if (resource.links) {\n let 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 * @returns\n */\n links(): PaginationLinks | null {\n let 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} The meta information for the belongs-to relationship.\n */\n meta() {\n let meta: Dict<JSONValue> | null = null;\n let 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 Ember\n Data will treat the new data as the canonical value of this\n relationship on the backend.\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 ```\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 commentsRef.push([\n [{ type: 'comment', id: 2 }],\n [{ type: 'comment', id: 3 }],\n ])\n\n commentsRef.ids(); // ['2', '3']\n ```\n\n @method push\n @public\n @param {Array|Promise} objectOrPromise a promise that resolves to a JSONAPI document object describing the new value of this relationship.\n @return {ManyArray}\n */\n async push(\n objectOrPromise: ExistingResourceObject[] | CollectionResourceDocument | { data: SingleResourceDocument[] }\n ): Promise<ManyArray> {\n let payload = objectOrPromise;\n if (DEPRECATE_PROMISE_PROXIES) {\n if ((objectOrPromise as unknown as { then: unknown }).then) {\n payload = await (objectOrPromise as unknown as Promise<\n ExistingResourceObject[] | CollectionResourceDocument | { data: SingleResourceDocument[] }\n >);\n if (payload !== objectOrPromise) {\n deprecate(\n `You passed in a Promise to a Reference API that now expects a resolved value. await the value before setting it.`,\n false,\n {\n id: 'ember-data:deprecate-promise-proxies',\n until: '5.0',\n since: {\n enabled: '4.7',\n available: '4.7',\n },\n for: 'ember-data',\n }\n );\n }\n }\n }\n let array: Array<ExistingResourceObject | SingleResourceDocument>;\n\n if (!Array.isArray(payload) && typeof payload === 'object' && Array.isArray(payload.data)) {\n array = payload.data;\n } else {\n array = payload as ExistingResourceObject[];\n }\n\n const { store } = this;\n\n let identifiers = array.map((obj) => {\n let record: RecordInstance;\n if ('data' in obj) {\n // TODO deprecate pushing non-valid JSON:API here\n record = store.push(obj);\n } else {\n record = store.push({ data: obj });\n }\n\n if (DEBUG) {\n let relationshipMeta = this.hasManyRelationship.definition;\n let identifier = this.hasManyRelationship.identifier;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n assertPolymorphicType(identifier, relationshipMeta, recordIdentifierFor(record), store);\n }\n return recordIdentifierFor(record);\n });\n\n const { identifier } = this.hasManyRelationship;\n store._join(() => {\n this.graph.push({\n op: 'replaceRelatedRecords',\n record: identifier,\n field: this.key,\n value: identifiers,\n });\n });\n\n return this.load();\n }\n\n _isLoaded() {\n let hasRelationshipDataProperty = this.hasManyRelationship.state.hasReceivedData;\n if (!hasRelationshipDataProperty) {\n return false;\n }\n\n let localState = this.hasManyRelationship.localState;\n\n return localState.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() {\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 : (support.getHasMany(this.key, options) as Promise<ManyArray> | ManyArray); // this cast is necessary because typescript does not work properly with custom thenables;\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}\n","import { assert, deprecate } from '@ember/debug';\n\nimport { importSync } from '@embroider/macros';\n\nimport { DEPRECATE_PROMISE_PROXIES } from '@ember-data/deprecations';\nimport { DEBUG } from '@ember-data/env';\nimport type { UpgradedMeta } from '@ember-data/graph/-private/graph/-edge-definition';\nimport type { LocalRelationshipOperation } from '@ember-data/graph/-private/graph/-operations';\nimport type { ImplicitRelationship } from '@ember-data/graph/-private/graph/index';\nimport type BelongsToRelationship from '@ember-data/graph/-private/relationships/state/belongs-to';\nimport type ManyRelationship from '@ember-data/graph/-private/relationships/state/has-many';\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 { NonSingletonCacheManager } from '@ember-data/store/-private/managers/cache-manager';\nimport type { Cache } from '@ember-data/types/q/cache';\nimport type { DSModel } from '@ember-data/types/q/ds-model';\nimport { CollectionResourceRelationship, SingleResourceRelationship } from '@ember-data/types/q/ember-data-json-api';\nimport type { StableRecordIdentifier } from '@ember-data/types/q/identifier';\nimport type { JsonApiRelationship } from '@ember-data/types/q/record-data-json-api';\nimport type { RecordInstance } from '@ember-data/types/q/record-instance';\nimport type { FindOptions } from '@ember-data/types/q/store';\nimport type { Dict } from '@ember-data/types/q/utils';\n\nimport RelatedCollection from './many-array';\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 class LegacySupport {\n declare record: DSModel;\n declare store: Store;\n declare cache: Cache;\n declare references: Dict<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>;\n declare _pending: Record<string, Promise<StableRecordIdentifier | null> | undefined>;\n\n declare isDestroying: boolean;\n declare isDestroyed: boolean;\n\n constructor(record: DSModel) {\n this.record = record;\n this.store = storeFor(record)!;\n this.identifier = recordIdentifierFor(record);\n this.cache = peekCache(record);\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 let [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: BelongsToRelationship,\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 let loadingPromise = this._relationshipPromisesCache[key] as Promise<RecordInstance | null> | undefined;\n if (loadingPromise) {\n return loadingPromise;\n }\n\n const graphFor = (importSync('@ember-data/graph/-private') as typeof import('@ember-data/graph/-private')).graphFor;\n const relationship = graphFor(this.store).get(this.identifier, key);\n assert(`Expected ${key} to be a belongs-to relationship`, isBelongsTo(relationship));\n\n let resource = this.cache.getRelationship(this.identifier, key) as SingleResourceRelationship;\n relationship.state.hasFailedLoadAttempt = false;\n relationship.state.shouldForceReload = true;\n let promise = this._findBelongsTo(key, resource, relationship, options);\n if (this._relationshipProxyCache[key]) {\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 let resource = cache.getRelationship(this.identifier, key) as SingleResourceRelationship;\n let relatedIdentifier = resource && resource.data ? resource.data : null;\n assert(`Expected a stable identifier`, !relatedIdentifier || isStableIdentifier(relatedIdentifier));\n\n const store = this.store;\n const graphFor = (importSync('@ember-data/graph/-private') as typeof import('@ember-data/graph/-private')).graphFor;\n const relationship = graphFor(store).get(this.identifier, key);\n assert(`Expected ${key} to be a belongs-to relationship`, isBelongsTo(relationship));\n\n let isAsync = relationship.definition.isAsync;\n let _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 let 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 let 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[], CollectionResourceRelationship] {\n let jsonApi = (this.cache as NonSingletonCacheManager).getRelationship(\n identifier,\n field,\n true\n ) as CollectionResourceRelationship;\n const cache = this.store._instanceCache;\n let identifiers: StableRecordIdentifier[] = [];\n if (jsonApi.data) {\n for (let i = 0; i < jsonApi.data.length; i++) {\n const identifier = jsonApi.data[i];\n assert(`Expected a stable identifier`, isStableIdentifier(identifier));\n if (cache.recordIsLoaded(identifier, true)) {\n identifiers.push(identifier);\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 const graphFor = (importSync('@ember-data/graph/-private') as typeof import('@ember-data/graph/-private'))\n .graphFor;\n definition = graphFor(this.store).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: ManyRelationship,\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 CollectionResourceRelationship;\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 let loadingPromise = this._relationshipPromisesCache[key];\n if (loadingPromise) {\n return loadingPromise;\n }\n const graphFor = (importSync('@ember-data/graph/-private') as typeof import('@ember-data/graph/-private'))\n .graphFor;\n const relationship = graphFor(this.store).get(this.identifier, key) as ManyRelationship;\n const { definition, state } = relationship;\n\n state.hasFailedLoadAttempt = false;\n state.shouldForceReload = true;\n let manyArray = this.getManyArray(key, definition);\n let 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 graphFor = (importSync('@ember-data/graph/-private') as typeof import('@ember-data/graph/-private'))\n .graphFor;\n const relationship = graphFor(this.store).get(this.identifier, key) as ManyRelationship;\n const { definition, state } = relationship;\n let manyArray = this.getManyArray(key, definition);\n\n if (definition.isAsync) {\n if (state.hasFailedLoadAttempt) {\n return this._relationshipProxyCache[key] as PromiseManyArray;\n }\n\n let 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 graphFor = (importSync('@ember-data/graph/-private') as typeof import('@ember-data/graph/-private'))\n .graphFor;\n const graph = graphFor(this.store);\n const relationship = graph.get(this.identifier, name);\n\n if (DEBUG) {\n if (kind) {\n let modelName = this.identifier.type;\n let 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 let relationshipKind = relationship.definition.kind;\n\n if (relationshipKind === 'belongsTo') {\n reference = new BelongsToReference(\n this.store,\n graph,\n this.identifier,\n relationship as BelongsToRelationship,\n name\n );\n } else if (relationshipKind === 'hasMany') {\n reference = new HasManyReference(this.store, graph, this.identifier, relationship as ManyRelationship, 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: ManyRelationship,\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 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('ember-data: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('ember-data: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: BelongsToRelationship,\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 let { 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('ember-data: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('ember-data: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: Dict<{ destroy(): void }> = this._manyArrayCache;\n this._manyArrayCache = Object.create(null);\n Object.keys(cache).forEach((key) => {\n cache[key]!.destroy();\n });\n\n cache = this._relationshipProxyCache;\n this._relationshipProxyCache = Object.create(null);\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);\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: BelongsToRelationship,\n value: StableRecordIdentifier | null\n): RecordInstance | null;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: ManyRelationship,\n value: RelatedCollection\n): RelatedCollection;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: BelongsToRelationship,\n value: null,\n error: Error\n): never;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: ManyRelationship,\n value: RelatedCollection,\n error: Error\n): never;\nfunction handleCompletedRelationshipRequest(\n recordExt: LegacySupport,\n key: string,\n relationship: BelongsToRelationship | ManyRelationship,\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 let 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 // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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(recordOrPromiseRecord: PromiseProxyRecord | RecordInstance | null) {\n if (!recordOrPromiseRecord) {\n return null;\n }\n\n if (DEPRECATE_PROMISE_PROXIES) {\n if (isPromiseRecord(recordOrPromiseRecord)) {\n let content = recordOrPromiseRecord.content;\n assert(\n 'You passed in a promise that did not originate from an EmberData relationship. You can only pass promises that come from a belongsTo or hasMany relationship to the get call.',\n content !== undefined\n );\n deprecate(\n `You passed in a PromiseProxy to a Relationship API that now expects a resolved value. await the value before setting it.`,\n false,\n {\n id: 'ember-data:deprecate-promise-proxies',\n until: '5.0',\n since: {\n enabled: '4.7',\n available: '4.7',\n },\n for: 'ember-data',\n }\n );\n return content ? recordIdentifierFor(content) : null;\n }\n }\n\n return recordIdentifierFor(recordOrPromiseRecord);\n}\n\nfunction isPromiseRecord(record: PromiseProxyRecord | RecordInstance): record is PromiseProxyRecord {\n return !!record.then;\n}\n\nfunction anyUnloaded(store: Store, relationship: ManyRelationship) {\n let state = relationship.localState;\n const cache = store._instanceCache;\n const unloaded = state.find((s) => {\n let 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(\n relationship: BelongsToRelationship | ImplicitRelationship | ManyRelationship\n): relationship is BelongsToRelationship {\n return relationship.definition.kind === 'belongsTo';\n}\n","import { cacheFor } from '@ember/object/internals';\n\nimport { DEPRECATE_V1_RECORD_DATA } from '@ember-data/deprecations';\nimport type Store from '@ember-data/store';\nimport { peekCache } from '@ember-data/store/-private';\nimport type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';\nimport type { StableRecordIdentifier } from '@ember-data/types/q/identifier';\n\nimport type Model from './model';\nimport { LEGACY_SUPPORT } 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((key) => {\n notifyAttribute(store, identifier, key, record);\n });\n }\n } else if (value === 'relationships') {\n if (key) {\n let meta = record.constructor.relationshipsByName.get(key);\n notifyRelationship(identifier, key, record, meta);\n } else {\n record.eachRelationship((key, meta) => {\n notifyRelationship(identifier, key, 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) {\n if (meta.kind === 'belongsTo') {\n record.notifyPropertyChange(key);\n } else if (meta.kind === 'hasMany') {\n let support = LEGACY_SUPPORT.get(identifier);\n let manyArray = support && support._manyArrayCache[key];\n let 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 if (!meta.options || meta.options.async || meta.options.async === undefined) {\n record.notifyPropertyChange(key);\n }\n }\n }\n}\n\nfunction notifyAttribute(store: Store, identifier: StableRecordIdentifier, key: string, record: Model) {\n let currentValue = cacheFor(record, key);\n const cache = DEPRECATE_V1_RECORD_DATA ? peekCache(record)! : store.cache;\n if (currentValue !== cache.getAttr(identifier, key)) {\n record.notifyPropertyChange(key);\n }\n}\n","import { assert } from '@ember/debug';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { cached, tracked } from '@glimmer/tracking';\n\nimport { DEPRECATE_V1_RECORD_DATA } from '@ember-data/deprecations';\nimport { DEBUG } from '@ember-data/env';\nimport type Store from '@ember-data/store';\nimport { storeFor } from '@ember-data/store';\nimport { peekCache, 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 { addToTransaction, subscribe } from '@ember-data/tracking/-private';\nimport type { Cache } from '@ember-data/types/q/cache';\nimport type { StableRecordIdentifier } from '@ember-data/types/q/identifier';\n\ntype Model = InstanceType<typeof import('./model')>;\n\nconst SOURCE_POINTER_REGEXP = /^\\/?data\\/(attributes|relationships)\\/(.*)/;\nconst SOURCE_POINTER_PRIMARY_REGEXP = /^\\/?data/;\nconst PRIMARY_ATTRIBUTE_KEY = 'base';\nfunction isInvalidError(error) {\n return error && error.isAdapterError === true && error.code === 'InvalidError';\n}\n\n/**\n * Tag provides a cache for a getter\n * that recomputes only when a specific\n * tracked property that it manages is dirtied.\n *\n * This allows us to bust the cache for a value\n * that otherwise doesn't access anything tracked\n * as well as control the timing of that notification.\n *\n * @internal\n */\nclass Tag {\n declare rev: number;\n declare isDirty: boolean;\n declare value: any;\n declare t: boolean;\n declare _debug_base: string;\n declare _debug_prop: string;\n\n constructor() {\n if (DEBUG) {\n const [base, prop] = arguments as unknown as [string, string];\n this._debug_base = base;\n this._debug_prop = prop;\n }\n this.rev = 1;\n this.isDirty = true;\n this.value = undefined;\n /*\n * whether this was part of a transaction when mutated\n */\n this.t = false;\n }\n @tracked ref = null;\n\n notify() {\n this.isDirty = true;\n addToTransaction(this);\n this.rev++;\n }\n consume(v) {\n this.isDirty = false;\n this.value = v; // set cached value\n }\n}\n\nconst Tags = new WeakMap();\nfunction getTag(record, key) {\n let tags = Tags.get(record);\n if (!tags) {\n tags = Object.create(null);\n Tags.set(record, tags);\n }\n // @ts-expect-error\n return (tags[key] = tags[key] || (DEBUG ? new Tag(record.constructor.modelName, key) : new Tag()));\n}\n\nexport function peekTag(record, key) {\n let tags = Tags.get(record);\n return tags && tags[key];\n}\n\n/**\n * A decorattor that caches a getter while\n * providing the ability to bust that cache\n * when we so choose in a way that notifies\n * glimmer's tracking system.\n *\n * @internal\n */\nexport function tagged(_target, key, desc) {\n const getter = desc.get;\n const setter = desc.set;\n desc.get = function () {\n let tag = getTag(this, key);\n subscribe(tag);\n\n if (tag.isDirty) {\n tag.consume(getter.call(this));\n }\n\n return tag.value;\n };\n desc.set = function (v) {\n getTag(this, key); // ensure tag is setup in case we want to use it.\n // probably notify here but not yet.\n setter.call(this, v);\n };\n dependentKeyCompat(desc);\n return desc;\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: Model;\n declare rs: RequestStateService;\n\n declare pendingCount: number;\n declare fulfilledCount: number;\n declare rejectedCount: number;\n declare cache: Cache;\n declare _errorRequests: any[];\n declare _lastError: any;\n declare handler: object;\n\n constructor(record: Model) {\n const store = storeFor(record)!;\n const identity = recordIdentifierFor(record);\n\n this.identifier = identity;\n this.record = record;\n this.cache = DEPRECATE_V1_RECORD_DATA ? peekCache(record)! : store.cache;\n\n this.pendingCount = 0;\n this.fulfilledCount = 0;\n this.rejectedCount = 0;\n this._errorRequests = [];\n this._lastError = null;\n\n let requests = store.getRequestStateService();\n let notifications = store.notifications;\n\n const handleRequest = (req) => {\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 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 if (!DEBUG) {\n const lastRequest = requests.getLastRequestForRecord(identity);\n if (lastRequest) {\n handleRequest(lastRequest);\n }\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('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) {\n getTag(this, key).notify();\n }\n\n updateInvalidErrors(errors) {\n assert(\n `Expected the Cache instance for ${this.identifier} to implement getErrors(identifier)`,\n typeof this.cache.getErrors === 'function'\n );\n let jsonApiErrors = this.cache.getErrors(this.identifier);\n\n errors.clear();\n\n for (let i = 0; i < jsonApiErrors.length; i++) {\n let error = jsonApiErrors[i];\n\n if (error.source && error.source.pointer) {\n let 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 let errMsg = error.detail || error.title;\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 @tracked isSaving = false;\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 let rd = this.cache;\n if (this.isDeleted) {\n assert(`Expected Cache to implement isDeletionCommitted()`, rd.isDeletionCommitted);\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 let 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()`, rd.isEmpty);\n return !this.isNew && rd.isEmpty(this.identifier);\n }\n\n @tagged\n get isNew() {\n let rd = this.cache;\n assert(`Expected Cache to implement isNew()`, rd.isNew);\n return rd.isNew(this.identifier);\n }\n\n @tagged\n get isDeleted() {\n let rd = this.cache;\n assert(`Expected Cache to implement isDeleted()`, rd.isDeleted);\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 let rd = this.cache;\n if (rd.isDeletionCommitted(this.identifier) || (this.isDeleted && this.isNew)) {\n return false;\n }\n return this.isNew || rd.hasChangedAttrs(this.identifier);\n }\n\n @tagged\n get isError() {\n let 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 let 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.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}\n\nfunction notifyErrorsStateChanged(state: RecordState) {\n state.notify('isValid');\n state.notify('isError');\n state.notify('adapterError');\n}\n","import { dasherize } from '@ember/string';\n\nimport { singularize } from 'ember-inflector';\n\nimport { DEBUG } from '@ember-data/env';\nimport type Store from '@ember-data/store';\nimport type { RelationshipSchema } from '@ember-data/types/q/record-data-schemas';\n\nfunction typeForRelationshipMeta(meta) {\n let modelName = dasherize(meta.type || meta.key);\n\n if (meta.kind === 'hasMany') {\n modelName = singularize(modelName);\n }\n\n return modelName;\n}\n\nfunction shouldFindInverse(relationshipMeta) {\n let options = relationshipMeta.options;\n return !(options && options.inverse === null);\n}\n\nclass RelationshipDefinition implements RelationshipSchema {\n declare _type: string;\n declare __inverseKey: string;\n declare __hasCalculatedInverse: boolean;\n declare parentModelName: string;\n declare inverseIsAsync: string | null;\n declare meta: any;\n\n constructor(meta: any) {\n this._type = '';\n this.__inverseKey = '';\n this.__hasCalculatedInverse = false;\n this.parentModelName = meta.parentModelName;\n this.meta = meta;\n }\n\n /**\n * @internal\n * @deprecated\n */\n get key(): string {\n return this.meta.key;\n }\n get kind(): 'belongsTo' | 'hasMany' {\n return this.meta.kind;\n }\n get type(): string {\n if (this._type) {\n return this._type;\n }\n this._type = typeForRelationshipMeta(this.meta);\n return this._type;\n }\n get options(): { [key: string]: any } {\n return this.meta.options;\n }\n get name(): string {\n return this.meta.name;\n }\n\n _inverseKey(store: Store, modelClass): string {\n if (this.__hasCalculatedInverse === false) {\n this._calculateInverse(store, modelClass);\n }\n return this.__inverseKey;\n }\n\n _calculateInverse(store: Store, modelClass): void {\n this.__hasCalculatedInverse = true;\n let inverseKey;\n let inverse: any = null;\n\n if (shouldFindInverse(this.meta)) {\n inverse = modelClass.inverseFor(this.key, store);\n }\n // TODO make this error again for the non-polymorphic case\n if (DEBUG) {\n if (!this.options.polymorphic) {\n modelClass.typeForRelationship(this.key, store);\n }\n }\n\n if (inverse) {\n inverseKey = inverse.name;\n } else {\n inverseKey = null;\n }\n this.__inverseKey = inverseKey;\n }\n}\nexport type { RelationshipDefinition };\n\nexport function relationshipFromMeta(meta: RelationshipSchema): RelationshipDefinition {\n return new RelationshipDefinition(meta);\n}\n","/**\n @module @ember-data/model\n */\n\nimport { assert, deprecate, warn } from '@ember/debug';\nimport EmberObject from '@ember/object';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { run } from '@ember/runloop';\nimport { tracked } from '@glimmer/tracking';\nimport Ember from 'ember';\n\nimport { importSync } from '@embroider/macros';\n\nimport {\n DEPRECATE_EARLY_STATIC,\n DEPRECATE_MODEL_REOPEN,\n DEPRECATE_NON_EXPLICIT_POLYMORPHISM,\n DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE,\n DEPRECATE_SAVE_PROMISE_ACCESS,\n} from '@ember-data/deprecations';\nimport { DEBUG } from '@ember-data/env';\nimport { HAS_DEBUG_PACKAGE } from '@ember-data/packages';\nimport { recordIdentifierFor, storeFor } from '@ember-data/store';\nimport { coerceId, peekCache } from '@ember-data/store/-private';\n\nimport { deprecatedPromiseObject } from './deprecated-promise-proxy';\nimport Errors from './errors';\nimport { LegacySupport } from './legacy-relationships-support';\nimport notifyChanges from './notify-changes';\nimport RecordState, { peekTag, tagged } from './record-state';\nimport { relationshipFromMeta } from './relationship-meta';\n\nconst { changeProperties } = Ember;\nexport const LEGACY_SUPPORT = new Map();\n\nexport function lookupLegacySupport(record) {\n const identifier = recordIdentifierFor(record);\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\nfunction findPossibleInverses(type, inverseType, name, relationshipsSoFar) {\n let possibleRelationships = relationshipsSoFar || [];\n\n let relationshipMap = inverseType.relationships;\n if (!relationshipMap) {\n return possibleRelationships;\n }\n\n let relationshipsForType = relationshipMap.get(type.modelName);\n let relationships = Array.isArray(relationshipsForType)\n ? relationshipsForType.filter((relationship) => {\n let 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, key, desc) {\n const cache = new WeakMap();\n let 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 @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 let store = (this.store = _secretInit.store);\n super.init(options);\n\n let 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 let notifications = store.notifications;\n this.___private_notifications = notifications.subscribe(identity, (identifier, type, key) => {\n notifyChanges(identifier, type, key, 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((key, meta) => {\n if (meta.kind === 'belongsTo') {\n this.notifyPropertyChange(key);\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @dependentKeyCompat\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 @tracked isReloading = false;\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 let 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 let 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 @dependentKeyCompat\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 serialize(options) {\n return storeFor(this).serializeRecord(this, options);\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(key) {\n let tag = peekTag(this, key);\n if (tag) {\n tag.notify();\n }\n super.notifyPropertyChange(key);\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 ```app/controllers/model/delete.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n\n export default class ModelDeleteController extends Controller {\n @action\n softDelete() {\n this.model.deleteRecord();\n }\n\n @action\n confirm() {\n this.model.save();\n }\n\n @action\n undo() {\n this.model.rollbackAttributes();\n }\n }\n ```\n\n @method deleteRecord\n @public\n */\n deleteRecord() {\n // ensure we've populated currentState prior to deleting a new record\n if (this.currentState) {\n storeFor(this).deleteRecord(this);\n }\n }\n\n /**\n Same as `deleteRecord`, but saves the record immediately.\n\n Example\n\n ```app/controllers/model/delete.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n\n export default class ModelDeleteController extends Controller {\n @action\n delete() {\n this.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 destroyRecord(options) {\n const { isNew } = this.currentState;\n this.deleteRecord();\n if (isNew) {\n return Promise.resolve(this);\n }\n return this.save(options).then((_) => {\n run(() => {\n this.unloadRecord();\n });\n return this;\n });\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 unloadRecord() {\n if (this.currentState.isNew && (this.isDestroyed || this.isDestroying)) {\n return;\n }\n storeFor(this).unloadRecord(this);\n }\n\n /**\n @method _notifyProperties\n @private\n */\n _notifyProperties(keys) {\n // changeProperties defers notifications until after the delegate\n // and protects with a try...finally block\n // previously used begin...endPropertyChanges but this is private API\n changeProperties(() => {\n let key;\n for (let i = 0, length = keys.length; i < length; i++) {\n key = keys[i];\n this.notifyPropertyChange(key);\n }\n });\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 changedAttributes() {\n return peekCache(this).changedAttrs(recordIdentifierFor(this));\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 rollbackAttributes() {\n const { currentState } = this;\n const { isNew } = currentState;\n\n storeFor(this)._join(() => {\n peekCache(this).rollbackAttrs(recordIdentifierFor(this));\n this.errors.clear();\n currentState.cleanErrorRequests();\n if (isNew) {\n this.unloadRecord();\n }\n });\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 _createSnapshot() {\n const store = storeFor(this);\n\n if (!store._fetchManager) {\n const FetchManager = importSync('@ember-data/legacy-compat/-private').FetchManager;\n store._fetchManager = new FetchManager(store);\n }\n\n return store._fetchManager.createSnapshot(recordIdentifierFor(this));\n }\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 save(options) {\n let promise;\n\n if (this.currentState.isNew && this.currentState.isDeleted) {\n promise = Promise.resolve(this);\n } else {\n promise = storeFor(this).saveRecord(this, options);\n }\n\n if (DEPRECATE_SAVE_PROMISE_ACCESS) {\n return deprecatedPromiseObject(promise);\n }\n\n return promise;\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 ```app/controllers/model/view.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n\n export default class ViewController extends Controller {\n @action\n reload() {\n this.model.reload().then(function(model) {\n // do something with the reloaded model\n });\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 reload(options = {}) {\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 = storeFor(this)\n .request({\n op: 'findRecord',\n data: {\n options,\n record: identifier,\n },\n cacheOptions: { [Symbol.for('ember-data:skip-cache')]: true },\n })\n .then(() => this)\n .finally(() => {\n this.isReloading = false;\n });\n\n if (DEPRECATE_SAVE_PROMISE_ACCESS) {\n return deprecatedPromiseObject(promise);\n }\n return promise;\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 Example\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 ```javascript\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 // check if the user relationship is loaded\n let isLoaded = userRef.value() !== null;\n\n // get the record of the reference (null if not yet available)\n let user = userRef.value();\n\n // get the identifier of the reference\n if (userRef.remoteType() === \"id\") {\n let id = userRef.id();\n } else if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n\n // load user (via store.findRecord or store.findBelongsTo)\n userRef.load().then(...)\n\n // or trigger a reload\n userRef.reload().then(...)\n\n // provide data for reference\n userRef.push({\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n }).then(function(user) {\n userRef.value() === user;\n });\n ```\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 belongsTo(name) {\n return lookupLegacySupport(this).referenceFor('belongsTo', name);\n }\n\n /**\n Get the reference for the specified hasMany relationship.\n\n Example\n\n ```app/models/blog.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class BlogModel extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n comments: {\n data: [\n { type: 'comment', id: 1 },\n { type: 'comment', id: 2 }\n ]\n }\n }\n }\n });\n let commentsRef = blog.hasMany('comments');\n\n // check if the comments are loaded already\n let isLoaded = commentsRef.value() !== null;\n\n // get the records of the reference (null if not yet available)\n let comments = commentsRef.value();\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 // load comments (via store.findMany or store.findHasMany)\n commentsRef.load().then(...)\n\n // or trigger a reload\n commentsRef.reload().then(...)\n\n // provide data for reference\n commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {\n commentsRef.value() === comments;\n });\n ```\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 hasMany(name) {\n return lookupLegacySupport(this).referenceFor('hasMany', name);\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 - **key** <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(key) {\n return this.constructor.inverseFor(key, 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 Ember Data. 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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let relationship = this.relationshipsByName.get(name);\n return relationship && store.modelFor(relationship.type);\n }\n\n @computeOnce\n static get inverseMap() {\n if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\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 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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let inverseMap = this.inverseMap;\n if (inverseMap[name]) {\n return inverseMap[name];\n } else {\n let 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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\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 let 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 let filteredRelationships = possibleRelationships.filter((possibleRelationship) => {\n let 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 let 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 if (DEPRECATE_NON_EXPLICIT_POLYMORPHISM) {\n if (!inverseOptions.as) {\n deprecate(\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 false,\n {\n id: 'ember-data:non-explicit-relationships',\n since: { enabled: '4.7', available: '4.7' },\n until: '5.0',\n for: 'ember-data',\n }\n );\n }\n } else {\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\n // ensure we are properly configured\n if (DEBUG) {\n if (inverseOptions.polymorphic) {\n if (DEPRECATE_NON_EXPLICIT_POLYMORPHISM) {\n if (!options.as) {\n deprecate(\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 false,\n {\n id: 'ember-data:non-explicit-relationships',\n since: { enabled: '4.7', available: '4.7' },\n until: '5.0',\n for: 'ember-data',\n }\n );\n }\n } else {\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\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 { get } from '@ember/object';\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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let map = new Map();\n let relationshipsByName = this.relationshipsByName;\n\n // Loop through each computed property on the class\n relationshipsByName.forEach((desc) => {\n let { 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 { get } from '@ember/object';\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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let names = {\n hasMany: [],\n belongsTo: [],\n };\n\n this.eachComputedProperty((name, meta) => {\n if (meta.isRelationship) {\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 { get } from '@ember/object';\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 Ember.Array\n @readOnly\n */\n @computeOnce\n static get relatedTypes() {\n if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let types = [];\n\n let rels = this.relationshipsObject;\n let 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 let name = relationships[i];\n let meta = rels[name];\n let 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 { get } from '@ember/object';\n import Blog from 'app/models/blog';\n\n let relationshipsByName = Blog.relationshipsByName;\n relationshipsByName.users;\n //=> { key: 'users', kind: 'hasMany', type: 'user', options: Object, isRelationship: true }\n relationshipsByName.owner;\n //=> { key: 'owner', kind: 'belongsTo', type: 'user', options: Object, isRelationship: true }\n ```\n\n @property relationshipsByName\n @public\n @static\n @type Map\n @readOnly\n */\n @computeOnce\n static get relationshipsByName() {\n if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let map = new Map();\n let rels = this.relationshipsObject;\n let relationships = Object.keys(rels);\n\n for (let i = 0; i < relationships.length; i++) {\n let key = relationships[i];\n let value = rels[key];\n\n map.set(value.name || value.key, value);\n }\n\n return map;\n }\n\n @computeOnce\n static get relationshipsObject() {\n if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let relationships = Object.create(null);\n let modelName = this.modelName;\n this.eachComputedProperty((name, meta) => {\n if (meta.isRelationship) {\n meta.key = name;\n meta.name = name;\n meta.parentModelName = modelName;\n relationships[name] = DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE ? relationshipFromMeta(meta) : 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 { get } from '@ember/object';\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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let map = new Map();\n\n this.eachComputedProperty((name, meta) => {\n // TODO end reliance on these booleans and stop leaking them in the spec\n if (meta.isRelationship) {\n map.set(name, meta.kind);\n } else if (meta.isAttribute) {\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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let relationshipTypes = this.relatedTypes;\n\n for (let i = 0; i < relationshipTypes.length; i++) {\n let type = relationshipTypes[i];\n callback.call(binding, type);\n }\n }\n\n static determineRelationshipType(knownSide, store) {\n if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let knownKey = knownSide.key;\n let knownKind = knownSide.kind;\n let inverse = this.inverseFor(knownKey, store);\n // let key;\n let otherKind;\n\n if (!inverse) {\n return knownKind === 'belongsTo' ? 'oneToNone' : 'manyToNone';\n }\n\n // key = inverse.name;\n 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 { get } from '@ember/object';\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\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", isAttribute: true, 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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let map = new Map();\n\n this.eachComputedProperty((name, meta) => {\n if (meta.isAttribute) {\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 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 { get } from '@ember/object';\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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n }\n let map = new Map();\n\n this.eachAttribute((key, meta) => {\n if (meta.type) {\n map.set(key, 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\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", isAttribute: true, 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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\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 if (DEPRECATE_EARLY_STATIC) {\n deprecate(\n `Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,\n this.modelName,\n {\n id: 'ember-data:deprecate-early-static',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n } else {\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\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 let relationships = {};\n let 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 let 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 let lookupDescriptor = function lookupDescriptor(obj, keyName) {\n let current = obj;\n do {\n let 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 let ourDescriptor = lookupDescriptor(Model.prototype, 'currentState');\n let theirDescriptor = lookupDescriptor(this, 'currentState');\n let 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 let 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 if (DEPRECATE_MODEL_REOPEN) {\n const originalReopen = Model.reopen;\n const originalReopenClass = Model.reopenClass;\n\n Model.reopen = function deprecatedReopen() {\n deprecate(`Model.reopen is deprecated. Use Foo extends Model to extend your class instead.`, false, {\n id: 'ember-data:deprecate-model-reopen',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n });\n return originalReopen.call(this, ...arguments);\n };\n\n Model.reopenClass = function deprecatedReopenClass() {\n deprecate(\n `Model.reopenClass is deprecated. Use Foo extends Model to add static methods and properties to your class instead.`,\n false,\n {\n id: 'ember-data:deprecate-model-reopenclass',\n for: 'ember-data',\n until: '5.0',\n since: { available: '4.7', enabled: '4.7' },\n }\n );\n return originalReopenClass.call(this, ...arguments);\n };\n }\n}\n\nexport default Model;\n","import { assert, deprecate, warn } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport { dasherize } from '@ember/string';\n\nimport {\n DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC,\n DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE,\n DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE,\n} from '@ember-data/deprecations';\nimport { DEBUG } from '@ember-data/env';\n\nimport { lookupLegacySupport } from './model';\nimport { computedMacroWithOptionalParams } from './util';\n\nfunction normalizeType(type) {\n if (DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE) {\n if (!type) {\n return;\n }\n }\n\n return dasherize(type);\n}\n/**\n @module @ember-data/model\n*/\n\n/**\n `belongsTo` is used to define One-To-One and One-To-Many\n relationships on a [Model](/ember-data/release/classes/Model).\n\n\n `belongsTo` takes an optional hash as a second parameter, currently\n supported options are:\n\n - `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n - `inverse`: A string used to identify the inverse property on a\n related model in a One-To-Many relationship. See [Explicit Inverses](#explicit-inverses)\n - `polymorphic` A boolean value to mark the relationship as polymorphic\n\n #### One-To-One\n To declare a one-to-one relationship between two models, use\n `belongsTo`:\n\n ```app/models/user.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @belongsTo('profile') profile;\n }\n ```\n\n ```app/models/profile.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class ProfileModel extends Model {\n @belongsTo('user') user;\n }\n ```\n\n #### One-To-Many\n\n To declare a one-to-many relationship between two models, use\n `belongsTo` in combination with `hasMany`, 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', { async: false, inverse: 'post' }) 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', { async: false, inverse: 'comments' }) post;\n }\n ```\n\n #### Sync relationships\n\n Ember Data resolves sync relationships with the related resources\n available in its local store, hence it is expected these resources\n to be loaded before or along-side the primary resource.\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', {\n async: false,\n inverse: null\n })\n post;\n }\n ```\n\n In contrast to async relationship, accessing a sync relationship\n will always return the record (Model instance) for the existing\n local resource, or null. But it will error on access when\n a related resource is known to exist and it has not been loaded.\n\n ```\n let post = comment.post;\n\n ```\n\n @method belongsTo\n @public\n @static\n @for @ember-data/model\n @param {String} modelName (optional) type of the relationship\n @param {Object} options (optional) a hash of options\n @return {Ember.computed} relationship\n*/\nfunction belongsTo(modelName, options) {\n let opts = options;\n let userEnteredModelName = modelName;\n if (DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE) {\n if (typeof modelName !== 'string' || !modelName.length) {\n deprecate('belongsTo() must specify the string type of the related resource as the first parameter', false, {\n id: 'ember-data:deprecate-non-strict-relationships',\n for: 'ember-data',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n });\n\n if (typeof modelName === 'object') {\n opts = modelName;\n userEnteredModelName = undefined;\n } else {\n opts = options;\n userEnteredModelName = modelName;\n }\n\n assert(\n 'The first argument to belongsTo must be a string representing a model type key, not an instance of ' +\n typeof userEnteredModelName +\n \". E.g., to define a relation to the Person model, use belongsTo('person')\",\n typeof userEnteredModelName === 'string' || typeof userEnteredModelName === 'undefined'\n );\n }\n }\n\n if (DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC) {\n if (!opts || typeof opts.async !== 'boolean') {\n opts = opts || {};\n if (!('async' in opts)) {\n opts.async = true;\n }\n deprecate('belongsTo(<type>, <options>) must specify options.async as either `true` or `false`.', false, {\n id: 'ember-data:deprecate-non-strict-relationships',\n for: 'ember-data',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n });\n } else {\n assert(`Expected belongsTo options.async to be a boolean`, opts && typeof opts.async === 'boolean');\n }\n } else {\n assert(`Expected belongsTo options.async to be a boolean`, opts && typeof opts.async === 'boolean');\n }\n\n if (DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE) {\n if (opts.inverse !== null && (typeof opts.inverse !== 'string' || opts.inverse.length === 0)) {\n deprecate(\n 'belongsTo(<type>, <options>) must specify options.inverse as either `null` or the name of the field on the related resource type.',\n false,\n {\n id: 'ember-data:deprecate-non-strict-relationships',\n for: 'ember-data',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n }\n );\n } else {\n assert(\n `Expected belongsTo options.inverse to be either null or the string type of the related resource.`,\n opts.inverse === null || (typeof opts.inverse === 'string' && opts.inverse.length > 0)\n );\n }\n } else {\n assert(\n `Expected belongsTo options.inverse to be either null or the string type of the related resource.`,\n opts.inverse === null || (typeof opts.inverse === 'string' && opts.inverse.length > 0)\n );\n }\n\n let meta = {\n type: normalizeType(userEnteredModelName),\n isRelationship: true,\n options: opts,\n kind: 'belongsTo',\n name: 'Belongs To',\n key: null,\n };\n\n return computed({\n get(key) {\n // this is a legacy behavior we may not carry into a new model setup\n // it's better to error on disconnected records so users find errors\n // in their logic.\n if (this.isDestroying || this.isDestroyed) {\n return null;\n }\n const support = lookupLegacySupport(this);\n\n if (DEBUG) {\n if (['currentState'].indexOf(key) !== -1) {\n throw new Error(\n `'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your belongsTo on ${this.constructor.toString()}`\n );\n }\n if (Object.prototype.hasOwnProperty.call(opts, 'serialize')) {\n warn(\n `You provided a serialize option on the \"${key}\" property in the \"${support.identifier.type}\" class, this belongs in the serializer. See Serializer and it's implementations https://api.emberjs.com/ember-data/release/classes/Serializer`,\n false,\n {\n id: 'ds.model.serialize-option-in-belongs-to',\n }\n );\n }\n\n if (Object.prototype.hasOwnProperty.call(opts, 'embedded')) {\n warn(\n `You provided an embedded option on the \"${key}\" property in the \"${support.identifier.type}\" class, this belongs in the serializer. See EmbeddedRecordsMixin https://api.emberjs.com/ember-data/release/classes/EmbeddedRecordsMixin`,\n false,\n {\n id: 'ds.model.embedded-option-in-belongs-to',\n }\n );\n }\n }\n\n return support.getBelongsTo(key);\n },\n set(key, value) {\n const support = lookupLegacySupport(this);\n if (DEBUG) {\n if (['currentState'].indexOf(key) !== -1) {\n throw new Error(\n `'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your belongsTo on ${this.constructor.toString()}`\n );\n }\n }\n this.store._join(() => {\n support.setDirtyBelongsTo(key, value);\n });\n\n return support.getBelongsTo(key);\n },\n }).meta(meta);\n}\n\nexport default computedMacroWithOptionalParams(belongsTo);\n","/**\n @module @ember-data/model\n*/\nimport { A } from '@ember/array';\nimport { assert, deprecate, inspect } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport { dasherize } from '@ember/string';\n\nimport { singularize } from 'ember-inflector';\n\nimport {\n DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC,\n DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE,\n DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE,\n} from '@ember-data/deprecations';\nimport { DEBUG } from '@ember-data/env';\n\nimport { lookupLegacySupport } from './model';\nimport { computedMacroWithOptionalParams } from './util';\n\nfunction normalizeType(type) {\n if (DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE) {\n if (!type) {\n return;\n }\n }\n\n return singularize(dasherize(type));\n}\n\n/**\n `hasMany` is used to define One-To-Many and Many-To-Many\n relationships on a [Model](/ember-data/release/classes/Model).\n\n `hasMany` takes an optional hash as a second parameter, currently\n supported options are:\n\n - `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n - `inverse`: A string used to identify the inverse property on a related model.\n - `polymorphic` A boolean value to mark the relationship as polymorphic\n\n #### One-To-Many\n To declare a one-to-many relationship between two models, use\n `belongsTo` in combination with `hasMany`, 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 ```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 #### Many-To-Many\n To declare a many-to-many relationship between two models, use\n `hasMany`:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('tag') tags;\n }\n ```\n\n ```app/models/tag.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class TagModel extends Model {\n @hasMany('post') posts;\n }\n ```\n\n You can avoid passing a string as the first parameter. In that case Ember Data\n will infer the type from the singularized key name.\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany tags;\n }\n ```\n\n will lookup for a Tag type.\n\n #### Explicit Inverses\n\n Ember Data will do its best to discover which relationships map to\n one another. In the one-to-many code above, for example, Ember Data\n can figure out that changing the `comments` relationship should update\n the `post` relationship on the inverse because post is the only\n relationship to that model.\n\n However, sometimes you may have multiple `belongsTo`/`hasMany` for the\n same type. You can specify which property on the related model is\n the inverse using `hasMany`'s `inverse` option:\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') onePost;\n @belongsTo('post') twoPost\n @belongsTo('post') redPost;\n @belongsTo('post') bluePost;\n }\n ```\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', {\n inverse: 'redPost'\n })\n comments;\n }\n ```\n\n You can also specify an inverse on a `belongsTo`, which works how\n you'd expect.\n\n #### Sync relationships\n\n Ember Data resolves sync relationships with the related resources\n available in its local store, hence it is expected these resources\n to be loaded before or along-side the primary resource.\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', {\n async: false\n })\n comments;\n }\n ```\n\n In contrast to async relationship, accessing a sync relationship\n will always return a [ManyArray](/ember-data/release/classes/ManyArray) instance\n containing the existing local resources. But it will error on access\n when any of the known related resources have not been loaded.\n\n ```\n post.comments.forEach((comment) => {\n\n });\n\n ```\n\n If you are using `links` with sync relationships, you have to use\n `ref.reload` to fetch the resources.\n\n @method hasMany\n @public\n @static\n @for @ember-data/model\n @param {String} type (optional) type of the relationship\n @param {Object} options (optional) a hash of options\n @return {Ember.computed} relationship\n*/\nfunction hasMany(type, options) {\n if (DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE) {\n if (typeof type !== 'string' || !type.length) {\n deprecate(\n 'hasMany(<type>, <options>) must specify the string type of the related resource as the first parameter',\n false,\n {\n id: 'ember-data:deprecate-non-strict-relationships',\n for: 'ember-data',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n }\n );\n if (typeof type === 'object') {\n options = type;\n type = undefined;\n }\n\n assert(\n `The first argument to hasMany must be a string representing a model type key, not an instance of ${inspect(\n type\n )}. E.g., to define a relation to the Comment model, use hasMany('comment')`,\n typeof type === 'string' || typeof type === 'undefined'\n );\n }\n }\n\n if (DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC) {\n if (!options || typeof options.async !== 'boolean') {\n options = options || {};\n if (!('async' in options)) {\n options.async = true;\n }\n deprecate('hasMany(<type>, <options>) must specify options.async as either `true` or `false`.', false, {\n id: 'ember-data:deprecate-non-strict-relationships',\n for: 'ember-data',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n });\n } else {\n assert(`Expected hasMany options.async to be a boolean`, options && typeof options.async === 'boolean');\n }\n } else {\n assert(`Expected hasMany options.async to be a boolean`, options && typeof options.async === 'boolean');\n }\n\n if (DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE) {\n if (options.inverse !== null && (typeof options.inverse !== 'string' || options.inverse.length === 0)) {\n deprecate(\n 'hasMany(<type>, <options>) must specify options.inverse as either `null` or the name of the field on the related resource type.',\n false,\n {\n id: 'ember-data:deprecate-non-strict-relationships',\n for: 'ember-data',\n until: '5.0',\n since: { enabled: '4.7', available: '4.7' },\n }\n );\n }\n }\n\n // Metadata about relationships is stored on the meta of\n // the relationship. This is used for introspection and\n // serialization. Note that `key` is populated lazily\n // the first time the CP is called.\n let meta = {\n type: normalizeType(type),\n options,\n isRelationship: true,\n kind: 'hasMany',\n name: 'Has Many',\n key: null,\n };\n\n return computed({\n get(key) {\n if (DEBUG) {\n if (['currentState'].indexOf(key) !== -1) {\n throw new Error(\n `'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your hasMany on ${this.constructor.toString()}`\n );\n }\n }\n if (this.isDestroying || this.isDestroyed) {\n return A();\n }\n return lookupLegacySupport(this).getHasMany(key);\n },\n set(key, records) {\n if (DEBUG) {\n if (['currentState'].indexOf(key) !== -1) {\n throw new Error(\n `'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your hasMany on ${this.constructor.toString()}`\n );\n }\n }\n const support = lookupLegacySupport(this);\n const manyArray = support.getManyArray(key);\n assert(`You must pass an array of records to set a hasMany relationship`, Array.isArray(records));\n this.store._join(() => {\n manyArray.splice(0, manyArray.length, ...records);\n });\n\n return support.getHasMany(key);\n },\n }).meta(meta);\n}\n\nexport default computedMacroWithOptionalParams(hasMany);\n"],"names":["isElementDescriptor","args","maybeTarget","maybeKey","maybeDesc","length","undefined","computedMacroWithOptionalParams","fn","attr","type","options","meta","isAttribute","computed","get","key","macroCondition","getOwnConfig","env","DEBUG","indexOf","Error","constructor","toString","isDestroyed","isDestroying","peekCache","getAttr","recordIdentifierFor","set","value","assert","currentState","isDeleted","identifier","cache","currentValue","setAttr","isValid","errors","remove","cleanErrorRequests","_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","initializer","call","_applyDecoratedDescriptor","decorators","desc","keys","forEach","slice","reverse","reduce","decorator","PromiseObject","ObjectProxy","extend","PromiseProxyMixin","promiseObject","promise","create","ALLOWABLE_METHODS","ALLOWABLE_PROPS","PROXIED_OBJECT_PROPS","ProxySymbolString","String","Symbol","for","deprecatedPromiseObject","promiseObjectProxy","handler","prop","receiver","Reflect","includes","deprecate","id","until","since","available","enabled","bind","Proxy","ArrayProxyWithCustomOverrides","ArrayProxy","Errors","_dec","_dec2","mapBy","_dec3","_dec4","not","_class","_descriptor","_descriptor2","errorsByAttributeName","Map","errorsFor","attribute","map","A","content","unknownProperty","add","messages","_findOrCreateMessages","addObjects","__record","notify","notifyPropertyChange","messagesArray","Array","isArray","_messages","i","message","err","findBy","isEmpty","rejectBy","setObjects","replace","delete","clear","attributes","_","push","has","prototype","getOwnPropertyDescriptor","RelatedCollection","RecordArray","isLoaded","isAsync","isPolymorphic","MUTATE","result","_manager","mutate","op","record","field","index","prior","extractIdentifiersFromRecords","start","removeCount","adds","SOURCE","tag","IDENTIFIER_ARRAY_TAG","shouldReset","notifyArray","reload","reloadHasMany","createRecord","hash","store","modelName","_inverseIsAsync","DEPRECATED_CLASS_NAME","assertRecordPassedToHasMany","records","extractIdentifierFromRecord","recordOrPromiseRecord","deprecations","DEPRECATE_PROMISE_PROXIES","isPromiseRecord","then","Extended","PromiseBelongsTo","legacySupport","_belongsToState","ref","referenceFor","reloadBelongsTo","cached","PromiseManyArray","_descriptor3","_descriptor4","_descriptor5","_update","DEPRECATE_A_USAGE","Ember","hasMixin","mixin","NativeArray","ArrayMixin","DEPRECATE_COMPUTED_CHAINS","[]","cb","s","f","catch","finally","destroy","links","tapPromise","tracked","dependentKeyCompat","DEPRECATE_PROMISE_MANY_ARRAY_BEHAVIORS","firstObject","lastObject","proxy","isPending","isSettled","isFulfilled","isRejected","Promise","resolve","error","EmberObjectMethods","method","delegatedMethod","InheritedProxyMethods","proxiedMethod","assertPolymorphicType","checkPolymorphic","modelClass","addedModelClass","__isMixin","__mixin","detect","PrototypeMixin","getPrototypeOf","parentIdentifier","parentDefinition","addedIdentifier","asserted","inverseIsImplicit","getSchemaDefinitionService","relationshipsDefinitionFor","inverseKey","DEPRECATE_NON_EXPLICIT_POLYMORPHISM","as","_store","addedModelName","parentModelName","relationshipModelName","relationshipClass","modelFor","addedClass","assertionMessage","isResourceIdentiferWithRelatedLinks","Boolean","related","BelongsToReference","graph","belongsToRelationship","___identifier","___token","___relatedToken","definition","notifications","subscribe","bucket","notifiedKey","_ref","unsubscribe","resource","_resource","data","identifierCache","getOrCreateRecordIdentifier","link","href","DEPRECATE_V1_RECORD_DATA","_instanceCache","getResourceCache","getRelationship","remoteType","jsonApiDoc","_join","peekRecord","load","support","LEGACY_SUPPORT","fetchSyncRel","areAllInverseRecordsLoaded","getBelongsTo","HasManyReference","hasManyRelationship","___relatedTokenMap","token","identifiers","resourceIdentifier","ids","objectOrPromise","payload","array","obj","relationshipMeta","_isLoaded","hasRelationshipDataProperty","state","hasReceivedData","localState","every","recordIsLoaded","loaded","getManyArray","getHasMany","LegacySupport","storeFor","_manyArrayCache","_relationshipPromisesCache","_relationshipProxyCache","_pending","references","_syncArray","jsonApi","_getCurrentState","fastPush","mutation","_findBelongsTo","relationship","_findBelongsToByJsonApiResource","handleCompletedRelationshipRequest","e","loadingPromise","graphFor","importSync","isBelongsTo","hasFailedLoadAttempt","shouldForceReload","_updatePromiseProxyFor","relatedIdentifier","isStableIdentifier","getRecord","toReturn","setDirtyBelongsTo","packages","HAS_JSON_API_PACKAGE","manyArray","doc","inverseIsAsync","manager","allowMutation","fetchAsyncHasMany","_findHasManyByJsonApiResource","anyUnloaded","kind","promiseProxy","name","reference","actualRelationshipKind","relationshipKind","adapter","adapterFor","isStale","hasDematerializedInverse","allInverseRecordsAreLoaded","shouldFindViaLink","findHasMany","inverseType","request","useLink","cacheOptions","preferLocalCache","hasLocalPartialData","attemptLocalCache","hasData","future","localDataIsEmpty","resourceIsLocal","recordExt","isHasMany","_flush","unloaded","find","instanceCache","notifyChanges","notifyAttribute","eachAttribute","relationshipsByName","notifyRelationship","eachRelationship","hasPromise","async","cacheFor","SOURCE_POINTER_REGEXP","SOURCE_POINTER_PRIMARY_REGEXP","PRIMARY_ATTRIBUTE_KEY","isInvalidError","isAdapterError","code","Tag","base","arguments","_debug_base","_debug_prop","rev","isDirty","t","addToTransaction","consume","v","Tags","WeakMap","getTag","tags","peekTag","tagged","_target","getter","setter","RecordState","_class3","identity","pendingCount","fulfilledCount","rejectedCount","_errorRequests","_lastError","requests","getRequestStateService","handleRequest","req","isSaving","response","notifyErrorsStateChanged","subscribeForRecord","lastRequest","getLastRequestForRecord","updateInvalidErrors","getErrors","jsonApiErrors","source","pointer","keyMatch","match","search","errMsg","detail","title","isLoading","isNew","isSaved","rd","isDeletionCommitted","hasChangedAttrs","isError","errorReq","adapterError","isPreloaded","stateName","dirtyType","typeForRelationshipMeta","dasherize","singularize","shouldFindInverse","inverse","RelationshipDefinition","_type","__inverseKey","__hasCalculatedInverse","_inverseKey","_calculateInverse","inverseFor","polymorphic","typeForRelationship","relationshipFromMeta","changeProperties","lookupLegacySupport","findPossibleInverses","relationshipsSoFar","possibleRelationships","relationshipMap","relationships","relationshipsForType","filter","optionsForRelationship","apply","superclass","computeOnce","hasComputed","Model","_class2","EmberObject","___private_notifications","init","_secretInit","_createProps","createProps","___recordState","setProperties","hasDirtyAttributes","normalizedId","coerceId","didChange","setRecordId","_v","serialize","serializeRecord","deleteRecord","destroyRecord","save","run","unloadRecord","_notifyProperties","changedAttributes","changedAttrs","rollbackAttributes","rollbackAttrs","_createSnapshot","_fetchManager","FetchManager","createSnapshot","saveRecord","DEPRECATE_SAVE_PROMISE_ACCESS","isReloading","belongsTo","hasMany","callback","binding","relationshipFor","DEPRECATE_EARLY_STATIC","inverseMap","_findInverseFor","isExplicitInverseNull","isAbstractType","doesTypeExist","fieldOnInverse","inverseKind","inverseRelationship","inverseOptions","inverseSchema","warn","filteredRelationships","possibleRelationship","explicitRelationship","relationshipNames","names","eachComputedProperty","isRelationship","relatedTypes","types","rels","relationshipsObject","DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE","fields","eachRelatedType","relationshipTypes","determineRelationshipType","knownSide","knownKey","knownKind","otherKind","transformedAttributes","eachTransformedAttribute","isModel","includeDataAdapter","_debugInfo","expensiveProperties","schema","attrDefs","attributesDefinitionFor","relDefs","unshift","groups","properties","expand","propertyInfo","includeOtherProperties","lookupDescriptor","keyName","current","reopen","_super","ourDescriptor","theirDescriptor","realState","ID_DESCRIPTOR","idDesc","DEPRECATE_MODEL_REOPEN","originalReopen","originalReopenClass","reopenClass","deprecatedReopen","deprecatedReopenClass","normalizeType","DEPRECATE_RELATIONSHIPS_WITHOUT_TYPE","opts","userEnteredModelName","DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC","hasOwnProperty","inspect","splice"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,SAASA,mBAAmBA,CAACC,IAAW,EAAyD;EACtG,IAAI,CAACC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,CAAC,GAAGH,IAAI,CAAA;AAE7C,EAAA;AACE;IACAA,IAAI,CAACI,MAAM,KAAK,CAAC;AACjB;AACC,IAAA,OAAOH,WAAW,KAAK,UAAU,IAAK,OAAOA,WAAW,KAAK,QAAQ,IAAIA,WAAW,KAAK,IAAK,CAAC;AAChG;IACA,OAAOC,QAAQ,KAAK,QAAQ;AAC5B;AACE,IAAA,OAAOC,SAAS,KAAK,QAAQ,IAC7BA,SAAS,KAAK,IAAI,IAClB,YAAY,IAAIA,SAAS,IACzB,cAAc,IAAIA,SAAS;AAC3B;AACAA,IAAAA,SAAS,KAAKE,SAAS,CAAA;AAAC,IAAA;AAE9B,CAAA;AAEO,SAASC,+BAA+BA,CAACC,EAAE,EAAE;EAClD,OAAO,CAAC,GAAGJ,SAAgB,KAAMJ,mBAAmB,CAACI,SAAS,CAAC,GAAGI,EAAE,EAAE,CAAC,GAAGJ,SAAS,CAAC,GAAGI,EAAE,CAAC,GAAGJ,SAAS,CAAE,CAAA;AAC1G;;ACfA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASK,IAAIA,CAACC,IAAI,EAAEC,OAAO,EAAE;AAC3B,EAAA,IA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,qBAAqB,CAAA;AACjD,IAAA,IAAI,CAAC3F,KAAK,CAACmH,KAAK,CAAC,MAAM;AACrB,MAAA,IAAI,CAACzB,KAAK,CAACzH,IAAI,CAAC;AACda,QAAAA,EAAE,EAAE,sBAAsB;AAC1BC,QAAAA,MAAM,EAAEnH,UAAU;QAClBoH,KAAK,EAAE,IAAI,CAACvI,GAAG;QACfe,KAAK,EAAEF,qBAAmB,CAACyH,MAAM,CAAA;AACnC,OAAC,CAAC,CAAA;AACJ,KAAC,CAAC,CAAA;AAEF,IAAA,OAAOA,MAAM,CAAA;AACf,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;AAQEvH,EAAAA,KAAKA,GAA0B;AAC7B,IAAA,IAAI8O,QAAQ,GAAG,IAAI,CAACC,SAAS,EAAE,CAAA;AAC/B,IAAA,OAAOD,QAAQ,IAAIA,QAAQ,CAACE,IAAI,GAAG,IAAI,CAACxG,KAAK,CAACoH,UAAU,CAACd,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;EAYEa,IAAIA,CAACjR,OAAuB,EAAE;IAC5B,MAAMkR,OAAsB,GAAIC,cAAc,CAAgD/Q,GAAG,CAC/F,IAAI,CAACoP,aAAa,CAClB,CAAA;IACF,MAAM4B,YAAY,GAChB,CAAC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AAY,CAAC6G,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,IACIkW,kBAAkBA,GAAG;AACvB,IAAA,OAAO,IAAI,CAAC/c,YAAY,CAACiX,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,IACI0B,QAAQA,GAAG;AACb,IAAA,OAAO,IAAI,CAAC3Y,YAAY,CAAC2Y,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,IACI1Y,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAACD,YAAY,CAACC,SAAS,CAAA;AACpC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACI4Z,KAAKA,GAAG;AACV,IAAA,OAAO,IAAI,CAAC7Z,YAAY,CAAC6Z,KAAK,CAAA;AAChC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAGE,IACIvZ,OAAOA,GAAG;AACZ,IAAA,OAAO,IAAI,CAACN,YAAY,CAACM,OAAO,CAAA;AAClC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IACIia,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAACva,YAAY,CAACua,SAAS,CAAA;AACpC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AACA;AACA;AACA;AACA;EAYEye,SAASA,CAACxK,IAAI,EAAE;IACd,OAAOwH,mBAAmB,CAAC,IAAI,CAAC,CAACjS,YAAY,CAAC,WAAW,EAAEyK,IAAI,CAAC,CAAA;AAClE,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;EAYEyK,OAAOA,CAACzK,IAAI,EAAE;IACZ,OAAOwH,mBAAmB,CAAC,IAAI,CAAC,CAACjS,YAAY,CAAC,SAAS,EAAEyK,IAAI,CAAC,CAAA;AAChE,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;AAcEiC,EAAAA,gBAAgBA,CAACyI,QAAQ,EAAEC,OAAO,EAAE;IAClC,IAAI,CAACrf,WAAW,CAAC2W,gBAAgB,CAACyI,QAAQ,EAAEC,OAAO,CAAC,CAAA;AACtD,GAAA;EAEAC,eAAeA,CAAC5K,IAAI,EAAE;IACpB,OAAO,IAAI,CAAC1U,WAAW,CAACyW,mBAAmB,CAACjX,GAAG,CAACkV,IAAI,CAAC,CAAA;AACvD,GAAA;EAEAmH,UAAUA,CAACpc,GAAG,EAAE;AACd,IAAA,OAAO,IAAI,CAACO,WAAW,CAAC6b,UAAU,CAACpc,GAAG,EAAEyS,UAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AACzD,GAAA;AAEAsE,EAAAA,aAAaA,CAAC4I,QAAQ,EAAEC,OAAO,EAAE;IAC/B,IA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AAA;AAC5C,OAAC,CACF,CAAA;MACD,OAAOgf,mBAAmB,CAACphB,IAAI,CAAC,IAAI,EAAE,GAAGwV,SAAS,CAAC,CAAA;KACpD,CAAA;AACH,GAAA;AACF;;AC39EA,SAASgM,eAAaA,CAACpkB,IAAI,EAAE;AAC3B,EAAA,IAAAO,cAAA,CAAAC,YAAA,GAAA6J,YAAA,CAAAga,oCAAA,CAA0C,EAAA;IACxC,IAAI,CAACrkB,IAAI,EAAE;AACT,MAAA,OAAA;AACF,KAAA;AACF,GAAA;EAEA,OAAOgc,SAAS,CAAChc,IAAI,CAAC,CAAA;AACxB,CAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS+f,SAASA,CAACjW,SAAS,EAAE7J,OAAO,EAAE;EACrC,IAAIqkB,IAAI,GAAGrkB,OAAO,CAAA;EAClB,IAAIskB,oBAAoB,GAAGza,SAAS,CAAA;AACpC,EAAA,IAAAvJ,cAAA,CAAAC,YAAA,GAAA6J,YAAA,CAAAga,oCAAA,CAA0C,EAAA;IACxC,IAAI,OAAOva,SAAS,KAAK,QAAQ,IAAI,CAACA,SAAS,CAACnK,MAAM,EAAE;AACtDgF,MAAAA,SAAS,CAAC,yFAAyF,EAAE,KAAK,EAAE;AAC1GC,QAAAA,EAAE,EAAE,+CAA+C;AACnD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B,IAAI,EAAE;AACT,MAAA,OAAA;AACF,KAAA;AACF,GAAA;AAEA,EAAA,OAAOic,WAAW,CAACD,SAAS,CAAChc,IAAI,CAAC,CAAC,CAAA;AACrC,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASggB,OAAOA,CAAChgB,IAAI,EAAEC,OAAO,EAAE;AAC9B,EAAA,IAAAM,cAAA,CAAAC,YAAA,GAAA6J,YAAA,CAAAga,oCAAA,CAA0C,EAAA;IACxC,IAAI,OAAOrkB,IAAI,KAAK,QAAQ,IAAI,CAACA,IAAI,CAACL,MAAM,EAAE;AAC5CgF,MAAAA,SAAS,CACP,wGAAwG,EACxG,KAAK,EACL;AACEC,QAAAA,EAAE,EAAE,+CAA+C;AACnDT,QAAAA,GAAG,EAAE,YAAY;AACjBU,QAAAA,KAAK,EAAE,KAAK;AACZC,QAAAA,KAAK,EAAE;AAAEE,UAAAA,OAAO,EAAE,KA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