var c = Object.defineProperty;
var n = (s, t, e) => t in s ? c(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
var r = (s, t, e) => (n(s, typeof t != "symbol" ? t + "" : t, e), e);
import { EmbedBlot as d } from "../../../../parchment@3.0.0/node_modules/parchment/dist/parchment.mjs";
import { sanitize as f } from "./link.mjs";
const a = ["alt", "height", "width"];
class o extends d {
  static create(t) {
    const e = super.create(t);
    return typeof t == "string" && e.setAttribute("src", this.sanitize(t)), e;
  }
  static formats(t) {
    return a.reduce((e, i) => (t.hasAttribute(i) && (e[i] = t.getAttribute(i)), e), {});
  }
  static match(t) {
    return /\.(jpe?g|gif|png)$/.test(t) || /^data:image\/.+;base64/.test(t);
  }
  static sanitize(t) {
    return f(t, ["http", "https", "data"]) ? t : "//:0";
  }
  static value(t) {
    return t.getAttribute("src");
  }
  format(t, e) {
    a.indexOf(t) > -1 ? e ? this.domNode.setAttribute(t, e) : this.domNode.removeAttribute(t) : super.format(t, e);
  }
}
r(o, "blotName", "image"), r(o, "tagName", "IMG");
export {
  o as default
};
