/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
function BaseElement(tag, definition, children) {
  const result = { tag };
  for (const [k, v] of Object.entries(definition)) {
    if (v !== void 0) {
      result[k] = v;
    }
  }
  if (children.length) {
    if (!result.children) {
      result.children = children;
    } else {
      result.children.push(...children);
    }
  }
  return result;
}
export {
  BaseElement
};
//# sourceMappingURL=BaseElement.js.map
