import { PluginContainerData, Media, Link } from "./common.js";
const baseImageData = {};
const ImageData = {
  fromJSON(object) {
    const message = { ...baseImageData };
    message.containerData = object.containerData !== void 0 && object.containerData !== null ? PluginContainerData.fromJSON(object.containerData) : void 0;
    message.image = object.image !== void 0 && object.image !== null ? Media.fromJSON(object.image) : void 0;
    message.link = object.link !== void 0 && object.link !== null ? Link.fromJSON(object.link) : void 0;
    message.disableExpand = object.disableExpand !== void 0 && object.disableExpand !== null ? Boolean(object.disableExpand) : void 0;
    message.altText = object.altText !== void 0 && object.altText !== null ? String(object.altText) : void 0;
    message.caption = object.caption !== void 0 && object.caption !== null ? String(object.caption) : void 0;
    message.disableDownload = object.disableDownload !== void 0 && object.disableDownload !== null ? Boolean(object.disableDownload) : void 0;
    message.decorative = object.decorative !== void 0 && object.decorative !== null ? Boolean(object.decorative) : void 0;
    message.styles = object.styles !== void 0 && object.styles !== null ? ImageData_Styles.fromJSON(object.styles) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.containerData !== void 0 && (obj.containerData = message.containerData ? PluginContainerData.toJSON(message.containerData) : void 0);
    message.image !== void 0 && (obj.image = message.image ? Media.toJSON(message.image) : void 0);
    message.link !== void 0 && (obj.link = message.link ? Link.toJSON(message.link) : void 0);
    message.disableExpand !== void 0 && (obj.disableExpand = message.disableExpand);
    message.altText !== void 0 && (obj.altText = message.altText);
    message.caption !== void 0 && (obj.caption = message.caption);
    message.disableDownload !== void 0 && (obj.disableDownload = message.disableDownload);
    message.decorative !== void 0 && (obj.decorative = message.decorative);
    message.styles !== void 0 && (obj.styles = message.styles ? ImageData_Styles.toJSON(message.styles) : void 0);
    return obj;
  }
};
const baseImageData_Styles = {};
const ImageData_Styles = {
  fromJSON(object) {
    const message = { ...baseImageData_Styles };
    message.border = object.border !== void 0 && object.border !== null ? ImageData_Styles_Border.fromJSON(object.border) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.border !== void 0 && (obj.border = message.border ? ImageData_Styles_Border.toJSON(message.border) : void 0);
    return obj;
  }
};
const baseImageData_Styles_Border = {};
const ImageData_Styles_Border = {
  fromJSON(object) {
    const message = {
      ...baseImageData_Styles_Border
    };
    message.width = object.width !== void 0 && object.width !== null ? Number(object.width) : void 0;
    message.color = object.color !== void 0 && object.color !== null ? String(object.color) : void 0;
    message.radius = object.radius !== void 0 && object.radius !== null ? Number(object.radius) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.width !== void 0 && (obj.width = message.width);
    message.color !== void 0 && (obj.color = message.color);
    message.radius !== void 0 && (obj.radius = message.radius);
    return obj;
  }
};
export {
  ImageData,
  ImageData_Styles,
  ImageData_Styles_Border
};
//# sourceMappingURL=plugin_image.js.map
