/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { ElementTag } from "../common/index.js";
import { FieldElement } from "./FieldElement.js";
import { ValueElement } from "./ValueElement.js";
function DatatypeElement(definition, ...children) {
  return ValueElement(DatatypeElement.Tag, definition, children);
}
((DatatypeElement2) => {
  DatatypeElement2.Tag = ElementTag.Datatype;
  function ListValues(values) {
    const result = Array();
    for (const [k, v] of Object.entries(values)) {
      if (typeof v === "number") {
        result.push(
          FieldElement({
            id: v,
            name: k,
            type: "uint8",
            default: v
          })
        );
      }
    }
    return result;
  }
  DatatypeElement2.ListValues = ListValues;
})(DatatypeElement || (DatatypeElement = {}));
export {
  DatatypeElement
};
//# sourceMappingURL=DatatypeElement.js.map
