var o = Object.defineProperty;
var u = (r, t, e) => t in r ? o(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
var s = (r, t, e) => (u(r, typeof t != "symbol" ? t + "" : t, e), e);
import { BlockEmbed as n } from "../blots/block.mjs";
import f from "./link.mjs";
const c = ["height", "width"];
class a extends n {
  static create(t) {
    const e = super.create(t);
    return e.setAttribute("frameborder", "0"), e.setAttribute("allowfullscreen", "true"), e.setAttribute("src", this.sanitize(t)), e;
  }
  static formats(t) {
    return c.reduce((e, i) => (t.hasAttribute(i) && (e[i] = t.getAttribute(i)), e), {});
  }
  static sanitize(t) {
    return f.sanitize(t);
  }
  static value(t) {
    return t.getAttribute("src");
  }
  format(t, e) {
    c.indexOf(t) > -1 ? e ? this.domNode.setAttribute(t, e) : this.domNode.removeAttribute(t) : super.format(t, e);
  }
  html() {
    const {
      video: t
    } = this.value();
    return `<a href="${t}">${t}</a>`;
  }
}
s(a, "blotName", "video"), s(a, "className", "ql-video"), s(a, "tagName", "IFRAME");
export {
  a as default
};
