import{a as M,b as T,c as R}from"./chunk-EOWJOLPV.min.js";import{a as I}from"./chunk-F5HZMA2O.min.js";import"./chunk-TCQ7DWI4.min.js";import"./chunk-6WVHDLRC.min.js";import"./chunk-2JU6FAUR.min.js";import{a as A}from"./chunk-N4KMO2SW.min.js";import"./chunk-Q6G2VLU2.min.js";import{C as S,Da as d,G as V,Ia as L,Na as N,Oa as B,Wa as G,Za as i,ab as z,b as F,c as H,h as g}from"./chunk-PBNKOM7K.min.js";import{d as k}from"./chunk-P42HNYSU.min.js";var ot=k(F(),1),lt=k(H(),1),st=k(V(),1);var E=s=>L.sanitizeText(s,i()),D={dividerMargin:10,padding:5,textHeight:10,curve:void 0},W=function(s,e,y,n){let t=Object.keys(s);d.info("keys:",t),d.info(s),t.forEach(function(r){var o,c;let l=s[r],p={shape:"rect",id:l.id,domId:l.domId,labelText:E(l.id),labelStyle:"",style:"fill: none; stroke: black",padding:((o=i().flowchart)==null?void 0:o.padding)??((c=i().class)==null?void 0:c.padding)};e.setNode(l.id,p),$(l.classes,e,y,n,l.id),d.info("setNode",p)})},$=function(s,e,y,n,t){let r=Object.keys(s);d.info("keys:",r),d.info(s),r.filter(o=>s[o].parent==t).forEach(function(o){var c,l;let a=s[o],p=a.cssClasses.join(" "),f={labelStyle:"",style:""},h=a.label??a.id,b=0,m="class_box",u={labelStyle:f.labelStyle,shape:m,labelText:E(h),classData:a,rx:b,ry:b,class:p,style:f.style,id:a.id,domId:a.domId,tooltip:n.db.getTooltip(a.id,t)||"",haveCallback:a.haveCallback,link:a.link,width:a.type==="group"?500:void 0,type:a.type,padding:((c=i().flowchart)==null?void 0:c.padding)??((l=i().class)==null?void 0:l.padding)};e.setNode(a.id,u),t&&e.setParent(a.id,t),d.info("setNode",u)})},J=function(s,e,y,n){d.info(s),s.forEach(function(t,r){var o,c;let l=t,a="",p={labelStyle:"",style:""},f=l.text,h=0,b="note",m={labelStyle:p.labelStyle,shape:b,labelText:E(f),noteData:l,rx:h,ry:h,class:a,style:p.style,id:l.id,domId:l.id,tooltip:"",type:"note",padding:((o=i().flowchart)==null?void 0:o.padding)??((c=i().class)==null?void 0:c.padding)};if(e.setNode(l.id,m),d.info("setNode",m),!l.class||!(l.class in n))return;let u=y+r,x={id:`edgeNote${u}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:N(D.curve,S)};e.setEdge(l.id,l.class,x,u)})},K=function(s,e){let y=i().flowchart,n=0;s.forEach(function(t){var r;n++;let o={classes:"relation",pattern:t.relation.lineType==1?"dashed":"solid",id:"id"+n,arrowhead:t.type==="arrow_open"?"none":"normal",startLabelRight:t.relationTitle1==="none"?"":t.relationTitle1,endLabelLeft:t.relationTitle2==="none"?"":t.relationTitle2,arrowTypeStart:P(t.relation.type1),arrowTypeEnd:P(t.relation.type2),style:"fill:none",labelStyle:"",curve:N(y?.curve,S)};if(d.info(o,t),t.style!==void 0){let c=B(t.style);o.style=c.style,o.labelStyle=c.labelStyle}t.text=t.title,t.text===void 0?t.style!==void 0&&(o.arrowheadStyle="fill: #333"):(o.arrowheadStyle="fill: #333",o.labelpos="c",((r=i().flowchart)==null?void 0:r.htmlLabels)??i().htmlLabels?(o.labelType="html",o.label='<span class="edgeLabel">'+t.text+"</span>"):(o.labelType="text",o.label=t.text.replace(L.lineBreakRegex,`
`),t.style===void 0&&(o.style=o.style||"stroke: #333; stroke-width: 1.5px;fill:none"),o.labelStyle=o.labelStyle.replace("color:","fill:"))),e.setEdge(t.id1,t.id2,o,n)})},Q=function(s){D={...D,...s}},U=async function(s,e,y,n){d.info("Drawing class - ",e);let t=i().flowchart??i().class,r=i().securityLevel;d.info("config:",t);let o=t?.nodeSpacing??50,c=t?.rankSpacing??50,l=new A({multigraph:!0,compound:!0}).setGraph({rankdir:n.db.getDirection(),nodesep:o,ranksep:c,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=n.db.getNamespaces(),p=n.db.getClasses(),f=n.db.getRelations(),h=n.db.getNotes();d.info(f),W(a,l,e,n),$(p,l,e,n),K(f,l),J(h,l,f.length+1,p);let b;r==="sandbox"&&(b=g("#i"+e));let m=r==="sandbox"?g(b.nodes()[0].contentDocument.body):g("body"),u=m.select(`[id="${e}"]`),x=m.select("#"+e+" g");if(await I(x,l,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",e),G.insertTitle(u,"classTitleText",t?.titleTopMargin??5,n.db.getDiagramTitle()),z(l,u,t?.diagramPadding,t?.useMaxWidth),!t?.htmlLabels){let _=r==="sandbox"?b.nodes()[0].contentDocument:document,q=_.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(let w of q){let C=w.getBBox(),v=_.createElementNS("http://www.w3.org/2000/svg","rect");v.setAttribute("rx",0),v.setAttribute("ry",0),v.setAttribute("width",C.width),v.setAttribute("height",C.height),w.insertBefore(v,w.firstChild)}}};function P(s){let e;switch(s){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}var X={setConf:Q,draw:U},it={parser:M,db:T,renderer:X,styles:R,init:s=>{s.class||(s.class={}),s.class.arrowMarkerAbsolute=s.arrowMarkerAbsolute,T.clear()}};export{it as diagram};
//# sourceMappingURL=classDiagram-v2-802a48d3-DVZMOQWE.min.js.map
