import { configureSvgSize as x } from "./chunk-ABZYJK2D.js";
import { __name as h, log as u } from "./chunk-AGHRB4JF.js";
var g = /* @__PURE__ */ h((t, e, i, o) => {
  t.attr("class", i);
  const { width: r, height: n, x: c, y: w } = s(t, e);
  x(t, n, r, o);
  const a = m(c, w, r, n, e);
  t.attr("viewBox", a), u.debug(`viewBox configured: ${a} with padding: ${e}`);
}, "setupViewPortForSVG"), s = /* @__PURE__ */ h((t, e) => {
  var o;
  const i = ((o = t.node()) == null ? void 0 : o.getBBox()) || { width: 0, height: 0, x: 0, y: 0 };
  return {
    width: i.width + e * 2,
    height: i.height + e * 2,
    x: i.x,
    y: i.y
  };
}, "calculateDimensionsWithPadding"), m = /* @__PURE__ */ h((t, e, i, o, r) => `${t - r} ${e - r} ${i} ${o}`, "createViewBox");
export {
  g as setupViewPortForSVG
};
