import { r as s } from "./css-BkBrZtKZ.js";
let n = null;
const u = () => (n ??= document.createElement("canvas"), n), c = (t, e, a) => {
  if (s.RUNTIME === "node") return { width: 0, height: 0 };
  a ??= u().getContext("2d"), a.font = e;
  const o = a.measureText(t);
  return r(o);
}, r = (t) => ({
  width: Math.trunc(
    Math.abs(t.actualBoundingBoxLeft) + Math.abs(t.actualBoundingBoxRight)
  ),
  height: Math.trunc(
    Math.abs(t.actualBoundingBoxAscent) + Math.abs(t.actualBoundingBoxDescent)
  )
});
export {
  r as a,
  c as d
};
