import{r as t}from"./c25d902c2-Dbv6uExJ.js";import{p as e}from"./c3880bcbc-D5xW2M9A.js";import{f as i,x as o}from"./c255cf682-BhczLtlf.js";var a=t(({flowchart:t})=>{const e=t?.subGraphTitleMargin?.top??0,i=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:i,subGraphTitleTotalMargin:e+i}},"getSubGraphTitleMargins");async function r(a,r){const n=a.getElementsByTagName("img");if(!n||0===n.length)return;const s=""===r.replace(/<img[^>]*>/g,"").trim();await Promise.all([...n].map(a=>new Promise(r=>{function n(){if(a.style.display="flex",a.style.flexDirection="column",s){const t=o().fontSize?o().fontSize:window.getComputedStyle(document.body).fontSize,r=5,[n=i.fontSize]=e(t),s=n*r+"px";a.style.minWidth=s,a.style.maxWidth=s}else a.style.width="100%";r(a)}t(n,"setupImage"),setTimeout(()=>{a.complete&&n()}),a.addEventListener("error",n),a.addEventListener("load",n)})))}t(r,"configureLabelImages");export{a as n,r as t};