import ServerDocumentMixin from"../backend/server-document.mjs";import BaseActiveEffect from"../../../common/documents/active-effect.mjs";import{getType}from"../../../common/utils/helpers.mjs";export default class ActiveEffect extends(ServerDocumentMixin(BaseActiveEffect)){static _migrationRegistry=[...super._migrationRegistry,{fn:migrateLabelToName,version:12},{fn:migrateSystemDataInChanges,version:12},{fn:migrateOriginOwnedItem,version:12}]}function migrateLabelToName(e){return!("name"in e)&&(e.name=e.label||"Unnamed Effect",delete e.label,!0)}function migrateSystemDataInChanges(e){if(!Array.isArray(e.changes))return!1;let t=!1;for(const n of e.changes)"Object"===getType(n)&&"string"==typeof n.key&&n.key.startsWith("data.")&&(n.key=n.key.replace(/^data\./,"system."),t=!0);return t}function migrateOriginOwnedItem(e){if("string"!=typeof e.origin)return!1;const t=e.origin.split(".").map((e=>"OwnedItem"===e?"Item":e)).join(".");return e.origin!==t&&(e.origin=t,!0)}