import _startCase from "lodash/startCase";
import _get from "lodash/get";
export default {
  name: "pb-render-page-element-style-margin",
  type: "pb-render-page-element-style",
  renderStyle: function renderStyle(_ref) {
    var element = _ref.element,
        style = _ref.style;

    var _get2 = _get(element, "data.settings", {}),
        margin = _get2.margin;

    if (!margin) {
      return style;
    }

    var adv = margin.advanced;
    var _margin$desktop = margin.desktop,
        desktop = _margin$desktop === void 0 ? {} : _margin$desktop;
    ["top", "right", "bottom", "left"].forEach(function (side) {
      var Side = _startCase(side);

      style["margin".concat(Side)] = ((adv ? desktop[side] : desktop.all) || 0) + "px";
    });
    return style;
  }
};
//# sourceMappingURL=index.js.map