var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var entity_exports = {};
__export(entity_exports, {
  AVATAR_VISIBILITY_VALUES: () => AVATAR_VISIBILITY_VALUES,
  ENTITY_TYPE_VALUES: () => ENTITY_TYPE_VALUES,
  isEntityMetadata: () => isEntityMetadata,
  isEntityType: () => isEntityType
});
module.exports = __toCommonJS(entity_exports);
const ENTITY_TYPE_VALUES = ["AVATAR", "HUMANOID", "CREATURE", "BLOCK"];
const AVATAR_VISIBILITY_VALUES = ["DEFAULT", "SHOP", "HIDDEN"];
function isNullableNumber(value) {
  return value === null || value === void 0 || typeof value === "number" && Number.isFinite(value);
}
function isEntityType(value) {
  if (typeof value !== "string") {
    return false;
  }
  return ENTITY_TYPE_VALUES.includes(value);
}
function isEntityMetadata(value) {
  if (typeof value !== "object" || value === null) {
    return false;
  }
  const metadata = value;
  const id = metadata["id"];
  const name = metadata["name"];
  const displayName = metadata["displayName"];
  const description = metadata["description"];
  const creatorId = metadata["creatorId"];
  const creatorUsername = metadata["creatorUsername"];
  const createdAt = metadata["createdAt"];
  const updatedAt = metadata["updatedAt"];
  const meshUrl = metadata["meshUrl"];
  const previewUrl = metadata["previewUrl"];
  const boxelUrl = metadata["boxelUrl"];
  const meshSizeBytes = metadata["meshSizeBytes"];
  const previewSizeBytes = metadata["previewSizeBytes"];
  const definitionSizeBytes = metadata["definitionSizeBytes"];
  const type = metadata["type"];
  const priceCredits = metadata["priceCredits"];
  const avatarVisibility = metadata["avatarVisibility"];
  return typeof id === "number" && Number.isInteger(id) && typeof name === "string" && name.length > 0 && typeof displayName === "string" && typeof description === "string" && typeof creatorId === "number" && Number.isInteger(creatorId) && typeof creatorUsername === "string" && typeof createdAt === "string" && typeof updatedAt === "string" && typeof meshUrl === "string" && typeof previewUrl === "string" && typeof boxelUrl === "string" && isNullableNumber(meshSizeBytes) && isNullableNumber(previewSizeBytes) && isNullableNumber(definitionSizeBytes) && isEntityType(type) && (priceCredits === void 0 || priceCredits === null || typeof priceCredits === "number") && (avatarVisibility === void 0 || avatarVisibility === null || typeof avatarVisibility === "string" && AVATAR_VISIBILITY_VALUES.includes(avatarVisibility));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  AVATAR_VISIBILITY_VALUES,
  ENTITY_TYPE_VALUES,
  isEntityMetadata,
  isEntityType
});
