var m = Object.defineProperty;
var g = (t, e, r) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
var i = (t, e, r) => g(t, typeof e != "symbol" ? e + "" : e, r);
import { jsx as l } from "react/jsx-runtime";
import { createPluginFactory as p } from "@udecode/plate-core";
import { merge as u } from "../../../../../utilities/merge.es.js";
import { alignmentClassnames as c } from "../../helper.es.js";
import { TextStyles as a } from "../types.es.js";
import { Plugin as d } from "../../Plugin.es.js";
import { defaultStyles as f } from "../../../utils/defaultStyles.es.js";
import { MarkupElement as y } from "../../MarkupElement.es.js";
import { getColumnBreakClasses as h } from "../../ColumnBreakPlugin/utils/getColumnBreakClasses.es.js";
const H = "textstyle-heading4-plugin";
class z extends d {
  constructor({ styles: r = f.heading4, ...n } = {}) {
    super(a.heading4, {
      label: "Heading 4",
      markupElement: new k(),
      ...n
    });
    i(this, "styles", {});
    this.styles = r;
  }
  plugins() {
    return [x(this.styles)];
  }
}
class k extends y {
  constructor(e = H, r = s) {
    super(e, r);
  }
}
const s = ({ element: t, attributes: e, children: r, styles: n }) => {
  const o = t.align;
  return /* @__PURE__ */ l(
    "h4",
    {
      ...e,
      className: u([o && c[o], h(t)]),
      style: n,
      children: r
    }
  );
}, x = (t) => p({
  key: a.heading4,
  isElement: !0,
  component: s,
  deserializeHtml: {
    rules: [{ validNodeName: ["h4", "H4"] }]
  }
})({
  component: (e) => /* @__PURE__ */ l(s, { ...e, styles: t })
});
export {
  z as Heading4Plugin
};
//# sourceMappingURL=heading4Plugin.es.js.map
