import { lineBreakRegex as o } from "./chunk-ABZYJK2D.js";
import { __name as n } from "./chunk-AGHRB4JF.js";
import { d as l } from "../../../../../../../../_virtual/index4.js";
var x = /* @__PURE__ */ n((s, t) => {
  const r = s.append("rect");
  if (r.attr("x", t.x), r.attr("y", t.y), r.attr("fill", t.fill), r.attr("stroke", t.stroke), r.attr("width", t.width), r.attr("height", t.height), t.name && r.attr("name", t.name), t.rx && r.attr("rx", t.rx), t.ry && r.attr("ry", t.ry), t.attrs !== void 0)
    for (const e in t.attrs)
      r.attr(e, t.attrs[e]);
  return t.class && r.attr("class", t.class), r;
}, "drawRect"), g = /* @__PURE__ */ n((s, t) => {
  const r = {
    x: t.startx,
    y: t.starty,
    width: t.stopx - t.startx,
    height: t.stopy - t.starty,
    fill: t.fill,
    stroke: t.stroke,
    class: "rect"
  };
  x(s, r).lower();
}, "drawBackgroundRect"), h = /* @__PURE__ */ n((s, t) => {
  const r = t.text.replace(o, " "), e = s.append("text");
  e.attr("x", t.x), e.attr("y", t.y), e.attr("class", "legend"), e.style("text-anchor", t.anchor), t.class && e.attr("class", t.class);
  const a = e.append("tspan");
  return a.attr("x", t.x + t.textMargin * 2), a.text(r), e;
}, "drawText"), p = /* @__PURE__ */ n((s, t, r, e) => {
  const a = s.append("image");
  a.attr("x", t), a.attr("y", r);
  const i = l.sanitizeUrl(e);
  a.attr("xlink:href", i);
}, "drawImage"), y = /* @__PURE__ */ n((s, t, r, e) => {
  const a = s.append("use");
  a.attr("x", t), a.attr("y", r);
  const i = l.sanitizeUrl(e);
  a.attr("xlink:href", `#${i}`);
}, "drawEmbeddedImage"), f = /* @__PURE__ */ n(() => ({
  x: 0,
  y: 0,
  width: 100,
  height: 100,
  fill: "#EDF2AE",
  stroke: "#666",
  anchor: "start",
  rx: 0,
  ry: 0
}), "getNoteRect"), w = /* @__PURE__ */ n(() => ({
  x: 0,
  y: 0,
  width: 100,
  height: 100,
  "text-anchor": "start",
  style: "#666",
  textMargin: 0,
  rx: 0,
  ry: 0,
  tspan: !0
}), "getTextObj");
export {
  g as drawBackgroundRect,
  y as drawEmbeddedImage,
  p as drawImage,
  x as drawRect,
  h as drawText,
  f as getNoteRect,
  w as getTextObj
};
