import { Version } from "../../version/index.js";
const galleryDataNormalizer = (componentData, normalizerConfig, stateVersion) => {
  const shouldNormalizeDisableDownload = componentData.disableDownload === void 0 && normalizerConfig.disableDownload !== void 0;
  const shouldNormalizeExpand = componentData.disableExpand === void 0 && normalizerConfig.disableGalleryExpand !== void 0;
  if (shouldNormalizeDisableDownload) {
    componentData.disableDownload = normalizerConfig.disableDownload;
  }
  if (shouldNormalizeExpand) {
    componentData.disableExpand = normalizerConfig.disableGalleryExpand;
  }
  if (Version.lessThan(stateVersion, "6")) {
    const items = componentData.items.map((item) => {
      const { metadata } = item;
      const altText = metadata.title;
      if (altText) {
        metadata.altText = altText;
      }
      delete metadata.title;
      return item;
    });
    componentData.items = items;
  }
  if (Version.lessThan(stateVersion, "8.49.0")) {
    componentData.styles.thumbnailSpacings && (componentData.styles.thumbnailSpacings *= 2);
  }
  return componentData;
};
export {
  galleryDataNormalizer
};
//# sourceMappingURL=gallery-data-normalizer.js.map
