import{_ as __name,e as configureSvgSize,l as log}from"./mermaid.core-BV3ugHFm.js";var setupViewPortForSVG=__name((svg,padding,cssDiagram,useMaxWidth)=>{svg.attr("class",cssDiagram);const{width:width,height:height,x:x,y:y}=calculateDimensionsWithPadding(svg,padding);configureSvgSize(svg,height,width,useMaxWidth);const viewBox=createViewBox(x,y,width,height,padding);svg.attr("viewBox",viewBox),log.debug(`viewBox configured: ${viewBox} with padding: ${padding}`)},"setupViewPortForSVG"),calculateDimensionsWithPadding=__name((svg,padding)=>{var _a;const bounds=(null==(_a=svg.node())?void 0:_a.getBBox())||{width:0,height:0,x:0,y:0};return{width:bounds.width+2*padding,height:bounds.height+2*padding,x:bounds.x,y:bounds.y}},"calculateDimensionsWithPadding"),createViewBox=__name((x,y,width,height,padding)=>`${x-padding} ${y-padding} ${width} ${height}`,"createViewBox");export{setupViewPortForSVG as s};
