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 { defaultStyles as u } from "../../../utils/defaultStyles.es.js";
import { merge as c } from "../../../../../utilities/merge.es.js";
import { MarkupElement as d } from "../../MarkupElement.es.js";
import { Plugin as f } from "../../Plugin.es.js";
import { alignmentClassnames as y } from "../../helper.es.js";
import { TextStyles as a } from "../types.es.js";
import { getColumnBreakClasses as h } from "../../ColumnBreakPlugin/utils/getColumnBreakClasses.es.js";
const H = "textstyle-heading2-plugin";
class z extends f {
  constructor({ styles: r = u.heading2, ...n } = {}) {
    super(a.heading2, {
      label: "Heading 2",
      markupElement: new k(),
      ...n
    });
    i(this, "styles", {});
    this.styles = r;
  }
  plugins() {
    return [x(this.styles)];
  }
}
class k extends d {
  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(
    "h2",
    {
      ...e,
      className: c([o && y[o], h(t)]),
      style: n,
      children: r
    }
  );
}, x = (t) => p({
  key: a.heading2,
  isElement: !0,
  component: s,
  deserializeHtml: {
    rules: [{ validNodeName: ["h2", "H2"] }]
  }
})({
  component: (e) => /* @__PURE__ */ l(s, { ...e, styles: t })
});
export {
  z as Heading2Plugin
};
//# sourceMappingURL=heading2Plugin.es.js.map
