"use strict";const o=require("@synnaxlabs/x");let e=null;const u=()=>(e??=document.createElement("canvas"),e),c=(t,s,n)=>{if(o.runtime.RUNTIME==="node")return{width:0,height:0};n??=u().getContext("2d"),n.font=s;const i=n.measureText(t);return a(i)},a=t=>({width:Math.trunc(Math.abs(t.actualBoundingBoxLeft)+Math.abs(t.actualBoundingBoxRight)),height:Math.trunc(Math.abs(t.actualBoundingBoxAscent)+Math.abs(t.actualBoundingBoxDescent))});exports.dimensions=c;exports.dimensionsFromMetrics=a;
