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 owned_assets_exports = {};
__export(owned_assets_exports, {
  canonicalizeOwnedAssetFingerprintInput: () => canonicalizeOwnedAssetFingerprintInput
});
module.exports = __toCommonJS(owned_assets_exports);
function sortObjectKeys(value) {
  if (Array.isArray(value)) {
    return value.map((entry) => sortObjectKeys(entry));
  }
  if (!value || typeof value !== "object") {
    return value;
  }
  return Object.keys(value).sort((left, right) => left.localeCompare(right)).reduce((acc, key) => {
    acc[key] = sortObjectKeys(value[key]);
    return acc;
  }, {});
}
function canonicalizeOwnedAssetFingerprintInput(input) {
  return JSON.stringify(sortObjectKeys({
    category: input.category,
    subcategory: input.subcategory ?? null,
    format: input.format,
    visibility: input.visibility,
    license: input.license ?? null,
    sourceKind: input.sourceKind,
    assetSpecVersionId: input.assetSpecVersionId ?? null,
    remixTargetNodeId: input.remixTargetNodeId ?? null,
    validationStatus: input.validationStatus ?? null,
    validationReportJson: input.validationReportJson ?? null,
    files: [...input.files].map((file) => ({
      role: file.role.trim().toLowerCase(),
      contentType: file.contentType.trim().toLowerCase(),
      sizeBytes: file.sizeBytes,
      sha256: file.sha256.trim().toLowerCase()
    })).sort((left, right) => left.role.localeCompare(right.role))
  }));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  canonicalizeOwnedAssetFingerprintInput
});
