"use strict";
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 plugin_shape_exports = {};
__export(plugin_shape_exports, {
  ShapeData: () => ShapeData,
  ShapeData_Styles: () => ShapeData_Styles,
  ShapeData_Styles_ColorsEntry: () => ShapeData_Styles_ColorsEntry
});
module.exports = __toCommonJS(plugin_shape_exports);
var import_common = require("./common.js");
const baseShapeData = {};
const ShapeData = {
  fromJSON(object) {
    const message = { ...baseShapeData };
    message.containerData = object.containerData !== void 0 && object.containerData !== null ? import_common.PluginContainerData.fromJSON(object.containerData) : void 0;
    message.shape = object.shape !== void 0 && object.shape !== null ? import_common.Media.fromJSON(object.shape) : void 0;
    message.styles = object.styles !== void 0 && object.styles !== null ? ShapeData_Styles.fromJSON(object.styles) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.containerData !== void 0 && (obj.containerData = message.containerData ? import_common.PluginContainerData.toJSON(message.containerData) : void 0);
    message.shape !== void 0 && (obj.shape = message.shape ? import_common.Media.toJSON(message.shape) : void 0);
    message.styles !== void 0 && (obj.styles = message.styles ? ShapeData_Styles.toJSON(message.styles) : void 0);
    return obj;
  }
};
const baseShapeData_Styles = {};
const ShapeData_Styles = {
  fromJSON(object) {
    const message = { ...baseShapeData_Styles };
    message.color = object.color !== void 0 && object.color !== null ? String(object.color) : void 0;
    message.colors = Object.entries(object.colors ?? {}).reduce((acc, [key, value]) => {
      acc[key] = String(value);
      return acc;
    }, {});
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.color !== void 0 && (obj.color = message.color);
    obj.colors = {};
    if (message.colors) {
      Object.entries(message.colors).forEach(([k, v]) => {
        obj.colors[k] = v;
      });
    }
    return obj;
  }
};
const baseShapeData_Styles_ColorsEntry = { key: "", value: "" };
const ShapeData_Styles_ColorsEntry = {
  fromJSON(object) {
    const message = {
      ...baseShapeData_Styles_ColorsEntry
    };
    message.key = object.key !== void 0 && object.key !== null ? String(object.key) : "";
    message.value = object.value !== void 0 && object.value !== null ? String(object.value) : "";
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.key !== void 0 && (obj.key = message.key);
    message.value !== void 0 && (obj.value = message.value);
    return obj;
  }
};
//# sourceMappingURL=plugin_shape.js.map
