UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

11 lines (10 loc) 36 kB
const d=require("./chunk-Y2CYZVJY-DPaYLFFP.cjs"),u=require("./src-C9EhKhbk.cjs"),O=require("./chunk-WYO6CB5R-u4mJNOcO.cjs"),_=require("./chunk-ICXQ74PX-BbT9JaEW.cjs"),lt=require("./line-CAB5QHC6.cjs"),ct=require("./chunk-Q4XR5HBZ-aBnPq509.cjs"),E=require("./chunk-7BUUIJ7U-DMv_UkjI.cjs"),dt=require("./chunk-OGEWGWER-DX8sW1dT.cjs"),tt=require("./chunk-C7G6YPKG-CKEeW9TM.cjs"),pt=require("./rough.esm-BfSi6CZE.cjs"),I=require("./chunk-ZGVPDNZ5-Cw5_HJba.cjs");var ft=d.__name((r,t,a,e,n,s=!1,o)=>{t.arrowTypeStart&&J(r,"start",t.arrowTypeStart,a,e,n,s,o),t.arrowTypeEnd&&J(r,"end",t.arrowTypeEnd,a,e,n,s,o)},"addEdgeMarkers"),ht={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},mt=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],J=d.__name((r,t,a,e,n,s,o=!1,i)=>{const h=ht[a],m=h&&mt.includes(h.type);if(!h){u.log.warn(`Unknown arrow type: ${a}`);return}const l=`${n}_${s}-${h.type}${t==="start"?"Start":"End"}${o&&m?"-margin":""}`;if(i&&i.trim()!==""){const p=`${l}_${i.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(p)){const c=document.getElementById(l);if(c){const f=c.cloneNode(!0);f.id=p,f.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",i),h.fill&&k.setAttribute("fill",i)}),c.parentNode?.appendChild(f)}}r.attr(`marker-${t}`,`url(${e}#${p})`)}else r.attr(`marker-${t}`,`url(${e}#${l})`)},"addEdgeMarker"),kt=d.__name(r=>typeof r=="string"?r:O.getConfig2()?.flowchart?.curve,"resolveEdgeCurveType"),A=new Map,w=new Map,ut=d.__name(()=>{A.clear(),w.clear()},"clear"),P=d.__name(r=>r?typeof r=="string"?r:r.reduce((t,a)=>t+";"+a,""):"","getLabelStyles"),gt=d.__name(async(r,t)=>{const a=O.getConfig2();let e=O.getEffectiveHtmlLabels(a);const{labelStyles:n}=tt.styles2String(t);t.labelStyle=n;const s=r.insert("g").attr("class","edgeLabel"),o=s.insert("g").attr("class","label").attr("data-id",t.id),i=t.labelType==="markdown",h=await ct.createText(r,t.label,{style:P(t.labelStyle),useHtmlLabels:e,addSvgBackground:!0,isNode:!1,markdown:i,width:void 0},a);o.node().appendChild(h),u.log.info("abc82",t,t.labelType);let m=h.getBBox(),l=m;if(e){const c=h.children[0],f=u.select_default(h);m=c.getBoundingClientRect(),l=m,f.attr("width",m.width),f.attr("height",m.height)}else{const c=u.select_default(h).select("text").node();c&&typeof c.getBBox=="function"&&(l=c.getBBox())}o.attr("transform",E.computeLabelTransform(l,e)),A.set(t.id,s),t.width=m.width,t.height=m.height;let p;if(t.startLabelLeft){const c=r.insert("g").attr("class","edgeTerminals"),f=c.insert("g").attr("class","inner"),k=await I.createLabel_default(f,t.startLabelLeft,P(t.labelStyle)||"",!1,!1);p=k;let g=k.getBBox();if(e){const L=k.children[0],x=u.select_default(k);g=L.getBoundingClientRect(),x.attr("width",g.width),x.attr("height",g.height)}f.attr("transform",E.computeLabelTransform(g,e)),w.get(t.id)||w.set(t.id,{}),w.get(t.id).startLeft=c,R(p,t.startLabelLeft)}if(t.startLabelRight){const c=r.insert("g").attr("class","edgeTerminals"),f=c.insert("g").attr("class","inner"),k=await I.createLabel_default(f,t.startLabelRight,P(t.labelStyle)||"",!1,!1);p=k;let g=k.getBBox();if(e){const L=k.children[0],x=u.select_default(k);g=L.getBoundingClientRect(),x.attr("width",g.width),x.attr("height",g.height)}f.attr("transform",E.computeLabelTransform(g,e)),w.get(t.id)||w.set(t.id,{}),w.get(t.id).startRight=c,R(p,t.startLabelRight)}if(t.endLabelLeft){const c=r.insert("g").attr("class","edgeTerminals"),f=c.insert("g").attr("class","inner"),k=await I.createLabel_default(c,t.endLabelLeft,P(t.labelStyle)||"",!1,!1);p=k;let g=k.getBBox();if(e){const L=k.children[0],x=u.select_default(k);g=L.getBoundingClientRect(),x.attr("width",g.width),x.attr("height",g.height)}f.attr("transform",E.computeLabelTransform(g,e)),w.get(t.id)||w.set(t.id,{}),w.get(t.id).endLeft=c,R(p,t.endLabelLeft)}if(t.endLabelRight){const c=r.insert("g").attr("class","edgeTerminals"),f=c.insert("g").attr("class","inner"),k=await I.createLabel_default(c,t.endLabelRight,P(t.labelStyle)||"",!1,!1);p=k;let g=k.getBBox();if(e){const L=k.children[0],x=u.select_default(k);g=L.getBoundingClientRect(),x.attr("width",g.width),x.attr("height",g.height)}f.attr("transform",E.computeLabelTransform(g,e)),w.get(t.id)||w.set(t.id,{}),w.get(t.id).endRight=c,R(p,t.endLabelRight)}return h},"insertEdgeLabel");function R(r,t){O.getEffectiveHtmlLabels(O.getConfig2())&&r&&(r.style.width=t.length*9+"px",r.style.height="12px")}d.__name(R,"setTerminalWidth");var _t=d.__name((r,t)=>{u.log.debug("Moving label abc88 ",r.id,r.label,A.get(r.id),t);let a=t.updatedPath?t.updatedPath:t.originalPath;const{subGraphTitleTotalMargin:e}=dt.getSubGraphTitleMargins(O.getConfig2());if(r.label){const n=A.get(r.id);let s=r.x,o=r.y;if(a){const i=_.utils_default.calcLabelPosition(a);u.log.debug("Moving label "+r.label+" from (",s,",",o,") to (",i.x,",",i.y,") abc88"),t.updatedPath&&(s=i.x,o=i.y)}n.attr("transform",`translate(${s}, ${o+e/2})`)}if(r.startLabelLeft){const n=w.get(r.id).startLeft;let s=r.x,o=r.y;if(a){const i=_.utils_default.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_left",a);s=i.x,o=i.y}n.attr("transform",`translate(${s}, ${o})`)}if(r.startLabelRight){const n=w.get(r.id).startRight;let s=r.x,o=r.y;if(a){const i=_.utils_default.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_right",a);s=i.x,o=i.y}n.attr("transform",`translate(${s}, ${o})`)}if(r.endLabelLeft){const n=w.get(r.id).endLeft;let s=r.x,o=r.y;if(a){const i=_.utils_default.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_left",a);s=i.x,o=i.y}n.attr("transform",`translate(${s}, ${o})`)}if(r.endLabelRight){const n=w.get(r.id).endRight;let s=r.x,o=r.y;if(a){const i=_.utils_default.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_right",a);s=i.x,o=i.y}n.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),yt=d.__name((r,t)=>{if(!r?.isLabelEdge||!r?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[a,e]=t,n=Math.abs(e.x-a.x),s=Math.abs(e.y-a.y);return n<.001||s<.001?t:s>=n?[a,{x:a.x,y:e.y},e]:[a,{x:e.x,y:a.y},e]},"orthogonalizeToLabelClippedPoints"),xt=d.__name((r,t)=>{const a=r.x,e=r.y,n=Math.abs(t.x-a),s=Math.abs(t.y-e),o=r.width/2,i=r.height/2;return n>=o||s>=i},"outsideNode"),bt=d.__name((r,t,a)=>{u.log.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(t)} insidePoint : ${JSON.stringify(a)} node : x:${r.x} y:${r.y} w:${r.width} h:${r.height}`);const e=r.x,n=r.y,s=Math.abs(e-a.x),o=r.width/2;let i=a.x<t.x?o-s:o+s;const h=r.height/2,m=Math.abs(t.y-a.y),l=Math.abs(t.x-a.x);if(Math.abs(n-t.y)*o>Math.abs(e-t.x)*h){let p=a.y<t.y?t.y-h-n:n-h-t.y;i=l*p/m;const c={x:a.x<t.x?a.x+i:a.x-l+i,y:a.y<t.y?a.y+m-p:a.y-m+p};return i===0&&(c.x=t.x,c.y=t.y),l===0&&(c.x=t.x),m===0&&(c.y=t.y),u.log.debug(`abc89 top/bottom calc, Q ${m}, q ${p}, R ${l}, r ${i}`,c),c}else{a.x<t.x?i=t.x-o-e:i=e-o-t.x;let p=m*i/l,c=a.x<t.x?a.x+l-i:a.x-l+i,f=a.y<t.y?a.y+p:a.y-p;return u.log.debug(`sides calc abc89, Q ${m}, q ${p}, R ${l}, r ${i}`,{_x:c,_y:f}),i===0&&(c=t.x,f=t.y),l===0&&(c=t.x),m===0&&(f=t.y),{x:c,y:f}}},"intersection"),F=d.__name((r,t)=>{u.log.warn("abc88 cutPathAtIntersect",r,t);let a=[],e=r[0],n=!1;return r.forEach(s=>{if(u.log.info("abc88 checking point",s,t),!xt(t,s)&&!n){const o=bt(t,e,s);u.log.debug("abc88 inside",s,e,o),u.log.debug("abc88 intersection",o,t);let i=!1;a.forEach(h=>{i=i||h.x===o.x&&h.y===o.y}),a.some(h=>h.x===o.x&&h.y===o.y)?u.log.warn("abc88 no intersect",o,a):a.push(o),n=!0}else u.log.warn("abc88 outside",s,e),e=s,n||a.push(s)}),u.log.debug("returning points",a),a},"cutPathAtIntersect");function rt(r){const t=[],a=[];for(let e=1;e<r.length-1;e++){const n=r[e-1],s=r[e],o=r[e+1];(n.x===s.x&&s.y===o.y&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-n.y)>5||n.y===s.y&&s.x===o.x&&Math.abs(s.x-n.x)>5&&Math.abs(s.y-o.y)>5)&&(t.push(s),a.push(e))}return{cornerPoints:t,cornerPointPositions:a}}d.__name(rt,"extractCornerPoints");var K=d.__name(function(r,t,a){const e=t.x-r.x,n=t.y-r.y,s=a/Math.sqrt(e*e+n*n);return{x:t.x-s*e,y:t.y-s*n}},"findAdjacentPoint"),wt=d.__name(function(r){const{cornerPointPositions:t}=rt(r),a=[];for(let e=0;e<r.length;e++)if(t.includes(e)){const n=r[e-1],s=r[e+1],o=r[e],i=K(n,o,5),h=K(s,o,5),m=h.x-i.x,l=h.y-i.y;a.push(i);const p=Math.sqrt(2)*2;let c={x:o.x,y:o.y};if(Math.abs(s.x-n.x)>10&&Math.abs(s.y-n.y)>=10){u.log.debug("Corner point fixing",Math.abs(s.x-n.x),Math.abs(s.y-n.y));const f=5;o.x===i.x?c={x:m<0?i.x-f+p:i.x+f-p,y:l<0?i.y-p:i.y+p}:c={x:m<0?i.x-p:i.x+p,y:l<0?i.y-f+p:i.y+f-p}}else u.log.debug("Corner point skipping fixing",Math.abs(s.x-n.x),Math.abs(s.y-n.y));a.push(c,h)}else a.push(r[e]);return a},"fixCorners"),Lt=d.__name((r,t,a)=>{const e=r-t-a,n=2,s=2,o=Math.floor(e/4);return`0 ${t} ${Array(o).fill(`${n} ${s}`).join(" ")} ${a}`},"generateDashArray"),Mt=d.__name(function(r,t,a,e,n,s,o,i=!1){if(!o)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:h,layout:m}=O.getConfig2();let l=t.points,p=!1;const c=n;var f=s;const k=[];for(const y in t.cssCompiledStyles)tt.isLabelStyle(y)||k.push(t.cssCompiledStyles[y]);if(m==="swimlane"){if(f.intersect&&c.intersect&&Array.isArray(l)&&l.length>=2)if(l.length===2)l=[c.intersect(l[0]),f.intersect(l[1])];else{const y=l.slice(1,-1),W=y[0],$=y[y.length-1],U=.5,q=Math.abs(l[l.length-1].x-$.x)<U&&Math.abs(l[l.length-1].y-$.y)<U,Y=c.intersect(W),X=q?$:f.intersect($),H=Math.abs(X.x-$.x)<U&&Math.abs(X.y-$.y)<U,z=Math.abs(Y.x-W.x)<U&&Math.abs(Y.y-W.y)<U?[]:[Y],it=H?[]:[X];l=[...z,...y,...it]}l=yt(t,l)}else f.intersect&&c.intersect&&!i&&(l=l.slice(1,t.points.length-1),l.unshift(c.intersect(l[0])),l.push(f.intersect(l[l.length-1])));const g=btoa(JSON.stringify(l));t.toCluster&&(u.log.info("to cluster abc88",a.get(t.toCluster)),l=F(t.points,a.get(t.toCluster).node),p=!0),t.fromCluster&&(u.log.debug("from cluster abc88",a.get(t.fromCluster),JSON.stringify(l,null,2)),l=F(l.reverse(),a.get(t.fromCluster).node).reverse(),p=!0);let L=l.filter(y=>!Number.isNaN(y.y));const x=kt(t.curve);x!=="rounded"&&(L=wt(L));let b=_.linear_default;switch(x){case"linear":b=_.linear_default;break;case"basis":b=_.basis_default;break;case"cardinal":b=_.cardinal_default;break;case"bumpX":b=_.bumpX;break;case"bumpY":b=_.bumpY;break;case"catmullRom":b=_.catmullRom_default;break;case"monotoneX":b=_.monotoneX;break;case"monotoneY":b=_.monotoneY;break;case"natural":b=_.natural_default;break;case"step":b=_.step_default;break;case"stepAfter":b=_.stepAfter;break;case"stepBefore":b=_.stepBefore;break;case"rounded":b=_.linear_default;break;default:b=_.basis_default}const{x:N,y:B}=E.getLineFunctionsWithOffset(t),T=lt.line_default().x(N).y(B).curve(b);let S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let M,Q=x==="rounded"?at(et(L,t),5):T(L);const v=Array.isArray(t.style)?t.style:[t.style];let G=v.find(y=>y?.startsWith("stroke:")),C="";t.animate&&(C="edge-animation-fast"),t.animation&&(C="edge-animation-"+t.animation);let j=!1;if(t.look==="handDrawn"){const y=pt.at.svg(r);Object.assign([],L);const W=y.path(Q,{roughness:.3,seed:h});S+=" transition",M=u.select_default(W).select("path").attr("id",`${o}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(C?" "+C:"")).attr("style",v?v.reduce((U,q)=>U+";"+q,""):"");let $=M.attr("d");M.attr("d",$),r.node().appendChild(M.node())}else{const y=k.join(";"),W=v?v.reduce((H,z)=>H+z+";",""):"",$=(y?y+";"+W+";":W)+";"+(v?v.reduce((H,z)=>H+";"+z,""):"");M=r.append("path").attr("d",Q).attr("id",`${o}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(C?" "+C:"")).attr("style",$),G=$.match(/stroke:([^;]+)/)?.[1],j=t.animate===!0||!!t.animation||y.includes("animation");const U=M.node(),q=typeof U.getTotalLength=="function"?U.getTotalLength():0,Y=E.markerOffsets2[t.arrowTypeStart]||0,X=E.markerOffsets2[t.arrowTypeEnd]||0;if(t.look==="neo"&&!j){const H=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?Lt(q,Y,X):`0 ${Y} ${q-Y-X} ${X}`}; stroke-dashoffset: 0;`;M.attr("style",H+M.attr("style"))}}M.attr("data-edge",!0),M.attr("data-et","edge"),M.attr("data-id",t.id),M.attr("data-points",g),M.attr("data-look",_.handleUndefinedAttr(t.look)),t.showPoints&&L.forEach(y=>{r.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",y.x).attr("cy",y.y)});let Z="";(O.getConfig2().flowchart.arrowMarkerAbsolute||O.getConfig2().state.arrowMarkerAbsolute)&&(Z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,Z=Z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),u.log.info("arrowTypeStart",t.arrowTypeStart),u.log.info("arrowTypeEnd",t.arrowTypeEnd);const nt=!j&&t?.look==="neo";ft(M,t,Z,o,e,nt,G);const st=Math.floor(l.length/2),ot=l[st];_.utils_default.isLabelCoordinateInPath(ot,M.attr("d"))||(p=!0);let V={};return p&&(V.updatedPath=l),V.originalPath=t.points,V},"insertEdge");function at(r,t){if(r.length<2)return"";let a="";const e=r.length,n=1e-5;for(let s=0;s<e;s++){const o=r[s],i=r[s-1],h=r[s+1];if(s===0)a+=`M${o.x},${o.y}`;else if(s===e-1)a+=`L${o.x},${o.y}`;else{const m=o.x-i.x,l=o.y-i.y,p=h.x-o.x,c=h.y-o.y,f=Math.hypot(m,l),k=Math.hypot(p,c);if(f<n||k<n){a+=`L${o.x},${o.y}`;continue}const g=m/f,L=l/f,x=p/k,b=c/k,N=g*x+L*b,B=Math.acos(Math.max(-1,Math.min(1,N)));if(B<n||Math.abs(Math.PI-B)<n){a+=`L${o.x},${o.y}`;continue}const T=Math.min(t/Math.sin(B/2),f/2,k/2),S=o.x-g*T,M=o.y-L*T,Q=o.x+x*T,v=o.y+b*T;a+=`L${S},${M}`,a+=`Q${o.x},${o.y} ${Q},${v}`}}return a}d.__name(at,"generateRoundedPath");function D(r,t){if(!r||!t)return{angle:0,deltaX:0,deltaY:0};const a=t.x-r.x,e=t.y-r.y;return{angle:Math.atan2(e,a),deltaX:a,deltaY:e}}d.__name(D,"calculateDeltaAndAngle");function et(r,t){const a=r.map(n=>({...n}));if(r.length>=2&&E.markerOffsets[t.arrowTypeStart]){const n=E.markerOffsets[t.arrowTypeStart],s=r[0],o=r[1],{angle:i}=D(s,o),h=n*Math.cos(i),m=n*Math.sin(i);a[0].x=s.x+h,a[0].y=s.y+m}const e=r.length;if(e>=2&&E.markerOffsets[t.arrowTypeEnd]){const n=E.markerOffsets[t.arrowTypeEnd],s=r[e-1],o=r[e-2],{angle:i}=D(o,s),h=n*Math.cos(i),m=n*Math.sin(i);a[e-1].x=s.x-h,a[e-1].y=s.y-m}return a}d.__name(et,"applyMarkerOffsetsToPoints");var Ot=d.__name((r,t,a,e)=>{t.forEach(n=>{St[n](r,a,e)})},"insertMarkers"),St={extension:d.__name((r,t,a)=>{u.log.trace("Making markers for ",a),r.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),r.append("marker").attr("id",a+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),r.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),composition:d.__name((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),aggregation:d.__name((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),dependency:d.__name((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lollipop:d.__name((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),point:d.__name((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),circle:d.__name((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),cross:d.__name((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),r.append("marker").attr("id",a+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),barb:d.__name((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),barbNeo:d.__name((r,t,a)=>{const{themeVariables:e}=O.getConfig(),{transitionColor:n}=e;r.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${n}`)},"barbNeo"),only_one:d.__name((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),zero_or_one:d.__name((r,t,a)=>{const e=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");e.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),e.append("path").attr("d","M9,0 L9,18");const n=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),one_or_more:d.__name((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),zero_or_more:d.__name((r,t,a)=>{const e=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");e.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),e.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const n=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),only_one_neo:d.__name((r,t,a)=>{const{themeVariables:e}=O.getConfig(),{strokeWidth:n}=e;r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${n}`),r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${n}`)},"only_one_neo"),zero_or_one_neo:d.__name((r,t,a)=>{const{themeVariables:e}=O.getConfig(),{strokeWidth:n,mainBkg:s}=e,o=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${n}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${n}`);const i=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");i.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${n}`).attr("r",6),i.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${n}`)},"zero_or_one_neo"),one_or_more_neo:d.__name((r,t,a)=>{const{themeVariables:e}=O.getConfig(),{strokeWidth:n}=e;r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${n}`),r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${n}`)},"one_or_more_neo"),zero_or_more_neo:d.__name((r,t,a)=>{const{themeVariables:e}=O.getConfig(),{strokeWidth:n,mainBkg:s}=e,o=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${n}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${n}`);const i=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");i.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${n}`),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${n}`)},"zero_or_more_neo"),requirement_arrow:d.__name((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 L0,20`)},"requirement_arrow"),requirement_contains:d.__name((r,t,a)=>{const e=r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");e.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),e.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),e.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),requirement_arrow_neo:d.__name((r,t,a)=>{const{themeVariables:e}=O.getConfig(),{strokeWidth:n}=e;r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${n}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),requirement_contains_neo:d.__name((r,t,a)=>{const{themeVariables:e}=O.getConfig(),{strokeWidth:n}=e,s=r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${n}`)},"requirement_contains_neo")},Et=Ot;Object.defineProperty(exports,"clear",{enumerable:!0,get:function(){return ut}});Object.defineProperty(exports,"edgeLabels",{enumerable:!0,get:function(){return A}});Object.defineProperty(exports,"insertEdge",{enumerable:!0,get:function(){return Mt}});Object.defineProperty(exports,"insertEdgeLabel",{enumerable:!0,get:function(){return gt}});Object.defineProperty(exports,"markers_default",{enumerable:!0,get:function(){return Et}});Object.defineProperty(exports,"positionEdgeLabel",{enumerable:!0,get:function(){return _t}});Object.defineProperty(exports,"terminalLabels",{enumerable:!0,get:function(){return w}});