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 creator_public_image_exports = {};
__export(creator_public_image_exports, {
  resolveCreatorPublicImageCandidate: () => resolveCreatorPublicImageCandidate,
  resolveCreatorPublicImageUrl: () => resolveCreatorPublicImageUrl
});
module.exports = __toCommonJS(creator_public_image_exports);
function normalizeUrl(value) {
  if (typeof value !== "string") {
    return null;
  }
  const trimmed = value.trim();
  return trimmed.length > 0 ? trimmed : null;
}
function resolveCreatorPublicImageCandidate(profile) {
  if (!profile) {
    return null;
  }
  const xProfileImageUrl = normalizeUrl(profile.xProfileImageUrl);
  if (xProfileImageUrl) {
    return {
      kind: "x-profile-image",
      url: xProfileImageUrl
    };
  }
  const googleProfileImageUrl = normalizeUrl(profile.googleProfileImageUrl);
  if (googleProfileImageUrl) {
    return {
      kind: "google-profile-image",
      url: googleProfileImageUrl
    };
  }
  const profileAssetPreviewUrl = normalizeUrl(profile.profileAssetPreviewUrl);
  if (profileAssetPreviewUrl) {
    return {
      kind: "profile-asset-preview",
      url: profileAssetPreviewUrl
    };
  }
  return null;
}
function resolveCreatorPublicImageUrl(profile) {
  return resolveCreatorPublicImageCandidate(profile)?.url ?? null;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  resolveCreatorPublicImageCandidate,
  resolveCreatorPublicImageUrl
});
