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