/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Quality } from "#aspects/Quality.js";
import { InvalidMetadataError } from "#decoration/errors.js";
import { FieldSemantics } from "#decoration/semantics/FieldSemantics.js";
import { Decorator } from "#general";
import { ValueModel } from "#models/ValueModel.js";
const nonvolatile = Decorator((_target, context) => {
  const model = FieldSemantics.of(context).mutableModel;
  if (!(model instanceof ValueModel)) {
    throw new InvalidMetadataError("Only a value models may be nonvolatile");
  }
  model.quality = new Quality({ ...model.quality, nonvolatile: true });
});
export {
  nonvolatile
};
//# sourceMappingURL=nonvolatile.js.map
