import ServerDocumentMixin from"../backend/server-document.mjs";import BaseActiveEffect from"../../../common/documents/active-effect.mjs";import{isEmpty}from"../../../common/utils/_module.mjs";export default class ActiveEffect extends(ServerDocumentMixin(BaseActiveEffect)){static _migrationRegistry=[...super._migrationRegistry,{fn:migrateLabelToName,version:12},{fn:migrateSystemDataInChanges,version:12},{fn:migrateOriginOwnedItem,version:12},{fn:migrateIconToImg,version:12},{fn:migrateTemporary,version:"14.353"}]}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 i of e.changes)foundry.utils.isPlainObject(i)&&"string"==typeof i.key&&i.key.startsWith("data.")&&(i.key=i.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)}function migrateIconToImg(e){return ActiveEffect._addDataFieldMigration(e,"icon","img")}function migrateTemporary(e){return!isEmpty(e?.statuses)&&(e.showIcon=CONST.ACTIVE_EFFECT_SHOW_ICON.ALWAYS,!0)}