import d from "../blots/block.mjs";
import l from "../blots/container.mjs";
import m from "../core/quill.mjs";
class s extends l {
}
s.blotName = "list-container";
s.tagName = "OL";
class r extends d {
  static create(t) {
    const e = super.create();
    return e.setAttribute("data-list", t), e;
  }
  static formats(t) {
    return t.getAttribute("data-list") || void 0;
  }
  static register() {
    m.register(s);
  }
  constructor(t, e) {
    super(t, e);
    const i = e.ownerDocument.createElement("span"), a = (n) => {
      if (!t.isEnabled())
        return;
      const o = this.statics.formats(e, t);
      o === "checked" ? (this.format("list", "unchecked"), n.preventDefault()) : o === "unchecked" && (this.format("list", "checked"), n.preventDefault());
    };
    i.addEventListener("mousedown", a), i.addEventListener("touchstart", a), this.attachUI(i);
  }
  format(t, e) {
    t === this.statics.blotName && e ? this.domNode.setAttribute("data-list", e) : super.format(t, e);
  }
}
r.blotName = "list";
r.tagName = "LI";
s.allowedChildren = [r];
r.requiredContainer = s;
export {
  s as ListContainer,
  r as default
};
