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