import { p as o, A as w, g as x } from "./index-CNUFa5l3.js";
var u = /* @__PURE__ */ o((e, t, i, h) => {
  e.attr("class", i);
  let { width: d, height: a, x: g, y: n } = l(e, t);
  w(e, a, d, h);
  let r = c(g, n, d, a, t);
  e.attr("viewBox", r), x.debug(`viewBox configured: ${r} with padding: ${t}`);
}, "setupViewPortForSVG"), l = /* @__PURE__ */ o((e, t) => {
  var h;
  let i = ((h = e.node()) == null ? void 0 : h.getBBox()) || {
    width: 0,
    height: 0,
    x: 0,
    y: 0
  };
  return {
    width: i.width + t * 2,
    height: i.height + t * 2,
    x: i.x,
    y: i.y
  };
}, "calculateDimensionsWithPadding"), c = /* @__PURE__ */ o((e, t, i, h, d) => `${e - d} ${t - d} ${i} ${h}`, "createViewBox");
export {
  u as r
};
