import React from "react";
import { Decoration_Type } from "./../../ricos-schema/legacy/wix/rich_content/v1/index.js";
const decorator = (element, italicDecoration) => {
  const { italicData } = italicDecoration;
  const isItalic = typeof italicData === "undefined" || italicData;
  return /* @__PURE__ */ React.createElement("em", { key: `italic-${element.key}`, style: { fontStyle: isItalic ? "italic" : "normal" } }, element);
};
const ItalicDecorator = {
  rule: (node) => !!node.textData?.decorations?.some(({ type }) => type === Decoration_Type.ITALIC),
  decorate: ({ element, node }) => {
    const italicDecoration = node.textData?.decorations?.find(
      ({ type }) => type === Decoration_Type.ITALIC
    );
    return decorator(element, italicDecoration);
  }
};
var viewer_default = ItalicDecorator;
export {
  viewer_default as default
};
//# sourceMappingURL=viewer.js.map
