@diagrammo/dgmo 0.44.1 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/element.js CHANGED
@@ -208,7 +208,7 @@ Task
208
208
  `);for(let n of e){let r=n.trim();if(!r||r.startsWith("//"))continue;let o=Ve(r);if(o)return o.chartType;break}return A0(t)?"sequence":Y0(t)?"flowchart":U0(t)?"class":j0(t)?"er":z0(t)?"state":J0(t)?"sitemap":K0(t)?"org":ZA(t)?"c4":KA(t)?"gantt":iw(t)?"pert":null}function tE(t){return Jw.get(t.toLowerCase())?.category??null}function y9(t){let e=Jw.get(t.toLowerCase());return e?UA(e.parse):!1}function b9(){return sw.map(t=>t.id)}function nE(t){let e=E9(t);return{diagnostics:FL(e.diagnostics),chartType:e.chartType}}function E9(t){let e=Ah(t);if(!e){let o=S9(t);if(o){let a=lo(t).diagnostics;return{diagnostics:[o,...a],chartType:null}}return{diagnostics:lo(t).diagnostics,chartType:null}}let n=w9.get(e);return n?{diagnostics:[...n(t).diagnostics,...qA(t)],chartType:e}:{diagnostics:[...lo(t).diagnostics,...qA(t)],chartType:e}}function S9(t){let e=t.split(`
209
209
  `);for(let n=0;n<e.length;n++){let r=e[n].trim();if(!r||r.startsWith("#")||r.startsWith("//"))continue;let o=r.match(/^(\w[\w-]*)\s*:\s*(.*)$/);if(!o)return null;let a=o[1].toLowerCase(),i=o[2].trim();if(jA.has(a)){let l=i?`${a} ${i}`:a;return Pt(n+1,`Remove the colon \u2014 use '${l}' instead of '${r}'. DGMO chart types don't use colons.`)}let s=be(a,[...jA]);return s?Pt(n+1,`Unknown chart type: ${a}. ${s} Also, DGMO chart types don't use colons.`):null}return null}function qA(t){return t.split(`
210
210
  `).filter(r=>r.trim()&&!r.trim().startsWith("#")&&!r.trim().startsWith("//")).length<=1?[Pt(1,"No content after chart type declaration.","warning")]:[]}var m9,h9,g9,x9,eE,QA,w9,jA,Rh=st(()=>{"use strict";Pc();ju();qu();Ku();Zu();Qu();Ju();of();qi();Gn();hn();p2();XA();m9=/^\d+(?:\.\d+)?(?:min|bd|d|w|m|q|y|h)(?:\?)?\s+/,h9=/^\d{4}-\d{2}-\d{2}(?:\s\d{2}:\d{2})?\s+/;g9=/\bis\s+an?\s+(person|system|container|component)\b/i;x9=Object.fromEntries(sw.map(t=>[t.id,t.description])),eE=Qw.map(t=>[t.id,t.parse]),QA=eE.map(([t])=>t),w9=new Map(eE),jA=new Set(QA)});function Qr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function v9(t,e,n,r){let o=[],a=t.pill;o.push(`<rect width="${t.width}" height="${t.height}" rx="${Se/2}" fill="${Qr(n)}"/>`),o.push(`<rect x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}" rx="${a.height/2}" fill="${Qr(e.bg)}"/>`,`<rect x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}" rx="${a.height/2}" fill="none" stroke="${Qr(r)}" stroke-width="0.75"/>`),o.push(`<text x="${a.x+a.width/2}" y="${Se/2+sr/2-2}" font-size="${sr}" font-weight="500" fill="${Qr(e.text)}" text-anchor="middle" font-family="${Qr(It)}">${Qr(t.groupName)}</text>`);for(let i of t.entries){let s=i.displayValue??i.value,l=i.width!=null?`<rect x="${i.x}" y="${i.y}" width="${i.width}" height="${Se}" fill="transparent"/>`:"";o.push(`<g data-legend-entry="${Qr(i.value.toLowerCase())}" data-series-name="${Qr(i.value)}" style="cursor:pointer">`+l+`<circle cx="${i.dotCx}" cy="${i.dotCy}" r="${wr}" fill="${Qr(i.color)}"/><text x="${i.textX}" y="${i.dotCy+Vn/2-1}" font-size="${Vn}" fill="${Qr(e.textMuted)}" font-family="${Qr(It)}">${Qr(s)}</text></g>`)}return`<g transform="translate(${t.x},${t.y})" data-legend-group="${Qr(qt(t.groupName))}" style="cursor:pointer">${o.join("")}</g>`}function k9(t,e,n){return`<g transform="translate(${t.x},${t.y})" data-legend-group="${Qr(qt(t.groupName))}" style="cursor:pointer"><rect width="${t.width}" height="${t.height}" rx="${t.height/2}" fill="${Qr(n)}"/><text x="${t.width/2}" y="${t.height/2+sr/2-2}" font-size="${sr}" font-weight="500" fill="${Qr(e.textMuted)}" text-anchor="middle" font-family="${Qr(It)}">${Qr(t.groupName)}</text></g>`}function tR(t,e){if(t.length===0)return{svg:"",height:0,width:0};let{palette:n,isDark:r,containerWidth:o,activeGroup:a,className:i}=e,s=o>0?o:1200,d=Al({groups:t,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview"},{activeGroup:a??null},s);if(!d.activeCapsule&&d.pills.length===0)return{svg:"",height:0,width:0};let u=r?Gt(n.surface,n.bg,50):Gt(n.surface,n.bg,30),f=Gt(n.textMuted,n.bg,50),p=[],m=0,h=1/0,g=0,v=(x,L,S,A)=>{h=Math.min(h,x),g=Math.max(g,x+S),m=Math.max(m,L+A)};if(d.activeCapsule){let x=d.activeCapsule;p.push(v9(x,n,u,f)),v(x.x,x.y,x.width,x.height)}for(let x of d.pills)p.push(k9(x,n,u)),v(x.x,x.y,x.width,x.height);let y=i?` class="${Qr(i)}"`:"",b=a?` data-legend-active="${Qr(a.toLowerCase())}"`:"";return{svg:`<g${y}${b}>${p.join("")}</g>`,height:m,width:g-(h===1/0?0:h)}}var eR=st(()=>{"use strict";Ke();Mr();To();tn();on()});function ln(t){return isFinite(t)?Math.abs(t)>=1e3?t.toLocaleString("en-US"):String(Math.round(t*100)/100):""}function Ih(t,e,n,r,o,a,i){return pf(t,lh(e,n),r,o,a,i)}function pf(t,e,n,r,o,a){let i=o?40:0;if(e.length===0)return o?i+12:24;let s=8+i,{svg:l,height:c}=tR(e,{palette:n,isDark:r,containerWidth:a,activeGroup:e[0].name,className:"chart-legend"}),d=t.node();return d&&l&&d.insertAdjacentHTML("beforeend",`<g transform="translate(0,${s})">${l}</g>`),s+c+14}function as(t,e){let r=t?22:0,o=e.length?Math.max(...e.map(a=>_t(a,So))):0;return Math.max(56,16+r+o+14)}function Ks(t,e,n,r,o){e&&t.append("text").attr("x",n).attr("y",r).attr("text-anchor","middle").attr("fill",o).attr("font-size",nR).attr("font-family",It).attr("font-weight",600).text(e)}function is(t,e,n,r,o){e&&t.append("text").attr("transform",`translate(${r},${n}) rotate(-90)`).attr("text-anchor","middle").attr("fill",o).attr("font-size",nR).attr("font-family",It).attr("font-weight",600).text(e)}function Yr(t,e){let n=(t.attr("class")??"").split(/\s+/).filter(Boolean);return n.includes("dgmo-datum")||n.push("dgmo-datum"),t.attr("class",n.join(" ")),e.line!=null&&t.attr("data-line-number",e.line),e.key!=null&&t.attr("data-emph-key",e.key),e.name!=null&&t.attr("data-name",e.name),e.value!=null&&t.attr("data-value",String(e.value)),e.color!=null&&t.attr("data-color",e.color),t}function Hl(t,e,n,r,o,a="middle"){t.append("text").attr("x",n).attr("y",r).attr("text-anchor",a).attr("fill",o).attr("font-size",L9).attr("font-family",It).text(e)}var nR,So,L9,na=st(()=>{"use strict";on();en();af();eR();nR=13,So=12,L9=12});function rR(t,e){let n=[t.value];for(let r=1;r<e;r++)n.push(t.extraValues?.[r-1]??0);return n}function oR(t,e,n,r,o,a,i,s,l,c){let d=e.data,u=e.seriesNames?.length?e.seriesNames:[e.series??""],f=e.barLayout==="stack",p=e.barLayout==="group",m=f||p?Math.max(1,u.length,1+Math.max(0,...d.map(H=>H.extraValues?.length??0))):1,h=e.orientation==="horizontal",g=m>1,v=e.solidFill===!0,y=(H,O,D)=>D||(g?o[H%o.length]:o[O%o.length]),b=H=>v?H:ie(a,H,i),E=Ih(t,e,o,a,i,c,n),x=d.map(H=>rR(H,m)),L=f?Ec(x,H=>H.reduce((O,D)=>O+D,0))??0:Ec(x,H=>Ec(H)??0)??0,S=L===0?1:L,A=h?d.map(H=>H.label):[ln(S),ln(S/2)],C={top:E+8,right:32,bottom:64,left:as(e.ylabel,A)},M=n-C.left-C.right,w=r-C.top-C.bottom,k=h,N=k?[C.top,C.top+w]:[C.left,C.left+M],_=El().domain(d.map(H=>H.label)).range(N).padding(.3),T=k?[C.left,C.left+M]:[C.top+w,C.top],R=or().domain([0,S]).nice().range(T);for(let H of R.ticks(6))if(k){let O=R(H);t.append("line").attr("x1",O).attr("x2",O).attr("y1",C.top).attr("y2",C.top+w).attr("stroke",l).attr("stroke-opacity",H===0?.6:.25),t.append("text").attr("x",O).attr("y",C.top+w+18).attr("text-anchor","middle").attr("fill",s).attr("font-size",So).attr("font-family",It).text(ln(H))}else{let O=R(H);t.append("line").attr("x1",C.left).attr("x2",C.left+M).attr("y1",O).attr("y2",O).attr("stroke",l).attr("stroke-opacity",H===0?.6:.25),t.append("text").attr("x",C.left-10).attr("y",O+4).attr("text-anchor","end").attr("fill",s).attr("font-size",So).attr("font-family",It).text(ln(H))}for(let H of d){let O=(_(H.label)??0)+_.bandwidth()/2;k?t.append("text").attr("x",C.left-10).attr("y",O+4).attr("text-anchor","end").attr("fill",s).attr("font-size",So).attr("font-family",It).text(H.label):t.append("text").attr("x",O).attr("y",C.top+w+18).attr("text-anchor","middle").attr("fill",s).attr("font-size",So).attr("font-family",It).text(H.label)}let G=R(0),I=f?null:El().domain(u.map((H,O)=>O)).range([0,_.bandwidth()]).padding(.12);d.forEach((H,O)=>{let D=_(H.label)??0,W=rR(H,m),z=0;W.forEach((P,B)=>{let Y=y(B,O,m===1?H.color:void 0),V=b(Y),j=u[B]??"",K={line:H.lineNumber,key:g?j:H.label,name:g?`${H.label} \xB7 ${j}`:H.label,value:P,color:Y};if(f){if(k){let $=R(z),U=R(z+P);Ph(t,Math.min($,U),D,Math.abs(U-$),_.bandwidth(),V,Y,K),Math.abs(U-$)>26&&Hl(t,ln(P),($+U)/2,D+_.bandwidth()/2+4,s)}else{let $=R(z),U=R(z+P);Ph(t,D,Math.min($,U),_.bandwidth(),Math.abs(U-$),V,Y,K),Math.abs(U-$)>18&&Hl(t,ln(P),D+_.bandwidth()/2,($+U)/2+4,s)}z+=P}else{let $=I(B)??0,U=I.bandwidth();if(k){let X=R(P);Ph(t,Math.min(G,X),D+$,Math.abs(X-G),U,V,Y,K),Hl(t,ln(P),X+6,D+$+U/2+4,s,"start")}else{let X=R(P);Ph(t,D+$,Math.min(G,X),U,Math.abs(G-X),V,Y,K),Hl(t,ln(P),D+$+U/2,X-6,s)}}})}),Ks(t,e.xlabel,C.left+M/2,C.top+w+46,s),is(t,e.ylabel,C.top+w/2,20,s)}function Ph(t,e,n,r,o,a,i,s){let l=t.append("rect").attr("x",e).attr("y",n).attr("width",r).attr("height",o).attr("fill",a).attr("stroke",i).attr("stroke-width",1.5);Yr(l,s)}var aR=st(()=>{"use strict";Xa();No();on();tn();na()});function iR(t,e){return e===0?t.value:t.extraValues?.[e-1]??0}function sR(t,e,n,r,o,a,i,s,l,c,d){let u=e.data,f=e.fill===!0,p=e.seriesNames?.length?e.seriesNames:[e.series??""],m=Math.max(1,p.length,1+Math.max(0,...u.map(I=>I.extraValues?.length??0))),h=I=>e.seriesNameColors?.[I]??o[I%o.length],g=I=>e.seriesAxes?.[I]??"left",v=(e.seriesAxes??[]).includes("right"),y=I=>{let H=[];for(let O=0;O<m;O++)g(O)===I&&H.push(O);return H.length===1?h(H[0]):void 0},b=Ih(t,e,o,a,i,d,n),E=I=>{let H=1/0,O=-1/0;for(let D of u)for(let W=0;W<m;W++)if(g(W)===I){let z=iR(D,W);H=Math.min(H,z),O=Math.max(O,z)}return isFinite(H)?(H>0&&(H=0),H===O&&(O=H+1),[H,O]):[0,1]},[x,L]=E("left"),[S,A]=v?E("right"):[0,1],C={top:b+8,right:v?as(e.yrlabel,[ln(A),ln(S)]):32,bottom:64,left:as(e.ylabel,[ln(L),ln(x)])},M=n-C.left-C.right,w=r-C.top-C.bottom,k=Ms().domain(u.map(I=>I.label)).range([C.left,C.left+M]).padding(.5),N=or().domain([x,L]).nice().range([C.top+w,C.top]),_=v?or().domain([S,A]).nice().range([C.top+w,C.top]):null,T=I=>v&&g(I)==="right"&&_?_:N,R=v?y("left"):void 0,G=y("right");e.eras?.length&&e.eras.forEach((I,H)=>{let O=k(I.start),D=k(I.end);if(O==null||D==null)return;let W=I.color??o[H%o.length];t.append("rect").attr("x",Math.min(O,D)).attr("y",C.top).attr("width",Math.abs(D-O)).attr("height",w).attr("fill",Gt(W,c,12)),t.append("text").attr("x",(O+D)/2).attr("y",C.top+14).attr("text-anchor","middle").attr("fill",s).attr("font-size",So).attr("font-family",It).attr("opacity",.8).text(I.label)});for(let I of N.ticks(6)){let H=N(I);t.append("line").attr("x1",C.left).attr("x2",C.left+M).attr("y1",H).attr("y2",H).attr("stroke",l).attr("stroke-opacity",I===0?.6:.25),t.append("text").attr("class","dgmo-tick").attr("x",C.left-10).attr("y",H+4).attr("text-anchor","end").attr("fill",R??s).attr("font-size",So).attr("font-family",It).text(ln(I))}if(v&&_)for(let I of _.ticks(6))t.append("text").attr("class","dgmo-tick").attr("x",C.left+M+10).attr("y",_(I)+4).attr("text-anchor","start").attr("fill",G??s).attr("font-size",So).attr("font-family",It).text(ln(I));for(let I of u)t.append("text").attr("class","dgmo-tick").attr("x",k(I.label)??0).attr("y",C.top+w+18).attr("text-anchor","middle").attr("fill",s).attr("font-size",So).attr("font-family",It).text(I.label);t.append("rect").attr("class","dgmo-plot-rect").attr("x",C.left).attr("y",C.top).attr("width",M).attr("height",w).attr("fill","transparent");for(let I=0;I<m;I++){let H=h(I),O=T(I),D=p[I]??`Series ${I+1}`,W=u.map((V,j)=>({label:V.label,v:iR(V,I),xIndex:j,lineNumber:V.lineNumber})),z=t.append("g").attr("class","dgmo-series").attr("data-series-index",I).attr("data-series-name",D).attr("data-axis",g(I)).attr("data-color",H),P=e.seriesNameLineNumbers?.[I];if(P!==void 0&&z.attr("data-line-number",P),f){let V=Hu().x(j=>k(j.label)??0).y0(O(Math.max(O.domain()[0],0))).y1(j=>O(j.v));z.append("path").attr("class","dgmo-series-area").attr("d",V(W)??"").attr("fill",ie(a,H,i)).attr("stroke","none")}let B=Kn().x(V=>k(V.label)??0).y(V=>O(V.v));z.append("path").attr("class","dgmo-series-line").attr("d",B(W)??"").attr("fill","none").attr("stroke",H).attr("stroke-width",2.5).attr("stroke-linejoin","round").attr("stroke-linecap","round");let Y=Gt(H,s,60);for(let V of W)z.append("circle").attr("class","dgmo-pt").attr("data-series-index",I).attr("data-series-name",D).attr("data-color",H).attr("data-x-index",V.xIndex).attr("data-x-label",V.label).attr("data-value",V.v).attr("data-line-number",V.lineNumber).attr("cx",k(V.label)??0).attr("cy",O(V.v)).attr("r",3.5).attr("fill",c).attr("stroke",H).attr("stroke-width",2),e.noValue||Hl(t,ln(V.v),k(V.label)??0,O(V.v)-10,Y)}Ks(t,e.xlabel,C.left+M/2,C.top+w+46,s),is(t,e.ylabel,C.top+w/2,20,R??s),v&&(is(t,e.yrlabel,C.top+w/2,n-18,G??s),t.append("rect").attr("class","dgmo-axis-legend").attr("data-axis-legend","left").attr("x",0).attr("y",C.top).attr("width",C.left).attr("height",w).attr("fill","transparent").attr("style","cursor:pointer"),t.append("rect").attr("class","dgmo-axis-legend").attr("data-axis-legend","right").attr("x",C.left+M).attr("y",C.top).attr("width",C.right).attr("height",w).attr("fill","transparent").attr("style","cursor:pointer"))}var lR=st(()=>{"use strict";Xa();Eo();on();tn();na()});function cR(t,e,n,r,o,a,i,s){let l=e.data.filter(L=>L.value>0);if(l.length===0)return;let c=e.hole,d=c!==void 0,u=e.solidFill===!0,f=l.reduce((L,S)=>L+S.value,0),p=n/2,m=s+12,h=m+(r-m)/2,g=Math.min(n/2-220,(r-m)/2-40),v=bc(o,l.length),y=(L,S)=>S??v[L%v.length],b=a0().sort(null).value(L=>L.value)(l.map(L=>({value:L.value}))),E=Cl().innerRadius(d?g*c:0).outerRadius(g),x=t.append("g").attr("transform",`translate(${p},${h})`);b.forEach((L,S)=>{let A=y(S,l[S].color),C=u?A:ie(o,A,a),M=Math.round(l[S].value/f*100),w=x.append("path").attr("d",E(L)??"").attr("fill",C).attr("stroke",A).attr("stroke-width",1.5);Yr(w,{line:l[S].lineNumber,key:l[S].label,name:l[S].label,value:`${ln(l[S].value)} (${M}%)`,color:A});let k=(L.startAngle+L.endAngle)/2-Math.PI/2,N=Math.cos(k)>=0,_=Math.cos(k)*g,T=Math.sin(k)*g,R=Math.cos(k)*(g+16),G=Math.sin(k)*(g+16),I=R+(N?28:-28),H=e.noName?"":l[S].label,O=[e.noValue?"":ln(l[S].value),e.noPercent?"":`(${M}%)`].filter(Boolean).join(" "),D=[H,O].filter(Boolean).join(" \u2014 ");D&&(x.append("polyline").attr("points",`${_},${T} ${R},${G} ${I},${G}`).attr("fill","none").attr("stroke",A).attr("stroke-width",1),x.append("text").attr("x",I+(N?4:-4)).attr("y",G+4).attr("text-anchor",N?"start":"end").attr("fill",i).attr("font-size",N9).attr("font-family",It).text(D))}),d&&!e.noCenterTotal&&x.append("text").attr("text-anchor","middle").attr("y",8).attr("fill",i).attr("font-size",26).attr("font-weight",700).attr("font-family",It).text(ln(f))}var N9,dR=st(()=>{"use strict";Eo();tn();on();na();N9=14});function rE(t,e){return e===0?t.value:t.extraValues?.[e-1]??0}function fR(t,e,n,r,o,a,i,s,l,c){let d=e.data,u=d.length;if(u<3)return;let f=e.solidFill===!0,p=e.seriesNames?.length?e.seriesNames:[e.series??""],m=Math.max(1,p.length,1+Math.max(0,...d.map(C=>C.extraValues?.length??0))),h=m>1,g=C=>h?e.seriesNameColors?.[C]??o[C%o.length]:e.color??e.seriesNameColors?.[0]??a.primary,v=[];for(let C of d)for(let M=0;M<m;M++)v.push(rE(C,M));let y=Math.max(...v)*1.15||1,b=n/2,E=c+8,x=E+(r-E)/2,L=Math.min(n/2-130,(r-E)/2-50),S=C=>-Math.PI/2+C*2*Math.PI/u,A=(C,M)=>[b+Math.cos(S(C))*M,x+Math.sin(S(C))*M];for(let C=1;C<=uR;C++){let M=L*C/uR,w=d.map((k,N)=>A(N,M).join(",")).join(" ");t.append("polygon").attr("points",w).attr("fill","none").attr("stroke",l).attr("stroke-opacity",.4)}d.forEach((C,M)=>{let[w,k]=A(M,L);t.append("line").attr("x1",b).attr("y1",x).attr("x2",w).attr("y2",k).attr("stroke",l).attr("stroke-opacity",.4);let[N,_]=A(M,L+18),T=Math.cos(S(M));t.append("text").attr("x",N).attr("y",_+4).attr("text-anchor",Math.abs(T)<.3?"middle":T>0?"start":"end").attr("fill",s).attr("font-size",14).attr("font-family",It).text(d[M].label)});for(let C=0;C<m;C++){let M=g(C),w=p[C]??`Series ${C+1}`,k=t.append("g").attr("class","dgmo-series").attr("data-series-index",C).attr("data-series-name",w).attr("data-color",M),N=e.seriesNameLineNumbers?.[C];N!==void 0&&k.attr("data-line-number",N);let _=d.map((T,R)=>A(R,rE(T,C)/y*L).join(",")).join(" ");k.append("polygon").attr("points",_).attr("fill",f||h?M:ie(a,M,i)).attr("fill-opacity",f?.6:h?.2:1).attr("stroke",M).attr("stroke-width",2),d.forEach((T,R)=>{let G=rE(T,C),[I,H]=A(R,G/y*L),O=k.append("circle").attr("cx",I).attr("cy",H).attr("r",4).attr("fill",M);Yr(O,{line:T.lineNumber,key:h?`${w}\0${T.label}`:T.label,name:h?`${w} \u2014 ${T.label}`:T.label,value:ln(G),color:M}),e.noValue||k.append("text").attr("x",I).attr("y",H-8).attr("text-anchor","middle").attr("fill",s).attr("font-size",12).attr("font-family",It).text(ln(G))})}}var uR,pR=st(()=>{"use strict";on();tn();na();uR=5});function mR(t,e,n,r,o,a,i,s){let l=e.data.filter(x=>x.value>0),c=l.length;if(c===0)return;let d=e.solidFill===!0,u=l.reduce((x,L)=>x+L.value,0),f=Math.max(...l.map(x=>x.value))||1,p=n/2,m=s+8,h=m+(r-m)/2,g=Math.min(n/2-200,(r-m)/2-40),v=g*.14,y=bc(o,c),b=t.append("g").attr("transform",`translate(${p},${h})`),E=2*Math.PI/c;l.forEach((x,L)=>{let S=x.color??y[L%y.length],A=v+x.value/f*(g-v),C=L*E,M=C+E,w=Cl().innerRadius(v).outerRadius(A).startAngle(C).endAngle(M),k=Math.round(x.value/u*100),N=b.append("path").attr("d",w({})??"").attr("fill",d?S:ie(o,S,a)).attr("stroke",S).attr("stroke-width",2);Yr(N,{line:x.lineNumber,key:x.label,name:x.label,value:`${ln(x.value)} (${k}%)`,color:S});let _=C+E/2-Math.PI/2,T=Math.cos(_)>=0,R=Math.cos(_)*(g+14),G=Math.sin(_)*(g+14),I=e.noName?"":x.label,H=[e.noValue?"":ln(x.value),e.noPercent?"":`(${k}%)`].filter(Boolean).join(" "),O=[I,H].filter(Boolean).join(" \u2014 ");O&&b.append("text").attr("x",R+(T?4:-4)).attr("y",G+4).attr("text-anchor",T?"start":"end").attr("fill",i).attr("font-size",13).attr("font-family",It).text(O)})}var hR=st(()=>{"use strict";Eo();on();tn();na()});function gR(t,e,n,r,o,a,i,s,l){let c=[...e.data].sort((L,S)=>S.value-L.value),d=c.length;if(d===0)return;let u=e.solidFill===!0,f=n*.2,p=n*.6,m=n/2,h=l+8,y=(r-30-h)/d,b=c[0].value||1,E=p*.08,x=L=>Math.max(E,L/b*p);c.forEach((L,S)=>{let A=L.color??o[e.data.indexOf(L)%o.length],C=u?A:ie(a,A,i),M=x(L.value),w=S<d-1?x(c[S+1].value):E,k=h+S*y,N=k+y,_=t.append("polygon").attr("points",`${m-M/2},${k} ${m+M/2},${k} ${m+w/2},${N} ${m-w/2},${N}`).attr("fill",C).attr("stroke",A).attr("stroke-width",2);Yr(_,{line:L.lineNumber,key:L.label,name:L.label,value:ln(L.value),color:A});let T=(k+N)/2;e.noName||(t.append("line").attr("x1",f-8).attr("y1",T).attr("x2",m-M/2).attr("y2",T).attr("stroke",s).attr("stroke-opacity",.3),t.append("text").attr("x",f-12).attr("y",T+4).attr("text-anchor","end").attr("fill",s).attr("font-size",13).attr("font-family",It).text(L.label)),e.noValue||(t.append("line").attr("x1",m+M/2).attr("y1",T).attr("x2",f+p+8).attr("y2",T).attr("stroke",s).attr("stroke-opacity",.3),t.append("text").attr("x",f+p+12).attr("y",T+4).attr("text-anchor","start").attr("fill",s).attr("font-size",13).attr("font-family",It).text(ln(L.value)))})}var yR=st(()=>{"use strict";on();tn();na()});function bR(t,e,n,r,o,a,i,s,l){let c=e.heatmapRows??[];if(c.length===0)return;let d=Math.max(e.columns?.length??0,...c.map(_=>_.values.length)),u=c.length,f=e.columns??[],p=1/0,m=-1/0;for(let _ of c)for(let T of _.values)p=Math.min(p,T),m=Math.max(m,T);let h=e.solidFill===!0,g=[ie(o,o.primary,a,{solid:h}),ie(o,o.colors.cyan,a,{solid:h}),ie(o,o.colors.yellow,a,{solid:h}),ie(o,o.colors.orange,a,{solid:h})],v=_=>{let T=Math.max(0,Math.min(1,_)),R=1/(g.length-1),G=Math.min(g.length-2,Math.floor(T/R)),I=(T-G*R)/R;return Gt(g[G+1],g[G],I*100)},y=_=>{let{h:T,s:R}=wu(_),G=Math.min(75,Math.max(R+25,50));return Qp(T,G,a?72:30)},E=20+(Math.max(0,...c.map(_=>_t(_.label,13)))+16),x=l+28,L=24,S=24,A=n-E-L,C=r-x-S,M=A/d,w=C/u,k=Math.max(11,Math.min(18,Math.min(M,w)*.28)),N=f.some(_=>_t(_,12)>M*.85);f.forEach((_,T)=>{let R=E+T*M+M/2,G=t.append("text").attr("fill",i).attr("font-size",12).attr("font-family",It).text(_);N?G.attr("transform",`translate(${R},${x-8}) rotate(-40)`).attr("text-anchor","start"):G.attr("x",R).attr("y",x-8).attr("text-anchor","middle")}),c.forEach((_,T)=>{t.append("text").attr("x",E-10).attr("y",x+T*w+w/2+4).attr("text-anchor","end").attr("fill",i).attr("font-size",13).attr("font-family",It).text(_.label),_.values.forEach((R,G)=>{let I=m===p?.5:(R-p)/(m-p),H=v(I),O=f[G]??`Col ${G+1}`,D=t.append("rect").attr("x",E+G*M).attr("y",x+T*w).attr("width",M).attr("height",w).attr("fill",H).attr("stroke",s).attr("stroke-width",2);Yr(D,{line:_.lineNumber,key:_.label,name:`${_.label} \xB7 ${O}`,value:ln(R),color:H}),e.noValue||t.append("text").attr("x",E+G*M+M/2).attr("y",x+T*w+w/2+k/3).attr("text-anchor","middle").attr("fill",y(H)).attr("font-size",k).attr("font-weight",600).attr("font-family",It).text(ln(R))})})}var xR=st(()=>{"use strict";on();tn();en();na()});function ER(t,e,n,r,o,a,i,s,l,c){let d=e.scatterPoints??[];if(d.length===0)return;let u=e.solidFill===!0,f=d.some(N=>N.size!==void 0),p=[...new Set(d.map(N=>N.category).filter(Boolean))],m=(N,_)=>e.categoryColors?.[N]??o[_%o.length],h=new Map(p.map((N,_)=>[N,_])),g=d.map(N=>N.x),v=d.map(N=>N.y),y=Math.min(...g),b=Math.max(...g),E=Math.min(...v),x=Math.max(...v),L=(b-y)*.1||1,S=(x-E)*.1||1,A={top:c+8,right:32,bottom:64,left:as(e.ylabel,[ln(Math.ceil(x+S)),ln(Math.floor(E-S))])},C=n-A.left-A.right,M=r-A.top-A.bottom,w=or().domain([Math.floor(y-L),Math.ceil(b+L)]).range([A.left,A.left+C]),k=or().domain([Math.floor(E-S),Math.ceil(x+S)]).range([A.top+M,A.top]);t.append("rect").attr("class","dgmo-plot-rect").attr("x",A.left).attr("y",A.top).attr("width",C).attr("height",M).attr("fill","transparent").attr("pointer-events","none");for(let N of k.ticks(6)){let _=k(N);t.append("line").attr("x1",A.left).attr("x2",A.left+C).attr("y1",_).attr("y2",_).attr("stroke",l).attr("stroke-opacity",.25),t.append("text").attr("class","dgmo-tick").attr("x",A.left-10).attr("y",_+4).attr("text-anchor","end").attr("fill",s).attr("font-size",So).attr("font-family",It).text(ln(N))}for(let N of w.ticks(6)){let _=w(N);t.append("line").attr("x1",_).attr("x2",_).attr("y1",A.top).attr("y2",A.top+M).attr("stroke",l).attr("stroke-opacity",.25),t.append("text").attr("class","dgmo-tick").attr("x",_).attr("y",A.top+M+18).attr("text-anchor","middle").attr("fill",s).attr("font-size",So).attr("font-family",It).text(ln(N))}d.forEach((N,_)=>{let T=N.color??(N.category?m(N.category,h.get(N.category)??0):o[_%o.length]),R=(f?N.size??wR:wR)/2,G=t.append("circle").attr("cx",w(N.x)).attr("cy",k(N.y)).attr("r",R).attr("fill",u?T:ie(a,T,i)).attr("fill-opacity",M9).attr("stroke",T).attr("stroke-width",2);Yr(G,{line:N.lineNumber,key:N.name,name:N.category?`${N.name} \xB7 ${N.category}`:N.name,value:`(${ln(N.x)}, ${ln(N.y)})`,color:T}),G.attr("data-axval-x",ln(N.x)).attr("data-axval-y",ln(N.y)),N.category&&G.attr("data-category",N.category),e.noName||t.append("text").attr("x",w(N.x)).attr("y",k(N.y)-R-5).attr("text-anchor","middle").attr("fill",s).attr("font-size",11).attr("font-family",It).text(N.name)}),Ks(t,e.xlabel,A.left+C/2,A.top+M+46,s),is(t,e.ylabel,A.top+M/2,20,s)}var M9,wR,SR=st(()=>{"use strict";Xa();on();tn();na();M9=.65,wR=15});function vR(t,e,n,r,o,a,i,s){let l=e.links??[];if(l.length===0)return;let c=e.solidFill===!0,d=Array.from(new Set(l.flatMap(C=>[C.source,C.target]))),u=new Map;d.forEach((C,M)=>u.set(C,{name:C,rank:0,value:0,order:M,x:0,y:0,h:0,raw:e.nodeColors?.[C]??o[M%o.length]}));for(let C=0;C<d.length;C++){let M=!1;for(let w of l){let k=u.get(w.source),N=u.get(w.target);N.rank<k.rank+1&&(N.rank=k.rank+1,M=!0)}if(!M)break}for(let C of u.values()){let M=l.filter(k=>k.source===C.name).reduce((k,N)=>k+N.value,0),w=l.filter(k=>k.target===C.name).reduce((k,N)=>k+N.value,0);C.value=Math.max(M,w,1)}let f=Math.max(...[...u.values()].map(C=>C.rank)),p=Array.from({length:f+1},()=>[]);for(let C of u.values())p[C.rank].push(C);let m=16,h=s+8,g=n-m-16-_t("M",14),v=r-h-24,y=1/0;for(let C of p){let M=C.reduce((k,N)=>k+N.value,0),w=v-(C.length-1)*oE;M>0&&(y=Math.min(y,w/M))}isFinite(y)||(y=1);let b=C=>m+(f===0?0:C*(g-Dh)/f),E=C=>{C.sort((k,N)=>k.order-N.order);let M=C.reduce((k,N)=>k+N.value*y,0)+(C.length-1)*oE,w=h+(v-M)/2;for(let k of C)k.h=k.value*y,k.x=b(k.rank),k.y=w,w+=k.h+oE};p.forEach(E);let x=C=>C.y+C.h/2;for(let C=0;C<6;C++){let M=C%2===0,w=M?[...p.keys()]:[...p.keys()].reverse();for(let k of w){for(let N of p[k]){let _=M?l.filter(T=>T.target===N.name).map(T=>u.get(T.source)):l.filter(T=>T.source===N.name).map(T=>u.get(T.target));N.order=_.length?_.reduce((T,R)=>T+x(R),0)/_.length:x(N)}E(p[k])}}let L=new Map,S=new Map;for(let C of u.values())L.set(C.name,C.y),S.set(C.name,C.y);let A=[...l].sort((C,M)=>{let w=u.get(C.source),k=u.get(M.source);return w.y!==k.y?w.y-k.y:u.get(C.target).y-u.get(M.target).y});for(let C of A){let M=u.get(C.source),w=u.get(C.target),k=C.value*y,N=L.get(M.name),_=S.get(w.name);L.set(M.name,N+k),S.set(w.name,_+k);let T=M.x+Dh,R=w.x,G=T+(R-T)*.5,I=C.color??M.raw,H=c?I:Gt(I,a,45),O=t.append("path").attr("d",`M${T},${N} C${G},${N} ${G},${_} ${R},${_} L${R},${_+k} C${G},${_+k} ${G},${N+k} ${T},${N+k} Z`).attr("fill",H).attr("fill-opacity",.6);Yr(O,{line:C.lineNumber,key:`link:${M.name}\0${w.name}`,name:`${M.name} \u2192 ${w.name}`,value:String(C.value),color:M.raw})}for(let C of u.values()){let M=l.find(N=>N.source===C.name||N.target===C.name)?.lineNumber,w=t.append("rect").attr("x",C.x).attr("y",C.y).attr("width",Dh).attr("height",Math.max(1,C.h)).attr("fill",c?C.raw:Gt(C.raw,a,75)).attr("stroke",C.raw).attr("stroke-width",1);Yr(w,{...M!==void 0&&{line:M},key:`node:${C.name}`,name:C.name,value:String(C.value),color:C.raw});let k=C.rank===f;t.append("text").attr("x",k?C.x-6:C.x+Dh+6).attr("y",C.y+C.h/2+4).attr("text-anchor",k?"end":"start").attr("fill",i).attr("font-size",13).attr("font-family",It).text(C.name)}}var Dh,oE,kR=st(()=>{"use strict";on();tn();en();na();Dh=20,oE=14});function LR(t,e,n,r,o,a,i,s,l){let c=e.links??[];if(c.length===0)return;let d=e.solidFill===!0,u=Array.from(new Set(c.flatMap(S=>[S.source,S.target]))),f=u.length,p=new Map(u.map((S,A)=>[S,A])),m=S=>o[S%o.length],h=l+8,g=n/2,v=h+(r-h)/2,y=Math.max(0,...u.map(S=>_t(S,14))),b=Math.min(n/2-y-60,(r-h)/2-50),E=S=>-Math.PI/2+S*2*Math.PI/f,x=S=>[g+Math.cos(E(S))*b,v+Math.sin(E(S))*b],L=new Set;for(let S of c)c.some(A=>A.source===S.target&&A.target===S.source&&A!==S)&&L.add(`${S.source}\0${S.target}`);for(let S of c){let A=p.get(S.source),C=p.get(S.target),[M,w]=x(A),[k,N]=x(C),_=L.has(`${S.source}\0${S.target}`),T=.3,R=_?S.source<S.target?T+.15:T-.15:T,G=(M+k)/2,I=(w+N)/2,H=G+(g-G)*R*2,O=I+(v-I)*R*2,D=Math.max(1,Math.min(S.value/20,10)),W=m(A),z=t.append("path").attr("d",`M${M},${w} Q${H},${O} ${k},${N}`).attr("fill","none").attr("stroke",W).attr("stroke-width",D).attr("stroke-opacity",.6);if(Yr(z,{line:S.lineNumber,key:`edge:${S.source} ${S.target}`,name:`${S.source} \u2192 ${S.target}`,value:String(S.value),color:W}),S.directed){let P=Math.atan2(N-O,k-H),B=11,Y=k-Math.cos(P)*10,V=N-Math.sin(P)*10,j=P+Math.PI-.4,K=P+Math.PI+.4;t.append("polygon").attr("points",`${Y},${V} ${Y+Math.cos(j)*B},${V+Math.sin(j)*B} ${Y+Math.cos(K)*B},${V+Math.sin(K)*B}`).attr("fill",W).attr("fill-opacity",.7)}}u.forEach((S,A)=>{let[C,M]=x(A),w=m(A),k=t.append("circle").attr("cx",C).attr("cy",M).attr("r",10).attr("fill",d?w:ie(a,w,i)).attr("stroke",w).attr("stroke-width",2);Yr(k,{key:`node:${S}`,name:S,color:w});let N=Math.cos(E(A)),_=C+N*16,T=M+Math.sin(E(A))*16;t.append("text").attr("x",_).attr("y",T+4).attr("text-anchor",Math.abs(N)<.3?"middle":N>0?"start":"end").attr("fill",s).attr("font-size",14).attr("font-family",It).text(S)})}var NR=st(()=>{"use strict";on();tn();en();na()});function MR(t,e){try{let n=t.replace(/\bpi\b/gi,String(Math.PI)).replace(/\be\b/g,String(Math.E)).replace(/\bsin\s*\(/gi,"Math.sin(").replace(/\bcos\s*\(/gi,"Math.cos(").replace(/\btan\s*\(/gi,"Math.tan(").replace(/\bln\s*\(/gi,"Math.log(").replace(/\blog\s*\(/gi,"Math.log10(").replace(/\bexp\s*\(/gi,"Math.exp(").replace(/\bsqrt\s*\(/gi,"Math.sqrt(").replace(/\babs\s*\(/gi,"Math.abs(").replace(/\bx\b/gi,`(${e})`).replace(/\^/g,"**"),r=new Function(`return ${n}`)();return typeof r=="number"&&isFinite(r)?r:NaN}catch{return NaN}}var TR=st(()=>{"use strict"});function _R(t,e,n,r,o,a,i,s){let l=e.functions??[];if(l.length===0)return;let c=e.xRange??{min:-10,max:10},d=(c.max-c.min)/CR,u=[];for(let x=0;x<=CR;x++)u.push(c.min+x*d);let f=l.map((x,L)=>({color:x.color??o[L%o.length],name:x.name,line:x.lineNumber,pts:u.map(S=>[S,MR(x.expression,S)])})),p=1/0,m=-1/0;for(let x of f)for(let[,L]of x.pts)isFinite(L)&&(p=Math.min(p,L),m=Math.max(m,L));isFinite(p)||(p=-1,m=1),p===m&&(m=p+1);let h={top:s+8,right:32,bottom:64,left:as(e.ylabel,[ln(m),ln(p)])},g=n-h.left-h.right,v=r-h.top-h.bottom,y=or().domain([c.min,c.max]).range([h.left,h.left+g]),b=or().domain([p,m]).nice().range([h.top+v,h.top]);for(let x of b.ticks(8)){let L=b(x);t.append("line").attr("x1",h.left).attr("x2",h.left+g).attr("y1",L).attr("y2",L).attr("stroke",i).attr("stroke-opacity",x===0?.6:.2),t.append("text").attr("class","dgmo-tick").attr("x",h.left-10).attr("y",L+4).attr("text-anchor","end").attr("fill",a).attr("font-size",So).attr("font-family",It).text(ln(x))}for(let x of y.ticks(10)){let L=y(x);t.append("line").attr("x1",L).attr("x2",L).attr("y1",h.top).attr("y2",h.top+v).attr("stroke",i).attr("stroke-opacity",x===0?.6:.2),t.append("text").attr("class","dgmo-tick").attr("x",L).attr("y",h.top+v+18).attr("text-anchor","middle").attr("fill",a).attr("font-size",So).attr("font-family",It).text(ln(x))}let E=Kn().defined(x=>isFinite(x[1])&&x[1]>=p-1&&x[1]<=m+1).x(x=>y(x[0])).y(x=>b(x[1]));for(let x of f){let L=t.append("path").attr("d",E(x.pts)??"").attr("fill","none").attr("stroke",x.color).attr("stroke-width",2.5).attr("stroke-linejoin","round");Yr(L,{line:x.line,key:x.name,name:x.name,color:x.color})}Ks(t,e.xlabel,h.left+g/2,h.top+v+46,a),is(t,e.ylabel,h.top+v/2,20,a)}var CR,AR=st(()=>{"use strict";Xa();Eo();on();TR();na();CR=200});var PR={};ye(PR,{D3_DATA_CHART_TYPES:()=>IR,renderDataChartD3:()=>iE,supportsD3DataChart:()=>T9});function T9(t){return IR.has(t)}function C9(t){for(let e of t.split(`
211
- `)){let n=e.trim();if(!(!n||n.startsWith("//")))return n.split(/\s+/)[0].toLowerCase()}return""}async function iE(t,e,n,r){let o=await Yn(e,n),a=e==="dark",i=r?.width&&r.width>0?Math.round(r.width):ur,s=r?.height&&r.height>0?Math.round(r.height):yr,l=rr(i,s),c=Va(l,o,{width:i,height:s});if(!c)return document.body.removeChild(l),"";let{svg:d,width:u,height:f,textColor:p,mutedColor:m,bgColor:h,colors:g}=c;return _9(d,t,o,a,u,f,p,m,h,g)?zn(l,e,o):(document.body.removeChild(l),"")}function _9(t,e,n,r,o,a,i,s,l,c){let d=C9(e),f=aE.has(d)?null:Ys(e,n);if(f&&!f.error&&f.data.length>0&&RR.has(f.type)){let g=!f.noTitle&&!!f.title;switch(g&&co(t,f.title,f.titleLineNumber,o,i),f.type){case"bar":return oR(t,f,o,a,c,n,r,i,s,g),!0;case"line":return sR(t,f,o,a,c,n,r,i,s,l,g),!0;case"pie":return cR(t,f,o,a,n,r,i,g?52:24),!0;case"radar":{let v=lh(f,c),y=pf(t,v,n,r,g,o);return fR(t,f,o,a,c,n,r,i,s,y),!0}case"polar-area":return mR(t,f,o,a,n,r,i,g?52:24),!0}}let p=zs(e,n);if(p.error||!aE.has(p.type))return!1;let m=ir(n),h=!p.noTitle&&!!p.title;switch(h&&co(t,p.title,p.titleLineNumber,o,i),p.type){case"funnel":return gR(t,p,o,a,m,n,r,i,h?52:24),!0;case"heatmap":return bR(t,p,o,a,n,r,i,l,h?52:24),!0;case"scatter":{let g=fw(p,m),v=pf(t,g,n,r,h,o);return ER(t,p,o,a,m,n,r,i,s,v),!0}case"sankey":return vR(t,p,o,a,m,l,i,h?52:24),!0;case"chord":return LR(t,p,o,a,m,n,r,i,h?52:24),!0;case"function":{let g=fw(p,m),v=pf(t,g,n,r,h,o);return _R(t,p,o,a,m,i,s,v),!0}default:return!1}}var RR,aE,IR,sE=st(()=>{"use strict";ih();af();af();tn();Ki();na();aR();lR();dR();pR();hR();yR();xR();SR();kR();NR();AR();RR=new Set(["bar","line","pie","radar","polar-area"]),aE=new Set(["funnel","heatmap","scatter","sankey","chord","function"]),IR=new Set([...RR,...aE])});function rd(t,e){let n=t.append("rect").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height).attr("rx",e.rx).attr("fill",e.fill).attr("stroke",e.stroke).attr("stroke-width",e.strokeWidth);e.dashed&&n.attr("stroke-dasharray","6 3"),t.append("text").attr("x",e.width/2).attr("y",e.headerHeight/2+e.labelFontSize/2-2).attr("text-anchor","middle").attr("fill",e.labelColor).attr("font-size",e.labelFontSize).attr("font-weight","bold").text(e.label);let r=e.meta;if(!r||r.rows.length===0)return;t.append("line").attr("x1",0).attr("y1",e.headerHeight).attr("x2",e.width).attr("y2",e.headerHeight).attr("stroke",r.separatorColor).attr("stroke-opacity",.3).attr("stroke-width",1);let o=r.keyX??10,a=Math.max(...r.rows.map(([l])=>_t(`${l}: `,r.fontSize))),i=o+a,s=e.headerHeight+r.separatorGap+r.fontSize;for(let l=0;l<r.rows.length;l++){let[c,d]=r.rows[l],u=s+l*r.lineHeight;t.append("text").attr("x",o).attr("y",u).attr("fill",r.textColor).attr("font-size",r.fontSize).text(`${c}: `),t.append("text").attr("x",i).attr("y",u).attr("fill",r.textColor).attr("font-size",r.fontSize).text(d)}}function lE(t,e){t.append("clipPath").attr("id",e.clipId).append("rect").attr("width",e.width).attr("height",e.height).attr("rx",e.rx),t.append("rect").attr("x",e.inset).attr("y",e.height-e.barHeight).attr("width",e.width-e.inset*2).attr("height",e.barHeight).attr("fill",e.fill).attr("clip-path",`url(#${e.clipId})`).attr("class",e.className)}var Oh=st(()=>{"use strict";en()});var XR={};ye(XR,{clearEventLineMuted:()=>V9,focusEventLine:()=>UR,renderEventLine:()=>gE,renderEventLineForExport:()=>J9});function gE(t,e,n,r,o,a,i){if(e.events.length===0)return;Rt(t).selectAll(":not([data-d3-tooltip])").remove();let s=a?.width??t.clientWidth,l=a?.height??t.clientHeight;if(s<=0||l<=0)return;let c=!!a,d=c?new Set:yE(t),f=ir(n)[0],p=Hr(e.tagGroups,void 0,i),m=!!e.title&&!e.options.noTitle,h=e.tagGroups.length>0&&p!==null&&!e.options.noLegend,g=m?A9:0,y=g+(h?R9:0),b=new Map(e.eras.map(rt=>[rt.name,rt])),E=new Set(e.eras.filter(rt=>rt.collapsed).map(rt=>rt.name)),x=e.events.some(rt=>rt.era&&b.has(rt.era)),L=e.events.some(rt=>rt.era&&b.has(rt.era)&&!E.has(rt.era)),S=e.options.side,A=S==="alternate",C=A||S==="above"?"below":"above",M=[],w=new Set;for(let rt of e.events){let pt=rt.era;pt&&E.has(pt)?w.has(pt)||(w.add(pt),M.push({kind:"era",era:b.get(pt),members:e.events.filter(ht=>ht.era===pt)})):M.push({kind:"event",event:rt})}let k=Math.max(8,Math.floor((oo-Wl*2)/(Bl*Wo))),N=(rt,pt)=>28+(pt?DR:0)+(rt.length>0?6+rt.length*zR:0)+(rt.length>0?Wl:6),_=rt=>{if(!p)return f;let pt=ar(rt.metadata,e.tagGroups,p);return pt&&pt!==$9?Dn(pt,n)??pt:f},T=0,R=M.map(rt=>{let pt=A?T++%2===0?"above":"below":S;if(rt.kind==="event"){let $t=rt.event,ft=_($t),Wt=ie(n,ft,r,{solid:!1}),he=ve(Wt,n.textOnFillLight,n.textOnFillDark),ne=FR($t.description,k);return{kind:"event",event:$t,era:null,members:[],label:$t.label,date:$t.date,dateValue:$t.dateValue,future:$t.future,futureSpan:$t.futureSpan,lineNumber:$t.lineNumber,eraName:$t.era,color:ft,cardFill:Wt,titleColor:he,lines:ne,bulletColors:[],bulletMeta:[],cardH:N(ne,!!$t.date),x:0,side:pt,lane:0,left:0,spanHalf:0}}let ht=rt.era,dt=rt.members.map(_),ut=p!=null&&dt.length>0&&dt.every($t=>$t===dt[0])&&dt[0]!==f,yt=ht.color?Dn(ht.color,n)??n.text:ut?dt[0]:n.text,kt=Gt(yt,nr(n,r),10),Ot=ve(kt,n.textOnFillLight,n.textOnFillDark),Xt=null,bt=null;for(let $t of rt.members)$t.dateValue!==null&&((Xt===null||$t.dateValue<Xt)&&(Xt=$t.dateValue),(bt===null||$t.dateValue>bt)&&(bt=$t.dateValue));let Nt=Xt!==null&&bt!==null?(Xt+bt)/2:null,Vt=rt.members.filter($t=>!X9($t.metadata,d)),xt=Vt.map($t=>`\u2022 ${$t.date?`${$t.future?"TBD":Ji($t.date)} `:""}${$t.label}`),Lt=Vt.map(_),Dt=Vt.map($t=>$t.metadata),zt=FR(xt,k);return{kind:"era",event:null,era:ht,members:rt.members,label:ht.name,date:null,dateValue:Nt,future:!1,futureSpan:null,lineNumber:ht.lineNumber,eraName:ht.name,color:yt,cardFill:kt,titleColor:Ot,lines:zt,bulletColors:Lt,bulletMeta:Dt,cardH:N(zt,!1),x:0,side:pt,lane:0,left:0,spanHalf:0}}),G=e.options.scale&&R.every(rt=>rt.dateValue!==null),I=s-Gh*2,H=16,O=8,D=64,W=16,z=[],P=[],B=()=>{if(!P.length)return;let rt=P.map(pt=>pt.dateValue);z.push({kind:"run",events:P,lo:Math.min(...rt),hi:Math.max(...rt)}),P=[]};for(let rt of R)rt.kind==="era"?(B(),z.push({kind:"capsule",p:rt})):P.push(rt);B();let Y=z.reduce((rt,pt)=>rt+(pt.kind==="run"?pt.hi-pt.lo:0),0),V=rt=>{if(G){let pt=Y>0?I*rt/Y:0,ht={above:-1/0,below:-1/0},dt=Gh;for(let kt of z)if(kt.kind==="capsule"){let Ot=dt+D/2,Xt=Math.max(oo/2+6,ht[kt.p.side]+$h+oo/2);Ot<Xt&&(dt+=Xt-Ot,Ot=Xt),kt.p.x=Ot,kt.p.spanHalf=D/2,ht[kt.p.side]=Ot+oo/2,dt+=D+W}else{for(let Ot of kt.events)Ot.x=dt+(Ot.dateValue-kt.lo)*pt,Ot.spanHalf=0;dt+=(kt.hi-kt.lo)*pt+W}let ut=-1/0,yt=null;for(let kt of[...R].sort((Ot,Xt)=>Ot.x-Xt.x)){if(kt.kind==="era"){ut=kt.x+kt.spanHalf,yt=null;continue}if(kt.dateValue===yt){kt.x=ut;continue}kt.x<ut+H&&(kt.x=ut+H),ut=kt.x,yt=kt.dateValue}}else{R.forEach(dt=>{dt.spanHalf=0});let pt=R.length,ht=pt>1?Math.max(O9,I/(pt-1)):0;R.forEach((dt,ut)=>{dt.x=Gh+ut*ht})}if(G){let pt=oo+$h;for(let ht=0;ht<8;ht++){let dt=!1;for(let ut of["above","below"]){let yt=R.filter(kt=>kt.side===ut).sort((kt,Ot)=>kt.x-Ot.x);for(let kt=1;kt<yt.length;kt++){let Ot=yt[kt];if(Ot.kind!=="event")continue;let Xt=yt[kt-1];if(Xt.kind==="event"&&Ot.dateValue===Xt.dateValue)continue;let bt=Xt.x+pt;if(bt<=Ot.x)continue;let Nt=yt[kt+1],Vt=Nt?.kind==="era"?Nt.x-pt:1/0,xt=Math.min(bt,Vt);xt>Ot.x+.5&&(Ot.x=xt,dt=!0)}}if(!dt)break}}for(let pt of["above","below"]){let ht=R.filter(ut=>ut.side===pt).sort((ut,yt)=>ut.x-yt.x),dt=[];for(let ut=0;ut<ht.length;ut++){let yt=ht[ut],kt=ht[ut+1],Xt=yt.kind!=="era"&&!!kt&&kt.x-yt.x<oo+$h?yt.x-oo+cE:yt.x-oo/2,bt=yt.x-cE,Nt=yt.x-oo+cE,Vt=dt.length,xt=Math.max(Xt,Nt);for(let Lt=0;Lt<dt.length;Lt++){let Dt=Math.max(Xt,dt[Lt]+$h,Nt);if(Dt<=bt){Vt=Lt,xt=Dt;break}}yt.lane=Vt,yt.left=Math.max(6,xt),dt[Vt]=yt.left+oo}}},j=()=>{let rt=Math.max(s,Math.max(...R.map(Dt=>Dt.x+Dt.spanHalf))+Gh,Math.max(...R.map(Dt=>Dt.left+oo))+6),pt={above:[],below:[]};for(let Dt of["above","below"]){let zt=[];for(let Wt of R)Wt.side===Dt&&(zt[Wt.lane]=Math.max(zt[Wt.lane]??0,Wt.cardH));let $t=[],ft=0;for(let Wt=0;Wt<zt.length;Wt++)$t[Wt]=ft,ft+=(zt[Wt]??0)+G9;pt[Dt]=$t}let ht=Dt=>(Dt.side==="above"?I9:P9)+(pt[Dt.side][Dt.lane]??0),dt=Dt=>Math.max(0,...R.filter(zt=>zt.side===Dt).map(zt=>ht(zt)+zt.cardH)),ut=dt("above"),yt=dt("below"),kt=ut+(L&&C==="above"?OR:0),Ot=yt+(L&&C==="below"?OR:0),Xt=14,bt=14,Nt=y+Xt+kt,Vt=C==="above"?Nt-(ut+14):Nt+(yt+14),xt=Nt+Ot+bt,Lt=c?xt:Math.max(l,xt);return{contentW:rt,contentH:xt,totalH:Lt,spineY:Nt,eraBaseY:Vt,laneNear:ht}},K=Number(globalThis.process?.env?.DGMO_EVT_STRETCH),$;if(Number.isFinite(K)&&K>0)V(K),$=j();else{V(1),$=j();let rt=s/l,pt=ht=>ht.contentW/ht.contentH;if(G&&$.contentH>l&&pt($)<rt){V(O);let ht=j();if(pt(ht)<=rt)$=ht;else{let dt=1,ut=O;for(let yt=0;yt<8;yt++){let kt=(dt+ut)/2;V(kt),pt(j())>=rt?ut=kt:dt=kt}V(ut),$=j()}}}let{contentW:U,totalH:X,spineY:q,eraBaseY:et,laneNear:tt}=$,F=Rt(t).append("svg").attr("width",U).attr("height",X).attr("viewBox",`0 0 ${U} ${X}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",It);if(c||F.append("style").text(F9),m){let rt=F.append("text").attr("class","chart-title").attr("x",U/2).attr("y",30).attr("text-anchor","middle").attr("fill",n.text).attr("font-family",It).attr("font-size",20).attr("font-weight","700").attr("data-line-number",e.titleLineNumber??1).text(e.title);if(o&&e.titleLineNumber){let pt=e.titleLineNumber;rt.style("cursor","pointer").on("click",()=>o(pt))}}if(h){let rt=F.append("g").attr("transform",`translate(0, ${g})`),pt=e.tagGroups.map(ht=>({name:ht.name,entries:ht.entries.map(dt=>({value:dt.value,color:Dn(dt.color,n)??dt.color}))}));fn(rt,{groups:pt,palette:n,isDark:r,width:U,mode:c?"export":"preview",activeGroup:p}),c||U9(rt)}let Q=Math.min(...R.map(rt=>rt.x-rt.spanHalf)),ot=Math.max(...R.map(rt=>rt.x+rt.spanHalf)),Z=Q-20,lt=ot+20,nt=G&&R.some(rt=>rt.future&&!rt.futureSpan),J=R.length?Math.max(Z,...R.filter(rt=>!rt.future).map(rt=>rt.x+rt.spanHalf)):lt,at=nt?J:lt;F.append("line").attr("x1",Z).attr("y1",q).attr("x2",at).attr("y2",q).attr("stroke",n.text).attr("stroke-width",2.5).attr("stroke-linecap","round"),nt&&F.append("line").attr("x1",at).attr("y1",q).attr("x2",lt).attr("y2",q).attr("stroke",n.text).attr("stroke-width",2.5).attr("stroke-linecap","round").attr("stroke-opacity",.45).attr("stroke-dasharray","2 6");let it=R.map(rt=>{let pt=rt.side==="above"?q-tt(rt):q+tt(rt),ht=rt.side==="above"?pt-rt.cardH:pt;return{p:rt,near:pt,top:ht}}),vt=(rt,pt)=>{let ht=Math.min(q,pt),dt=Math.max(q,pt);return it.some(ut=>ut.p!==rt&&rt.x>ut.p.left&&rt.x<ut.p.left+oo&&dt>ut.top&&ht<ut.top+ut.p.cardH)},Tt=rt=>q+B9*(rt.side==="above"?-1:1);for(let{p:rt,near:pt}of it){let ht=rt.kind==="era"?Tt(rt):q,dt=F.append("line").attr("class","dgmo-event-leader").attr("x1",rt.x).attr("y1",ht).attr("x2",rt.x).attr("y2",pt).attr("stroke",rt.color).attr("stroke-width",1.5).attr("stroke-opacity",vt(rt,pt)?.18:rt.future?.4:.65);uE(dt,rt)}let At=0;for(let{p:rt,top:pt}of it){let ht=rt.left,dt=F.append("g").attr("class","dgmo-event-card").attr("transform",`translate(${ht}, ${pt})`).attr("data-line-number",rt.lineNumber);if(uE(dt,rt),rt.kind==="era"&&dt.attr("data-era",rt.era.name).attr("data-era-collapsed","true"),o){let kt=rt.lineNumber;dt.style("cursor","pointer").on("click",()=>o(kt)),dt.append("rect").attr("x",0).attr("y",0).attr("width",oo).attr("height",rt.cardH).attr("fill","transparent").attr("pointer-events","all")}let ut=rt.kind==="event"&&rt.date?rt.future?"TBD":Ji(rt.date):null,yt=ut?DR:0;if(e.options.noBox){let kt=rt.side==="below",Ot=kt?0:rt.cardH-28,Xt=kt?0:rt.cardH-28-yt,bt=28+yt,Nt=`dgmo-evt-shelf-${At++}`;dt.append("clipPath").attr("id",Nt).append("rect").attr("x",0).attr("y",Xt).attr("width",oo).attr("height",bt).attr("rx",dE),dt.append("rect").attr("x",0).attr("y",Xt).attr("width",oo).attr("height",bt).attr("clip-path",`url(#${Nt})`).attr("fill",Gt(rt.color,nr(n,r),H9));let Vt=kt?Xt:Xt+bt-dE;if(dt.append("rect").attr("x",0).attr("y",Vt).attr("width",oo).attr("height",dE).attr("clip-path",`url(#${Nt})`).attr("fill",rt.color).attr("fill-opacity",rt.future?.4:1),dt.append("text").attr("x",Wl).attr("y",Ot+28/2+13/2-2).attr("fill",rt.color).attr("font-family",It).attr("font-size",13).attr("font-weight",700).text(rt.label),ut&&dt.append("text").attr("x",Wl).attr("y",(kt?28:Ot-yt)+Hh+2).attr("fill",Gt(n.text,n.bg,55)).attr("font-family",It).attr("font-size",Hh).attr("font-weight",600).text(ut),rt.lines.length>0){let xt=kt?fE+yt+Bl:Wl+Bl;YR(dt,rt.lines,n.text,n,xt,rt.bulletColors,rt.bulletMeta)}}else rd(dt,{width:oo,height:rt.cardH,rx:6,fill:rt.cardFill,stroke:rt.color,strokeWidth:1.5,label:rt.label,labelColor:rt.titleColor,labelFontSize:13,headerHeight:28}),ut&&dt.append("text").attr("x",oo/2).attr("y",28+Hh+1).attr("text-anchor","middle").attr("fill",Gt(rt.titleColor,rt.cardFill,60)).attr("font-family",It).attr("font-size",Hh).attr("font-weight",600).text(ut),rt.lines.length>0&&(dt.append("line").attr("x1",0).attr("y1",28+yt).attr("x2",oo).attr("y2",28+yt).attr("stroke",rt.titleColor).attr("stroke-opacity",.3).attr("stroke-width",1),YR(dt,rt.lines,rt.titleColor,n,fE+yt+Bl,rt.bulletColors,rt.bulletMeta))}for(let rt of R){if(rt.kind==="era"){let ht=rt.color,dt=Math.max(16,rt.spanHalf),ut=Q-20,yt=ot+20,kt=Math.max(ut,rt.x-dt),Ot=Math.min(yt,rt.x+dt),Xt=Tt(rt),bt=F.append("g").attr("class","dgmo-event-era").attr("data-era",rt.era.name).attr("data-era-collapsed","true").attr("data-line-number",rt.lineNumber);if(o){let Vt=Math.min(Xt,q)-4,xt=Math.max(Xt,q)+8;bt.append("rect").attr("x",kt).attr("y",Vt).attr("width",Ot-kt).attr("height",xt-Vt).attr("fill","transparent").attr("pointer-events","all")}bt.append("path").attr("d",`M${kt},${q} L${kt},${Xt} L${Ot},${Xt} L${Ot},${q}`).attr("fill","none").attr("stroke",ht).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round");let Nt=(kt+Ot)/2;bt.append("line").attr("x1",Nt-Fh/2).attr("y1",q).attr("x2",Nt+Fh/2).attr("y2",q).attr("stroke",n.bg).attr("stroke-width",5).attr("stroke-linecap","butt");for(let Vt of tj(Nt,q))bt.append("path").attr("d",Vt).attr("fill","none").attr("stroke",n.text).attr("stroke-width",2).attr("stroke-linecap","round").attr("stroke-linejoin","round");if(o){let Vt=rt.lineNumber;bt.style("cursor","pointer").on("click",()=>o(Vt))}continue}let pt=F.append("circle").attr("class","dgmo-event-dot").attr("cx",rt.x).attr("cy",q).attr("r",D9).attr("fill",rt.future?n.bg:rt.color).attr("stroke",rt.future?rt.color:n.bg).attr("stroke-width",2).attr("data-line-number",rt.lineNumber);uE(pt,rt)}if(x){let rt=[],pt=null;for(let yt of R){let kt=yt.eraName;if(kt&&b.has(kt)){if(pt===kt&&rt.length>0){let Ot=rt[rt.length-1];Ot.firstX=Math.min(Ot.firstX,yt.x),Ot.lastX=Math.max(Ot.lastX,yt.x)}else rt.push({era:b.get(kt),collapsed:yt.kind==="era",firstX:yt.x,lastX:yt.x});pt=kt}else pt=null}let ht=yt=>Math.max(4,Math.min(U-4,yt)),dt=C==="above"?1:-1,ut=rt.filter(yt=>!yt.collapsed).map(yt=>({run:yt,x0:ht(yt.firstX-$R),x1:ht(yt.lastX+$R)})).sort((yt,kt)=>yt.run.firstX-kt.run.firstX);for(let yt=1;yt<ut.length;yt++){let kt=ut[yt-1],Ot=ut[yt];if(kt.x1<=Ot.x0)continue;let Xt=(kt.run.lastX+Ot.run.firstX)/2;kt.x1=Math.max(kt.run.lastX,Math.min(kt.x1,Xt-HR)),Ot.x0=Math.min(Ot.run.firstX,Math.max(Ot.x0,Xt+HR))}for(let{run:yt,x0:kt,x1:Ot}of ut){let Xt=!yt.era.color,bt=Xt?n.text:Dn(yt.era.color,n)??n.text,Nt=Xt?.5:.85,Vt=et,xt=F.append("g").attr("class","dgmo-event-era").attr("data-era",yt.era.name).attr("data-era-collapsed",String(yt.collapsed)).attr("data-line-number",yt.era.lineNumber);if(xt.append("path").attr("d",`M${kt},${Vt+GR*dt} L${kt},${Vt} L${Ot},${Vt} L${Ot},${Vt+GR*dt}`).attr("fill","none").attr("stroke",bt).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",Nt),xt.append("text").attr("x",(yt.firstX+yt.lastX)/2).attr("y",C==="above"?Vt-6:Vt+BR+4).attr("text-anchor","middle").attr("font-family",It).attr("font-size",BR).attr("font-weight",700).attr("fill",bt).attr("fill-opacity",Xt?.85:1).text(yt.era.name),o){let Lt=yt.era.lineNumber;xt.style("cursor","pointer").on("click",()=>o(Lt))}}}if(!c){let rt=F.node();Q9(rt),rt&&(Z9(t,rt,()=>gE(t,e,n,r,o,a,i)),j9(t,rt))}}function uE(t,e){if(t.attr("data-evt",e.lineNumber),e.eraName&&t.attr("data-evt-era",e.eraName),e.event)for(let[n,r]of Object.entries(e.event.metadata))t.attr(`data-tag-${n.toLowerCase()}`,String(r).toLowerCase())}function z9(t){t.querySelectorAll(`.${Zs},.${Fl},.${Yh}`).forEach(e=>e.classList.remove(Zs,Fl,Yh))}function od(t,e){if(z9(t),!e)return;let n=[...t.querySelectorAll(Y9)];if(e.kind==="event"){let l=c=>c.getAttribute("data-evt")===e.id;if(!n.some(l))return;n.forEach(c=>c.classList.add(l(c)?Zs:Fl));return}if(e.kind==="era"){let l=c=>c.getAttribute("data-evt-era")===e.name||c.classList.contains("dgmo-event-era")&&c.getAttribute("data-era")===e.name;if(!n.some(l))return;n.forEach(c=>{l(c)?c.classList.contains("dgmo-event-era")&&c.classList.add(Yh):c.classList.add(Fl)});return}let r=`data-tag-${e.group}`,o=l=>l.getAttribute(r)===e.value,a=[...t.querySelectorAll(".dgmo-evt-bullet")],i=new Set;for(let l of a){if(!o(l))continue;let c=l.closest(".dgmo-event-card"),d=c?.getAttribute("data-era")??c?.getAttribute("data-evt-era");d&&i.add(d)}if(!n.some(o)&&i.size===0)return;let s=l=>{let c=l.getAttribute("data-era")??l.getAttribute("data-evt-era");return!!c&&i.has(c)};n.forEach(l=>{!o(l)&&!s(l)&&l.classList.add(Fl)});for(let l of a)o(l)||l.classList.add(Fl)}function Bh(t){let e=t.getAttribute(pE);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function V9(t){t.removeAttribute(hE)}function UR(t,e){let n=t.querySelector("svg");n&&(e?n.setAttribute(pE,JSON.stringify(e)):n.removeAttribute(pE),od(n,e))}function yE(t){let e=t.getAttribute(hE);if(!e)return new Set;try{return new Set(JSON.parse(e))}catch{return new Set}}function U9(t){t.selectAll("[data-legend-entry]").each(function(){let r;try{r=this.getBBox()}catch{return}!r.width||!r.height||Rt(this).insert("rect",":first-child").attr("x",r.x-6).attr("y",r.y-7).attr("width",r.width+12).attr("height",r.height+14).attr("fill","transparent").attr("data-legend-hit","")})}function X9(t,e){if(e.size===0)return!1;for(let[n,r]of Object.entries(t))if(e.has(`${n.toLowerCase()}:${String(r).toLowerCase()}`))return!0;return!1}function j9(t,e){let n=yE(t),r=o=>{for(let a of n){let i=a.indexOf(":");if(i<0)continue;let s=a.slice(0,i),l=a.slice(i+1);if(o.getAttribute(`data-tag-${s}`)===l)return!0}return!1};e.querySelectorAll(".dgmo-event-card,.dgmo-event-leader").forEach(o=>o.classList.toggle(mf,r(o))),e.querySelectorAll("[data-legend-entry]").forEach(o=>{let a=o.closest("[data-legend-group]")?.getAttribute("data-legend-group"),i=o.getAttribute("data-legend-entry");q9(o,!!a&&n.has(`${a}:${i}`))})}function q9(t,e){t.classList.toggle(VR,e);let n=t.querySelector("circle");if(n)if(e)n.hasAttribute("data-fill0")||n.setAttribute("data-fill0",n.getAttribute("fill")??""),n.setAttribute("fill","none"),n.setAttribute("stroke",n.getAttribute("data-fill0")||"currentColor"),n.setAttribute("stroke-width","1.5");else{let r=n.getAttribute("data-fill0");r!==null&&n.setAttribute("fill",r),n.removeAttribute("stroke"),n.removeAttribute("stroke-width")}}function K9(t,e,n){let r=yE(t),o=`${e}:${n}`;r.has(o)?r.delete(o):r.add(o),t.setAttribute(hE,JSON.stringify([...r]))}function Z9(t,e,n){e.addEventListener("click",r=>{let o=r.target;if(!o||typeof o.closest!="function")return;let a=o.closest("[data-legend-entry]");if(!a)return;let i=a.getAttribute("data-legend-entry"),s=a.closest("[data-legend-group]")?.getAttribute("data-legend-group");if(!s||!i)return;K9(t,s,i);let l=Bh(e);n(),l&&UR(t,l),typeof CustomEvent<"u"&&t.dispatchEvent(new CustomEvent("dgmo-event-line-rerender"))})}function Q9(t){t&&(t.addEventListener("mouseover",e=>{let n=e.target;if(!n||typeof n.closest!="function")return;let r=n.closest("[data-legend-entry]");if(r){let i=r.getAttribute("data-legend-entry"),s=r.closest("[data-legend-group]")?.getAttribute("data-legend-group");od(t,s&&i?{kind:"tag",group:s,value:i}:Bh(t));return}let o=n.closest(".dgmo-event-era");if(o){od(t,{kind:"era",name:o.getAttribute("data-era")??""});return}let a=n.closest("[data-evt]");if(a){let i=a.getAttribute("data-era");od(t,i?{kind:"era",name:i}:{kind:"event",id:a.getAttribute("data-evt")??""});return}od(t,Bh(t))}),t.addEventListener("mouseout",e=>{let n=e.relatedTarget;(!n||!t.contains(n))&&od(t,Bh(t))}))}function J9(t,e,n,r,o,a){gE(t,e,n,r,void 0,o,a)}function tj(t,e){let o=a=>{let i="";for(let s=0;s<=48;s++){let l=s/48,c=e-WR+l*2*WR,d=a+W9*Math.sin(l*Math.PI*2);i+=`${s===0?"M":"L"}${d.toFixed(2)},${c.toFixed(2)}`,s<48&&(i+=" ")}return i};return[o(t-Fh/2),o(t+Fh/2)]}function FR(t,e){let n=[];for(let r of t){if(r===""){n.push({text:"",kind:"plain"});continue}n.push(...qo([r],e))}return n}function YR(t,e,n,r,o=fE+Bl,a=[],i=[]){let s=o,l=0,c=n,d=null,u=f=>{if(d){f.attr("class","dgmo-evt-bullet");for(let[p,m]of Object.entries(d))f.attr(`data-tag-${p.toLowerCase()}`,String(m).toLowerCase())}};for(let f of e){let p=f.kind==="bullet-first"||f.kind==="bullet-cont",m=Wl+(p?12:0);if(f.kind==="bullet-first"){c=a[l]??n,d=i[l]??null,l++;let g=t.append("text").attr("x",Wl).attr("y",s).attr("text-anchor","start").attr("fill",c).attr("font-family",It).attr("font-size",Bl).attr("font-weight",700).text("\u2022");u(g)}else p||(c=n,d=null);let h=t.append("text").attr("x",m).attr("y",s).attr("text-anchor","start").attr("fill",p?c:n).attr("font-family",It).attr("font-size",Bl);p&&u(h),gn(h,f.text,r),s+=zR}}var oo,Gh,A9,R9,I9,P9,Bl,zR,Wl,fE,D9,O9,G9,$9,cE,$h,DR,Hh,H9,dE,OR,GR,$R,HR,WR,W9,Fh,B9,BR,Zs,Fl,Yh,mf,VR,hE,F9,Y9,pE,jR=st(()=>{"use strict";Xn();on();tn();xr();Oh();_o();en();$s();Br();w0();Ke();oo=210,Gh=58,A9=48,R9=34,I9=46,P9=46,Bl=11.5,zR=16,Wl=9,fE=34,D9=5.5,O9=96,G9=16,$9="#999999",cE=18,$h=6,DR=15,Hh=10,H9=13,dE=4,OR=30,GR=8,$R=14,HR=3,WR=6,W9=2.6,Fh=5,B9=13,BR=11.5,Zs="dgmo-evt-hl",Fl="dgmo-evt-dim",Yh="dgmo-evt-era-hl",mf="dgmo-evt-collapsed",VR="dgmo-evt-off",hE="data-evt-hidden",F9=`.dgmo-event-dot{transition:transform .12s ease;transform-box:fill-box;transform-origin:center}.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era{transition:opacity .12s ease,filter .12s ease}.dgmo-event-dot,.dgmo-event-card,.dgmo-event-era{cursor:default}[data-legend-entry]{cursor:pointer}.${Fl}{opacity:.2}.dgmo-event-dot.${Zs}{transform:scale(1.55)}.dgmo-event-leader.${Zs}{stroke-opacity:1;stroke-width:2.5}.dgmo-event-card.${Zs}{filter:drop-shadow(0 2px 5px rgba(0,0,0,.22))}.dgmo-event-era.${Yh}{filter:drop-shadow(0 1px 2px rgba(0,0,0,.28))}.dgmo-event-card.${mf},.dgmo-event-leader.${mf}{opacity:0;pointer-events:none}.dgmo-event-card.${mf}.${Zs},.dgmo-event-leader.${mf}.${Zs}{opacity:1;pointer-events:auto}[data-legend-entry].${VR} text{text-decoration:line-through;opacity:.5}`;Y9=".dgmo-event-dot,.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era",pE="data-evt-pin"});var QR={};ye(QR,{renderVersionControl:()=>ZR,renderVersionControlForExport:()=>aj});function nj(t,e){return t.length>e?t.slice(0,e-1)+"\u2026":t}function wE(t,e,n,r,o,a,i){let s=Math.hypot(n-t,r-e),l=Math.hypot(o-n,a-r),c=Math.max(2,Math.min(i,s-1,l-1)),d=(n-t)/(s||1),u=(r-e)/(s||1),f=(o-n)/(l||1),p=(a-r)/(l||1);return`M${t},${e} L${n-d*c},${r-u*c} Q${n},${r} ${n+f*c},${r+p*c} L${o},${a}`}function ZR(t,e,n,r,o,a){if(e.nodes.length===0)return;Rt(t).selectAll(":not([data-d3-tooltip])").remove();let i=e.nodes,s=e.options.direction!=="LR",l=new Map(e.branches.map(D=>[D.name,D])),c=ir(n),d=D=>D.colorToken?Dn(D.colorToken,n)??c[D.lane%c.length]:c[D.lane%c.length],u=D=>d(l.get(D.branch)),f=D=>i[D],p=D=>D.kind==="cherry"?"\u21E0 ":D.kind==="merge"?"\u21F2 ":"",m=new Map;for(let D of i){let W=D.id,z=p(D)+nj(D.message||"(empty)",26),P=(W?W.length*6.6+8:0)+z.length*6.9+8;m.set(D.key,{sha:W,msg:z,lw:P})}let h=Math.max(0,...[...m.values()].map(D=>D.lw)),g=new Map,v=(D,W)=>{g.has(D)||g.set(D,[]),g.get(D).push(W)};if(!e.options.noLabels)for(let D of i)D.tag&&v(D.key,{kind:"tag",label:D.tag,w:D.tag.length*6.6+16});for(let D of e.refs)D.atKey!=null&&(D.head?v(D.atKey,{kind:"head",label:"HEAD",w:46}):v(D.atKey,{kind:"ref",label:D.name,remote:D.remote,w:D.name.length*6.2+18}));for(let D of e.notes)D.anchorKey!=null&&v(D.anchorKey,{kind:"note",label:KR[D.num-1]??`#${D.num}`,w:19});let y=Math.max(0,...[...g.values()].map(D=>D.length)),b=e.branches.length,E=i.length,x=new Map,L=[],S,A,C,M,w=0,k=Math.cos(EE*Math.PI/180),N=Math.sin(EE*Math.PI/180);if(s){C=24;let D=C+32,W=52,z=96;M=78;for(let B of i)x.set(B.key,{x:M+B.lane*z,y:D+B.seq*W});let P=M+(b-1)*z+28;for(let B of i){let Y=x.get(B.key);L.push({node:B,kind:"msg",diag:!1,x:P,y:Y.y,anchor:"start",leader:{x1:Y.x+Ko+2,y1:Y.y,x2:P-6,y2:Y.y}}),(g.get(B.key)??[]).forEach((j,K)=>L.push({node:B,kind:j.kind,label:j.label,remote:j.remote,w:j.w,x:Y.x-Ko-12-j.w/2-K*4,y:Y.y,anchor:"middle"}))}S=P+h+16,A=D+(E-1)*W+22}else{C=Math.max(4,...e.branches.map(V=>V.name.length))*7.5+18;let W=C+34,z=86,P=54;M=16+y*qR+14;for(let V of i)x.set(V.key,{x:W+V.seq*z,y:M+V.lane*P});let Y=M+(b-1)*P+26;for(let V of i){let j=x.get(V.key);L.push({node:V,kind:"msg",diag:!0,x:j.x,y:Y,anchor:"start",leader:{x1:j.x,y1:j.y+Ko,x2:j.x,y2:Y-3}}),(g.get(V.key)??[]).forEach(($,U)=>L.push({node:V,kind:$.kind,label:$.label,remote:$.remote,w:$.w,x:j.x,y:j.y-Ko-12-U*qR,anchor:"middle"}))}for(let V of e.branches){if(!V.ab||V.ab.ahead+V.ab.behind===0||V.tip==null)continue;let j=x.get(V.tip);L.push({node:f(V.tip),kind:"ab",label:rj(V.ab),x:j.x+Ko+10,y:j.y,anchor:"start"})}S=Math.max(W+(E-1)*z+Ko+70,...[...x.entries()].map(([V,j])=>j.x+m.get(V).lw*k))+18,A=Y+h*N+12*k+16,e.notes.length&&(w=A+4,A+=8+e.notes.length*16+8)}let _=!!e.title,T=_?ej:0,R=Math.round(S),G=Math.round(A+T),I=!!a,H=Rt(t).append("svg").attr("width",R).attr("height",G).attr("viewBox",`0 0 ${R} ${G}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",It);if(H.append("rect").attr("width",R).attr("height",G).attr("fill",n.bg),_){let D=H.append("text").attr("class","chart-title").attr("x",R/2).attr("y",30).attr("text-anchor","middle").attr("fill",n.text).attr("font-family",It).attr("font-size",20).attr("font-weight","700").attr("data-line-number",e.titleLineNumber??1).text(e.title);if(o&&e.titleLineNumber&&!I){let W=e.titleLineNumber;D.style("cursor","pointer").on("click",()=>o(W))}}let O=H.append("g").attr("transform",`translate(0, ${T})`);oj(O,e,n,s,x,L,m,u,f,C,M,w,o&&!I?o:void 0)}function rj(t){let e=[];return t.ahead&&e.push("\u2191"+t.ahead),t.behind&&e.push("\u2193"+t.behind),e.join(" ")}function oj(t,e,n,r,o,a,i,s,l,c,d,u,f){let p=e.nodes,m=E=>o.get(E),h=(E,x)=>r?{x:m(x.key).x,y:m(E.key).y}:{x:m(E.key).x,y:m(x.key).y},g=(E,x)=>r?{x:m(E.key).x,y:m(x.key).y}:{x:m(x.key).x,y:m(E.key).y},v=E=>E.ghost?.32:1,y=(E,x,L,S)=>{let A=m(E.key),C=m(x.key),M=g(E,x);if(t.append("path").attr("d",wE(A.x,A.y,M.x,M.y,C.x,C.y,xE)).attr("fill","none").attr("stroke",L).attr("stroke-width",2).attr("stroke-dasharray","2 4").attr("opacity",.8),S){let w=C.x-M.x,k=C.y-M.y,N=Math.hypot(w,k)||1,_=w/N,T=k/N,R=-T,G=_,I=4;t.append("path").attr("d",`M${C.x},${C.y} L${C.x-_*I*2+R*I},${C.y-T*I*2+G*I} L${C.x-_*I*2-R*I},${C.y-T*I*2-G*I} Z`).attr("fill",L).attr("opacity",.8)}};for(let E of p){let x=s(E),L=v(E),S=m(E.key);if(E.prev!=null){let A=m(E.prev),C=t.append("line").attr("x1",A.x).attr("y1",A.y).attr("x2",S.x).attr("y2",S.y).attr("stroke",x).attr("stroke-width",bE).attr("stroke-linecap","round").attr("opacity",L);E.ghost&&C.attr("stroke-dasharray","5 5")}if(E.parent!=null){let A=l(E.parent),C=h(A,E),M=m(A.key),w=t.append("path").attr("d",wE(M.x,M.y,C.x,C.y,S.x,S.y,xE)).attr("fill","none").attr("stroke",x).attr("stroke-width",bE).attr("stroke-linecap","round").attr("opacity",L);E.ghost&&w.attr("stroke-dasharray","5 5")}if(E.mergeFrom!=null){let A=l(E.mergeFrom),C=g(A,E),M=m(A.key);t.append("path").attr("d",wE(M.x,M.y,C.x,C.y,S.x,S.y,xE)).attr("fill","none").attr("stroke",s(A)).attr("stroke-width",bE).attr("stroke-linecap","round").attr("opacity",.92*L)}E.cherryFrom!=null&&y(l(E.cherryFrom),E,s(l(E.cherryFrom)),!1),E.revertFrom!=null&&y(l(E.revertFrom),E,x,!1),E.squashFrom!=null&&y(l(E.squashFrom),E,n.textMuted,!0),E.movedTo!=null&&y(E,l(E.movedTo),n.textMuted,!0)}if(!e.options.noLanes)for(let E of e.branches){let x=null;for(let A of p)A.branch===E.name&&(x===null||A.seq<x.seq)&&(x=A);if(!x)continue;let L=m(x.key),S=s(x);r?t.append("text").attr("x",L.x).attr("y",14).attr("text-anchor","middle").attr("font-size",12.5).attr("font-weight",800).attr("fill",S).text(E.name):t.append("text").attr("x",c).attr("y",L.y+4).attr("text-anchor","end").attr("font-size",12.5).attr("font-weight",800).attr("fill",S).text(E.name)}for(let E of p){let x=s(E),L=m(E.key),S=A=>{A.attr("data-line-number",E.lineNumber),A.attr("data-branch",E.branch),f&&A.style("cursor","pointer").on("click",()=>f(E.lineNumber))};if(E.ghost){S(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",Ko-1).attr("fill",n.bg).attr("stroke",x).attr("stroke-width",2).attr("opacity",.4));continue}E.type==="highlight"?S(t.append("rect").attr("x",L.x-Ko).attr("y",L.y-Ko).attr("width",Ko*2).attr("height",Ko*2).attr("rx",3.5).attr("fill",x).attr("stroke",n.bg).attr("stroke-width",3)):E.type==="reverse"?(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",Ko).attr("fill",n.bg).attr("stroke",x).attr("stroke-width",3),S(t.append("path").attr("d",`M${L.x-3.6},${L.y-3.6} L${L.x+3.6},${L.y+3.6} M${L.x+3.6},${L.y-3.6} L${L.x-3.6},${L.y+3.6}`).attr("stroke",x).attr("stroke-width",2).attr("stroke-linecap","round").attr("fill","none"))):E.kind==="merge"?(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",Ko).attr("fill",n.bg).attr("stroke",x).attr("stroke-width",3),S(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",3).attr("fill",x))):S(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",Ko).attr("fill",x).attr("stroke",n.bg).attr("stroke-width",3))}let b=(E,x,L,S,A,C,M,w,k=700)=>{let N=t.append("rect").attr("x",E-L/2).attr("y",x-8.5).attr("width",L).attr("height",17).attr("rx",8.5).attr("fill",A);M&&(N.attr("stroke",M).attr("stroke-width",1.3),w&&N.attr("stroke-dasharray","3 2")),t.append("text").attr("x",E).attr("y",x+4).attr("text-anchor","middle").attr("font-size",10.5).attr("font-weight",k).attr("fill",C).text(S)};for(let E of a){let x=E.node,L=s(x);if(E.leader&&t.append("line").attr("x1",E.leader.x1).attr("y1",E.leader.y1).attr("x2",E.leader.x2).attr("y2",E.leader.y2).attr("stroke",L).attr("stroke-width",1).attr("opacity",.34*v(x)),E.kind==="tag")b(E.x,E.y,E.w,E.label,L,n.bg);else if(E.kind==="head")b(E.x,E.y,E.w,"HEAD",n.text,n.bg,void 0,!1,800);else if(E.kind==="ref")b(E.x,E.y,E.w,E.label,n.bg,L,L,E.remote);else if(E.kind==="note")t.append("circle").attr("cx",E.x).attr("cy",E.y).attr("r",8.5).attr("fill",L),t.append("text").attr("x",E.x).attr("y",E.y+4).attr("text-anchor","middle").attr("font-size",11).attr("fill",n.bg).text(E.label);else if(E.kind==="ab")t.append("text").attr("x",E.x).attr("y",E.y+4).attr("text-anchor","start").attr("font-size",11).attr("font-weight",700).attr("fill",L).text(E.label);else{let S=i.get(x.key),A=x.ghost,C=A?n.textMuted:L,M=E.diag?t.append("text").attr("transform",`translate(${E.x},${E.y}) rotate(${EE})`).attr("font-size",12).attr("opacity",A?.55:1):t.append("text").attr("x",E.x).attr("y",E.y+4).attr("text-anchor",E.anchor).attr("font-size",12).attr("opacity",A?.55:1);S.sha&&M.append("tspan").attr("font-family","ui-monospace, monospace").attr("font-size",11).attr("fill",n.textMuted).text(S.sha+" "),M.append("tspan").attr("fill",C).attr("font-weight",x.kind==="cherry"?400:700).attr("font-style",x.kind==="cherry"?"italic":"normal").text(S.msg)}}if(u&&e.notes.length){let E=u+14;for(let x of e.notes){let L=t.append("text").attr("x",12).attr("y",E).attr("font-size",11.5);L.append("tspan").attr("fill",n.text).attr("font-weight",800).text((KR[x.num-1]??`#${x.num}`)+" "),L.append("tspan").attr("fill",n.textMuted).text(x.text),E+=16}}}function aj(t,e,n,r,o){ZR(t,e,n,r,void 0,o)}var bE,Ko,xE,EE,qR,KR,ej,JR=st(()=>{"use strict";Xn();on();tn();xr();bE=5.5,Ko=8,xE=13,EE=32,qR=19,KR="\u2460\u2461\u2462\u2463\u2464\u2465\u2466\u2467\u2468",ej=40});function ij(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function tI(){return this.eachAfter(ij)}var eI=st(()=>{"use strict"});function nI(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}var rI=st(()=>{"use strict"});function oI(t,e){for(var n=this,r=[n],o,a,i=-1;n=r.pop();)if(t.call(e,n,++i,this),o=n.children)for(a=o.length-1;a>=0;--a)r.push(o[a]);return this}var aI=st(()=>{"use strict"});function iI(t,e){for(var n=this,r=[n],o=[],a,i,s,l=-1;n=r.pop();)if(o.push(n),a=n.children)for(i=0,s=a.length;i<s;++i)r.push(a[i]);for(;n=o.pop();)t.call(e,n,++l,this);return this}var sI=st(()=>{"use strict"});function lI(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}var cI=st(()=>{"use strict"});function dI(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}var uI=st(()=>{"use strict"});function fI(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}var pI=st(()=>{"use strict"});function mI(t){for(var e=this,n=sj(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function sj(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}var hI=st(()=>{"use strict"});function gI(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}var yI=st(()=>{"use strict"});function bI(){return Array.from(this)}var xI=st(()=>{"use strict"});function wI(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}var EI=st(()=>{"use strict"});function SI(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}var vI=st(()=>{"use strict"});function*kI(){var t=this,e,n=[t],r,o,a;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,a=r.length;o<a;++o)n.push(r[o]);while(n.length)}var LI=st(()=>{"use strict"});function Ai(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=dj)):e===void 0&&(e=cj);for(var n=new Yl(t),r,o=[n],a,i,s,l;r=o.pop();)if((i=e(r.data))&&(l=(i=Array.from(i)).length))for(r.children=i,s=l-1;s>=0;--s)o.push(a=i[s]=new Yl(i[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(fj)}function lj(){return Ai(this).eachBefore(uj)}function cj(t){return t.children}function dj(t){return Array.isArray(t)?t[1]:null}function uj(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function fj(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Yl(t){this.data=t,this.depth=this.height=0,this.parent=null}var SE=st(()=>{"use strict";eI();rI();aI();sI();cI();uI();pI();hI();yI();xI();EI();vI();LI();Yl.prototype=Ai.prototype={constructor:Yl,count:tI,each:nI,eachAfter:iI,eachBefore:oI,find:lI,sum:dI,sort:fI,path:mI,ancestors:gI,descendants:bI,leaves:wI,links:SI,copy:lj,[Symbol.iterator]:kI}});function NI(t){if(typeof t!="function")throw new Error;return t}var MI=st(()=>{"use strict"});function ad(){return 0}function id(t){return function(){return t}}var TI=st(()=>{"use strict"});function zh(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}var vE=st(()=>{"use strict"});function Vh(t,e,n,r,o){for(var a=t.children,i,s=-1,l=a.length,c=t.value&&(r-e)/t.value;++s<l;)i=a[s],i.y0=n,i.y1=o,i.x0=e,i.x1=e+=i.value*c}var kE=st(()=>{"use strict"});function LE(){var t=1,e=1,n=0,r=!1;function o(i){var s=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/s,i.eachBefore(a(e,s)),r&&i.eachBefore(zh),i}function a(i,s){return function(l){l.children&&Vh(l,l.x0,i*(l.depth+1)/s,l.x1,i*(l.depth+2)/s);var c=l.x0,d=l.y0,u=l.x1-n,f=l.y1-n;u<c&&(c=u=(c+u)/2),f<d&&(d=f=(d+f)/2),l.x0=c,l.y0=d,l.x1=u,l.y1=f}}return o.round=function(i){return arguments.length?(r=!!i,o):r},o.size=function(i){return arguments.length?(t=+i[0],e=+i[1],o):[t,e]},o.padding=function(i){return arguments.length?(n=+i,o):n},o}var CI=st(()=>{"use strict";vE();kE()});function pj(t,e){return t.parent===e.parent?1:2}function NE(t){var e=t.children;return e?e[0]:t.t}function ME(t){var e=t.children;return e?e[e.length-1]:t.t}function mj(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function hj(t){for(var e=0,n=0,r=t.children,o=r.length,a;--o>=0;)a=r[o],a.z+=e,a.m+=e,e+=a.s+(n+=a.c)}function gj(t,e,n){return t.a.parent===e.parent?t.a:n}function Uh(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function yj(t){for(var e=new Uh(t,0),n,r=[e],o,a,i,s;n=r.pop();)if(a=n._.children)for(n.children=new Array(s=a.length),i=s-1;i>=0;--i)r.push(o=n.children[i]=new Uh(a[i],i)),o.parent=n;return(e.parent=new Uh(null,0)).children=[e],e}function TE(){var t=pj,e=1,n=1,r=null;function o(c){var d=yj(c);if(d.eachAfter(a),d.parent.m=-d.z,d.eachBefore(i),r)c.eachBefore(l);else{var u=c,f=c,p=c;c.eachBefore(function(y){y.x<u.x&&(u=y),y.x>f.x&&(f=y),y.depth>p.depth&&(p=y)});var m=u===f?1:t(u,f)/2,h=m-u.x,g=e/(f.x+m+h),v=n/(p.depth||1);c.eachBefore(function(y){y.x=(y.x+h)*g,y.y=y.depth*v})}return c}function a(c){var d=c.children,u=c.parent.children,f=c.i?u[c.i-1]:null;if(d){hj(c);var p=(d[0].z+d[d.length-1].z)/2;f?(c.z=f.z+t(c._,f._),c.m=c.z-p):c.z=p}else f&&(c.z=f.z+t(c._,f._));c.parent.A=s(c,f,c.parent.A||u[0])}function i(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function s(c,d,u){if(d){for(var f=c,p=c,m=d,h=f.parent.children[0],g=f.m,v=p.m,y=m.m,b=h.m,E;m=ME(m),f=NE(f),m&&f;)h=NE(h),p=ME(p),p.a=c,E=m.z+y-f.z-g+t(m._,f._),E>0&&(mj(gj(m,c,u),c,E),g+=E,v+=E),y+=m.m,g+=f.m,b+=h.m,v+=p.m;m&&!ME(p)&&(p.t=m,p.m+=y-v),f&&!NE(h)&&(h.t=f,h.m+=g-b,u=c)}return u}function l(c){c.x*=e,c.y=c.depth*n}return o.separation=function(c){return arguments.length?(t=c,o):t},o.size=function(c){return arguments.length?(r=!1,e=+c[0],n=+c[1],o):r?null:[e,n]},o.nodeSize=function(c){return arguments.length?(r=!0,e=+c[0],n=+c[1],o):r?[e,n]:null},o}var _I=st(()=>{"use strict";SE();Uh.prototype=Object.create(Yl.prototype)});function AI(t,e,n,r,o){for(var a=t.children,i,s=-1,l=a.length,c=t.value&&(o-n)/t.value;++s<l;)i=a[s],i.x0=e,i.x1=r,i.y0=n,i.y1=n+=i.value*c}var RI=st(()=>{"use strict"});function xj(t,e,n,r,o,a){for(var i=[],s=e.children,l,c,d=0,u=0,f=s.length,p,m,h=e.value,g,v,y,b,E,x,L;d<f;){p=o-n,m=a-r;do g=s[u++].value;while(!g&&u<f);for(v=y=g,x=Math.max(m/p,p/m)/(h*t),L=g*g*x,E=Math.max(y/L,L/v);u<f;++u){if(g+=c=s[u].value,c<v&&(v=c),c>y&&(y=c),L=g*g*x,b=Math.max(y/L,L/v),b>E){g-=c;break}E=b}i.push(l={value:g,dice:p<m,children:s.slice(d,u)}),l.dice?Vh(l,n,r,o,h?r+=m*g/h:a):AI(l,n,r,h?n+=p*g/h:o,a),h-=g,d=u}return i}var bj,hf,CE=st(()=>{"use strict";kE();RI();bj=(1+Math.sqrt(5))/2;hf=(function t(e){function n(r,o,a,i,s){xj(e,r,o,a,i,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(bj)});function _E(){var t=hf,e=!1,n=1,r=1,o=[0],a=ad,i=ad,s=ad,l=ad,c=ad;function d(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(u),o=[0],e&&f.eachBefore(zh),f}function u(f){var p=o[f.depth],m=f.x0+p,h=f.y0+p,g=f.x1-p,v=f.y1-p;g<m&&(m=g=(m+g)/2),v<h&&(h=v=(h+v)/2),f.x0=m,f.y0=h,f.x1=g,f.y1=v,f.children&&(p=o[f.depth+1]=a(f)/2,m+=c(f)-p,h+=i(f)-p,g-=s(f)-p,v-=l(f)-p,g<m&&(m=g=(m+g)/2),v<h&&(h=v=(h+v)/2),t(f,m,h,g,v))}return d.round=function(f){return arguments.length?(e=!!f,d):e},d.size=function(f){return arguments.length?(n=+f[0],r=+f[1],d):[n,r]},d.tile=function(f){return arguments.length?(t=NI(f),d):t},d.padding=function(f){return arguments.length?d.paddingInner(f).paddingOuter(f):d.paddingInner()},d.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:id(+f),d):a},d.paddingOuter=function(f){return arguments.length?d.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):d.paddingTop()},d.paddingTop=function(f){return arguments.length?(i=typeof f=="function"?f:id(+f),d):i},d.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:id(+f),d):s},d.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:id(+f),d):l},d.paddingLeft=function(f){return arguments.length?(c=typeof f=="function"?f:id(+f),d):c},d}var II=st(()=>{"use strict";vE();CE();MI();TI()});var Xh=st(()=>{"use strict";SE();CI();_I();II();CE()});var YI={};ye(YI,{layoutOrg:()=>PE});function Kh(t,e){let n=0;for(let r of t.children){n+=(r.isContainer?0:1)+Kh(r,e);let o=e?.get(r.id);o&&(n+=o)}return n}function gf(t,e){if(!e||e.size===0)return t;let n={};for(let[r,o]of Object.entries(t))e.has(r)||(n[r]=o);return n}function Nj(t,e){let n=_t(t,wj);for(let[r,o]of Object.entries(e)){let a=_t(`${r}: ${o}`,Ej);a>n&&(n=a)}return Math.max(Lj,Math.ceil(n)+kj*2)}function Mj(t){let e=Object.keys(t).length;return e===0?PI+DI:PI+vj+e*Sj+DI}function qh(t,e,n){return t.color?t.color:ar(t.metadata,[...e],n,t.isContainer)}function WI(t,e,n,r,o){return t.map(a=>{let i=gf(a.metadata,n),s=e?.get(a.id);if(!a.isContainer&&o&&!(s!=null&&s>0)){let l=Kh(a,e);l>0&&(i[r??"Sub-node Count"]=String(l))}return{orgNode:a,children:WI(a.children,e,n,r,o),width:Nj(a.label,i),height:Mj(i)}})}function BI(t){let e=0;for(let n of t.children)e+=1+BI(n);return e}function FI(t){for(let i of t.children)FI(i);if(t.children.length<=2)return;let e=t.children.map(i=>({child:i,weight:BI(i)})).sort((i,s)=>s.weight-i.weight),n=new Array(e.length),r=Math.floor((e.length-1)/2),o=r,a=r;for(let i=0;i<e.length;i++){let s=e[i];i===0?n[r]=s.child:i%2===1?(a++,n[a]=s.child):(o--,n[o]=s.child)}t.children=n}function HI(t,e,n){let r=[];for(let o of t){if(o.entries.length===0)continue;let a=n?.get(qt(o.name)),i=a?o.entries.filter(f=>a.has(f.value.toLowerCase())):o.entries;if(i.length===0)continue;let s=We(o.name,sr)+po,l=s,c=0;for(let f of i)c+=wr*2+Nr+We(f.value,Vn)+Kr;let d=e?Mo+wi:0,u=Rn*2+s+4+d+c;r.push({name:o.name,...o.alias!==void 0&&{alias:o.alias},entries:i.map(f=>({value:f.value,color:f.color})),x:0,y:0,width:u,height:Se,minifiedWidth:l,minifiedHeight:Se})}return r}function Tj(t,e){let n=[],r=o=>{n.push(o);for(let a of o.children)r(a)};for(let o of t)r(o);wa(n,e,o=>o.isContainer)}function PE(t,e,n,r,o){if(t.roots.length===0){let $=r!==void 0,U=HI(t.tagGroups,$);if(U.length===0)return{nodes:[],edges:[],containers:[],legend:[],width:0,height:0};let X=Ja,q=0;for(let et of U)et.x=Ja,et.y=X,X+=Se+Wn,et.width>q&&(q=et.width);return{nodes:[],edges:[],containers:[],legend:U,width:q+Ja*2,height:X-Wn+Ja}}Tj(t.roots,t.tagGroups);let a=t.options["sub-node-label"]??void 0,i=["yes","on"].includes(t.options["show-sub-node-count"]?.toLowerCase()??""),s=WI(t.roots,e,r,a,i),l;s.length===1?l=s[0]:l={orgNode:{id:"__virtual_root__",label:"",metadata:{},children:t.roots,parentId:null,isContainer:!1,lineNumber:0},children:s,width:0,height:0};let c=0,d=0,u=[],f=$=>{$.orgNode.id!=="__virtual_root__"&&(u.push($),$.width>c&&(c=$.width),$.height>d&&(d=$.height));for(let U of $.children)f(U)};f(l);for(let $ of u)$.width=c;let p=new Map,m=$=>{for(let U of $.children)m(U);if($.orgNode.isContainer&&$.children.length>0&&$.children.every(U=>U.children.length===0)){let U=`__stack_${$.orgNode.id}`;p.set($.orgNode.id,{children:[...$.children],placeholderId:U});let X=Math.max(...$.children.map(et=>et.width));for(let et of $.children)et.width=X;let q=$.children.reduce((et,tt)=>et+tt.height,0)+($.children.length-1)*$I;$.children=[{orgNode:{id:U,label:"",metadata:{},children:[],parentId:$.orgNode.id,isContainer:!1,lineNumber:0},children:[],width:X,height:q}]}};m(l),FI(l);let h=Ai(l,$=>$.children);TE().nodeSize([c+OI,d+AE])(h);{let $=h.descendants().filter(tt=>tt.data.orgNode.id!=="__virtual_root__"),U=new Map;for(let tt of $){if(tt.data.orgNode.id.startsWith("__stack_"))continue;let F=U.get(tt.depth)??0;tt.data.height>F&&U.set(tt.depth,tt.data.height)}let X=Math.max(...U.keys(),0),q=new Map,et=s.length===1?0:1;q.set(et,0);for(let tt=et+1;tt<=X;tt++){let F=U.get(tt-1)??d,Q=q.get(tt-1)??0;q.set(tt,Q+F+AE)}for(let tt of h.descendants())tt.data.orgNode.id!=="__virtual_root__"&&(tt.y=q.get(tt.depth)??tt.y)}for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||!$.data.orgNode.isContainer||!$.children||$.children.length===0)continue;let X=$.children[0].y-$.y,q=Object.keys($.data.orgNode.metadata).length,tt=RE+q*IE+15,F=X-tt;if(F<=0)continue;let Q=ot=>{if(ot.children)for(let Z of ot.children)Z.y-=F,Q(Z)};Q($)}for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||$.data.orgNode.isContainer||!$.children||$.children.length===0||!$.children.every(Q=>Q.data.orgNode.isContainer))continue;let U=$.y+$.data.height,q=Math.min(...$.children.map(Q=>Q.y))-U,et=AE*.6,tt=q-et;if(tt<=0)continue;let F=Q=>{if(Q.y-=tt,Q.children)for(let ot of Q.children)F(ot)};for(let Q of $.children)F(Q)}{let $=q=>{let et=q.x-q.data.width/2,tt=q.x+q.data.width/2;if(q.children)for(let F of q.children){let Q=$(F);Q.minX<et&&(et=Q.minX),Q.maxX>tt&&(tt=Q.maxX)}return q.data.orgNode.isContainer&&(et-=jh,tt+=jh),{minX:et,maxX:tt}},U=(q,et)=>{q.x+=et,q.children&&q.children.forEach(tt=>U(tt,et))},X=h.descendants().filter(q=>q.children&&q.children.length>=2).sort((q,et)=>et.depth-q.depth);for(let q of X){let et=q.children,tt=et.map(lt=>{let nt=$(lt);return{relLeft:nt.minX-lt.x,relRight:nt.maxX-lt.x}}),F=(et[0].x+et[et.length-1].x)/2,Q=[0];for(let lt=1;lt<et.length;lt++){let nt=Q[lt-1]+tt[lt-1].relRight;Q[lt]=nt+OI-tt[lt].relLeft}let ot=(Q[0]+Q[Q.length-1])/2,Z=F-ot;for(let lt=0;lt<et.length;lt++){let J=Q[lt]+Z-et[lt].x;Math.abs(J)>.001&&U(et[lt],J)}}}{let $=h.descendants().filter(U=>U.children&&U.children.length>=1&&U.data.orgNode.id!=="__virtual_root__").sort((U,X)=>X.depth-U.depth);for(let U of $){let X=U.children.map(et=>et.x),q=(Math.min(...X)+Math.max(...X))/2;U.x=q}}let v=[],y=[],b=1/0,E=-1/0,x=1/0,L=-1/0,S=[];for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||!$.data.orgNode.id.startsWith("__stack_"))continue;let U=$.data.orgNode.id.replace("__stack_",""),X=p.get(U);if(!X)continue;let q=$.y;for(let et of X.children)S.push({orgNode:et.orgNode,width:et.width,height:et.height,cx:$.x,cy:q}),q+=et.height+$I}for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||$.data.orgNode.id.startsWith("__stack_"))continue;let U=$.data.width,X=$.data.height,q=$.x,et=$.y;q-U/2<b&&(b=q-U/2),q+U/2>E&&(E=q+U/2),et<x&&(x=et),et+X>L&&(L=et+X)}for(let $ of S)$.cx-$.width/2<b&&(b=$.cx-$.width/2),$.cx+$.width/2>E&&(E=$.cx+$.width/2),$.cy<x&&(x=$.cy),$.cy+$.height>L&&(L=$.cy+$.height);let A=-b+Ja,C=-x+Ja,M=a??"Sub-node Count";for(let $ of S){let U=e?.get($.orgNode.id),X=gf($.orgNode.metadata,r);if(!$.orgNode.isContainer&&i&&!(U!=null&&U>0)){let tt=Kh($.orgNode,e);tt>0&&(X[M]=String(tt))}let q=qh($.orgNode,t.tagGroups,n??null),et=$.orgNode.children.length>0||U!=null&&U>0||void 0;v.push({id:$.orgNode.id,label:$.orgNode.label,metadata:X,tagMetadata:{...$.orgNode.metadata},isContainer:$.orgNode.isContainer,lineNumber:$.orgNode.lineNumber,...q!==void 0&&{color:q},x:$.cx+A,y:$.cy+C,width:$.width,height:$.height,...U!==void 0&&{hiddenCount:U},...et!==void 0&&{hasChildren:et}})}let w=new Map;for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||$.data.orgNode.id.startsWith("__stack_"))continue;let U=$.data.orgNode,X=$.data.width,q=$.data.height,et=$.x+A,tt=$.y+C,F=e?.get(U.id),Q=gf(U.metadata,r);if(!U.isContainer&&i&&!(F!=null&&F>0)){let nt=Kh(U,e);nt>0&&(Q[M]=String(nt))}let ot=qh(U,t.tagGroups,n??null),Z=$.children!=null&&$.children.length>0||F!=null&&F>0||void 0;v.push({id:U.id,label:U.label,metadata:Q,tagMetadata:{...U.metadata},isContainer:U.isContainer,lineNumber:U.lineNumber,...ot!==void 0&&{color:ot},x:et,y:tt,width:X,height:q,...F!==void 0&&{hiddenCount:F},...Z!==void 0&&{hasChildren:Z}});let lt=$.parent?.data.orgNode.isContainer&&$.parent.children&&$.parent.children.length>0;if($.parent&&$.parent.data.orgNode.id!=="__virtual_root__"&&!lt){let nt=$.parent.data.orgNode.id;if(!w.has(nt)){let J=$.parent.x+A,at=$.parent.y+C,it=$.parent.data.height;w.set(nt,{parentX:J,parentBottomY:at+it,children:[]})}w.get(nt).children.push({id:U.id,x:et,topY:tt})}}for(let[$,U]of w){let{parentX:X,parentBottomY:q,children:et}=U;if(et.length===1){let tt=et[0],F=(q+tt.topY)/2;y.push({sourceId:$,targetId:tt.id,points:[{x:X,y:q},{x:X,y:F},{x:tt.x,y:F},{x:tt.x,y:tt.topY}]})}else{let tt=(q+et[0].topY)/2,F=et.map(Z=>Z.x),Q=Math.min(...F),ot=Math.max(...F);y.push({sourceId:$,targetId:$,points:[{x:X,y:q},{x:X,y:tt}]}),y.push({sourceId:$,targetId:$,points:[{x:Q,y:tt},{x:ot,y:tt}]});for(let Z of et)y.push({sourceId:$,targetId:Z.id,points:[{x:Z.x,y:tt},{x:Z.x,y:Z.topY}]})}}let k=h.descendants().filter($=>$.data.orgNode.id!=="__virtual_root__"&&$.data.orgNode.isContainer),N=new Map,_=[],T=60;for(let $ of k){if($.children&&$.children.length>0)continue;let U=$.x+A,X=$.y+C,q=Object.keys($.data.orgNode.metadata).length,et=RE+q*IE,tt=$.data.width,F=Math.max(et+GI,T),Q=U-tt/2,ot=X;N.set($.data.orgNode.id,{minX:Q,maxX:Q+tt,minY:ot,maxY:ot+F});let Z=e?.get($.data.orgNode.id),lt=gf($.data.orgNode.metadata,r),nt=qh($.data.orgNode,t.tagGroups,n??null),J=Z!=null&&Z>0||void 0;_.push({nodeId:$.data.orgNode.id,label:$.data.orgNode.label,lineNumber:$.data.orgNode.lineNumber,...nt!==void 0&&{color:nt},metadata:lt,tagMetadata:{...$.data.orgNode.metadata},x:Q,y:ot,width:tt,height:F,labelHeight:et,...Z!==void 0&&{hiddenCount:Z},...J!==void 0&&{hasChildren:J}})}let R=k.filter($=>$.children&&$.children.length>0);R.sort(($,U)=>U.depth-$.depth);for(let $ of R){let U=[],X=pt=>{if(pt.children)for(let ht of pt.children)U.push(ht),X(ht)};if(X($),U.length===0)continue;let q=1/0,et=-1/0,tt=-1/0;for(let pt of U){let ht=N.get(pt.data.orgNode.id);if(ht)ht.minX<q&&(q=ht.minX),ht.maxX>et&&(et=ht.maxX),ht.maxY>tt&&(tt=ht.maxY);else if(pt.data.orgNode.id.startsWith("__stack_")){let dt=pt.data.orgNode.id.replace("__stack_","");if(p.get(dt))for(let yt of S){if(yt.orgNode.parentId!==dt)continue;let kt=yt.cx+A,Ot=yt.cy+C;kt-yt.width/2<q&&(q=kt-yt.width/2),kt+yt.width/2>et&&(et=kt+yt.width/2),Ot+yt.height>tt&&(tt=Ot+yt.height)}}else{let dt=pt.data.width,ut=pt.data.height,yt=pt.x+A,kt=pt.y+C;yt-dt/2<q&&(q=yt-dt/2),yt+dt/2>et&&(et=yt+dt/2),kt+ut>tt&&(tt=kt+ut)}}let F=$.x+A,Q=$.y+C,ot=Object.keys($.data.orgNode.metadata).length,Z=RE+ot*IE,lt=Q,nt=tt-Q+GI,J=q-jh,at=et-q+jh*2,it=Math.max(at,$.data.width),vt=it>at?F-it/2:J;N.set($.data.orgNode.id,{minX:vt,maxX:vt+it,minY:lt,maxY:lt+nt});let Tt=e?.get($.data.orgNode.id),At=gf($.data.orgNode.metadata,r),rt=qh($.data.orgNode,t.tagGroups,n??null);_.push({nodeId:$.data.orgNode.id,label:$.data.orgNode.label,lineNumber:$.data.orgNode.lineNumber,...rt!==void 0&&{color:rt},metadata:At,tagMetadata:{...$.data.orgNode.metadata},x:vt,y:lt,width:it,height:nt,labelHeight:Z,...Tt!==void 0&&{hiddenCount:Tt},hasChildren:!0})}_.reverse();let G=b,I=E,H=L;for(let $ of _){let U=$.x-A,X=U+$.width,q=$.y-C+$.height;U<G&&(G=U),X>I&&(I=X),q>H&&(H=q)}let O=I-G+Ja*2,D=H-x+Ja*2,W=new Map;for(let $ of t.tagGroups){let U=qt($.name),X=new Set,q=et=>{!et.isContainer&&et.metadata[U]&&X.add(et.metadata[U].toLowerCase());for(let tt of et.children)q(tt)};for(let et of t.roots)q(et);W.set(U,X)}let z=r!==void 0,P=HI(t.tagGroups,z,W),B=O,Y=D,V=n!=null?P.filter($=>$.name.toLowerCase()===n.toLowerCase()):P,j=o&&n==null,K=$=>n!=null||j?$.width:$.minifiedWidth;if(V.length>0){let $=Se+Wn;for(let et of v)et.y+=$;for(let et of _)et.y+=$;for(let et of y)for(let tt of et.points)tt.y+=$;let U=V.reduce((et,tt)=>et+K(tt),0)+(V.length-1)*Wn,X=Ja;for(let et of V)et.x=X,et.y=Ja,X+=K(et)+Wn;Y+=$;let q=U+Ja*2;q>B&&(B=q)}return{nodes:v,edges:y,containers:_,legend:P,width:B,height:Y}}var wj,Ej,Sj,PI,vj,kj,DI,Lj,OI,AE,Ja,jh,GI,RE,IE,$I,DE=st(()=>{"use strict";Ke();Xh();Ke();Mr();en();wj=13,Ej=11,Sj=16,PI=28,vj=6,kj=20,DI=10,Lj=140,OI=30,AE=50,Ja=40,jh=24,GI=24,RE=28,IE=16,$I=20});function zI(t,e){let n=0;for(let r of e.getChildren(t))n+=(e.countsAsHidden(r)?1:0)+zI(r,e);return n}function VI(t,e,n,r){for(let o of t){let a=r.getChildren(o);e.has(r.getId(o))&&a.length>0&&n.set(r.getId(o),zI(o,r)),VI(a,e,n,r)}}function UI(t,e,n){for(let r of n.getChildren(t))UI(r,e,n);e.has(n.getId(t))&&n.getChildren(t).length>0&&n.setChildren(t,[])}function sd(t,e,n){let r=new Map;VI(t,e,r,n);let o=t.map(a=>n.clone(a));for(let a of o)UI(a,e,n);return{roots:o,hiddenCounts:r}}function XI(t,e){let n=new Set,r=o=>{for(let a of o)n.add(e.getId(a)),r(e.getChildren(a))};return r(t),n}var yf=st(()=>{"use strict"});var qI={};ye(qI,{collapseOrgTree:()=>_j,focusOrgTree:()=>Aj});function Zh(t){return{id:t.id,label:t.label,metadata:{...t.metadata},children:t.children.map(Zh),parentId:t.parentId,isContainer:t.isContainer,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color}}}function _j(t,e){if(e.size===0)return{parsed:t,hiddenCounts:new Map};let{roots:n,hiddenCounts:r}=sd(t.roots,e,Cj);return{parsed:{...t,roots:n},hiddenCounts:r}}function jI(t,e,n){for(let r of t){if(r.id===e)return{node:r,path:n};let o=jI(r.children,e,[...n,{id:r.id,label:r.label,lineNumber:r.lineNumber,...r.color!==void 0&&{color:r.color},metadata:{...r.metadata},isContainer:r.isContainer}]);if(o)return o}return null}function Aj(t,e){let n=jI(t.roots,e,[]);if(!n)return null;if(t.roots.some(a=>a.id===e))return{parsed:{...t,roots:[Zh(n.node)]},ancestorPath:[]};let o=Zh(n.node);return o.parentId=null,{parsed:{...t,roots:[o]},ancestorPath:n.path}}var Cj,KI=st(()=>{"use strict";yf();Cj={getId:t=>t.id,getChildren:t=>t.children,clone:Zh,setChildren:(t,e)=>{t.children=e},countsAsHidden:t=>!t.isContainer}});function ld(t,e,n){let r=document.createElement("div");r.style.width=`${t}px`,r.style.height=`${e}px`,r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);try{return n(r)}finally{document.body.removeChild(r)}}function cd(t,e){let n=t.querySelector("svg");return n?(e==="transparent"&&(n.style.background="none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.style.fontFamily=It,n.querySelectorAll("[data-export-ignore]").forEach(r=>r.remove()),n.outerHTML):""}var Qh=st(()=>{"use strict";on()});var nP={};ye(nP,{renderOrg:()=>eP,renderOrgForExport:()=>Yj});function Bj(t,e,n,r){let o=n??t.primary;return ie(t,o,e,{...r!==void 0&&{solid:r}})}function ZI(t,e){return e??t.primary}function Fj(t,e,n){return n?Gt(n,nr(t,e),10):Gt(t.surface,t.bg,40)}function QI(t,e){return e??t.textMuted}function eP(t,e,n,r,o,a,i,s,l,c,d){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let u=i?.width??t.clientWidth,f=i?.height??t.clientHeight;if(u<=0||f<=0)return;let p=Ee.identity(),m=p.aesthetic(OE),h=p.structural(tP),g=p.text(13),v=p.text(11),y=p.structural(16),b=p.structural(28),E=p.structural(6),x=p.structural(1.5),L=p.structural(1.5),S=p.structural(6),A=p.structural(8),C=p.text(13),M=p.text(11),w=p.structural(16),k=p.structural(28),N=p.structural(6),_=p.structural(0),T=p.structural(Oj),R=p.text(Gj),G=p.structural($j),I=p.structural(Hj),H=p.aesthetic(Wj),O=!!e.title&&e.options["no-title"]!=="on",D=O?h:0,W=n.nodes.length===0,z=n.legend.length>0,P=Se+Wn,B=!i&&z&&!W,Y=B?Tr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview",capsulePillAddonWidth:Mo+wi},u)+H:0,V=!i&&O,j=V?h:0,K=!i&&c&&c.length>0,$=K?c.length*G+I:0,U=n.width,X=n.height+(V?0:D)+$;B&&(X-=P);let q=f-m*2-Y-j,et=(u-m*2)/U,tt=q/X,F=Math.min(Dj,et,tt),Q=U*F,ot=(u-Q)/2,Z=B?m+Y+j:m+j,lt=Rt(t).append("svg").attr("width",u).attr("height",f).attr("viewBox",`0 0 ${u} ${f}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It);p.isBelowFloor&&lt.attr("width","100%");let nt=lt.append("g").attr("transform",`translate(${ot}, ${Z}) scale(${F})`);if(O){let rt=V?lt:nt,pt=V?u/2:U/2,ht=V?m+20:20,dt=rt.append("text").attr("x",pt).attr("y",ht).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",20).attr("font-weight","700").attr("class","org-title chart-title").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(dt.attr("data-line-number",e.titleLineNumber),a&&dt.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){Rt(this).attr("opacity",.7)}).on("mouseleave",function(){Rt(this).attr("opacity",1)}))}let J=(V?0:D)+$,at=nt.append("g").attr("transform",`translate(0, ${J})`),it=new Map;for(let rt of e.tagGroups)it.set(qt(rt.name),rt.name);let vt=new Set(e.roots.map(rt=>rt.id)),Tt=e.options?.color==="off";for(let rt of n.containers){let pt=at.append("g").attr("transform",`translate(${rt.x}, ${rt.y})`).attr("class","org-container").attr("data-line-number",String(rt.lineNumber));if(s){let yt=qt(s),kt=rt.tagMetadata[yt];kt&&pt.attr(`data-tag-${yt}`,kt.toLowerCase())}rt.hasChildren&&pt.attr("data-node-toggle",rt.nodeId).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!rt.hiddenCount)).attr("aria-label",rt.label),a&&pt.style("cursor","pointer").on("click",()=>{a(rt.lineNumber)});let ht=Fj(r,o,Tt?void 0:rt.color),dt=QI(r,Tt?void 0:rt.color);pt.append("rect").attr("x",0).attr("y",0).attr("width",rt.width).attr("height",rt.height).attr("rx",A).attr("fill",ht).attr("stroke",dt).attr("stroke-opacity",.35).attr("stroke-width",L),pt.append("text").attr("x",rt.width/2).attr("y",k/2+C/2-2).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",C).attr("font-weight","bold").text(rt.label);let ut=Object.entries(rt.metadata);if(ut.length>0){let yt=ut.map(([bt])=>it.get(bt)??bt),Ot=10+Math.max(...yt.map(bt=>_t(`${bt}: `,M))),Xt=k+M-2;for(let bt=0;bt<ut.length;bt++){let[,Nt]=ut[bt],Vt=yt[bt],xt=Xt+bt*w;pt.append("text").attr("x",10).attr("y",xt).attr("fill",r.textMuted).attr("font-size",M).text(`${Vt}: `),pt.append("text").attr("x",Ot).attr("y",xt).attr("fill",r.text).attr("font-size",M).text(Nt)}}if(!i&&rt.hiddenCount&&rt.hiddenCount>0&&lE(pt,{width:rt.width,height:rt.height,barHeight:N,inset:_,rx:A,fill:QI(r,Tt?void 0:rt.color),clipId:`clip-${rt.nodeId}`,className:"org-collapse-bar"}),!i&&rt.hasChildren&&!vt.has(rt.nodeId)){let Ot=rt.width-14-5,bt=pt.append("g").attr("class","org-focus-icon").attr("data-focus-node",rt.nodeId).attr("data-export-ignore","true").attr("transform",`translate(${Ot}, 5)`);bt.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let Nt=ve(ht,r.textOnFillLight,r.textOnFillDark),Vt=14/2,xt=14/2;bt.append("circle").attr("cx",Vt).attr("cy",xt).attr("r",14/2-1).attr("fill","none").attr("stroke",Nt).attr("stroke-width",1.5),bt.append("circle").attr("cx",Vt).attr("cy",xt).attr("r",2).attr("fill",Nt)}}for(let rt of n.edges){if(rt.points.length<2)continue;let pt=[];pt.push(`M ${rt.points[0].x} ${rt.points[0].y}`);for(let ht=1;ht<rt.points.length;ht++)pt.push(`L ${rt.points[ht].x} ${rt.points[ht].y}`);at.append("path").attr("d",pt.join(" ")).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",x).attr("class","org-edge").attr("data-from",rt.sourceId).attr("data-to",rt.targetId)}let At=new Set(n.containers.map(rt=>rt.nodeId));for(let rt of n.nodes){if(At.has(rt.id))continue;let pt=at.append("g").attr("transform",`translate(${rt.x-rt.width/2}, ${rt.y})`).attr("class","org-node").attr("data-line-number",String(rt.lineNumber)).attr("data-node-id",rt.id);if(s){let Ot=qt(s),Xt=rt.tagMetadata[Ot];Xt&&pt.attr(`data-tag-${Ot}`,Xt.toLowerCase())}rt.hasChildren&&pt.attr("data-node-toggle",rt.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!rt.hiddenCount)).attr("aria-label",rt.label),a&&pt.style("cursor","pointer").on("click",()=>{a(rt.lineNumber)});let ht=e.options["solid-fill"]==="on",dt=Bj(r,o,Tt?void 0:rt.color,ht),ut=ZI(r,Tt?void 0:rt.color),yt=ve(dt,r.textOnFillLight,r.textOnFillDark),kt=Object.entries(rt.metadata);if(rd(pt,{width:rt.width,height:rt.height,rx:S,fill:dt,stroke:ut,strokeWidth:L,...rt.isContainer&&{dashed:!0},label:rt.label,labelColor:yt,labelFontSize:g,headerHeight:b,...kt.length>0&&{meta:{rows:kt.map(([Ot,Xt])=>[it.get(Ot)??Ot,Xt]),fontSize:v,lineHeight:y,separatorGap:E,separatorColor:ht?yt:ut,textColor:yt}}}),!i&&rt.hiddenCount&&rt.hiddenCount>0&&lE(pt,{width:rt.width,height:rt.height,barHeight:N,inset:_,rx:S,fill:ht?yt:ZI(r,Tt?void 0:rt.color),clipId:`clip-${rt.id}`,className:"org-collapse-bar"}),!i&&rt.hasChildren&&!vt.has(rt.id)){let bt=rt.width-14-5,Vt=pt.append("g").attr("class","org-focus-icon").attr("data-focus-node",rt.id).attr("data-export-ignore","true").attr("transform",`translate(${bt}, 5)`);Vt.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let xt=yt,Lt=14/2,Dt=14/2;Vt.append("circle").attr("cx",Lt).attr("cy",Dt).attr("r",14/2-1).attr("fill","none").attr("stroke",xt).attr("stroke-width",1.5),Vt.append("circle").attr("cx",Lt).attr("cy",Dt).attr("r",2).attr("fill",xt)}}if(K){let rt=n.nodes.find(ut=>vt.has(ut.id)),pt=rt?null:n.containers.find(ut=>vt.has(ut.nodeId)),ht=rt?rt.x:pt?pt.x+pt.width/2:null,dt=rt?rt.y:pt?pt.y:null;if(ht!==null&&dt!==null){let ut=dt-I,yt=at.append("g").attr("class","org-ancestor-trail"),kt=c.length,Ot=[];for(let bt=0;bt<kt;bt++){let Nt=kt-1-bt;Ot.push(ut-Nt*G)}let Xt=Ot[0];yt.append("line").attr("x1",ht).attr("y1",Xt).attr("x2",ht).attr("y2",dt).attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-opacity",.4);for(let bt=0;bt<kt;bt++){let Nt=c[bt],Vt=Ot[bt],Lt=Nt.color??ar(Nt.metadata,[...e.tagGroups],s??null,Nt.isContainer)??r.textMuted,Dt=yt.append("g").attr("class","org-ancestor-node").attr("data-focus-ancestor",Nt.id).style("cursor","pointer").attr("transform",`translate(${ht}, ${Vt})`);Dt.append("rect").attr("x",-T-2).attr("y",-T-2).attr("width",120).attr("height",T*2+4).attr("fill","transparent"),Dt.append("circle").attr("cx",0).attr("cy",0).attr("r",T).attr("fill",Lt),Dt.append("text").attr("x",T+6).attr("y",R*.35).attr("fill",r.textMuted).attr("font-size",R).text(Nt.label),Dt.on("mouseenter",function(){Rt(this).select("circle").attr("r",T+1),Rt(this).select("text").attr("fill",r.text)}).on("mouseleave",function(){Rt(this).select("circle").attr("r",T),Rt(this).select("text").attr("fill",r.textMuted)})}}}if(B||W||i&&z){let rt=n.legend.map(ut=>({name:ut.name,entries:ut.entries.map(yt=>({value:yt.value,color:yt.color}))})),pt=B?Mo+wi:0,ht=B?lt.append("g").attr("class","org-legend-fixed").attr("transform",`translate(0, ${m+j})`):at.append("g"),dt;if(W){for(let ut of n.legend){let yt={groups:[{name:ut.name,entries:ut.entries.map(Ot=>({value:Ot.value,color:Ot.color}))}],position:{placement:"top-center",titleRelation:"below-title"},mode:d?"export":"preview"},kt=ht.append("g").attr("transform",`translate(${ut.x}, ${ut.y})`);fn(kt,{...yt,palette:r,isDark:o,width:ut.width,activeGroup:ut.name}),kt.selectAll("[data-legend-group]").classed("org-legend-group",!0)}dt=null}else dt=fn(ht,{...{groups:rt,position:{placement:"top-center",titleRelation:"below-title"},mode:d?"export":"preview",capsulePillAddonWidth:pt},palette:r,isDark:o,width:B?u:n.width,activeGroup:s??null}),ht.selectAll("[data-legend-group]").classed("org-legend-group",!0);if(B&&dt){let ut=dt.getLayout();if(ut.activeCapsule?.addonX!=null){let yt=ut.activeCapsule,kt=qt(yt.groupName),Ot=l?.has(kt)??!1,Xt=ht.select(`[data-legend-group="${kt}"]`);if(!Xt.empty()){let bt=yt.addonX,Nt=(Se-Mo)/2,Vt=6,xt=Xt.append("g").attr("class","org-legend-eye").attr("data-legend-visibility",kt).style("cursor","pointer").attr("opacity",Ot?.4:.7);xt.append("rect").attr("x",bt-Vt).attr("y",Nt-Vt).attr("width",Mo+Vt*2).attr("height",Mo+Vt*2).attr("fill","transparent").attr("pointer-events","all"),xt.append("path").attr("d",Ot?Dm:Pm).attr("transform",`translate(${bt}, ${Nt})`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.2).attr("stroke-linecap","round").attr("stroke-linejoin","round")}}}}}function Yj(t,e,n){let r=zc(t,n);if(r.error)return"";let o=r.options?.hide,a=o?new Set(o.split(",").map(u=>u.trim().toLowerCase())):void 0,i=PE(r,void 0,void 0,a),s=e==="dark",l=r.title&&r.options["no-title"]!=="on"?tP:0,c=i.width+OE*2,d=i.height+OE*2+l;return ld(c,d,u=>(eP(u,r,i,n,s,void 0,{width:c,height:d}),cd(u,e)))}var OE,Dj,tP,Oj,Gj,$j,Hj,Wj,rP=st(()=>{"use strict";Ke();Xn();on();Qh();fr();tn();Ke();Qu();DE();Mr();Br();Oh();en();To();OE=20,Dj=3,tP=30,Oj=4,Gj=11,$j=22,Hj=16,Wj=8});function oP(t,e){t[e]?t[e]++:t[e]=1}function aP(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function bf(t,e,n,r){let o=""+e,a=""+n;if(!t&&o>a){let i=o;o=a,a=i}return o+""+a+""+(r===void 0?"\0":r)}function jj(t,e,n,r){let o=""+e,a=""+n;if(!t&&o>a){let s=o;o=a,a=s}let i={v:o,w:a};return r&&(i.name=r),i}function HE(t,e){return bf(t,e.v,e.w,e.name)}function Kj(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Zj(t),edges:Qj(t)},n=t.graph();return n!==void 0&&(e.value=structuredClone(n)),e}function Zj(t){return t.nodes().map(e=>{let n=t.node(e),r=t.parent(e),o={v:e};return n!==void 0&&(o.value=n),r!==void 0&&(o.parent=r),o})}function Qj(t){return t.edges().map(e=>{let n=t.edge(e),r={v:e.v,w:e.w};return e.name!==void 0&&(r.name=e.name),n!==void 0&&(r.value=n),r})}function Jj(t){let e=new La(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(n=>{e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),t.edges.forEach(n=>{e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}function EP(t,e,n,r){return eq(t,String(e),n||tq,r||function(o){return t.outEdges(o)})}function eq(t,e,n,r){let o={},a,i=0,s=t.nodes(),l=function(u){let f=n(u);o[u.v].distance+f<o[u.w].distance&&(o[u.w]={distance:o[u.v].distance+f,predecessor:u.v},a=!0)},c=function(){s.forEach(function(u){r(u).forEach(function(f){let p=f.v===u?f.v:f.w,m=p===f.v?f.w:f.v;l({v:p,w:m})})})};s.forEach(function(u){let f=u===e?0:Number.POSITIVE_INFINITY;o[u]={distance:f,predecessor:""}});let d=s.length;for(let u=1;u<d&&(a=!1,i++,c(),!!a);u++);if(i===d-1&&(a=!1,c(),a))throw new Error("The graph contains a negative weight cycle");return o}function nq(t){let e={},n=[],r;function o(a){a in e||(e[a]=!0,r.push(a),t.successors(a).forEach(o),t.predecessors(a).forEach(o))}return t.nodes().forEach(function(a){r=[],o(a),r.length&&n.push(r)}),n}function tg(t,e,n,r){let o=function(a){return t.outEdges(a)};return oq(t,String(e),n||rq,r||o)}function oq(t,e,n,r){let o={},a=new SP,i,s,l=function(c){let d=c.v!==i?c.v:c.w,u=o[d],f=n(c),p=s.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+f);p<u.distance&&(u.distance=p,u.predecessor=i,a.decrease(d,p))};for(t.nodes().forEach(function(c){let d=c===e?0:Number.POSITIVE_INFINITY;o[c]={distance:d,predecessor:""},a.add(c,d)});a.size()>0&&(i=a.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(l);return o}function aq(t,e,n){return t.nodes().reduce(function(r,o){return r[o]=tg(t,o,e,n),r},{})}function vP(t){let e=0,n=[],r={},o=[];function a(i){let s=r[i]={onStack:!0,lowlink:e,index:e++};if(n.push(i),t.successors(i).forEach(function(l){l in r?r[l].onStack&&(s.lowlink=Math.min(s.lowlink,r[l].index)):(a(l),s.lowlink=Math.min(s.lowlink,r[l].lowlink))}),s.lowlink===s.index){let l=[],c;do c=n.pop(),r[c].onStack=!1,l.push(c);while(i!==c);o.push(l)}}return t.nodes().forEach(function(i){i in r||a(i)}),o}function iq(t){return vP(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}function lq(t,e,n){return cq(t,e||sq,n||function(r){return t.outEdges(r)})}function cq(t,e,n){let r={},o=t.nodes();return o.forEach(function(a){r[a]={},r[a][a]={distance:0,predecessor:""},o.forEach(function(i){a!==i&&(r[a][i]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(a).forEach(function(i){let s=i.v===a?i.w:i.v,l=e(i);r[a][s]={distance:l,predecessor:a}})}),o.forEach(function(a){let i=r[a];o.forEach(function(s){let l=r[s];o.forEach(function(c){let d=l[a],u=i[c],f=l[c],p=d.distance+u.distance;p<f.distance&&(f.distance=p,f.predecessor=u.predecessor)})})}),r}function kP(t){let e={},n={},r=[];function o(a){if(a in n)throw new eg;a in e||(n[a]=!0,e[a]=!0,t.predecessors(a).forEach(o),delete n[a],r.push(a))}if(t.sinks().forEach(o),Object.keys(e).length!==t.nodeCount())throw new eg;return r}function dq(t){try{kP(t)}catch(e){if(e instanceof eg)return!1;throw e}return!0}function uq(t,e,n,r,o){Array.isArray(e)||(e=[e]);let a=(s=>{var l;return(l=t.isDirected()?t.successors(s):t.neighbors(s))!=null?l:[]}),i={};return e.forEach(function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);o=LP(t,s,n==="post",i,a,r,o)}),o}function LP(t,e,n,r,o,a,i){return e in r||(r[e]=!0,n||(i=a(i,e)),o(e).forEach(function(s){i=LP(t,s,n,r,o,a,i)}),n&&(i=a(i,e))),i}function NP(t,e,n){return uq(t,e,n,function(r,o){return r.push(o),r},[])}function fq(t,e){return NP(t,e,"post")}function pq(t,e){return NP(t,e,"pre")}function mq(t,e){let n=new La,r={},o=new SP,a;function i(l){let c=l.v===a?l.w:l.v,d=o.priority(c);if(d!==void 0){let u=e(l);u<d&&(r[c]=a,o.decrease(c,u))}}if(t.nodeCount()===0)return n;t.nodes().forEach(function(l){o.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),o.decrease(t.nodes()[0],0);let s=!1;for(;o.size()>0;){if(a=o.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(a).forEach(i)}return n}function hq(t,e,n,r){return gq(t,e,n,r??(o=>{let a=t.outEdges(o);return a??[]}))}function gq(t,e,n,r){if(n===void 0)return tg(t,e,n,r);let o=!1,a=t.nodes();for(let i=0;i<a.length;i++){let s=r(a[i]);for(let l=0;l<s.length;l++){let c=s[l],d=c.v===a[i]?c.v:c.w,u=d===c.v?c.w:c.v;n({v:d,w:u})<0&&(o=!0)}if(o)return EP(t,e,n,r)}return tg(t,e,n,r)}function pd(t,e,n,r){let o=r;for(;t.hasNode(o);)o=XE(r);return n.dummy=e,t.setNode(o,n),o}function yq(t){let e=new La().setGraph(t.graph());return t.nodes().forEach(n=>e.setNode(n,t.node(n))),t.edges().forEach(n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),e}function MP(t){let e=new La({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(n=>{t.children(n).length||e.setNode(n,t.node(n))}),t.edges().forEach(n=>{e.setEdge(n,t.edge(n))}),e}function iP(t,e){let n=t.x,r=t.y,o=e.x-n,a=e.y-r,i=t.width/2,s=t.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(a)*i>Math.abs(o)*s?(a<0&&(s=-s),l=s*o/a,c=s):(o<0&&(i=-i),l=i,c=i*a/o),{x:n+l,y:r+c}}function wf(t){let e=xf(CP(t)+1).map(()=>[]);return t.nodes().forEach(n=>{let r=t.node(n),o=r.rank;o!==void 0&&(e[o]||(e[o]=[]),e[o][r.order]=n)}),e}function bq(t){let e=t.nodes().map(r=>{let o=t.node(r).rank;return o===void 0?Number.MAX_VALUE:o}),n=Ri(Math.min,e);t.nodes().forEach(r=>{let o=t.node(r);Object.hasOwn(o,"rank")&&(o.rank-=n)})}function xq(t){let e=t.nodes().map(i=>t.node(i).rank).filter(i=>i!==void 0),n=Ri(Math.min,e),r=[];t.nodes().forEach(i=>{let s=t.node(i).rank-n;r[s]||(r[s]=[]),r[s].push(i)});let o=0,a=t.graph().nodeRankFactor;Array.from(r).forEach((i,s)=>{i===void 0&&s%a!==0?--o:i!==void 0&&o&&i.forEach(l=>t.node(l).rank+=o)})}function sP(t,e,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),pd(t,"border",o,e)}function wq(t,e=TP){let n=[];for(let r=0;r<t.length;r+=e){let o=t.slice(r,r+e);n.push(o)}return n}function Ri(t,e){if(e.length>TP){let n=wq(e);return t(...n.map(r=>t(...r)))}else return t(...e)}function CP(t){let e=t.nodes().map(n=>{let r=t.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return Ri(Math.max,e)}function Eq(t,e){let n={lhs:[],rhs:[]};return t.forEach(r=>{e(r)?n.lhs.push(r):n.rhs.push(r)}),n}function _P(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}}function AP(t,e){return e()}function XE(t){let e=++Sq;return t+(""+e)}function xf(t,e,n=1){e==null&&(e=t,t=0);let r=a=>a<e;n<0&&(r=a=>e<a);let o=[];for(let a=t;r(a);a+=n)o.push(a);return o}function ng(t,e){let n={};for(let r of e)t[r]!==void 0&&(n[r]=t[r]);return n}function rg(t,e){let n;return typeof e=="string"?n=r=>r[e]:n=e,Object.entries(t).reduce((r,[o,a])=>(r[o]=n(a,o),r),{})}function vq(t,e){return t.reduce((n,r,o)=>(n[r]=e[o],n),{})}function lP(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Nq(t,e){if(t!=="_next"&&t!=="_prev")return e}function Cq(t,e){if(t.nodeCount()<=1)return[];let n=Aq(t,e||Tq);return _q(n.graph,n.buckets,n.zeroIdx).flatMap(r=>t.outEdges(r.v,r.w)||[])}function _q(t,e,n){var r;let o=[],a=e[e.length-1],i=e[0],s;for(;t.nodeCount();){for(;s=i.dequeue();)WE(t,e,n,s);for(;s=a.dequeue();)WE(t,e,n,s);if(t.nodeCount()){for(let l=e.length-2;l>0;--l)if(s=(r=e[l])==null?void 0:r.dequeue(),s){o=o.concat(WE(t,e,n,s,!0)||[]);break}}}return o}function WE(t,e,n,r,o){let a=[],i=o?a:void 0;return(t.inEdges(r.v)||[]).forEach(s=>{let l=t.edge(s),c=t.node(s.v);o&&a.push({v:s.v,w:s.w}),c.out-=l,VE(e,n,c)}),(t.outEdges(r.v)||[]).forEach(s=>{let l=t.edge(s),c=s.w,d=t.node(c);d.in-=l,VE(e,n,d)}),t.removeNode(r.v),i}function Aq(t,e){let n=new La,r=0,o=0;t.nodes().forEach(s=>{n.setNode(s,{v:s,in:0,out:0})}),t.edges().forEach(s=>{let l=n.edge(s.v,s.w)||0,c=e(s),d=l+c;n.setEdge(s.v,s.w,d);let u=n.node(s.v),f=n.node(s.w);o=Math.max(o,u.out+=c),r=Math.max(r,f.in+=c)});let a=Rq(o+r+3).map(()=>new Mq),i=r+1;return n.nodes().forEach(s=>{VE(a,i,n.node(s))}),{graph:n,buckets:a,zeroIdx:i}}function VE(t,e,n){var r,o,a;n.out?n.in?(a=t[n.out-n.in+e])==null||a.enqueue(n):(o=t[t.length-1])==null||o.enqueue(n):(r=t[0])==null||r.enqueue(n)}function Rq(t){let e=[];for(let n=0;n<t;n++)e.push(n);return e}function Iq(t){(t.graph().acyclicer==="greedy"?Cq(t,e(t)):Pq(t)).forEach(n=>{let r=t.edge(n);t.removeEdge(n),r.forwardName=n.name,r.reversed=!0,t.setEdge(n.w,n.v,r,XE("rev"))});function e(n){return r=>n.edge(r).weight}}function Pq(t){let e=[],n={},r={};function o(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,t.outEdges(a).forEach(i=>{Object.hasOwn(n,i.w)?e.push(i):o(i.w)}),delete n[a])}return t.nodes().forEach(o),e}function Dq(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}})}function Oq(t){t.graph().dummyChains=[],t.edges().forEach(e=>Gq(t,e))}function Gq(t,e){let n=e.v,r=t.node(n).rank,o=e.w,a=t.node(o).rank,i=e.name,s=t.edge(e),l=s.labelRank;if(a===r+1)return;t.removeEdge(e);let c,d,u;for(u=0,++r;r<a;++u,++r)s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},c=pd(t,"edge",d,"_d"),r===l&&(d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos),t.setEdge(n,c,{weight:s.weight},i),u===0&&t.graph().dummyChains.push(c),n=c;t.setEdge(n,o,{weight:s.weight},i)}function $q(t){t.graph().dummyChains.forEach(e=>{let n=t.node(e),r=n.edgeLabel,o;for(t.setEdge(n.edgeObj,r);n.dummy;)o=t.successors(e)[0],t.removeNode(e),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),e=o,n=t.node(e)})}function jE(t){let e={};function n(r){let o=t.node(r);if(Object.hasOwn(e,r))return o.rank;e[r]=!0;let a=t.outEdges(r),i=a?a.map(l=>l==null?Number.POSITIVE_INFINITY:n(l.w)-t.edge(l).minlen):[],s=Ri(Math.min,i);return s===Number.POSITIVE_INFINITY&&(s=0),o.rank=s}t.sources().forEach(n)}function fd(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function Hq(t){let e=new La({directed:!1}),n=t.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let r=n[0],o=t.nodeCount();e.setNode(r,{});let a,i;for(;Wq(e,t)<o&&(a=Bq(e,t),!!a);)i=e.hasNode(a.v)?fd(t,a):-fd(t,a),Fq(e,t,i);return e}function Wq(t,e){function n(r){let o=e.nodeEdges(r);o&&o.forEach(a=>{let i=a.v,s=r===i?a.w:i;!t.hasNode(s)&&!fd(e,a)&&(t.setNode(s,{}),t.setEdge(r,s,{}),n(s))})}return t.nodes().forEach(n),t.nodeCount()}function Bq(t,e){return e.edges().reduce((n,r)=>{let o=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(o=fd(e,r)),o<n[0]?[o,r]:n},[Number.POSITIVE_INFINITY,null])[1]}function Fq(t,e,n){t.nodes().forEach(r=>e.node(r).rank+=n)}function zl(t){t=yq(t),jE(t);let e=RP(t);KE(e),qE(e,t);let n,r;for(;n=DP(e);)r=OP(e,t,n),GP(e,t,n,r)}function qE(t,e){let n=zq(t,t.nodes());n=n.slice(0,n.length-1),n.forEach(r=>Uq(t,e,r))}function Uq(t,e,n){let r=t.node(n).parent,o=t.edge(n,r);o.cutvalue=IP(t,e,n)}function IP(t,e,n){let r=t.node(n).parent,o=!0,a=e.edge(n,r),i=0;a||(o=!1,a=e.edge(r,n)),i=a.weight;let s=e.nodeEdges(n);return s&&s.forEach(l=>{let c=l.v===n,d=c?l.w:l.v;if(d!==r){let u=c===o,f=e.edge(l).weight;if(i+=u?f:-f,jq(t,n,d)){let p=t.edge(n,d).cutvalue;i+=u?-p:p}}}),i}function KE(t,e){arguments.length<2&&(e=t.nodes()[0]),PP(t,{},1,e)}function PP(t,e,n,r,o){let a=n,i=t.node(r);e[r]=!0;let s=t.neighbors(r);return s&&s.forEach(l=>{Object.hasOwn(e,l)||(n=PP(t,e,n,l,r))}),i.low=a,i.lim=n++,o?i.parent=o:delete i.parent,n}function DP(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function OP(t,e,n){let r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);let a=t.node(r),i=t.node(o),s=a,l=!1;return a.lim>i.lim&&(s=i,l=!0),e.edges().filter(c=>l===cP(t,t.node(c.v),s)&&l!==cP(t,t.node(c.w),s)).reduce((c,d)=>fd(e,d)<fd(e,c)?d:c)}function GP(t,e,n,r){let o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(r.v,r.w,{}),KE(t),qE(t,e),Xq(t,e)}function Xq(t,e){let n=t.nodes().find(o=>!t.node(o).parent);if(!n)return;let r=Yq(t,[n]);r=r.slice(1),r.forEach(o=>{let a=t.node(o).parent,i=e.edge(o,a),s=!1;i||(i=e.edge(a,o),s=!0),e.node(o).rank=e.node(a).rank+(s?i.minlen:-i.minlen)})}function jq(t,e,n){return t.hasEdge(e,n)}function cP(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Kq(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":dP(t);break;case"tight-tree":Qq(t);break;case"longest-path":Zq(t);break;case"none":break;default:dP(t)}}function Qq(t){jE(t),RP(t)}function dP(t){Vq(t)}function tK(t){let e=nK(t);t.graph().dummyChains.forEach(n=>{let r=t.node(n),o=r.edgeObj,a=eK(t,e,o.v,o.w),i=a.path,s=a.lca,l=0,c=i[l],d=!0;for(;n!==o.w;){if(r=t.node(n),d){for(;(c=i[l])!==s&&t.node(c).maxRank<r.rank;)l++;c===s&&(d=!1)}if(!d){for(;l<i.length-1&&t.node(i[l+1]).minRank<=r.rank;)l++;c=i[l]}c!==void 0&&t.setParent(n,c),n=t.successors(n)[0]}})}function eK(t,e,n,r){let o=[],a=[],i=Math.min(e[n].low,e[r].low),s=Math.max(e[n].lim,e[r].lim),l;l=n;do l=t.parent(l),o.push(l);while(l&&(e[l].low>i||s>e[l].lim));let c=l,d=r;for(;(d=t.parent(d))!==c;)a.push(d);return{path:o.concat(a.reverse()),lca:c}}function nK(t){let e={},n=0;function r(o){let a=n;t.children(o).forEach(r),e[o]={low:a,lim:n++}}return t.children(og).forEach(r),e}function rK(t){let e=pd(t,"root",{},"_root"),n=oK(t),r=Object.values(n),o=Ri(Math.max,r)-1,a=2*o+1;t.graph().nestingRoot=e,t.edges().forEach(s=>t.edge(s).minlen*=a);let i=aK(t)+1;t.children(og).forEach(s=>$P(t,e,a,i,o,n,s)),t.graph().nodeRankFactor=a}function $P(t,e,n,r,o,a,i){var s;let l=t.children(i);if(!l.length){i!==e&&t.setEdge(e,i,{weight:0,minlen:n});return}let c=sP(t,"_bt"),d=sP(t,"_bb"),u=t.node(i);t.setParent(c,i),u.borderTop=c,t.setParent(d,i),u.borderBottom=d,l.forEach(f=>{var p;$P(t,e,n,r,o,a,f);let m=t.node(f),h=m.borderTop?m.borderTop:f,g=m.borderBottom?m.borderBottom:f,v=m.borderTop?r:2*r,y=h!==g?1:o-((p=a[i])!=null?p:0)+1;t.setEdge(c,h,{weight:v,minlen:y,nestingEdge:!0}),t.setEdge(g,d,{weight:v,minlen:y,nestingEdge:!0})}),t.parent(i)||t.setEdge(e,c,{weight:0,minlen:o+((s=a[i])!=null?s:0)})}function oK(t){let e={};function n(r,o){let a=t.children(r);a&&a.length&&a.forEach(i=>n(i,o+1)),e[r]=o}return t.children(og).forEach(r=>n(r,1)),e}function aK(t){return t.edges().reduce((e,n)=>e+t.edge(n).weight,0)}function iK(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(n=>{t.edge(n).nestingEdge&&t.removeEdge(n)})}function lK(t){function e(n){let r=t.children(n),o=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let a=o.minRank,i=o.maxRank+1;a<i;++a)uP(t,"borderLeft","_bl",n,o,a),uP(t,"borderRight","_br",n,o,a)}}t.children(og).forEach(e)}function uP(t,e,n,r,o,a){let i={width:0,height:0,rank:a,borderType:e},s=o[e][a-1],l=pd(t,"border",i,n);o[e][a]=l,t.setParent(l,r),s&&t.setEdge(s,l,{weight:1})}function cK(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="lr"||n==="rl")&&HP(t)}function dK(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="bt"||n==="rl")&&uK(t),(n==="lr"||n==="rl")&&(fK(t),HP(t))}function HP(t){t.nodes().forEach(e=>fP(t.node(e))),t.edges().forEach(e=>fP(t.edge(e)))}function fP(t){let e=t.width;t.width=t.height,t.height=e}function uK(t){t.nodes().forEach(e=>BE(t.node(e))),t.edges().forEach(e=>{var n;let r=t.edge(e);(n=r.points)==null||n.forEach(BE),Object.hasOwn(r,"y")&&BE(r)})}function BE(t){t.y=-t.y}function fK(t){t.nodes().forEach(e=>FE(t.node(e))),t.edges().forEach(e=>{var n;let r=t.edge(e);(n=r.points)==null||n.forEach(FE),Object.hasOwn(r,"x")&&FE(r)})}function FE(t){let e=t.x;t.x=t.y,t.y=e}function pK(t){let e={},n=t.nodes().filter(s=>!t.children(s).length),r=n.map(s=>t.node(s).rank),o=Ri(Math.max,r),a=xf(o+1).map(()=>[]);function i(s){if(e[s])return;e[s]=!0;let l=t.node(s);a[l.rank].push(s);let c=t.successors(s);c&&c.forEach(i)}return n.sort((s,l)=>t.node(s).rank-t.node(l).rank).forEach(i),a}function mK(t,e){let n=0;for(let r=1;r<e.length;++r)n+=hK(t,e[r-1],e[r]);return n}function hK(t,e,n){let r=vq(n,n.map((c,d)=>d)),o=e.flatMap(c=>{let d=t.outEdges(c);return d?d.map(u=>({pos:r[u.w],weight:t.edge(u).weight})).sort((u,f)=>u.pos-f.pos):[]}),a=1;for(;a<n.length;)a<<=1;let i=2*a-1;a-=1;let s=new Array(i).fill(0),l=0;return o.forEach(c=>{let d=c.pos+a;s[d]+=c.weight;let u=0;for(;d>0;)d%2&&(u+=s[d+1]),d=d-1>>1,s[d]+=c.weight;l+=c.weight*u}),l}function gK(t,e=[]){return e.map(n=>{let r=t.inEdges(n);if(!r||!r.length)return{v:n};{let o=r.reduce((a,i)=>{let s=t.edge(i),l=t.node(i.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}})}function yK(t,e){let n={};t.forEach((o,a)=>{let i={indegree:0,in:[],out:[],vs:[o.v],i:a};o.barycenter!==void 0&&(i.barycenter=o.barycenter,i.weight=o.weight),n[o.v]=i}),e.edges().forEach(o=>{let a=n[o.v],i=n[o.w];a!==void 0&&i!==void 0&&(i.indegree++,a.out.push(i))});let r=Object.values(n).filter(o=>!o.indegree);return bK(r)}function bK(t){let e=[];function n(o){return a=>{a.merged||(a.barycenter===void 0||o.barycenter===void 0||a.barycenter>=o.barycenter)&&xK(o,a)}}function r(o){return a=>{a.in.push(o),--a.indegree===0&&t.push(a)}}for(;t.length;){let o=t.pop();e.push(o),o.in.reverse().forEach(n(o)),o.out.forEach(r(o))}return e.filter(o=>!o.merged).map(o=>ng(o,["vs","i","barycenter","weight"]))}function xK(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}function wK(t,e){let n=Eq(t,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,o=n.rhs.sort((d,u)=>u.i-d.i),a=[],i=0,s=0,l=0;r.sort(EK(!!e)),l=pP(a,o,l),r.forEach(d=>{l+=d.vs.length,a.push(d.vs),i+=d.barycenter*d.weight,s+=d.weight,l=pP(a,o,l)});let c={vs:a.flat(1)};return s&&(c.barycenter=i/s,c.weight=s),c}function pP(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}function EK(t){return(e,n)=>e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i}function WP(t,e,n,r){let o=t.children(e),a=t.node(e),i=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};i&&(o=o.filter(f=>f!==i&&f!==s));let c=gK(t,o);c.forEach(f=>{if(t.children(f.v).length){let p=WP(t,f.v,n,r);l[f.v]=p,Object.hasOwn(p,"barycenter")&&vK(f,p)}});let d=yK(c,n);SK(d,l);let u=wK(d,r);if(i&&s){u.vs=[i,u.vs,s].flat(1);let f=t.predecessors(i);if(f&&f.length){let p=t.node(f[0]),m=t.predecessors(s),h=t.node(m[0]);Object.hasOwn(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+p.order+h.order)/(u.weight+2),u.weight+=2}}return u}function SK(t,e){t.forEach(n=>{n.vs=n.vs.flatMap(r=>e[r]?e[r].vs:r)})}function vK(t,e){t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)}function kK(t,e,n,r){r||(r=t.nodes());let o=LK(t),a=new La({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>t.node(i));return r.forEach(i=>{let s=t.node(i),l=t.parent(i);if(s.rank===e||s.minRank<=e&&e<=s.maxRank){a.setNode(i),a.setParent(i,l||o);let c=t[n](i);c&&c.forEach(d=>{let u=d.v===i?d.w:d.v,f=a.edge(u,i),p=f!==void 0?f.weight:0;a.setEdge(u,i,{weight:t.edge(d).weight+p})}),Object.hasOwn(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]})}}),a}function LK(t){let e;for(;t.hasNode(e=XE("_root")););return e}function NK(t,e,n){let r={},o;n.forEach(a=>{let i=t.parent(a),s,l;for(;i;){if(s=t.parent(i),s?(l=r[s],r[s]=i):(l=o,o=i),l&&l!==i){e.setEdge(l,i);return}i=s}})}function BP(t,e={}){if(typeof e.customOrder=="function"){e.customOrder(t,BP);return}let n=CP(t),r=mP(t,xf(1,n+1),"inEdges"),o=mP(t,xf(n-1,-1,-1),"outEdges"),a=pK(t);if(hP(t,a),e.disableOptimalOrderHeuristic)return;let i=Number.POSITIVE_INFINITY,s,l=e.constraints||[];for(let c=0,d=0;d<4;++c,++d){MK(c%2?r:o,c%4>=2,l),a=wf(t);let u=mK(t,a);u<i?(d=0,s=Object.assign({},a),i=u):u===i&&(s=structuredClone(a))}hP(t,s)}function mP(t,e,n){let r=new Map,o=(a,i)=>{r.has(a)||r.set(a,[]),r.get(a).push(i)};for(let a of t.nodes()){let i=t.node(a);if(typeof i.rank=="number"&&o(i.rank,a),typeof i.minRank=="number"&&typeof i.maxRank=="number")for(let s=i.minRank;s<=i.maxRank;s++)s!==i.rank&&o(s,a)}return e.map(function(a){return kK(t,a,n,r.get(a)||[])})}function MK(t,e,n){let r=new La;t.forEach(function(o){n.forEach(s=>r.setEdge(s.left,s.right));let a=o.graph().root,i=WP(o,a,r,e);i.vs.forEach((s,l)=>o.node(s).order=l),NK(o,r,i.vs)})}function hP(t,e){Object.values(e).forEach(n=>n.forEach((r,o)=>t.node(r).order=o))}function TK(t,e){let n={};function r(o,a){let i=0,s=0,l=o.length,c=a[a.length-1];return a.forEach((d,u)=>{let f=_K(t,d),p=f?t.node(f).order:l;(f||d===c)&&(a.slice(s,u+1).forEach(m=>{let h=t.predecessors(m);h&&h.forEach(g=>{let v=t.node(g),y=v.order;(y<i||p<y)&&!(v.dummy&&t.node(m).dummy)&&FP(n,g,m)})}),s=u+1,i=p)}),a}return e.length&&e.reduce(r),n}function CK(t,e){let n={};function r(a,i,s,l,c){xf(i,s).forEach(d=>{let u=a[d];if(u!==void 0&&t.node(u).dummy){let f=t.predecessors(u);f&&f.forEach(p=>{if(p===void 0)return;let m=t.node(p);m.dummy&&(m.order<l||m.order>c)&&FP(n,p,u)})}})}function o(a,i){let s=-1,l=-1,c=0;return i.forEach((d,u)=>{if(t.node(d).dummy==="border"){let f=t.predecessors(d);if(f&&f.length){let p=f[0];if(p===void 0)return;l=t.node(p).order,r(i,c,u,s,l),c=u,s=l}}r(i,c,i.length,l,a.length)}),i}return e.length&&e.reduce(o),n}function _K(t,e){if(t.node(e).dummy){let n=t.predecessors(e);if(n)return n.find(r=>t.node(r).dummy)}}function FP(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];r||(t[e]=r={}),r[n]=!0}function AK(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];return r!==void 0&&Object.hasOwn(r,n)}function RK(t,e,n,r){let o={},a={},i={};return e.forEach(s=>{s.forEach((l,c)=>{o[l]=l,a[l]=l,i[l]=c})}),e.forEach(s=>{let l=-1;s.forEach(c=>{let d=r(c);if(d&&d.length){let u=d.sort((p,m)=>{let h=i[p],g=i[m];return(h!==void 0?h:0)-(g!==void 0?g:0)}),f=(u.length-1)/2;for(let p=Math.floor(f),m=Math.ceil(f);p<=m;++p){let h=u[p];if(h===void 0)continue;let g=i[h];if(g!==void 0&&a[c]===c&&l<g&&!AK(n,c,h)){let v=o[h];v!==void 0&&(a[h]=c,a[c]=o[c]=v,l=g)}}}})}),{root:o,align:a}}function IK(t,e,n,r,o=!1){let a={},i=PK(t,e,n,o),s=o?"borderLeft":"borderRight";function l(p,m){let h=i.nodes().slice(),g={},v=h.pop();for(;v;){if(g[v])p(v);else{g[v]=!0,h.push(v);for(let y of m(v))h.push(y)}v=h.pop()}}function c(p){let m=i.inEdges(p);m?a[p]=m.reduce((h,g)=>{var v;let y=(v=a[g.v])!=null?v:0,b=i.edge(g);return Math.max(h,y+(b!==void 0?b:0))},0):a[p]=0}function d(p){let m=i.outEdges(p),h=Number.POSITIVE_INFINITY;m&&(h=m.reduce((v,y)=>{let b=a[y.w],E=i.edge(y);return Math.min(v,(b!==void 0?b:0)-(E!==void 0?E:0))},Number.POSITIVE_INFINITY));let g=t.node(p);h!==Number.POSITIVE_INFINITY&&g.borderType!==s&&(a[p]=Math.max(a[p]!==void 0?a[p]:0,h))}function u(p){return i.predecessors(p)||[]}function f(p){return i.successors(p)||[]}return l(c,u),l(d,f),Object.keys(r).forEach(p=>{var m;let h=n[p];h!==void 0&&(a[p]=(m=a[h])!=null?m:0)}),a}function PK(t,e,n,r){let o=new La,a=t.graph(),i=HK(a.nodesep,a.edgesep,r);return e.forEach(s=>{let l;s.forEach(c=>{let d=n[c];if(d!==void 0){if(o.setNode(d),l!==void 0){let u=n[l];if(u!==void 0){let f=o.edge(u,d);o.setEdge(u,d,Math.max(i(t,c,l),f||0))}}l=c}})}),o}function DK(t,e){return Object.values(e).reduce((n,r)=>{let o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([s,l])=>{let c=WK(t,s)/2;o=Math.max(l+c,o),a=Math.min(l-c,a)});let i=o-a;return i<n[0]&&(n=[i,r]),n},[Number.POSITIVE_INFINITY,null])[1]}function OK(t,e){let n=Object.values(e),r=Ri(Math.min,n),o=Ri(Math.max,n);["u","d"].forEach(a=>{["l","r"].forEach(i=>{let s=a+i,l=t[s];if(!l||l===e)return;let c=Object.values(l),d=r-Ri(Math.min,c);i!=="l"&&(d=o-Ri(Math.max,c)),d&&(t[s]=rg(l,u=>u+d))})})}function GK(t,e=void 0){let n=t.ul;return n?rg(n,(r,o)=>{var a,i;if(e){let l=e.toLowerCase(),c=t[l];if(c&&c[o]!==void 0)return c[o]}let s=Object.values(t).map(l=>{let c=l[o];return c!==void 0?c:0}).sort((l,c)=>l-c);return(((a=s[1])!=null?a:0)+((i=s[2])!=null?i:0))/2}):{}}function $K(t){let e=wf(t),n=Object.assign(TK(t,e),CK(t,e)),r={},o;["u","d"].forEach(i=>{o=i==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(o=o.map(d=>Object.values(d).reverse()));let l=RK(t,o,n,d=>(i==="u"?t.predecessors(d):t.successors(d))||[]),c=IK(t,o,l.root,l.align,s==="r");s==="r"&&(c=rg(c,d=>-d)),r[i+s]=c})});let a=DK(t,r);return OK(r,a),GK(r,t.graph().align)}function HK(t,e,n){return(r,o,a)=>{let i=r.node(o),s=r.node(a),l=0,c;if(l+=i.width/2,Object.hasOwn(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":c=-i.width/2;break;case"r":c=i.width/2;break}if(c&&(l+=n?c:-c),c=void 0,l+=(i.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=s.width/2;break;case"r":c=-s.width/2;break}return c&&(l+=n?c:-c),l}}function WK(t,e){return t.node(e).width}function BK(t){t=MP(t),FK(t),Object.entries($K(t)).forEach(([e,n])=>t.node(e).x=n)}function FK(t){let e=wf(t),n=t.graph(),r=n.ranksep,o=n.rankalign,a=0;e.forEach(i=>{let s=i.reduce((l,c)=>{var d;let u=(d=t.node(c).height)!=null?d:0;return l>u?l:u},0);i.forEach(l=>{let c=t.node(l);o==="top"?c.y=a+c.height/2:o==="bottom"?c.y=a+s-c.height/2:c.y=a+s/2}),a+=s+r})}function YK(t,e={}){let n=e.debugTiming?_P:AP;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>JK(t));return n(" runLayout",()=>zK(r,n,e)),n(" updateInputGraph",()=>VK(t,r)),r})}function zK(t,e,n){e(" makeSpaceForEdgeLabels",()=>t7(t)),e(" removeSelfEdges",()=>c7(t)),e(" acyclic",()=>Iq(t)),e(" nestingGraph.run",()=>rK(t)),e(" rank",()=>qq(MP(t))),e(" injectEdgeLabelProxies",()=>e7(t)),e(" removeEmptyRanks",()=>xq(t)),e(" nestingGraph.cleanup",()=>iK(t)),e(" normalizeRanks",()=>bq(t)),e(" assignRankMinMax",()=>n7(t)),e(" removeEdgeLabelProxies",()=>r7(t)),e(" normalize.run",()=>Oq(t)),e(" parentDummyChains",()=>Jq(t)),e(" addBorderSegments",()=>sK(t)),e(" order",()=>BP(t,n)),e(" insertSelfEdges",()=>d7(t)),e(" adjustCoordinateSystem",()=>cK(t)),e(" position",()=>BK(t)),e(" positionSelfEdges",()=>u7(t)),e(" removeBorderNodes",()=>l7(t)),e(" normalize.undo",()=>$q(t)),e(" fixupEdgeLabelCoords",()=>i7(t)),e(" undoCoordinateSystem",()=>dK(t)),e(" translateGraph",()=>o7(t)),e(" assignNodeIntersects",()=>a7(t)),e(" reversePoints",()=>s7(t)),e(" acyclic.undo",()=>Dq(t))}function VK(t,e){t.nodes().forEach(n=>{let r=t.node(n),o=e.node(n);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,e.children(n).length&&(r.width=o.width,r.height=o.height))}),t.edges().forEach(n=>{let r=t.edge(n),o=e.edge(n);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function JK(t){let e=new La({multigraph:!0,compound:!0}),n=zE(t.graph());return e.setGraph(Object.assign({},XK,YE(n,UK),ng(n,jK))),t.nodes().forEach(r=>{let o=zE(t.node(r)),a=YE(o,qK);Object.keys(gP).forEach(s=>{a[s]===void 0&&(a[s]=gP[s])}),e.setNode(r,a);let i=t.parent(r);i!==void 0&&e.setParent(r,i)}),t.edges().forEach(r=>{let o=zE(t.edge(r));e.setEdge(r,Object.assign({},ZK,YE(o,KK),ng(o,QK)))}),e}function t7(t){let e=t.graph();e.ranksep/=2,t.edges().forEach(n=>{let r=t.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function e7(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let r=t.node(e.v),o={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};pd(t,"edge-proxy",o,"_ep")}})}function n7(t){let e=0;t.nodes().forEach(n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))}),t.graph().maxRank=e}function r7(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="edge-proxy"){let r=n;t.edge(r.e).labelRank=n.rank,t.removeNode(e)}})}function o7(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,a=t.graph(),i=a.marginx||0,s=a.marginy||0;function l(c){let d=c.x,u=c.y,f=c.width,p=c.height;e=Math.min(e,d-f/2),n=Math.max(n,d+f/2),r=Math.min(r,u-p/2),o=Math.max(o,u+p/2)}t.nodes().forEach(c=>l(t.node(c))),t.edges().forEach(c=>{let d=t.edge(c);Object.hasOwn(d,"x")&&l(d)}),e-=i,r-=s,t.nodes().forEach(c=>{let d=t.node(c);d.x-=e,d.y-=r}),t.edges().forEach(c=>{let d=t.edge(c);d.points.forEach(u=>{u.x-=e,u.y-=r}),Object.hasOwn(d,"x")&&(d.x-=e),Object.hasOwn(d,"y")&&(d.y-=r)}),a.width=n-e+i,a.height=o-r+s}function a7(t){t.edges().forEach(e=>{let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),a,i;n.points?(a=n.points[0],i=n.points[n.points.length-1]):(n.points=[],a=o,i=r),n.points.unshift(iP(r,a)),n.points.push(iP(o,i))})}function i7(t){t.edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function s7(t){t.edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}function l7(t){t.nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(n.borderLeft[n.borderLeft.length-1]),i=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(i.x-a.x),n.height=Math.abs(o.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{t.node(e).dummy==="border"&&t.removeNode(e)})}function c7(t){t.edges().forEach(e=>{if(e.v===e.w){let n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function d7(t){wf(t).forEach(e=>{let n=0;e.forEach((r,o)=>{let a=t.node(r);a.order=o+n,(a.selfEdges||[]).forEach(i=>{pd(t,"selfedge",{width:i.label.width,height:i.label.height,rank:a.rank,order:o+ ++n,e:i.e,label:i.label},"_se")}),delete a.selfEdges})})}function u7(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="selfedge"){let r=n,o=t.node(r.e.v),a=o.x+o.width/2,i=o.y,s=n.x-a,l=o.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:a+2*s/3,y:i-l},{x:a+5*s/6,y:i-l},{x:a+s,y:i},{x:a+5*s/6,y:i+l},{x:a+2*s/3,y:i+l}],r.label.x=n.x,r.label.y=n.y}})}function YE(t,e){return rg(ng(t,e),Number)}function zE(t){let e={};return t&&Object.entries(t).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),e[n]=r}),e}function f7(t){let e=wf(t),n=new La({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+t.node(r).rank)}),t.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),e.forEach((r,o)=>{let a="layer"+o;n.setNode(a,{rank:"same"}),r.reduce((i,s)=>(n.setEdge(i,s,{style:"invis"}),s))}),n}var yP,zj,Vj,Uj,bP,Xj,xP,La,qj,wP,UE,tq,SP,rq,sq,eg,TP,Sq,og,kq,Lq,Mq,Tq,RP,Yq,zq,Vq,qq,Zq,Jq,sK,UK,XK,jK,qK,gP,KK,ZK,QK,p7,er,ss=st(()=>{"use strict";yP=Object.defineProperty,zj=(t,e,n)=>e in t?yP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vj=(t,e)=>{for(var n in e)yP(t,n,{get:e[n],enumerable:!0})},Uj=(t,e,n)=>zj(t,typeof e!="symbol"?e+"":e,n),bP={};Vj(bP,{Graph:()=>La,alg:()=>UE,json:()=>wP,version:()=>qj});Xj=Object.defineProperty,xP=(t,e)=>{for(var n in e)Xj(t,n,{get:e[n],enumerable:!0})},La=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,e){return t.forEach(n=>{e!==void 0?this.setNode(n,e):this.setNode(n)}),this}setNode(t,e){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let e=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(n=>{this.setParent(n)}),delete this._children[t]),Object.keys(this._in[t]).forEach(e),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e===void 0)e="\0";else{e+="";for(let n=e;n!==void 0;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}parent(t){if(this._isCompound){let e=this._parent[t];if(e!=="\0")return e}}children(t="\0"){if(this._isCompound){let e=this._children[t];if(e)return Object.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let e=this._preds[t];if(e)return Object.keys(e)}successors(t){let e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){let e=this.predecessors(t);if(e){let n=new Set(e);for(let r of this.successors(t))n.add(r);return Array.from(n.values())}}isLeaf(t){let e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0}filterNodes(t){let e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Object.entries(this._nodes).forEach(([o,a])=>{t(o)&&e.setNode(o,a)}),Object.values(this._edgeObjs).forEach(o=>{e.hasNode(o.v)&&e.hasNode(o.w)&&e.setEdge(o,this.edge(o))});let n={},r=o=>{let a=this.parent(o);return!a||e.hasNode(a)?(n[o]=a??void 0,a??void 0):a in n?n[a]:r(a)};return this._isCompound&&e.nodes().forEach(o=>e.setParent(o,r(o))),e}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){return t.reduce((n,r)=>(e!==void 0?this.setEdge(n,r,e):this.setEdge(n,r),r)),this}setEdge(t,e,n,r){let o,a,i,s,l=!1;typeof t=="object"&&t!==null&&"v"in t?(o=t.v,a=t.w,i=t.name,arguments.length===2&&(s=e,l=!0)):(o=t,a=e,i=r,arguments.length>2&&(s=n,l=!0)),o=""+o,a=""+a,i!==void 0&&(i=""+i);let c=bf(this._isDirected,o,a,i);if(c in this._edgeLabels)return l&&(this._edgeLabels[c]=s),this;if(i!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(o),this.setNode(a),this._edgeLabels[c]=l?s:this._defaultEdgeLabelFn(o,a,i);let d=jj(this._isDirected,o,a,i);return o=d.v,a=d.w,Object.freeze(d),this._edgeObjs[c]=d,oP(this._preds[a],o),oP(this._sucs[o],a),this._in[a][c]=d,this._out[o][c]=d,this._edgeCount++,this}edge(t,e,n){let r=arguments.length===1?HE(this._isDirected,t):bf(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(t,e,n){let r=arguments.length===1?this.edge(t):this.edge(t,e,n);return typeof r!="object"?{label:r}:r}hasEdge(t,e,n){return(arguments.length===1?HE(this._isDirected,t):bf(this._isDirected,t,e,n))in this._edgeLabels}removeEdge(t,e,n){let r=arguments.length===1?HE(this._isDirected,t):bf(this._isDirected,t,e,n),o=this._edgeObjs[r];if(o){let a=o.v,i=o.w;delete this._edgeLabels[r],delete this._edgeObjs[r],aP(this._preds[i],a),aP(this._sucs[a],i),delete this._in[i][r],delete this._out[a][r],this._edgeCount--}return this}inEdges(t,e){return this.isDirected()?this.filterEdges(this._in[t],t,e):this.nodeEdges(t,e)}outEdges(t,e){return this.isDirected()?this.filterEdges(this._out[t],t,e):this.nodeEdges(t,e)}nodeEdges(t,e){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,e)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,e,n){if(!t)return;let r=Object.values(t);return n?r.filter(o=>o.v===e&&o.w===n||o.v===n&&o.w===e):r}};qj="4.0.1",wP={};xP(wP,{read:()=>Jj,write:()=>Kj});UE={};xP(UE,{CycleException:()=>eg,bellmanFord:()=>EP,components:()=>nq,dijkstra:()=>tg,dijkstraAll:()=>aq,findCycles:()=>iq,floydWarshall:()=>lq,isAcyclic:()=>dq,postorder:()=>fq,preorder:()=>pq,prim:()=>mq,shortestPaths:()=>hq,tarjan:()=>vP,topsort:()=>kP});tq=()=>1;SP=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(t=>t.key)}has(t){return t in this._keyIndices}priority(t){let e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){let n=this._keyIndices,r=String(t);if(!(r in n)){let o=this._arr,a=o.length;return n[r]=a,o.push({key:r,priority:e}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){let n=this._keyIndices[t];if(n===void 0)throw new Error(`Key not found: ${t}`);let r=this._arr[n].priority;if(e>r)throw new Error(`New priority is greater than current priority. Key: ${t} Old: ${r} New: ${e}`);this._arr[n].priority=e,this._decrease(n)}_heapify(t){let e=this._arr,n=2*t,r=n+1,o=t;n<e.length&&(o=e[n].priority<e[o].priority?n:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==t&&(this._swap(t,o),this._heapify(o)))}_decrease(t){let e=this._arr,n=e[t].priority,r;for(;t!==0&&(r=t>>1,!(e[r].priority<n));)this._swap(t,r),t=r}_swap(t,e){let n=this._arr,r=this._keyIndices,o=n[t],a=n[e];n[t]=a,n[e]=o,r[a.key]=t,r[o.key]=e}},rq=()=>1;sq=()=>1;eg=class extends Error{constructor(...t){super(...t)}};TP=65535;Sq=0;og="\0",kq="3.0.0",Lq=class{constructor(){Uj(this,"_sentinel");let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return lP(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&lP(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Nq)),n=n._prev;return"["+t.join(", ")+"]"}};Mq=Lq,Tq=()=>1;RP=Hq;({preorder:Yq,postorder:zq}=UE),Vq=zl;zl.initLowLimValues=KE;zl.initCutValues=qE;zl.calcCutValue=IP;zl.leaveEdge=DP;zl.enterEdge=OP;zl.exchangeEdges=GP;qq=Kq;Zq=jE;Jq=tK;sK=lK;UK=["nodesep","edgesep","ranksep","marginx","marginy"],XK={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},jK=["acyclicer","ranker","rankdir","align","rankalign"],qK=["width","height","rank"],gP={width:0,height:0},KK=["minlen","weight","width","height","labeloffset"],ZK={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},QK=["labelpos"];p7={graphlib:bP,version:kq,layout:YK,debug:f7,util:{time:_P,notime:AP}},er=p7;});var JE={};ye(JE,{layoutSitemap:()=>k7});function zP(t,e,n,r,o,a){let i=o-t,s=a-e;if(i===0&&s===0)return{x:t,y:e};let l=n/2,c=r/2,d=i!==0?l/Math.abs(i):1/0,u=s!==0?c/Math.abs(s):1/0,f=Math.min(d,u);return{x:t+i*f,y:e+s*f}}function x7(t,e){if(!e||e.size===0)return t;let n={};for(let[r,o]of Object.entries(t))e.has(r)||(n[r]=o);return n}function w7(t,e,n){let r=_t(t,m7);for(let[o,a]of Object.entries(e)){let i=_t(`${o}: ${a}`,YP);i>r&&(r=i)}if(n)for(let o of n){let a=_t(o,YP);a>r&&(r=a)}return Math.max(KP,Math.ceil(r)+qP*2)}function E7(t,e=0){let r=Object.keys(t).length+e;return r===0?VP+UP:VP+y7+r*g7+UP}function jP(t,e,n){return t.color?t.color:ar(t.metadata,[...e],n,t.isContainer)}function v7(t,e){let n=[];for(let r of t){if(r.entries.length===0)continue;let o=e?.get(qt(r.name)),a=o?r.entries.filter(u=>o.has(u.value.toLowerCase())):r.entries;if(a.length===0)continue;let i=We(r.name,sr)+po,s=i,l=0;for(let u of a)l+=wr*2+Nr+We(u.value,Vn)+Kr;let c=Mo+wi,d=Rn*2+i+4+c+l;n.push({name:r.name,...r.alias!==void 0&&{alias:r.alias},entries:a.map(u=>({value:u.value,color:u.color})),x:0,y:0,width:d,height:Se,minifiedWidth:s,minifiedHeight:Se})}return n}function QE(t,e,n,r,o,a){for(let i of t){let s=x7(i.metadata,o);if(i.isContainer){let l=Object.keys(s).length,c=ZP+l*QP;a.push({sitemapNode:i,parentContainerId:e,parentPageId:n,meta:s,fullMeta:{...i.metadata},width:Math.max(KP,_t(i.label,h7)+qP*2),height:c+ZE}),QE(i.children,i.id,n,r,o,a)}else a.push({sitemapNode:i,parentContainerId:e,parentPageId:n,meta:s,fullMeta:{...i.metadata},width:w7(i.label,s,i.description),height:E7(s,i.description?.length??0)}),i.children.length>0&&QE(i.children,e,i.id,r,o,a)}}function k7(t,e,n,r,o){if(t.roots.length===0)return{nodes:[],edges:[],containers:[],legend:[],width:0,height:0};let a=[],i=k=>{a.push(k);for(let N of k.children)i(N)};for(let k of t.roots)i(k);wa(a,t.tagGroups,k=>k.isContainer);let s=[];QE(t.roots,null,null,e,r,s);let l=new Map;for(let k of s)l.set(k.sitemapNode.id,k);let c=new er.graphlib.Graph({compound:!0,multigraph:!0});c.setGraph({rankdir:t.direction,nodesep:50,ranksep:60,edgesep:30,marginx:Vl,marginy:Vl}),c.setDefaultEdgeLabel(()=>({}));let d=new Set,u=new Set,f=new Set;for(let k of s)k.sitemapNode.isContainer?(d.add(k.sitemapNode.id),(e?.get(k.sitemapNode.id)??0)>0&&f.add(k.sitemapNode.id)):u.add(k.sitemapNode.id);let p=0,m=0;for(let k of s)k.sitemapNode.isContainer||(k.width>p&&(p=k.width),k.height>m&&(m=k.height));for(let k of s){let N=k.sitemapNode;if(N.isContainer)if(f.has(N.id)){let _=Math.max(k.width,p),T=Math.max(k.height,m);c.setNode(N.id,{label:N.label,width:_,height:T})}else c.setNode(N.id,{label:N.label,paddingLeft:XP,paddingRight:XP,paddingTop:b7,paddingBottom:ZE});else c.setNode(N.id,{label:N.label,width:k.width,height:k.height})}for(let k of s)k.parentContainerId&&!f.has(k.parentContainerId)&&c.setParent(k.sitemapNode.id,k.parentContainerId);let h=new Set;for(let k of d)f.has(k)||h.add(k);let g=[];for(let k=0;k<t.edges.length;k++){let N=t.edges[k];if(!(!c.hasNode(N.sourceId)||!c.hasNode(N.targetId))){if(h.has(N.sourceId)||h.has(N.targetId)){g.push(k);continue}c.setEdge(N.sourceId,N.targetId,{label:N.label??"",minlen:1},`e${k}`)}}er.layout(c);let v=[],y=[];for(let k of s){let N=k.sitemapNode;if(N.isContainer)continue;let _=c.node(N.id);if(!_)continue;let T=e?.get(N.id),R=jP(N,t.tagGroups,n??null);v.push({id:N.id,label:N.label,metadata:k.meta,tagMetadata:k.fullMeta,...N.description!==void 0&&{description:[...N.description]},isContainer:!1,lineNumber:N.lineNumber,...R!==void 0&&{color:R},x:_.x,y:_.y-_.height/2,width:_.width,height:_.height,...T!==void 0&&{hiddenCount:T},...(N.children.length>0||T!=null&&T>0)&&{hasChildren:!0}})}for(let k of s){let N=k.sitemapNode;if(!N.isContainer)continue;let _=c.node(N.id),T=e?.get(N.id),R=Object.keys(k.meta).length,G=ZP+R*QP,I=jP(N,t.tagGroups,n??null);if(_)y.push({nodeId:N.id,label:N.label,lineNumber:N.lineNumber,...I!==void 0&&{color:I},metadata:k.meta,tagMetadata:k.fullMeta,x:_.x-_.width/2,y:_.y-_.height/2,width:_.width,height:_.height,labelHeight:G,...T!==void 0&&{hiddenCount:T},...(N.children.length>0||T!=null&&T>0)&&{hasChildren:!0}});else{let H=f.has(N.id),O=H?Math.max(k.width,p):k.width,D=H?k.height:G+ZE,W=H?Math.max(D,m):D;y.push({nodeId:N.id,label:N.label,lineNumber:N.lineNumber,...I!==void 0&&{color:I},metadata:k.meta,tagMetadata:k.fullMeta,x:Vl,y:Vl,width:O,height:W,labelHeight:G,...T!==void 0&&{hiddenCount:T},...(N.children.length>0||T!=null&&T>0)&&{hasChildren:!0}})}}let b=new Set(g),E=[];for(let k=0;k<t.edges.length;k++){let N=t.edges[k];if(!c.hasNode(N.sourceId)||!c.hasNode(N.targetId))continue;let _;if(b.has(k)){let T=c.node(N.sourceId),R=c.node(N.targetId);if(!T||!R)continue;let G=zP(T.x,T.y,T.width,T.height,R.x,R.y),I=zP(R.x,R.y,R.width,R.height,T.x,T.y),H=(G.x+I.x)/2,O=(G.y+I.y)/2;_=[G,{x:H,y:O},I]}else{let T=c.edge({v:N.sourceId,w:N.targetId,name:`e${k}`});if(!T)continue;_=T.points??[]}E.push({sourceId:N.sourceId,targetId:N.targetId,points:_,...N.label!==void 0&&{label:N.label},lineNumber:N.lineNumber,...b.has(k)&&{deferred:!0}})}{let k=new Set([...u,...f]),N=new Map;for(let O of k)N.set(O,O);let _=O=>{for(;N.get(O)!==O;)N.set(O,N.get(N.get(O))),O=N.get(O);return O},T=(O,D)=>{let W=_(O),z=_(D);W!==z&&N.set(W,z)};for(let O of t.edges)k.has(O.sourceId)&&k.has(O.targetId)&&T(O.sourceId,O.targetId);let R=s.find(O=>!O.sitemapNode.isContainer)?.sitemapNode.id,G=R?_(R):null,I=new Set;for(let O of k)G&&_(O)!==G&&I.add(O);let H=new Set;for(let O of d){if(f.has(O)){I.has(O)&&H.add(O);continue}let D=s.filter(W=>!W.sitemapNode.isContainer&&W.parentContainerId===O);D.length>0&&D.every(W=>I.has(W.sitemapNode.id))&&H.add(O)}if(I.size>0){let O=t.direction==="TB",D=0,W=0,z=1/0,P=1/0;for(let K of v)I.has(K.id)||(D=Math.max(D,K.x+K.width/2),W=Math.max(W,K.y+K.height),z=Math.min(z,K.y),P=Math.min(P,K.x-K.width/2));for(let K of y)H.has(K.nodeId)||(D=Math.max(D,K.x+K.width),W=Math.max(W,K.y+K.height),z=Math.min(z,K.y),P=Math.min(P,K.x));let B=1/0,Y=1/0,V=0,j=0;for(let K of v)I.has(K.id)&&(B=Math.min(B,K.x-K.width/2),Y=Math.min(Y,K.y),V=Math.max(V,K.x+K.width/2),j=Math.max(j,K.y+K.height));for(let K of y)H.has(K.nodeId)&&(B=Math.min(B,K.x),Y=Math.min(Y,K.y),V=Math.max(V,K.x+K.width),j=Math.max(j,K.y+K.height));if(B!==1/0){let K=S7*2,$,U;if(O?($=D+K-B,U=(z===1/0?0:z)-Y):($=(P===1/0?0:P)-B,U=W+K-Y),$!==0||U!==0){for(let X of v)I.has(X.id)&&(X.x+=$,X.y+=U);for(let X of y)H.has(X.nodeId)&&(X.x+=$,X.y+=U);for(let X of E){let q=I.has(X.sourceId),et=I.has(X.targetId);if(q||et)for(let tt of X.points)tt.x+=$,tt.y+=U}}}}}let x=0,L=0;for(let k of v){let N=k.x+k.width/2,_=k.y+k.height;N>x&&(x=N),_>L&&(L=_)}for(let k of y){let N=k.x+k.width,_=k.y+k.height;N>x&&(x=N),_>L&&(L=_)}for(let k of E)for(let N of k.points)N.x>x&&(x=N.x),N.y>L&&(L=N.y);x+=Vl,L+=Vl;let S=new Map;for(let k of t.tagGroups){let N=qt(k.name),_=new Set,T=R=>{!R.isContainer&&R.metadata[N]&&_.add(R.metadata[N].toLowerCase());for(let G of R.children)T(G)};for(let R of t.roots)T(R);S.set(N,_)}let A=v7(t.tagGroups,S),C=n!=null?A.filter(k=>k.name.toLowerCase()===n.toLowerCase()):A,M=o&&n==null,w=k=>n!=null||M?k.width:k.minifiedWidth;if(C.length>0){let k=Se+Wn,N=C.reduce((G,I)=>G+w(I),0)+(C.length-1)*Wn,_=N+Vl*2;_>x&&(x=_);let T=(x-N)/2,R=L+Wn;for(let G of C)G.x=T,G.y=R,T+=w(G)+Wn;L+=k}return{nodes:v,edges:E,containers:y,legend:A,width:x,height:L}}var m7,YP,h7,g7,VP,y7,qP,UP,KP,Vl,XP,b7,ZE,ZP,QP,S7,t1=st(()=>{"use strict";Ke();ss();Ke();Mr();en();m7=13,YP=11,h7=13;g7=16,VP=28,y7=6,qP=20,UP=10,KP=140,Vl=40,XP=24,b7=40,ZE=24,ZP=28,QP=16;S7=20});function L7(t,e){let n=new Map,r=o=>{for(let a of o)for(let i of e.getChildren(a))n.set(e.getId(i),e.getId(a)),r([i])};return r(t),n}function JP(t,e,n,r){let o=t;for(;;){let a=e.get(o);if(!a)return null;if(n.has(a)&&r.has(a))return a;o=a}}function tD(t,e,n,r,o,a){let i=XI(e,o),s=L7(t,o),l=[];for(let c of n){let d=a.getSource(c),u=a.getTarget(c),f=i.has(d),p=i.has(u);if(f&&p){l.push(a.withEndpoints(c,d,u));continue}if(!f){let m=JP(d,s,i,r);if(!m)continue;d=m}if(!p){let m=JP(u,s,i,r);if(!m)continue;u=m}d!==u&&l.push(a.withEndpoints(c,d,u))}return l}var eD=st(()=>{"use strict";yf()});var oD={};ye(oD,{collapseSitemapTree:()=>M7});function rD(t){return{id:t.id,label:t.label,metadata:{...t.metadata},children:t.children.map(rD),parentId:t.parentId,isContainer:t.isContainer,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color}}}function M7(t,e){if(e.size===0)return{parsed:t,hiddenCounts:new Map};let{roots:n,hiddenCounts:r}=sd(t.roots,e,nD),o=tD(t.roots,n,t.edges,e,nD,N7);return{parsed:{...t,roots:n,edges:o},hiddenCounts:r}}var nD,N7,aD=st(()=>{"use strict";yf();eD();nD={getId:t=>t.id,getChildren:t=>t.children,clone:rD,setChildren:(t,e)=>{t.children=e},countsAsHidden:t=>!t.isContainer},N7={getSource:t=>t.sourceId,getTarget:t=>t.targetId,withEndpoints:(t,e,n)=>({...t,sourceId:e,targetId:n})}});var lD={};ye(lD,{renderSitemap:()=>sD,renderSitemapForExport:()=>H7});function I7(t,e,n,r){let o=n??t.primary;return ie(t,o,e,{...r!==void 0&&{solid:r}})}function P7(t,e){return e??t.primary}function D7(t,e,n){return n?Gt(n,nr(t,e),10):Gt(t.surface,t.bg,40)}function O7(t,e){return e??t.textMuted}function sD(t,e,n,r,o,a,i,s,l,c){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let d=i?.width??t.clientWidth,u=i?.height??t.clientHeight;if(d<=0||u<=0)return;let f=Ee.identity(),p=f.aesthetic(T7),m=f.text(13),h=f.text(11),g=f.structural(16),v=f.structural(28),y=f.structural(6),b=f.structural(1.5),E=f.structural(1.5),x=f.text(A7),L=f.text(13),S=f.text(11),A=f.structural(16),C=f.structural(28),M=f.text(20),w=f.structural(_7),k=f.structural(6),N=f.aesthetic(R7),_=n.legend.length>0,T=Se+Wn,R=!!e.title&&e.options["no-title"]!=="on",G=!i&&_,I=G&&R,H=I?w:0,O=f.structural(G?Tr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview",capsulePillAddonWidth:Mo+wi},d):Se),D=G?O+N:0,W=H+D,z=0,P=!I&&R?w:0,B=n.width,Y=n.height+P;G&&(Y-=T);let V=u-p*2-W-z,j=(d-p*2)/B,K=V/Y,$=Math.min(C7,j,K),U=B*$,X=(d-U)/2,q=p+W,et=Rt(t).append("svg").attr("width",d).attr("height",u).attr("viewBox",`0 0 ${d} ${u}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It);f.isBelowFloor&&et.attr("width","100%");let tt=et.append("defs");tt.append("marker").attr("id","sm-arrow").attr("viewBox",`0 0 ${Qs} ${Ii}`).attr("refX",Qs).attr("refY",Ii/2).attr("markerWidth",Qs).attr("markerHeight",Ii).attr("orient","auto").append("polygon").attr("points",`0,0 ${Qs},${Ii/2} 0,${Ii}`).attr("fill",r.textMuted);let F=new Set;for(let J of F){let at=`sm-arrow-${J.replace("#","")}`;tt.append("marker").attr("id",at).attr("viewBox",`0 0 ${Qs} ${Ii}`).attr("refX",Qs).attr("refY",Ii/2).attr("markerWidth",Qs).attr("markerHeight",Ii).attr("orient","auto").append("polygon").attr("points",`0,0 ${Qs},${Ii/2} 0,${Ii}`).attr("fill",J)}let Q=et.append("g").attr("transform",`translate(${X}, ${q}) scale(${$})`);if(!I&&R){let J=Q.append("text").attr("x",B/2).attr("y",M).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",M).attr("font-weight","700").attr("class","sitemap-title chart-title");e.titleLineNumber&&(J.attr("data-line-number",e.titleLineNumber),a&&J.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))),J.text(e.title)}let ot=G?-T:0,Z=Q.append("g").attr("transform",`translate(0, ${P+ot})`),lt=new Map,nt=new Map;for(let J of e.tagGroups){lt.set(qt(J.name),J.name);for(let at of J.entries)nt.set(`${qt(J.name)}:${at.value.toLowerCase()}`,at.color)}for(let J of n.containers){let at=Z.append("g").attr("transform",`translate(${J.x}, ${J.y})`).attr("class","sitemap-container").attr("data-line-number",String(J.lineNumber));if(J.hasChildren&&at.attr("data-node-toggle",J.nodeId).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!J.hiddenCount)).attr("aria-label",J.label),a&&at.style("cursor","pointer").on("click",()=>a(J.lineNumber)),s){let At=qt(s),rt=J.tagMetadata[At];rt&&at.attr(`data-tag-${At}`,rt.toLowerCase())}let it=D7(r,o,J.color),vt=O7(r,J.color);at.append("rect").attr("x",0).attr("y",0).attr("width",J.width).attr("height",J.height).attr("rx",8).attr("fill",it).attr("stroke",vt).attr("stroke-opacity",.35).attr("stroke-width",E),at.append("text").attr("x",J.width/2).attr("y",C/2+L/2-2).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",L).attr("font-weight","bold").text(J.label);let Tt=Object.entries(J.metadata);if(Tt.length>0){let At=Tt.map(([dt])=>lt.get(dt)??dt),pt=10+Math.max(...At.map(dt=>_t(`${dt}: `,S))),ht=C+S-2;for(let dt=0;dt<Tt.length;dt++){let[ut,yt]=Tt[dt],kt=At[dt],Ot=ht+dt*A,Xt=nt.get(`${ut}:${yt.toLowerCase()}`)??r.text;at.append("text").attr("x",10).attr("y",Ot).attr("fill",r.textMuted).attr("font-size",S).text(`${kt}: `),at.append("text").attr("x",pt).attr("y",Ot).attr("fill",Xt).attr("font-size",S).text(yt)}}if(!i&&J.hiddenCount&&J.hiddenCount>0){let At=`clip-${J.nodeId}`;at.append("clipPath").attr("id",At).append("rect").attr("width",J.width).attr("height",J.height).attr("rx",8),at.append("rect").attr("y",J.height-k).attr("width",J.width).attr("height",k).attr("fill",vt).attr("clip-path",`url(#${At})`).attr("class","sitemap-collapse-bar")}}for(let J of n.edges){if(J.points.length<2)continue;let at=Z.append("g").attr("class","sitemap-edge-group").attr("data-line-number",String(J.lineNumber)).attr("data-from",J.sourceId).attr("data-to",J.targetId),it=r.textMuted,vt="sm-arrow",At=(J.deferred?$7:G7)(J.points);if(At&&at.append("path").attr("d",At).attr("fill","none").attr("stroke",it).attr("stroke-width",b).attr("marker-end",`url(#${vt})`).attr("class","sitemap-edge"),J.label&&J.points.length>=2){let rt=J.points[Math.floor(J.points.length/2)],pt=_t(J.label,x)+10,ht=x+6;at.append("rect").attr("x",rt.x-pt/2).attr("y",rt.y-ht/2-1).attr("width",pt).attr("height",ht).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","sitemap-edge-label-bg"),at.append("text").attr("x",rt.x).attr("y",rt.y+4).attr("text-anchor","middle").attr("fill",it).attr("font-size",x).attr("class","sitemap-edge-label").text(J.label)}}for(let J of n.nodes){let at=Z.append("g").attr("transform",`translate(${J.x-J.width/2}, ${J.y})`).attr("class","sitemap-node").attr("data-line-number",String(J.lineNumber)).attr("data-node-id",J.id);if(J.hasChildren&&at.attr("data-node-toggle",J.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!J.hiddenCount)),a&&at.style("cursor","pointer").on("click",()=>a(J.lineNumber)),s){let pt=qt(s),ht=J.tagMetadata[pt];ht&&at.attr(`data-tag-${pt}`,ht.toLowerCase())}let it=e.options["solid-fill"]==="on",vt=I7(r,o,J.color,it),Tt=P7(r,J.color),At=ve(vt,r.textOnFillLight,r.textOnFillDark);rd(at,{width:J.width,height:J.height,rx:6,fill:vt,stroke:Tt,strokeWidth:E,label:J.label,labelColor:At,labelFontSize:m,headerHeight:v});let rt=Object.entries(J.metadata);if(rt.length>0){at.append("line").attr("x1",0).attr("y1",v).attr("x2",J.width).attr("y2",v).attr("stroke",it?At:Tt).attr("stroke-opacity",.3);let pt=rt.map(([ut])=>lt.get(ut)??ut),dt=10+Math.max(...pt.map(ut=>_t(`${ut}: `,h)));for(let ut=0;ut<rt.length;ut++){let[yt,kt]=rt[ut],Ot=pt[ut],Xt=v+y+(ut+1)*g-4,bt=nt.get(`${yt}:${kt.toLowerCase()}`),Nt=it?At:bt??At;at.append("text").attr("x",10).attr("y",Xt).attr("fill",At).attr("font-size",h).text(`${Ot}:`),at.append("text").attr("x",dt).attr("y",Xt).attr("fill",Nt).attr("font-size",h).text(kt)}}if(J.description&&J.description.length>0){let pt=Object.keys(J.metadata).length,ht=pt>0?v+y+pt*g:v;at.append("line").attr("x1",0).attr("y1",ht).attr("x2",J.width).attr("y2",ht).attr("stroke",it?At:Tt).attr("stroke-opacity",.3);let dt=v+y+pt*g;for(let ut=0;ut<J.description.length;ut++){let yt=ta(J.description[ut]),kt=dt+(ut+1)*g-4,Ot=at.append("text").attr("x",10).attr("y",kt).attr("fill",At).attr("font-size",h);gn(Ot,yt,r,h)}}if(!i&&J.hiddenCount&&J.hiddenCount>0){let pt=`clip-${J.id}`;at.append("clipPath").attr("id",pt).append("rect").attr("width",J.width).attr("height",J.height).attr("rx",6),at.append("rect").attr("y",J.height-k).attr("width",J.width).attr("height",k).attr("fill",it?At:J.color??r.primary).attr("opacity",.5).attr("clip-path",`url(#${pt})`)}}if(i&&_&&iD(Z,n.legend,r,o,s,void 0,l,c),I){let J=et.append("text").attr("x",d/2).attr("y",p+M).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",M).attr("font-weight","700").attr("class","sitemap-title chart-title").style("font-family",It);e.titleLineNumber&&(J.attr("data-line-number",e.titleLineNumber),a&&J.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))),J.text(e.title)}if(G){let J=et.append("g").attr("class","sitemap-legend-fixed").attr("transform",`translate(0, ${p+H})`);s&&J.attr("data-legend-active",s.toLowerCase()),iD(J,n.legend,r,o,s,d,l,c)}}function iD(t,e,n,r,o,a,i,s){if(e.length===0)return;let l=e.map(p=>({name:p.name,entries:p.entries.map(m=>({value:m.value,color:m.color}))})),c=a!=null,d=c?Mo+wi:0,u=a??e[0].x+(e[0].width??200),f=fn(t,{groups:l,activeGroup:o??null,mode:s?"export":"preview",capsulePillAddonWidth:d,palette:n,isDark:r,width:u});if(t.selectAll("[data-legend-group]").classed("sitemap-legend-group",!0),c){let p=f.getLayout();if(p.activeCapsule?.addonX!=null){let m=p.activeCapsule,h=qt(m.groupName),g=i?.has(h)??!1,v=t.select(`[data-legend-group="${h}"]`);if(!v.empty()){let y=m.addonX,b=(Se-Mo)/2,E=6,x=v.append("g").attr("class","sitemap-legend-eye").attr("data-legend-visibility",h).style("cursor","pointer").attr("opacity",g?.4:.7);x.append("rect").attr("x",y-E).attr("y",b-E).attr("width",Mo+E*2).attr("height",Mo+E*2).attr("fill","transparent").attr("pointer-events","all"),x.append("path").attr("d",g?Dm:Pm).attr("transform",`translate(${y}, ${b})`).attr("fill","none").attr("stroke",n.textMuted).attr("stroke-width",1.2).attr("stroke-linecap","round").attr("stroke-linejoin","round")}}}}async function H7(t,e,n){let{parseSitemap:r}=await Promise.resolve().then(()=>(Ju(),ew)),{layoutSitemap:o}=await Promise.resolve().then(()=>(t1(),JE)),{getPalette:a}=await Promise.resolve().then(()=>(gi(),vx)),i=e==="dark",s=n??(i?a("nord").dark:a("nord").light),l=r(t,s);if(l.error||l.roots.length===0)return"";let c=o(l,void 0,null,void 0,!0),d=20,u=l.title?30:0,f=c.width+d*2,p=c.height+d*2+u,m=document.createElement("div");m.style.width=`${f}px`,m.style.height=`${p}px`,m.style.position="absolute",m.style.left="-9999px",document.body.appendChild(m),sD(m,l,c,s,i,void 0,{width:f,height:p});let h=m.querySelector("svg");if(!h)return document.body.removeChild(m),"";e==="transparent"?h.style.background="none":h.style.background||(h.style.background=s.bg),h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.style.fontFamily=It;let g=h.outerHTML;return document.body.removeChild(m),g}var T7,C7,_7,Qs,Ii,A7,R7,G7,$7,cD=st(()=>{"use strict";Ke();Xn();Eo();on();tn();_o();Ka();en();Mr();Br();To();fr();Oh();T7=20,C7=3,_7=30,Qs=10,Ii=7,A7=11,R7=8;G7=Kn().x(t=>t.x).y(t=>t.y).curve(fo),$7=Kn().x(t=>t.x).y(t=>t.y).curve(Zi)});function ag(t){return t.toLowerCase()===W7}var W7,dD=st(()=>{"use strict";W7="archive"});var bD={};ye(bD,{renderKanban:()=>yD,renderKanbanForExport:()=>B7});function mg(t,e,n){let r=[];for(let o of e){if(n?.includes(o.name.toLowerCase()))continue;let i=t.tags[qt(o.name)]??o.defaultValue;if(!i)continue;let s=o.entries.find(l=>l.value.toLowerCase()===i.toLowerCase());r.push({label:o.name,value:i,...s?.color!==void 0&&{color:s.color}})}return r}function hD(t,e,n){if(!n)return t.color;let r=e.find(s=>s.name.toLowerCase()===n.toLowerCase());if(!r)return t.color;let a=t.tags[qt(r.name)]??r.defaultValue;return a?r.entries.find(s=>s.value.toLowerCase()===a.toLowerCase())?.color:void 0}function gD(t,e,n,r,o=Ef,a=dg,i=ug,s=r1,l=ig,c=sg,d=cg,u=yd,f=gd,p=hd,m=md,h=fg,g=lg,v=e1,y=Sf,b=pg){let x=!!t.title&&t.options["no-title"]!=="on"?a+8:0,L=o+x,S=[],A=0,C=t.columns.filter(N=>!ag(N.name));for(let N of C){if(n?.has(N.id)??!1){S.push({x:0,y:L,width:b,height:0,column:N,cardLayouts:[]});continue}let T=_t(N.name,s),R=[],G=l+c;for(let O of N.cards){let D=_t(O.title,i);T=Math.max(T,D+d*2);let W=mg(O,t.tagGroups,r),z=W.length+O.details.length,P=z>0?f+1+u+z*p:0,B=m+u+P;for(let Y of W){let V=_t(`${Y.label}: ${Y.value}`,h)+d*2;T=Math.max(T,V)}R.push({x:c,y:G,width:0,height:B,card:O}),G+=B+g}let I=Math.max(v,T+c*2);for(let O of R)O.width=I-c*2;let H=G+c;A=Math.max(A,H),S.push({x:0,y:L,width:I,height:H,column:N,cardLayouts:R})}let M=o;for(let N of S)N.x=M,N.height=A,M+=N.width+y;let w=M-y+o,k=L+A+o;return{columns:S,totalWidth:w,totalHeight:k}}function yD(t,e,n,r,o){let a=o?.exportDims,i=o?.activeTagGroup??null,s=o?.onSwimlaneChange,l=o?.collapsedLanes,c=o?.collapsedColumns??new Set(e.columns.filter(F=>F.collapsed).map(F=>F.id)),d=o?.compactMeta??!1,u=e.options["solid-fill"]==="on",f=o?.currentSwimlaneGroup??null,p=f?e.tagGroups.find(F=>F.name.toLowerCase()===f.toLowerCase())??null:null,m=[];d&&(i&&m.push(i.toLowerCase()),f&&m.push(f.toLowerCase()));let h=e.columns.filter(F=>!ag(F.name)),g=Math.max(1,h.length),v=g*e1+(g-1)*Sf+2*Ef,y=a?.width??t.getBoundingClientRect().width,b=a||y<=0?Ee.identity():Ee.from(y,v),E=b.aesthetic(Ef),x=b.aesthetic(Sf),L=b.structural(ig),S=b.aesthetic(sg),A=b.structural(e1),C=b.structural(md),M=b.structural(hd),w=b.structural(gd),k=b.aesthetic(lg),N=b.structural(6),_=b.aesthetic(cg),T=b.aesthetic(yd),R=b.structural(n1),G=b.structural(dg),I=b.text(r1),H=b.text(ug),O=b.text(fg),D=b.text(fD),W=b.structural(pD),z=b.structural(mD),P=b.structural(pg),B=b.structural(o1),Y=b.text(20),V=b.structural(a1),j=b.aesthetic(i1),K=gD(e,n,c,m,E,G,H,I,L,S,_,T,w,M,C,O,k,A,x,P),$=a?.width??K.totalWidth,U=a?.height??K.totalHeight;t.innerHTML="";let X=Rt(t).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("width",$).attr("height",U).attr("viewBox",`0 0 ${$} ${U}`).attr("preserveAspectRatio","xMidYMin meet").attr("font-family",It).style("background",n.bg);b.isBelowFloor&&X.attr("width","100%");let q=!!e.title&&e.options["no-title"]!=="on";if(q&&X.append("text").attr("class","chart-title").attr("data-line-number",e.titleLineNumber??0).attr("x",E).attr("y",E+Y).attr("font-size",Y).attr("font-weight","700").attr("fill",n.text).text(e.title),e.tagGroups.length>0){let F=q?We(e.title,Y)+16:0,Q=E+F,ot={groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:o?.exportMode?"export":"preview"},Z=Tr(ot,$-Q-E),lt=E+(Y-Z)/2,nt=X.append("g").attr("class","kanban-legend").attr("transform",`translate(${Q},${lt})`),at=!!s&&!a?{onGroupRendered:(it,vt,Tt)=>{let At=p?.name.toLowerCase()===it.toLowerCase(),rt=We(it,11),pt=Tt?10+rt+6:8+rt+4,ht=(Se-7)/2,dt=F7(vt,pt,ht,At,n);dt.append("title").text(`Group by ${it}`),dt.style("cursor","pointer").on("click",ut=>{ut.stopPropagation(),s?.(At?null:it)})}}:void 0;fn(nt,{...ot,palette:n,isDark:r,width:$-Q-E,activeGroup:i??null,...at!==void 0&&{callbacks:at}})}if(p){V7(X,e,K,p,n,r,i,l,c,m,E,G,V,x,P,L,S,C,T,k,B,j,w,M,I,W,z,D,N,_,R,H,O);return}let et=r?Gt(n.surface,n.bg,50):Gt(n.surface,n.bg,30),tt=r?Gt(n.surface,n.bg,70):Gt(n.surface,n.bg,50);for(let F of K.columns){let Q=F.column,ot=c?.has(Q.id)??!1,Z=X.append("g").attr("class","kanban-column").attr("data-column-id",Q.id).attr("data-line-number",Q.lineNumber),lt=et,nt=Q.color?ie(n,Q.color,r,{solid:u}):tt,J=Q.color?ve(nt,n.textOnFillLight,n.textOnFillDark):n.text;if(ot){Z.append("rect").attr("x",F.x).attr("y",F.y).attr("width",P).attr("height",F.height).attr("rx",W).attr("fill",lt),Z.append("rect").attr("x",F.x).attr("y",F.y).attr("width",P).attr("height",L).attr("rx",z).attr("fill",nt),Z.append("text").attr("x",F.x+P/2).attr("y",F.y+L/2+D/2-1).attr("font-size",D).attr("font-weight","bold").attr("fill",Q.color?J:n.textMuted).attr("text-anchor","middle").text(String(Q.cards.length)),Z.append("text").attr("x",F.x+P/2).attr("y",F.y+L+S).attr("font-size",H).attr("font-weight","bold").attr("fill",n.text).attr("text-anchor","middle").attr("writing-mode","tb").text(Q.name);continue}Z.append("rect").attr("x",F.x).attr("y",F.y).attr("width",F.width).attr("height",F.height).attr("rx",W).attr("fill",lt),Z.append("rect").attr("x",F.x).attr("y",F.y).attr("width",F.width).attr("height",L).attr("rx",z).attr("fill",nt),Z.append("text").attr("x",F.x+S).attr("y",F.y+L/2+I/2-2).attr("font-size",I).attr("font-weight","bold").attr("fill",J).text(Q.name);{let at=Q.wipLimit!=null&&Q.cards.length>Q.wipLimit,it=Q.wipLimit!=null?`${Q.cards.length}/${Q.wipLimit}`:String(Q.cards.length);Z.append("text").attr("x",F.x+F.width-S).attr("y",F.y+L/2+D/2-1).attr("text-anchor","end").attr("font-size",D).attr("fill",at?n.colors.red:Q.color?J:n.textMuted).attr("font-weight",at?"bold":"normal").text(it)}for(let at of F.cardLayouts){let it=at.card,vt=hD(it,e.tagGroups,i??null),Tt=mg(it,e.tagGroups,m),At=Tt.length>0||it.details.length>0,rt=ie(n,vt??n.primary,r,{solid:u}),pt=vt??n.textMuted,ht=ve(rt,n.textOnFillLight,n.textOnFillDark),dt=Z.append("g").attr("class","kanban-card").attr("data-card-id",it.id).attr("data-line-number",it.lineNumber);if(i){let Ot=qt(i),Xt=it.tags[Ot],bt=e.tagGroups.find(Vt=>Vt.name.toLowerCase()===Ot),Nt=Xt??bt?.defaultValue;Nt&&dt.attr(`data-tag-${Ot}`,Nt.toLowerCase())}let ut=F.x+at.x,yt=F.y+at.y;dt.append("rect").attr("x",ut).attr("y",yt).attr("width",at.width).attr("height",at.height).attr("rx",N).attr("fill",rt).attr("stroke",pt).attr("stroke-width",R);let kt=dt.append("text").attr("x",ut+_).attr("y",yt+T+H).attr("font-size",H).attr("font-weight","500").attr("fill",ht);if(gn(kt,it.title,n,H),At){let Ot=yt+C;dt.append("line").attr("x1",ut).attr("y1",Ot).attr("x2",ut+at.width).attr("y2",Ot).attr("stroke",u?ht:pt).attr("stroke-opacity",.3).attr("stroke-width",1);let Xt=Ot+w+O;for(let bt of Tt){dt.append("text").attr("x",ut+_).attr("y",Xt).attr("font-size",O).attr("fill",ht).text(`${bt.label}: `);let Nt=_t(`${bt.label}: `,O);dt.append("text").attr("x",ut+_+Nt).attr("y",Xt).attr("font-size",O).attr("fill",ht).text(bt.value),Xt+=M}for(let bt of it.details){let Nt=dt.append("text").attr("x",ut+_).attr("y",Xt).attr("font-size",O).attr("fill",ht);gn(Nt,bt,n,O),Xt+=M}}}}}function B7(t,e,n){let r=qc(t,n);if(r.error||r.columns.length===0)return"";let o=e==="dark",a=gD(r,n),i=document.createElement("div");return yD(i,r,n,o,{exportDims:{width:a.totalWidth,height:a.totalHeight},exportMode:!0}),i.querySelector("svg")?.outerHTML??""}function F7(t,e,n,r,o){let a=t.append("g").attr("class","kanban-swimlane-icon").attr("transform",`translate(${e}, ${n})`);a.append("rect").attr("x",-5).attr("y",-5).attr("width",22).attr("height",18).attr("fill","transparent");let i=r?o.primary:o.textMuted,s=r?1:.35,l=[8,12,6],c=2,d=3;for(let u=0;u<l.length;u++)a.append("rect").attr("x",0).attr("y",u*d).attr("width",l[u]).attr("height",c).attr("rx",1).attr("fill",i).attr("opacity",s);return a}function Y7(t,e){let n=qt(e.name),r=new Map;for(let a of e.entries)r.set(a.value.toLowerCase(),{laneName:a.value,laneColor:a.color,isFallback:!1,cellsByColumn:{}});let o=`__no_${n}__`;for(let a of t)for(let i of a.cards){let s=i.tags[n]??e.defaultValue,l;s&&r.has(s.toLowerCase())?l=s.toLowerCase():(r.has(o)||r.set(o,{laneName:`No ${e.name}`,isFallback:!0,cellsByColumn:{}}),l=o);let c=r.get(l);(c.cellsByColumn[a.id]??=[]).push(i)}return Array.from(r.values())}function uD(t,e,n,r=gd,o=yd,a=hd,i=md){let l=mg(t,e,n).length+t.details.length,c=l>0?r+1+o+l*a:0;return i+o+c}function z7(t,e,n,r,o,a,i=Ef,s=dg,l=a1,c=Sf,d=pg,u=ig,f=sg,p=md,m=yd,h=lg,g=o1,v=i1,y=gd,b=hd){let E=t.title&&t.options["no-title"]!=="on"?s+8:0,x=i+E,L=[],S=i+l;for(let N of n.columns){let T=o?.has(N.column.id)??!1?d:N.width;L.push({column:N.column,x:S,width:T}),S+=T+c}let A=S-c+i,C=[],M=x+u+f,w=p+m+h;for(let N of e){if(r?.has(N.laneName)??!1){let H=L.map(O=>({column:O.column,cards:N.cellsByColumn[O.column.id]??[],cardLayouts:[]}));C.push({bucket:N,y:M,height:g,cells:H}),M+=g+v;continue}let T=w,R=[];for(let H of L){let O=o?.has(H.column.id)??!1,D=N.cellsByColumn[H.column.id]??[];if(O){R.push({column:H.column,cards:D,h:0});continue}let W=0;for(let z of D)W+=uD(z,t.tagGroups,a,y,m,b,p)+h;W=Math.max(W-(D.length>0?h:0),0),R.push({column:H.column,cards:D,h:W}),W>T&&(T=W)}let G=Math.max(T,w),I=R.map((H,O)=>{let D=L[O];if(o?.has(D.column.id)??!1)return{column:H.column,cards:H.cards,cardLayouts:[]};let z=[],P=0;for(let B of H.cards){let Y=uD(B,t.tagGroups,a,y,m,b,p);z.push({x:D.x+f,y:M+P,width:D.width-f*2,height:Y,card:B}),P+=Y+h}return{column:H.column,cards:H.cards,cardLayouts:z}});C.push({bucket:N,y:M,height:G,cells:I}),M+=G+v}let k=M-v+f+i;return{columnXs:L,lanes:C,totalWidth:A,totalHeight:k,startY:x}}function V7(t,e,n,r,o,a,i,s,l,c,d=Ef,u=dg,f=a1,p=Sf,m=pg,h=ig,g=sg,v=md,y=yd,b=lg,E=o1,x=i1,L=gd,S=hd,A=r1,C=pD,M=mD,w=fD,k=6,N=cg,_=n1,T=ug,R=fg){let G=e.columns.filter(P=>!ag(P.name)),I=Y7(G,r),H=z7(e,I,n,s,l,c,d,u,f,p,m,h,g,v,y,b,E,x,L,S),O=parseFloat(t.attr("width")||"0"),D=parseFloat(t.attr("height")||"0");H.totalWidth>O&&(t.attr("width",H.totalWidth),t.attr("viewBox",`0 0 ${H.totalWidth} ${Math.max(D,H.totalHeight)}`)),H.totalHeight>D&&(t.attr("height",H.totalHeight),t.attr("viewBox",`0 0 ${Math.max(O,H.totalWidth)} ${H.totalHeight}`));let W=a?Gt(o.surface,o.bg,50):Gt(o.surface,o.bg,30),z=a?Gt(o.surface,o.bg,70):Gt(o.surface,o.bg,50);for(let P of H.columnXs){let B=P.column,Y=l?.has(B.id)??!1,V=t.append("g").attr("class","kanban-column kanban-column-header").attr("data-column-id",B.id).attr("data-line-number",B.lineNumber),j=B.color?ie(o,B.color,a,{solid:e.options["solid-fill"]==="on"}):z;if(V.append("rect").attr("x",P.x).attr("y",H.startY).attr("width",P.width).attr("height",h).attr("rx",M).attr("fill",j),Y)V.append("text").attr("x",P.x+P.width/2).attr("y",H.startY+h/2+w/2-1).attr("font-size",w).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String(B.cards.length));else{V.append("text").attr("x",P.x+g).attr("y",H.startY+h/2+A/2-2).attr("font-size",A).attr("font-weight","bold").attr("fill",o.text).text(B.name);let K=B.wipLimit!=null&&B.cards.length>B.wipLimit,$=B.wipLimit!=null?`${B.cards.length}/${B.wipLimit}`:String(B.cards.length);V.append("text").attr("x",P.x+P.width-g).attr("y",H.startY+h/2+w/2-1).attr("text-anchor","end").attr("font-size",w).attr("fill",K?o.colors.red:o.textMuted).attr("font-weight",K?"bold":"normal").text($)}}for(let P of H.lanes){let B=s?.has(P.bucket.laneName)??!1,Y=t.append("g").attr("class","kanban-lane").attr("data-lane-name",P.bucket.laneName),V=Y.append("g").attr("class","kanban-lane-header").attr("transform",`translate(${d}, ${P.y-g})`);V.append("rect").attr("x",0).attr("y",0).attr("width",f-8).attr("height",P.height+g*2).attr("rx",C).attr("fill",W);let j=10,K=P.cells.reduce(($,U)=>$+U.cards.length,0);if(P.bucket.laneColor&&(V.append("circle").attr("cx",j+4).attr("cy",16).attr("r",4).attr("fill",P.bucket.laneColor),j+=14),B?V.append("text").attr("x",j).attr("y",20).attr("font-size",10).attr("fill",o.textMuted).text(`${P.bucket.laneName} (${K})`):V.append("text").attr("x",j).attr("y",20).attr("font-size",12).attr("font-weight","bold").attr("fill",P.bucket.isFallback?o.textMuted:o.text).text(P.bucket.laneName),B)for(let $ of P.cells){let U=l?.has($.column.id)??!1;if($.cards.length>0){let X=H.columnXs.find(tt=>tt.column.id===$.column.id);if(!X)continue;let q=P.bucket.laneColor?Gt(P.bucket.laneColor,o.bg,a?40:28):Gt(o.textMuted,o.bg,a?28:22),et=U?m-8:X.width-g*2;Y.append("rect").attr("x",X.x+(U?4:g)).attr("y",P.y).attr("width",et).attr("height",18).attr("rx",4).attr("fill",q),Y.append("text").attr("x",X.x+(U?4:g)+et/2).attr("y",P.y+13).attr("font-size",w).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String($.cards.length))}}if(Y.append("line").attr("x1",d+f).attr("x2",H.totalWidth-d).attr("y1",P.y+P.height+g).attr("y2",P.y+P.height+g).attr("stroke",o.border??o.textMuted).attr("stroke-opacity",.4).attr("stroke-width",1),!B)for(let $ of P.cells){if((l?.has($.column.id)??!1)&&$.cards.length>0){let X=H.columnXs.find(q=>q.column.id===$.column.id);if(X){let q=P.bucket.laneColor?Gt(P.bucket.laneColor,o.bg,a?40:28):Gt(o.textMuted,o.bg,a?28:22);Y.append("rect").attr("x",X.x+4).attr("y",P.y).attr("width",m-8).attr("height",22).attr("rx",4).attr("fill",q),Y.append("text").attr("x",X.x+m/2).attr("y",P.y+16).attr("font-size",w).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String($.cards.length))}continue}for(let X of $.cardLayouts)U7(Y,X,e.tagGroups,i,o,a,c,e.options["solid-fill"]==="on",k,N,y,_,T,R,v,L,S)}}}function U7(t,e,n,r,o,a,i,s,l=6,c=cg,d=yd,u=n1,f=ug,p=fg,m=md,h=gd,g=hd){let v=e.card,y=hD(v,n,r),b=mg(v,n,i),E=b.length>0||v.details.length>0,x=ie(o,y??o.primary,a,{...s!==void 0&&{solid:s}}),L=y??o.textMuted,S=ve(x,o.textOnFillLight,o.textOnFillDark),A=t.append("g").attr("class","kanban-card").attr("data-card-id",v.id).attr("data-line-number",v.lineNumber);if(r){let k=qt(r),N=n.find(T=>T.name.toLowerCase()===k),_=v.tags[k]??N?.defaultValue;_&&A.attr(`data-tag-${k}`,_.toLowerCase())}let C=e.x,M=e.y;A.append("rect").attr("x",C).attr("y",M).attr("width",e.width).attr("height",e.height).attr("rx",l).attr("fill",x).attr("stroke",L).attr("stroke-width",u);let w=A.append("text").attr("x",C+c).attr("y",M+d+f).attr("font-size",f).attr("font-weight","500").attr("fill",S);if(gn(w,v.title,o,f),E){let k=M+m;A.append("line").attr("x1",C).attr("y1",k).attr("x2",C+e.width).attr("y2",k).attr("stroke",L).attr("stroke-opacity",.3).attr("stroke-width",1);let N=k+h+p;for(let _ of b){A.append("text").attr("x",C+c).attr("y",N).attr("font-size",p).attr("fill",o.textMuted).text(`${_.label}: `);let T=_t(`${_.label}: `,p);A.append("text").attr("x",C+c+T).attr("y",N).attr("font-size",p).attr("fill",S).text(_.value),N+=g}for(let _ of v.details){let T=A.append("text").attr("x",C+c).attr("y",N).attr("font-size",p).attr("fill",o.textMuted);gn(T,_,o,p),N+=g}}}var Ef,Sf,ig,sg,e1,md,hd,gd,lg,cg,yd,n1,dg,r1,ug,fg,fD,pD,mD,pg,o1,a1,i1,xD=st(()=>{"use strict";Ke();Xn();on();tn();_o();fh();dD();Mr();To();Br();fr();en();Ef=20,Sf=16,ig=36,sg=12,e1=200,md=24,hd=14,gd=4,lg=8,cg=10,yd=6,n1=1.5,dg=30,r1=13,ug=12,fg=10,fD=10,pD=8,mD=8,pg=40,o1=26;a1=140,i1=14});var ED={};ye(ED,{layoutClassDiagram:()=>l1});function Q7(t){let e=t.members.filter(d=>!d.isMethod),n=t.members.filter(d=>d.isMethod),r=t.modifier==="enum",o=_t(t.name,K7);t.modifier&&(o=Math.max(o,_t(`\xAB${t.modifier}\xBB`,wD)));for(let d of t.members){let u=d.name;d.isMethod?(u+=`(${d.params??""})`,d.type&&(u+=`: ${d.type}`)):d.type&&(u+=`: ${d.type}`),u=`+ ${u}`,o=Math.max(o,_t(u,wD))}let a=Math.max(X7,o+j7),i=q7+(t.modifier?Z7:0),s;if(r){let d=t.members;d.length>0?s=bd*2+d.length*s1+xd:s=xd+bd}else e.length>0?s=bd*2+e.length*s1+xd:s=xd+bd;let l=0;r||(n.length>0?l=bd*2+n.length*s1+xd:l=xd+bd);let c=i+s+l;return{width:a,height:c,headerHeight:i,fieldsHeight:s,methodsHeight:l}}function l1(t,e){if(t.classes.length===0)return{nodes:[],edges:[],width:0,height:0};let n=new er.graphlib.Graph;n.setGraph({rankdir:"TB",nodesep:60,ranksep:80,edgesep:20}),n.setDefaultEdgeLabel(()=>({}));let r=new Map;for(let x of t.classes){let L=Q7(x);r.set(x.id,L),n.setNode(x.id,{label:x.name,width:L.width,height:L.height})}for(let x of t.relationships)n.setEdge(x.source,x.target,{label:x.label??""});er.layout(n);let a=t.options?.["no-notes"]==="on"||!t.notes?new Map:no(t.notes,t.classes.map(x=>({id:x.id,label:x.name}))),i=$c(t.classes.map(x=>{let L=n.node(x.id);return{id:x.id,x:L.x,y:L.y,width:L.width,height:L.height}}),a,"TB",e?.collapsedNotes),s=t.classes.map(x=>{let L=n.node(x.id),S=r.get(x.id),A=i.get(x.id);return{...x,x:L.x,y:L.y,width:S.width,height:S.height,headerHeight:S.headerHeight,fieldsHeight:S.fieldsHeight,methodsHeight:S.methodsHeight,...A&&{note:A}}}),l=t.relationships.map(x=>{let L=n.edge(x.source,x.target);return{source:x.source,target:x.target,type:x.type,points:L?.points??[],...x.label!==void 0&&{label:x.label},lineNumber:x.lineNumber}}),c=1/0,d=1/0,u=-1/0,f=-1/0,p=(x,L,S,A)=>{x<c&&(c=x),L<d&&(d=L),S>u&&(u=S),A>f&&(f=A)};for(let x of s)p(x.x-x.width/2,x.y-x.height/2,x.x+x.width/2,x.y+x.height/2),x.note&&!x.note.collapsed&&p(x.x+x.note.x,x.y+x.note.y,x.x+x.note.x+x.note.width,x.y+x.note.y+x.note.height);Number.isFinite(c)||(c=0,d=0,u=0,f=0);let{shiftX:m,shiftY:h}=Hs(c,d),g=m!==0||h!==0,v=g?s.map(x=>({...x,x:x.x+m,y:x.y+h})):s,y=g?l.map(x=>({...x,points:x.points.map(L=>({x:L.x+m,y:L.y+h}))})):l,b=u+m+40,E=f+h+40;return{nodes:v,edges:y,width:b,height:E}}var X7,j7,q7,K7,wD,Z7,s1,bd,xd,c1=st(()=>{"use strict";ss();en();ts();X7=140,j7=24,q7=36,K7=13,wD=11,Z7=16,s1=18,bd=8,xd=1});var MD={};ye(MD,{renderClassDiagram:()=>ND,renderClassDiagramForExport:()=>hZ});function kD(t,e,n){if(n)return e.textMuted;switch(t){case"interface":return e.colors.blue;case"abstract":return e.colors.purple;case"enum":return e.colors.yellow;default:return e.colors.teal}}function iZ(t,e,n,r,o,a){let i=r??kD(n,t,o);return ie(t,i,e,{...a!==void 0&&{solid:a}})}function sZ(t,e,n,r){return n??kD(e,t,r)}function LD(t){if(t.options?.["no-auto-color"])return[];let e=new Set;for(let n of t.classes)n.color||e.add(n.modifier??"class");return cZ.filter(n=>e.has(n)).map(n=>lZ[n])}function dZ(t){return t??"class"}function vD(t){switch(t){case"public":return"+";case"private":return"-";case"protected":return"#"}}function fZ(t){return t==="implements"||t==="depends"}function pZ(t){switch(t){case"extends":return"cd-arrow-inherit";case"implements":return"cd-arrow-implement";case"composes":return"cd-arrow-compose";case"aggregates":return"cd-arrow-aggregate";case"depends":return"cd-arrow-depend";case"associates":return"cd-arrow-assoc"}}function mZ(t){return t==="composes"||t==="aggregates"}function ND(t,e,n,r,o,a,i,s,l){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let c=i?.width??t.clientWidth,d=i?.height??t.clientHeight;if(c<=0||d<=0)return;let u=Ee.identity(),f=u.aesthetic(d1),p=u.text(tZ),m=u.text(eZ),h=u.text(nZ),g=u.structural(1.5),v=u.structural(1.5),y=u.structural(rZ),b=u.structural(oZ),E=u.structural(aZ),x=u.text(20),L=u.structural(30),S=u.structural(Se),A=LD(e),C=A.length>1,M=!!e.title&&e.options["no-title"]!=="on",w=M?40:0,N=u.aesthetic(8),_=C?S+N:0,T=n.width,R=n.height,G=d-w-_,I=(c-f*2)/T,H=(G-f*2)/R,O=Math.min(J7,I,H),D=T*O,W=(c-D)/2,z=w+_+f,P=Rt(t).append("svg").attr("width",c).attr("height",d).attr("viewBox",`0 0 ${c} ${d}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It);u.isBelowFloor&&P.attr("width","100%");let B=P.append("defs"),Y=12,V=8;B.append("marker").attr("id","cd-arrow-inherit").attr("viewBox",`0 0 ${Y} ${V}`).attr("refX",Y).attr("refY",V/2).attr("markerWidth",Y).attr("markerHeight",V).attr("orient","auto").append("polygon").attr("points",`0,0 ${Y},${V/2} 0,${V}`).attr("fill",r.textMuted).attr("stroke",r.textMuted).attr("stroke-width",1),B.append("marker").attr("id","cd-arrow-implement").attr("viewBox",`0 0 ${Y} ${V}`).attr("refX",Y).attr("refY",V/2).attr("markerWidth",Y).attr("markerHeight",V).attr("orient","auto").append("polygon").attr("points",`0,0 ${Y},${V/2} 0,${V}`).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1);let j=12,K=8;if(B.append("marker").attr("id","cd-arrow-compose").attr("viewBox",`0 0 ${j} ${K}`).attr("refX",0).attr("refY",K/2).attr("markerWidth",j).attr("markerHeight",K).attr("orient","auto").append("polygon").attr("points",`${j/2},0 ${j},${K/2} ${j/2},${K} 0,${K/2}`).attr("fill",r.textMuted).attr("stroke",r.textMuted).attr("stroke-width",1),B.append("marker").attr("id","cd-arrow-aggregate").attr("viewBox",`0 0 ${j} ${K}`).attr("refX",0).attr("refY",K/2).attr("markerWidth",j).attr("markerHeight",K).attr("orient","auto").append("polygon").attr("points",`${j/2},0 ${j},${K/2} ${j/2},${K} 0,${K/2}`).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1),B.append("marker").attr("id","cd-arrow-depend").attr("viewBox",`0 0 ${Y} ${V}`).attr("refX",Y).attr("refY",V/2).attr("markerWidth",Y).attr("markerHeight",V).attr("orient","auto").append("polyline").attr("points",`0,0 ${Y},${V/2} 0,${V}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5),B.append("marker").attr("id","cd-arrow-assoc").attr("viewBox",`0 0 ${Y} ${V}`).attr("refX",Y).attr("refY",V/2).attr("markerWidth",Y).attr("markerHeight",V).attr("orient","auto").append("polyline").attr("points",`0,0 ${Y},${V/2} 0,${V}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5),M){let X=P.append("text").attr("class","chart-title").attr("x",c/2).attr("y",L).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",x).attr("font-weight","700").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(X.attr("data-line-number",e.titleLineNumber),a&&X.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){Rt(this).attr("opacity",.7)}).on("mouseleave",function(){Rt(this).attr("opacity",1)}))}let $=s!==!1;if(C){let X=[{name:SD,entries:A.map(et=>({value:et.label,color:r.colors[et.colorKey]}))}],q=P.append("g").attr("class","cd-legend").attr("transform",`translate(0,${w})`);fn(q,{groups:X,activeGroup:$?SD:null,mode:l?"export":"preview",palette:r,isDark:o,width:c})}let U=P.append("g").attr("transform",`translate(${W}, ${z}) scale(${O})`);for(let X of n.edges){if(X.points.length<2)continue;let q=U.append("g").attr("class","cd-edge-group").attr("data-line-number",String(X.lineNumber)).attr("data-source",X.source).attr("data-target",X.target),et=r.textMuted,tt=pZ(X.type),F=fZ(X.type),Q=mZ(X.type),ot=uZ(X.points);if(ot){let Z=q.append("path").attr("d",ot).attr("fill","none").attr("stroke",et).attr("stroke-width",g).attr("class","cd-edge");F&&Z.attr("stroke-dasharray","6 3"),Q?Z.attr("marker-start",`url(#${tt})`):Z.attr("marker-end",`url(#${tt})`)}if(X.label){let Z=Math.floor(X.points.length/2),lt=X.points[Z],nt=_t(X.label,h)+8,J=16;q.append("rect").attr("x",lt.x-nt/2).attr("y",lt.y-J/2-1).attr("width",nt).attr("height",J).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","cd-edge-label-bg"),q.append("text").attr("x",lt.x).attr("y",lt.y+4).attr("text-anchor","middle").attr("fill",et).attr("font-size",h).attr("class","cd-edge-label").text(X.label)}}for(let X of n.nodes){let q=U.append("g").attr("transform",`translate(${X.x}, ${X.y})`).attr("class","cd-class").attr("data-line-number",String(X.lineNumber)).attr("data-node-id",X.id).attr("data-cd-type",dZ(X.modifier));a&&q.style("cursor","pointer").on("click",()=>{a(X.lineNumber)});let et=X.width,tt=X.height,F=!!e.options?.["no-auto-color"],ot=C&&!$&&!X.color?r.primary:X.color,Z=e.options?.["solid-fill"]==="on",lt=iZ(r,o,X.modifier,ot,F,Z),nt=sZ(r,X.modifier,ot,F),J=ve(lt,r.textOnFillLight,r.textOnFillDark);q.append("rect").attr("x",-et/2).attr("y",-tt/2).attr("width",et).attr("height",tt).attr("rx",3).attr("ry",3).attr("fill",lt).attr("stroke",nt).attr("stroke-width",v);let at=-tt/2,it=at+X.headerHeight/2;if(X.modifier){let rt=`\xAB${X.modifier}\xBB`;q.append("text").attr("x",0).attr("y",it-6).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",J).attr("font-size",m).attr("font-style","italic").text(rt),q.append("text").attr("x",0).attr("y",it+10).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",J).attr("font-size",p).attr("font-weight","bold").attr("font-style",X.modifier==="abstract"?"italic":"normal").text(X.name)}else q.append("text").attr("x",0).attr("y",it).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",J).attr("font-size",p).attr("font-weight","bold").text(X.name);at+=X.headerHeight;let vt=X.modifier==="enum",Tt=X.members.filter(rt=>!rt.isMethod),At=X.members.filter(rt=>rt.isMethod);if(vt){q.append("line").attr("x1",-et/2).attr("y1",at).attr("x2",et/2).attr("y2",at).attr("stroke",Z?J:nt).attr("stroke-width",.5).attr("stroke-opacity",.5);let rt=at+b;for(let pt of X.members)q.append("text").attr("x",-et/2+E).attr("y",rt+y/2).attr("dominant-baseline","central").attr("fill",J).attr("font-size",m).text(pt.name),rt+=y}else{if(q.append("line").attr("x1",-et/2).attr("y1",at).attr("x2",et/2).attr("y2",at).attr("stroke",Z?J:nt).attr("stroke-width",.5).attr("stroke-opacity",.5),Tt.length>0){let rt=at+b;for(let pt of Tt){let dt=`${vD(pt.visibility)} ${pt.name}`;pt.type&&(dt+=`: ${pt.type}`);let ut=q.append("text").attr("x",-et/2+E).attr("y",rt+y/2).attr("dominant-baseline","central").attr("fill",J).attr("font-size",m);pt.isStatic&&ut.attr("text-decoration","underline"),ut.text(dt),rt+=y}}if(at+=X.fieldsHeight,q.append("line").attr("x1",-et/2).attr("y1",at).attr("x2",et/2).attr("y2",at).attr("stroke",Z?J:nt).attr("stroke-width",.5).attr("stroke-opacity",.5),At.length>0){let rt=at+b;for(let pt of At){let dt=`${vD(pt.visibility)} ${pt.name}(${pt.params??""})`;pt.type&&(dt+=`: ${pt.type}`);let ut=q.append("text").attr("x",-et/2+E).attr("y",rt+y/2).attr("dominant-baseline","central").attr("fill",J).attr("font-size",m);pt.isStatic&&ut.attr("text-decoration","underline"),ut.text(dt),rt+=y}}}if(X.note)if(X.note.collapsed)Ni(q,{x:et/2-Fo-3,y:-tt/2+Fo+3},r,{isDark:o,...X.note.color&&{color:X.note.color},lineNumber:X.note.lineNumber,endLineNumber:X.note.endLineNumber});else{let[rt,pt,ht,dt]=ki({width:et,height:tt},X.note);vi(q,rt,pt,ht,dt,r),Li(q,{x:X.note.x,y:X.note.y,width:X.note.width,height:X.note.height},X.note.lines,r,{isDark:o,...X.note.color&&{color:X.note.color},lineNumber:X.note.lineNumber,endLineNumber:X.note.endLineNumber,interactive:!0})}}}function hZ(t,e,n){let r=Fc(t,n);if(r.error||r.classes.length===0)return"";let o=l1(r),a=e==="dark",l=LD(r).length>1?Se+8:0,c=o.width+d1*2,d=o.height+d1*2+(r.title?40:0)+l;return ld(c,d,u=>(ND(u,r,o,n,a,void 0,{width:c,height:d},!0,!0),cd(u,e)))}var d1,J7,tZ,eZ,nZ,rZ,oZ,aZ,lZ,cZ,SD,uZ,TD=st(()=>{"use strict";Xn();Eo();on();Qh();Mr();Br();tn();Ku();c1();fr();en();Mi();d1=20,J7=3,tZ=13,eZ=11,nZ=11,rZ=18,oZ=8,aZ=10;lZ={class:{label:"Class",colorKey:"teal"},abstract:{label:"Abstract",colorKey:"purple"},interface:{label:"Interface",colorKey:"blue"},enum:{label:"Enum",colorKey:"yellow"}},cZ=["class","abstract","interface","enum"];SD="Type";uZ=Kn().x(t=>t.x).y(t=>t.y).curve(fo)});var _D={};ye(_D,{layoutERDiagram:()=>p1});function kZ(t){let e=_t(t.name,yZ);for(let i of t.columns){let s=i.name;i.type&&(s+=`: ${i.type}`);let l=_t(s,bZ);i.constraints.length>0&&(l+=wZ),e=Math.max(e,l)}let n=Math.max(u1,e+gZ),r=f1,o=0;t.columns.length>0&&(o=SZ*2+t.columns.length*EZ+vZ);let a=r+o+(o===0?4:0);return{width:n,height:a,headerHeight:r,columnsHeight:o}}function LZ(t,e){let n=new Map;for(let a of t)n.set(a,new Set);for(let a of e)n.get(a.source)?.add(a.target),n.get(a.target)?.add(a.source);let r=new Set,o=[];for(let a of t){if(r.has(a))continue;let i=[],s=[a];for(;s.length>0;){let l=s.shift();if(!r.has(l)){r.add(l),i.push(l);for(let c of n.get(l)??[])r.has(c)||s.push(c)}}o.push(i)}return o}function NZ(t,e,n){let r=new Map,o=new Map;if(t.length===1){let d=t[0],u=n.get(d.id);return r.set(d.id,{x:u.width/2,y:u.height/2,...u}),{nodePositions:r,edgePoints:o,width:u.width,height:u.height}}let a=new er.graphlib.Graph({multigraph:!0});a.setGraph({rankdir:"LR",nodesep:40,ranksep:80,edgesep:20}),a.setDefaultEdgeLabel(()=>({}));for(let d of t){let u=n.get(d.id);a.setNode(d.id,{width:u.width,height:u.height})}for(let d of e)a.setEdge(d.source,d.target,{label:d.label??""},String(d.lineNumber));er.layout(a);let i=1/0,s=1/0,l=-1/0,c=-1/0;for(let d of t){let u=a.node(d.id),f=n.get(d.id);i=Math.min(i,u.x-f.width/2),s=Math.min(s,u.y-f.height/2),l=Math.max(l,u.x+f.width/2),c=Math.max(c,u.y+f.height/2)}for(let d of e){let u=a.edge(d.source,d.target,String(d.lineNumber));for(let f of u?.points??[])i=Math.min(i,f.x),s=Math.min(s,f.y),l=Math.max(l,f.x),c=Math.max(c,f.y);if(d.label&&(u?.points??[]).length>0){let f=u.points,p=f[Math.floor(f.length/2)],m=(_t(d.label,xZ)+8)/2;i=Math.min(i,p.x-m),l=Math.max(l,p.x+m)}}for(let d of t){let u=a.node(d.id),f=n.get(d.id);r.set(d.id,{x:u.x-i,y:u.y-s,...f})}for(let d of e){let u=a.edge(d.source,d.target,String(d.lineNumber));o.set(d.lineNumber,(u?.points??[]).map(f=>({x:f.x-i,y:f.y-s})))}return{nodePositions:r,edgePoints:o,width:Math.max(0,l-i),height:Math.max(0,c-s)}}function MZ(t){if(t.length===0)return[];let e=[...t].sort((l,c)=>{let d=l.compIds.length>1?1:0,u=c.compIds.length>1?1:0;return d!==u?u-d:c.compLayout.height-l.compLayout.height}),n=t.reduce((l,c)=>l+(c.compLayout.width||u1)*(c.compLayout.height||f1),0),r=Math.max(Math.sqrt(n)*1.5,e[0].compLayout.width),o=[],a=0,i=0,s=0;for(let l of e){let c=l.compLayout.width||u1,d=l.compLayout.height||f1;a>0&&a+c>r&&(i+=s+CD,a=0,s=0),o.push({compIds:l.compIds,compLayout:l.compLayout,offsetX:a,offsetY:i}),a+=c+CD,s=Math.max(s,d)}return o}function p1(t,e){if(t.tables.length===0)return{nodes:[],edges:[],width:0,height:0};let n=new Map;for(let C of t.tables)n.set(C.id,kZ(C));let r=LZ(t.tables.map(C=>C.id),t.relationships),o=new Map(t.tables.map(C=>[C.id,C])),a=r.map(C=>{let M=C.map(k=>o.get(k)),w=t.relationships.filter(k=>C.includes(k.source));return{compIds:C,compLayout:NZ(M,w,n)}}),i=MZ(a),s=new Map;for(let C of i)for(let M of C.compIds)s.set(M,C);let l=new Map;for(let C of i)for(let M of C.compLayout.edgePoints.keys())l.set(M,C);let c=t.tables.map(C=>{let M=s.get(C.id),w=M.compLayout.nodePositions.get(C.id);return{...C,x:w.x+M.offsetX+wd,y:w.y+M.offsetY+wd,width:w.width,height:w.height,headerHeight:w.headerHeight,columnsHeight:w.columnsHeight}}),d=t.relationships.map(C=>{let M=l.get(C.lineNumber),w=M?.compLayout.edgePoints.get(C.lineNumber)??[];return{source:C.source,target:C.target,cardinality:C.cardinality,points:w.map(k=>({x:k.x+(M?.offsetX??0)+wd,y:k.y+(M?.offsetY??0)+wd})),...C.label!==void 0&&{label:C.label},lineNumber:C.lineNumber}}),f=t.options?.["no-notes"]==="on"||!t.notes?new Map:no(t.notes,t.tables.map(C=>({id:C.id,label:C.name}))),p=$c(c.map(C=>({id:C.id,x:C.x,y:C.y,width:C.width,height:C.height})),f,"TB",e?.collapsedNotes),m=c.map(C=>{let M=p.get(C.id);return M?{...C,note:M}:C}),h=1/0,g=1/0,v=-1/0,y=-1/0,b=(C,M,w,k)=>{C<h&&(h=C),M<g&&(g=M),w>v&&(v=w),k>y&&(y=k)};for(let C of m)b(C.x-C.width/2,C.y-C.height/2,C.x+C.width/2,C.y+C.height/2),C.note&&!C.note.collapsed&&b(C.x+C.note.x,C.y+C.note.y,C.x+C.note.x+C.note.width,C.y+C.note.y+C.note.height);for(let C of d)for(let M of C.points)b(M.x,M.y,M.x,M.y);Number.isFinite(h)||(h=0,g=0,v=0,y=0);let{shiftX:E,shiftY:x}=Hs(h,g),L=E!==0||x!==0,S=L?m.map(C=>({...C,x:C.x+E,y:C.y+x})):m,A=L?d.map(C=>({...C,points:C.points.map(M=>({x:M.x+E,y:M.y+x}))})):d;return{nodes:S,edges:A,width:v+E+wd,height:y+x+wd}}var u1,gZ,f1,yZ,bZ,xZ,wZ,EZ,SZ,vZ,wd,CD,m1=st(()=>{"use strict";ss();en();ts();u1=140,gZ=24,f1=36,yZ=13,bZ=11,xZ=11,wZ=16,EZ=18,SZ=8,vZ=1,wd=30,CD=60});function ID(t,e){let n=new Map;if(t.length===0)return n;let r={};for(let f of t)r[f.id]=0;for(let f of e)f.source!==f.target&&(f.cardinality.from==="1"&&f.cardinality.to!=="1"&&(r[f.source]=(r[f.source]??0)+1),f.cardinality.to==="1"&&f.cardinality.from!=="1"&&(r[f.target]=(r[f.target]??0)+1));let o=new Map;for(let f of e)f.source!==f.target&&(f.cardinality.from==="*"&&(o.has(f.source)||o.set(f.source,new Set),o.get(f.source).add(f.target)),f.cardinality.to==="*"&&(o.has(f.target)||o.set(f.target,new Set),o.get(f.target).add(f.source)));let a=new Set;for(let[f,p]of o)p.size>=2&&a.add(f);let i=Object.values(r),s=i.reduce((f,p)=>f+p,0)/i.length,l=i.reduce((f,p)=>f+(p-s)**2,0)/i.length,c=Math.sqrt(l),d=[...i].sort((f,p)=>f-p),u=d.length%2===0?(d[d.length/2-1]+d[d.length/2])/2:d[Math.floor(d.length/2)];for(let f of t){let p=f.id,m=f.columns,h=m.filter(N=>N.constraints.includes("fk")),g=m.filter(N=>N.constraints.includes("pk")&&N.constraints.includes("fk")),v=h.length,y=m.length===0?0:v/m.length,b=r[p]??0,E=f.name.toLowerCase(),x=e.filter(N=>(N.source===p||N.target===p)&&N.source!==N.target),L=e.some(N=>N.source===p&&N.target===p),S=new Set;for(let N of x)S.add(N.source===p?N.target:N.source);if(L&&x.length===0){n.set(p,"self-referential");continue}let A=g.length>=2&&S.size===1,C=y>=.6&&!A,M=g.length>=2&&S.size>=2,w=a.has(p);if(C||M||w){n.set(p,"junction");continue}if(y>=.4&&y<.6&&g.length<2&&!a.has(p)){n.set(p,"ambiguous");continue}if(TZ.some(N=>E.endsWith(N))&&m.length<=6&&v<=1&&b>u){n.set(p,"lookup");continue}if(t.length>=6&&b>0&&b>s+1.5*c&&b>=2*s){n.set(p,"hub");continue}if(v>0){n.set(p,"dependent");continue}n.set(p,"core")}return n}var h1,AD,RD,TZ,PD=st(()=>{"use strict";h1={core:"green",dependent:"blue",junction:"red",ambiguous:"purple",lookup:"yellow",hub:"orange","self-referential":"teal",unclassified:"gray"},AD={core:"Core entity",dependent:"Dependent",junction:"Junction / M:M",ambiguous:"Bridge",lookup:"Lookup / Reference",hub:"Hub","self-referential":"Self-referential",unclassified:"Unclassified"},RD=["core","dependent","junction","ambiguous","lookup","hub","self-referential","unclassified"],TZ=["_type","_status","_code","_category"]});var $D={};ye($D,{renderERDiagram:()=>GD,renderERDiagramForExport:()=>GZ});function DZ(t){switch(t){case"pk":return"\u2666";case"fk":return"\u2192";case"unique":return"\u25C6";case"nullable":return"\u25CB"}}function DD(t,e,n,r,o,a,i=OD,s=1.5){let l=e.x-n.x,c=e.y-n.y,d=Math.sqrt(l*l+c*c);if(d===0)return;let u=l/d,f=c/d,p=-f,m=u,h=s+.5;if(a){let b=e.x-u*15,E=e.y-f*15,x=r==="1"?"1":r==="*"?"*":"0..1";t.append("text").attr("x",b+p*12).attr("y",E+m*12).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",o).attr("font-size",i).text(x);return}let g=14,v=9;if(r==="1"){let y=e.x-u*g,b=e.y-f*g;t.append("line").attr("x1",y+p*v).attr("y1",b+m*v).attr("x2",y-p*v).attr("y2",b-m*v).attr("stroke",o).attr("stroke-width",h)}else if(r==="*"){let E=e.x-u*18,x=e.y-f*18,L=e.x-u*5,S=e.y-f*5;t.append("line").attr("x1",E).attr("y1",x).attr("x2",L+p*v).attr("y2",S+m*v).attr("stroke",o).attr("stroke-width",h),t.append("line").attr("x1",E).attr("y1",x).attr("x2",L-p*v).attr("y2",S-m*v).attr("stroke",o).attr("stroke-width",h),t.append("line").attr("x1",E).attr("y1",x).attr("x2",L).attr("y2",S).attr("stroke",o).attr("stroke-width",h)}else if(r==="?"){let b=g+10+2,E=e.x-u*b,x=e.y-f*b;t.append("circle").attr("cx",E).attr("cy",x).attr("r",5).attr("fill","none").attr("stroke",o).attr("stroke-width",h);let L=e.x-u*g,S=e.y-f*g;t.append("line").attr("x1",L+p*v).attr("y1",S+m*v).attr("x2",L-p*v).attr("y2",S-m*v).attr("stroke",o).attr("stroke-width",h)}}function GD(t,e,n,r,o,a,i,s,l,c){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let d=e.tagGroups.length===0&&n.nodes.every(V=>!V.color),u=8,f=e.tagGroups.length>0,p=d?Se+u:f?Se+u:0,m=!!e.title&&e.options["no-title"]!=="on",h=m?40:0,g=n.width,v=n.height,y=Ee.identity(),b=y.aesthetic(g1),E=y.text(_Z),x=y.text(AZ),L=y.text(OD),S=y.structural(1.5),A=y.structural(1.5),C=y.structural(RZ),M=y.structural(IZ),w=y.structural(PZ),k=y.text(20),N=y.structural(30),_=g+b*2,T=v+h+p+b*2,R,G,I,H,O;if(i){R=i.width??_,G=i.height??T;let V=G-h-p,j=(R-b*2)/g,K=(V-b*2)/v;I=Math.min(CZ,j,K);let $=g*I;H=(R-$)/2,O=h+p+b}else R=_,G=T,I=1,H=b,O=h+p+b;if(R<=0||G<=0)return;let D=Rt(t).append("svg").attr("width",i?R:"100%").attr("height",i?G:"100%").attr("viewBox",`0 0 ${R} ${G}`).attr("preserveAspectRatio","xMidYMid meet").style("font-family",It);if(m){let V=D.append("text").attr("class","chart-title").attr("x",R/2).attr("y",N).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",k).attr("font-weight","700").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(V.attr("data-line-number",e.titleLineNumber),a&&V.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){Rt(this).attr("opacity",.7)}).on("mouseleave",function(){Rt(this).attr("opacity",1)}))}let W=D.append("g").attr("transform",`translate(${H}, ${O}) scale(${I})`),z=ir(r),P=d?ID([...e.tables],[...e.relationships]):null,B=P!==null&&(l??!0),Y=e.options.notation==="labels";for(let V of n.edges){if(V.points.length<2)continue;let j=W.append("g").attr("class","er-edge-group").attr("data-line-number",String(V.lineNumber)).attr("data-source",V.source).attr("data-target",V.target),K=r.textMuted,$=OZ(V.points);$&&j.append("path").attr("d",$).attr("fill","none").attr("stroke",K).attr("stroke-width",S).attr("class","er-edge");let U=V.points;if(DD(j,U[0],U[1],V.cardinality.from,K,Y,L,S),DD(j,U[U.length-1],U[U.length-2],V.cardinality.to,K,Y,L,S),V.label){let X=Math.floor(U.length/2),q=U[X],et=_t(V.label,L)+8,tt=16;j.append("rect").attr("x",q.x-et/2).attr("y",q.y-tt/2-1).attr("width",et).attr("height",tt).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","er-edge-label-bg"),j.append("text").attr("x",q.x).attr("y",q.y+4).attr("text-anchor","middle").attr("fill",K).attr("font-size",L).attr("class","er-edge-label").text(V.label)}}for(let V=0;V<n.nodes.length;V++){let j=n.nodes[V],K=ar(j.metadata,[...e.tagGroups],s??null),$=B?r.colors[h1[P.get(j.id)??"unclassified"]]:P?r.primary:void 0,U=j.color??K??$??z[V%z.length],X=W.append("g").attr("transform",`translate(${j.x}, ${j.y})`).attr("class","er-table").attr("data-line-number",String(j.lineNumber)).attr("data-node-id",j.id);if(s){let lt=qt(s),nt=j.metadata[lt];nt&&X.attr(`data-tag-${lt}`,nt.toLowerCase())}if(P){let lt=P.get(j.id);lt&&X.attr("data-er-role",lt)}a&&X.style("cursor","pointer").on("click",()=>{a(j.lineNumber)});let q=j.width,et=j.height,tt=ie(r,U,o,{solid:e.options["solid-fill"]==="on"}),F=U,Q=ve(tt,r.textOnFillLight,r.textOnFillDark);X.append("rect").attr("x",-q/2).attr("y",-et/2).attr("width",q).attr("height",et).attr("rx",3).attr("ry",3).attr("fill",tt).attr("stroke",F).attr("stroke-width",A);let ot=-et/2,Z=ot+j.headerHeight/2;if(X.append("text").attr("x",0).attr("y",Z).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",Q).attr("font-size",E).attr("font-weight","bold").text(j.name),ot+=j.headerHeight,j.columns.length>0){X.append("line").attr("x1",-q/2).attr("y1",ot).attr("x2",q/2).attr("y2",ot).attr("stroke",F).attr("stroke-width",.5).attr("stroke-opacity",.5);let lt=ot+M;for(let nt of j.columns){let J=-q/2+w,at=nt.constraints[0];at&&X.append("text").attr("x",J).attr("y",lt+C/2).attr("dominant-baseline","central").attr("fill",Q).attr("font-size",x).text(DZ(at));let it=-q/2+w+(at?16:0),vt=nt.name;nt.type&&(vt+=`: ${nt.type}`),X.append("text").attr("x",it).attr("y",lt+C/2).attr("dominant-baseline","central").attr("fill",Q).attr("font-size",x).text(vt),lt+=C}}if(j.note)if(j.note.collapsed)Ni(X,{x:q/2-Fo-3,y:-et/2+Fo+3},r,{isDark:o,...j.note.color&&{color:j.note.color},lineNumber:j.note.lineNumber,endLineNumber:j.note.endLineNumber});else{let[lt,nt,J,at]=ki({width:q,height:et},j.note);vi(X,lt,nt,J,at,r),Li(X,{x:j.note.x,y:j.note.y,width:j.note.width,height:j.note.height},j.note.lines,r,{isDark:o,...j.note.color&&{color:j.note.color},lineNumber:j.note.lineNumber,endLineNumber:j.note.endLineNumber,interactive:!0})}}if(e.tagGroups.length>0){let V=b+h,j=D.append("g").attr("class","er-tag-legend").attr("transform",`translate(0,${V})`);fn(j,{groups:e.tagGroups,activeGroup:s??null,mode:c?"export":"preview",palette:r,isDark:o,width:R}),j.selectAll("[data-legend-group]").classed("er-legend-group",!0)}if(P){let V=RD.filter(j=>{for(let K of P.values())if(K===j)return!0;return!1});if(V.length>0){let j=b+h,K=[{name:"Role",entries:V.map(U=>({value:AD[U],color:r.colors[h1[U]]}))}],$=D.append("g").attr("class","er-semantic-legend").attr("transform",`translate(0,${j})`);fn($,{groups:K,activeGroup:B?"Role":null,mode:c?"export":"preview",palette:r,isDark:o,width:R}),$.selectAll("[data-legend-group]").classed("er-legend-group",!0)}}}function GZ(t,e,n){let r=Yc(t,n);if(r.error||r.tables.length===0)return"";let o=p1(r),a=e==="dark",i=document.createElement("div"),s=o.width+g1*2,l=o.height+g1*2+(r.title&&r.options["no-title"]!=="on"?40:0);i.style.width=`${s}px`,i.style.height=`${l}px`,i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i);try{GD(i,r,o,n,a,void 0,{width:s,height:l},void 0,void 0,!0);let c=i.querySelector("svg");return c?(e==="transparent"&&(c.style.background="none"),c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.style.fontFamily=It,c.outerHTML):""}finally{document.body.removeChild(i)}}var g1,CZ,_Z,AZ,OD,RZ,IZ,PZ,OZ,HD=st(()=>{"use strict";Ke();Xn();Eo();on();tn();gi();Ke();Mr();Br();fr();en();Mi();Zu();m1();PD();g1=20,CZ=3,_Z=13,AZ=11,OD=11,RZ=18,IZ=8,PZ=10;OZ=Kn().x(t=>t.x).y(t=>t.y).curve(fo)});var UD={};ye(UD,{renderBoxesAndLines:()=>VD,renderBoxesAndLinesForExport:()=>QZ});function jZ(t){let e=[],n=0;for(let r=1;r<t.length;r++){let o=t[r-1],a=t[r],i=r+1<t.length?t[r+1]:"",s=o>="a"&&o<="z"&&a>="A"&&a<="Z",l=o>="A"&&o<="Z"&&a>="A"&&a<="Z"&&i>="a"&&i<="z";(s||l)&&(e.push(t.slice(n,r)),n=r)}return e.push(t.slice(n)),e.length>1?e:[t]}function hg(t,e,n){let r=e-zD*2,o=t.split(/(\s+|-)/),a=[];for(let s of o)!s||/^\s+$/.test(s)||s==="-"||a.push(...jZ(s));for(let s=HZ;s>=gg;s--){if(r<_t("MM",s))continue;let l=[],c="";for(let p of a){let m=c?`${c} ${p}`:p;_t(m,s)<=r?c=m:(c&&l.push(c),c=p)}c&&l.push(c);let d=p=>_t(p,s)<=r;if(l.length<=n&&l.every(d))return{lines:l,fontSize:s};if(l.length<=n)return{lines:l.map(m=>d(m)?m:tr(m,s,r)),fontSize:s};let u=l.slice(0,n).map(p=>d(p)?p:tr(p,s,r)),f=u[n-1];return f.endsWith("\u2026")||(u[n-1]=tr(f+"\u2026",s,r)),{lines:u,fontSize:s}}return{lines:[tr(t,gg,r)],fontSize:gg}}function qZ(t,e,n,r,o,a,i){let s=Gt(r.bg,r.text,o?90:95);if(a.active){if(t.value===void 0){let g=ve(s,r.textOnFillLight,r.textOnFillDark);return{fill:s,stroke:a.hue,text:g}}let f=a.fillForValue(t.value),p=ie(r,f,o,{...i!==void 0&&{solid:i}}),m=a.twoColor?f:a.hue,h=ve(p,r.textOnFillLight,r.textOnFillDark);return{fill:p,stroke:m,text:h}}let l=ar(t.metadata,[...e],n);if(l){let f=ie(r,l,o,{...i!==void 0&&{solid:i}}),p=l,m=ve(f,r.textOnFillLight,r.textOnFillDark);return{fill:f,stroke:p,text:m}}let c=Gt(r.bg,r.text,o?90:95),d=Gt(r.text,r.bg,o?60:40),u=r.text;return{fill:c,stroke:d,text:u}}function KZ(t,e,n,r){if(Object.keys(t.metadata).length>0&&n!=null){let a=ar(t.metadata,[...e],n);if(a)return a}return r.textMuted}function ZZ(t,e){for(let n of e){let r=`bl-arrow-${n.replace("#","")}`;if(!t.select(`#${r}`).empty())continue;t.append("marker").attr("id",r).attr("viewBox",`0 0 ${Js*2} ${Pi*2}`).attr("refX",Js*2).attr("refY",Pi).attr("markerWidth",Js).attr("markerHeight",Pi).attr("orient","auto").append("polygon").attr("points",`0,0 ${Js*2},${Pi} 0,${Pi*2}`).attr("fill",n);let o=`bl-arrow-rev-${n.replace("#","")}`;t.select(`#${o}`).empty()&&t.append("marker").attr("id",o).attr("viewBox",`0 0 ${Js*2} ${Pi*2}`).attr("refX",0).attr("refY",Pi).attr("markerWidth",Js).attr("markerHeight",Pi).attr("orient","auto").append("polygon").attr("points",`${Js*2},0 0,${Pi} ${Js*2},${Pi*2}`).attr("fill",n)}}function VD(t,e,n,r,o,a){let{onClickItem:i,exportDims:s,activeTagGroup:l,hiddenTagValues:c,hideDescriptions:d,controlsExpanded:u,onToggleDescriptions:f,onToggleControlsExpand:p,exportMode:m=!1,controlsHost:h,rampDomain:g}=a??{};Rt(t).selectAll(":not([data-d3-tooltip])").remove();let v=s?.width??t.clientWidth,y=s?.height??t.clientHeight;if(v<=0||y<=0)return;let b=Ee.identity(),E=b.aesthetic($Z),x=b.text(gg),L=b.text(WZ),S=b.structural(1.5),A=b.structural(1.5),C=b.structural(BZ),M=b.text(WD),w=b.text(YZ),k=b.structural(zZ),N=b.text(20),_=b.structural(30),T=e.nodes.filter(ft=>ft.value!==void 0).map(ft=>ft.value),R=T.length>0,G=g?.min??(R?Math.min(...T):0),I=g?.max??Math.max(...T),H=Dn(e.boxMetricColor??"",r)??r.primary,O=e.boxMetricLowColor?Dn(e.boxMetricLowColor,r)??void 0:void 0,D=o?Gt(r.surface,r.text,28):r.bg,W=Gt(H,D,y1),z=ft=>{let Wt=I>G?(ft-G)/(I-G):1;if(O!==void 0)return Jp(O,H,Wt,{isDark:o});let he=y1+Math.max(0,Math.min(1,Wt))*(100-y1);return Gt(H,D,he)},P=R?e.boxMetric?.trim()||"Value":null,B=ft=>{let Wt=ft.trim().toLowerCase();if(Wt===""||Wt==="none")return null;let he=e.tagGroups.find(ne=>ne.name.toLowerCase()===Wt);return he?he.name:Wt===P?.toLowerCase()?P:ft},Y=l,V;Y!==void 0?V=Y===null?null:B(Y):e.options["active-tag"]!==void 0?V=B(e.options["active-tag"]):V=P??(e.tagGroups.length>0?e.tagGroups[0].name:null);let j=P!==null&&V===P,K=P!==null?{name:P,entries:[],gradient:{min:G,max:I,low:O??W,high:H}}:null,$=[...K?[K]:[],...e.tagGroups],U=e.nodes.some(ft=>ft.description&&ft.description.length>0),q=$.length>0||U&&h!=="app"?b.structural(Tr({groups:$,position:{placement:"top-center",titleRelation:"below-title"},mode:m?"export":"preview"},v)):0,et=c??e.initialHiddenTagValues,tt=new Map;for(let ft of e.nodes)tt.set(ft.label,ft);let F=new Map;for(let ft of n.nodes)F.set(ft.label,ft);let Q=!!e.title&&e.options["no-title"]!=="on",ot=Q?40:0,Z=e.nodes.some(ft=>ft.description&&ft.description.length>0),nt=$.length>0||Z&&f?q+8:0,J=new Set(n.groups.map(ft=>ft.label)),at=0;for(let ft of e.groups)ft.children.some(Wt=>J.has(Wt))&&(at+=k);let it=n.width,vt=n.height+ot+nt+at,Tt=v/(it+E*2),At=y/(vt+E*2),rt=Math.min(Tt,At,3),pt=0,ht=0;if(e.nodePositions&&e.nodePositions.size>0){let ft=1/0,Wt=1/0,he=-1/0,ne=-1/0,se=(Zt,Ie)=>{Zt<ft&&(ft=Zt),Zt>he&&(he=Zt),Ie<Wt&&(Wt=Ie),Ie>ne&&(ne=Ie)};for(let Zt of n.nodes)se(Zt.x-Zt.width/2,Zt.y-Zt.height/2),se(Zt.x+Zt.width/2,Zt.y+Zt.height/2);for(let Zt of n.groups)se(Zt.x-Zt.width/2,Zt.y-Zt.height/2),se(Zt.x+Zt.width/2,Zt.y+Zt.height/2);for(let Zt of n.edges)for(let Ie of Zt.points)se(Ie.x,Ie.y);Number.isFinite(ft)&&(pt=(n.width-he-ft)/2,ht=(n.height-ne-Wt)/2)}let dt=(v-it*rt)/2+pt*rt,ut=E+ot+nt+ht*rt,yt=Rt(t).append("svg").attr("width",v).attr("height",y).attr("viewBox",`0 0 ${v} ${y}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It).style("background",r.bg);b.isBelowFloor&&yt.attr("width","100%");let kt=yt.append("defs");Q&&yt.append("text").attr("x",v/2).attr("y",_).attr("text-anchor","middle").attr("font-size",N).attr("font-weight","700").attr("fill",r.text).text(e.title);let Ot=yt.append("g").attr("transform",`translate(${dt},${ut}) scale(${rt})`),Xt=new Set,bt=new Map;for(let ft=0;ft<n.edges.length;ft++){let Wt=KZ(n.edges[ft],e.tagGroups,V,r);Xt.add(Wt),bt.set(ft,Wt)}ZZ(kt,Xt);let Nt=[...n.groups].sort((ft,Wt)=>Wt.width*Wt.height-ft.width*ft.height),Vt=new Set(n.groups.map(ft=>ft.label)),xt=new Set;for(let ft of e.groups)for(let Wt of ft.children)Vt.has(Wt)&&xt.add(ft.label);for(let ft of Nt){let Wt=ft.x-ft.width/2,he=!ft.collapsed&&xt.has(ft.label),ne=he?ft.y-ft.height/2-k:ft.y-ft.height/2,se=he?ft.height+k:ft.height,Zt=Ot.append("g").attr("class",ft.collapsed?"bl-group bl-group-collapsed":"bl-group").attr("data-line-number",String(ft.lineNumber)).attr("data-node-id",ft.label).attr("data-group-toggle",ft.label).style("cursor","pointer");if(ft.collapsed){let Ie=nr(r,o),Ht=r.border;Zt.append("rect").attr("x",Wt).attr("y",ne).attr("width",ft.width).attr("height",ft.height).attr("rx",vf).attr("ry",vf).attr("fill",Ie).attr("stroke",Ht).attr("stroke-width",A);let Qt=`bl-clip-${ft.label.replace(/[[\]\s]/g,"")}`;Zt.append("clipPath").attr("id",Qt).append("rect").attr("x",Wt).attr("y",ne).attr("width",ft.width).attr("height",ft.height).attr("rx",vf),Zt.append("rect").attr("x",Wt).attr("y",ne+ft.height-C).attr("width",ft.width).attr("height",C).attr("fill",Ht).attr("clip-path",`url(#${Qt})`).attr("class","bl-collapse-bar");let Ut=Math.max(2,Math.floor((ft.height-16)/(x*1.3))),fe=hg(ft.label,ft.width,Ut),de=fe.fontSize*1.3,te=fe.lines.length*de;for(let ae=0;ae<fe.lines.length;ae++)Zt.append("text").attr("class","bl-group-label").attr("x",ft.x).attr("y",ft.y-te/2+de/2+ae*de).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family",It).attr("font-size",fe.fontSize).attr("font-weight","600").attr("fill",r.text).text(fe.lines[ae])}else Zt.append("rect").attr("x",Wt).attr("y",ne).attr("width",ft.width).attr("height",se).attr("rx",FD).attr("ry",FD).attr("fill",Gt(r.surface,r.bg,40)).attr("stroke",r.textMuted).attr("stroke-width",1).attr("stroke-opacity",.35),Zt.append("text").attr("class","bl-group-label").attr("x",Wt+ft.width/2).attr("y",ne+18).attr("text-anchor","middle").attr("font-family",It).attr("font-size",w).attr("font-weight","600").attr("fill",r.text).text(ft.label)}for(let ft=0;ft<n.edges.length;ft++){let Wt=n.edges[ft],he=bt.get(ft)??r.textMuted;if(et.size>0){let Qt=!1;for(let[Ut,fe]of et){let de=Wt.metadata[Ut];if(de&&fe.has(de.toLowerCase())){Qt=!0;break}}if(Qt)continue}if(Wt.source===Wt.target){let Qt=F.get(Wt.source);if(Qt){let Ut=Ot.append("g").attr("class","bl-edge-group").attr("data-line-number",String(Wt.lineNumber)).attr("data-from",Wt.source).attr("data-to",Wt.target),fe=`bl-arrow-${he.replace("#","")}`,de=Qt.x,te=Qt.y,ae=Qt.width/2,Te=Qt.height/2,Je=20,sn=de+ae,ze=te+Te*.4,Ce=de+ae*.4,ee=te+Te,oe=sn+ae+Je,Be=ze,dn=Ce,_n=ee+Te+Je;Ut.append("path").attr("class","bl-edge").attr("d",`M ${sn} ${ze} C ${oe} ${Be}, ${dn} ${_n}, ${Ce} ${ee}`).attr("fill","none").attr("stroke",he).attr("stroke-width",S).attr("marker-end",`url(#${fe})`)}continue}let ne;if(Wt.yOffset!==0&&Wt.parallelCount>1){let Qt=F.get(Wt.source),Ut=F.get(Wt.target),fe=Qt?.y??Wt.points[0]?.y??0,de=Ut?.y??Wt.points[Wt.points.length-1]?.y??0,te=Wt.points[0]?.x??0,ae=Wt.points[Wt.points.length-1]?.x??0,Te=(te+ae)/2,Je=(fe+de)/2;ne=[{x:te,y:fe},{x:te+(Te-te)*.3,y:fe+Wt.yOffset*.5},{x:Te,y:Je+Wt.yOffset},{x:ae-(ae-Te)*.3,y:de+Wt.yOffset*.5},{x:ae,y:de}]}else ne=Wt.points.map(Qt=>({x:Qt.x,y:Qt.y}));if(ne.length<2)continue;let se=Ot.append("g").attr("class","bl-edge-group").attr("data-line-number",String(Wt.lineNumber)).attr("data-from",Wt.source).attr("data-to",Wt.target),Zt=`bl-arrow-${he.replace("#","")}`,Ie=Wt.straight?XZ:e.direction==="TB"?UZ:VZ,Ht=se.append("path").attr("class","bl-edge").attr("d",Ie(ne)??"").attr("fill","none").attr("stroke",he).attr("stroke-width",S).attr("marker-end",`url(#${Zt})`);if(Wt.bidirectional){let Qt=`bl-arrow-rev-${he.replace("#","")}`;Ht.attr("marker-start",`url(#${Qt})`)}}for(let ft of n.nodes){let Wt=tt.get(ft.label);if(!Wt)continue;if(et.size>0){let Ut=!1;for(let[fe,de]of et){let te=Wt.metadata[fe];if(te&&de.has(te.toLowerCase())){Ut=!0;break}}if(Ut)continue}let he=e.options["solid-fill"]==="on",ne=qZ(Wt,e.tagGroups,V,r,o,{active:j,hue:H,twoColor:O!==void 0,fillForValue:z},he),se=he?ne.text:ne.stroke,Zt=Ot.append("g").attr("class","bl-node").attr("transform",`translate(${ft.x},${ft.y})`).attr("data-line-number",Wt.lineNumber).attr("data-node-id",Wt.label).style("cursor",i?"pointer":"default").style("--bl-node-stroke",ne.stroke);for(let[Ut,fe]of Object.entries(Wt.metadata))Zt.attr(`data-tag-${Ut.toLowerCase()}`,fe.toLowerCase());Wt.value!==void 0&&Zt.attr("data-value",Wt.value),i&&Zt.on("click",Ut=>{Ut.target?.closest("a")||i(Wt.lineNumber)});let Ie=-ft.width/2,Ht=-ft.height/2;Zt.append("rect").attr("x",Ie).attr("y",Ht).attr("width",ft.width).attr("height",ft.height).attr("rx",vf).attr("ry",vf).attr("fill",ne.fill).attr("stroke",ne.stroke).attr("stroke-width",A);let Qt=Wt.description;if(Qt&&Qt.length>0&&!d){let fe=hg(Wt.label,ft.width,3),de=fe.lines,te=fe.fontSize*1.3,ae=de.length*te,Te=ae+12,Je=-ft.height/2+Te/2;for(let An=0;An<de.length;An++)Zt.append("text").attr("x",0).attr("y",Je-ae/2+te/2+An*te).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",fe.fontSize).attr("font-weight","bold").attr("fill",ne.text).text(de[An]);let sn=-ft.height/2+Te;Zt.append("line").attr("x1",-ft.width/2).attr("y1",sn).attr("x2",ft.width/2).attr("y2",sn).attr("stroke",se).attr("stroke-opacity",.3).attr("stroke-width",1);let ze=sn+4+M,Ce=ft.width-zD*2,ee=Math.floor(Ce/(M*Wo)),oe=M*FZ,Be=An=>An.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/`(.+?)`/g,"$1").replace(/https?:\/\/\S+/g,In=>In.slice(0,20)).length,dn=[];for(let An of Qt){let In=An.startsWith("- ")?"\u2022 "+An.slice(2):An;In=In.replace(/\bhttps?\s+([\w][\w.-]+\.[a-z]{2,}(?:\/\S*)?)/gi,(Ar,lr)=>`https://${lr}`),dn.push(In)}let _n=qo(dn,ee,Be),He=_n.length>BD,Nn=He?_n.slice(0,BD):_n,jn=-ft.width/2+6,xo=jn+10,Sr=Ls(ne.fill)>.5?r.textMuted:Gt(ne.text,ne.fill,75);for(let An=0;An<Nn.length;An++){let In=Nn[An],Ar=In.text;He&&An===Nn.length-1&&(Ar=_t(Ar,M)>=Ce?tr(Ar,M,Ce):Ar+"\u2026");let lr=ze+An*oe;In.kind==="bullet-first"&&Zt.append("text").attr("x",jn).attr("y",lr).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size",M).attr("fill",Sr).text("\u2022");let Vr=In.kind==="bullet-first"||In.kind==="bullet-cont",Zn=Zt.append("text").attr("x",Vr?xo:0).attr("y",lr).attr("text-anchor",Vr?"start":"middle").attr("dominant-baseline","central").attr("font-size",WD).attr("fill",Sr);gn(Zn,Ar,r,M)}if(He){let An=Qt.join(" "),In=An.length>200?An.slice(0,199)+"\u2026":An;Zt.append("title").text(In)}if(e.showValues&&Wt.value!==void 0){let An=e.boxMetric?`${e.boxMetric}: ${Wt.value}`:String(Wt.value);Zt.append("text").attr("class","bl-node-value").attr("x",0).attr("y",ze+Nn.length*oe).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",YD).attr("font-weight","600").attr("fill",ne.text).text(An)}}else if(e.showValues&&Wt.value!==void 0){let Ut=e.boxMetric?`${e.boxMetric}: ${Wt.value}`:String(Wt.value),fe=ft.height/2,de=-ft.height/2+fe,te=hg(Wt.label,ft.width,2),ae=te.fontSize*1.3,Te=te.lines.length*ae,Je=-ft.height/2+fe/2;for(let sn=0;sn<te.lines.length;sn++)Zt.append("text").attr("x",0).attr("y",Je-Te/2+ae/2+sn*ae).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",te.fontSize).attr("font-weight","bold").attr("fill",ne.text).text(te.lines[sn]);Zt.append("line").attr("x1",-ft.width/2).attr("y1",de).attr("x2",ft.width/2).attr("y2",de).attr("stroke",se).attr("stroke-opacity",.3).attr("stroke-width",1),Zt.append("text").attr("class","bl-node-value").attr("x",0).attr("y",(de+ft.height/2)/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",YD).attr("fill",ne.text).attr("opacity",.85).text(Ut)}else{let Ut=Math.max(2,Math.floor((ft.height-16)/(x*1.3))),fe=hg(Wt.label,ft.width,Ut),de=fe.fontSize*1.3,te=fe.lines.length*de;for(let ae=0;ae<fe.lines.length;ae++)Zt.append("text").attr("x",0).attr("y",-te/2+de/2+ae*de).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",fe.fontSize).attr("font-weight","600").attr("fill",ne.text).text(fe.lines[ae])}if(ft.note)if(ft.note.collapsed)Ni(Zt,{x:ft.width/2-Fo-3,y:-ft.height/2+Fo+3},r,{isDark:o,...ft.note.color&&{color:ft.note.color},lineNumber:ft.note.lineNumber,endLineNumber:ft.note.endLineNumber});else{let[Ut,fe,de,te]=ki({width:ft.width,height:ft.height},ft.note);vi(Zt,Ut,fe,de,te,r),Li(Zt,{x:ft.note.x,y:ft.note.y,width:ft.note.width,height:ft.note.height},ft.note.lines,r,{isDark:o,...ft.note.color&&{color:ft.note.color},lineNumber:ft.note.lineNumber,endLineNumber:ft.note.endLineNumber,interactive:!0})}}let Lt=Ot.append("g").attr("class","bl-edge-labels"),Dt=L*1.3;for(let ft of n.edges){if(!ft.labelLines||ft.labelLines.length===0||ft.labelX===void 0||ft.labelY===void 0)continue;let Wt=ft.labelX,he=ft.labelY;if(et.size>0){let Ut=!1;for(let[fe,de]of et){let te=ft.metadata[fe];if(te&&de.has(te.toLowerCase())){Ut=!0;break}}if(Ut)continue}let ne=ft.labelWidth??0,se=ft.labelHeight??L+6,Zt=ft.labelLines,Ie=Lt.append("g").attr("class","bl-edge-label").attr("data-line-number",String(ft.lineNumber));Ie.append("rect").attr("x",Wt-ne/2).attr("y",he-se/2).attr("width",ne).attr("height",se).attr("rx",3).attr("fill",r.bg).attr("opacity",.72);let Ht=Ie.append("text").attr("x",Wt).attr("text-anchor","middle").attr("font-family",It).attr("font-size",L).attr("fill",r.textMuted),Qt=he-(Zt.length-1)/2*Dt+L/3;Zt.forEach((Ut,fe)=>{Ht.append("tspan").attr("x",Wt).attr("y",Qt+fe*Dt).text(Ut)})}let zt=e.nodes.some(ft=>ft.description&&ft.description.length>0);if($.length>0||zt&&h!=="app"){let ft;zt&&(f||h==="app")&&(ft={toggles:[{id:"descriptions",type:"toggle",label:"Descriptions",active:!d,onToggle:()=>{}}]});let Wt={...p!==void 0&&{onControlsExpand:p},onControlsToggle:(ne,se)=>{ne==="descriptions"&&f&&f(se)}},he=yt.append("g").attr("transform",`translate(0,${ot+4})`);fn(he,{groups:$,activeGroup:V,mode:m?"export":"preview",showInactivePills:!0,...ft!==void 0&&{controlsGroup:ft},...h!==void 0&&{controlsHost:h},...u!==void 0&&{controlsExpanded:u},callbacks:Wt,palette:r,isDark:o,width:v}),he.selectAll("[data-legend-group]").classed("bl-legend-group",!0)}if(!s&&!m){let Wt=yt.append("g").attr("class","bl-focus-icon").attr("data-export-ignore","true").style("display","none").style("pointer-events","auto").style("cursor","pointer");Wt.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let he=14/2,ne=14/2;Wt.append("circle").attr("cx",he).attr("cy",ne).attr("r",14/2-1).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1.5),Wt.append("circle").attr("cx",he).attr("cy",ne).attr("r",2).attr("fill",r.textMuted)}}function QZ(t,e,n,r,o,a){VD(t,e,n,r,o,{...a?.exportDims!==void 0&&{exportDims:a.exportDims},...a?.activeTagGroup!==void 0&&{activeTagGroup:a.activeTagGroup},...a?.hiddenTagValues!==void 0&&{hiddenTagValues:a.hiddenTagValues},...a?.exportMode!==void 0&&{exportMode:a.exportMode}})}var $Z,HZ,gg,WZ,vf,BZ,Js,Pi,WD,FZ,BD,zD,FD,YZ,zZ,y1,YD,VZ,UZ,XZ,XD=st(()=>{"use strict";Xn();Mi();Eo();on();Br();To();tn();xr();Ke();_o();$s();fr();en();$Z=20,HZ=11,gg=9,WZ=11,vf=8,BZ=4,Js=5,Pi=4,WD=10,FZ=1.4,BD=6,zD=12,FD=8,YZ=14,zZ=32,y1=15,YD=11,VZ=Kn().x(t=>t.x).y(t=>t.y).curve(fo),UZ=Kn().x(t=>t.x).y(t=>t.y).curve(fo),XZ=Kn().x(t=>t.x).y(t=>t.y).curve(Zi)});function w1(t,e=xg,n=KD){let r=Tn(t,e,n,{hardBreak:!0});if(r.length>b1){let a=r.slice(0,b1-1),i=r.slice(b1-1).join(" ");a.push(tr(i,e,n)),r=a}let o=0;for(let a of r){let i=_t(a,e);i>o&&(o=i)}return{lines:r,width:o+2*tQ,height:r.length*e*JZ+2*eQ}}function oQ(t){return x1(t,.5).p}function x1(t,e){if(t.length===0)return{p:{x:0,y:0},nx:0,ny:1};if(t.length===1)return{p:{x:t[0].x,y:t[0].y},nx:0,ny:1};let n=[],r=0;for(let i=1;i<t.length;i++){let s=Math.hypot(t[i].x-t[i-1].x,t[i].y-t[i-1].y);n.push(s),r+=s}let o=r*Math.max(0,Math.min(1,e));for(let i=1;i<t.length;i++){let s=n[i-1];if(o<=s||i===t.length-1){let l=s===0?0:Math.min(1,o/s),c=t[i-1].x,d=t[i-1].y,u=t[i].x,f=t[i].y,p=u-c,m=f-d,h=Math.hypot(p,m)||1;return{p:{x:c+p*l,y:d+m*l},nx:-m/h,ny:p/h}}o-=s}let a=t[t.length-1];return{p:{x:a.x,y:a.y},nx:0,ny:1}}function qD(t,e,n,r){return{minX:t-n/2,minY:e-r/2,maxX:t+n/2,maxY:e+r/2}}function bg(t,e,n,r,o,a){let i=t-n/2-a,s=e-r/2-a,l=t+n/2+a,c=e+r/2+a;for(let d of o)if(i<d.maxX&&l>d.minX&&s<d.maxY&&c>d.minY)return!0;return!1}function aQ(){let t=[.5];for(let e=1;e<=rQ;e++){let n=e*.08;.5-n>=.12&&t.push(.5-n),.5+n<=.88&&t.push(.5+n)}return t}function iQ(t,e,n,r){let o=aQ();for(let a of o){let{p:i}=x1(n,a);if(!bg(i.x,i.y,t,e,r,yg))return i}for(let a=jD;a<=nQ;a+=jD)for(let i of o){let{p:s,nx:l,ny:c}=x1(n,i);for(let d of[-1,1]){let u=s.x+l*a*d,f=s.y+c*a*d;if(!bg(u,f,t,e,r,yg))return{x:u,y:f}}}return null}function sQ(t){for(let r=0;r<8;r++){let o=!1;for(let a=0;a<t.length;a++)for(let i=a+1;i<t.length;i++){let s=t[a],l=t[i],c=Math.abs(s.cx-l.cx),d=Math.abs(s.cy-l.cy),u=(s.w+l.w)/2+4-c,f=(s.h+l.h)/2+4-d;if(u>0&&f>0){let p=f/2+1;s.cy<l.cy?(s.cy-=p,l.cy+=p):(s.cy+=p,l.cy-=p),o=!0}}if(!o)break}}function E1(t,e){let n=e?.fontSize??xg,r=e?.maxWidth??KD,o=[];for(let l of t.nodes)o.push(qD(l.x,l.y,l.width,l.height));for(let l of t.groups)l.collapsed&&o.push(qD(l.x,l.y,l.width,l.height));let a=[];t.edges.forEach((l,c)=>{if(!l.label||l.points.length<2)return;let d=w1(l.label,n,r),u=oQ(l.points),f=u.y;l.parallelCount>1&&l.yOffset!==0&&(f+=(l.yOffset<0?-1:1)*(d.height/2)),a.push({edgeIdx:c,cx:u.x,cy:f,w:d.width,h:d.height,lines:d.lines,resolved:!0})});for(let l of a){if(!bg(l.cx,l.cy,l.w,l.h,o,yg))continue;let c=t.edges[l.edgeIdx],d=iQ(l.w,l.h,c.points,o);d?(l.cx=d.x,l.cy=d.y):l.resolved=!1}sQ(a);for(let l of a)bg(l.cx,l.cy,l.w,l.h,o,yg)&&(l.resolved=!1);let i=new Map;for(let l of a)i.set(l.edgeIdx,l);let s=t.edges.map((l,c)=>{let d=i.get(c);return d?{...l,labelX:d.cx,labelY:d.cy,labelWidth:d.w,labelHeight:d.h,labelLines:d.lines}:l});return{layout:{...t,edges:s},unresolved:a.filter(l=>!l.resolved).map(l=>l.edgeIdx)}}var xg,KD,b1,JZ,tQ,eQ,yg,jD,nQ,rQ,S1=st(()=>{"use strict";en();xg=11,KD=160,b1=3,JZ=1.3,tQ=6,eQ=3,yg=4,jD=8,nQ=40,rQ=9});function mQ(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function ZD(t,e,n){if(t.groups.length>0)return[];let r=t.nodes.length;if(r<3||r>40)return[];let o=t.direction==="TB",a=n?.nodesep??lQ,i=n?.ranksep??cQ,s=n?.backEdgeSide??"nearest",l=n?.restarts??(r<=14?28:r<=25?14:6),c=n?.keepK??3,d=t.nodes.map($=>$.label),u=new Set(d),f=t.edges.map(($,U)=>({e:$,i:U})).filter(({e:$})=>u.has($.source)&&u.has($.target)&&$.source!==$.target);if(f.length===0)return[];let p=new Map;for(let $ of d)p.set($,[]);for(let{e:$,i:U}of f)p.get($.source).push({to:$.target,idx:U});let m=new Set,h=new Map;for(let $ of d)h.set($,0);let g=$=>{h.set($,1);for(let{to:U,idx:X}of p.get($)){let q=h.get(U);q===1?m.add(X):q===0&&g(U)}h.set($,2)};for(let $ of d)h.get($)===0&&g($);let v=f.map(({e:$,i:U})=>m.has(U)?{from:$.target,to:$.source,idx:U,rev:!0}:{from:$.source,to:$.target,idx:U,rev:!1}),y=new Map,b=new Map;for(let $ of d)y.set($,[]),b.set($,0);for(let $ of v)y.get($.from).push($.to),b.set($.to,(b.get($.to)??0)+1);let E=new Map;for(let $ of d)E.set($,0);let x=d.filter($=>(b.get($)??0)===0),L=new Map(b),S=[];for(;x.length;){let $=x.shift();S.push($);for(let U of y.get($))E.set(U,Math.max(E.get(U),E.get($)+1)),L.set(U,L.get(U)-1),L.get(U)===0&&x.push(U)}if(S.length!==d.length)return[];let A=Math.max(...d.map($=>E.get($))),C=new Map;for(let $ of t.nodes){let U=e.get($.label)??{width:Na,height:oa};C.set($.label,{id:$.label,dummy:!1,rank:E.get($.label),cross:0,thick:o?U.width:U.height,depth:o?U.height:U.width,realW:U.width,realH:U.height})}let M=[],w=[],k=[];for(let $ of v){if($.rev){k.push({edgeIdx:$.idx,src:$.to,tgt:$.from});continue}let U=E.get($.from),X=E.get($.to),q=[$.from],et=$.from;for(let tt=U+1;tt<X;tt++){let F=`__d${$.idx}_${tt}`;C.set(F,{id:F,dummy:!0,rank:tt,cross:0,thick:dQ,depth:0,realW:0,realH:0}),M.push({a:et,b:F}),q.push(F),et=F}M.push({a:et,b:$.to}),q.push($.to),w.push({edgeIdx:$.idx,chain:$.rev?q.slice().reverse():q})}let N=Array.from({length:A+1},()=>[]);for(let $ of C.values())N[$.rank].push($.id);let _=new Map,T=new Map;for(let $ of C.keys())_.set($,[]),T.set($,[]);for(let $ of M)T.get($.a).push($.b),_.get($.b).push($.a);let R=new Map,G=$=>{for(let U of C.keys())R.set(U,$.get(U))},I=$=>{if(!N[$+1])return 0;let X=[];for(let et of N[$]){let tt=R.get(et);for(let F of T.get(et))X.push({p:tt,q:R.get(F)})}let q=0;for(let et=0;et<X.length;et++)for(let tt=et+1;tt<X.length;tt++){let F=X[et],Q=X[tt];(F.p-Q.p)*(F.q-Q.q)<0&&q++}return q},H=()=>{let $=0;for(let U=0;U<A;U++)$+=I(U);return $},O=$=>{if($.length===0)return-1;$.sort((et,tt)=>et-tt);let U=Math.floor($.length/2);if($.length%2===1)return $[U];if($.length===2)return($[0]+$[1])/2;let X=$[U-1]-$[0],q=$[$.length-1]-$[U];return X+q===0?($[U-1]+$[U])/2:($[U-1]*q+$[U]*X)/(X+q)},D=($,U)=>{let X=N[$],q=U?_:T,et=new Map;for(let Z of X)et.set(Z,O(q.get(Z).map(lt=>R.get(lt))));let tt=X.filter(Z=>et.get(Z)>=0).sort((Z,lt)=>et.get(Z)-et.get(lt)),F=new Array(X.length).fill(null);for(let Z of X)et.get(Z)<0&&(F[R.get(Z)]=Z);let Q=0;for(let Z=0;Z<F.length;Z++)F[Z]===null&&(F[Z]=tt[Q++]);let ot=F;ot.forEach((Z,lt)=>R.set(Z,lt)),N[$]=ot},W=()=>{let $=!0,U=0;for(;$&&U++<12;){$=!1;for(let X=0;X<=A;X++){let q=N[X];for(let et=0;et<q.length-1;et++){let tt=(X>0?I(X-1):0)+(X<A?I(X):0),F=q[et],Q=q[et+1];q[et]=Q,q[et+1]=F,R.set(Q,et),R.set(F,et+1),(X>0?I(X-1):0)+(X<A?I(X):0)<tt?$=!0:(q[et]=F,q[et+1]=Q,R.set(F,et),R.set(Q,et+1))}}}},z=$=>{let U=$===0?null:mQ($);for(let X=0;X<=A;X++){let q=N[X].slice();if(U)for(let et=q.length-1;et>0;et--){let tt=Math.floor(U()*(et+1));[q[et],q[tt]]=[q[tt],q[et]]}N[X]=q,q.forEach((et,tt)=>R.set(et,tt))}},P=[];for(let $=0;$<l;$++){z($);let U=H(),X=new Map(R);for(let et=0;et<8;et++){if(et%2===0)for(let Q=1;Q<=A;Q++)D(Q,!0);else for(let Q=A-1;Q>=0;Q--)D(Q,!1);W();let F=H();if(F<U&&(U=F,X=new Map(R)),F===0)break}G(X);for(let et=0;et<=A;et++)N[et].sort((tt,F)=>R.get(tt)-R.get(F));let q=N.map(et=>et.join(",")).join("|");P.some(et=>et.sig===q)||P.push({sig:q,cross:U,order:new Map(X)})}P.sort(($,U)=>$.cross-U.cross);let B=P.slice(0,c);if(B.length===0)return[];let Y=[];for(let $ of B){G($.order);let U=Array.from({length:A+1},()=>[]);for(let X of C.values())U[X.rank].push(X.id);for(let X=0;X<=A;X++)U[X].sort((q,et)=>$.order.get(q)-$.order.get(et));Y.push(V(U))}return Y;function V($){let U=$.map(xt=>Math.max(0,...xt.map(Lt=>C.get(Lt).depth))),X=[],q=Ul;for(let xt=0;xt<=A;xt++)X[xt]=q+U[xt]/2,q+=U[xt]+i;for(let xt=0;xt<=A;xt++){let Lt=Ul;for(let Dt of $[xt]){let zt=C.get(Dt);zt.cross=Lt+zt.thick/2,Lt+=zt.thick+a}}let et=18;for(let xt=0;xt<et;xt++){let Dt=xt%2===0?Array.from({length:A+1},(zt,$t)=>$t):Array.from({length:A+1},(zt,$t)=>A-$t);for(let zt of Dt){let $t=$[zt],ft=$t.map(Wt=>{let he=C.get(Wt),ne=0,se=0;for(let Zt of _.get(Wt)){let Ie=j(he,C.get(Zt));ne+=Ie,se+=Ie*C.get(Zt).cross}for(let Zt of T.get(Wt)){let Ie=j(he,C.get(Zt));ne+=Ie,se+=Ie*C.get(Zt).cross}return ne>0?se/ne:he.cross});K($t,ft)}}let tt=1/0;for(let xt of C.values())tt=Math.min(tt,xt.cross-xt.thick/2);let F=Ul-tt;for(let xt of C.values())xt.cross+=F;let Q=xt=>o?{x:xt.cross,y:X[xt.rank]}:{x:X[xt.rank],y:xt.cross},ot=t.nodes.map(xt=>{let Lt=C.get(xt.label),Dt=Q(Lt);return{label:xt.label,x:Dt.x,y:Dt.y,width:Lt.realW,height:Lt.realH}}),Z=new Map;for(let xt of w)Z.set(xt.edgeIdx,xt.chain);let lt=1/0,nt=-1/0;for(let xt of C.values())xt.dummy||(lt=Math.min(lt,xt.cross-xt.thick/2),nt=Math.max(nt,xt.cross+xt.thick/2));let J=34,at=28,it=xt=>s==="left"?-1:s==="right"||C.get(xt.src).cross-C.get(xt.tgt).cross>=0?1:-1,vt=k.map(xt=>({...xt,side:it(xt),span:Math.abs(C.get(xt.src).rank-C.get(xt.tgt).rank)})).sort((xt,Lt)=>xt.side-Lt.side||xt.span-Lt.span),Tt=new Map;for(let xt of vt)Tt.set(xt.side,(Tt.get(xt.side)??0)+1);let At=new Map,rt=new Map,pt=xt=>Math.max(0,xt/2-6),ht=new Map,dt=new Map;{let xt=new Map;for(let Lt of vt){let Dt=`${Lt.side}|${Lt.tgt}`,zt=xt.get(Dt)??0;xt.set(Dt,zt+1),ht.set(Lt.edgeIdx,zt)}for(let[Lt,Dt]of xt)dt.set(Lt,Dt)}for(let xt of vt){let Lt=xt.side,Dt=At.get(Lt)??0;At.set(Lt,Dt+1);let zt=Tt.get(Lt),$t=C.get(xt.src),ft=C.get(xt.tgt),Wt=Lt>0?nt+J+Dt*at:lt-J-Dt*at,he=X[$t.rank],ne=X[ft.rank],se=zt>1?(Dt+1)/(zt+1):0,Zt=he+se*pt($t.depth),Ie=ne-se*pt(ft.depth),Ht=(ae,Te)=>o?{x:ae,y:Te}:{x:Te,y:ae},Qt=10,Ut=$t.cross+Lt*($t.thick/2+Qt),fe=ft.cross+Lt*(ft.thick/2+Qt),de=ht.get(xt.edgeIdx),te=dt.get(`${Lt}|${xt.tgt}`);if(te>1&&de>0){let ae=ne-(ft.depth/2+J+(de-1)*at),Te=ft.cross+Lt*pt(ft.thick)*(de/te);rt.set(xt.edgeIdx,[Ht($t.cross,he),Ht(Ut,Zt),Ht(Wt,Zt),Ht(Wt,ae),Ht(Te,ae),Ht(ft.cross,ne)])}else rt.set(xt.edgeIdx,[Ht($t.cross,he),Ht(Ut,Zt),Ht(Wt,Zt),Ht(Wt,Ie),Ht(fe,Ie),Ht(ft.cross,ne)])}let ut=[];for(let xt=0;xt<t.edges.length;xt++){let Lt=t.edges[xt];if(!u.has(Lt.source)||!u.has(Lt.target))continue;let Dt;if(Lt.source===Lt.target){let zt=Q(C.get(Lt.source));Dt=[zt,zt]}else if(rt.has(xt))Dt=rt.get(xt);else{let zt=Z.get(xt);if(!zt)continue;Dt=zt.map($t=>Q(C.get($t)))}ut.push({source:Lt.source,target:Lt.target,...Lt.label!==void 0&&{label:Lt.label},bidirectional:Lt.bidirectional,lineNumber:Lt.lineNumber,points:Dt,yOffset:0,parallelCount:1,metadata:Lt.metadata})}let yt=1/0,kt=1/0,Ot=-1/0,Xt=-1/0;for(let xt of ot)yt=Math.min(yt,xt.x-xt.width/2),kt=Math.min(kt,xt.y-xt.height/2),Ot=Math.max(Ot,xt.x+xt.width/2),Xt=Math.max(Xt,xt.y+xt.height/2);for(let xt of ut)for(let Lt of xt.points)yt=Math.min(yt,Lt.x),kt=Math.min(kt,Lt.y),Ot=Math.max(Ot,Lt.x),Xt=Math.max(Xt,Lt.y);let bt=Ul-yt,Nt=Ul-kt,Vt=bt!==0||Nt!==0?{nodes:ot.map(xt=>({...xt,x:xt.x+bt,y:xt.y+Nt})),edges:ut.map(xt=>({...xt,points:xt.points.map(Lt=>({x:Lt.x+bt,y:Lt.y+Nt}))}))}:{nodes:ot,edges:ut};return{nodes:Vt.nodes,edges:Vt.edges,groups:[],width:Ot+bt+Ul,height:Xt+Nt+Ul}}function j($,U){return $.dummy&&U.dummy?pQ:$.dummy||U.dummy?fQ:uQ}function K($,U){let X=$.length;if(X===0)return;let q=$.map(ot=>C.get(ot).thick/2),et=[0];for(let ot=1;ot<X;ot++)et[ot]=et[ot-1]+q[ot-1]+a+q[ot];let tt=U.map((ot,Z)=>ot-et[Z]),F=[];for(let ot=0;ot<X;ot++){let Z={pos:tt[ot],count:1,sumOffset:tt[ot],first:ot};for(;F.length&&F[F.length-1].pos>=Z.pos;){let lt=F.pop(),nt=lt.count+Z.count,J=lt.sumOffset+Z.sumOffset;Z={pos:J/nt,count:nt,sumOffset:J,first:lt.first}}F.push(Z)}let Q=new Array(X);for(let ot of F)for(let Z=0;Z<ot.count;Z++)Q[ot.first+Z]=ot.pos;for(let ot=0;ot<X;ot++)C.get($[ot]).cross=Q[ot]+et[ot]}}var lQ,cQ,dQ,Ul,uQ,fQ,pQ,QD=st(()=>{"use strict";kf();lQ=50,cQ=60,dQ=10,Ul=40,uQ=1,fQ=2,pQ=8});function vQ(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function kQ(t){if(t.length===0)return-1;t.sort((o,a)=>o-a);let e=Math.floor(t.length/2);if(t.length%2===1)return t[e];if(t.length===2)return(t[0]+t[1])/2;let n=t[e-1]-t[0],r=t[t.length-1]-t[e];return n+r===0?(t[e-1]+t[e])/2:(t[e-1]*r+t[e]*n)/(n+r)}function wg(t,e){let n=new Map;for(let l of t)n.set(l,[]);for(let l of e)n.get(l.from)?.push({to:l.to,idx:l.idx});let r=new Set,o=new Map;for(let l of t)o.set(l,0);let a=[],i=l=>{a.push(l);let c=new Map;for(;a.length;){let d=a[a.length-1];o.get(d)===0&&o.set(d,1);let u=n.get(d),f=c.get(d)??0,p=!1;for(;f<u.length;f++){let{to:m,idx:h}=u[f],g=o.get(m);if(g===1)r.add(h);else if(g===0){c.set(d,f+1),a.push(m),p=!0;break}}p||(c.set(d,u.length),o.set(d,2),a.pop())}};for(let l of t)o.get(l)===0&&i(l);return{dag:e.map(l=>r.has(l.idx)?{from:l.to,to:l.from,idx:l.idx,rev:!0}:{from:l.from,to:l.to,idx:l.idx,rev:!1})}}function JD(t,e){let n=new Map,r=new Map;for(let l of t)n.set(l,[]),r.set(l,0);for(let l of e)n.get(l.from).push(l.to),r.set(l.to,(r.get(l.to)??0)+1);let o=new Map;for(let l of t)o.set(l,0);let a=t.filter(l=>(r.get(l)??0)===0),i=new Map(r),s=0;for(;a.length;){let l=a.shift();s++;for(let c of n.get(l))o.set(c,Math.max(o.get(c),o.get(l)+1)),i.set(c,i.get(c)-1),i.get(c)===0&&a.push(c)}return s===t.length?o:null}function eO(t,e,n){if(t.groups.length===0)return[];let r=t.nodes.length;if(r<3||r>60)return[];let o=t.direction==="TB",a=t.nodes.map(tt=>tt.label),i=new Set(a);for(let tt of t.edges)if(tt.source.startsWith("__group_")||tt.target.startsWith("__group_"))return[];let s=new Map(t.groups.map(tt=>[tt.label,tt])),l=new Map;for(let tt of t.groups)for(let F of tt.children)i.has(F)&&l.set(F,tt.label);let c=tt=>{let F=tt,Q=new Set;for(;;){let ot=s.get(F);if(!ot?.parentGroup||Q.has(F))return F;Q.add(F),F=ot.parentGroup}},d=tt=>{let F=l.get(tt);if(!F)return[];let Q=[F],ot=F,Z=new Set([F]);for(;;){let lt=s.get(ot);if(!lt?.parentGroup||Z.has(lt.parentGroup))break;Q.push(lt.parentGroup),Z.add(lt.parentGroup),ot=lt.parentGroup}return Q.reverse()},u="\0node\0",f=tt=>{let F=l.get(tt);return F?c(F):u+tt},p=t.edges.map((tt,F)=>({e:tt,i:F})).filter(({e:tt})=>i.has(tt.source)&&i.has(tt.target)&&tt.source!==tt.target);if(p.length===0)return[];let m=new Map;for(let tt of a)m.set(tt,f(tt));let h=Array.from(new Set(a.map(tt=>m.get(tt)))),g=p.filter(({e:tt})=>m.get(tt.source)!==m.get(tt.target)).map(({e:tt,i:F})=>({from:m.get(tt.source),to:m.get(tt.target),idx:F})),{dag:v}=wg(h,g),y=JD(h,v.map(tt=>({from:tt.from,to:tt.to})));if(!y)return[];let b=new Map,E=new Map;for(let tt of a){let F=m.get(tt);(E.get(F)??E.set(F,[]).get(F)).push(tt)}for(let[tt,F]of E){let Q=new Set(F),ot=p.filter(({e:nt})=>m.get(nt.source)===tt&&m.get(nt.target)===tt&&Q.has(nt.source)&&Q.has(nt.target)).map(({e:nt,i:J})=>({from:nt.source,to:nt.target,idx:J})),{dag:Z}=wg(F,ot),lt=JD(F,Z.map(nt=>({from:nt.from,to:nt.to})));if(!lt)return[];for(let nt of F)b.set(nt,lt.get(nt))}let x=Math.max(...h.map(tt=>y.get(tt))),L=Array.from({length:x+1},()=>1);for(let tt of h){let F=Math.max(...E.get(tt).map(ot=>b.get(ot)+1)),Q=y.get(tt);L[Q]=Math.max(L[Q],F)}let S=[],A=0;for(let tt=0;tt<=x;tt++)S[tt]=A,A+=L[tt];let C=new Set(S.slice(1)),M=new Map;for(let tt of a)M.set(tt,S[y.get(m.get(tt))]+b.get(tt));let w=Math.max(...a.map(tt=>M.get(tt))),k=new Map;for(let tt of t.nodes){let F=e.get(tt.label)??{width:Na,height:oa};k.set(tt.label,{id:tt.label,dummy:!1,rank:M.get(tt.label),cross:0,thick:o?F.width:F.height,depth:o?F.height:F.width,realW:F.width,realH:F.height,unit:m.get(tt.label),path:d(tt.label)})}let N=[],_=[],T=[],R=[];for(let{e:tt,i:F}of p){let Q=M.get(tt.source),ot=M.get(tt.target);if(Q===ot){R.push({edgeIdx:F,a:tt.source,b:tt.target});continue}if(ot<Q){T.push({edgeIdx:F,src:tt.source,tgt:tt.target});continue}let Z=[tt.source],lt=tt.source;for(let nt=Q+1;nt<ot;nt++){let J=`__d${F}_${nt}`;k.set(J,{id:J,dummy:!0,rank:nt,cross:0,thick:yQ,depth:0,realW:0,realH:0,unit:u+J,path:[]}),_.push({a:lt,b:J}),Z.push(J),lt=J}_.push({a:lt,b:tt.target}),Z.push(tt.target),N.push({edgeIdx:F,chain:Z})}let G=Array.from({length:w+1},()=>[]);for(let tt of k.values())G[tt.rank].push(tt.id);let I=new Map,H=new Map;for(let tt of k.keys())I.set(tt,[]),H.set(tt,[]);for(let tt of _)H.get(tt.a).push(tt.b),I.get(tt.b).push(tt.a);let O=new Map,D=tt=>{if(!G[tt+1])return 0;let Q=[];for(let Z of G[tt]){let lt=O.get(Z);for(let nt of H.get(Z))Q.push({p:lt,q:O.get(nt)})}let ot=0;for(let Z=0;Z<Q.length;Z++)for(let lt=Z+1;lt<Q.length;lt++){let nt=Q[Z],J=Q[lt];(nt.p-J.p)*(nt.q-J.q)<0&&ot++}return ot},W=()=>{let tt=0;for(let F=0;F<w;F++)tt+=D(F);return tt},z=(tt,F)=>{let Q=G[tt],ot=F?I:H,Z=new Map;for(let it of Q)Z.set(it,kQ(ot.get(it).map(vt=>O.get(vt))));let lt=Q.filter(it=>Z.get(it)>=0).sort((it,vt)=>Z.get(it)-Z.get(vt)),nt=new Array(Q.length).fill(null);for(let it of Q)Z.get(it)<0&&(nt[O.get(it)]=it);let J=0;for(let it=0;it<nt.length;it++)nt[it]===null&&(nt[it]=lt[J++]);let at=nt;at.forEach((it,vt)=>O.set(it,vt)),G[tt]=at},P=()=>{let tt=!0,F=0;for(;tt&&F++<12;){tt=!1;for(let Q=0;Q<=w;Q++){let ot=G[Q];for(let Z=0;Z<ot.length-1;Z++){let lt=(Q>0?D(Q-1):0)+(Q<w?D(Q):0),nt=ot[Z],J=ot[Z+1];ot[Z]=J,ot[Z+1]=nt,O.set(J,Z),O.set(nt,Z+1),(Q>0?D(Q-1):0)+(Q<w?D(Q):0)<lt?tt=!0:(ot[Z]=nt,ot[Z+1]=J,O.set(nt,Z),O.set(J,Z+1))}}}},B=tt=>{let F=tt===0?null:vQ(tt);for(let Q=0;Q<=w;Q++){let ot=G[Q].slice();if(F)for(let Z=ot.length-1;Z>0;Z--){let lt=Math.floor(F()*(Z+1));[ot[Z],ot[lt]]=[ot[lt],ot[Z]]}G[Q]=ot,ot.forEach((Z,lt)=>O.set(Z,lt))}},Y=n?.restarts??(r<=16?20:r<=30?12:6),V=n?.keepK??3,j=[];for(let tt=0;tt<Y;tt++){B(tt);let F=W(),Q=new Map(O);for(let Z=0;Z<8;Z++){if(Z%2===0)for(let nt=1;nt<=w;nt++)z(nt,!0);else for(let nt=w-1;nt>=0;nt--)z(nt,!1);P();let lt=W();if(lt<F&&(F=lt,Q=new Map(O)),lt===0)break}for(let[Z,lt]of Q)O.set(Z,lt);for(let Z=0;Z<=w;Z++)G[Z].sort((lt,nt)=>O.get(lt)-O.get(nt));let ot=G.map(Z=>Z.join(",")).join("|");j.some(Z=>Z.sig===ot)||j.push({sig:ot,cross:F,order:new Map(Q)})}j.sort((tt,F)=>tt.cross-F.cross);let K=j.slice(0,V);if(K.length===0)return[];let $=[];for(let tt of K){for(let[Q,ot]of tt.order)O.set(Q,ot);let F=Array.from({length:w+1},()=>[]);for(let Q of k.values())F[Q.rank].push(Q.id);for(let Q=0;Q<=w;Q++)F[Q].sort((ot,Z)=>tt.order.get(ot)-tt.order.get(Z));$.push(et(F))}return $;function U(tt,F){return tt.dummy&&F.dummy?SQ:tt.dummy||F.dummy?EQ:wQ}function X(tt,F,Q){let ot=tt.length;if(ot===0)return;let Z=[0];for(let at=1;at<ot;at++)Z[at]=Z[at-1]+Q[at];let lt=F.map((at,it)=>at-Z[it]),nt=[];for(let at=0;at<ot;at++){let it={pos:lt[at],count:1,sumOffset:lt[at],first:at};for(;nt.length&&nt[nt.length-1].pos>=it.pos;){let vt=nt.pop(),Tt=vt.count+it.count,At=vt.sumOffset+it.sumOffset;it={pos:At/Tt,count:Tt,sumOffset:At,first:vt.first}}nt.push(it)}let J=new Array(ot);for(let at of nt)for(let it=0;it<at.count;it++)J[at.first+it]=at.pos;for(let at=0;at<ot;at++)k.get(tt[at]).cross=J[at]+Z[at]}function q(tt,F){let Q=tt.thick/2+F.thick/2+hQ;if(tt.dummy||F.dummy)return Q;if(tt.unit!==F.unit)return Q+2*Ed+bQ;let ot=tt.path[tt.path.length-1],Z=F.path[F.path.length-1];return ot!==Z&&(ot||Z)?Q+2*Ed:Q}function et(tt){let F=tt.map(Ht=>Math.max(0,...Ht.map(Qt=>k.get(Qt).depth))),Q=[],ot=tl;for(let Ht=0;Ht<=w;Ht++)Ht>0&&(ot+=gQ+(C.has(Ht)?xQ:0)),Q[Ht]=ot+F[Ht]/2,ot+=F[Ht];let Z=Ht=>Ht.map((Qt,Ut)=>Ut===0?0:q(k.get(Ht[Ut-1]),k.get(Qt)));for(let Ht=0;Ht<=w;Ht++){let Qt=tt[Ht],Ut=Z(Qt),fe=tl;for(let de=0;de<Qt.length;de++){let te=k.get(Qt[de]);fe+=Ut[de],te.cross=de===0?tl+te.thick/2:fe}}let lt=18;for(let Ht=0;Ht<lt;Ht++){let Ut=Ht%2===0?Array.from({length:w+1},(fe,de)=>de):Array.from({length:w+1},(fe,de)=>w-de);for(let fe of Ut){let de=tt[fe],te=de.map(ae=>{let Te=k.get(ae),Je=0,sn=0;for(let ze of I.get(ae)){let Ce=U(Te,k.get(ze));Je+=Ce,sn+=Ce*k.get(ze).cross}for(let ze of H.get(ae)){let Ce=U(Te,k.get(ze));Je+=Ce,sn+=Ce*k.get(ze).cross}return Je>0?sn/Je:Te.cross});X(de,te,Z(de))}}let nt=1/0;for(let Ht of k.values())nt=Math.min(nt,Ht.cross-Ht.thick/2);let J=tl-nt;for(let Ht of k.values())Ht.cross+=J;let at=Ht=>o?{x:Ht.cross,y:Q[Ht.rank]}:{x:Q[Ht.rank],y:Ht.cross},it=t.nodes.map(Ht=>{let Qt=k.get(Ht.label),Ut=at(Qt);return{label:Ht.label,x:Ut.x,y:Ut.y,width:Qt.realW,height:Qt.realH}}),vt=new Map;for(let Ht of N)vt.set(Ht.edgeIdx,Ht.chain);let Tt=1/0,At=-1/0;for(let Ht of k.values())Ht.dummy||(Tt=Math.min(Tt,Ht.cross-Ht.thick/2),At=Math.max(At,Ht.cross+Ht.thick/2));let rt=34,pt=28,ht=Ht=>Math.max(0,Ht/2-6),dt=Ht=>k.get(Ht.src).cross-k.get(Ht.tgt).cross>=0?1:-1,ut=T.map(Ht=>({...Ht,side:dt(Ht),span:Math.abs(k.get(Ht.src).rank-k.get(Ht.tgt).rank)})).sort((Ht,Qt)=>Ht.side-Qt.side||Ht.span-Qt.span),yt=new Map;for(let Ht of ut)yt.set(Ht.side,(yt.get(Ht.side)??0)+1);let kt=new Map,Ot=new Map;for(let Ht of ut){let Qt=Ht.side,Ut=kt.get(Qt)??0;kt.set(Qt,Ut+1);let fe=yt.get(Qt),de=k.get(Ht.src),te=k.get(Ht.tgt),ae=Qt>0?At+rt+Ut*pt:Tt-rt-Ut*pt,Te=Q[de.rank],Je=Q[te.rank],sn=fe>1?(Ut+1)/(fe+1):0,ze=Te-sn*ht(de.depth),Ce=Je+sn*ht(te.depth),ee=(_n,He)=>o?{x:_n,y:He}:{x:He,y:_n},oe=10,Be=de.cross+Qt*(de.thick/2+oe),dn=te.cross+Qt*(te.thick/2+oe);Ot.set(Ht.edgeIdx,[ee(de.cross,Te),ee(Be,ze),ee(ae,ze),ee(ae,Ce),ee(dn,Ce),ee(te.cross,Je)])}let Xt=new Map;for(let Ht of R){let Qt=k.get(Ht.a),Ut=k.get(Ht.b),fe=Q[Qt.rank],de=fe-(Qt.depth/2+26),te=(ae,Te)=>o?{x:ae,y:Te}:{x:Te,y:ae};Xt.set(Ht.edgeIdx,[te(Qt.cross,fe),te(Qt.cross,de),te(Ut.cross,de),te(Ut.cross,fe)])}let bt=[];for(let Ht=0;Ht<t.edges.length;Ht++){let Qt=t.edges[Ht];if(!i.has(Qt.source)||!i.has(Qt.target))continue;let Ut;if(Qt.source===Qt.target){let fe=at(k.get(Qt.source));Ut=[fe,fe]}else if(Ot.has(Ht))Ut=Ot.get(Ht);else if(Xt.has(Ht))Ut=Xt.get(Ht);else{let fe=vt.get(Ht);if(!fe)continue;Ut=fe.map(de=>at(k.get(de)))}bt.push({source:Qt.source,target:Qt.target,...Qt.label!==void 0&&{label:Qt.label},bidirectional:Qt.bidirectional,lineNumber:Qt.lineNumber,points:Ut,yOffset:0,parallelCount:1,metadata:Qt.metadata})}let Nt=new Map(it.map(Ht=>[Ht.label,{l:Ht.x-Ht.width/2,r:Ht.x+Ht.width/2,t:Ht.y-Ht.height/2,b:Ht.y+Ht.height/2}])),Vt=Ht=>{let Qt=0,Ut=Ht,fe=new Set;for(;Ut&&!fe.has(Ut);)fe.add(Ut),Ut=s.get(Ut)?.parentGroup,Ut&&Qt++;return Qt},xt=new Map;for(let Ht of t.groups)Ht.parentGroup&&(xt.get(Ht.parentGroup)??xt.set(Ht.parentGroup,[]).get(Ht.parentGroup)).push(Ht.label);let Lt=new Map,Dt=[...t.groups].sort((Ht,Qt)=>Vt(Qt.label)-Vt(Ht.label)),zt=[];for(let Ht of Dt){let Qt=1/0,Ut=-1/0,fe=1/0,de=-1/0,te=ze=>{Qt=Math.min(Qt,ze.l),Ut=Math.max(Ut,ze.r),fe=Math.min(fe,ze.t),de=Math.max(de,ze.b)};for(let ze of Ht.children){let Ce=Nt.get(ze);Ce&&te(Ce)}for(let ze of xt.get(Ht.label)??[]){let Ce=Lt.get(ze);Ce&&te(Ce)}if(!Number.isFinite(Qt))continue;let ae=Qt-Ed,Te=Ut+Ed,Je=fe-tO,sn=de+Ed;Lt.set(Ht.label,{l:ae,r:Te,t:Je,b:sn}),zt.push({label:Ht.label,lineNumber:Ht.lineNumber,x:(ae+Te)/2,y:(Je+sn)/2,width:Te-ae,height:sn-Je,collapsed:!1,childCount:Ht.children.length})}let $t=1/0,ft=1/0,Wt=-1/0,he=-1/0,ne=(Ht,Qt,Ut,fe)=>{$t=Math.min($t,Ht),ft=Math.min(ft,Qt),Wt=Math.max(Wt,Ut),he=Math.max(he,fe)};for(let Ht of it)ne(Ht.x-Ht.width/2,Ht.y-Ht.height/2,Ht.x+Ht.width/2,Ht.y+Ht.height/2);for(let Ht of bt)for(let Qt of Ht.points)ne(Qt.x,Qt.y,Qt.x,Qt.y);for(let Ht of zt)ne(Ht.x-Ht.width/2,Ht.y-Ht.height/2,Ht.x+Ht.width/2,Ht.y+Ht.height/2);let se=tl-$t,Zt=tl-ft,Ie=se!==0||Zt!==0;return{nodes:Ie?it.map(Ht=>({...Ht,x:Ht.x+se,y:Ht.y+Zt})):it,edges:Ie?bt.map(Ht=>({...Ht,points:Ht.points.map(Qt=>({x:Qt.x+se,y:Qt.y+Zt}))})):bt,groups:Ie?zt.map(Ht=>({...Ht,x:Ht.x+se,y:Ht.y+Zt})):zt,width:Wt+se+tl,height:he+Zt+tl}}}var hQ,gQ,yQ,tl,Ed,tO,bQ,xQ,wQ,EQ,SQ,v1=st(()=>{"use strict";kf();hQ=50,gQ=60,yQ=10,tl=40,Ed=16,tO=32,bQ=24,xQ=tO+2*Ed,wQ=1,EQ=2,SQ=8});var cO={};ye(cO,{countEdgeNearMiss:()=>HQ,countEdgeNodePierces:()=>sO,countEdgeOverlaps:()=>iO,countGroupOverlaps:()=>Sg,countSplineCrossings:()=>aO,deroutePierces:()=>k1,detectEdgeNodePierces:()=>N1,detectEdgeOverlaps:()=>Eg,detectGroupOverlaps:()=>WQ,layoutBoxesAndLinesSearch:()=>zQ,separateGroupBands:()=>lO});function _Q(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function AQ(t,e){let n=t.slice();for(let r=n.length-1;r>0;r--){let o=Math.floor(e()*(r+1));[n[r],n[o]]=[n[o],n[r]]}return n}function PQ(t){let e=t.match(IQ)??[],n=[],r=0,o=0,a=0,i="",s=()=>parseFloat(e[r++]),l=(c,d,u,f)=>{for(let p=0;p<=1;p+=.12){let m=1-p;u?n.push({x:m*m*m*c.x+3*m*m*p*d.x+3*m*p*p*u.x+p*p*p*f.x,y:m*m*m*c.y+3*m*m*p*d.y+3*m*p*p*u.y+p*p*p*f.y}):n.push({x:m*m*c.x+2*m*p*d.x+p*p*f.x,y:m*m*c.y+2*m*p*d.y+p*p*f.y})}};for(;r<e.length;){let c=e[r];if(/[MLQC]/i.test(c)&&(i=c,r++),i==="M"||i==="L"){let d=s(),u=s();n.push({x:d,y:u}),o=d,a=u}else if(i==="Q"){let d={x:s(),y:s()},u={x:s(),y:s()};l({x:o,y:a},d,null,u),o=u.x,a=u.y}else if(i==="C"){let d={x:s(),y:s()},u={x:s(),y:s()},f={x:s(),y:s()};l({x:o,y:a},d,u,f),o=f.x,a=f.y}else r++}return n}function L1(t){let e=t.edges,n=nO.get(e);if(n)return n;let r=t.edges.map(o=>{let a=o.points.length>=2?PQ(RQ(o.points)??""):[],i=1/0,s=1/0,l=-1/0,c=-1/0;for(let d of a)d.x<i&&(i=d.x),d.x>l&&(l=d.x),d.y<s&&(s=d.y),d.y>c&&(c=d.y);return{pts:a,x0:i,y0:s,x1:l,y1:c}});return nO.set(e,r),r}function DQ(t,e,n,r){let o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(Math.abs(o)<1e-9)return null;let a=((n.x-t.x)*(r.y-n.y)-(n.y-t.y)*(r.x-n.x))/o,i=((n.x-t.x)*(e.y-t.y)-(n.y-t.y)*(e.x-t.x))/o;return a>0&&a<1&&i>0&&i<1?{x:t.x+a*(e.x-t.x),y:t.y+a*(e.y-t.y)}:null}function aO(t,e=1/0){let n=new Map;for(let s of t.nodes)n.set(s.label,{x:s.x,y:s.y});for(let s of t.groups)s.collapsed&&n.set("__group_"+s.label,{x:s.x,y:s.y});let r=L1(t),o=t.edges,a=34,i=0;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){let c=r[s],d=r[l];if(c.pts.length<2||d.pts.length<2||c.x1<d.x0||d.x1<c.x0||c.y1<d.y0||d.y1<c.y0)continue;let u=o[s],f=o[l],p,m;(u.source===f.source||u.source===f.target)&&(p=n.get(u.source)),(u.target===f.source||u.target===f.target)&&(m=n.get(u.target));let h=[],g=c.pts,v=d.pts;for(let y=1;y<g.length;y++){let b=g[y-1],E=g[y],x=b.x<E.x?b.x:E.x,L=b.x>E.x?b.x:E.x,S=b.y<E.y?b.y:E.y,A=b.y>E.y?b.y:E.y;for(let C=1;C<v.length;C++){let M=v[C-1],w=v[C];if(L<(M.x<w.x?M.x:w.x)||(M.x>w.x?M.x:w.x)<x||A<(M.y<w.y?M.y:w.y)||(M.y>w.y?M.y:w.y)<S)continue;let k=DQ(b,E,M,w);k&&(p&&Math.hypot(k.x-p.x,k.y-p.y)<a||m&&Math.hypot(k.x-m.x,k.y-m.y)<a||h.some(N=>Math.hypot(N.x-k.x,N.y-k.y)<6)||h.push(k))}}if(i+=h.length,i>e)return i}return i}function OQ(t,e,n){let r=n.x-e.x,o=n.y-e.y,a=r*r+o*o;if(a<1e-9)return Math.hypot(t.x-e.x,t.y-e.y);let i=((t.x-e.x)*r+(t.y-e.y)*o)/a;return i=Math.max(0,Math.min(1,i)),Math.hypot(t.x-(e.x+i*r),t.y-(e.y+i*o))}function GQ(t,e){let n=1/0;for(let r=1;r<e.length;r++)n=Math.min(n,OQ(t,e[r-1],e[r]));return n}function rO(t,e){let n=Math.max(e.x-e.w/2-t.x,0,t.x-(e.x+e.w/2)),r=Math.max(e.y-e.h/2-t.y,0,t.y-(e.y+e.h/2));return Math.hypot(n,r)}function Eg(t,e){let n=e?.dist??8,r=e?.minLen??16,o=e?.nodeClear??12,a=new Map;for(let c of t.nodes)a.set(c.label,{x:c.x,y:c.y,w:c.width,h:c.height});for(let c of t.groups)c.collapsed&&a.set("__group_"+c.label,{x:c.x,y:c.y,w:c.width,h:c.height});let i=L1(t),s=t.edges,l=[];for(let c=0;c<i.length;c++)for(let d=c+1;d<i.length;d++){let u=i[c],f=i[d];if(u.pts.length<2||f.pts.length<2||u.x1+n<f.x0||f.x1+n<u.x0||u.y1+n<f.y0||f.y1+n<u.y0)continue;let p=s[c],m=s[d],h,g;(p.source===m.source||p.source===m.target)&&(h=a.get(p.source)),(p.target===m.source||p.target===m.target)&&(g=a.get(p.target));let v=[],y=0,b=()=>{y>=r&&v.length>=2&&l.push({mid:v[Math.floor(v.length/2)],length:y,pts:v.slice()}),v=[],y=0};for(let E of u.pts)!(h!==void 0&&rO(E,h)<o||g!==void 0&&rO(E,g)<o)&&GQ(E,f.pts)<n?(v.length&&(y+=Math.hypot(E.x-v[v.length-1].x,E.y-v[v.length-1].y)),v.push(E)):b();b()}return l}function iO(t,e){return Eg(t,e).length}function N1(t,e){let n=e?.inset??6,r=e?.minPts??2,o=[];for(let l of t.nodes)o.push({key:l.label,x:l.x,y:l.y,w:l.width,h:l.height});for(let l of t.groups)l.collapsed&&o.push({key:"__group_"+l.label,x:l.x,y:l.y,w:l.width,h:l.height});let a=(l,c)=>Math.abs(l.x-c.x)<c.w/2-n&&Math.abs(l.y-c.y)<c.h/2-n,i=[],s=L1(t);return t.edges.forEach((l,c)=>{if(l.points.length<2)return;let d=s[c].pts;for(let u of o){if(u.key===l.source||u.key===l.target||"__group_"+u.key===l.source||"__group_"+u.key===l.target)continue;let f=d.filter(p=>a(p,u));f.length>=r&&i.push({edgeIdx:c,node:u.key,pts:f})}}),i}function sO(t,e){return N1(t,e).length}function k1(t){let e=N1(t);if(!e.length)return t;let n=new Map;for(let a of t.nodes)n.set(a.label,{x:a.x,y:a.y,w:a.width,h:a.height});for(let a of t.groups)a.collapsed&&n.set("__group_"+a.label,{x:a.x,y:a.y,w:a.width,h:a.height});let r=new Map;for(let a of e){let i=r.get(a.edgeIdx);i?i.push(a.node):r.set(a.edgeIdx,[a.node])}let o=t.edges.map((a,i)=>{let s=r.get(i);if(!s)return a;let l=a.points.map(c=>({x:c.x,y:c.y}));for(let c of s){let d=n.get(c);d&&(l=$Q(l,d))}return{...a,points:l}});return{...t,edges:o}}function $Q(t,e){if(t.length<2)return t;let n={x:e.x,y:e.y},r=-1,o=0,a=1/0,i=t[0];for(let x=0;x<t.length-1;x++){let L=t[x],S=t[x+1],A=S.x-L.x,C=S.y-L.y,M=A*A+C*C||1e-9,w=((n.x-L.x)*A+(n.y-L.y)*C)/M;w=Math.max(0,Math.min(1,w));let k={x:L.x+w*A,y:L.y+w*C},N=Math.hypot(k.x-n.x,k.y-n.y);N<a&&(a=N,r=x,o=w,i=k)}if(r<0)return t;let s=i.x-n.x,l=i.y-n.y;Math.hypot(s,l)<1&&(e.w<=e.h?(s=1,l=0):(s=0,l=1));let c=Math.hypot(s,l)||1;s/=c,l/=c;let d=t[r],u=t[r+1],f=u.x-d.x,p=u.y-d.y,m=Math.hypot(f,p)||1;f/=m,p/=m;let h=Math.hypot(e.w,e.h)/2+18,g=Math.hypot(e.w,e.h)/2,v={x:i.x-f*g+s*h*.5,y:i.y-p*g+l*h*.5},y={x:n.x+s*h,y:n.y+l*h},b={x:i.x+f*g+s*h*.5,y:i.y+p*g+l*h*.5},E=t.slice(0,r+1);return E.push(v,y,b),E.push(...t.slice(r+1)),E}function HQ(t,e){let n=e?.near??14,r=e?.tight??8,o=e?.minLen??18,a=Eg(t,{dist:n,minLen:o}).length,i=Eg(t,{dist:r,minLen:o}).length;return Math.max(0,a-i)}function WQ(t,e){let n=e?.margin??4,r=t.groups.map(s=>({label:s.label,l:s.x-s.width/2,r:s.x+s.width/2,t:s.y-s.height/2,b:s.y+s.height/2})),o=(s,l)=>s.l<=l.l+n&&s.r>=l.r-n&&s.t<=l.t+n&&s.b>=l.b-n,a=r.map((s,l)=>r.some((d,u)=>u!==l&&o(s,d))?{...s,t:s.t-Lf}:s),i=new Set;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){if(o(r[s],r[l])||o(r[l],r[s]))continue;let c=a[s],d=a[l],u=Math.max(c.l-d.r,d.l-c.r),f=Math.max(c.t-d.b,d.t-c.b);Math.max(u,f)<n&&(i.add(r[s].label),i.add(r[l].label))}return[...i]}function Sg(t,e){let n=e?.margin??4,r=t.groups.map(s=>({l:s.x-s.width/2,r:s.x+s.width/2,t:s.y-s.height/2,b:s.y+s.height/2})),o=(s,l)=>s.l<=l.l+n&&s.r>=l.r-n&&s.t<=l.t+n&&s.b>=l.b-n,a=r.map((s,l)=>r.some((d,u)=>u!==l&&o(s,d))?{...s,t:s.t-Lf}:s),i=0;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){if(o(r[s],r[l])||o(r[l],r[s]))continue;let c=a[s],d=a[l],u=Math.max(c.l-d.r,d.l-c.r),f=Math.max(c.t-d.b,d.t-c.b);Math.max(u,f)<n&&i++}return i}function lO(t,e){if(t.groups.some(T=>T.collapsed)||Sg(t)===0)return t;let n=new Map;for(let T of e.groups)n.set(T.label,T.parentGroup);let r=T=>{let R=T,G=new Set;for(;;){let I=n.get(R);if(!I||G.has(I))return R;G.add(R),R=I}},o=e.groups.filter(T=>!T.parentGroup).map(T=>T.label);if(o.length<2)return t;let a=new Map;for(let T of e.groups)for(let R of T.children)e.groups.some(G=>G.label===R)||a.set(R,r(T.label));let i=e.direction==="TB"?"x":"y",s=new Map(t.groups.map(T=>[T.label,T])),l=o.map(T=>{let R=s.get(T),G=(i==="y"?R.height:R.width)/2,I=(i==="y"?R.y:R.x)-G,H=(i==="y"?R.y:R.x)+G,O=e.groups.some(D=>D.parentGroup===T);return i==="y"&&O&&(I-=Lf),{label:T,lo:I,hi:H,c:(I+H)/2}});l.sort((T,R)=>T.c-R.c);let c=16,d=l.map(T=>(T.hi-T.lo)/2),u=[0];for(let T=1;T<l.length;T++)u[T]=u[T-1]+d[T-1]+c+d[T];let f=l.map((T,R)=>T.c-u[R]),p=[];for(let T=0;T<l.length;T++){let R={pos:f[T],count:1,sum:f[T],first:T};for(;p.length&&p[p.length-1].pos>=R.pos;){let G=p.pop(),I=G.count+R.count,H=G.sum+R.sum;R={pos:H/I,count:I,sum:H,first:G.first}}p.push(R)}let m=new Array(l.length);for(let T of p)for(let R=0;R<T.count;R++)m[T.first+R]=T.pos+u[T.first+R];let h=new Map,g=!1;if(l.forEach((T,R)=>{let G=m[R]-T.c;h.set(T.label,G),Math.abs(G)>.5&&(g=!0)}),!g)return t;let v=T=>{if(T.startsWith("__group_"))return h.get(r(T.slice(8)))??0;let R=a.get(T);return R?h.get(R)??0:0},y=(T,R)=>i==="y"?{x:T.x,y:T.y+R}:{x:T.x+R,y:T.y},b=t.nodes.map(T=>{let R=v(T.label);return R?{...T,...i==="y"?{y:T.y+R}:{x:T.x+R}}:T}),E=t.groups.map(T=>{let R=h.get(r(T.label))??0;return R?{...T,...i==="y"?{y:T.y+R}:{x:T.x+R}}:T}),x=t.edges.map(T=>{let R=v(T.source),G=v(T.target);if(!R&&!G)return T;let I=T.points.length,H=T.points.map((O,D)=>{let W=I>1?D/(I-1):0;return y(O,R*(1-W)+G*W)});return{...T,points:H}}),L=1/0,S=1/0,A=-1/0,C=-1/0,M=(T,R)=>{T<L&&(L=T),T>A&&(A=T),R<S&&(S=R),R>C&&(C=R)};for(let T of b)M(T.x-T.width/2,T.y-T.height/2),M(T.x+T.width/2,T.y+T.height/2);for(let T of E)M(T.x-T.width/2,T.y-T.height/2-Lf),M(T.x+T.width/2,T.y+T.height/2);for(let T of x)for(let R of T.points)M(R.x,R.y);let w=40,k=w-L,N=w-S,_=k!==0||N!==0;return{nodes:_?b.map(T=>({...T,x:T.x+k,y:T.y+N})):b,groups:_?E.map(T=>({...T,x:T.x+k,y:T.y+N})):E,edges:_?x.map(T=>({...T,points:T.points.map(R=>({x:R.x+k,y:R.y+N}))})):x,width:A-L+2*w,height:C-S+2*w}}function BQ(t,e,n,r){let o=e.x-t.x,a=e.y-t.y,i=r.x-n.x,s=r.y-n.y,l=o*s-a*i;if(Math.abs(l)<1e-9)return!1;let c=((n.x-t.x)*s-(n.y-t.y)*i)/l,d=((n.x-t.x)*a-(n.y-t.y)*o)/l;return c>.001&&c<.999&&d>.001&&d<.999}function oO(t){let e=t.edges.filter(o=>o.points.length>=2),n=e.map(o=>{let a=1/0,i=1/0,s=-1/0,l=-1/0;for(let c of o.points)c.x<a&&(a=c.x),c.x>s&&(s=c.x),c.y<i&&(i=c.y),c.y>l&&(l=c.y);return{x0:a,y0:i,x1:s,y1:l}}),r=0;for(let o=0;o<e.length;o++)for(let a=o+1;a<e.length;a++){let i=e[o],s=e[a];if(i.source===s.source||i.source===s.target||i.target===s.source||i.target===s.target)continue;let l=n[o],c=n[a];if(l.x1<c.x0||c.x1<l.x0||l.y1<c.y0||c.y1<l.y0)continue;let d=i.points,u=s.points,f=!1;for(let p=0;p<d.length-1&&!f;p++)for(let m=0;m<u.length-1;m++)if(BQ(d[p],d[p+1],u[m],u[m+1])){f=!0;break}f&&r++}return r}function FQ(t,e){if(!e?.size)return 0;let n=0,r=0;for(let o of t.nodes){let a=e.get(o.label);a&&(n+=Math.hypot(o.x-a.x,o.y-a.y),r++)}return r?n/r:0}function YQ(t){let e=0;for(let n of t.edges)for(let r=1;r<n.points.length;r++)e+=Math.hypot(n.points[r].x-n.points[r-1].x,n.points[r].y-n.points[r-1].y);return e}async function zQ(t,e,n){let r=n?.hideDescriptions??!1,o=n?.reserveEdgeLabels??!1,a=n?.onProgress,i=a?()=>new Promise(nt=>setTimeout(nt)):()=>{},s=150,l=30,c=performance.now(),d=c,u=new Set;if(e){let nt=new Set;for(let J of e.originalGroups)t.groups.some(at=>at.label===J.label)||nt.add(J.label);for(let J of nt){let it=e.originalGroups.find(vt=>vt.label===J)?.parentGroup;(!it||!nt.has(it))&&u.add(J)}}let f=new Map,p=0;for(let nt of t.nodes){let J=r?{width:Na,height:oa}:M1(nt,t.showValues===!0);f.set(nt.label,J),!r&&nt.description&&nt.description.length>0&&(p=Math.max(p,J.height))}if(p>0){for(let nt of t.nodes)if(nt.description&&nt.description.length>0){let J=f.get(nt.label);f.set(nt.label,{width:J.width,height:p})}}let m=nt=>`__group_${nt}`,h=t.direction==="TB"?"TB":"LR",g=new Set(t.nodes.map(nt=>nt.label)),v=new Map,y=new Map;for(let nt of t.groups)if(v.set(nt.label,nt.children.filter(J=>g.has(J))),nt.parentGroup){let J=y.get(nt.parentGroup)??[];J.push(nt.label),y.set(nt.parentGroup,J)}let b=new Map,E=nt=>{let J=b.get(nt);if(J)return J;b.set(nt,[]);let at=[...v.get(nt)??[]];for(let it of y.get(nt)??[])at.push(...E(it));return b.set(nt,at),at},x=new Map,L=new Map;for(let nt of t.groups){let J=E(nt.label);if(J.length===0)continue;let at=new Set(J),it=new Map;for(let ht of t.edges)if(at.has(ht.source)&&at.has(ht.target)){let dt=it.get(ht.target)??[];dt.push(ht.source),it.set(ht.target,dt)}let vt=new Map,Tt=new Set,At=ht=>{let dt=vt.get(ht);if(dt!==void 0)return dt;if(Tt.has(ht))return 0;Tt.add(ht);let ut=0;for(let yt of it.get(ht)??[])ut=Math.max(ut,At(yt)+1);return Tt.delete(ht),vt.set(ht,ut),ut},rt=J[0],pt=J[0];for(let ht of J)At(ht)>At(rt)&&(rt=ht),At(ht)<At(pt)&&(pt=ht);x.set(m(nt.label),rt),L.set(m(nt.label),pt)}let S=nt=>x.get(nt)??nt,A=nt=>L.get(nt)??nt,C=nt=>`${nt.source}->${nt.target}#${nt.lineNumber}`,M=(nt,J)=>{let at=J.x-nt.x,it=J.y-nt.y,vt=at===0?1/0:nt.w/2/Math.abs(at),Tt=it===0?1/0:nt.h/2/Math.abs(it),At=Math.min(vt,Tt);return Number.isFinite(At)?{x:nt.x+at*At,y:nt.y+it*At}:{x:nt.x,y:nt.y}},w=(nt,J)=>Math.abs(nt.x-J.x)<=J.w/2&&Math.abs(nt.y-J.y)<=J.h/2,k=t.nodePositions,N=new Set(t.groups.map(nt=>nt.label)),_=t.groups.every(nt=>!nt.parentGroup&&!nt.children.some(J=>N.has(J))),T=new Set((e?.originalGroups??t.groups).map(nt=>nt.label)),R=u.size===0||k!==void 0&&e!==void 0&&[...u].every(nt=>{let J=e.originalGroups.find(at=>at.label===nt);return!J||J.parentGroup?!1:J.children.every(at=>k.has(at)&&!T.has(at))}),G=k!==void 0&&(t.nodes.length>0||u.size>0)&&t.nodes.every(nt=>k.has(nt.label))&&_&&R;function I(nt){let J=new Map,at=[];if(e)for(let Lt of u){let Dt=e.originalGroups.find(se=>se.label===Lt);if(!Dt)continue;let zt=1/0,$t=1/0,ft=-1/0,Wt=-1/0;for(let se of Dt.children){let Zt=nt.get(se);Zt&&(zt=Math.min(zt,Zt.x),ft=Math.max(ft,Zt.x),$t=Math.min($t,Zt.y),Wt=Math.max(Wt,Zt.y))}if(!Number.isFinite(zt))continue;let he=(zt+ft)/2,ne=($t+Wt)/2;J.set(`__group_${Lt}`,{x:he,y:ne}),at.push({label:Lt,lineNumber:Dt.lineNumber,childCount:e.collapsedChildCounts.get(Lt)??Dt.children.length,x:he,y:ne})}let it=Lt=>nt.get(Lt)??J.get(Lt),vt=Lt=>{let Dt=it(Lt),zt=f.get(Lt)??{width:Na,height:oa};return{x:Dt.x,y:Dt.y,w:zt.width,h:zt.height}},Tt=t.nodes.map(Lt=>{let Dt=vt(Lt.label);return{label:Lt.label,x:Dt.x,y:Dt.y,width:Dt.w,height:Dt.h}}),At=t.edges.flatMap(Lt=>{let Dt=it(Lt.source),zt=it(Lt.target);if(!Dt||!zt)return[];let $t=vt(Lt.source),ft=vt(Lt.target),Wt=M($t,zt),he=M(ft,Dt);return[{source:Lt.source,target:Lt.target,...Lt.label!==void 0&&{label:Lt.label},bidirectional:Lt.bidirectional,lineNumber:Lt.lineNumber,points:[Wt,he],yOffset:0,parallelCount:1,metadata:Lt.metadata,straight:!0}]}),rt=16,pt=new Map(Tt.map(Lt=>[Lt.label,Lt])),ht=[];for(let Lt of t.groups){let Dt=1/0,zt=1/0,$t=-1/0,ft=-1/0;for(let Zt of Lt.children){let Ie=pt.get(Zt);Ie&&(Dt=Math.min(Dt,Ie.x-Ie.width/2),$t=Math.max($t,Ie.x+Ie.width/2),zt=Math.min(zt,Ie.y-Ie.height/2),ft=Math.max(ft,Ie.y+Ie.height/2))}if(!Number.isFinite(Dt))continue;let Wt=Dt-rt,he=$t+rt,ne=zt-Lf,se=ft+rt;ht.push({label:Lt.label,lineNumber:Lt.lineNumber,x:(Wt+he)/2,y:(ne+se)/2,width:he-Wt,height:se-ne,collapsed:!1,childCount:Lt.children.length})}for(let Lt of at)ht.push({label:Lt.label,lineNumber:Lt.lineNumber,x:Lt.x,y:Lt.y,width:Na,height:oa,collapsed:!0,childCount:Lt.childCount});let dt=40,ut=1/0,yt=1/0,kt=-1/0,Ot=-1/0,Xt=(Lt,Dt)=>{Lt<ut&&(ut=Lt),Lt>kt&&(kt=Lt),Dt<yt&&(yt=Dt),Dt>Ot&&(Ot=Dt)};for(let Lt of Tt)Xt(Lt.x-Lt.width/2,Lt.y-Lt.height/2),Xt(Lt.x+Lt.width/2,Lt.y+Lt.height/2);for(let Lt of At)for(let Dt of Lt.points)Xt(Dt.x,Dt.y);for(let Lt of ht)Xt(Lt.x-Lt.width/2,Lt.y-Lt.height/2),Xt(Lt.x+Lt.width/2,Lt.y+Lt.height/2);let bt=2,Nt=ut<dt-bt?dt-ut:0,Vt=yt<dt-bt?dt-yt:0,xt=Nt!==0||Vt!==0;return{nodes:xt?Tt.map(Lt=>({...Lt,x:Lt.x+Nt,y:Lt.y+Vt})):Tt,edges:xt?At.map(Lt=>({...Lt,points:Lt.points.map(Dt=>({x:Dt.x+Nt,y:Dt.y+Vt}))})):At,groups:xt?ht.map(Lt=>({...Lt,x:Lt.x+Nt,y:Lt.y+Vt})):ht,width:kt+Nt+dt,height:Ot+Vt+dt}}function H(nt){let J=nt.seed===void 0?null:_Q(nt.seed+1),at=dt=>J?AQ(dt,J):dt.slice(),it=new er.graphlib.Graph({compound:!0,multigraph:!0});it.setGraph({rankdir:h,ranker:nt.ranker,nodesep:nt.nodesep,ranksep:nt.ranksep,edgesep:20,marginx:40,marginy:40}),it.setDefaultEdgeLabel(()=>({}));for(let dt of at(t.groups))it.setNode(m(dt.label),{label:dt.label});for(let dt of at(t.nodes)){let ut=f.get(dt.label);it.setNode(dt.label,{width:ut.width,height:ut.height})}for(let dt of u)it.setNode(m(dt),{width:Na,height:oa});for(let dt of t.groups){dt.parentGroup&&it.hasNode(m(dt.parentGroup))&&it.setParent(m(dt.label),m(dt.parentGroup));for(let ut of at(dt.children))it.hasNode(ut)&&it.setParent(ut,m(dt.label))}if(e)for(let dt of u){let ut=e.originalGroups.find(yt=>yt.label===dt);ut?.parentGroup&&!u.has(ut.parentGroup)&&it.hasNode(m(ut.parentGroup))&&it.setParent(m(dt),m(ut.parentGroup))}for(let dt of at(t.edges)){let ut=S(dt.source),yt=A(dt.target);if(ut!==yt&&it.hasNode(ut)&&it.hasNode(yt)){let kt={};if(o&&dt.label){let Ot=w1(dt.label,xg);kt={width:Ot.width,height:Ot.height,labelpos:"c"}}it.setEdge(ut,yt,kt,C(dt))}}er.layout(it);let vt=t.nodes.map(dt=>{let ut=it.node(dt.label);return{label:dt.label,x:ut.x,y:ut.y,width:ut.width,height:ut.height}}),Tt=t.groups.map(dt=>{let ut=it.node(m(dt.label));return{label:dt.label,lineNumber:dt.lineNumber,x:ut.x,y:ut.y,width:ut.width,height:ut.height,collapsed:!1,childCount:dt.children.length}});for(let dt of u){let ut=it.node(m(dt));Tt.push({label:dt,lineNumber:0,x:ut.x,y:ut.y,width:ut.width,height:ut.height,collapsed:!0,childCount:e?.collapsedChildCounts.get(dt)??0})}let At=new Map;for(let dt of t.groups){let ut=it.node(m(dt.label));ut&&At.set(m(dt.label),{x:ut.x,y:ut.y,w:ut.width,h:ut.height})}let rt=(dt,ut,yt)=>{if(dt.length<2)return dt;let kt=dt,Ot=At.get(ut);if(Ot){let bt=0;for(;bt<kt.length-1&&w(kt[bt],Ot);)bt++;kt=[M(Ot,kt[bt]),...kt.slice(bt)]}let Xt=At.get(yt);if(Xt){let bt=kt.length-1;for(;bt>0&&w(kt[bt],Xt);)bt--;kt=[...kt.slice(0,bt+1),M(Xt,kt[bt])]}return kt},pt=t.edges.flatMap(dt=>{let ut=S(dt.source),yt=A(dt.target),kt=C(dt);if(ut===yt||!it.hasEdge(ut,yt,kt))return[];let Ot=it.edge(ut,yt,kt),Xt=rt(Ot?.points??[],dt.source,dt.target);return[{source:dt.source,target:dt.target,...dt.label!==void 0&&{label:dt.label},bidirectional:dt.bidirectional,lineNumber:dt.lineNumber,points:Xt,yOffset:0,parallelCount:1,metadata:dt.metadata}]}),ht=it.graph();return{nodes:vt,edges:pt,groups:Tt,width:ht.width??800,height:ht.height??600}}if(G)return I(k);let O=t.nodes.length,D=n?.seeds??(O<=12?80:O<=22?40:O<=35?22:10),W=n?.refineK??6,z=n?.lambda??LQ,P=n?.previousPositions,B=["network-simplex","tight-tree","longest-path"],Y=[{nodesep:50,ranksep:60},{nodesep:34,ranksep:46},{nodesep:66,ranksep:82}],V=[];for(let nt of B)for(let J of Y)V.push({ranker:nt,...J});for(let nt=0;nt<D;nt++)V.push({ranker:"network-simplex",nodesep:50,ranksep:60,seed:nt});let j=(nt,J)=>{let at=aO(nt,J);return at>J?1/0:at+iO(nt)+sO(nt)+Sg(nt)},K=(nt,J)=>J*1e6+YQ(nt)+z*FQ(nt,P)*10,$=V.length+Math.min(n?.refineK??6,V.length),U=0,X=async nt=>{if(!a)return;a(++U,$,nt);let J=performance.now();J-c>s&&J-d>l&&(d=J,await i())},q=[];for(let nt of V){try{q.push(H(nt))}catch{}await X("Optimizing layout")}if(!q.length)return H({ranker:"network-simplex",nodesep:50,ranksep:60});let et=[];try{et=ZD(t,f)}catch{}if(t.groups.length>0&&u.size===0)try{et=et.concat(eO(t,f))}catch{}let tt=new Map;for(let nt of q)tt.set(nt,K(nt,oO(nt)));q.sort((nt,J)=>tt.get(nt)-tt.get(J));let F=Math.min(W,q.length),Q=q[0],ot=1/0,Z=1/0,lt=nt=>{let J=j(nt,Z);if(J===1/0)return;let at=K(nt,J);at<ot&&(ot=at,Z=J,Q=nt)};for(let nt of q.slice(0,F))lt(nt),await X("Refining layout");if(Z>=NQ&&O<=MQ){let nt=[];for(let at=D;at<D+TQ;at++)try{nt.push(H({ranker:"network-simplex",nodesep:50,ranksep:60,seed:at}))}catch{}let J=new Map;for(let at of nt)J.set(at,K(at,oO(at)));nt.sort((at,it)=>J.get(at)-J.get(it));for(let at of nt.slice(0,CQ))lt(at)}for(let nt of et){let J=[nt],at=k1(nt);at!==nt&&J.push(at);for(let it of J){let vt=j(it,Z-1);vt<Z&&(Z=vt,Q=it)}}if(Z>0){let nt=k1(Q);nt!==Q&&j(nt,Z-1)<Z&&(Q=nt)}if(Z>0&&Sg(Q)>0){let nt=lO(Q,t);nt!==Q&&j(nt,Z-1)<Z&&(Q=nt)}return Q}var LQ,NQ,MQ,TQ,CQ,RQ,IQ,nO,Lf,dO=st(()=>{"use strict";ss();Eo();kf();QD();v1();S1();LQ=4,NQ=4,MQ=45,TQ=18,CQ=10;RQ=Kn().x(t=>t.x).y(t=>t.y).curve(fo),IQ=/[MLQC]|-?\d*\.?\d+(?:e-?\d+)?/gi;nO=new WeakMap;Lf=32});var gO={};ye(gO,{NODE_HEIGHT:()=>oa,NODE_WIDTH:()=>Na,computeNodeSize:()=>M1,layoutBoxesAndLines:()=>eJ});function JQ(t){let e=[],n=0;for(let r=1;r<t.length;r++){let o=t.charAt(r-1),a=t.charAt(r),i=r+1<t.length?t.charAt(r+1):"",s=o>="a"&&o<="z"&&a>="A"&&a<="Z",l=o>="A"&&o<="Z"&&a>="A"&&a<="Z"&&i>="a"&&i<="z";(s||l)&&(e.push(t.slice(n,r)),n=r)}return e.push(t.slice(n)),e.length>1?e:[t]}function tJ(t,e=Na){let n=t.split(/[\s-]+/),r=[];for(let a of n)a&&r.push(...JQ(a));let o=e-24;for(let a=13;a>=9;a--){if(o<_t("MM",a))continue;let i=1,s="";for(let l of r){let c=s?`${s} ${l}`:l;_t(c,a)<=o?s=c:(i++,s=l)}if(i<=C1)return Math.min(i,C1)}return C1}function M1(t,e){if(!t.description||t.description.length===0)return{width:Na,height:oa};let n=XQ,o=tJ(t.label,n)*13*qQ+KQ,a=n-24,i=0;for(let c of t.description)_t(c,T1)<=a?i+=1:i+=Tn(c,T1,a,{hardBreak:!0}).length;i=Math.min(i,jQ);let s=i*T1*mO,l=o+hO+_1+s+_1+(e?QQ:0);return{width:n,height:Math.max(oa,l)}}async function eJ(t,e,n){let{layoutBoxesAndLinesSearch:r}=await Promise.resolve().then(()=>(dO(),cO)),o={...n?.hideDescriptions!==void 0&&{hideDescriptions:n.hideDescriptions},...n?.previousPositions!==void 0&&{previousPositions:n.previousPositions},...n?.onProgress!==void 0&&{onProgress:n.onProgress}},a=await r(t,e,o),i=E1(pO(a));if(i.unresolved.length>0){let s=await r(t,e,{...o,reserveEdgeLabels:!0}),l=E1(pO(s));l.unresolved.length<i.unresolved.length&&(i=l)}return nJ(i.layout,t,n?.collapsedNotes)}function nJ(t,e,n){let o=e.options?.["no-notes"]==="on"||!e.notes?new Map:no(e.notes,e.nodes.map(y=>({id:y.label,label:y.label})));if(o.size===0)return t;let a=$c(t.nodes.map(y=>({id:y.label,x:y.x,y:y.y,width:y.width,height:y.height})),o,e.direction==="TB"?"TB":"LR",n),i=t.nodes.map(y=>{let b=a.get(y.label);return b?{...y,note:b}:y}),s=1/0,l=1/0,c=-1/0,d=-1/0,u=(y,b,E,x)=>{y<s&&(s=y),b<l&&(l=b),E>c&&(c=E),x>d&&(d=x)};for(let y of i)u(y.x-y.width/2,y.y-y.height/2,y.x+y.width/2,y.y+y.height/2),y.note&&!y.note.collapsed&&u(y.x+y.note.x,y.y+y.note.y,y.x+y.note.x+y.note.width,y.y+y.note.y+y.note.height);for(let y of t.groups)u(y.x-y.width/2,y.y-y.height/2,y.x+y.width/2,y.y+y.height/2);if(!Number.isFinite(s))return{...t,nodes:i};let{shiftX:f,shiftY:p}=Hs(s,l),m=f!==0||p!==0,h=m?i.map(y=>({...y,x:y.x+f,y:y.y+p})):i,g=m?t.edges.map(y=>({...y,points:y.points.map(b=>({x:b.x+f,y:b.y+p})),...y.labelX!==void 0&&{labelX:y.labelX+f},...y.labelY!==void 0&&{labelY:y.labelY+p}})):t.edges,v=m?t.groups.map(y=>({...y,x:y.x+f,y:y.y+p})):t.groups;return{nodes:h,edges:g,groups:v,width:c+f+uO,height:d+p+uO}}function pO(t){let e=new Map;if(t.edges.forEach((o,a)=>{let[i,s]=o.source<o.target?[o.source,o.target]:[o.target,o.source],l=`${i}\0${s}`,c=e.get(l);c?c.push(a):e.set(l,[a])}),[...e.values()].every(o=>o.length<2))return t;let n=new Array(t.edges.length).fill(0),r=new Array(t.edges.length).fill(1);for(let o of e.values()){let a=o.slice(0,fO);for(let i of o.slice(fO))r[i]=0;a.length<2||a.forEach((i,s)=>{n[i]=(s-(a.length-1)/2)*VQ,r[i]=a.length})}return{...t,edges:t.edges.map((o,a)=>({...o,yOffset:n[a],parallelCount:r[a]}))}}var uO,fO,VQ,UQ,oa,Na,XQ,T1,mO,_1,hO,jQ,C1,qQ,KQ,ZQ,QQ,kf=st(()=>{"use strict";en();S1();ts();uO=40,fO=5,VQ=22,UQ=1.618,oa=60,Na=Math.round(oa*UQ),XQ=140,T1=10,mO=1.4,_1=8,hO=4,jQ=6,C1=3,qQ=1.3,KQ=12,ZQ=11,QQ=hO+ZQ*mO+_1});var MO={};ye(MO,{layoutSwimlane:()=>aJ});function oJ(t){return t==="exclusive"||t==="parallel"?{w:bO,h:bO}:t==="terminal"?{w:xO,h:xO}:{w:R1,h:LO}}function kO(t,e,n,r){let o=new Map,a=new Map;for(let c of t)o.set(c,[]),a.set(c,0);for(let c of e)o.get(c.from)?.push(c.to),a.set(c.to,(a.get(c.to)??0)+1);let i=new Map(t.map(c=>[c,0])),s=new Map;for(let c of t)s.set(c,new Map);let l=t.filter(c=>(a.get(c)??0)===0);for(let c=0;c<l.length;c++){let d=l[c],u=n(d),f=s.get(d),p=r?.get(d);p!==void 0&&(i.get(d)??0)<p&&i.set(d,p);let m=f.get(u);m!==void 0&&(i.get(d)??0)<=m&&i.set(d,m+1);let h=i.get(d),g=new Map(f);g.set(u,Math.max(g.get(u)??-1,h));for(let v of o.get(d)??[]){let y=h+(n(v)===u?1:0);y>(i.get(v)??0)&&i.set(v,y);let b=s.get(v);for(let[x,L]of g)L>(b.get(x)??-1)&&b.set(x,L);let E=(a.get(v)??0)-1;a.set(v,E),E===0&&l.push(v)}}return i}function aJ(t){let n=t.direction==="LR",r=new Map(t.nodes.map(F=>[F.id,F])),o=t.nodes.map(F=>F.id),a=new Map(t.nodes.map(F=>[F.id,oJ(F.shape)])),i=F=>{let Q=a.get(F);return n?Q.w:Q.h},s=F=>{let Q=a.get(F);return n?Q.h:Q.w},l=t.edges.map((F,Q)=>({from:F.source,to:F.target,idx:Q})).filter(F=>F.from!==F.to&&r.has(F.from)&&r.has(F.to)),{dag:c}=wg(o,l),d=F=>r.get(F).lane,u=kO(o,c.map(F=>({from:F.from,to:F.to})),d),f=new Map;for(let F of o)f.set(F,u.get(F)??0);{let F=new Map(t.lanes.map((Z,lt)=>[Z.id,lt])),Q=c.map(Z=>({from:Z.from,to:Z.to})),ot=new Map;for(let Z=0;Z<o.length;Z++){let lt=!1;for(let nt of l)if(!((f.get(nt.to)??0)>=(f.get(nt.from)??0)))for(let J of[nt.from,nt.to]){let at=f.get(J),it=F.get(d(J));for(let vt of o)vt===nt.from||vt===nt.to||f.get(vt)===at&&((F.get(d(vt))??0)<=it||(ot.get(vt)??0)<=at&&(ot.set(vt,at+1),lt=!0))}if(!lt)break;f=kO(o,Q,d,ot)}}let p=Array.from(new Set(o.map(F=>f.get(F)))).sort((F,Q)=>F-Q),m=new Map(p.map((F,Q)=>[F,Q])),h=p.length,g=F=>m.get(f.get(F))??0,v=wO+vg,y=Array.from({length:h},()=>0);for(let F of o){let Q=g(F);y[Q]=Math.max(y[Q],i(F))}let b=[],E=[];{let F=v;for(let Q=0;Q<h;Q++){let ot=Math.max(y[Q],R1);E[Q]=ot,b[Q]=F+ot/2,F+=ot+yO}}let x=F=>b[F]+E[F]/2+yO/2,L=(h>0?b[h-1]+Math.max(y[h-1],R1)/2:v)+vg,S=(t.phases.length?EO:0)+vg,A=new Map;for(let F of t.nodes){let Q=`${F.lane}\0${g(F.id)}`;(A.get(Q)??A.set(Q,[]).get(Q)).push(F.id)}let C=(F,Q)=>{let ot=A.get(`${F}\0${Q}`)??[];return ot.length===0?0:ot.reduce((Z,lt)=>Z+s(lt),0)+A1*(ot.length-1)},M=new Map,w=new Map,k=new Map;{let F=S;for(let Q of t.lanes){let ot=0;for(let lt=0;lt<h;lt++)ot=Math.max(ot,C(Q.id,lt));let Z=Math.max(rJ,ot+2*NO);M.set(Q.id,F),w.set(Q.id,Z),k.set(Q.id,F+Z/2),F+=Z}}let N=(()=>{let F=S;for(let Q of t.lanes)F+=w.get(Q.id);return F})(),_=new Map,T=new Map;for(let[F,Q]of A){let ot=F.indexOf("\0"),Z=F.slice(0,ot),lt=k.get(Z)??S,nt=Q.reduce((at,it)=>at+s(it),0)+A1*(Q.length-1),J=lt-nt/2;for(let at of Q){let it=s(at);T.set(at,J+it/2),J+=it+A1,_.set(at,b[g(at)])}}let R=0;for(let F of l)(f.get(F.to)??0)<(f.get(F.from)??0)&&R++;let I=R>0?SO+vO*(R-1):0,H=N+I+vg,O=(F,Q)=>n?{x:F,y:Q}:{x:Q,y:F},D=t.nodes.map(F=>{let Q=a.get(F.id),ot=O(_.get(F.id),T.get(F.id));return{id:F.id,label:F.label,shape:F.shape,event:F.event,lane:F.lane,...F.phase!==void 0&&{phase:F.phase},...F.color!==void 0&&{color:F.color},tags:F.tags,x:ot.x,y:ot.y,width:Q.w,height:Q.h,lineNumber:F.lineNumber}}),W=16,z=new Array(t.edges.length).fill(0);{let F=new Map;t.edges.forEach((Q,ot)=>{let Z=r.get(Q.source),lt=r.get(Q.target);if(!Z||!lt||Z.id===lt.id)return;let nt=f.get(Z.id)??0;if((f.get(lt.id)??0)<=nt||Math.abs((T.get(Z.id)??0)-(T.get(lt.id)??0))<.5)return;let at=`${Q.target}\0${nt}`;(F.get(at)??F.set(at,[]).get(at)).push(ot)});for(let Q of F.values())Q.length<2||(Q.sort((ot,Z)=>(T.get(t.edges[ot].source)??0)-(T.get(t.edges[Z].source)??0)),Q.forEach((ot,Z)=>{z[ot]=(Z-(Q.length-1)/2)*W}))}let P=4,B=(F,Q,ot,Z,lt,nt)=>{let J=1/0;for(let Tt of o){if(Tt===F)continue;let At=i(Tt)/2+P;if(Math.abs(_.get(Tt)-Q)>=At)continue;let rt=s(Tt)/2,pt=T.get(Tt);pt+rt<=ot||pt-rt>=Z||(J=Math.min(J,pt-rt))}if(J===1/0)return{flow:Q};let at=lt-1,it=lt<h-1?lt:-1,vt=nt<Q?at:it;return vt<0&&(vt=nt<Q?it:at),vt<0?{flow:Q}:{flow:x(vt),jogCross:(ot+J)/2}},Y=0,V=[];t.edges.forEach((F,Q)=>{let ot=r.get(F.source),Z=r.get(F.target);if(!ot||!Z||ot.id===Z.id)return;let lt=_.get(ot.id),nt=T.get(ot.id),J=_.get(Z.id),at=T.get(Z.id),it=i(ot.id)/2,vt=i(Z.id)/2,Tt=s(ot.id)/2,At=s(Z.id)/2,rt=f.get(ot.id)??0,pt=f.get(Z.id)??0,ht,dt=!1;if(pt>rt){let ut=lt+it,yt=J-vt;if(Math.abs(nt-at)<.5)ht=[O(ut,nt),O(yt,at)];else{let kt=(ut+yt)/2+z[Q];ht=[O(ut,nt),O(kt,nt),O(kt,at),O(yt,at)]}}else if(pt===rt){let ut=at>=nt,yt=nt+(ut?Tt:-Tt),kt=at+(ut?-At:At);if(Math.abs(lt-J)<.5)ht=[O(lt,yt),O(J,kt)];else{let Ot=(yt+kt)/2;ht=[O(lt,yt),O(lt,Ot),O(J,Ot),O(J,kt)]}}else{dt=!0;let ut=N+SO+vO*Y;Y++;let yt=nt+Tt,kt=at+At,Ot=B(ot.id,lt,yt,ut,g(ot.id),J),Xt=B(Z.id,J,kt,ut,g(Z.id),lt);ht=[O(lt,yt),...Ot.jogCross!==void 0?[O(lt,Ot.jogCross),O(Ot.flow,Ot.jogCross)]:[],O(Ot.flow,ut),O(Xt.flow,ut),...Xt.jogCross!==void 0?[O(Xt.flow,Xt.jogCross),O(J,Xt.jogCross)]:[],O(J,kt)]}V.push({source:F.source,target:F.target,...F.label!==void 0&&{label:F.label},points:ht,back:dt,lineNumber:F.lineNumber})});let j=(F,Q,ot,Z)=>n?{x:F,y:ot,width:Q,height:Z}:{x:ot,y:F,width:Z,height:Q},K=t.lanes.map(F=>{let Q=j(0,L,M.get(F.id),w.get(F.id));return{id:F.id,label:F.label,...F.color!==void 0&&{color:F.color},...Q,headerSize:wO,lineNumber:F.lineNumber}}),$=new Map(t.phases.map((F,Q)=>[F.id,Q])),U=Array.from({length:h},()=>{});for(let F of t.nodes){if(F.phase===void 0)continue;let Q=$.get(F.phase);if(Q===void 0)continue;let ot=g(F.id),Z=U[ot];(Z===void 0||Q<Z)&&(U[ot]=Q)}let X=Array.from({length:h},()=>0),q=0;for(let F=0;F<h;F++){let Q=U[F];Q!==void 0&&Q>q&&(q=Q),X[F]=q}let et=(F,Q)=>(b[F]+b[Q])/2,tt=[];if(t.phases.length>0&&h>0){let F=0;for(let Q=1;Q<=h;Q++)if(Q===h||X[Q]!==X[F]){let ot=F,Z=Q-1,lt=t.phases[X[F]],nt=ot===0?0:et(ot-1,ot),J=Z===h-1?L:et(Z,Z+1);tt.push({id:lt.id,label:lt.label,...j(nt,J-nt,0,H),headerSize:EO,lineNumber:lt.lineNumber}),F=Q}}return{nodes:D,edges:V,lanes:K,phases:tt,width:n?L:H,height:n?H:L}}var vg,yO,R1,LO,bO,xO,A1,NO,rJ,wO,EO,SO,vO,TO=st(()=>{"use strict";v1();vg=30,yO=64,R1=124,LO=44,bO=56,xO=40,A1=16,NO=22,rJ=LO+2*NO,wO=116,EO=30,SO=28,vO=18});function Sd(t,e){let{idPrefix:n,width:r,height:o,baseFill:a,colors:i}=e,s=(l,c)=>{t.append("marker").attr("id",l).attr("viewBox",`0 0 ${r} ${o}`).attr("refX",r).attr("refY",o/2).attr("markerWidth",r).attr("markerHeight",o).attr("orient","auto").append("polygon").attr("points",`0,0 ${r},${o/2} 0,${o}`).attr("fill",c)};s(`${n}-arrow`,a);for(let l of i??[])s(`${n}-arrow-${l.replace("#","")}`,l)}var kg=st(()=>{"use strict"});var IO={};ye(IO,{renderSwimlaneForExport:()=>mJ});function fJ(t,e){if(t.length<3)return t.map((o,a)=>`${a?"L":"M"}${o.x} ${o.y}`).join(" ");let n=`M${t[0].x} ${t[0].y}`;for(let o=1;o<t.length-1;o++){let a=t[o-1],i=t[o],s=t[o+1],l=Math.hypot(i.x-a.x,i.y-a.y),c=Math.hypot(s.x-i.x,s.y-i.y);if(l<.01||c<.01){n+=` L${i.x} ${i.y}`;continue}let d=Math.min(e,l/2,c/2),u=i.x-(i.x-a.x)/l*d,f=i.y-(i.y-a.y)/l*d,p=i.x+(s.x-i.x)/c*d,m=i.y+(s.y-i.y)/c*d;n+=` L${u} ${f} Q${i.x} ${i.y} ${p} ${m}`}let r=t[t.length-1];return n+=` L${r.x} ${r.y}`,n}function pJ(t,e,n,r,o,a){let i=o-n,s=a-r,l=i*i+s*s,c=l>0?((t-n)*i+(e-r)*s)/l:0;return c=Math.max(0,Math.min(1,c)),Math.hypot(t-(n+c*i),e-(r+c*s))}function AO(t,e,n,r,o={}){let a=Math.min(n,r)/2,i=Math.min(o.tl??0,a),s=Math.min(o.tr??0,a),l=Math.min(o.br??0,a),c=Math.min(o.bl??0,a);return[`M${t+i},${e}`,`H${t+n-s}`,s?`A${s},${s} 0 0 1 ${t+n},${e+s}`:"",`V${e+r-l}`,l?`A${l},${l} 0 0 1 ${t+n-l},${e+r}`:"",`H${t+c}`,c?`A${c},${c} 0 0 1 ${t},${e+r-c}`:"",`V${e+i}`,i?`A${i},${i} 0 0 1 ${t+i},${e}`:"","Z"].join(" ")}function mJ(t,e,n,r,o,a={}){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let i=e.title?40:0,s=a.exportDims?.width??n.width,l=(a.exportDims?.height??n.height)+0,c=Rt(t).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("width",s).attr("height",l).attr("viewBox",`0 0 ${s} ${l}`).style("font-family",It),d=c.append("defs"),u=nr(r,o),f={error:r.colors.red,success:r.colors.green,terminate:r.text,neutral:r.border};Sd(d,{idPrefix:"sw",width:dJ,height:uJ,baseFill:r.textMuted,colors:[f.error,f.success]});let p=c.append("g").attr("transform",`translate(0, ${i})`);e.title&&c.append("text").attr("x",s/2).attr("y",30).attr("text-anchor","middle").attr("font-size",20).attr("font-weight","700").attr("fill",r.text).text(e.title);let m=new Map;e.lanes.forEach((M,w)=>{let k=M.color??Dn(gl[w%gl.length],r)??r.border;m.set(M.id,k)});let h=e.direction==="LR",g=e.options["solid-fill"]==="on",v=M=>Gt(M,u,9),y=M=>{for(let w of n.lanes){let k=h?w.y:w.x,N=k+(h?w.height:w.width);if(M>=k&&M<=N)return v(m.get(w.id)??r.border)}return u},b=p.append("g").attr("class","dgmo-swimlane-lanes");for(let M of n.lanes){let w=m.get(M.id)??r.border,k=h?M.x:M.x+Ng,N=h?M.y+Ng:M.y,_=h?M.width:M.width-Ng*2,T=h?M.height-Ng*2:M.height;b.append("path").attr("d",AO(k,N,_,T,{tl:ls,tr:ls,br:ls,bl:ls})).attr("fill",Gt(w,u,9)).attr("stroke",Gt(r.border,u,60)).attr("stroke-width",1).attr("data-line-number",String(M.lineNumber));let R=h?M.headerSize:_,G=h?T:M.headerSize;b.append("path").attr("d",AO(k,N,R,G,h?{tl:ls,bl:ls}:{tl:ls,tr:ls})).attr("fill",Gt(w,u,16)).attr("opacity",.6),b.append("text").attr("x",h?k+12:k+_/2).attr("y",h?N+T/2:N+M.headerSize/2).attr("text-anchor",h?"start":"middle").attr("dominant-baseline","middle").attr("font-size",iJ).attr("font-weight","700").attr("fill",Gt(w,r.text,55)).text(M.label)}let E=p.append("g").attr("class","dgmo-swimlane-phases");n.phases.forEach((M,w)=>{w%2===1&&E.append("rect").attr("x",M.x).attr("y",M.y).attr("width",M.width).attr("height",M.height).attr("rx",ls).attr("fill",r.text).attr("opacity",.05).attr("pointer-events","none"),E.append("text").attr("x",h?M.x+M.width/2:M.headerSize/2).attr("y",h?M.headerSize/2:M.y+M.height/2).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-size",sJ).attr("font-weight","700").attr("letter-spacing","0.06em").attr("fill",r.textMuted).attr("data-line-number",String(M.lineNumber)).text(M.label)});let x=a.activeTagGroup??null,L=M=>{if(x){let k=qt(x);if(M.tags[k]){let N=ar(M.tags,[...e.tagGroups],x);if(N&&N!=="#999999")return{fill:g?N:Gt(N,u,22),stroke:N}}}if(M.shape==="terminal")return M.event==="error"?{fill:g?f.error:Gt(f.error,u,22),stroke:f.error}:M.event==="success"?{fill:g?f.success:Gt(f.success,u,22),stroke:f.success}:M.event==="terminate"?{fill:Gt(r.text,u,30),stroke:r.text}:{fill:r.bg,stroke:r.textMuted};if(M.shape==="exclusive"||M.shape==="parallel")return{fill:Gt(r.surface,u,80),stroke:r.textMuted};let w=m.get(M.lane)??r.border;return{fill:g?w:Gt(w,u,20),stroke:Gt(w,r.text,40)}},S=new Map(n.nodes.map(M=>[M.id,M])),A=p.append("g").attr("class","dgmo-swimlane-edges");for(let M of n.edges){let w=S.get(M.target),k=r.textMuted,N="sw-arrow";w?.shape==="terminal"&&w.event==="error"?(k=f.error,N=`sw-arrow-${f.error.replace("#","")}`):w?.shape==="terminal"&&w.event==="success"&&(k=f.success,N=`sw-arrow-${f.success.replace("#","")}`);let _=fJ(M.points,cJ);if(A.append("path").attr("d",_).attr("fill","none").attr("stroke",k).attr("stroke-width",lJ).attr("stroke-dasharray",M.back?"5 4":null).attr("marker-end",`url(#${N})`).attr("data-line-number",String(M.lineNumber)),M.label){let T=[],R=0;for(let q=0;q<M.points.length-1;q++){let et=M.points[q],tt=M.points[q+1],F=Math.abs(tt.x-et.x)+Math.abs(tt.y-et.y);T.push(F),R+=F}let G=R/2,I=0;for(let q=0;q<T.length;q++){if(G<=T[q]||q===T.length-1){I=q;break}G-=T[q]}let H=M.points[I],O=M.points[I+1]??H,D=T[I]>0?G/T[I]:.5,W={x:H.x+(O.x-H.x)*D,y:H.y+(O.y-H.y)*D},z=Math.abs(O.x-H.x)>=Math.abs(O.y-H.y),P=7,B=(q,et)=>{let tt=1/0;for(let F of n.edges)if(F!==M)for(let Q=0;Q<F.points.length-1;Q++){let ot=pJ(q,et,F.points[Q].x,F.points[Q].y,F.points[Q+1].x,F.points[Q+1].y);ot<tt&&(tt=ot)}return tt},Y=M.label.length*CO*.6,V=(q,et,tt)=>{let F=tt===0?[q-Y/2,q,q+Y/2]:[q,q+tt*Y/2,q+tt*Y];return Math.min(...F.map(Q=>B(Q,et)))},j=10,K,$,U,X;if(z){let q=V(W.x,W.y-P,0),et=V(W.x,W.y+P,0),tt=q<j&&et>q;K=W.x,$=W.y+(tt?P:-P),U="middle",X=tt?"hanging":"auto"}else{let q=V(W.x+P,W.y,1),et=V(W.x-P,W.y,-1),tt=q<j&&et>q;K=W.x+(tt?-P:P),$=W.y,U=tt?"end":"start",X="middle"}A.append("text").attr("x",K).attr("y",$).attr("text-anchor",U).attr("dominant-baseline",X).attr("font-size",CO).attr("fill",k===r.textMuted?r.textMuted:k).attr("stroke",y($)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(M.label)}}let C=p.append("g").attr("class","dgmo-swimlane-nodes");for(let M of n.nodes){let{fill:w,stroke:k}=L(M),N=C.append("g").attr("data-line-number",String(M.lineNumber)).attr("data-lane",M.lane),_=M.x,T=M.y;if(M.shape==="exclusive"||M.shape==="parallel"){let R=M.width/2;if(N.append("polygon").attr("points",`${_},${T-R} ${_+R},${T} ${_},${T+R} ${_-R},${T}`).attr("fill",w).attr("stroke",k).attr("stroke-width",I1),M.shape==="parallel"){let G=r.textMuted;N.append("line").attr("x1",_).attr("y1",T-R/2.4).attr("x2",_).attr("y2",T+R/2.4).attr("stroke",G).attr("stroke-width",2.4),N.append("line").attr("x1",_-R/2.4).attr("y1",T).attr("x2",_+R/2.4).attr("y2",T).attr("stroke",G).attr("stroke-width",2.4),N.append("text").attr("x",_).attr("y",T+R+12).attr("text-anchor","middle").attr("font-size",Lg-1).attr("fill",r.textMuted).attr("stroke",y(T+R+12)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(M.label)}else RO(N,M.label,_,T,r.text,Lg-1,!0,y(T))}else if(M.shape==="terminal"){let R=M.width/2;N.append("circle").attr("cx",_).attr("cy",T).attr("r",R).attr("fill",w).attr("stroke",k).attr("stroke-width",M.event==="none"?I1:2.4),M.event==="success"&&N.append("circle").attr("cx",_).attr("cy",T).attr("r",R-4).attr("fill","none").attr("stroke",k).attr("stroke-width",1);let G=!1;for(let H of n.edges){let O=H.target===M.id?H.points[H.points.length-1]:H.source===M.id?H.points[0]:void 0;O&&O.y>T+R*.5&&(G=!0)}let I=G?T-R-6:T+R+12;N.append("text").attr("x",_).attr("y",I).attr("text-anchor","middle").attr("font-size",Lg-1).attr("fill",r.text).attr("stroke",y(I)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(M.label)}else{N.append("rect").attr("x",_-M.width/2).attr("y",T-M.height/2).attr("width",M.width).attr("height",M.height).attr("rx",_O).attr("fill",w).attr("stroke",k).attr("stroke-width",I1),M.shape==="subprocess"&&N.append("rect").attr("x",_-M.width/2+3).attr("y",T-M.height/2+3).attr("width",M.width-6).attr("height",M.height-6).attr("rx",_O-2).attr("fill","none").attr("stroke",k).attr("stroke-width",1);let R=ve(w,r.textOnFillLight,r.textOnFillDark);RO(N,M.label,_,T,R,Lg)}}}function hJ(t,e){let n=[],r="";for(let o of t)r===""?r=o:r.length+1+o.length<=e?r+=" "+o:(n.push(r),r=o);return r&&n.push(r),n}function RO(t,e,n,r,o,a,i=!1,s){let l=e.split(/\s+/),c;if(i)c=l.length===1?[e]:hJ(l,7);else if(e.length<=14||l.length===1)c=[e];else{let f=Math.ceil(l.length/2);c=[l.slice(0,f).join(" "),l.slice(f).join(" ")]}let d=a*1.2,u=r-(c.length-1)*d/2;c.forEach((f,p)=>{let m=t.append("text").attr("x",n).attr("y",u+p*d).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-size",a).attr("fill",o);s&&m.attr("stroke",s).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke"),m.text(f)})}var Lg,iJ,sJ,CO,_O,I1,lJ,cJ,dJ,uJ,ls,Ng,PO=st(()=>{"use strict";Xn();on();kg();tn();xr();Ke();Lg=12,iJ=12,sJ=12,CO=11,_O=8,I1=1.5,lJ=1.6,cJ=11,dJ=9,uJ=6.4,ls=10,Ng=2});function yJ(t){let e=[],n=t.split(/(\s+)/);for(let r of n){if(/^\s+$/.test(r))continue;let o=r.split(/(?<=-)(?=\S)/);e.push(...o)}return e}function DO(t,e,n,r){let o=e-D1,a=[],i="";for(let s of t){let l=i&&!i.endsWith("-")?" ":"",c=i+l+s;if(_t(c,n)<=o)i=c;else if(!i)i=s;else{if(a.push(i),a.length>=r)return null;i=s}}return i&&a.push(i),a.length>r?null:a}function OO(t,e,n){let r=e-D1,o=[...t],a=o[o.length-1];return _t(a,n)>r&&(o[o.length-1]=tr(a,n,r)),o}function GO(t,e,n,r,o=$O){if(!t)return{lines:[""],fontSize:n};let a=yJ(t);for(let c=n;c>=r;c--){let d=DO(a,e,c,o);if(d)return{lines:OO(d,e,c),fontSize:c}}let i=DO(a,e,r,999)??[t],s=i.slice(0,o),l=OO(s,e,r);if(i.length>o){let c=l[l.length-1];if(!c.endsWith("\u2026")){let d=e-D1;_t(c+"\u2026",r)>d?l[l.length-1]=tr(c,r,d):l[l.length-1]=c+"\u2026"}}return{lines:l,fontSize:r}}function wJ(t){return Math.max(HO,bJ-t*xJ)}function Mg(t,e,n,r,o){let a=wJ(n),i=GO(t,r,a,HO,$O),s=[],l=P1;if(!o&&e&&e.length>0){let c=gJ;for(let d of e){if(c<=0)break;let u=ta(d),f=GO(u,r,P1,P1,c);s.push(...f.lines),c-=f.lines.length,l=f.fontSize}}return{labelLines:i.lines,labelFontSize:i.fontSize,descLines:s,descFontSize:l}}var D1,$O,gJ,bJ,HO,xJ,P1,O1=st(()=>{"use strict";Ka();en();D1=16,$O=3,gJ=2;bJ=17,HO=9,xJ=3,P1=10});var BO={};ye(BO,{layoutMindmap:()=>Cg});function Cg(t,e,n){let r=t.roots;if(r.length===0)return{nodes:[],edges:[],width:0,height:0};let o=n?.hiddenCounts??new Map,a=n?.activeTagGroup??null,i=n?.hideDescriptions??!1,s=n?.ctx??Ee.identity(),l={rootWidth:s.structural(EJ),depth1Width:s.structural(SJ),leafWidth:s.structural(vJ),hGap:s.aesthetic(TJ),vGap:s.aesthetic(CJ),margin:s.aesthetic(_J),multiRootGap:s.aesthetic(AJ)};$J(r);let c=[],d=f=>{for(let p of f)c.push(p),d(p.children)};d(r),wa(c,t.tagGroups);let u=t.tagGroups;return r.length===1?WO(r[0],o,i,u,a,l):RJ(r,t,o,i,u,a,l)}function WO(t,e,n,r=[],o=null,a){let i=[],s=W1(0,a),l=B1(t,n,a),c=t.children,{right:d,left:u}=DJ(c,n,a),f=Tg(d,1,n,a),p=Tg(u,1,n,a),m=Math.max(f,p,l),h=0,g=m/2-l/2;i.push({node:t,x:h,y:g,width:s,height:l,depth:0,direction:"right",subtreeHeight:m});let v=g+l/2,y=h+s+a.hGap;G1(d,y,v,1,"right",n,i,a);let b=h-a.hGap;return G1(u,b,v,1,"left",n,i,a),PJ(i,e,n,t,r,o,a)}function RJ(t,e,n,r,o,a,i){let s=[];for(let p of t)s.push(WO(p,n,r,o,a,i));let l=s.reduce((p,m)=>p+m.width,0)+i.multiRootGap*(s.length-1),c=Math.max(...s.map(p=>p.height)),d=[],u=[],f=0;for(let p of s){let m=(c-p.height)/2;for(let h of p.nodes)d.push({...h,x:h.x+f,y:h.y+m});for(let h of p.edges)u.push({sourceId:h.sourceId,targetId:h.targetId,path:OJ(h.path,f,m)});f+=p.width+i.multiRootGap}return{nodes:d,edges:u,width:l,height:c}}function G1(t,e,n,r,o,a,i,s){if(t.length===0)return;let l=Tg(t,r,a,s),c=n-l/2;for(let d of t){let u=W1(r,s),f=B1(d,a,s),p=H1(d,r,a,s),m=c+p/2-f/2,h=o==="right"?e:e-u;if(i.push({node:d,x:h,y:m,width:u,height:f,depth:r,direction:o,subtreeHeight:p}),d.children.length>0){let g=m+f/2,v=o==="right"?h+u+s.hGap:h-s.hGap;G1(d.children,v,g,r+1,o,a,i,s)}c+=p+s.vGap}}function Tg(t,e,n,r){if(t.length===0)return 0;let o=0;for(let a of t)o+=H1(a,e,n,r);return o+=r.vGap*(t.length-1),o}function H1(t,e,n,r){let o=B1(t,n,r);if(t.children.length===0)return o;let a=Tg(t.children,e+1,n,r);return Math.max(o,a)}function IJ(t,e,n){return t.color?t.color:ar(t.metadata,[...e],n)}function PJ(t,e,n,r,o=[],a=null,i){let s=1/0,l=1/0,c=-1/0,d=-1/0;for(let E of t)s=Math.min(s,E.x),l=Math.min(l,E.y),c=Math.max(c,E.x+E.width),d=Math.max(d,E.y+E.height);let u=-s+i.margin,f=-l+i.margin,p=c-s+i.margin*2,m=d-l+i.margin*2,h=new Map;for(let E of t)h.set(E.node.id,E);let g=[],v=[];for(let E of t){let x=IJ(E.node,o,a),L=e.get(E.node.id);g.push({id:E.node.id,label:E.node.label,...E.node.description!==void 0&&{description:[...E.node.description]},metadata:{...E.node.metadata},lineNumber:E.node.lineNumber,...x!==void 0&&{color:x},x:E.x+u,y:E.y+f,width:E.width,height:E.height,depth:E.depth,angle:0,radius:0,...L!==void 0&&{hiddenCount:L},hasChildren:e.has(E.node.id)||E.node.children.length>0})}let y=new Map;for(let E of t)if(E.node.parentId){let x=y.get(E.node.parentId)??[];x.push(E),y.set(E.node.parentId,x)}let b=[];for(let[E,x]of y){let L=x.filter(A=>A.direction==="right"),S=x.filter(A=>A.direction==="left");L.length>0&&b.push([E,L]),S.length>0&&b.push([E,S])}for(let[E,x]of b){let L=h.get(E),S=L.x+u,A=L.y+f,C=x[0].direction==="left",M=C?S:S+L.width,w=A+L.height/2,k=x[0],N=C?k.x+u+k.width:k.x+u,_=(M+N)/2;if(x.length===1){let T=x[0],R=C?T.x+u+T.width:T.x+u,G=T.y+f+T.height/2;v.push({sourceId:E,targetId:T.node.id,path:`M ${M} ${w} L ${_} ${w} L ${_} ${G} L ${R} ${G}`})}else{v.push({sourceId:E,targetId:E,path:`M ${M} ${w} L ${_} ${w}`});let T=x.map(I=>I.y+f+I.height/2),R=Math.min(...T),G=Math.max(...T);v.push({sourceId:E,targetId:E,path:`M ${_} ${R} L ${_} ${G}`});for(let I=0;I<x.length;I++){let H=x[I],O=C?H.x+u+H.width:H.x+u,D=T[I];v.push({sourceId:E,targetId:H.node.id,path:`M ${_} ${D} L ${O} ${D}`})}}}return{nodes:g,edges:v,width:p,height:m}}function DJ(t,e,n){if(t.length<=1)return{right:[...t],left:[]};if(t.length===2)return{right:[t[0]],left:[t[1]]};let r=t.map((l,c)=>({index:c,node:l,height:H1(l,1,e,n)})),o=[],a=[],i=0,s=0;for(let l of r)i<=s?(o.push(l.node),i+=l.height):(a.push(l.node),s+=l.height);return{right:o,left:a}}function OJ(t,e,n){return e===0&&n===0?t:t.replace(/([ML])\s*([\d.e+-]+)\s+([\d.e+-]+)/g,(r,o,a,i)=>`${o} ${parseFloat(a)+e} ${parseFloat(i)+n}`)}function W1(t,e){return t===0?e.rootWidth:t===1?e.depth1Width:e.leafWidth}function B1(t,e,n){let r=GJ(t),o=W1(r,n),a=Mg(t.label,t.description?[...t.description]:void 0,r,o,e),i=a.labelLines.length,l=(i<=1?kJ:LJ*i)+MJ;return a.descLines.length>0&&(l+=NJ*a.descLines.length+4),l}function GJ(t){return $1.get(t.id)??0}function $J(t){$1.clear();let e=(n,r)=>{for(let o of n)$1.set(o.id,r),e(o.children,r+1)};e(t,0)}var EJ,SJ,vJ,kJ,LJ,NJ,MJ,TJ,CJ,_J,AJ,$1,F1=st(()=>{"use strict";Ke();O1();fr();EJ=180,SJ=150,vJ=120,kJ=28,LJ=18,NJ=14,MJ=10,TJ=40,CJ=12,_J=40,AJ=60;$1=new Map});var YO={};ye(YO,{collapseMindmapTree:()=>WJ});function FO(t){return{id:t.id,label:t.label,...t.description!==void 0&&{description:[...t.description]},metadata:{...t.metadata},children:t.children.map(FO),parentId:t.parentId,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color},...t.collapsed!==void 0&&{collapsed:t.collapsed}}}function WJ(t,e){return e.size===0?{roots:[...t],hiddenCounts:new Map}:sd(t,e,HJ)}var HJ,zO=st(()=>{"use strict";yf();HJ={getId:t=>t.id,getChildren:t=>t.children,clone:FO,setChildren:(t,e)=>{t.children=e},countsAsHidden:()=>!0}});var XO={};ye(XO,{renderMindmap:()=>UO,renderMindmapForExport:()=>jJ});function zJ(t,e,n,r){let o=n??t.primary;return ie(t,o,e,{...r!==void 0&&{solid:r}})}function VJ(t,e){return e??t.primary}function XJ(t,e){let n=UJ[t];return n&&n in e.colors?e.colors[n]:e.colors.gray}function UO(t,e,n,r,o,a,i,s,l,c,d){let u=!!i,f=i?.width??(t.getBoundingClientRect().width||800),p=i?.height??(t.getBoundingClientRect().height||600);Rt(t).selectAll("*").remove();let m=Rt(t).append("svg").attr("width",f).attr("height",p).attr("viewBox",`0 0 ${f} ${p}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It),h=d?.controlsHost==="app",g=!!d?.onToggleColorByDepth||!!d?.onToggleDescriptions,v=e.tagGroups.length>0||g&&!h,y=!u&&v,b=y?Tr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview"},f)+Wn:0,E=!!e.title&&e.options["no-title"]!=="on",x=!u&&E,L=x?VO:0,S=f,A=p-vd*2-b-L,C=u?Ee.identity():Ee.fromBox(S,n.width,A,n.height),M=n;if(C.factor<1){let G=new Map;for(let H of n.nodes)H.hiddenCount!=null&&H.hiddenCount>0&&G.set(H.id,H.hiddenCount);let I=H=>Cg(e,r,{interactive:!u,...G.size>0&&{hiddenCounts:G},activeTagGroup:c??null,...l!==void 0&&{hideDescriptions:l},ctx:H});M=I(C);for(let H=0;H<3&&!C.isBelowFloor;H++){let O=Math.min(S/M.width,A/M.height);if(O>=.999)break;C=Ee.fromFactor(C.factor*O),M=I(C)}}let w=u?1:Math.min(1,M.width>0?S/M.width:1,M.height>0?A/M.height:1),k=M.width*w,N=M.height*w,_=Math.max(0,(S-k)/2),T=vd+b+L+Math.max(0,(A-N)/2),R=m.append("g").attr("transform",`translate(${_}, ${T})${w<1?` scale(${w})`:""}`);if(C.isBelowFloor&&m.attr("width","100%"),E){let G=x?m:R,I=x?f/2:M.width/2,H=x?vd+20:20,O=G.append("text").attr("x",I).attr("y",H).attr("text-anchor","middle").attr("font-size",20).attr("font-weight","700").attr("fill",r.text).attr("class","chart-title").text(e.title);e.titleLineNumber&&O.attr("data-line-number",e.titleLineNumber),a&&e.titleLineNumber&&O.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))}if(y){let G=m.append("g").attr("class","mindmap-legend-fixed").attr("transform",`translate(0, ${vd+L})`),I=new Map;for(let P of M.nodes)for(let B of e.tagGroups){let Y=B.name.toLowerCase(),V=P.metadata[Y];V&&(I.has(Y)||I.set(Y,new Set),I.get(Y).add(V.toLowerCase()))}let H=[];d?.onToggleDescriptions&&H.push({id:"descriptions",type:"toggle",label:"Descriptions",active:!l,onToggle:P=>d.onToggleDescriptions(P)}),d?.onToggleColorByDepth&&H.push({id:"depth-colors",type:"toggle",label:"Depth Colors",active:d.colorByDepth??!1,onToggle:d.onToggleColorByDepth});let O=H.length>0?{toggles:H}:void 0,D={groups:e.tagGroups.map(P=>{let B=I.get(P.name.toLowerCase());return{name:P.name,...P.alias!==void 0&&{alias:P.alias},entries:P.entries.filter(Y=>B?.has(Y.value.toLowerCase())).map(Y=>({value:Y.value,color:Y.color}))}}),position:{placement:"top-center",titleRelation:"below-title"},mode:d?.exportMode?"export":"preview",...O!==void 0&&{controlsGroup:O},...d?.controlsHost!==void 0&&{controlsHost:d.controlsHost}},W={text:r.text,textMuted:r.textMuted,bg:r.bg,surface:r.surface,primary:r.primary},z={...d?.onToggleControlsExpand!==void 0&&{onControlsExpand:d.onToggleControlsExpand},onControlsToggle:(P,B)=>{P==="depth-colors"&&d?.onToggleColorByDepth&&d.onToggleColorByDepth(B),P==="descriptions"&&d?.onToggleDescriptions&&d.onToggleDescriptions(B)}};fn(G,{...D,palette:W,isDark:o,width:f,activeGroup:d?.colorByDepth?null:c!==void 0?c:e.options["active-tag"]??null,hiddenAttributes:new Set,...d?.controlsExpanded!==void 0&&{controlsExpanded:d.controlsExpanded},callbacks:z})}for(let G of M.edges)R.append("path").attr("class","mindmap-edge").attr("d",G.path).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-opacity",.5);for(let G of M.nodes){let I=G.radius===0&&M.nodes.indexOf(G)===0,H=I?YJ:1.5,O=d?.colorByDepth?XJ(G.depth,r):G.color,D=zJ(r,o,O,e.options["solid-fill"]==="on"),W=VJ(r,O),z=ve(D,r.textOnFillLight,r.textOnFillDark),P=R.append("g").attr("class","mindmap-node").attr("data-line-number",G.lineNumber);if(c){let F=qt(c),Q=G.metadata[F];Q&&P.attr(`data-tag-${F}`,Q.toLowerCase())}G.hasChildren&&P.attr("data-node-toggle",G.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",G.hiddenCount!=null&&G.hiddenCount>0?"false":"true").attr("aria-label",G.label),P.append("rect").attr("x",G.x).attr("y",G.y).attr("width",G.width).attr("height",G.height).attr("rx",_g).attr("ry",_g).attr("fill",D).attr("stroke",W).attr("stroke-width",H);let B=G.hiddenCount!=null&&G.hiddenCount>0,Y=!l&&!!G.description&&!B,V=Mg(G.label,G.description,G.depth,G.width,l||B),{labelLines:j,labelFontSize:K,descLines:$,descFontSize:U}=V,X=j.length,q=X<=1?BJ:Y1*X,et=Y?q:G.height,tt=G.x+G.width/2;if(X<=1){let F=G.y+et/2+K*.35;P.append("text").attr("x",tt).attr("y",F).attr("text-anchor","middle").attr("font-size",K).attr("font-weight",I?"bold":"normal").attr("fill",z).text(j[0])}else{let F=Y1*(X-1),Q=G.y+et/2-F/2+K*.35,ot=P.append("text").attr("x",tt).attr("text-anchor","middle").attr("font-size",K).attr("font-weight",I?"bold":"normal").attr("fill",z);for(let Z=0;Z<j.length;Z++)ot.append("tspan").attr("x",tt).attr("y",Q+Z*Y1).text(j[Z])}if((j.length>1||j[0]!==G.label)&&P.append("title").text(G.label),Y&&$.length>0){let F=G.y+q;if(P.append("line").attr("x1",G.x).attr("y1",F).attr("x2",G.x+G.width).attr("y2",F).attr("stroke",W).attr("stroke-opacity",.3).attr("stroke-width",1),$.length<=1){let Q=F+4+U,ot=ta($[0]),Z=P.append("text").attr("x",tt).attr("y",Q).attr("text-anchor","middle").attr("font-size",U).attr("fill",z);gn(Z,ot,r,U)}else{let Q=F+4+U;for(let ot=0;ot<$.length;ot++){let Z=ta($[ot]),lt=P.append("text").attr("x",tt).attr("y",Q+ot*FJ).attr("text-anchor","middle").attr("font-size",U).attr("fill",z);gn(lt,Z,r,U)}}}if(!u&&G.hiddenCount!=null&&G.hiddenCount>0){let F=`collapse-clip-${G.id}`;R.append("defs").append("clipPath").attr("id",F).append("rect").attr("x",G.x).attr("y",G.y).attr("width",G.width).attr("height",G.height).attr("rx",_g).attr("ry",_g),P.append("rect").attr("class","collapse-bar").attr("x",G.x).attr("y",G.y+G.height-6).attr("width",G.width).attr("height",6).attr("fill",W).attr("clip-path",`url(#${F})`)}a&&P.style("cursor","pointer").on("click",F=>{G.hasChildren&&s?(F.stopPropagation(),s(G.id)):a(G.lineNumber)}),u||P.on("mouseenter",function(){Rt(this).attr("opacity",.7)}).on("mouseleave",function(){Rt(this).attr("opacity",1)})}}function jJ(t,e,n){let r=ed(t,n);if(r.error)return"";let o=e==="dark",a=r.options["no-descriptions"]==="true",i=Cg(r,n,{interactive:!1,hideDescriptions:a}),s=r.title&&r.options["no-title"]!=="on"?VO:0,l=i.width+vd*2,c=i.height+vd*2+s;return ld(l,c,d=>(UO(d,r,i,n,o,void 0,{width:l,height:c},void 0,a),cd(d,e)))}var vd,VO,BJ,Y1,FJ,_g,YJ,UJ,jO=st(()=>{"use strict";Ke();Xn();on();Qh();tn();Sh();F1();O1();_o();Ka();Br();Mr();To();fr();vd=20,VO=30,BJ=28,Y1=18,FJ=14,_g=6,YJ=2.5;UJ=["red","orange","yellow","green","blue","purple","teal","cyan"]});var JO={};ye(JO,{layoutWireframe:()=>itt});function itt(t,e,n,r=!0){z1=r?QO:JJ;let o=t.formFactor==="mobile"?KJ:qJ,a=n??o,i=t.title&&t.options["no-title"]!=="on"?ntt:0,s=a-KO*2,l=stt(t.roots,s,t.formFactor),c=0;for(let p of l)c=Math.max(c,p.y+p.height);let d=[],u=c+24;for(let p of t.modals){let m=Math.min(s*.7,600),h=(s-m)/2,g=kd(p,h,u,m);d.push(g),u+=g.height+24}let f=(d.length>0?d[d.length-1].y+d[d.length-1].height:c)+KO*2+i;return{width:a,height:f,titleHeight:i,nodes:l,modalNodes:d}}function stt(t,e,n){let r=[],o=0,a=[],i=[];for(let s of t){let l=s.label.toLowerCase().split(/\s+/)[0];ZO.has(l)||n==="mobile"?(i.length>0&&(a.push(i),i=[]),a.push([s])):i.push(s)}i.length>0&&a.push(i);for(let s of a){if(s.length===1&&n!=="mobile"){let l=s[0],c=l.label.toLowerCase().split(/\s+/)[0];if(ZO.has(c)){let d=kd(l,0,o,e);c==="header"||c==="top"?d.height=Math.max(d.height,ott):d.height=Math.max(d.height,att),r.push(d),o+=d.height+16;continue}}if(n==="mobile"||s.length===1)for(let l of s){let c=kd(l,0,o,e);r.push(c),o+=c.height+16}else{let l=ltt(s,e),c=0,d=0,u=[];for(let f=0;f<s.length;f++){let p=l[f],m=kd(s[f],c,o,p);u.push(m),d=Math.max(d,m.height),c+=p+12}for(let f of u)f.height=d;r.push(...u),o+=d+16}}return r}function ltt(t,e){let r=(t.length-1)*12,o=e-r,a=new Array(t.length).fill(0),i=0,s=0;for(let l=0;l<t.length;l++){let c=t[l].label.toLowerCase().split(/\s+/)[0],d=rtt[c];d!==void 0&&d>0?(a[l]=o*d,i+=a[l]):s++}if(s>0){let c=Math.max(0,o-i)/s;for(let d=0;d<a.length;d++)a[d]===0&&(a[d]=Math.max(40,c))}for(let l=0;l<a.length;l++)a[l]=Math.max(40,a[l]);return a}function kd(t,e,n,r){let o={id:t.id,x:e,y:n,width:r,height:0,element:t,children:[]},a=t.type==="nav"||t.type==="tabs";if(!t.isContainer||t.children.length===0||a)return o.height=dtt(t),o;let i=t.metadata._inlineRow==="true"||t.metadata._labelField==="true",s=i?0:z1,l=i?0:ttt,c=i?0:ett,d=r-c*2,u=c;if(t.orientation==="horizontal"){let f=ctt(t.children,d),p=u,m=0,h=[];for(let g=0;g<t.children.length;g++){let v=t.children[g],y=f[g],b=kd(v,p,s,y);h.push(b),o.children.push(b),m=Math.max(m,b.height),p+=y+8}for(let g of h)g.height=m;o.height=s+m+l}else{let f=s,p=ftt(t.children);p>0&&(o.fieldAlignX=p);for(let m of t.children){let h=kd(m,u,f,d);o.children.push(h),f+=h.height+utt(m)}o.height=f+l}return t.states.includes("collapsed")&&(o.height=z1,o.children=[]),o}function ctt(t,e){let r=(t.length-1)*8,o=Math.max(40,(e-r)/t.length);return t.map(()=>o)}function dtt(t){return t.type==="heading"?t.headingLevel===2?Ag.subheading??36:Ag.heading??48:t.type==="textInput"&&t.fieldVariant==="textarea"?80:t.type==="table"?32+(t.tableData?.length||t.tableRows||0)*28+8:t.type==="image"?t.imageHint==="round"||t.imageHint==="wide"?80:Ag.image??120:t.metadata._labelField==="true"?36:Ag[t.type]??24}function utt(t){return t.type==="heading"&&t.headingLevel===2?qO.subheading??12:qO[t.type]??8}function ftt(t){let e=0,n=0;for(let r of t)if(r.metadata._labelField==="true"&&r.children.length>=2){let o=r.children[0],a=_t(o.label,QJ);e=Math.max(e,a),n++}return n<2?0:e+ZJ}var qJ,KJ,ZJ,QJ,Ag,qO,QO,JJ,ttt,z1,ett,KO,ntt,rtt,ZO,ott,att,tG=st(()=>{"use strict";en();qJ=1200,KJ=375,ZJ=16,QJ=13,Ag={textInput:36,button:40,dropdown:36,checkbox:24,radio:24,heading:48,subheading:36,divider:24,text:22,listItem:24,image:120,progress:28,chart:160,alert:40,nav:44,tabs:44},qO={heading:16,subheading:12,divider:12,textInput:8,dropdown:8,checkbox:8,radio:8,button:8,text:12,listItem:4,group:16,image:12,progress:12,chart:16,alert:12,nav:12,tabs:12,table:16},QO=32,JJ=10,ttt=12,z1=QO,ett=12,KO=20,ntt=40,rtt={sidebar:.25,side:.25,left:.25,right:.25,main:0,content:0,center:0},ZO=new Set(["header","top","footer","bottom"]),ott=60,att=40});var iG={};ye(iG,{renderWireframe:()=>htt});function mtt(t,e){let n=ptt[t];return n?n(e):null}function oG(t,e){for(let n of t.states){let r=mtt(n,e);if(r)return r}return null}function htt(t,e,n,r,o,a,i,s,l){let c=l??{},d=c.exportDims??i,u=c.theme??s;Rt(t).selectAll(":not([data-d3-tooltip])").remove();let f=!!d,p=d?.width??t.clientWidth,m=d?.height??t.clientHeight,h=f?Ee.identity():Ee.from(p,n.width),g=Rt(t).append("svg").attr("viewBox",`0 0 ${n.width} ${n.height}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",It);f?g.attr("width",p).attr("height",m):g.attr("width","100%").attr("height","auto").style("display","block");let v={palette:r,isTransparent:u==="transparent",isDark:o,showGroupLabels:c.showGroupLabels??!0,solid:e.options["solid-fill"]==="on"};v.isTransparent||g.append("rect").attr("width",n.width).attr("height",n.height).attr("fill",r.bg).attr("rx",8);let y=g.append("g").attr("transform","translate(20, 20)"),b=0,E=!!e.title&&e.options["no-title"]!=="on",x=h.text(20);f&&E&&(y.append("text").attr("x",0).attr("y",x).attr("fill",r.text).attr("font-size",x).attr("font-weight","700").text(e.title),b=n.titleHeight);let L=y.append("g").attr("transform",`translate(0, ${b})`);for(let S of n.nodes)Mf(L,S,v,0);if(n.modalNodes.length>0){let S=L.append("g").attr("class","wireframe-modals");for(let A of n.modalNodes)Ptt(S,A,v)}}function Mf(t,e,n,r){let o=e.element,a=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`).attr("data-line-number",o.lineNumber);if(o.states.includes("disabled")&&a.attr("opacity",.5),o.isSkeleton&&o.type!=="skeleton"){aG(a,e,n);return}switch(o.type){case"group":gtt(a,e,n,r);break;case"textInput":ytt(a,e,n);break;case"button":btt(a,e,n);break;case"dropdown":xtt(a,e,n);break;case"checkbox":wtt(a,e,n);break;case"radio":Ett(a,e,n);break;case"heading":Stt(a,e,n);break;case"divider":vtt(a,e,n);break;case"text":nG(a,e,n);break;case"listItem":ktt(a,e,n);break;case"nav":Ltt(a,e,n);break;case"tabs":Ntt(a,e,n);break;case"table":Mtt(a,e,n);break;case"image":Ctt(a,e,n);break;case"skeleton":_tt(a,e,n);break;case"alert":Att(a,e,n);break;case"progress":Rtt(a,e,n);break;case"chart":Itt(a,e,n);break;default:nG(a,e,n)}}function gtt(t,e,n,r){let{palette:o,isTransparent:a}=n,i=e.element;if(i.metadata._inlineRow==="true"||i.metadata._labelField==="true"){for(let d of e.children)Mf(t,d,n,r);return}let s=[12,7,4,2],l=s[Math.min(r,s.length-1)],c=Gt(o.textMuted,o.bg,l);if(a?t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",o.border).attr("stroke-width",1).attr("rx",Nf):t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",c).attr("stroke",o.border).attr("stroke-width",1).attr("rx",Nf),i.label&&n.showGroupLabels&&t.append("text").attr("x",10).attr("y",18).attr("fill",o.textMuted).attr("font-size",11).attr("font-weight","600").attr("letter-spacing","0.5px").text(i.label.toUpperCase()),i.states.includes("collapsed")){t.append("text").attr("x",e.width-20).attr("y",18).attr("fill",o.textMuted).attr("font-size",12).attr("opacity",.6).text("\u25B6");return}i.states.includes("scrollable")&&t.append("rect").attr("x",e.width-6).attr("y",28).attr("width",3).attr("height",Math.min(e.height-36,40)).attr("fill",o.border).attr("rx",1.5);for(let d of e.children)Mf(t,d,n,r+1)}function ytt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=e.height;if(t.append("rect").attr("width",e.width).attr("height",i).attr("fill",o?"none":r.bg).attr("stroke",r.border).attr("rx",rG),a.fieldVariant==="password"?t.append("text").attr("x",10).attr("y",i/2+4).attr("fill",r.text).attr("font-size",16).text("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022"):t.append("text").attr("x",10).attr("y",i/2+4).attr("fill",r.textMuted).attr("font-size",13).text(a.label||"Text input"),a.fieldVariant!=="password"){let s=Math.min(_t(a.label||"Text input",13)+14,e.width-20);t.append("line").attr("x1",s).attr("y1",8).attr("x2",s).attr("y2",i-8).attr("stroke",r.primary).attr("stroke-width",1.5).attr("opacity",.6)}if(a.fieldVariant==="textarea")for(let s=0;s<3;s++)t.append("line").attr("x1",e.width-12+s*3).attr("y1",i-4).attr("x2",e.width-4).attr("y2",i-12+s*3).attr("stroke",r.border).attr("stroke-width",1)}function btt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=a.states.includes("ghost"),s=oG(a,r),c=a.states.includes("primary")?r.primary:r.secondary,d=r.bg;s&&(c=s),i||o?(t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",c).attr("stroke-width",1.5).attr("rx",eG),d=c):t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",c).attr("rx",eG),t.append("text").attr("x",e.width/2).attr("y",e.height/2+4).attr("fill",d).attr("font-size",13).attr("font-weight","600").attr("text-anchor","middle").text(a.label)}function xtt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":r.bg).attr("stroke",r.border).attr("rx",rG),t.append("text").attr("x",10).attr("y",e.height/2+4).attr("fill",r.text).attr("font-size",13).text(a.label||(a.options?.[0]??"Select..."));let i=e.width-16,s=e.height/2;t.append("path").attr("d",`M${i-4},${s-2} L${i},${s+2} L${i+4},${s-2}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5)}function wtt(t,e,n){let{palette:r}=n,o=e.element;if(o.states.includes("toggle")){let l=e.height/2;t.append("rect").attr("x",0).attr("y",l-18/2).attr("width",32).attr("height",18).attr("rx",18/2).attr("fill",o.checked?r.primary:r.border),t.append("circle").attr("cx",o.checked?32-18/2:18/2).attr("cy",l).attr("r",18/2-2).attr("fill",r.bg),o.label&&t.append("text").attr("x",40).attr("y",l+4).attr("fill",r.text).attr("font-size",13).text(o.label)}else{let s=e.height/2;t.append("rect").attr("x",0).attr("y",s-16/2).attr("width",16).attr("height",16).attr("fill",o.checked?r.primary:"none").attr("stroke",o.checked?r.primary:r.border).attr("rx",3),o.checked&&t.append("path").attr("d",`M3,${s} L6,${s+3} L13,${s-4}`).attr("fill","none").attr("stroke",r.bg).attr("stroke-width",2),o.label&&t.append("text").attr("x",24).attr("y",s+4).attr("fill",r.text).attr("font-size",13).text(o.label)}}function Ett(t,e,n){let{palette:r}=n,o=e.element,a=8,i=e.height/2;t.append("circle").attr("cx",a).attr("cy",i).attr("r",a).attr("fill","none").attr("stroke",o.selected?r.primary:r.border).attr("stroke-width",1.5),o.selected&&t.append("circle").attr("cx",a).attr("cy",i).attr("r",4).attr("fill",r.primary),t.append("text").attr("x",a*2+8).attr("y",i+4).attr("fill",r.text).attr("font-size",13).text(o.label)}function Stt(t,e,n){let{palette:r}=n,o=e.element,a=o.headingLevel===1;t.append("text").attr("x",0).attr("y",a?28:22).attr("fill",r.text).attr("font-size",a?22:16).attr("font-weight","bold").text(o.label)}function vtt(t,e,n){let{palette:r}=n;t.append("line").attr("x1",0).attr("y1",e.height/2).attr("x2",e.width).attr("y2",e.height/2).attr("stroke",r.border).attr("stroke-width",1)}function nG(t,e,n){let{palette:r}=n,o=e.element;if(o.metadata._labelField==="true"&&o.children.length>=2){for(let i of e.children)Mf(t,i,n,0);return}let a=o.labelFor?r.textMuted:r.text;t.append("text").attr("x",0).attr("y",15).attr("fill",a).attr("font-size",13).text(o.label)}function ktt(t,e,n){let{palette:r}=n,o=e.element;t.append("circle").attr("cx",4).attr("cy",e.height/2).attr("r",2.5).attr("fill",r.textMuted),t.append("text").attr("x",14).attr("y",e.height/2+4).attr("fill",r.text).attr("font-size",13).text(o.label)}function Ltt(t,e,n){let{palette:r}=n,o=e.element;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",Gt(r.textMuted,r.bg,8)).attr("rx",4);let a=12;for(let i of o.children){let s=i.states.includes("active");t.append("text").attr("x",a).attr("y",e.height/2+4).attr("fill",s?r.primary:r.text).attr("font-size",13).attr("font-weight",s?"600":"normal").text(i.label);let l=_t(i.label,13);s&&t.append("line").attr("x1",a).attr("y1",e.height-4).attr("x2",a+l).attr("y2",e.height-4).attr("stroke",r.primary).attr("stroke-width",2),a+=l+24}}function Ntt(t,e,n){let{palette:r}=n,o=e.element;t.append("line").attr("x1",0).attr("y1",e.height-1).attr("x2",e.width).attr("y2",e.height-1).attr("stroke",r.border).attr("stroke-width",1);let a=0;for(let i of o.children){let s=i.states.includes("active"),l=_t(i.label,13)+24;s&&t.append("line").attr("x1",a).attr("y1",e.height-1).attr("x2",a+l).attr("y2",e.height-1).attr("stroke",r.primary).attr("stroke-width",2),t.append("text").attr("x",a+12).attr("y",e.height/2+4).attr("fill",s?r.primary:r.textMuted).attr("font-size",13).attr("font-weight",s?"600":"normal").text(i.label),a+=l}}function Mtt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=a.tableHeaders||[],s=a.tableData||[],l=a.tableRows!==void 0&&a.tableCols!==void 0,c=i.length||a.tableCols||3,d=e.width/c,u=32,f=28;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",r.border).attr("rx",4),t.append("rect").attr("width",e.width).attr("height",u).attr("fill",o?"none":Gt(r.textMuted,r.bg,8)).attr("rx",4);for(let m=0;m<c;m++){let h=i[m]||`Col ${m+1}`;t.append("text").attr("x",m*d+10).attr("y",u/2+4).attr("fill",r.text).attr("font-size",12).attr("font-weight","600").text(h)}t.append("line").attr("x1",0).attr("y1",u).attr("x2",e.width).attr("y2",u).attr("stroke",r.border);let p=l?a.tableRows||3:s.length;for(let m=0;m<p;m++){let h=u+m*f;m>0&&t.append("line").attr("x1",0).attr("y1",h).attr("x2",e.width).attr("y2",h).attr("stroke",r.border).attr("opacity",.3);for(let g=0;g<c;g++)if(l)t.append("rect").attr("x",g*d+10).attr("y",h+8).attr("width",d*.6).attr("height",12).attr("fill",r.textMuted).attr("opacity",.25).attr("rx",2);else if(s[m]){let v=s[m][g]||"";Ttt(t,v,g*d+10,h,d-20,f,n)}}}function Ttt(t,e,n,r,o,a,i){let{palette:s}=i,l=e.trim(),c=l.match(/^\(([^)]+)\)(?:\s*\|\s*(.+))?$/);if(c){let d=c[1],u=c[2]?.trim().toLowerCase(),f=u==="ghost",m=u==="destructive"?s.destructive:s.primary,h=Math.min(_t(d,10)+16,o),g=20,v=r+(a-g)/2;f?(t.append("rect").attr("x",n).attr("y",v).attr("width",h).attr("height",g).attr("fill","none").attr("stroke",m).attr("stroke-width",1).attr("rx",3),t.append("text").attr("x",n+h/2).attr("y",v+g/2+3).attr("fill",m).attr("font-size",10).attr("font-weight","600").attr("text-anchor","middle").text(d)):(t.append("rect").attr("x",n).attr("y",v).attr("width",h).attr("height",g).attr("fill",m).attr("rx",3),t.append("text").attr("x",n+h/2).attr("y",v+g/2+3).attr("fill",s.bg).attr("font-size",10).attr("font-weight","600").attr("text-anchor","middle").text(d));return}if(/^<\s*x?\s*>$/.test(l)){let d=/x/i.test(l),u=12,f=n,p=r+(a-u)/2;t.append("rect").attr("x",f).attr("y",p).attr("width",u).attr("height",u).attr("fill",d?s.primary:"none").attr("stroke",d?s.primary:s.border).attr("rx",2),d&&t.append("path").attr("d",`M${f+2},${p+u/2} L${f+4},${p+u/2+2} L${f+10},${p+2}`).attr("fill","none").attr("stroke",s.bg).attr("stroke-width",1.5);return}t.append("text").attr("x",n).attr("y",r+a/2+4).attr("fill",s.text).attr("font-size",12).text(l)}function Ctt(t,e,n){let{palette:r,isTransparent:o}=n;if(e.element.imageHint==="round"){let s=Math.min(e.width,e.height)/2,l=e.width/2,c=e.height/2;t.append("circle").attr("cx",l).attr("cy",c).attr("r",s).attr("fill",o?"none":Gt(r.border,r.bg,30)).attr("stroke",r.border),t.append("line").attr("x1",l-s*.7).attr("y1",c-s*.7).attr("x2",l+s*.7).attr("y2",c+s*.7).attr("stroke",r.border),t.append("line").attr("x1",l+s*.7).attr("y1",c-s*.7).attr("x2",l-s*.7).attr("y2",c+s*.7).attr("stroke",r.border)}else t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":Gt(r.border,r.bg,30)).attr("stroke",r.border).attr("rx",4),t.append("line").attr("x1",0).attr("y1",0).attr("x2",e.width).attr("y2",e.height).attr("stroke",r.border),t.append("line").attr("x1",e.width).attr("y1",0).attr("x2",0).attr("y2",e.height).attr("stroke",r.border)}function _tt(t,e,n){for(let r of e.children)aG(t,r,n)}function aG(t,e,n){let{palette:r,isTransparent:o}=n,a=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`);o?a.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",r.border).attr("opacity",.1).attr("rx",4):a.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",r.border).attr("opacity",.2).attr("rx",4)}function Att(t,e,n){let{palette:r,isDark:o,isTransparent:a}=n,i=e.element,s=oG(i,r)||r.accent,l=a?null:ie(r,s,o,{solid:n.solid});l&&t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",l).attr("rx",4),t.append("rect").attr("width",3).attr("height",e.height).attr("fill",s).attr("rx",1.5),a&&t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",s).attr("rx",4);let c=l?ve(l,r.textOnFillLight,r.textOnFillDark):r.text;t.append("text").attr("x",12).attr("y",e.height/2+4).attr("fill",c).attr("font-size",13).text(i.label)}function Rtt(t,e,n){let{palette:r,isTransparent:o}=n,i=e.element.progressValue??0,s=8,l=e.height/2;t.append("rect").attr("width",e.width-40).attr("height",s).attr("y",l-s/2).attr("fill",o?"none":Gt(r.border,r.bg,30)).attr("stroke",o?r.border:"none").attr("rx",s/2);let c=(e.width-40)*i/100;c>0&&t.append("rect").attr("width",c).attr("height",s).attr("y",l-s/2).attr("fill",r.primary).attr("rx",s/2),t.append("text").attr("x",e.width-32).attr("y",l+4).attr("fill",r.textMuted).attr("font-size",11).text(`${i}%`)}function Itt(t,e,n){let{palette:r,isTransparent:o}=n,i=e.element.chartHint||"line";t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":Gt(r.textMuted,r.bg,8)).attr("stroke",r.border).attr("rx",4);let s=20,l=20,c=e.width-s*2,d=e.height-l*2;if(i==="line"){let f=[[0,d*.7],[c*.2,d*.4],[c*.4,d*.6],[c*.6,d*.2],[c*.8,d*.3],[c,d*.1]].map(([p,m],h)=>h===0?`M${s+p},${l+m}`:`L${s+p},${l+m}`).join(" ");t.append("path").attr("d",f).attr("fill","none").attr("stroke",r.primary).attr("stroke-width",2)}else if(i==="bar"){let f=c/10,p=[.6,.8,.5,.9,.7];for(let m=0;m<5;m++){let h=d*p[m];t.append("rect").attr("x",s+m*(c/5)+f/2).attr("y",l+d-h).attr("width",f).attr("height",h).attr("fill",r.primary).attr("opacity",.7).attr("rx",2)}}else if(i==="pie"){let u=e.width/2,f=e.height/2,p=Math.min(c,d)/2,m=[.35,.25,.2,.2],h=[r.primary,r.secondary,r.accent,r.border],g=0;for(let v=0;v<m.length;v++){let y=g+m[v]*Math.PI*2,b=u+p*Math.cos(g),E=f+p*Math.sin(g),x=u+p*Math.cos(y),L=f+p*Math.sin(y),S=m[v]>.5?1:0;t.append("path").attr("d",`M${u},${f} L${b},${E} A${p},${p} 0 ${S},1 ${x},${L} Z`).attr("fill",h[v]).attr("opacity",.7),g=y}}}function Ptt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`).attr("data-line-number",a.lineNumber);o||i.append("rect").attr("x",4).attr("y",4).attr("width",e.width).attr("height",e.height).attr("fill","rgba(0,0,0,0.1)").attr("rx",Nf),i.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":r.surface).attr("stroke",r.border).attr("rx",Nf),i.append("rect").attr("width",e.width).attr("height",36).attr("fill",o?"none":Gt(r.textMuted,r.bg,15)).attr("rx",Nf),i.append("text").attr("x",12).attr("y",24).attr("fill",r.text).attr("font-size",14).attr("font-weight","600").text(a.label||"Modal");let s=e.width-16;i.append("text").attr("x",s).attr("y",24).attr("fill",r.textMuted).attr("font-size",16).text("\xD7");for(let l of e.children){let c=i.append("g").attr("transform","translate(0, 36)");Mf(c,l,n,1)}}var rG,eG,Nf,ptt,sG=st(()=>{"use strict";Xn();on();tn();en();fr();rG=4,eG=6,Nf=8,ptt={destructive:t=>t.destructive,success:t=>t.colors.green,warning:t=>t.colors.yellow,info:t=>t.colors.blue}});var hG={};ye(hG,{collectCardMetadata:()=>Og,computeC4NodeDimensions:()=>Xl,layoutC4Components:()=>q1,layoutC4Containers:()=>j1,layoutC4Context:()=>X1,layoutC4Deployment:()=>K1,rollUpContextRelationships:()=>pG});function Pg(t,e,n,r){let o=0;for(let a of t){let i=e.get(a.source),s=e.get(a.target);if(i==null||s==null)continue;let l=Math.abs(i-s),c=Math.min(n.get(a.source)??1,n.get(a.target)??1);o+=l*c}if(r)for(let a of t){let i=r.get(a.source),s=r.get(a.target);if(!i||!s)continue;let l=e.get(a.source)??0,c=e.get(a.target)??0,d=i.y,u=s.y;if(d===u)continue;let f=Math.min(l,c),p=Math.max(l,c),m=Math.min(d,u),h=Math.max(d,u);for(let[g,v]of r){if(g===a.source||g===a.target)continue;let y=e.get(g)??0,b=v.y,E=v.width/2,x=v.height/2;y+E>f&&y-E<p&&b+x>m&&b-x<h&&(o+=Btt)}}return o}function Dg(t,e,n){if(e.length<2)return;let r=new Map;for(let s of e)r.set(s.source,(r.get(s.source)??0)+1),r.set(s.target,(r.get(s.target)??0)+1);let o=new Map;for(let s of t.nodes()){let l=cs(t,s);l&&o.set(s,{y:l.y,width:l.width,height:l.height})}let a=new Map;for(let s of t.nodes()){let l=cs(t,s);if(!l)continue;let c=Math.round(l.y);a.has(c)||a.set(c,[]),a.get(c).push(s)}for(let[,s]of a)s.sort((l,c)=>cs(t,l).x-cs(t,c).x);let i=!1;for(let[,s]of a){if(s.length<2)continue;let l=[];if(n&&n.size>0){let c=new Map,d=[];for(let u of s){let f=n.get(u);f?(c.has(f)||c.set(f,[]),c.get(f).push(u)):d.push(u)}for(let u of c.values())u.length>=2&&l.push(u);d.length>=2&&l.push(d)}else l.push(s);for(let c of l){if(c.length<2)continue;let d=c.map(h=>cs(t,h).x).sort((h,g)=>h-g),u=new Map;for(let h of t.nodes()){let g=cs(t,h);g&&u.set(h,g.x)}let f=Pg(e,u,r,o),p=[...c],m=f;if(c.length<=8){let h=Ftt(c);for(let g of h){let v=new Map(u);for(let b=0;b<g.length;b++)v.set(g[b],d[b]);let y=Pg(e,v,r,o);y<m&&(m=y,p=[...g])}}else{let h=[...c],g=!0,v=0;for(;g&&v<10;){g=!1,v++;for(let y=0;y<h.length-1;y++){let b=new Map(u);for(let S=0;S<h.length;S++)b.set(h[S],d[S]);let E=Pg(e,b,r,o);[h[y],h[y+1]]=[h[y+1],h[y]];let x=new Map(u);for(let S=0;S<h.length;S++)x.set(h[S],d[S]);let L=Pg(e,x,r,o);L<E?(g=!0,L<m&&(m=L,p=[...h])):[h[y],h[y+1]]=[h[y+1],h[y]]}}}if(p.some((h,g)=>h!==c[g])){for(let h=0;h<p.length;h++){cs(t,p[h]).x=d[h];let g=s.indexOf(c[h]);g>=0&&(s[g]=p[h])}i=!0}}}if(i)for(let s of e){let l=Dtt(t,s.source,s.target);if(!l)continue;let c=cs(t,s.source),d=cs(t,s.target);if(!c||!d)continue;let u={x:c.x,y:c.y+c.height/2},f={x:d.x,y:d.y-d.height/2},p=(u.y+f.y)/2;l.points=[u,{x:u.x,y:p},{x:f.x,y:p},f]}}function Ftt(t){let e=[],n=[...t],r=n.length,o=new Array(r).fill(0);e.push([...n]);let a=0;for(;a<r;)o[a]<a?(a%2===0?[n[0],n[a]]=[n[a],n[0]]:[n[o[a]],n[a]]=[n[a],n[o[a]]],e.push([...n]),o[a]++,a=0):(o[a]=0,a++);return e}function V1(t){let e=new Map;function n(r,o){e.set(r.name,o);for(let a of r.children)n(a,o);for(let a of r.groups)for(let i of a.children)n(i,o)}for(let r of t)n(r,r.name);return e}function U1(t,e){let n=[];function r(o){for(let a of o.relationships)n.push({sourceName:o.name,rel:a});for(let a of o.children)r(a);for(let a of o.groups)for(let i of a.children)r(i)}for(let o of t)r(o);return n}function pG(t){let e=V1(t.elements),n=U1(t.elements,e),r=new Set(t.elements.map(c=>c.name)),o=new Set,a=[],i=[];for(let{sourceName:c,rel:d}of n){let u=e.get(c)??c,f=e.get(d.target)??d.target;if(u===f)continue;let p={sourceName:u,targetName:f,...d.label!==void 0&&{label:d.label},...d.technology!==void 0&&{technology:d.technology},arrowType:d.arrowType,lineNumber:d.lineNumber};if(r.has(c)&&c===u){let m=`${u}\u2192${f}`;o.add(m),a.push(p)}else i.push(p)}let s=[...a],l=new Set(o);for(let c of i){let d=`${c.sourceName}\u2192${c.targetName}`;l.has(d)||(l.add(d),s.push(c))}return s}function Ld(t,e,n,r){let o=t.metadata.color;if(o)return o;if(!n)return;let a=e.find(c=>c.name.toLowerCase()===n.toLowerCase());if(!a)return;let i=qt(a.name),s=t.metadata[i];if(!s&&r){for(let c of r)if(s=c.metadata[i],s)break}let l=s??a.defaultValue;return l?a.entries.find(c=>c.value.toLowerCase()===l.toLowerCase())?.color??"#999999":"#999999"}function Og(t){let e=[],n=t.tech??t.technology;n&&e.push({key:"Technology",value:n});for(let[r,o]of Object.entries(t)){if(Ytt.has(r.toLowerCase()))continue;let a=r.charAt(0).toUpperCase()+r.slice(1);e.push({key:a,value:o})}return e}function Xl(t,e){let n=_t(t.name,$tt)+Ig*2,r=Math.max(Ott,Math.min(lG,n));if(e?.showTechnology){let i=Rg+dG,s=t.description?.join(`
211
+ `)){let n=e.trim();if(!(!n||n.startsWith("//")))return n.split(/\s+/)[0].toLowerCase()}return""}async function iE(t,e,n,r){let o=await Yn(e,n),a=e==="dark",i=r?.width&&r.width>0?Math.round(r.width):ur,s=r?.height&&r.height>0?Math.round(r.height):yr,l=rr(i,s),c=Va(l,o,{width:i,height:s});if(!c)return document.body.removeChild(l),"";let{svg:d,width:u,height:f,textColor:p,mutedColor:m,bgColor:h,colors:g}=c;return _9(d,t,o,a,u,f,p,m,h,g)?zn(l,e,o):(document.body.removeChild(l),"")}function _9(t,e,n,r,o,a,i,s,l,c){let d=C9(e),f=aE.has(d)?null:Ys(e,n);if(f&&!f.error&&f.data.length>0&&RR.has(f.type)){let g=!f.noTitle&&!!f.title;switch(g&&co(t,f.title,f.titleLineNumber,o,i),f.type){case"bar":return oR(t,f,o,a,c,n,r,i,s,g),!0;case"line":return sR(t,f,o,a,c,n,r,i,s,l,g),!0;case"pie":return cR(t,f,o,a,n,r,i,g?52:24),!0;case"radar":{let v=lh(f,c),y=pf(t,v,n,r,g,o);return fR(t,f,o,a,c,n,r,i,s,y),!0}case"polar-area":return mR(t,f,o,a,n,r,i,g?52:24),!0}}let p=zs(e,n);if(p.error||!aE.has(p.type))return!1;let m=ir(n),h=!p.noTitle&&!!p.title;switch(h&&co(t,p.title,p.titleLineNumber,o,i),p.type){case"funnel":return gR(t,p,o,a,m,n,r,i,h?52:24),!0;case"heatmap":return bR(t,p,o,a,n,r,i,l,h?52:24),!0;case"scatter":{let g=fw(p,m),v=pf(t,g,n,r,h,o);return ER(t,p,o,a,m,n,r,i,s,v),!0}case"sankey":return vR(t,p,o,a,m,l,i,h?52:24),!0;case"chord":return LR(t,p,o,a,m,n,r,i,h?52:24),!0;case"function":{let g=fw(p,m),v=pf(t,g,n,r,h,o);return _R(t,p,o,a,m,i,s,v),!0}default:return!1}}var RR,aE,IR,sE=st(()=>{"use strict";ih();af();af();tn();Ki();na();aR();lR();dR();pR();hR();yR();xR();SR();kR();NR();AR();RR=new Set(["bar","line","pie","radar","polar-area"]),aE=new Set(["funnel","heatmap","scatter","sankey","chord","function"]),IR=new Set([...RR,...aE])});function rd(t,e){let n=t.append("rect").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height).attr("rx",e.rx).attr("fill",e.fill).attr("stroke",e.stroke).attr("stroke-width",e.strokeWidth);e.dashed&&n.attr("stroke-dasharray","6 3"),t.append("text").attr("x",e.width/2).attr("y",e.headerHeight/2+e.labelFontSize/2-2).attr("text-anchor","middle").attr("fill",e.labelColor).attr("font-size",e.labelFontSize).attr("font-weight","bold").text(e.label);let r=e.meta;if(!r||r.rows.length===0)return;t.append("line").attr("x1",0).attr("y1",e.headerHeight).attr("x2",e.width).attr("y2",e.headerHeight).attr("stroke",r.separatorColor).attr("stroke-opacity",.3).attr("stroke-width",1);let o=r.keyX??10,a=Math.max(...r.rows.map(([l])=>_t(`${l}: `,r.fontSize))),i=o+a,s=e.headerHeight+r.separatorGap+r.fontSize;for(let l=0;l<r.rows.length;l++){let[c,d]=r.rows[l],u=s+l*r.lineHeight;t.append("text").attr("x",o).attr("y",u).attr("fill",r.textColor).attr("font-size",r.fontSize).text(`${c}: `),t.append("text").attr("x",i).attr("y",u).attr("fill",r.textColor).attr("font-size",r.fontSize).text(d)}}function lE(t,e){t.append("clipPath").attr("id",e.clipId).append("rect").attr("width",e.width).attr("height",e.height).attr("rx",e.rx),t.append("rect").attr("x",e.inset).attr("y",e.height-e.barHeight).attr("width",e.width-e.inset*2).attr("height",e.barHeight).attr("fill",e.fill).attr("clip-path",`url(#${e.clipId})`).attr("class",e.className)}var Oh=st(()=>{"use strict";en()});var XR={};ye(XR,{clearEventLineMuted:()=>V9,focusEventLine:()=>UR,renderEventLine:()=>gE,renderEventLineForExport:()=>J9});function gE(t,e,n,r,o,a,i){if(e.events.length===0)return;Rt(t).selectAll(":not([data-d3-tooltip])").remove();let s=a?.width??t.clientWidth,l=a?.height??t.clientHeight;if(s<=0||l<=0)return;let c=!!a,d=c?new Set:yE(t),f=ir(n)[0],p=Hr(e.tagGroups,void 0,i),m=!!e.title&&!e.options.noTitle,h=e.tagGroups.length>0&&p!==null&&!e.options.noLegend,g=m?A9:0,y=g+(h?R9:0),b=new Map(e.eras.map(rt=>[rt.name,rt])),E=new Set(e.eras.filter(rt=>rt.collapsed).map(rt=>rt.name)),x=e.events.some(rt=>rt.era&&b.has(rt.era)),L=e.events.some(rt=>rt.era&&b.has(rt.era)&&!E.has(rt.era)),S=e.options.side,A=S==="alternate",C=A||S==="above"?"below":"above",M=[],w=new Set;for(let rt of e.events){let pt=rt.era;pt&&E.has(pt)?w.has(pt)||(w.add(pt),M.push({kind:"era",era:b.get(pt),members:e.events.filter(ht=>ht.era===pt)})):M.push({kind:"event",event:rt})}let k=Math.max(8,Math.floor((oo-Wl*2)/(Bl*Wo))),N=(rt,pt)=>28+(pt?DR:0)+(rt.length>0?6+rt.length*zR:0)+(rt.length>0?Wl:6),_=rt=>{if(!p)return f;let pt=ar(rt.metadata,e.tagGroups,p);return pt&&pt!==$9?Dn(pt,n)??pt:f},T=0,R=M.map(rt=>{let pt=A?T++%2===0?"above":"below":S;if(rt.kind==="event"){let $t=rt.event,ft=_($t),Wt=ie(n,ft,r,{solid:!1}),he=ve(Wt,n.textOnFillLight,n.textOnFillDark),ne=FR($t.description,k);return{kind:"event",event:$t,era:null,members:[],label:$t.label,date:$t.date,dateValue:$t.dateValue,future:$t.future,futureSpan:$t.futureSpan,lineNumber:$t.lineNumber,eraName:$t.era,color:ft,cardFill:Wt,titleColor:he,lines:ne,bulletColors:[],bulletMeta:[],cardH:N(ne,!!$t.date),x:0,side:pt,lane:0,left:0,spanHalf:0}}let ht=rt.era,dt=rt.members.map(_),ut=p!=null&&dt.length>0&&dt.every($t=>$t===dt[0])&&dt[0]!==f,yt=ht.color?Dn(ht.color,n)??n.text:ut?dt[0]:n.text,kt=Gt(yt,nr(n,r),10),Ot=ve(kt,n.textOnFillLight,n.textOnFillDark),Xt=null,bt=null;for(let $t of rt.members)$t.dateValue!==null&&((Xt===null||$t.dateValue<Xt)&&(Xt=$t.dateValue),(bt===null||$t.dateValue>bt)&&(bt=$t.dateValue));let Nt=Xt!==null&&bt!==null?(Xt+bt)/2:null,Vt=rt.members.filter($t=>!X9($t.metadata,d)),xt=Vt.map($t=>`\u2022 ${$t.date?`${$t.future?"TBD":Ji($t.date)} `:""}${$t.label}`),Lt=Vt.map(_),Dt=Vt.map($t=>$t.metadata),zt=FR(xt,k);return{kind:"era",event:null,era:ht,members:rt.members,label:ht.name,date:null,dateValue:Nt,future:!1,futureSpan:null,lineNumber:ht.lineNumber,eraName:ht.name,color:yt,cardFill:kt,titleColor:Ot,lines:zt,bulletColors:Lt,bulletMeta:Dt,cardH:N(zt,!1),x:0,side:pt,lane:0,left:0,spanHalf:0}}),G=e.options.scale&&R.every(rt=>rt.dateValue!==null),I=s-Gh*2,H=16,O=8,D=64,W=16,z=[],P=[],B=()=>{if(!P.length)return;let rt=P.map(pt=>pt.dateValue);z.push({kind:"run",events:P,lo:Math.min(...rt),hi:Math.max(...rt)}),P=[]};for(let rt of R)rt.kind==="era"?(B(),z.push({kind:"capsule",p:rt})):P.push(rt);B();let Y=z.reduce((rt,pt)=>rt+(pt.kind==="run"?pt.hi-pt.lo:0),0),V=rt=>{if(G){let pt=Y>0?I*rt/Y:0,ht={above:-1/0,below:-1/0},dt=Gh;for(let kt of z)if(kt.kind==="capsule"){let Ot=dt+D/2,Xt=Math.max(oo/2+6,ht[kt.p.side]+$h+oo/2);Ot<Xt&&(dt+=Xt-Ot,Ot=Xt),kt.p.x=Ot,kt.p.spanHalf=D/2,ht[kt.p.side]=Ot+oo/2,dt+=D+W}else{for(let Ot of kt.events)Ot.x=dt+(Ot.dateValue-kt.lo)*pt,Ot.spanHalf=0;dt+=(kt.hi-kt.lo)*pt+W}let ut=-1/0,yt=null;for(let kt of[...R].sort((Ot,Xt)=>Ot.x-Xt.x)){if(kt.kind==="era"){ut=kt.x+kt.spanHalf,yt=null;continue}if(kt.dateValue===yt){kt.x=ut;continue}kt.x<ut+H&&(kt.x=ut+H),ut=kt.x,yt=kt.dateValue}}else{R.forEach(dt=>{dt.spanHalf=0});let pt=R.length,ht=pt>1?Math.max(O9,I/(pt-1)):0;R.forEach((dt,ut)=>{dt.x=Gh+ut*ht})}if(G){let pt=oo+$h;for(let ht=0;ht<8;ht++){let dt=!1;for(let ut of["above","below"]){let yt=R.filter(kt=>kt.side===ut).sort((kt,Ot)=>kt.x-Ot.x);for(let kt=1;kt<yt.length;kt++){let Ot=yt[kt];if(Ot.kind!=="event")continue;let Xt=yt[kt-1];if(Xt.kind==="event"&&Ot.dateValue===Xt.dateValue)continue;let bt=Xt.x+pt;if(bt<=Ot.x)continue;let Nt=yt[kt+1],Vt=Nt?.kind==="era"?Nt.x-pt:1/0,xt=Math.min(bt,Vt);xt>Ot.x+.5&&(Ot.x=xt,dt=!0)}}if(!dt)break}}for(let pt of["above","below"]){let ht=R.filter(ut=>ut.side===pt).sort((ut,yt)=>ut.x-yt.x),dt=[];for(let ut=0;ut<ht.length;ut++){let yt=ht[ut],kt=ht[ut+1],Xt=yt.kind!=="era"&&!!kt&&kt.x-yt.x<oo+$h?yt.x-oo+cE:yt.x-oo/2,bt=yt.x-cE,Nt=yt.x-oo+cE,Vt=dt.length,xt=Math.max(Xt,Nt);for(let Lt=0;Lt<dt.length;Lt++){let Dt=Math.max(Xt,dt[Lt]+$h,Nt);if(Dt<=bt){Vt=Lt,xt=Dt;break}}yt.lane=Vt,yt.left=Math.max(6,xt),dt[Vt]=yt.left+oo}}},j=()=>{let rt=Math.max(s,Math.max(...R.map(Dt=>Dt.x+Dt.spanHalf))+Gh,Math.max(...R.map(Dt=>Dt.left+oo))+6),pt={above:[],below:[]};for(let Dt of["above","below"]){let zt=[];for(let Wt of R)Wt.side===Dt&&(zt[Wt.lane]=Math.max(zt[Wt.lane]??0,Wt.cardH));let $t=[],ft=0;for(let Wt=0;Wt<zt.length;Wt++)$t[Wt]=ft,ft+=(zt[Wt]??0)+G9;pt[Dt]=$t}let ht=Dt=>(Dt.side==="above"?I9:P9)+(pt[Dt.side][Dt.lane]??0),dt=Dt=>Math.max(0,...R.filter(zt=>zt.side===Dt).map(zt=>ht(zt)+zt.cardH)),ut=dt("above"),yt=dt("below"),kt=ut+(L&&C==="above"?OR:0),Ot=yt+(L&&C==="below"?OR:0),Xt=14,bt=14,Nt=y+Xt+kt,Vt=C==="above"?Nt-(ut+14):Nt+(yt+14),xt=Nt+Ot+bt,Lt=c?xt:Math.max(l,xt);return{contentW:rt,contentH:xt,totalH:Lt,spineY:Nt,eraBaseY:Vt,laneNear:ht}},K=Number(globalThis.process?.env?.DGMO_EVT_STRETCH),$;if(Number.isFinite(K)&&K>0)V(K),$=j();else{V(1),$=j();let rt=s/l,pt=ht=>ht.contentW/ht.contentH;if(G&&$.contentH>l&&pt($)<rt){V(O);let ht=j();if(pt(ht)<=rt)$=ht;else{let dt=1,ut=O;for(let yt=0;yt<8;yt++){let kt=(dt+ut)/2;V(kt),pt(j())>=rt?ut=kt:dt=kt}V(ut),$=j()}}}let{contentW:U,totalH:X,spineY:q,eraBaseY:et,laneNear:tt}=$,F=Rt(t).append("svg").attr("width",U).attr("height",X).attr("viewBox",`0 0 ${U} ${X}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",It);if(c||F.append("style").text(F9),m){let rt=F.append("text").attr("class","chart-title").attr("x",U/2).attr("y",30).attr("text-anchor","middle").attr("fill",n.text).attr("font-family",It).attr("font-size",20).attr("font-weight","700").attr("data-line-number",e.titleLineNumber??1).text(e.title);if(o&&e.titleLineNumber){let pt=e.titleLineNumber;rt.style("cursor","pointer").on("click",()=>o(pt))}}if(h){let rt=F.append("g").attr("transform",`translate(0, ${g})`),pt=e.tagGroups.map(ht=>({name:ht.name,entries:ht.entries.map(dt=>({value:dt.value,color:Dn(dt.color,n)??dt.color}))}));fn(rt,{groups:pt,palette:n,isDark:r,width:U,mode:c?"export":"preview",activeGroup:p}),c||U9(rt)}let Q=Math.min(...R.map(rt=>rt.x-rt.spanHalf)),ot=Math.max(...R.map(rt=>rt.x+rt.spanHalf)),Z=Q-20,lt=ot+20,nt=G&&R.some(rt=>rt.future&&!rt.futureSpan),J=R.length?Math.max(Z,...R.filter(rt=>!rt.future).map(rt=>rt.x+rt.spanHalf)):lt,at=nt?J:lt;F.append("line").attr("x1",Z).attr("y1",q).attr("x2",at).attr("y2",q).attr("stroke",n.text).attr("stroke-width",2.5).attr("stroke-linecap","round"),nt&&F.append("line").attr("x1",at).attr("y1",q).attr("x2",lt).attr("y2",q).attr("stroke",n.text).attr("stroke-width",2.5).attr("stroke-linecap","round").attr("stroke-opacity",.45).attr("stroke-dasharray","2 6");let it=R.map(rt=>{let pt=rt.side==="above"?q-tt(rt):q+tt(rt),ht=rt.side==="above"?pt-rt.cardH:pt;return{p:rt,near:pt,top:ht}}),vt=(rt,pt)=>{let ht=Math.min(q,pt),dt=Math.max(q,pt);return it.some(ut=>ut.p!==rt&&rt.x>ut.p.left&&rt.x<ut.p.left+oo&&dt>ut.top&&ht<ut.top+ut.p.cardH)},Tt=rt=>q+B9*(rt.side==="above"?-1:1);for(let{p:rt,near:pt}of it){let ht=rt.kind==="era"?Tt(rt):q,dt=F.append("line").attr("class","dgmo-event-leader").attr("x1",rt.x).attr("y1",ht).attr("x2",rt.x).attr("y2",pt).attr("stroke",rt.color).attr("stroke-width",1.5).attr("stroke-opacity",vt(rt,pt)?.18:rt.future?.4:.65);uE(dt,rt)}let At=0;for(let{p:rt,top:pt}of it){let ht=rt.left,dt=F.append("g").attr("class","dgmo-event-card").attr("transform",`translate(${ht}, ${pt})`).attr("data-line-number",rt.lineNumber);if(uE(dt,rt),rt.kind==="era"&&dt.attr("data-era",rt.era.name).attr("data-era-collapsed","true"),o){let kt=rt.lineNumber;dt.style("cursor","pointer").on("click",()=>o(kt)),dt.append("rect").attr("x",0).attr("y",0).attr("width",oo).attr("height",rt.cardH).attr("fill","transparent").attr("pointer-events","all")}let ut=rt.kind==="event"&&rt.date?rt.future?"TBD":Ji(rt.date):null,yt=ut?DR:0;if(e.options.noBox){let kt=rt.side==="below",Ot=kt?0:rt.cardH-28,Xt=kt?0:rt.cardH-28-yt,bt=28+yt,Nt=`dgmo-evt-shelf-${At++}`;dt.append("clipPath").attr("id",Nt).append("rect").attr("x",0).attr("y",Xt).attr("width",oo).attr("height",bt).attr("rx",dE),dt.append("rect").attr("x",0).attr("y",Xt).attr("width",oo).attr("height",bt).attr("clip-path",`url(#${Nt})`).attr("fill",Gt(rt.color,nr(n,r),H9));let Vt=kt?Xt:Xt+bt-dE;if(dt.append("rect").attr("x",0).attr("y",Vt).attr("width",oo).attr("height",dE).attr("clip-path",`url(#${Nt})`).attr("fill",rt.color).attr("fill-opacity",rt.future?.4:1),dt.append("text").attr("x",Wl).attr("y",Ot+28/2+13/2-2).attr("fill",rt.color).attr("font-family",It).attr("font-size",13).attr("font-weight",700).text(rt.label),ut&&dt.append("text").attr("x",Wl).attr("y",(kt?28:Ot-yt)+Hh+2).attr("fill",Gt(n.text,n.bg,55)).attr("font-family",It).attr("font-size",Hh).attr("font-weight",600).text(ut),rt.lines.length>0){let xt=kt?fE+yt+Bl:Wl+Bl;YR(dt,rt.lines,n.text,n,xt,rt.bulletColors,rt.bulletMeta)}}else rd(dt,{width:oo,height:rt.cardH,rx:6,fill:rt.cardFill,stroke:rt.color,strokeWidth:1.5,label:rt.label,labelColor:rt.titleColor,labelFontSize:13,headerHeight:28}),ut&&dt.append("text").attr("x",oo/2).attr("y",28+Hh+1).attr("text-anchor","middle").attr("fill",Gt(rt.titleColor,rt.cardFill,60)).attr("font-family",It).attr("font-size",Hh).attr("font-weight",600).text(ut),rt.lines.length>0&&(dt.append("line").attr("x1",0).attr("y1",28+yt).attr("x2",oo).attr("y2",28+yt).attr("stroke",rt.titleColor).attr("stroke-opacity",.3).attr("stroke-width",1),YR(dt,rt.lines,rt.titleColor,n,fE+yt+Bl,rt.bulletColors,rt.bulletMeta))}for(let rt of R){if(rt.kind==="era"){let ht=rt.color,dt=Math.max(16,rt.spanHalf),ut=Q-20,yt=ot+20,kt=Math.max(ut,rt.x-dt),Ot=Math.min(yt,rt.x+dt),Xt=Tt(rt),bt=F.append("g").attr("class","dgmo-event-era").attr("data-era",rt.era.name).attr("data-era-collapsed","true").attr("data-line-number",rt.lineNumber);if(o){let Vt=Math.min(Xt,q)-4,xt=Math.max(Xt,q)+8;bt.append("rect").attr("x",kt).attr("y",Vt).attr("width",Ot-kt).attr("height",xt-Vt).attr("fill","transparent").attr("pointer-events","all")}bt.append("path").attr("d",`M${kt},${q} L${kt},${Xt} L${Ot},${Xt} L${Ot},${q}`).attr("fill","none").attr("stroke",ht).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round");let Nt=(kt+Ot)/2;bt.append("line").attr("x1",Nt-Fh/2).attr("y1",q).attr("x2",Nt+Fh/2).attr("y2",q).attr("stroke",n.bg).attr("stroke-width",5).attr("stroke-linecap","butt");for(let Vt of tj(Nt,q))bt.append("path").attr("d",Vt).attr("fill","none").attr("stroke",n.text).attr("stroke-width",2).attr("stroke-linecap","round").attr("stroke-linejoin","round");if(o){let Vt=rt.lineNumber;bt.style("cursor","pointer").on("click",()=>o(Vt))}continue}let pt=F.append("circle").attr("class","dgmo-event-dot").attr("cx",rt.x).attr("cy",q).attr("r",D9).attr("fill",rt.future?n.bg:rt.color).attr("stroke",rt.future?rt.color:n.bg).attr("stroke-width",2).attr("data-line-number",rt.lineNumber);uE(pt,rt)}if(x){let rt=[],pt=null;for(let yt of R){let kt=yt.eraName;if(kt&&b.has(kt)){if(pt===kt&&rt.length>0){let Ot=rt[rt.length-1];Ot.firstX=Math.min(Ot.firstX,yt.x),Ot.lastX=Math.max(Ot.lastX,yt.x)}else rt.push({era:b.get(kt),collapsed:yt.kind==="era",firstX:yt.x,lastX:yt.x});pt=kt}else pt=null}let ht=yt=>Math.max(4,Math.min(U-4,yt)),dt=C==="above"?1:-1,ut=rt.filter(yt=>!yt.collapsed).map(yt=>({run:yt,x0:ht(yt.firstX-$R),x1:ht(yt.lastX+$R)})).sort((yt,kt)=>yt.run.firstX-kt.run.firstX);for(let yt=1;yt<ut.length;yt++){let kt=ut[yt-1],Ot=ut[yt];if(kt.x1<=Ot.x0)continue;let Xt=(kt.run.lastX+Ot.run.firstX)/2;kt.x1=Math.max(kt.run.lastX,Math.min(kt.x1,Xt-HR)),Ot.x0=Math.min(Ot.run.firstX,Math.max(Ot.x0,Xt+HR))}for(let{run:yt,x0:kt,x1:Ot}of ut){let Xt=!yt.era.color,bt=Xt?n.text:Dn(yt.era.color,n)??n.text,Nt=Xt?.5:.85,Vt=et,xt=F.append("g").attr("class","dgmo-event-era").attr("data-era",yt.era.name).attr("data-era-collapsed",String(yt.collapsed)).attr("data-line-number",yt.era.lineNumber);if(xt.append("path").attr("d",`M${kt},${Vt+GR*dt} L${kt},${Vt} L${Ot},${Vt} L${Ot},${Vt+GR*dt}`).attr("fill","none").attr("stroke",bt).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",Nt),xt.append("text").attr("x",(yt.firstX+yt.lastX)/2).attr("y",C==="above"?Vt-6:Vt+BR+4).attr("text-anchor","middle").attr("font-family",It).attr("font-size",BR).attr("font-weight",700).attr("fill",bt).attr("fill-opacity",Xt?.85:1).text(yt.era.name),o){let Lt=yt.era.lineNumber;xt.style("cursor","pointer").on("click",()=>o(Lt))}}}if(!c){let rt=F.node();Q9(rt),rt&&(Z9(t,rt,()=>gE(t,e,n,r,o,a,i)),j9(t,rt))}}function uE(t,e){if(t.attr("data-evt",e.lineNumber),e.eraName&&t.attr("data-evt-era",e.eraName),e.event)for(let[n,r]of Object.entries(e.event.metadata))t.attr(`data-tag-${n.toLowerCase()}`,String(r).toLowerCase())}function z9(t){t.querySelectorAll(`.${Zs},.${Fl},.${Yh}`).forEach(e=>e.classList.remove(Zs,Fl,Yh))}function od(t,e){if(z9(t),!e)return;let n=[...t.querySelectorAll(Y9)];if(e.kind==="event"){let l=c=>c.getAttribute("data-evt")===e.id;if(!n.some(l))return;n.forEach(c=>c.classList.add(l(c)?Zs:Fl));return}if(e.kind==="era"){let l=c=>c.getAttribute("data-evt-era")===e.name||c.classList.contains("dgmo-event-era")&&c.getAttribute("data-era")===e.name;if(!n.some(l))return;n.forEach(c=>{l(c)?c.classList.contains("dgmo-event-era")&&c.classList.add(Yh):c.classList.add(Fl)});return}let r=`data-tag-${e.group}`,o=l=>l.getAttribute(r)===e.value,a=[...t.querySelectorAll(".dgmo-evt-bullet")],i=new Set;for(let l of a){if(!o(l))continue;let c=l.closest(".dgmo-event-card"),d=c?.getAttribute("data-era")??c?.getAttribute("data-evt-era");d&&i.add(d)}if(!n.some(o)&&i.size===0)return;let s=l=>{let c=l.getAttribute("data-era")??l.getAttribute("data-evt-era");return!!c&&i.has(c)};n.forEach(l=>{!o(l)&&!s(l)&&l.classList.add(Fl)});for(let l of a)o(l)||l.classList.add(Fl)}function Bh(t){let e=t.getAttribute(pE);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function V9(t){t.removeAttribute(hE)}function UR(t,e){let n=t.querySelector("svg");n&&(e?n.setAttribute(pE,JSON.stringify(e)):n.removeAttribute(pE),od(n,e))}function yE(t){let e=t.getAttribute(hE);if(!e)return new Set;try{return new Set(JSON.parse(e))}catch{return new Set}}function U9(t){t.selectAll("[data-legend-entry]").each(function(){let r;try{r=this.getBBox()}catch{return}!r.width||!r.height||Rt(this).insert("rect",":first-child").attr("x",r.x-6).attr("y",r.y-7).attr("width",r.width+12).attr("height",r.height+14).attr("fill","transparent").attr("data-legend-hit","")})}function X9(t,e){if(e.size===0)return!1;for(let[n,r]of Object.entries(t))if(e.has(`${n.toLowerCase()}:${String(r).toLowerCase()}`))return!0;return!1}function j9(t,e){let n=yE(t),r=o=>{for(let a of n){let i=a.indexOf(":");if(i<0)continue;let s=a.slice(0,i),l=a.slice(i+1);if(o.getAttribute(`data-tag-${s}`)===l)return!0}return!1};e.querySelectorAll(".dgmo-event-card,.dgmo-event-leader").forEach(o=>o.classList.toggle(mf,r(o))),e.querySelectorAll("[data-legend-entry]").forEach(o=>{let a=o.closest("[data-legend-group]")?.getAttribute("data-legend-group"),i=o.getAttribute("data-legend-entry");q9(o,!!a&&n.has(`${a}:${i}`))})}function q9(t,e){t.classList.toggle(VR,e);let n=t.querySelector("circle");if(n)if(e)n.hasAttribute("data-fill0")||n.setAttribute("data-fill0",n.getAttribute("fill")??""),n.setAttribute("fill","none"),n.setAttribute("stroke",n.getAttribute("data-fill0")||"currentColor"),n.setAttribute("stroke-width","1.5");else{let r=n.getAttribute("data-fill0");r!==null&&n.setAttribute("fill",r),n.removeAttribute("stroke"),n.removeAttribute("stroke-width")}}function K9(t,e,n){let r=yE(t),o=`${e}:${n}`;r.has(o)?r.delete(o):r.add(o),t.setAttribute(hE,JSON.stringify([...r]))}function Z9(t,e,n){e.addEventListener("click",r=>{let o=r.target;if(!o||typeof o.closest!="function")return;let a=o.closest("[data-legend-entry]");if(!a)return;let i=a.getAttribute("data-legend-entry"),s=a.closest("[data-legend-group]")?.getAttribute("data-legend-group");if(!s||!i)return;K9(t,s,i);let l=Bh(e);n(),l&&UR(t,l),typeof CustomEvent<"u"&&t.dispatchEvent(new CustomEvent("dgmo-event-line-rerender"))})}function Q9(t){t&&(t.addEventListener("mouseover",e=>{let n=e.target;if(!n||typeof n.closest!="function")return;let r=n.closest("[data-legend-entry]");if(r){let i=r.getAttribute("data-legend-entry"),s=r.closest("[data-legend-group]")?.getAttribute("data-legend-group");od(t,s&&i?{kind:"tag",group:s,value:i}:Bh(t));return}let o=n.closest(".dgmo-event-era");if(o){od(t,{kind:"era",name:o.getAttribute("data-era")??""});return}let a=n.closest("[data-evt]");if(a){let i=a.getAttribute("data-era");od(t,i?{kind:"era",name:i}:{kind:"event",id:a.getAttribute("data-evt")??""});return}od(t,Bh(t))}),t.addEventListener("mouseout",e=>{let n=e.relatedTarget;(!n||!t.contains(n))&&od(t,Bh(t))}))}function J9(t,e,n,r,o,a){gE(t,e,n,r,void 0,o,a)}function tj(t,e){let o=a=>{let i="";for(let s=0;s<=48;s++){let l=s/48,c=e-WR+l*2*WR,d=a+W9*Math.sin(l*Math.PI*2);i+=`${s===0?"M":"L"}${d.toFixed(2)},${c.toFixed(2)}`,s<48&&(i+=" ")}return i};return[o(t-Fh/2),o(t+Fh/2)]}function FR(t,e){let n=[];for(let r of t){if(r===""){n.push({text:"",kind:"plain"});continue}n.push(...qo([r],e))}return n}function YR(t,e,n,r,o=fE+Bl,a=[],i=[]){let s=o,l=0,c=n,d=null,u=f=>{if(d){f.attr("class","dgmo-evt-bullet");for(let[p,m]of Object.entries(d))f.attr(`data-tag-${p.toLowerCase()}`,String(m).toLowerCase())}};for(let f of e){let p=f.kind==="bullet-first"||f.kind==="bullet-cont",m=Wl+(p?12:0);if(f.kind==="bullet-first"){c=a[l]??n,d=i[l]??null,l++;let g=t.append("text").attr("x",Wl).attr("y",s).attr("text-anchor","start").attr("fill",c).attr("font-family",It).attr("font-size",Bl).attr("font-weight",700).text("\u2022");u(g)}else p||(c=n,d=null);let h=t.append("text").attr("x",m).attr("y",s).attr("text-anchor","start").attr("fill",p?c:n).attr("font-family",It).attr("font-size",Bl);p&&u(h),gn(h,f.text,r),s+=zR}}var oo,Gh,A9,R9,I9,P9,Bl,zR,Wl,fE,D9,O9,G9,$9,cE,$h,DR,Hh,H9,dE,OR,GR,$R,HR,WR,W9,Fh,B9,BR,Zs,Fl,Yh,mf,VR,hE,F9,Y9,pE,jR=st(()=>{"use strict";Xn();on();tn();xr();Oh();_o();en();$s();Br();w0();Ke();oo=210,Gh=58,A9=48,R9=34,I9=46,P9=46,Bl=11.5,zR=16,Wl=9,fE=34,D9=5.5,O9=96,G9=16,$9="#999999",cE=18,$h=6,DR=15,Hh=10,H9=13,dE=4,OR=30,GR=8,$R=14,HR=3,WR=6,W9=2.6,Fh=5,B9=13,BR=11.5,Zs="dgmo-evt-hl",Fl="dgmo-evt-dim",Yh="dgmo-evt-era-hl",mf="dgmo-evt-collapsed",VR="dgmo-evt-off",hE="data-evt-hidden",F9=`.dgmo-event-dot{transition:transform .12s ease;transform-box:fill-box;transform-origin:center}.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era{transition:opacity .12s ease,filter .12s ease}.dgmo-event-dot,.dgmo-event-card,.dgmo-event-era{cursor:default}[data-legend-entry]{cursor:pointer}.${Fl}{opacity:.2}.dgmo-event-dot.${Zs}{transform:scale(1.55)}.dgmo-event-leader.${Zs}{stroke-opacity:1;stroke-width:2.5}.dgmo-event-card.${Zs}{filter:drop-shadow(0 2px 5px rgba(0,0,0,.22))}.dgmo-event-era.${Yh}{filter:drop-shadow(0 1px 2px rgba(0,0,0,.28))}.dgmo-event-card.${mf},.dgmo-event-leader.${mf}{opacity:0;pointer-events:none}.dgmo-event-card.${mf}.${Zs},.dgmo-event-leader.${mf}.${Zs}{opacity:1;pointer-events:auto}[data-legend-entry].${VR} text{opacity:.5}`;Y9=".dgmo-event-dot,.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era",pE="data-evt-pin"});var QR={};ye(QR,{renderVersionControl:()=>ZR,renderVersionControlForExport:()=>aj});function nj(t,e){return t.length>e?t.slice(0,e-1)+"\u2026":t}function wE(t,e,n,r,o,a,i){let s=Math.hypot(n-t,r-e),l=Math.hypot(o-n,a-r),c=Math.max(2,Math.min(i,s-1,l-1)),d=(n-t)/(s||1),u=(r-e)/(s||1),f=(o-n)/(l||1),p=(a-r)/(l||1);return`M${t},${e} L${n-d*c},${r-u*c} Q${n},${r} ${n+f*c},${r+p*c} L${o},${a}`}function ZR(t,e,n,r,o,a){if(e.nodes.length===0)return;Rt(t).selectAll(":not([data-d3-tooltip])").remove();let i=e.nodes,s=e.options.direction!=="LR",l=new Map(e.branches.map(D=>[D.name,D])),c=ir(n),d=D=>D.colorToken?Dn(D.colorToken,n)??c[D.lane%c.length]:c[D.lane%c.length],u=D=>d(l.get(D.branch)),f=D=>i[D],p=D=>D.kind==="cherry"?"\u21E0 ":D.kind==="merge"?"\u21F2 ":"",m=new Map;for(let D of i){let W=D.id,z=p(D)+nj(D.message||"(empty)",26),P=(W?W.length*6.6+8:0)+z.length*6.9+8;m.set(D.key,{sha:W,msg:z,lw:P})}let h=Math.max(0,...[...m.values()].map(D=>D.lw)),g=new Map,v=(D,W)=>{g.has(D)||g.set(D,[]),g.get(D).push(W)};if(!e.options.noLabels)for(let D of i)D.tag&&v(D.key,{kind:"tag",label:D.tag,w:D.tag.length*6.6+16});for(let D of e.refs)D.atKey!=null&&(D.head?v(D.atKey,{kind:"head",label:"HEAD",w:46}):v(D.atKey,{kind:"ref",label:D.name,remote:D.remote,w:D.name.length*6.2+18}));for(let D of e.notes)D.anchorKey!=null&&v(D.anchorKey,{kind:"note",label:KR[D.num-1]??`#${D.num}`,w:19});let y=Math.max(0,...[...g.values()].map(D=>D.length)),b=e.branches.length,E=i.length,x=new Map,L=[],S,A,C,M,w=0,k=Math.cos(EE*Math.PI/180),N=Math.sin(EE*Math.PI/180);if(s){C=24;let D=C+32,W=52,z=96;M=78;for(let B of i)x.set(B.key,{x:M+B.lane*z,y:D+B.seq*W});let P=M+(b-1)*z+28;for(let B of i){let Y=x.get(B.key);L.push({node:B,kind:"msg",diag:!1,x:P,y:Y.y,anchor:"start",leader:{x1:Y.x+Ko+2,y1:Y.y,x2:P-6,y2:Y.y}}),(g.get(B.key)??[]).forEach((j,K)=>L.push({node:B,kind:j.kind,label:j.label,remote:j.remote,w:j.w,x:Y.x-Ko-12-j.w/2-K*4,y:Y.y,anchor:"middle"}))}S=P+h+16,A=D+(E-1)*W+22}else{C=Math.max(4,...e.branches.map(V=>V.name.length))*7.5+18;let W=C+34,z=86,P=54;M=16+y*qR+14;for(let V of i)x.set(V.key,{x:W+V.seq*z,y:M+V.lane*P});let Y=M+(b-1)*P+26;for(let V of i){let j=x.get(V.key);L.push({node:V,kind:"msg",diag:!0,x:j.x,y:Y,anchor:"start",leader:{x1:j.x,y1:j.y+Ko,x2:j.x,y2:Y-3}}),(g.get(V.key)??[]).forEach(($,U)=>L.push({node:V,kind:$.kind,label:$.label,remote:$.remote,w:$.w,x:j.x,y:j.y-Ko-12-U*qR,anchor:"middle"}))}for(let V of e.branches){if(!V.ab||V.ab.ahead+V.ab.behind===0||V.tip==null)continue;let j=x.get(V.tip);L.push({node:f(V.tip),kind:"ab",label:rj(V.ab),x:j.x+Ko+10,y:j.y,anchor:"start"})}S=Math.max(W+(E-1)*z+Ko+70,...[...x.entries()].map(([V,j])=>j.x+m.get(V).lw*k))+18,A=Y+h*N+12*k+16,e.notes.length&&(w=A+4,A+=8+e.notes.length*16+8)}let _=!!e.title,T=_?ej:0,R=Math.round(S),G=Math.round(A+T),I=!!a,H=Rt(t).append("svg").attr("width",R).attr("height",G).attr("viewBox",`0 0 ${R} ${G}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",It);if(H.append("rect").attr("width",R).attr("height",G).attr("fill",n.bg),_){let D=H.append("text").attr("class","chart-title").attr("x",R/2).attr("y",30).attr("text-anchor","middle").attr("fill",n.text).attr("font-family",It).attr("font-size",20).attr("font-weight","700").attr("data-line-number",e.titleLineNumber??1).text(e.title);if(o&&e.titleLineNumber&&!I){let W=e.titleLineNumber;D.style("cursor","pointer").on("click",()=>o(W))}}let O=H.append("g").attr("transform",`translate(0, ${T})`);oj(O,e,n,s,x,L,m,u,f,C,M,w,o&&!I?o:void 0)}function rj(t){let e=[];return t.ahead&&e.push("\u2191"+t.ahead),t.behind&&e.push("\u2193"+t.behind),e.join(" ")}function oj(t,e,n,r,o,a,i,s,l,c,d,u,f){let p=e.nodes,m=E=>o.get(E),h=(E,x)=>r?{x:m(x.key).x,y:m(E.key).y}:{x:m(E.key).x,y:m(x.key).y},g=(E,x)=>r?{x:m(E.key).x,y:m(x.key).y}:{x:m(x.key).x,y:m(E.key).y},v=E=>E.ghost?.32:1,y=(E,x,L,S)=>{let A=m(E.key),C=m(x.key),M=g(E,x);if(t.append("path").attr("d",wE(A.x,A.y,M.x,M.y,C.x,C.y,xE)).attr("fill","none").attr("stroke",L).attr("stroke-width",2).attr("stroke-dasharray","2 4").attr("opacity",.8),S){let w=C.x-M.x,k=C.y-M.y,N=Math.hypot(w,k)||1,_=w/N,T=k/N,R=-T,G=_,I=4;t.append("path").attr("d",`M${C.x},${C.y} L${C.x-_*I*2+R*I},${C.y-T*I*2+G*I} L${C.x-_*I*2-R*I},${C.y-T*I*2-G*I} Z`).attr("fill",L).attr("opacity",.8)}};for(let E of p){let x=s(E),L=v(E),S=m(E.key);if(E.prev!=null){let A=m(E.prev),C=t.append("line").attr("x1",A.x).attr("y1",A.y).attr("x2",S.x).attr("y2",S.y).attr("stroke",x).attr("stroke-width",bE).attr("stroke-linecap","round").attr("opacity",L);E.ghost&&C.attr("stroke-dasharray","5 5")}if(E.parent!=null){let A=l(E.parent),C=h(A,E),M=m(A.key),w=t.append("path").attr("d",wE(M.x,M.y,C.x,C.y,S.x,S.y,xE)).attr("fill","none").attr("stroke",x).attr("stroke-width",bE).attr("stroke-linecap","round").attr("opacity",L);E.ghost&&w.attr("stroke-dasharray","5 5")}if(E.mergeFrom!=null){let A=l(E.mergeFrom),C=g(A,E),M=m(A.key);t.append("path").attr("d",wE(M.x,M.y,C.x,C.y,S.x,S.y,xE)).attr("fill","none").attr("stroke",s(A)).attr("stroke-width",bE).attr("stroke-linecap","round").attr("opacity",.92*L)}E.cherryFrom!=null&&y(l(E.cherryFrom),E,s(l(E.cherryFrom)),!1),E.revertFrom!=null&&y(l(E.revertFrom),E,x,!1),E.squashFrom!=null&&y(l(E.squashFrom),E,n.textMuted,!0),E.movedTo!=null&&y(E,l(E.movedTo),n.textMuted,!0)}if(!e.options.noLanes)for(let E of e.branches){let x=null;for(let A of p)A.branch===E.name&&(x===null||A.seq<x.seq)&&(x=A);if(!x)continue;let L=m(x.key),S=s(x);r?t.append("text").attr("x",L.x).attr("y",14).attr("text-anchor","middle").attr("font-size",12.5).attr("font-weight",800).attr("fill",S).text(E.name):t.append("text").attr("x",c).attr("y",L.y+4).attr("text-anchor","end").attr("font-size",12.5).attr("font-weight",800).attr("fill",S).text(E.name)}for(let E of p){let x=s(E),L=m(E.key),S=A=>{A.attr("data-line-number",E.lineNumber),A.attr("data-branch",E.branch),f&&A.style("cursor","pointer").on("click",()=>f(E.lineNumber))};if(E.ghost){S(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",Ko-1).attr("fill",n.bg).attr("stroke",x).attr("stroke-width",2).attr("opacity",.4));continue}E.type==="highlight"?S(t.append("rect").attr("x",L.x-Ko).attr("y",L.y-Ko).attr("width",Ko*2).attr("height",Ko*2).attr("rx",3.5).attr("fill",x).attr("stroke",n.bg).attr("stroke-width",3)):E.type==="reverse"?(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",Ko).attr("fill",n.bg).attr("stroke",x).attr("stroke-width",3),S(t.append("path").attr("d",`M${L.x-3.6},${L.y-3.6} L${L.x+3.6},${L.y+3.6} M${L.x+3.6},${L.y-3.6} L${L.x-3.6},${L.y+3.6}`).attr("stroke",x).attr("stroke-width",2).attr("stroke-linecap","round").attr("fill","none"))):E.kind==="merge"?(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",Ko).attr("fill",n.bg).attr("stroke",x).attr("stroke-width",3),S(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",3).attr("fill",x))):S(t.append("circle").attr("cx",L.x).attr("cy",L.y).attr("r",Ko).attr("fill",x).attr("stroke",n.bg).attr("stroke-width",3))}let b=(E,x,L,S,A,C,M,w,k=700)=>{let N=t.append("rect").attr("x",E-L/2).attr("y",x-8.5).attr("width",L).attr("height",17).attr("rx",8.5).attr("fill",A);M&&(N.attr("stroke",M).attr("stroke-width",1.3),w&&N.attr("stroke-dasharray","3 2")),t.append("text").attr("x",E).attr("y",x+4).attr("text-anchor","middle").attr("font-size",10.5).attr("font-weight",k).attr("fill",C).text(S)};for(let E of a){let x=E.node,L=s(x);if(E.leader&&t.append("line").attr("x1",E.leader.x1).attr("y1",E.leader.y1).attr("x2",E.leader.x2).attr("y2",E.leader.y2).attr("stroke",L).attr("stroke-width",1).attr("opacity",.34*v(x)),E.kind==="tag")b(E.x,E.y,E.w,E.label,L,n.bg);else if(E.kind==="head")b(E.x,E.y,E.w,"HEAD",n.text,n.bg,void 0,!1,800);else if(E.kind==="ref")b(E.x,E.y,E.w,E.label,n.bg,L,L,E.remote);else if(E.kind==="note")t.append("circle").attr("cx",E.x).attr("cy",E.y).attr("r",8.5).attr("fill",L),t.append("text").attr("x",E.x).attr("y",E.y+4).attr("text-anchor","middle").attr("font-size",11).attr("fill",n.bg).text(E.label);else if(E.kind==="ab")t.append("text").attr("x",E.x).attr("y",E.y+4).attr("text-anchor","start").attr("font-size",11).attr("font-weight",700).attr("fill",L).text(E.label);else{let S=i.get(x.key),A=x.ghost,C=A?n.textMuted:L,M=E.diag?t.append("text").attr("transform",`translate(${E.x},${E.y}) rotate(${EE})`).attr("font-size",12).attr("opacity",A?.55:1):t.append("text").attr("x",E.x).attr("y",E.y+4).attr("text-anchor",E.anchor).attr("font-size",12).attr("opacity",A?.55:1);S.sha&&M.append("tspan").attr("font-family","ui-monospace, monospace").attr("font-size",11).attr("fill",n.textMuted).text(S.sha+" "),M.append("tspan").attr("fill",C).attr("font-weight",x.kind==="cherry"?400:700).attr("font-style",x.kind==="cherry"?"italic":"normal").text(S.msg)}}if(u&&e.notes.length){let E=u+14;for(let x of e.notes){let L=t.append("text").attr("x",12).attr("y",E).attr("font-size",11.5);L.append("tspan").attr("fill",n.text).attr("font-weight",800).text((KR[x.num-1]??`#${x.num}`)+" "),L.append("tspan").attr("fill",n.textMuted).text(x.text),E+=16}}}function aj(t,e,n,r,o){ZR(t,e,n,r,void 0,o)}var bE,Ko,xE,EE,qR,KR,ej,JR=st(()=>{"use strict";Xn();on();tn();xr();bE=5.5,Ko=8,xE=13,EE=32,qR=19,KR="\u2460\u2461\u2462\u2463\u2464\u2465\u2466\u2467\u2468",ej=40});function ij(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function tI(){return this.eachAfter(ij)}var eI=st(()=>{"use strict"});function nI(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}var rI=st(()=>{"use strict"});function oI(t,e){for(var n=this,r=[n],o,a,i=-1;n=r.pop();)if(t.call(e,n,++i,this),o=n.children)for(a=o.length-1;a>=0;--a)r.push(o[a]);return this}var aI=st(()=>{"use strict"});function iI(t,e){for(var n=this,r=[n],o=[],a,i,s,l=-1;n=r.pop();)if(o.push(n),a=n.children)for(i=0,s=a.length;i<s;++i)r.push(a[i]);for(;n=o.pop();)t.call(e,n,++l,this);return this}var sI=st(()=>{"use strict"});function lI(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}var cI=st(()=>{"use strict"});function dI(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}var uI=st(()=>{"use strict"});function fI(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}var pI=st(()=>{"use strict"});function mI(t){for(var e=this,n=sj(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function sj(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}var hI=st(()=>{"use strict"});function gI(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}var yI=st(()=>{"use strict"});function bI(){return Array.from(this)}var xI=st(()=>{"use strict"});function wI(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}var EI=st(()=>{"use strict"});function SI(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}var vI=st(()=>{"use strict"});function*kI(){var t=this,e,n=[t],r,o,a;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,a=r.length;o<a;++o)n.push(r[o]);while(n.length)}var LI=st(()=>{"use strict"});function Ai(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=dj)):e===void 0&&(e=cj);for(var n=new Yl(t),r,o=[n],a,i,s,l;r=o.pop();)if((i=e(r.data))&&(l=(i=Array.from(i)).length))for(r.children=i,s=l-1;s>=0;--s)o.push(a=i[s]=new Yl(i[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(fj)}function lj(){return Ai(this).eachBefore(uj)}function cj(t){return t.children}function dj(t){return Array.isArray(t)?t[1]:null}function uj(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function fj(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Yl(t){this.data=t,this.depth=this.height=0,this.parent=null}var SE=st(()=>{"use strict";eI();rI();aI();sI();cI();uI();pI();hI();yI();xI();EI();vI();LI();Yl.prototype=Ai.prototype={constructor:Yl,count:tI,each:nI,eachAfter:iI,eachBefore:oI,find:lI,sum:dI,sort:fI,path:mI,ancestors:gI,descendants:bI,leaves:wI,links:SI,copy:lj,[Symbol.iterator]:kI}});function NI(t){if(typeof t!="function")throw new Error;return t}var MI=st(()=>{"use strict"});function ad(){return 0}function id(t){return function(){return t}}var TI=st(()=>{"use strict"});function zh(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}var vE=st(()=>{"use strict"});function Vh(t,e,n,r,o){for(var a=t.children,i,s=-1,l=a.length,c=t.value&&(r-e)/t.value;++s<l;)i=a[s],i.y0=n,i.y1=o,i.x0=e,i.x1=e+=i.value*c}var kE=st(()=>{"use strict"});function LE(){var t=1,e=1,n=0,r=!1;function o(i){var s=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/s,i.eachBefore(a(e,s)),r&&i.eachBefore(zh),i}function a(i,s){return function(l){l.children&&Vh(l,l.x0,i*(l.depth+1)/s,l.x1,i*(l.depth+2)/s);var c=l.x0,d=l.y0,u=l.x1-n,f=l.y1-n;u<c&&(c=u=(c+u)/2),f<d&&(d=f=(d+f)/2),l.x0=c,l.y0=d,l.x1=u,l.y1=f}}return o.round=function(i){return arguments.length?(r=!!i,o):r},o.size=function(i){return arguments.length?(t=+i[0],e=+i[1],o):[t,e]},o.padding=function(i){return arguments.length?(n=+i,o):n},o}var CI=st(()=>{"use strict";vE();kE()});function pj(t,e){return t.parent===e.parent?1:2}function NE(t){var e=t.children;return e?e[0]:t.t}function ME(t){var e=t.children;return e?e[e.length-1]:t.t}function mj(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function hj(t){for(var e=0,n=0,r=t.children,o=r.length,a;--o>=0;)a=r[o],a.z+=e,a.m+=e,e+=a.s+(n+=a.c)}function gj(t,e,n){return t.a.parent===e.parent?t.a:n}function Uh(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function yj(t){for(var e=new Uh(t,0),n,r=[e],o,a,i,s;n=r.pop();)if(a=n._.children)for(n.children=new Array(s=a.length),i=s-1;i>=0;--i)r.push(o=n.children[i]=new Uh(a[i],i)),o.parent=n;return(e.parent=new Uh(null,0)).children=[e],e}function TE(){var t=pj,e=1,n=1,r=null;function o(c){var d=yj(c);if(d.eachAfter(a),d.parent.m=-d.z,d.eachBefore(i),r)c.eachBefore(l);else{var u=c,f=c,p=c;c.eachBefore(function(y){y.x<u.x&&(u=y),y.x>f.x&&(f=y),y.depth>p.depth&&(p=y)});var m=u===f?1:t(u,f)/2,h=m-u.x,g=e/(f.x+m+h),v=n/(p.depth||1);c.eachBefore(function(y){y.x=(y.x+h)*g,y.y=y.depth*v})}return c}function a(c){var d=c.children,u=c.parent.children,f=c.i?u[c.i-1]:null;if(d){hj(c);var p=(d[0].z+d[d.length-1].z)/2;f?(c.z=f.z+t(c._,f._),c.m=c.z-p):c.z=p}else f&&(c.z=f.z+t(c._,f._));c.parent.A=s(c,f,c.parent.A||u[0])}function i(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function s(c,d,u){if(d){for(var f=c,p=c,m=d,h=f.parent.children[0],g=f.m,v=p.m,y=m.m,b=h.m,E;m=ME(m),f=NE(f),m&&f;)h=NE(h),p=ME(p),p.a=c,E=m.z+y-f.z-g+t(m._,f._),E>0&&(mj(gj(m,c,u),c,E),g+=E,v+=E),y+=m.m,g+=f.m,b+=h.m,v+=p.m;m&&!ME(p)&&(p.t=m,p.m+=y-v),f&&!NE(h)&&(h.t=f,h.m+=g-b,u=c)}return u}function l(c){c.x*=e,c.y=c.depth*n}return o.separation=function(c){return arguments.length?(t=c,o):t},o.size=function(c){return arguments.length?(r=!1,e=+c[0],n=+c[1],o):r?null:[e,n]},o.nodeSize=function(c){return arguments.length?(r=!0,e=+c[0],n=+c[1],o):r?[e,n]:null},o}var _I=st(()=>{"use strict";SE();Uh.prototype=Object.create(Yl.prototype)});function AI(t,e,n,r,o){for(var a=t.children,i,s=-1,l=a.length,c=t.value&&(o-n)/t.value;++s<l;)i=a[s],i.x0=e,i.x1=r,i.y0=n,i.y1=n+=i.value*c}var RI=st(()=>{"use strict"});function xj(t,e,n,r,o,a){for(var i=[],s=e.children,l,c,d=0,u=0,f=s.length,p,m,h=e.value,g,v,y,b,E,x,L;d<f;){p=o-n,m=a-r;do g=s[u++].value;while(!g&&u<f);for(v=y=g,x=Math.max(m/p,p/m)/(h*t),L=g*g*x,E=Math.max(y/L,L/v);u<f;++u){if(g+=c=s[u].value,c<v&&(v=c),c>y&&(y=c),L=g*g*x,b=Math.max(y/L,L/v),b>E){g-=c;break}E=b}i.push(l={value:g,dice:p<m,children:s.slice(d,u)}),l.dice?Vh(l,n,r,o,h?r+=m*g/h:a):AI(l,n,r,h?n+=p*g/h:o,a),h-=g,d=u}return i}var bj,hf,CE=st(()=>{"use strict";kE();RI();bj=(1+Math.sqrt(5))/2;hf=(function t(e){function n(r,o,a,i,s){xj(e,r,o,a,i,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(bj)});function _E(){var t=hf,e=!1,n=1,r=1,o=[0],a=ad,i=ad,s=ad,l=ad,c=ad;function d(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(u),o=[0],e&&f.eachBefore(zh),f}function u(f){var p=o[f.depth],m=f.x0+p,h=f.y0+p,g=f.x1-p,v=f.y1-p;g<m&&(m=g=(m+g)/2),v<h&&(h=v=(h+v)/2),f.x0=m,f.y0=h,f.x1=g,f.y1=v,f.children&&(p=o[f.depth+1]=a(f)/2,m+=c(f)-p,h+=i(f)-p,g-=s(f)-p,v-=l(f)-p,g<m&&(m=g=(m+g)/2),v<h&&(h=v=(h+v)/2),t(f,m,h,g,v))}return d.round=function(f){return arguments.length?(e=!!f,d):e},d.size=function(f){return arguments.length?(n=+f[0],r=+f[1],d):[n,r]},d.tile=function(f){return arguments.length?(t=NI(f),d):t},d.padding=function(f){return arguments.length?d.paddingInner(f).paddingOuter(f):d.paddingInner()},d.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:id(+f),d):a},d.paddingOuter=function(f){return arguments.length?d.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):d.paddingTop()},d.paddingTop=function(f){return arguments.length?(i=typeof f=="function"?f:id(+f),d):i},d.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:id(+f),d):s},d.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:id(+f),d):l},d.paddingLeft=function(f){return arguments.length?(c=typeof f=="function"?f:id(+f),d):c},d}var II=st(()=>{"use strict";vE();CE();MI();TI()});var Xh=st(()=>{"use strict";SE();CI();_I();II();CE()});var YI={};ye(YI,{layoutOrg:()=>PE});function Kh(t,e){let n=0;for(let r of t.children){n+=(r.isContainer?0:1)+Kh(r,e);let o=e?.get(r.id);o&&(n+=o)}return n}function gf(t,e){if(!e||e.size===0)return t;let n={};for(let[r,o]of Object.entries(t))e.has(r)||(n[r]=o);return n}function Nj(t,e){let n=_t(t,wj);for(let[r,o]of Object.entries(e)){let a=_t(`${r}: ${o}`,Ej);a>n&&(n=a)}return Math.max(Lj,Math.ceil(n)+kj*2)}function Mj(t){let e=Object.keys(t).length;return e===0?PI+DI:PI+vj+e*Sj+DI}function qh(t,e,n){return t.color?t.color:ar(t.metadata,[...e],n,t.isContainer)}function WI(t,e,n,r,o){return t.map(a=>{let i=gf(a.metadata,n),s=e?.get(a.id);if(!a.isContainer&&o&&!(s!=null&&s>0)){let l=Kh(a,e);l>0&&(i[r??"Sub-node Count"]=String(l))}return{orgNode:a,children:WI(a.children,e,n,r,o),width:Nj(a.label,i),height:Mj(i)}})}function BI(t){let e=0;for(let n of t.children)e+=1+BI(n);return e}function FI(t){for(let i of t.children)FI(i);if(t.children.length<=2)return;let e=t.children.map(i=>({child:i,weight:BI(i)})).sort((i,s)=>s.weight-i.weight),n=new Array(e.length),r=Math.floor((e.length-1)/2),o=r,a=r;for(let i=0;i<e.length;i++){let s=e[i];i===0?n[r]=s.child:i%2===1?(a++,n[a]=s.child):(o--,n[o]=s.child)}t.children=n}function HI(t,e,n){let r=[];for(let o of t){if(o.entries.length===0)continue;let a=n?.get(qt(o.name)),i=a?o.entries.filter(f=>a.has(f.value.toLowerCase())):o.entries;if(i.length===0)continue;let s=We(o.name,sr)+po,l=s,c=0;for(let f of i)c+=wr*2+Nr+We(f.value,Vn)+Kr;let d=e?Mo+wi:0,u=Rn*2+s+4+d+c;r.push({name:o.name,...o.alias!==void 0&&{alias:o.alias},entries:i.map(f=>({value:f.value,color:f.color})),x:0,y:0,width:u,height:Se,minifiedWidth:l,minifiedHeight:Se})}return r}function Tj(t,e){let n=[],r=o=>{n.push(o);for(let a of o.children)r(a)};for(let o of t)r(o);wa(n,e,o=>o.isContainer)}function PE(t,e,n,r,o){if(t.roots.length===0){let $=r!==void 0,U=HI(t.tagGroups,$);if(U.length===0)return{nodes:[],edges:[],containers:[],legend:[],width:0,height:0};let X=Ja,q=0;for(let et of U)et.x=Ja,et.y=X,X+=Se+Wn,et.width>q&&(q=et.width);return{nodes:[],edges:[],containers:[],legend:U,width:q+Ja*2,height:X-Wn+Ja}}Tj(t.roots,t.tagGroups);let a=t.options["sub-node-label"]??void 0,i=["yes","on"].includes(t.options["show-sub-node-count"]?.toLowerCase()??""),s=WI(t.roots,e,r,a,i),l;s.length===1?l=s[0]:l={orgNode:{id:"__virtual_root__",label:"",metadata:{},children:t.roots,parentId:null,isContainer:!1,lineNumber:0},children:s,width:0,height:0};let c=0,d=0,u=[],f=$=>{$.orgNode.id!=="__virtual_root__"&&(u.push($),$.width>c&&(c=$.width),$.height>d&&(d=$.height));for(let U of $.children)f(U)};f(l);for(let $ of u)$.width=c;let p=new Map,m=$=>{for(let U of $.children)m(U);if($.orgNode.isContainer&&$.children.length>0&&$.children.every(U=>U.children.length===0)){let U=`__stack_${$.orgNode.id}`;p.set($.orgNode.id,{children:[...$.children],placeholderId:U});let X=Math.max(...$.children.map(et=>et.width));for(let et of $.children)et.width=X;let q=$.children.reduce((et,tt)=>et+tt.height,0)+($.children.length-1)*$I;$.children=[{orgNode:{id:U,label:"",metadata:{},children:[],parentId:$.orgNode.id,isContainer:!1,lineNumber:0},children:[],width:X,height:q}]}};m(l),FI(l);let h=Ai(l,$=>$.children);TE().nodeSize([c+OI,d+AE])(h);{let $=h.descendants().filter(tt=>tt.data.orgNode.id!=="__virtual_root__"),U=new Map;for(let tt of $){if(tt.data.orgNode.id.startsWith("__stack_"))continue;let F=U.get(tt.depth)??0;tt.data.height>F&&U.set(tt.depth,tt.data.height)}let X=Math.max(...U.keys(),0),q=new Map,et=s.length===1?0:1;q.set(et,0);for(let tt=et+1;tt<=X;tt++){let F=U.get(tt-1)??d,Q=q.get(tt-1)??0;q.set(tt,Q+F+AE)}for(let tt of h.descendants())tt.data.orgNode.id!=="__virtual_root__"&&(tt.y=q.get(tt.depth)??tt.y)}for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||!$.data.orgNode.isContainer||!$.children||$.children.length===0)continue;let X=$.children[0].y-$.y,q=Object.keys($.data.orgNode.metadata).length,tt=RE+q*IE+15,F=X-tt;if(F<=0)continue;let Q=ot=>{if(ot.children)for(let Z of ot.children)Z.y-=F,Q(Z)};Q($)}for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||$.data.orgNode.isContainer||!$.children||$.children.length===0||!$.children.every(Q=>Q.data.orgNode.isContainer))continue;let U=$.y+$.data.height,q=Math.min(...$.children.map(Q=>Q.y))-U,et=AE*.6,tt=q-et;if(tt<=0)continue;let F=Q=>{if(Q.y-=tt,Q.children)for(let ot of Q.children)F(ot)};for(let Q of $.children)F(Q)}{let $=q=>{let et=q.x-q.data.width/2,tt=q.x+q.data.width/2;if(q.children)for(let F of q.children){let Q=$(F);Q.minX<et&&(et=Q.minX),Q.maxX>tt&&(tt=Q.maxX)}return q.data.orgNode.isContainer&&(et-=jh,tt+=jh),{minX:et,maxX:tt}},U=(q,et)=>{q.x+=et,q.children&&q.children.forEach(tt=>U(tt,et))},X=h.descendants().filter(q=>q.children&&q.children.length>=2).sort((q,et)=>et.depth-q.depth);for(let q of X){let et=q.children,tt=et.map(lt=>{let nt=$(lt);return{relLeft:nt.minX-lt.x,relRight:nt.maxX-lt.x}}),F=(et[0].x+et[et.length-1].x)/2,Q=[0];for(let lt=1;lt<et.length;lt++){let nt=Q[lt-1]+tt[lt-1].relRight;Q[lt]=nt+OI-tt[lt].relLeft}let ot=(Q[0]+Q[Q.length-1])/2,Z=F-ot;for(let lt=0;lt<et.length;lt++){let J=Q[lt]+Z-et[lt].x;Math.abs(J)>.001&&U(et[lt],J)}}}{let $=h.descendants().filter(U=>U.children&&U.children.length>=1&&U.data.orgNode.id!=="__virtual_root__").sort((U,X)=>X.depth-U.depth);for(let U of $){let X=U.children.map(et=>et.x),q=(Math.min(...X)+Math.max(...X))/2;U.x=q}}let v=[],y=[],b=1/0,E=-1/0,x=1/0,L=-1/0,S=[];for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||!$.data.orgNode.id.startsWith("__stack_"))continue;let U=$.data.orgNode.id.replace("__stack_",""),X=p.get(U);if(!X)continue;let q=$.y;for(let et of X.children)S.push({orgNode:et.orgNode,width:et.width,height:et.height,cx:$.x,cy:q}),q+=et.height+$I}for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||$.data.orgNode.id.startsWith("__stack_"))continue;let U=$.data.width,X=$.data.height,q=$.x,et=$.y;q-U/2<b&&(b=q-U/2),q+U/2>E&&(E=q+U/2),et<x&&(x=et),et+X>L&&(L=et+X)}for(let $ of S)$.cx-$.width/2<b&&(b=$.cx-$.width/2),$.cx+$.width/2>E&&(E=$.cx+$.width/2),$.cy<x&&(x=$.cy),$.cy+$.height>L&&(L=$.cy+$.height);let A=-b+Ja,C=-x+Ja,M=a??"Sub-node Count";for(let $ of S){let U=e?.get($.orgNode.id),X=gf($.orgNode.metadata,r);if(!$.orgNode.isContainer&&i&&!(U!=null&&U>0)){let tt=Kh($.orgNode,e);tt>0&&(X[M]=String(tt))}let q=qh($.orgNode,t.tagGroups,n??null),et=$.orgNode.children.length>0||U!=null&&U>0||void 0;v.push({id:$.orgNode.id,label:$.orgNode.label,metadata:X,tagMetadata:{...$.orgNode.metadata},isContainer:$.orgNode.isContainer,lineNumber:$.orgNode.lineNumber,...q!==void 0&&{color:q},x:$.cx+A,y:$.cy+C,width:$.width,height:$.height,...U!==void 0&&{hiddenCount:U},...et!==void 0&&{hasChildren:et}})}let w=new Map;for(let $ of h.descendants()){if($.data.orgNode.id==="__virtual_root__"||$.data.orgNode.id.startsWith("__stack_"))continue;let U=$.data.orgNode,X=$.data.width,q=$.data.height,et=$.x+A,tt=$.y+C,F=e?.get(U.id),Q=gf(U.metadata,r);if(!U.isContainer&&i&&!(F!=null&&F>0)){let nt=Kh(U,e);nt>0&&(Q[M]=String(nt))}let ot=qh(U,t.tagGroups,n??null),Z=$.children!=null&&$.children.length>0||F!=null&&F>0||void 0;v.push({id:U.id,label:U.label,metadata:Q,tagMetadata:{...U.metadata},isContainer:U.isContainer,lineNumber:U.lineNumber,...ot!==void 0&&{color:ot},x:et,y:tt,width:X,height:q,...F!==void 0&&{hiddenCount:F},...Z!==void 0&&{hasChildren:Z}});let lt=$.parent?.data.orgNode.isContainer&&$.parent.children&&$.parent.children.length>0;if($.parent&&$.parent.data.orgNode.id!=="__virtual_root__"&&!lt){let nt=$.parent.data.orgNode.id;if(!w.has(nt)){let J=$.parent.x+A,at=$.parent.y+C,it=$.parent.data.height;w.set(nt,{parentX:J,parentBottomY:at+it,children:[]})}w.get(nt).children.push({id:U.id,x:et,topY:tt})}}for(let[$,U]of w){let{parentX:X,parentBottomY:q,children:et}=U;if(et.length===1){let tt=et[0],F=(q+tt.topY)/2;y.push({sourceId:$,targetId:tt.id,points:[{x:X,y:q},{x:X,y:F},{x:tt.x,y:F},{x:tt.x,y:tt.topY}]})}else{let tt=(q+et[0].topY)/2,F=et.map(Z=>Z.x),Q=Math.min(...F),ot=Math.max(...F);y.push({sourceId:$,targetId:$,points:[{x:X,y:q},{x:X,y:tt}]}),y.push({sourceId:$,targetId:$,points:[{x:Q,y:tt},{x:ot,y:tt}]});for(let Z of et)y.push({sourceId:$,targetId:Z.id,points:[{x:Z.x,y:tt},{x:Z.x,y:Z.topY}]})}}let k=h.descendants().filter($=>$.data.orgNode.id!=="__virtual_root__"&&$.data.orgNode.isContainer),N=new Map,_=[],T=60;for(let $ of k){if($.children&&$.children.length>0)continue;let U=$.x+A,X=$.y+C,q=Object.keys($.data.orgNode.metadata).length,et=RE+q*IE,tt=$.data.width,F=Math.max(et+GI,T),Q=U-tt/2,ot=X;N.set($.data.orgNode.id,{minX:Q,maxX:Q+tt,minY:ot,maxY:ot+F});let Z=e?.get($.data.orgNode.id),lt=gf($.data.orgNode.metadata,r),nt=qh($.data.orgNode,t.tagGroups,n??null),J=Z!=null&&Z>0||void 0;_.push({nodeId:$.data.orgNode.id,label:$.data.orgNode.label,lineNumber:$.data.orgNode.lineNumber,...nt!==void 0&&{color:nt},metadata:lt,tagMetadata:{...$.data.orgNode.metadata},x:Q,y:ot,width:tt,height:F,labelHeight:et,...Z!==void 0&&{hiddenCount:Z},...J!==void 0&&{hasChildren:J}})}let R=k.filter($=>$.children&&$.children.length>0);R.sort(($,U)=>U.depth-$.depth);for(let $ of R){let U=[],X=pt=>{if(pt.children)for(let ht of pt.children)U.push(ht),X(ht)};if(X($),U.length===0)continue;let q=1/0,et=-1/0,tt=-1/0;for(let pt of U){let ht=N.get(pt.data.orgNode.id);if(ht)ht.minX<q&&(q=ht.minX),ht.maxX>et&&(et=ht.maxX),ht.maxY>tt&&(tt=ht.maxY);else if(pt.data.orgNode.id.startsWith("__stack_")){let dt=pt.data.orgNode.id.replace("__stack_","");if(p.get(dt))for(let yt of S){if(yt.orgNode.parentId!==dt)continue;let kt=yt.cx+A,Ot=yt.cy+C;kt-yt.width/2<q&&(q=kt-yt.width/2),kt+yt.width/2>et&&(et=kt+yt.width/2),Ot+yt.height>tt&&(tt=Ot+yt.height)}}else{let dt=pt.data.width,ut=pt.data.height,yt=pt.x+A,kt=pt.y+C;yt-dt/2<q&&(q=yt-dt/2),yt+dt/2>et&&(et=yt+dt/2),kt+ut>tt&&(tt=kt+ut)}}let F=$.x+A,Q=$.y+C,ot=Object.keys($.data.orgNode.metadata).length,Z=RE+ot*IE,lt=Q,nt=tt-Q+GI,J=q-jh,at=et-q+jh*2,it=Math.max(at,$.data.width),vt=it>at?F-it/2:J;N.set($.data.orgNode.id,{minX:vt,maxX:vt+it,minY:lt,maxY:lt+nt});let Tt=e?.get($.data.orgNode.id),At=gf($.data.orgNode.metadata,r),rt=qh($.data.orgNode,t.tagGroups,n??null);_.push({nodeId:$.data.orgNode.id,label:$.data.orgNode.label,lineNumber:$.data.orgNode.lineNumber,...rt!==void 0&&{color:rt},metadata:At,tagMetadata:{...$.data.orgNode.metadata},x:vt,y:lt,width:it,height:nt,labelHeight:Z,...Tt!==void 0&&{hiddenCount:Tt},hasChildren:!0})}_.reverse();let G=b,I=E,H=L;for(let $ of _){let U=$.x-A,X=U+$.width,q=$.y-C+$.height;U<G&&(G=U),X>I&&(I=X),q>H&&(H=q)}let O=I-G+Ja*2,D=H-x+Ja*2,W=new Map;for(let $ of t.tagGroups){let U=qt($.name),X=new Set,q=et=>{!et.isContainer&&et.metadata[U]&&X.add(et.metadata[U].toLowerCase());for(let tt of et.children)q(tt)};for(let et of t.roots)q(et);W.set(U,X)}let z=r!==void 0,P=HI(t.tagGroups,z,W),B=O,Y=D,V=n!=null?P.filter($=>$.name.toLowerCase()===n.toLowerCase()):P,j=o&&n==null,K=$=>n!=null||j?$.width:$.minifiedWidth;if(V.length>0){let $=Se+Wn;for(let et of v)et.y+=$;for(let et of _)et.y+=$;for(let et of y)for(let tt of et.points)tt.y+=$;let U=V.reduce((et,tt)=>et+K(tt),0)+(V.length-1)*Wn,X=Ja;for(let et of V)et.x=X,et.y=Ja,X+=K(et)+Wn;Y+=$;let q=U+Ja*2;q>B&&(B=q)}return{nodes:v,edges:y,containers:_,legend:P,width:B,height:Y}}var wj,Ej,Sj,PI,vj,kj,DI,Lj,OI,AE,Ja,jh,GI,RE,IE,$I,DE=st(()=>{"use strict";Ke();Xh();Ke();Mr();en();wj=13,Ej=11,Sj=16,PI=28,vj=6,kj=20,DI=10,Lj=140,OI=30,AE=50,Ja=40,jh=24,GI=24,RE=28,IE=16,$I=20});function zI(t,e){let n=0;for(let r of e.getChildren(t))n+=(e.countsAsHidden(r)?1:0)+zI(r,e);return n}function VI(t,e,n,r){for(let o of t){let a=r.getChildren(o);e.has(r.getId(o))&&a.length>0&&n.set(r.getId(o),zI(o,r)),VI(a,e,n,r)}}function UI(t,e,n){for(let r of n.getChildren(t))UI(r,e,n);e.has(n.getId(t))&&n.getChildren(t).length>0&&n.setChildren(t,[])}function sd(t,e,n){let r=new Map;VI(t,e,r,n);let o=t.map(a=>n.clone(a));for(let a of o)UI(a,e,n);return{roots:o,hiddenCounts:r}}function XI(t,e){let n=new Set,r=o=>{for(let a of o)n.add(e.getId(a)),r(e.getChildren(a))};return r(t),n}var yf=st(()=>{"use strict"});var qI={};ye(qI,{collapseOrgTree:()=>_j,focusOrgTree:()=>Aj});function Zh(t){return{id:t.id,label:t.label,metadata:{...t.metadata},children:t.children.map(Zh),parentId:t.parentId,isContainer:t.isContainer,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color}}}function _j(t,e){if(e.size===0)return{parsed:t,hiddenCounts:new Map};let{roots:n,hiddenCounts:r}=sd(t.roots,e,Cj);return{parsed:{...t,roots:n},hiddenCounts:r}}function jI(t,e,n){for(let r of t){if(r.id===e)return{node:r,path:n};let o=jI(r.children,e,[...n,{id:r.id,label:r.label,lineNumber:r.lineNumber,...r.color!==void 0&&{color:r.color},metadata:{...r.metadata},isContainer:r.isContainer}]);if(o)return o}return null}function Aj(t,e){let n=jI(t.roots,e,[]);if(!n)return null;if(t.roots.some(a=>a.id===e))return{parsed:{...t,roots:[Zh(n.node)]},ancestorPath:[]};let o=Zh(n.node);return o.parentId=null,{parsed:{...t,roots:[o]},ancestorPath:n.path}}var Cj,KI=st(()=>{"use strict";yf();Cj={getId:t=>t.id,getChildren:t=>t.children,clone:Zh,setChildren:(t,e)=>{t.children=e},countsAsHidden:t=>!t.isContainer}});function ld(t,e,n){let r=document.createElement("div");r.style.width=`${t}px`,r.style.height=`${e}px`,r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);try{return n(r)}finally{document.body.removeChild(r)}}function cd(t,e){let n=t.querySelector("svg");return n?(e==="transparent"&&(n.style.background="none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.style.fontFamily=It,n.querySelectorAll("[data-export-ignore]").forEach(r=>r.remove()),n.outerHTML):""}var Qh=st(()=>{"use strict";on()});var nP={};ye(nP,{renderOrg:()=>eP,renderOrgForExport:()=>Yj});function Bj(t,e,n,r){let o=n??t.primary;return ie(t,o,e,{...r!==void 0&&{solid:r}})}function ZI(t,e){return e??t.primary}function Fj(t,e,n){return n?Gt(n,nr(t,e),10):Gt(t.surface,t.bg,40)}function QI(t,e){return e??t.textMuted}function eP(t,e,n,r,o,a,i,s,l,c,d){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let u=i?.width??t.clientWidth,f=i?.height??t.clientHeight;if(u<=0||f<=0)return;let p=Ee.identity(),m=p.aesthetic(OE),h=p.structural(tP),g=p.text(13),v=p.text(11),y=p.structural(16),b=p.structural(28),E=p.structural(6),x=p.structural(1.5),L=p.structural(1.5),S=p.structural(6),A=p.structural(8),C=p.text(13),M=p.text(11),w=p.structural(16),k=p.structural(28),N=p.structural(6),_=p.structural(0),T=p.structural(Oj),R=p.text(Gj),G=p.structural($j),I=p.structural(Hj),H=p.aesthetic(Wj),O=!!e.title&&e.options["no-title"]!=="on",D=O?h:0,W=n.nodes.length===0,z=n.legend.length>0,P=Se+Wn,B=!i&&z&&!W,Y=B?Tr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview",capsulePillAddonWidth:Mo+wi},u)+H:0,V=!i&&O,j=V?h:0,K=!i&&c&&c.length>0,$=K?c.length*G+I:0,U=n.width,X=n.height+(V?0:D)+$;B&&(X-=P);let q=f-m*2-Y-j,et=(u-m*2)/U,tt=q/X,F=Math.min(Dj,et,tt),Q=U*F,ot=(u-Q)/2,Z=B?m+Y+j:m+j,lt=Rt(t).append("svg").attr("width",u).attr("height",f).attr("viewBox",`0 0 ${u} ${f}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It);p.isBelowFloor&&lt.attr("width","100%");let nt=lt.append("g").attr("transform",`translate(${ot}, ${Z}) scale(${F})`);if(O){let rt=V?lt:nt,pt=V?u/2:U/2,ht=V?m+20:20,dt=rt.append("text").attr("x",pt).attr("y",ht).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",20).attr("font-weight","700").attr("class","org-title chart-title").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(dt.attr("data-line-number",e.titleLineNumber),a&&dt.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){Rt(this).attr("opacity",.7)}).on("mouseleave",function(){Rt(this).attr("opacity",1)}))}let J=(V?0:D)+$,at=nt.append("g").attr("transform",`translate(0, ${J})`),it=new Map;for(let rt of e.tagGroups)it.set(qt(rt.name),rt.name);let vt=new Set(e.roots.map(rt=>rt.id)),Tt=e.options?.color==="off";for(let rt of n.containers){let pt=at.append("g").attr("transform",`translate(${rt.x}, ${rt.y})`).attr("class","org-container").attr("data-line-number",String(rt.lineNumber));if(s){let yt=qt(s),kt=rt.tagMetadata[yt];kt&&pt.attr(`data-tag-${yt}`,kt.toLowerCase())}rt.hasChildren&&pt.attr("data-node-toggle",rt.nodeId).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!rt.hiddenCount)).attr("aria-label",rt.label),a&&pt.style("cursor","pointer").on("click",()=>{a(rt.lineNumber)});let ht=Fj(r,o,Tt?void 0:rt.color),dt=QI(r,Tt?void 0:rt.color);pt.append("rect").attr("x",0).attr("y",0).attr("width",rt.width).attr("height",rt.height).attr("rx",A).attr("fill",ht).attr("stroke",dt).attr("stroke-opacity",.35).attr("stroke-width",L),pt.append("text").attr("x",rt.width/2).attr("y",k/2+C/2-2).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",C).attr("font-weight","bold").text(rt.label);let ut=Object.entries(rt.metadata);if(ut.length>0){let yt=ut.map(([bt])=>it.get(bt)??bt),Ot=10+Math.max(...yt.map(bt=>_t(`${bt}: `,M))),Xt=k+M-2;for(let bt=0;bt<ut.length;bt++){let[,Nt]=ut[bt],Vt=yt[bt],xt=Xt+bt*w;pt.append("text").attr("x",10).attr("y",xt).attr("fill",r.textMuted).attr("font-size",M).text(`${Vt}: `),pt.append("text").attr("x",Ot).attr("y",xt).attr("fill",r.text).attr("font-size",M).text(Nt)}}if(!i&&rt.hiddenCount&&rt.hiddenCount>0&&lE(pt,{width:rt.width,height:rt.height,barHeight:N,inset:_,rx:A,fill:QI(r,Tt?void 0:rt.color),clipId:`clip-${rt.nodeId}`,className:"org-collapse-bar"}),!i&&rt.hasChildren&&!vt.has(rt.nodeId)){let Ot=rt.width-14-5,bt=pt.append("g").attr("class","org-focus-icon").attr("data-focus-node",rt.nodeId).attr("data-export-ignore","true").attr("transform",`translate(${Ot}, 5)`);bt.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let Nt=ve(ht,r.textOnFillLight,r.textOnFillDark),Vt=14/2,xt=14/2;bt.append("circle").attr("cx",Vt).attr("cy",xt).attr("r",14/2-1).attr("fill","none").attr("stroke",Nt).attr("stroke-width",1.5),bt.append("circle").attr("cx",Vt).attr("cy",xt).attr("r",2).attr("fill",Nt)}}for(let rt of n.edges){if(rt.points.length<2)continue;let pt=[];pt.push(`M ${rt.points[0].x} ${rt.points[0].y}`);for(let ht=1;ht<rt.points.length;ht++)pt.push(`L ${rt.points[ht].x} ${rt.points[ht].y}`);at.append("path").attr("d",pt.join(" ")).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",x).attr("class","org-edge").attr("data-from",rt.sourceId).attr("data-to",rt.targetId)}let At=new Set(n.containers.map(rt=>rt.nodeId));for(let rt of n.nodes){if(At.has(rt.id))continue;let pt=at.append("g").attr("transform",`translate(${rt.x-rt.width/2}, ${rt.y})`).attr("class","org-node").attr("data-line-number",String(rt.lineNumber)).attr("data-node-id",rt.id);if(s){let Ot=qt(s),Xt=rt.tagMetadata[Ot];Xt&&pt.attr(`data-tag-${Ot}`,Xt.toLowerCase())}rt.hasChildren&&pt.attr("data-node-toggle",rt.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!rt.hiddenCount)).attr("aria-label",rt.label),a&&pt.style("cursor","pointer").on("click",()=>{a(rt.lineNumber)});let ht=e.options["solid-fill"]==="on",dt=Bj(r,o,Tt?void 0:rt.color,ht),ut=ZI(r,Tt?void 0:rt.color),yt=ve(dt,r.textOnFillLight,r.textOnFillDark),kt=Object.entries(rt.metadata);if(rd(pt,{width:rt.width,height:rt.height,rx:S,fill:dt,stroke:ut,strokeWidth:L,...rt.isContainer&&{dashed:!0},label:rt.label,labelColor:yt,labelFontSize:g,headerHeight:b,...kt.length>0&&{meta:{rows:kt.map(([Ot,Xt])=>[it.get(Ot)??Ot,Xt]),fontSize:v,lineHeight:y,separatorGap:E,separatorColor:ht?yt:ut,textColor:yt}}}),!i&&rt.hiddenCount&&rt.hiddenCount>0&&lE(pt,{width:rt.width,height:rt.height,barHeight:N,inset:_,rx:S,fill:ht?yt:ZI(r,Tt?void 0:rt.color),clipId:`clip-${rt.id}`,className:"org-collapse-bar"}),!i&&rt.hasChildren&&!vt.has(rt.id)){let bt=rt.width-14-5,Vt=pt.append("g").attr("class","org-focus-icon").attr("data-focus-node",rt.id).attr("data-export-ignore","true").attr("transform",`translate(${bt}, 5)`);Vt.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let xt=yt,Lt=14/2,Dt=14/2;Vt.append("circle").attr("cx",Lt).attr("cy",Dt).attr("r",14/2-1).attr("fill","none").attr("stroke",xt).attr("stroke-width",1.5),Vt.append("circle").attr("cx",Lt).attr("cy",Dt).attr("r",2).attr("fill",xt)}}if(K){let rt=n.nodes.find(ut=>vt.has(ut.id)),pt=rt?null:n.containers.find(ut=>vt.has(ut.nodeId)),ht=rt?rt.x:pt?pt.x+pt.width/2:null,dt=rt?rt.y:pt?pt.y:null;if(ht!==null&&dt!==null){let ut=dt-I,yt=at.append("g").attr("class","org-ancestor-trail"),kt=c.length,Ot=[];for(let bt=0;bt<kt;bt++){let Nt=kt-1-bt;Ot.push(ut-Nt*G)}let Xt=Ot[0];yt.append("line").attr("x1",ht).attr("y1",Xt).attr("x2",ht).attr("y2",dt).attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-opacity",.4);for(let bt=0;bt<kt;bt++){let Nt=c[bt],Vt=Ot[bt],Lt=Nt.color??ar(Nt.metadata,[...e.tagGroups],s??null,Nt.isContainer)??r.textMuted,Dt=yt.append("g").attr("class","org-ancestor-node").attr("data-focus-ancestor",Nt.id).style("cursor","pointer").attr("transform",`translate(${ht}, ${Vt})`);Dt.append("rect").attr("x",-T-2).attr("y",-T-2).attr("width",120).attr("height",T*2+4).attr("fill","transparent"),Dt.append("circle").attr("cx",0).attr("cy",0).attr("r",T).attr("fill",Lt),Dt.append("text").attr("x",T+6).attr("y",R*.35).attr("fill",r.textMuted).attr("font-size",R).text(Nt.label),Dt.on("mouseenter",function(){Rt(this).select("circle").attr("r",T+1),Rt(this).select("text").attr("fill",r.text)}).on("mouseleave",function(){Rt(this).select("circle").attr("r",T),Rt(this).select("text").attr("fill",r.textMuted)})}}}if(B||W||i&&z){let rt=n.legend.map(ut=>({name:ut.name,entries:ut.entries.map(yt=>({value:yt.value,color:yt.color}))})),pt=B?Mo+wi:0,ht=B?lt.append("g").attr("class","org-legend-fixed").attr("transform",`translate(0, ${m+j})`):at.append("g"),dt;if(W){for(let ut of n.legend){let yt={groups:[{name:ut.name,entries:ut.entries.map(Ot=>({value:Ot.value,color:Ot.color}))}],position:{placement:"top-center",titleRelation:"below-title"},mode:d?"export":"preview"},kt=ht.append("g").attr("transform",`translate(${ut.x}, ${ut.y})`);fn(kt,{...yt,palette:r,isDark:o,width:ut.width,activeGroup:ut.name}),kt.selectAll("[data-legend-group]").classed("org-legend-group",!0)}dt=null}else dt=fn(ht,{...{groups:rt,position:{placement:"top-center",titleRelation:"below-title"},mode:d?"export":"preview",capsulePillAddonWidth:pt},palette:r,isDark:o,width:B?u:n.width,activeGroup:s??null}),ht.selectAll("[data-legend-group]").classed("org-legend-group",!0);if(B&&dt){let ut=dt.getLayout();if(ut.activeCapsule?.addonX!=null){let yt=ut.activeCapsule,kt=qt(yt.groupName),Ot=l?.has(kt)??!1,Xt=ht.select(`[data-legend-group="${kt}"]`);if(!Xt.empty()){let bt=yt.addonX,Nt=(Se-Mo)/2,Vt=6,xt=Xt.append("g").attr("class","org-legend-eye").attr("data-legend-visibility",kt).style("cursor","pointer").attr("opacity",Ot?.4:.7);xt.append("rect").attr("x",bt-Vt).attr("y",Nt-Vt).attr("width",Mo+Vt*2).attr("height",Mo+Vt*2).attr("fill","transparent").attr("pointer-events","all"),xt.append("path").attr("d",Ot?Dm:Pm).attr("transform",`translate(${bt}, ${Nt})`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.2).attr("stroke-linecap","round").attr("stroke-linejoin","round")}}}}}function Yj(t,e,n){let r=zc(t,n);if(r.error)return"";let o=r.options?.hide,a=o?new Set(o.split(",").map(u=>u.trim().toLowerCase())):void 0,i=PE(r,void 0,void 0,a),s=e==="dark",l=r.title&&r.options["no-title"]!=="on"?tP:0,c=i.width+OE*2,d=i.height+OE*2+l;return ld(c,d,u=>(eP(u,r,i,n,s,void 0,{width:c,height:d}),cd(u,e)))}var OE,Dj,tP,Oj,Gj,$j,Hj,Wj,rP=st(()=>{"use strict";Ke();Xn();on();Qh();fr();tn();Ke();Qu();DE();Mr();Br();Oh();en();To();OE=20,Dj=3,tP=30,Oj=4,Gj=11,$j=22,Hj=16,Wj=8});function oP(t,e){t[e]?t[e]++:t[e]=1}function aP(t,e){t[e]!==void 0&&!--t[e]&&delete t[e]}function bf(t,e,n,r){let o=""+e,a=""+n;if(!t&&o>a){let i=o;o=a,a=i}return o+""+a+""+(r===void 0?"\0":r)}function jj(t,e,n,r){let o=""+e,a=""+n;if(!t&&o>a){let s=o;o=a,a=s}let i={v:o,w:a};return r&&(i.name=r),i}function HE(t,e){return bf(t,e.v,e.w,e.name)}function Kj(t){let e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Zj(t),edges:Qj(t)},n=t.graph();return n!==void 0&&(e.value=structuredClone(n)),e}function Zj(t){return t.nodes().map(e=>{let n=t.node(e),r=t.parent(e),o={v:e};return n!==void 0&&(o.value=n),r!==void 0&&(o.parent=r),o})}function Qj(t){return t.edges().map(e=>{let n=t.edge(e),r={v:e.v,w:e.w};return e.name!==void 0&&(r.name=e.name),n!==void 0&&(r.value=n),r})}function Jj(t){let e=new La(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(n=>{e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),t.edges.forEach(n=>{e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}function EP(t,e,n,r){return eq(t,String(e),n||tq,r||function(o){return t.outEdges(o)})}function eq(t,e,n,r){let o={},a,i=0,s=t.nodes(),l=function(u){let f=n(u);o[u.v].distance+f<o[u.w].distance&&(o[u.w]={distance:o[u.v].distance+f,predecessor:u.v},a=!0)},c=function(){s.forEach(function(u){r(u).forEach(function(f){let p=f.v===u?f.v:f.w,m=p===f.v?f.w:f.v;l({v:p,w:m})})})};s.forEach(function(u){let f=u===e?0:Number.POSITIVE_INFINITY;o[u]={distance:f,predecessor:""}});let d=s.length;for(let u=1;u<d&&(a=!1,i++,c(),!!a);u++);if(i===d-1&&(a=!1,c(),a))throw new Error("The graph contains a negative weight cycle");return o}function nq(t){let e={},n=[],r;function o(a){a in e||(e[a]=!0,r.push(a),t.successors(a).forEach(o),t.predecessors(a).forEach(o))}return t.nodes().forEach(function(a){r=[],o(a),r.length&&n.push(r)}),n}function tg(t,e,n,r){let o=function(a){return t.outEdges(a)};return oq(t,String(e),n||rq,r||o)}function oq(t,e,n,r){let o={},a=new SP,i,s,l=function(c){let d=c.v!==i?c.v:c.w,u=o[d],f=n(c),p=s.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+f);p<u.distance&&(u.distance=p,u.predecessor=i,a.decrease(d,p))};for(t.nodes().forEach(function(c){let d=c===e?0:Number.POSITIVE_INFINITY;o[c]={distance:d,predecessor:""},a.add(c,d)});a.size()>0&&(i=a.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(l);return o}function aq(t,e,n){return t.nodes().reduce(function(r,o){return r[o]=tg(t,o,e,n),r},{})}function vP(t){let e=0,n=[],r={},o=[];function a(i){let s=r[i]={onStack:!0,lowlink:e,index:e++};if(n.push(i),t.successors(i).forEach(function(l){l in r?r[l].onStack&&(s.lowlink=Math.min(s.lowlink,r[l].index)):(a(l),s.lowlink=Math.min(s.lowlink,r[l].lowlink))}),s.lowlink===s.index){let l=[],c;do c=n.pop(),r[c].onStack=!1,l.push(c);while(i!==c);o.push(l)}}return t.nodes().forEach(function(i){i in r||a(i)}),o}function iq(t){return vP(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}function lq(t,e,n){return cq(t,e||sq,n||function(r){return t.outEdges(r)})}function cq(t,e,n){let r={},o=t.nodes();return o.forEach(function(a){r[a]={},r[a][a]={distance:0,predecessor:""},o.forEach(function(i){a!==i&&(r[a][i]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(a).forEach(function(i){let s=i.v===a?i.w:i.v,l=e(i);r[a][s]={distance:l,predecessor:a}})}),o.forEach(function(a){let i=r[a];o.forEach(function(s){let l=r[s];o.forEach(function(c){let d=l[a],u=i[c],f=l[c],p=d.distance+u.distance;p<f.distance&&(f.distance=p,f.predecessor=u.predecessor)})})}),r}function kP(t){let e={},n={},r=[];function o(a){if(a in n)throw new eg;a in e||(n[a]=!0,e[a]=!0,t.predecessors(a).forEach(o),delete n[a],r.push(a))}if(t.sinks().forEach(o),Object.keys(e).length!==t.nodeCount())throw new eg;return r}function dq(t){try{kP(t)}catch(e){if(e instanceof eg)return!1;throw e}return!0}function uq(t,e,n,r,o){Array.isArray(e)||(e=[e]);let a=(s=>{var l;return(l=t.isDirected()?t.successors(s):t.neighbors(s))!=null?l:[]}),i={};return e.forEach(function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);o=LP(t,s,n==="post",i,a,r,o)}),o}function LP(t,e,n,r,o,a,i){return e in r||(r[e]=!0,n||(i=a(i,e)),o(e).forEach(function(s){i=LP(t,s,n,r,o,a,i)}),n&&(i=a(i,e))),i}function NP(t,e,n){return uq(t,e,n,function(r,o){return r.push(o),r},[])}function fq(t,e){return NP(t,e,"post")}function pq(t,e){return NP(t,e,"pre")}function mq(t,e){let n=new La,r={},o=new SP,a;function i(l){let c=l.v===a?l.w:l.v,d=o.priority(c);if(d!==void 0){let u=e(l);u<d&&(r[c]=a,o.decrease(c,u))}}if(t.nodeCount()===0)return n;t.nodes().forEach(function(l){o.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),o.decrease(t.nodes()[0],0);let s=!1;for(;o.size()>0;){if(a=o.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(a).forEach(i)}return n}function hq(t,e,n,r){return gq(t,e,n,r??(o=>{let a=t.outEdges(o);return a??[]}))}function gq(t,e,n,r){if(n===void 0)return tg(t,e,n,r);let o=!1,a=t.nodes();for(let i=0;i<a.length;i++){let s=r(a[i]);for(let l=0;l<s.length;l++){let c=s[l],d=c.v===a[i]?c.v:c.w,u=d===c.v?c.w:c.v;n({v:d,w:u})<0&&(o=!0)}if(o)return EP(t,e,n,r)}return tg(t,e,n,r)}function pd(t,e,n,r){let o=r;for(;t.hasNode(o);)o=XE(r);return n.dummy=e,t.setNode(o,n),o}function yq(t){let e=new La().setGraph(t.graph());return t.nodes().forEach(n=>e.setNode(n,t.node(n))),t.edges().forEach(n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),e}function MP(t){let e=new La({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(n=>{t.children(n).length||e.setNode(n,t.node(n))}),t.edges().forEach(n=>{e.setEdge(n,t.edge(n))}),e}function iP(t,e){let n=t.x,r=t.y,o=e.x-n,a=e.y-r,i=t.width/2,s=t.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(a)*i>Math.abs(o)*s?(a<0&&(s=-s),l=s*o/a,c=s):(o<0&&(i=-i),l=i,c=i*a/o),{x:n+l,y:r+c}}function wf(t){let e=xf(CP(t)+1).map(()=>[]);return t.nodes().forEach(n=>{let r=t.node(n),o=r.rank;o!==void 0&&(e[o]||(e[o]=[]),e[o][r.order]=n)}),e}function bq(t){let e=t.nodes().map(r=>{let o=t.node(r).rank;return o===void 0?Number.MAX_VALUE:o}),n=Ri(Math.min,e);t.nodes().forEach(r=>{let o=t.node(r);Object.hasOwn(o,"rank")&&(o.rank-=n)})}function xq(t){let e=t.nodes().map(i=>t.node(i).rank).filter(i=>i!==void 0),n=Ri(Math.min,e),r=[];t.nodes().forEach(i=>{let s=t.node(i).rank-n;r[s]||(r[s]=[]),r[s].push(i)});let o=0,a=t.graph().nodeRankFactor;Array.from(r).forEach((i,s)=>{i===void 0&&s%a!==0?--o:i!==void 0&&o&&i.forEach(l=>t.node(l).rank+=o)})}function sP(t,e,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),pd(t,"border",o,e)}function wq(t,e=TP){let n=[];for(let r=0;r<t.length;r+=e){let o=t.slice(r,r+e);n.push(o)}return n}function Ri(t,e){if(e.length>TP){let n=wq(e);return t(...n.map(r=>t(...r)))}else return t(...e)}function CP(t){let e=t.nodes().map(n=>{let r=t.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return Ri(Math.max,e)}function Eq(t,e){let n={lhs:[],rhs:[]};return t.forEach(r=>{e(r)?n.lhs.push(r):n.rhs.push(r)}),n}function _P(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}}function AP(t,e){return e()}function XE(t){let e=++Sq;return t+(""+e)}function xf(t,e,n=1){e==null&&(e=t,t=0);let r=a=>a<e;n<0&&(r=a=>e<a);let o=[];for(let a=t;r(a);a+=n)o.push(a);return o}function ng(t,e){let n={};for(let r of e)t[r]!==void 0&&(n[r]=t[r]);return n}function rg(t,e){let n;return typeof e=="string"?n=r=>r[e]:n=e,Object.entries(t).reduce((r,[o,a])=>(r[o]=n(a,o),r),{})}function vq(t,e){return t.reduce((n,r,o)=>(n[r]=e[o],n),{})}function lP(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Nq(t,e){if(t!=="_next"&&t!=="_prev")return e}function Cq(t,e){if(t.nodeCount()<=1)return[];let n=Aq(t,e||Tq);return _q(n.graph,n.buckets,n.zeroIdx).flatMap(r=>t.outEdges(r.v,r.w)||[])}function _q(t,e,n){var r;let o=[],a=e[e.length-1],i=e[0],s;for(;t.nodeCount();){for(;s=i.dequeue();)WE(t,e,n,s);for(;s=a.dequeue();)WE(t,e,n,s);if(t.nodeCount()){for(let l=e.length-2;l>0;--l)if(s=(r=e[l])==null?void 0:r.dequeue(),s){o=o.concat(WE(t,e,n,s,!0)||[]);break}}}return o}function WE(t,e,n,r,o){let a=[],i=o?a:void 0;return(t.inEdges(r.v)||[]).forEach(s=>{let l=t.edge(s),c=t.node(s.v);o&&a.push({v:s.v,w:s.w}),c.out-=l,VE(e,n,c)}),(t.outEdges(r.v)||[]).forEach(s=>{let l=t.edge(s),c=s.w,d=t.node(c);d.in-=l,VE(e,n,d)}),t.removeNode(r.v),i}function Aq(t,e){let n=new La,r=0,o=0;t.nodes().forEach(s=>{n.setNode(s,{v:s,in:0,out:0})}),t.edges().forEach(s=>{let l=n.edge(s.v,s.w)||0,c=e(s),d=l+c;n.setEdge(s.v,s.w,d);let u=n.node(s.v),f=n.node(s.w);o=Math.max(o,u.out+=c),r=Math.max(r,f.in+=c)});let a=Rq(o+r+3).map(()=>new Mq),i=r+1;return n.nodes().forEach(s=>{VE(a,i,n.node(s))}),{graph:n,buckets:a,zeroIdx:i}}function VE(t,e,n){var r,o,a;n.out?n.in?(a=t[n.out-n.in+e])==null||a.enqueue(n):(o=t[t.length-1])==null||o.enqueue(n):(r=t[0])==null||r.enqueue(n)}function Rq(t){let e=[];for(let n=0;n<t;n++)e.push(n);return e}function Iq(t){(t.graph().acyclicer==="greedy"?Cq(t,e(t)):Pq(t)).forEach(n=>{let r=t.edge(n);t.removeEdge(n),r.forwardName=n.name,r.reversed=!0,t.setEdge(n.w,n.v,r,XE("rev"))});function e(n){return r=>n.edge(r).weight}}function Pq(t){let e=[],n={},r={};function o(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,t.outEdges(a).forEach(i=>{Object.hasOwn(n,i.w)?e.push(i):o(i.w)}),delete n[a])}return t.nodes().forEach(o),e}function Dq(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}})}function Oq(t){t.graph().dummyChains=[],t.edges().forEach(e=>Gq(t,e))}function Gq(t,e){let n=e.v,r=t.node(n).rank,o=e.w,a=t.node(o).rank,i=e.name,s=t.edge(e),l=s.labelRank;if(a===r+1)return;t.removeEdge(e);let c,d,u;for(u=0,++r;r<a;++u,++r)s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},c=pd(t,"edge",d,"_d"),r===l&&(d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos),t.setEdge(n,c,{weight:s.weight},i),u===0&&t.graph().dummyChains.push(c),n=c;t.setEdge(n,o,{weight:s.weight},i)}function $q(t){t.graph().dummyChains.forEach(e=>{let n=t.node(e),r=n.edgeLabel,o;for(t.setEdge(n.edgeObj,r);n.dummy;)o=t.successors(e)[0],t.removeNode(e),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),e=o,n=t.node(e)})}function jE(t){let e={};function n(r){let o=t.node(r);if(Object.hasOwn(e,r))return o.rank;e[r]=!0;let a=t.outEdges(r),i=a?a.map(l=>l==null?Number.POSITIVE_INFINITY:n(l.w)-t.edge(l).minlen):[],s=Ri(Math.min,i);return s===Number.POSITIVE_INFINITY&&(s=0),o.rank=s}t.sources().forEach(n)}function fd(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function Hq(t){let e=new La({directed:!1}),n=t.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let r=n[0],o=t.nodeCount();e.setNode(r,{});let a,i;for(;Wq(e,t)<o&&(a=Bq(e,t),!!a);)i=e.hasNode(a.v)?fd(t,a):-fd(t,a),Fq(e,t,i);return e}function Wq(t,e){function n(r){let o=e.nodeEdges(r);o&&o.forEach(a=>{let i=a.v,s=r===i?a.w:i;!t.hasNode(s)&&!fd(e,a)&&(t.setNode(s,{}),t.setEdge(r,s,{}),n(s))})}return t.nodes().forEach(n),t.nodeCount()}function Bq(t,e){return e.edges().reduce((n,r)=>{let o=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(o=fd(e,r)),o<n[0]?[o,r]:n},[Number.POSITIVE_INFINITY,null])[1]}function Fq(t,e,n){t.nodes().forEach(r=>e.node(r).rank+=n)}function zl(t){t=yq(t),jE(t);let e=RP(t);KE(e),qE(e,t);let n,r;for(;n=DP(e);)r=OP(e,t,n),GP(e,t,n,r)}function qE(t,e){let n=zq(t,t.nodes());n=n.slice(0,n.length-1),n.forEach(r=>Uq(t,e,r))}function Uq(t,e,n){let r=t.node(n).parent,o=t.edge(n,r);o.cutvalue=IP(t,e,n)}function IP(t,e,n){let r=t.node(n).parent,o=!0,a=e.edge(n,r),i=0;a||(o=!1,a=e.edge(r,n)),i=a.weight;let s=e.nodeEdges(n);return s&&s.forEach(l=>{let c=l.v===n,d=c?l.w:l.v;if(d!==r){let u=c===o,f=e.edge(l).weight;if(i+=u?f:-f,jq(t,n,d)){let p=t.edge(n,d).cutvalue;i+=u?-p:p}}}),i}function KE(t,e){arguments.length<2&&(e=t.nodes()[0]),PP(t,{},1,e)}function PP(t,e,n,r,o){let a=n,i=t.node(r);e[r]=!0;let s=t.neighbors(r);return s&&s.forEach(l=>{Object.hasOwn(e,l)||(n=PP(t,e,n,l,r))}),i.low=a,i.lim=n++,o?i.parent=o:delete i.parent,n}function DP(t){return t.edges().find(e=>t.edge(e).cutvalue<0)}function OP(t,e,n){let r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);let a=t.node(r),i=t.node(o),s=a,l=!1;return a.lim>i.lim&&(s=i,l=!0),e.edges().filter(c=>l===cP(t,t.node(c.v),s)&&l!==cP(t,t.node(c.w),s)).reduce((c,d)=>fd(e,d)<fd(e,c)?d:c)}function GP(t,e,n,r){let o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(r.v,r.w,{}),KE(t),qE(t,e),Xq(t,e)}function Xq(t,e){let n=t.nodes().find(o=>!t.node(o).parent);if(!n)return;let r=Yq(t,[n]);r=r.slice(1),r.forEach(o=>{let a=t.node(o).parent,i=e.edge(o,a),s=!1;i||(i=e.edge(a,o),s=!0),e.node(o).rank=e.node(a).rank+(s?i.minlen:-i.minlen)})}function jq(t,e,n){return t.hasEdge(e,n)}function cP(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Kq(t){let e=t.graph().ranker;if(typeof e=="function")return e(t);switch(e){case"network-simplex":dP(t);break;case"tight-tree":Qq(t);break;case"longest-path":Zq(t);break;case"none":break;default:dP(t)}}function Qq(t){jE(t),RP(t)}function dP(t){Vq(t)}function tK(t){let e=nK(t);t.graph().dummyChains.forEach(n=>{let r=t.node(n),o=r.edgeObj,a=eK(t,e,o.v,o.w),i=a.path,s=a.lca,l=0,c=i[l],d=!0;for(;n!==o.w;){if(r=t.node(n),d){for(;(c=i[l])!==s&&t.node(c).maxRank<r.rank;)l++;c===s&&(d=!1)}if(!d){for(;l<i.length-1&&t.node(i[l+1]).minRank<=r.rank;)l++;c=i[l]}c!==void 0&&t.setParent(n,c),n=t.successors(n)[0]}})}function eK(t,e,n,r){let o=[],a=[],i=Math.min(e[n].low,e[r].low),s=Math.max(e[n].lim,e[r].lim),l;l=n;do l=t.parent(l),o.push(l);while(l&&(e[l].low>i||s>e[l].lim));let c=l,d=r;for(;(d=t.parent(d))!==c;)a.push(d);return{path:o.concat(a.reverse()),lca:c}}function nK(t){let e={},n=0;function r(o){let a=n;t.children(o).forEach(r),e[o]={low:a,lim:n++}}return t.children(og).forEach(r),e}function rK(t){let e=pd(t,"root",{},"_root"),n=oK(t),r=Object.values(n),o=Ri(Math.max,r)-1,a=2*o+1;t.graph().nestingRoot=e,t.edges().forEach(s=>t.edge(s).minlen*=a);let i=aK(t)+1;t.children(og).forEach(s=>$P(t,e,a,i,o,n,s)),t.graph().nodeRankFactor=a}function $P(t,e,n,r,o,a,i){var s;let l=t.children(i);if(!l.length){i!==e&&t.setEdge(e,i,{weight:0,minlen:n});return}let c=sP(t,"_bt"),d=sP(t,"_bb"),u=t.node(i);t.setParent(c,i),u.borderTop=c,t.setParent(d,i),u.borderBottom=d,l.forEach(f=>{var p;$P(t,e,n,r,o,a,f);let m=t.node(f),h=m.borderTop?m.borderTop:f,g=m.borderBottom?m.borderBottom:f,v=m.borderTop?r:2*r,y=h!==g?1:o-((p=a[i])!=null?p:0)+1;t.setEdge(c,h,{weight:v,minlen:y,nestingEdge:!0}),t.setEdge(g,d,{weight:v,minlen:y,nestingEdge:!0})}),t.parent(i)||t.setEdge(e,c,{weight:0,minlen:o+((s=a[i])!=null?s:0)})}function oK(t){let e={};function n(r,o){let a=t.children(r);a&&a.length&&a.forEach(i=>n(i,o+1)),e[r]=o}return t.children(og).forEach(r=>n(r,1)),e}function aK(t){return t.edges().reduce((e,n)=>e+t.edge(n).weight,0)}function iK(t){let e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(n=>{t.edge(n).nestingEdge&&t.removeEdge(n)})}function lK(t){function e(n){let r=t.children(n),o=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let a=o.minRank,i=o.maxRank+1;a<i;++a)uP(t,"borderLeft","_bl",n,o,a),uP(t,"borderRight","_br",n,o,a)}}t.children(og).forEach(e)}function uP(t,e,n,r,o,a){let i={width:0,height:0,rank:a,borderType:e},s=o[e][a-1],l=pd(t,"border",i,n);o[e][a]=l,t.setParent(l,r),s&&t.setEdge(s,l,{weight:1})}function cK(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="lr"||n==="rl")&&HP(t)}function dK(t){var e;let n=(e=t.graph().rankdir)==null?void 0:e.toLowerCase();(n==="bt"||n==="rl")&&uK(t),(n==="lr"||n==="rl")&&(fK(t),HP(t))}function HP(t){t.nodes().forEach(e=>fP(t.node(e))),t.edges().forEach(e=>fP(t.edge(e)))}function fP(t){let e=t.width;t.width=t.height,t.height=e}function uK(t){t.nodes().forEach(e=>BE(t.node(e))),t.edges().forEach(e=>{var n;let r=t.edge(e);(n=r.points)==null||n.forEach(BE),Object.hasOwn(r,"y")&&BE(r)})}function BE(t){t.y=-t.y}function fK(t){t.nodes().forEach(e=>FE(t.node(e))),t.edges().forEach(e=>{var n;let r=t.edge(e);(n=r.points)==null||n.forEach(FE),Object.hasOwn(r,"x")&&FE(r)})}function FE(t){let e=t.x;t.x=t.y,t.y=e}function pK(t){let e={},n=t.nodes().filter(s=>!t.children(s).length),r=n.map(s=>t.node(s).rank),o=Ri(Math.max,r),a=xf(o+1).map(()=>[]);function i(s){if(e[s])return;e[s]=!0;let l=t.node(s);a[l.rank].push(s);let c=t.successors(s);c&&c.forEach(i)}return n.sort((s,l)=>t.node(s).rank-t.node(l).rank).forEach(i),a}function mK(t,e){let n=0;for(let r=1;r<e.length;++r)n+=hK(t,e[r-1],e[r]);return n}function hK(t,e,n){let r=vq(n,n.map((c,d)=>d)),o=e.flatMap(c=>{let d=t.outEdges(c);return d?d.map(u=>({pos:r[u.w],weight:t.edge(u).weight})).sort((u,f)=>u.pos-f.pos):[]}),a=1;for(;a<n.length;)a<<=1;let i=2*a-1;a-=1;let s=new Array(i).fill(0),l=0;return o.forEach(c=>{let d=c.pos+a;s[d]+=c.weight;let u=0;for(;d>0;)d%2&&(u+=s[d+1]),d=d-1>>1,s[d]+=c.weight;l+=c.weight*u}),l}function gK(t,e=[]){return e.map(n=>{let r=t.inEdges(n);if(!r||!r.length)return{v:n};{let o=r.reduce((a,i)=>{let s=t.edge(i),l=t.node(i.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}})}function yK(t,e){let n={};t.forEach((o,a)=>{let i={indegree:0,in:[],out:[],vs:[o.v],i:a};o.barycenter!==void 0&&(i.barycenter=o.barycenter,i.weight=o.weight),n[o.v]=i}),e.edges().forEach(o=>{let a=n[o.v],i=n[o.w];a!==void 0&&i!==void 0&&(i.indegree++,a.out.push(i))});let r=Object.values(n).filter(o=>!o.indegree);return bK(r)}function bK(t){let e=[];function n(o){return a=>{a.merged||(a.barycenter===void 0||o.barycenter===void 0||a.barycenter>=o.barycenter)&&xK(o,a)}}function r(o){return a=>{a.in.push(o),--a.indegree===0&&t.push(a)}}for(;t.length;){let o=t.pop();e.push(o),o.in.reverse().forEach(n(o)),o.out.forEach(r(o))}return e.filter(o=>!o.merged).map(o=>ng(o,["vs","i","barycenter","weight"]))}function xK(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}function wK(t,e){let n=Eq(t,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,o=n.rhs.sort((d,u)=>u.i-d.i),a=[],i=0,s=0,l=0;r.sort(EK(!!e)),l=pP(a,o,l),r.forEach(d=>{l+=d.vs.length,a.push(d.vs),i+=d.barycenter*d.weight,s+=d.weight,l=pP(a,o,l)});let c={vs:a.flat(1)};return s&&(c.barycenter=i/s,c.weight=s),c}function pP(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}function EK(t){return(e,n)=>e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i}function WP(t,e,n,r){let o=t.children(e),a=t.node(e),i=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};i&&(o=o.filter(f=>f!==i&&f!==s));let c=gK(t,o);c.forEach(f=>{if(t.children(f.v).length){let p=WP(t,f.v,n,r);l[f.v]=p,Object.hasOwn(p,"barycenter")&&vK(f,p)}});let d=yK(c,n);SK(d,l);let u=wK(d,r);if(i&&s){u.vs=[i,u.vs,s].flat(1);let f=t.predecessors(i);if(f&&f.length){let p=t.node(f[0]),m=t.predecessors(s),h=t.node(m[0]);Object.hasOwn(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+p.order+h.order)/(u.weight+2),u.weight+=2}}return u}function SK(t,e){t.forEach(n=>{n.vs=n.vs.flatMap(r=>e[r]?e[r].vs:r)})}function vK(t,e){t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)}function kK(t,e,n,r){r||(r=t.nodes());let o=LK(t),a=new La({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>t.node(i));return r.forEach(i=>{let s=t.node(i),l=t.parent(i);if(s.rank===e||s.minRank<=e&&e<=s.maxRank){a.setNode(i),a.setParent(i,l||o);let c=t[n](i);c&&c.forEach(d=>{let u=d.v===i?d.w:d.v,f=a.edge(u,i),p=f!==void 0?f.weight:0;a.setEdge(u,i,{weight:t.edge(d).weight+p})}),Object.hasOwn(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]})}}),a}function LK(t){let e;for(;t.hasNode(e=XE("_root")););return e}function NK(t,e,n){let r={},o;n.forEach(a=>{let i=t.parent(a),s,l;for(;i;){if(s=t.parent(i),s?(l=r[s],r[s]=i):(l=o,o=i),l&&l!==i){e.setEdge(l,i);return}i=s}})}function BP(t,e={}){if(typeof e.customOrder=="function"){e.customOrder(t,BP);return}let n=CP(t),r=mP(t,xf(1,n+1),"inEdges"),o=mP(t,xf(n-1,-1,-1),"outEdges"),a=pK(t);if(hP(t,a),e.disableOptimalOrderHeuristic)return;let i=Number.POSITIVE_INFINITY,s,l=e.constraints||[];for(let c=0,d=0;d<4;++c,++d){MK(c%2?r:o,c%4>=2,l),a=wf(t);let u=mK(t,a);u<i?(d=0,s=Object.assign({},a),i=u):u===i&&(s=structuredClone(a))}hP(t,s)}function mP(t,e,n){let r=new Map,o=(a,i)=>{r.has(a)||r.set(a,[]),r.get(a).push(i)};for(let a of t.nodes()){let i=t.node(a);if(typeof i.rank=="number"&&o(i.rank,a),typeof i.minRank=="number"&&typeof i.maxRank=="number")for(let s=i.minRank;s<=i.maxRank;s++)s!==i.rank&&o(s,a)}return e.map(function(a){return kK(t,a,n,r.get(a)||[])})}function MK(t,e,n){let r=new La;t.forEach(function(o){n.forEach(s=>r.setEdge(s.left,s.right));let a=o.graph().root,i=WP(o,a,r,e);i.vs.forEach((s,l)=>o.node(s).order=l),NK(o,r,i.vs)})}function hP(t,e){Object.values(e).forEach(n=>n.forEach((r,o)=>t.node(r).order=o))}function TK(t,e){let n={};function r(o,a){let i=0,s=0,l=o.length,c=a[a.length-1];return a.forEach((d,u)=>{let f=_K(t,d),p=f?t.node(f).order:l;(f||d===c)&&(a.slice(s,u+1).forEach(m=>{let h=t.predecessors(m);h&&h.forEach(g=>{let v=t.node(g),y=v.order;(y<i||p<y)&&!(v.dummy&&t.node(m).dummy)&&FP(n,g,m)})}),s=u+1,i=p)}),a}return e.length&&e.reduce(r),n}function CK(t,e){let n={};function r(a,i,s,l,c){xf(i,s).forEach(d=>{let u=a[d];if(u!==void 0&&t.node(u).dummy){let f=t.predecessors(u);f&&f.forEach(p=>{if(p===void 0)return;let m=t.node(p);m.dummy&&(m.order<l||m.order>c)&&FP(n,p,u)})}})}function o(a,i){let s=-1,l=-1,c=0;return i.forEach((d,u)=>{if(t.node(d).dummy==="border"){let f=t.predecessors(d);if(f&&f.length){let p=f[0];if(p===void 0)return;l=t.node(p).order,r(i,c,u,s,l),c=u,s=l}}r(i,c,i.length,l,a.length)}),i}return e.length&&e.reduce(o),n}function _K(t,e){if(t.node(e).dummy){let n=t.predecessors(e);if(n)return n.find(r=>t.node(r).dummy)}}function FP(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];r||(t[e]=r={}),r[n]=!0}function AK(t,e,n){if(e>n){let o=e;e=n,n=o}let r=t[e];return r!==void 0&&Object.hasOwn(r,n)}function RK(t,e,n,r){let o={},a={},i={};return e.forEach(s=>{s.forEach((l,c)=>{o[l]=l,a[l]=l,i[l]=c})}),e.forEach(s=>{let l=-1;s.forEach(c=>{let d=r(c);if(d&&d.length){let u=d.sort((p,m)=>{let h=i[p],g=i[m];return(h!==void 0?h:0)-(g!==void 0?g:0)}),f=(u.length-1)/2;for(let p=Math.floor(f),m=Math.ceil(f);p<=m;++p){let h=u[p];if(h===void 0)continue;let g=i[h];if(g!==void 0&&a[c]===c&&l<g&&!AK(n,c,h)){let v=o[h];v!==void 0&&(a[h]=c,a[c]=o[c]=v,l=g)}}}})}),{root:o,align:a}}function IK(t,e,n,r,o=!1){let a={},i=PK(t,e,n,o),s=o?"borderLeft":"borderRight";function l(p,m){let h=i.nodes().slice(),g={},v=h.pop();for(;v;){if(g[v])p(v);else{g[v]=!0,h.push(v);for(let y of m(v))h.push(y)}v=h.pop()}}function c(p){let m=i.inEdges(p);m?a[p]=m.reduce((h,g)=>{var v;let y=(v=a[g.v])!=null?v:0,b=i.edge(g);return Math.max(h,y+(b!==void 0?b:0))},0):a[p]=0}function d(p){let m=i.outEdges(p),h=Number.POSITIVE_INFINITY;m&&(h=m.reduce((v,y)=>{let b=a[y.w],E=i.edge(y);return Math.min(v,(b!==void 0?b:0)-(E!==void 0?E:0))},Number.POSITIVE_INFINITY));let g=t.node(p);h!==Number.POSITIVE_INFINITY&&g.borderType!==s&&(a[p]=Math.max(a[p]!==void 0?a[p]:0,h))}function u(p){return i.predecessors(p)||[]}function f(p){return i.successors(p)||[]}return l(c,u),l(d,f),Object.keys(r).forEach(p=>{var m;let h=n[p];h!==void 0&&(a[p]=(m=a[h])!=null?m:0)}),a}function PK(t,e,n,r){let o=new La,a=t.graph(),i=HK(a.nodesep,a.edgesep,r);return e.forEach(s=>{let l;s.forEach(c=>{let d=n[c];if(d!==void 0){if(o.setNode(d),l!==void 0){let u=n[l];if(u!==void 0){let f=o.edge(u,d);o.setEdge(u,d,Math.max(i(t,c,l),f||0))}}l=c}})}),o}function DK(t,e){return Object.values(e).reduce((n,r)=>{let o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([s,l])=>{let c=WK(t,s)/2;o=Math.max(l+c,o),a=Math.min(l-c,a)});let i=o-a;return i<n[0]&&(n=[i,r]),n},[Number.POSITIVE_INFINITY,null])[1]}function OK(t,e){let n=Object.values(e),r=Ri(Math.min,n),o=Ri(Math.max,n);["u","d"].forEach(a=>{["l","r"].forEach(i=>{let s=a+i,l=t[s];if(!l||l===e)return;let c=Object.values(l),d=r-Ri(Math.min,c);i!=="l"&&(d=o-Ri(Math.max,c)),d&&(t[s]=rg(l,u=>u+d))})})}function GK(t,e=void 0){let n=t.ul;return n?rg(n,(r,o)=>{var a,i;if(e){let l=e.toLowerCase(),c=t[l];if(c&&c[o]!==void 0)return c[o]}let s=Object.values(t).map(l=>{let c=l[o];return c!==void 0?c:0}).sort((l,c)=>l-c);return(((a=s[1])!=null?a:0)+((i=s[2])!=null?i:0))/2}):{}}function $K(t){let e=wf(t),n=Object.assign(TK(t,e),CK(t,e)),r={},o;["u","d"].forEach(i=>{o=i==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(o=o.map(d=>Object.values(d).reverse()));let l=RK(t,o,n,d=>(i==="u"?t.predecessors(d):t.successors(d))||[]),c=IK(t,o,l.root,l.align,s==="r");s==="r"&&(c=rg(c,d=>-d)),r[i+s]=c})});let a=DK(t,r);return OK(r,a),GK(r,t.graph().align)}function HK(t,e,n){return(r,o,a)=>{let i=r.node(o),s=r.node(a),l=0,c;if(l+=i.width/2,Object.hasOwn(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":c=-i.width/2;break;case"r":c=i.width/2;break}if(c&&(l+=n?c:-c),c=void 0,l+=(i.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=s.width/2;break;case"r":c=-s.width/2;break}return c&&(l+=n?c:-c),l}}function WK(t,e){return t.node(e).width}function BK(t){t=MP(t),FK(t),Object.entries($K(t)).forEach(([e,n])=>t.node(e).x=n)}function FK(t){let e=wf(t),n=t.graph(),r=n.ranksep,o=n.rankalign,a=0;e.forEach(i=>{let s=i.reduce((l,c)=>{var d;let u=(d=t.node(c).height)!=null?d:0;return l>u?l:u},0);i.forEach(l=>{let c=t.node(l);o==="top"?c.y=a+c.height/2:o==="bottom"?c.y=a+s-c.height/2:c.y=a+s/2}),a+=s+r})}function YK(t,e={}){let n=e.debugTiming?_P:AP;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>JK(t));return n(" runLayout",()=>zK(r,n,e)),n(" updateInputGraph",()=>VK(t,r)),r})}function zK(t,e,n){e(" makeSpaceForEdgeLabels",()=>t7(t)),e(" removeSelfEdges",()=>c7(t)),e(" acyclic",()=>Iq(t)),e(" nestingGraph.run",()=>rK(t)),e(" rank",()=>qq(MP(t))),e(" injectEdgeLabelProxies",()=>e7(t)),e(" removeEmptyRanks",()=>xq(t)),e(" nestingGraph.cleanup",()=>iK(t)),e(" normalizeRanks",()=>bq(t)),e(" assignRankMinMax",()=>n7(t)),e(" removeEdgeLabelProxies",()=>r7(t)),e(" normalize.run",()=>Oq(t)),e(" parentDummyChains",()=>Jq(t)),e(" addBorderSegments",()=>sK(t)),e(" order",()=>BP(t,n)),e(" insertSelfEdges",()=>d7(t)),e(" adjustCoordinateSystem",()=>cK(t)),e(" position",()=>BK(t)),e(" positionSelfEdges",()=>u7(t)),e(" removeBorderNodes",()=>l7(t)),e(" normalize.undo",()=>$q(t)),e(" fixupEdgeLabelCoords",()=>i7(t)),e(" undoCoordinateSystem",()=>dK(t)),e(" translateGraph",()=>o7(t)),e(" assignNodeIntersects",()=>a7(t)),e(" reversePoints",()=>s7(t)),e(" acyclic.undo",()=>Dq(t))}function VK(t,e){t.nodes().forEach(n=>{let r=t.node(n),o=e.node(n);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,e.children(n).length&&(r.width=o.width,r.height=o.height))}),t.edges().forEach(n=>{let r=t.edge(n),o=e.edge(n);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function JK(t){let e=new La({multigraph:!0,compound:!0}),n=zE(t.graph());return e.setGraph(Object.assign({},XK,YE(n,UK),ng(n,jK))),t.nodes().forEach(r=>{let o=zE(t.node(r)),a=YE(o,qK);Object.keys(gP).forEach(s=>{a[s]===void 0&&(a[s]=gP[s])}),e.setNode(r,a);let i=t.parent(r);i!==void 0&&e.setParent(r,i)}),t.edges().forEach(r=>{let o=zE(t.edge(r));e.setEdge(r,Object.assign({},ZK,YE(o,KK),ng(o,QK)))}),e}function t7(t){let e=t.graph();e.ranksep/=2,t.edges().forEach(n=>{let r=t.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function e7(t){t.edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let r=t.node(e.v),o={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};pd(t,"edge-proxy",o,"_ep")}})}function n7(t){let e=0;t.nodes().forEach(n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))}),t.graph().maxRank=e}function r7(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="edge-proxy"){let r=n;t.edge(r.e).labelRank=n.rank,t.removeNode(e)}})}function o7(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,a=t.graph(),i=a.marginx||0,s=a.marginy||0;function l(c){let d=c.x,u=c.y,f=c.width,p=c.height;e=Math.min(e,d-f/2),n=Math.max(n,d+f/2),r=Math.min(r,u-p/2),o=Math.max(o,u+p/2)}t.nodes().forEach(c=>l(t.node(c))),t.edges().forEach(c=>{let d=t.edge(c);Object.hasOwn(d,"x")&&l(d)}),e-=i,r-=s,t.nodes().forEach(c=>{let d=t.node(c);d.x-=e,d.y-=r}),t.edges().forEach(c=>{let d=t.edge(c);d.points.forEach(u=>{u.x-=e,u.y-=r}),Object.hasOwn(d,"x")&&(d.x-=e),Object.hasOwn(d,"y")&&(d.y-=r)}),a.width=n-e+i,a.height=o-r+s}function a7(t){t.edges().forEach(e=>{let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),a,i;n.points?(a=n.points[0],i=n.points[n.points.length-1]):(n.points=[],a=o,i=r),n.points.unshift(iP(r,a)),n.points.push(iP(o,i))})}function i7(t){t.edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function s7(t){t.edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}function l7(t){t.nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(n.borderLeft[n.borderLeft.length-1]),i=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(i.x-a.x),n.height=Math.abs(o.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{t.node(e).dummy==="border"&&t.removeNode(e)})}function c7(t){t.edges().forEach(e=>{if(e.v===e.w){let n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function d7(t){wf(t).forEach(e=>{let n=0;e.forEach((r,o)=>{let a=t.node(r);a.order=o+n,(a.selfEdges||[]).forEach(i=>{pd(t,"selfedge",{width:i.label.width,height:i.label.height,rank:a.rank,order:o+ ++n,e:i.e,label:i.label},"_se")}),delete a.selfEdges})})}function u7(t){t.nodes().forEach(e=>{let n=t.node(e);if(n.dummy==="selfedge"){let r=n,o=t.node(r.e.v),a=o.x+o.width/2,i=o.y,s=n.x-a,l=o.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:a+2*s/3,y:i-l},{x:a+5*s/6,y:i-l},{x:a+s,y:i},{x:a+5*s/6,y:i+l},{x:a+2*s/3,y:i+l}],r.label.x=n.x,r.label.y=n.y}})}function YE(t,e){return rg(ng(t,e),Number)}function zE(t){let e={};return t&&Object.entries(t).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),e[n]=r}),e}function f7(t){let e=wf(t),n=new La({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+t.node(r).rank)}),t.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),e.forEach((r,o)=>{let a="layer"+o;n.setNode(a,{rank:"same"}),r.reduce((i,s)=>(n.setEdge(i,s,{style:"invis"}),s))}),n}var yP,zj,Vj,Uj,bP,Xj,xP,La,qj,wP,UE,tq,SP,rq,sq,eg,TP,Sq,og,kq,Lq,Mq,Tq,RP,Yq,zq,Vq,qq,Zq,Jq,sK,UK,XK,jK,qK,gP,KK,ZK,QK,p7,er,ss=st(()=>{"use strict";yP=Object.defineProperty,zj=(t,e,n)=>e in t?yP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vj=(t,e)=>{for(var n in e)yP(t,n,{get:e[n],enumerable:!0})},Uj=(t,e,n)=>zj(t,typeof e!="symbol"?e+"":e,n),bP={};Vj(bP,{Graph:()=>La,alg:()=>UE,json:()=>wP,version:()=>qj});Xj=Object.defineProperty,xP=(t,e)=>{for(var n in e)Xj(t,n,{get:e[n],enumerable:!0})},La=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,e){return t.forEach(n=>{e!==void 0?this.setNode(n,e):this.setNode(n)}),this}setNode(t,e){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let e=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(n=>{this.setParent(n)}),delete this._children[t]),Object.keys(this._in[t]).forEach(e),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e===void 0)e="\0";else{e+="";for(let n=e;n!==void 0;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}parent(t){if(this._isCompound){let e=this._parent[t];if(e!=="\0")return e}}children(t="\0"){if(this._isCompound){let e=this._children[t];if(e)return Object.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let e=this._preds[t];if(e)return Object.keys(e)}successors(t){let e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){let e=this.predecessors(t);if(e){let n=new Set(e);for(let r of this.successors(t))n.add(r);return Array.from(n.values())}}isLeaf(t){let e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0}filterNodes(t){let e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Object.entries(this._nodes).forEach(([o,a])=>{t(o)&&e.setNode(o,a)}),Object.values(this._edgeObjs).forEach(o=>{e.hasNode(o.v)&&e.hasNode(o.w)&&e.setEdge(o,this.edge(o))});let n={},r=o=>{let a=this.parent(o);return!a||e.hasNode(a)?(n[o]=a??void 0,a??void 0):a in n?n[a]:r(a)};return this._isCompound&&e.nodes().forEach(o=>e.setParent(o,r(o))),e}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){return t.reduce((n,r)=>(e!==void 0?this.setEdge(n,r,e):this.setEdge(n,r),r)),this}setEdge(t,e,n,r){let o,a,i,s,l=!1;typeof t=="object"&&t!==null&&"v"in t?(o=t.v,a=t.w,i=t.name,arguments.length===2&&(s=e,l=!0)):(o=t,a=e,i=r,arguments.length>2&&(s=n,l=!0)),o=""+o,a=""+a,i!==void 0&&(i=""+i);let c=bf(this._isDirected,o,a,i);if(c in this._edgeLabels)return l&&(this._edgeLabels[c]=s),this;if(i!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(o),this.setNode(a),this._edgeLabels[c]=l?s:this._defaultEdgeLabelFn(o,a,i);let d=jj(this._isDirected,o,a,i);return o=d.v,a=d.w,Object.freeze(d),this._edgeObjs[c]=d,oP(this._preds[a],o),oP(this._sucs[o],a),this._in[a][c]=d,this._out[o][c]=d,this._edgeCount++,this}edge(t,e,n){let r=arguments.length===1?HE(this._isDirected,t):bf(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(t,e,n){let r=arguments.length===1?this.edge(t):this.edge(t,e,n);return typeof r!="object"?{label:r}:r}hasEdge(t,e,n){return(arguments.length===1?HE(this._isDirected,t):bf(this._isDirected,t,e,n))in this._edgeLabels}removeEdge(t,e,n){let r=arguments.length===1?HE(this._isDirected,t):bf(this._isDirected,t,e,n),o=this._edgeObjs[r];if(o){let a=o.v,i=o.w;delete this._edgeLabels[r],delete this._edgeObjs[r],aP(this._preds[i],a),aP(this._sucs[a],i),delete this._in[i][r],delete this._out[a][r],this._edgeCount--}return this}inEdges(t,e){return this.isDirected()?this.filterEdges(this._in[t],t,e):this.nodeEdges(t,e)}outEdges(t,e){return this.isDirected()?this.filterEdges(this._out[t],t,e):this.nodeEdges(t,e)}nodeEdges(t,e){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,e)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,e,n){if(!t)return;let r=Object.values(t);return n?r.filter(o=>o.v===e&&o.w===n||o.v===n&&o.w===e):r}};qj="4.0.1",wP={};xP(wP,{read:()=>Jj,write:()=>Kj});UE={};xP(UE,{CycleException:()=>eg,bellmanFord:()=>EP,components:()=>nq,dijkstra:()=>tg,dijkstraAll:()=>aq,findCycles:()=>iq,floydWarshall:()=>lq,isAcyclic:()=>dq,postorder:()=>fq,preorder:()=>pq,prim:()=>mq,shortestPaths:()=>hq,tarjan:()=>vP,topsort:()=>kP});tq=()=>1;SP=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(t=>t.key)}has(t){return t in this._keyIndices}priority(t){let e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){let n=this._keyIndices,r=String(t);if(!(r in n)){let o=this._arr,a=o.length;return n[r]=a,o.push({key:r,priority:e}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){let n=this._keyIndices[t];if(n===void 0)throw new Error(`Key not found: ${t}`);let r=this._arr[n].priority;if(e>r)throw new Error(`New priority is greater than current priority. Key: ${t} Old: ${r} New: ${e}`);this._arr[n].priority=e,this._decrease(n)}_heapify(t){let e=this._arr,n=2*t,r=n+1,o=t;n<e.length&&(o=e[n].priority<e[o].priority?n:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==t&&(this._swap(t,o),this._heapify(o)))}_decrease(t){let e=this._arr,n=e[t].priority,r;for(;t!==0&&(r=t>>1,!(e[r].priority<n));)this._swap(t,r),t=r}_swap(t,e){let n=this._arr,r=this._keyIndices,o=n[t],a=n[e];n[t]=a,n[e]=o,r[a.key]=t,r[o.key]=e}},rq=()=>1;sq=()=>1;eg=class extends Error{constructor(...t){super(...t)}};TP=65535;Sq=0;og="\0",kq="3.0.0",Lq=class{constructor(){Uj(this,"_sentinel");let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return lP(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&lP(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Nq)),n=n._prev;return"["+t.join(", ")+"]"}};Mq=Lq,Tq=()=>1;RP=Hq;({preorder:Yq,postorder:zq}=UE),Vq=zl;zl.initLowLimValues=KE;zl.initCutValues=qE;zl.calcCutValue=IP;zl.leaveEdge=DP;zl.enterEdge=OP;zl.exchangeEdges=GP;qq=Kq;Zq=jE;Jq=tK;sK=lK;UK=["nodesep","edgesep","ranksep","marginx","marginy"],XK={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},jK=["acyclicer","ranker","rankdir","align","rankalign"],qK=["width","height","rank"],gP={width:0,height:0},KK=["minlen","weight","width","height","labeloffset"],ZK={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},QK=["labelpos"];p7={graphlib:bP,version:kq,layout:YK,debug:f7,util:{time:_P,notime:AP}},er=p7;});var JE={};ye(JE,{layoutSitemap:()=>k7});function zP(t,e,n,r,o,a){let i=o-t,s=a-e;if(i===0&&s===0)return{x:t,y:e};let l=n/2,c=r/2,d=i!==0?l/Math.abs(i):1/0,u=s!==0?c/Math.abs(s):1/0,f=Math.min(d,u);return{x:t+i*f,y:e+s*f}}function x7(t,e){if(!e||e.size===0)return t;let n={};for(let[r,o]of Object.entries(t))e.has(r)||(n[r]=o);return n}function w7(t,e,n){let r=_t(t,m7);for(let[o,a]of Object.entries(e)){let i=_t(`${o}: ${a}`,YP);i>r&&(r=i)}if(n)for(let o of n){let a=_t(o,YP);a>r&&(r=a)}return Math.max(KP,Math.ceil(r)+qP*2)}function E7(t,e=0){let r=Object.keys(t).length+e;return r===0?VP+UP:VP+y7+r*g7+UP}function jP(t,e,n){return t.color?t.color:ar(t.metadata,[...e],n,t.isContainer)}function v7(t,e){let n=[];for(let r of t){if(r.entries.length===0)continue;let o=e?.get(qt(r.name)),a=o?r.entries.filter(u=>o.has(u.value.toLowerCase())):r.entries;if(a.length===0)continue;let i=We(r.name,sr)+po,s=i,l=0;for(let u of a)l+=wr*2+Nr+We(u.value,Vn)+Kr;let c=Mo+wi,d=Rn*2+i+4+c+l;n.push({name:r.name,...r.alias!==void 0&&{alias:r.alias},entries:a.map(u=>({value:u.value,color:u.color})),x:0,y:0,width:d,height:Se,minifiedWidth:s,minifiedHeight:Se})}return n}function QE(t,e,n,r,o,a){for(let i of t){let s=x7(i.metadata,o);if(i.isContainer){let l=Object.keys(s).length,c=ZP+l*QP;a.push({sitemapNode:i,parentContainerId:e,parentPageId:n,meta:s,fullMeta:{...i.metadata},width:Math.max(KP,_t(i.label,h7)+qP*2),height:c+ZE}),QE(i.children,i.id,n,r,o,a)}else a.push({sitemapNode:i,parentContainerId:e,parentPageId:n,meta:s,fullMeta:{...i.metadata},width:w7(i.label,s,i.description),height:E7(s,i.description?.length??0)}),i.children.length>0&&QE(i.children,e,i.id,r,o,a)}}function k7(t,e,n,r,o){if(t.roots.length===0)return{nodes:[],edges:[],containers:[],legend:[],width:0,height:0};let a=[],i=k=>{a.push(k);for(let N of k.children)i(N)};for(let k of t.roots)i(k);wa(a,t.tagGroups,k=>k.isContainer);let s=[];QE(t.roots,null,null,e,r,s);let l=new Map;for(let k of s)l.set(k.sitemapNode.id,k);let c=new er.graphlib.Graph({compound:!0,multigraph:!0});c.setGraph({rankdir:t.direction,nodesep:50,ranksep:60,edgesep:30,marginx:Vl,marginy:Vl}),c.setDefaultEdgeLabel(()=>({}));let d=new Set,u=new Set,f=new Set;for(let k of s)k.sitemapNode.isContainer?(d.add(k.sitemapNode.id),(e?.get(k.sitemapNode.id)??0)>0&&f.add(k.sitemapNode.id)):u.add(k.sitemapNode.id);let p=0,m=0;for(let k of s)k.sitemapNode.isContainer||(k.width>p&&(p=k.width),k.height>m&&(m=k.height));for(let k of s){let N=k.sitemapNode;if(N.isContainer)if(f.has(N.id)){let _=Math.max(k.width,p),T=Math.max(k.height,m);c.setNode(N.id,{label:N.label,width:_,height:T})}else c.setNode(N.id,{label:N.label,paddingLeft:XP,paddingRight:XP,paddingTop:b7,paddingBottom:ZE});else c.setNode(N.id,{label:N.label,width:k.width,height:k.height})}for(let k of s)k.parentContainerId&&!f.has(k.parentContainerId)&&c.setParent(k.sitemapNode.id,k.parentContainerId);let h=new Set;for(let k of d)f.has(k)||h.add(k);let g=[];for(let k=0;k<t.edges.length;k++){let N=t.edges[k];if(!(!c.hasNode(N.sourceId)||!c.hasNode(N.targetId))){if(h.has(N.sourceId)||h.has(N.targetId)){g.push(k);continue}c.setEdge(N.sourceId,N.targetId,{label:N.label??"",minlen:1},`e${k}`)}}er.layout(c);let v=[],y=[];for(let k of s){let N=k.sitemapNode;if(N.isContainer)continue;let _=c.node(N.id);if(!_)continue;let T=e?.get(N.id),R=jP(N,t.tagGroups,n??null);v.push({id:N.id,label:N.label,metadata:k.meta,tagMetadata:k.fullMeta,...N.description!==void 0&&{description:[...N.description]},isContainer:!1,lineNumber:N.lineNumber,...R!==void 0&&{color:R},x:_.x,y:_.y-_.height/2,width:_.width,height:_.height,...T!==void 0&&{hiddenCount:T},...(N.children.length>0||T!=null&&T>0)&&{hasChildren:!0}})}for(let k of s){let N=k.sitemapNode;if(!N.isContainer)continue;let _=c.node(N.id),T=e?.get(N.id),R=Object.keys(k.meta).length,G=ZP+R*QP,I=jP(N,t.tagGroups,n??null);if(_)y.push({nodeId:N.id,label:N.label,lineNumber:N.lineNumber,...I!==void 0&&{color:I},metadata:k.meta,tagMetadata:k.fullMeta,x:_.x-_.width/2,y:_.y-_.height/2,width:_.width,height:_.height,labelHeight:G,...T!==void 0&&{hiddenCount:T},...(N.children.length>0||T!=null&&T>0)&&{hasChildren:!0}});else{let H=f.has(N.id),O=H?Math.max(k.width,p):k.width,D=H?k.height:G+ZE,W=H?Math.max(D,m):D;y.push({nodeId:N.id,label:N.label,lineNumber:N.lineNumber,...I!==void 0&&{color:I},metadata:k.meta,tagMetadata:k.fullMeta,x:Vl,y:Vl,width:O,height:W,labelHeight:G,...T!==void 0&&{hiddenCount:T},...(N.children.length>0||T!=null&&T>0)&&{hasChildren:!0}})}}let b=new Set(g),E=[];for(let k=0;k<t.edges.length;k++){let N=t.edges[k];if(!c.hasNode(N.sourceId)||!c.hasNode(N.targetId))continue;let _;if(b.has(k)){let T=c.node(N.sourceId),R=c.node(N.targetId);if(!T||!R)continue;let G=zP(T.x,T.y,T.width,T.height,R.x,R.y),I=zP(R.x,R.y,R.width,R.height,T.x,T.y),H=(G.x+I.x)/2,O=(G.y+I.y)/2;_=[G,{x:H,y:O},I]}else{let T=c.edge({v:N.sourceId,w:N.targetId,name:`e${k}`});if(!T)continue;_=T.points??[]}E.push({sourceId:N.sourceId,targetId:N.targetId,points:_,...N.label!==void 0&&{label:N.label},lineNumber:N.lineNumber,...b.has(k)&&{deferred:!0}})}{let k=new Set([...u,...f]),N=new Map;for(let O of k)N.set(O,O);let _=O=>{for(;N.get(O)!==O;)N.set(O,N.get(N.get(O))),O=N.get(O);return O},T=(O,D)=>{let W=_(O),z=_(D);W!==z&&N.set(W,z)};for(let O of t.edges)k.has(O.sourceId)&&k.has(O.targetId)&&T(O.sourceId,O.targetId);let R=s.find(O=>!O.sitemapNode.isContainer)?.sitemapNode.id,G=R?_(R):null,I=new Set;for(let O of k)G&&_(O)!==G&&I.add(O);let H=new Set;for(let O of d){if(f.has(O)){I.has(O)&&H.add(O);continue}let D=s.filter(W=>!W.sitemapNode.isContainer&&W.parentContainerId===O);D.length>0&&D.every(W=>I.has(W.sitemapNode.id))&&H.add(O)}if(I.size>0){let O=t.direction==="TB",D=0,W=0,z=1/0,P=1/0;for(let K of v)I.has(K.id)||(D=Math.max(D,K.x+K.width/2),W=Math.max(W,K.y+K.height),z=Math.min(z,K.y),P=Math.min(P,K.x-K.width/2));for(let K of y)H.has(K.nodeId)||(D=Math.max(D,K.x+K.width),W=Math.max(W,K.y+K.height),z=Math.min(z,K.y),P=Math.min(P,K.x));let B=1/0,Y=1/0,V=0,j=0;for(let K of v)I.has(K.id)&&(B=Math.min(B,K.x-K.width/2),Y=Math.min(Y,K.y),V=Math.max(V,K.x+K.width/2),j=Math.max(j,K.y+K.height));for(let K of y)H.has(K.nodeId)&&(B=Math.min(B,K.x),Y=Math.min(Y,K.y),V=Math.max(V,K.x+K.width),j=Math.max(j,K.y+K.height));if(B!==1/0){let K=S7*2,$,U;if(O?($=D+K-B,U=(z===1/0?0:z)-Y):($=(P===1/0?0:P)-B,U=W+K-Y),$!==0||U!==0){for(let X of v)I.has(X.id)&&(X.x+=$,X.y+=U);for(let X of y)H.has(X.nodeId)&&(X.x+=$,X.y+=U);for(let X of E){let q=I.has(X.sourceId),et=I.has(X.targetId);if(q||et)for(let tt of X.points)tt.x+=$,tt.y+=U}}}}}let x=0,L=0;for(let k of v){let N=k.x+k.width/2,_=k.y+k.height;N>x&&(x=N),_>L&&(L=_)}for(let k of y){let N=k.x+k.width,_=k.y+k.height;N>x&&(x=N),_>L&&(L=_)}for(let k of E)for(let N of k.points)N.x>x&&(x=N.x),N.y>L&&(L=N.y);x+=Vl,L+=Vl;let S=new Map;for(let k of t.tagGroups){let N=qt(k.name),_=new Set,T=R=>{!R.isContainer&&R.metadata[N]&&_.add(R.metadata[N].toLowerCase());for(let G of R.children)T(G)};for(let R of t.roots)T(R);S.set(N,_)}let A=v7(t.tagGroups,S),C=n!=null?A.filter(k=>k.name.toLowerCase()===n.toLowerCase()):A,M=o&&n==null,w=k=>n!=null||M?k.width:k.minifiedWidth;if(C.length>0){let k=Se+Wn,N=C.reduce((G,I)=>G+w(I),0)+(C.length-1)*Wn,_=N+Vl*2;_>x&&(x=_);let T=(x-N)/2,R=L+Wn;for(let G of C)G.x=T,G.y=R,T+=w(G)+Wn;L+=k}return{nodes:v,edges:E,containers:y,legend:A,width:x,height:L}}var m7,YP,h7,g7,VP,y7,qP,UP,KP,Vl,XP,b7,ZE,ZP,QP,S7,t1=st(()=>{"use strict";Ke();ss();Ke();Mr();en();m7=13,YP=11,h7=13;g7=16,VP=28,y7=6,qP=20,UP=10,KP=140,Vl=40,XP=24,b7=40,ZE=24,ZP=28,QP=16;S7=20});function L7(t,e){let n=new Map,r=o=>{for(let a of o)for(let i of e.getChildren(a))n.set(e.getId(i),e.getId(a)),r([i])};return r(t),n}function JP(t,e,n,r){let o=t;for(;;){let a=e.get(o);if(!a)return null;if(n.has(a)&&r.has(a))return a;o=a}}function tD(t,e,n,r,o,a){let i=XI(e,o),s=L7(t,o),l=[];for(let c of n){let d=a.getSource(c),u=a.getTarget(c),f=i.has(d),p=i.has(u);if(f&&p){l.push(a.withEndpoints(c,d,u));continue}if(!f){let m=JP(d,s,i,r);if(!m)continue;d=m}if(!p){let m=JP(u,s,i,r);if(!m)continue;u=m}d!==u&&l.push(a.withEndpoints(c,d,u))}return l}var eD=st(()=>{"use strict";yf()});var oD={};ye(oD,{collapseSitemapTree:()=>M7});function rD(t){return{id:t.id,label:t.label,metadata:{...t.metadata},children:t.children.map(rD),parentId:t.parentId,isContainer:t.isContainer,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color}}}function M7(t,e){if(e.size===0)return{parsed:t,hiddenCounts:new Map};let{roots:n,hiddenCounts:r}=sd(t.roots,e,nD),o=tD(t.roots,n,t.edges,e,nD,N7);return{parsed:{...t,roots:n,edges:o},hiddenCounts:r}}var nD,N7,aD=st(()=>{"use strict";yf();eD();nD={getId:t=>t.id,getChildren:t=>t.children,clone:rD,setChildren:(t,e)=>{t.children=e},countsAsHidden:t=>!t.isContainer},N7={getSource:t=>t.sourceId,getTarget:t=>t.targetId,withEndpoints:(t,e,n)=>({...t,sourceId:e,targetId:n})}});var lD={};ye(lD,{renderSitemap:()=>sD,renderSitemapForExport:()=>H7});function I7(t,e,n,r){let o=n??t.primary;return ie(t,o,e,{...r!==void 0&&{solid:r}})}function P7(t,e){return e??t.primary}function D7(t,e,n){return n?Gt(n,nr(t,e),10):Gt(t.surface,t.bg,40)}function O7(t,e){return e??t.textMuted}function sD(t,e,n,r,o,a,i,s,l,c){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let d=i?.width??t.clientWidth,u=i?.height??t.clientHeight;if(d<=0||u<=0)return;let f=Ee.identity(),p=f.aesthetic(T7),m=f.text(13),h=f.text(11),g=f.structural(16),v=f.structural(28),y=f.structural(6),b=f.structural(1.5),E=f.structural(1.5),x=f.text(A7),L=f.text(13),S=f.text(11),A=f.structural(16),C=f.structural(28),M=f.text(20),w=f.structural(_7),k=f.structural(6),N=f.aesthetic(R7),_=n.legend.length>0,T=Se+Wn,R=!!e.title&&e.options["no-title"]!=="on",G=!i&&_,I=G&&R,H=I?w:0,O=f.structural(G?Tr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview",capsulePillAddonWidth:Mo+wi},d):Se),D=G?O+N:0,W=H+D,z=0,P=!I&&R?w:0,B=n.width,Y=n.height+P;G&&(Y-=T);let V=u-p*2-W-z,j=(d-p*2)/B,K=V/Y,$=Math.min(C7,j,K),U=B*$,X=(d-U)/2,q=p+W,et=Rt(t).append("svg").attr("width",d).attr("height",u).attr("viewBox",`0 0 ${d} ${u}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It);f.isBelowFloor&&et.attr("width","100%");let tt=et.append("defs");tt.append("marker").attr("id","sm-arrow").attr("viewBox",`0 0 ${Qs} ${Ii}`).attr("refX",Qs).attr("refY",Ii/2).attr("markerWidth",Qs).attr("markerHeight",Ii).attr("orient","auto").append("polygon").attr("points",`0,0 ${Qs},${Ii/2} 0,${Ii}`).attr("fill",r.textMuted);let F=new Set;for(let J of F){let at=`sm-arrow-${J.replace("#","")}`;tt.append("marker").attr("id",at).attr("viewBox",`0 0 ${Qs} ${Ii}`).attr("refX",Qs).attr("refY",Ii/2).attr("markerWidth",Qs).attr("markerHeight",Ii).attr("orient","auto").append("polygon").attr("points",`0,0 ${Qs},${Ii/2} 0,${Ii}`).attr("fill",J)}let Q=et.append("g").attr("transform",`translate(${X}, ${q}) scale(${$})`);if(!I&&R){let J=Q.append("text").attr("x",B/2).attr("y",M).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",M).attr("font-weight","700").attr("class","sitemap-title chart-title");e.titleLineNumber&&(J.attr("data-line-number",e.titleLineNumber),a&&J.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))),J.text(e.title)}let ot=G?-T:0,Z=Q.append("g").attr("transform",`translate(0, ${P+ot})`),lt=new Map,nt=new Map;for(let J of e.tagGroups){lt.set(qt(J.name),J.name);for(let at of J.entries)nt.set(`${qt(J.name)}:${at.value.toLowerCase()}`,at.color)}for(let J of n.containers){let at=Z.append("g").attr("transform",`translate(${J.x}, ${J.y})`).attr("class","sitemap-container").attr("data-line-number",String(J.lineNumber));if(J.hasChildren&&at.attr("data-node-toggle",J.nodeId).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!J.hiddenCount)).attr("aria-label",J.label),a&&at.style("cursor","pointer").on("click",()=>a(J.lineNumber)),s){let At=qt(s),rt=J.tagMetadata[At];rt&&at.attr(`data-tag-${At}`,rt.toLowerCase())}let it=D7(r,o,J.color),vt=O7(r,J.color);at.append("rect").attr("x",0).attr("y",0).attr("width",J.width).attr("height",J.height).attr("rx",8).attr("fill",it).attr("stroke",vt).attr("stroke-opacity",.35).attr("stroke-width",E),at.append("text").attr("x",J.width/2).attr("y",C/2+L/2-2).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",L).attr("font-weight","bold").text(J.label);let Tt=Object.entries(J.metadata);if(Tt.length>0){let At=Tt.map(([dt])=>lt.get(dt)??dt),pt=10+Math.max(...At.map(dt=>_t(`${dt}: `,S))),ht=C+S-2;for(let dt=0;dt<Tt.length;dt++){let[ut,yt]=Tt[dt],kt=At[dt],Ot=ht+dt*A,Xt=nt.get(`${ut}:${yt.toLowerCase()}`)??r.text;at.append("text").attr("x",10).attr("y",Ot).attr("fill",r.textMuted).attr("font-size",S).text(`${kt}: `),at.append("text").attr("x",pt).attr("y",Ot).attr("fill",Xt).attr("font-size",S).text(yt)}}if(!i&&J.hiddenCount&&J.hiddenCount>0){let At=`clip-${J.nodeId}`;at.append("clipPath").attr("id",At).append("rect").attr("width",J.width).attr("height",J.height).attr("rx",8),at.append("rect").attr("y",J.height-k).attr("width",J.width).attr("height",k).attr("fill",vt).attr("clip-path",`url(#${At})`).attr("class","sitemap-collapse-bar")}}for(let J of n.edges){if(J.points.length<2)continue;let at=Z.append("g").attr("class","sitemap-edge-group").attr("data-line-number",String(J.lineNumber)).attr("data-from",J.sourceId).attr("data-to",J.targetId),it=r.textMuted,vt="sm-arrow",At=(J.deferred?$7:G7)(J.points);if(At&&at.append("path").attr("d",At).attr("fill","none").attr("stroke",it).attr("stroke-width",b).attr("marker-end",`url(#${vt})`).attr("class","sitemap-edge"),J.label&&J.points.length>=2){let rt=J.points[Math.floor(J.points.length/2)],pt=_t(J.label,x)+10,ht=x+6;at.append("rect").attr("x",rt.x-pt/2).attr("y",rt.y-ht/2-1).attr("width",pt).attr("height",ht).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","sitemap-edge-label-bg"),at.append("text").attr("x",rt.x).attr("y",rt.y+4).attr("text-anchor","middle").attr("fill",it).attr("font-size",x).attr("class","sitemap-edge-label").text(J.label)}}for(let J of n.nodes){let at=Z.append("g").attr("transform",`translate(${J.x-J.width/2}, ${J.y})`).attr("class","sitemap-node").attr("data-line-number",String(J.lineNumber)).attr("data-node-id",J.id);if(J.hasChildren&&at.attr("data-node-toggle",J.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",String(!J.hiddenCount)),a&&at.style("cursor","pointer").on("click",()=>a(J.lineNumber)),s){let pt=qt(s),ht=J.tagMetadata[pt];ht&&at.attr(`data-tag-${pt}`,ht.toLowerCase())}let it=e.options["solid-fill"]==="on",vt=I7(r,o,J.color,it),Tt=P7(r,J.color),At=ve(vt,r.textOnFillLight,r.textOnFillDark);rd(at,{width:J.width,height:J.height,rx:6,fill:vt,stroke:Tt,strokeWidth:E,label:J.label,labelColor:At,labelFontSize:m,headerHeight:v});let rt=Object.entries(J.metadata);if(rt.length>0){at.append("line").attr("x1",0).attr("y1",v).attr("x2",J.width).attr("y2",v).attr("stroke",it?At:Tt).attr("stroke-opacity",.3);let pt=rt.map(([ut])=>lt.get(ut)??ut),dt=10+Math.max(...pt.map(ut=>_t(`${ut}: `,h)));for(let ut=0;ut<rt.length;ut++){let[yt,kt]=rt[ut],Ot=pt[ut],Xt=v+y+(ut+1)*g-4,bt=nt.get(`${yt}:${kt.toLowerCase()}`),Nt=it?At:bt??At;at.append("text").attr("x",10).attr("y",Xt).attr("fill",At).attr("font-size",h).text(`${Ot}:`),at.append("text").attr("x",dt).attr("y",Xt).attr("fill",Nt).attr("font-size",h).text(kt)}}if(J.description&&J.description.length>0){let pt=Object.keys(J.metadata).length,ht=pt>0?v+y+pt*g:v;at.append("line").attr("x1",0).attr("y1",ht).attr("x2",J.width).attr("y2",ht).attr("stroke",it?At:Tt).attr("stroke-opacity",.3);let dt=v+y+pt*g;for(let ut=0;ut<J.description.length;ut++){let yt=ta(J.description[ut]),kt=dt+(ut+1)*g-4,Ot=at.append("text").attr("x",10).attr("y",kt).attr("fill",At).attr("font-size",h);gn(Ot,yt,r,h)}}if(!i&&J.hiddenCount&&J.hiddenCount>0){let pt=`clip-${J.id}`;at.append("clipPath").attr("id",pt).append("rect").attr("width",J.width).attr("height",J.height).attr("rx",6),at.append("rect").attr("y",J.height-k).attr("width",J.width).attr("height",k).attr("fill",it?At:J.color??r.primary).attr("opacity",.5).attr("clip-path",`url(#${pt})`)}}if(i&&_&&iD(Z,n.legend,r,o,s,void 0,l,c),I){let J=et.append("text").attr("x",d/2).attr("y",p+M).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",M).attr("font-weight","700").attr("class","sitemap-title chart-title").style("font-family",It);e.titleLineNumber&&(J.attr("data-line-number",e.titleLineNumber),a&&J.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))),J.text(e.title)}if(G){let J=et.append("g").attr("class","sitemap-legend-fixed").attr("transform",`translate(0, ${p+H})`);s&&J.attr("data-legend-active",s.toLowerCase()),iD(J,n.legend,r,o,s,d,l,c)}}function iD(t,e,n,r,o,a,i,s){if(e.length===0)return;let l=e.map(p=>({name:p.name,entries:p.entries.map(m=>({value:m.value,color:m.color}))})),c=a!=null,d=c?Mo+wi:0,u=a??e[0].x+(e[0].width??200),f=fn(t,{groups:l,activeGroup:o??null,mode:s?"export":"preview",capsulePillAddonWidth:d,palette:n,isDark:r,width:u});if(t.selectAll("[data-legend-group]").classed("sitemap-legend-group",!0),c){let p=f.getLayout();if(p.activeCapsule?.addonX!=null){let m=p.activeCapsule,h=qt(m.groupName),g=i?.has(h)??!1,v=t.select(`[data-legend-group="${h}"]`);if(!v.empty()){let y=m.addonX,b=(Se-Mo)/2,E=6,x=v.append("g").attr("class","sitemap-legend-eye").attr("data-legend-visibility",h).style("cursor","pointer").attr("opacity",g?.4:.7);x.append("rect").attr("x",y-E).attr("y",b-E).attr("width",Mo+E*2).attr("height",Mo+E*2).attr("fill","transparent").attr("pointer-events","all"),x.append("path").attr("d",g?Dm:Pm).attr("transform",`translate(${y}, ${b})`).attr("fill","none").attr("stroke",n.textMuted).attr("stroke-width",1.2).attr("stroke-linecap","round").attr("stroke-linejoin","round")}}}}async function H7(t,e,n){let{parseSitemap:r}=await Promise.resolve().then(()=>(Ju(),ew)),{layoutSitemap:o}=await Promise.resolve().then(()=>(t1(),JE)),{getPalette:a}=await Promise.resolve().then(()=>(gi(),vx)),i=e==="dark",s=n??(i?a("nord").dark:a("nord").light),l=r(t,s);if(l.error||l.roots.length===0)return"";let c=o(l,void 0,null,void 0,!0),d=20,u=l.title?30:0,f=c.width+d*2,p=c.height+d*2+u,m=document.createElement("div");m.style.width=`${f}px`,m.style.height=`${p}px`,m.style.position="absolute",m.style.left="-9999px",document.body.appendChild(m),sD(m,l,c,s,i,void 0,{width:f,height:p});let h=m.querySelector("svg");if(!h)return document.body.removeChild(m),"";e==="transparent"?h.style.background="none":h.style.background||(h.style.background=s.bg),h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.style.fontFamily=It;let g=h.outerHTML;return document.body.removeChild(m),g}var T7,C7,_7,Qs,Ii,A7,R7,G7,$7,cD=st(()=>{"use strict";Ke();Xn();Eo();on();tn();_o();Ka();en();Mr();Br();To();fr();Oh();T7=20,C7=3,_7=30,Qs=10,Ii=7,A7=11,R7=8;G7=Kn().x(t=>t.x).y(t=>t.y).curve(fo),$7=Kn().x(t=>t.x).y(t=>t.y).curve(Zi)});function ag(t){return t.toLowerCase()===W7}var W7,dD=st(()=>{"use strict";W7="archive"});var bD={};ye(bD,{renderKanban:()=>yD,renderKanbanForExport:()=>B7});function mg(t,e,n){let r=[];for(let o of e){if(n?.includes(o.name.toLowerCase()))continue;let i=t.tags[qt(o.name)]??o.defaultValue;if(!i)continue;let s=o.entries.find(l=>l.value.toLowerCase()===i.toLowerCase());r.push({label:o.name,value:i,...s?.color!==void 0&&{color:s.color}})}return r}function hD(t,e,n){if(!n)return t.color;let r=e.find(s=>s.name.toLowerCase()===n.toLowerCase());if(!r)return t.color;let a=t.tags[qt(r.name)]??r.defaultValue;return a?r.entries.find(s=>s.value.toLowerCase()===a.toLowerCase())?.color:void 0}function gD(t,e,n,r,o=Ef,a=dg,i=ug,s=r1,l=ig,c=sg,d=cg,u=yd,f=gd,p=hd,m=md,h=fg,g=lg,v=e1,y=Sf,b=pg){let x=!!t.title&&t.options["no-title"]!=="on"?a+8:0,L=o+x,S=[],A=0,C=t.columns.filter(N=>!ag(N.name));for(let N of C){if(n?.has(N.id)??!1){S.push({x:0,y:L,width:b,height:0,column:N,cardLayouts:[]});continue}let T=_t(N.name,s),R=[],G=l+c;for(let O of N.cards){let D=_t(O.title,i);T=Math.max(T,D+d*2);let W=mg(O,t.tagGroups,r),z=W.length+O.details.length,P=z>0?f+1+u+z*p:0,B=m+u+P;for(let Y of W){let V=_t(`${Y.label}: ${Y.value}`,h)+d*2;T=Math.max(T,V)}R.push({x:c,y:G,width:0,height:B,card:O}),G+=B+g}let I=Math.max(v,T+c*2);for(let O of R)O.width=I-c*2;let H=G+c;A=Math.max(A,H),S.push({x:0,y:L,width:I,height:H,column:N,cardLayouts:R})}let M=o;for(let N of S)N.x=M,N.height=A,M+=N.width+y;let w=M-y+o,k=L+A+o;return{columns:S,totalWidth:w,totalHeight:k}}function yD(t,e,n,r,o){let a=o?.exportDims,i=o?.activeTagGroup??null,s=o?.onSwimlaneChange,l=o?.collapsedLanes,c=o?.collapsedColumns??new Set(e.columns.filter(F=>F.collapsed).map(F=>F.id)),d=o?.compactMeta??!1,u=e.options["solid-fill"]==="on",f=o?.currentSwimlaneGroup??null,p=f?e.tagGroups.find(F=>F.name.toLowerCase()===f.toLowerCase())??null:null,m=[];d&&(i&&m.push(i.toLowerCase()),f&&m.push(f.toLowerCase()));let h=e.columns.filter(F=>!ag(F.name)),g=Math.max(1,h.length),v=g*e1+(g-1)*Sf+2*Ef,y=a?.width??t.getBoundingClientRect().width,b=a||y<=0?Ee.identity():Ee.from(y,v),E=b.aesthetic(Ef),x=b.aesthetic(Sf),L=b.structural(ig),S=b.aesthetic(sg),A=b.structural(e1),C=b.structural(md),M=b.structural(hd),w=b.structural(gd),k=b.aesthetic(lg),N=b.structural(6),_=b.aesthetic(cg),T=b.aesthetic(yd),R=b.structural(n1),G=b.structural(dg),I=b.text(r1),H=b.text(ug),O=b.text(fg),D=b.text(fD),W=b.structural(pD),z=b.structural(mD),P=b.structural(pg),B=b.structural(o1),Y=b.text(20),V=b.structural(a1),j=b.aesthetic(i1),K=gD(e,n,c,m,E,G,H,I,L,S,_,T,w,M,C,O,k,A,x,P),$=a?.width??K.totalWidth,U=a?.height??K.totalHeight;t.innerHTML="";let X=Rt(t).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("width",$).attr("height",U).attr("viewBox",`0 0 ${$} ${U}`).attr("preserveAspectRatio","xMidYMin meet").attr("font-family",It).style("background",n.bg);b.isBelowFloor&&X.attr("width","100%");let q=!!e.title&&e.options["no-title"]!=="on";if(q&&X.append("text").attr("class","chart-title").attr("data-line-number",e.titleLineNumber??0).attr("x",E).attr("y",E+Y).attr("font-size",Y).attr("font-weight","700").attr("fill",n.text).text(e.title),e.tagGroups.length>0){let F=q?We(e.title,Y)+16:0,Q=E+F,ot={groups:e.tagGroups,position:{placement:"top-center",titleRelation:"inline-with-title"},mode:o?.exportMode?"export":"preview"},Z=Tr(ot,$-Q-E),lt=E+(Y-Z)/2,nt=X.append("g").attr("class","kanban-legend").attr("transform",`translate(${Q},${lt})`),at=!!s&&!a?{onGroupRendered:(it,vt,Tt)=>{let At=p?.name.toLowerCase()===it.toLowerCase(),rt=We(it,11),pt=Tt?10+rt+6:8+rt+4,ht=(Se-7)/2,dt=F7(vt,pt,ht,At,n);dt.append("title").text(`Group by ${it}`),dt.style("cursor","pointer").on("click",ut=>{ut.stopPropagation(),s?.(At?null:it)})}}:void 0;fn(nt,{...ot,palette:n,isDark:r,width:$-Q-E,activeGroup:i??null,...at!==void 0&&{callbacks:at}})}if(p){V7(X,e,K,p,n,r,i,l,c,m,E,G,V,x,P,L,S,C,T,k,B,j,w,M,I,W,z,D,N,_,R,H,O);return}let et=r?Gt(n.surface,n.bg,50):Gt(n.surface,n.bg,30),tt=r?Gt(n.surface,n.bg,70):Gt(n.surface,n.bg,50);for(let F of K.columns){let Q=F.column,ot=c?.has(Q.id)??!1,Z=X.append("g").attr("class","kanban-column").attr("data-column-id",Q.id).attr("data-line-number",Q.lineNumber),lt=et,nt=Q.color?ie(n,Q.color,r,{solid:u}):tt,J=Q.color?ve(nt,n.textOnFillLight,n.textOnFillDark):n.text;if(ot){Z.append("rect").attr("x",F.x).attr("y",F.y).attr("width",P).attr("height",F.height).attr("rx",W).attr("fill",lt),Z.append("rect").attr("x",F.x).attr("y",F.y).attr("width",P).attr("height",L).attr("rx",z).attr("fill",nt),Z.append("text").attr("x",F.x+P/2).attr("y",F.y+L/2+D/2-1).attr("font-size",D).attr("font-weight","bold").attr("fill",Q.color?J:n.textMuted).attr("text-anchor","middle").text(String(Q.cards.length)),Z.append("text").attr("x",F.x+P/2).attr("y",F.y+L+S).attr("font-size",H).attr("font-weight","bold").attr("fill",n.text).attr("text-anchor","middle").attr("writing-mode","tb").text(Q.name);continue}Z.append("rect").attr("x",F.x).attr("y",F.y).attr("width",F.width).attr("height",F.height).attr("rx",W).attr("fill",lt),Z.append("rect").attr("x",F.x).attr("y",F.y).attr("width",F.width).attr("height",L).attr("rx",z).attr("fill",nt),Z.append("text").attr("x",F.x+S).attr("y",F.y+L/2+I/2-2).attr("font-size",I).attr("font-weight","bold").attr("fill",J).text(Q.name);{let at=Q.wipLimit!=null&&Q.cards.length>Q.wipLimit,it=Q.wipLimit!=null?`${Q.cards.length}/${Q.wipLimit}`:String(Q.cards.length);Z.append("text").attr("x",F.x+F.width-S).attr("y",F.y+L/2+D/2-1).attr("text-anchor","end").attr("font-size",D).attr("fill",at?n.colors.red:Q.color?J:n.textMuted).attr("font-weight",at?"bold":"normal").text(it)}for(let at of F.cardLayouts){let it=at.card,vt=hD(it,e.tagGroups,i??null),Tt=mg(it,e.tagGroups,m),At=Tt.length>0||it.details.length>0,rt=ie(n,vt??n.primary,r,{solid:u}),pt=vt??n.textMuted,ht=ve(rt,n.textOnFillLight,n.textOnFillDark),dt=Z.append("g").attr("class","kanban-card").attr("data-card-id",it.id).attr("data-line-number",it.lineNumber);if(i){let Ot=qt(i),Xt=it.tags[Ot],bt=e.tagGroups.find(Vt=>Vt.name.toLowerCase()===Ot),Nt=Xt??bt?.defaultValue;Nt&&dt.attr(`data-tag-${Ot}`,Nt.toLowerCase())}let ut=F.x+at.x,yt=F.y+at.y;dt.append("rect").attr("x",ut).attr("y",yt).attr("width",at.width).attr("height",at.height).attr("rx",N).attr("fill",rt).attr("stroke",pt).attr("stroke-width",R);let kt=dt.append("text").attr("x",ut+_).attr("y",yt+T+H).attr("font-size",H).attr("font-weight","500").attr("fill",ht);if(gn(kt,it.title,n,H),At){let Ot=yt+C;dt.append("line").attr("x1",ut).attr("y1",Ot).attr("x2",ut+at.width).attr("y2",Ot).attr("stroke",u?ht:pt).attr("stroke-opacity",.3).attr("stroke-width",1);let Xt=Ot+w+O;for(let bt of Tt){dt.append("text").attr("x",ut+_).attr("y",Xt).attr("font-size",O).attr("fill",ht).text(`${bt.label}: `);let Nt=_t(`${bt.label}: `,O);dt.append("text").attr("x",ut+_+Nt).attr("y",Xt).attr("font-size",O).attr("fill",ht).text(bt.value),Xt+=M}for(let bt of it.details){let Nt=dt.append("text").attr("x",ut+_).attr("y",Xt).attr("font-size",O).attr("fill",ht);gn(Nt,bt,n,O),Xt+=M}}}}}function B7(t,e,n){let r=qc(t,n);if(r.error||r.columns.length===0)return"";let o=e==="dark",a=gD(r,n),i=document.createElement("div");return yD(i,r,n,o,{exportDims:{width:a.totalWidth,height:a.totalHeight},exportMode:!0}),i.querySelector("svg")?.outerHTML??""}function F7(t,e,n,r,o){let a=t.append("g").attr("class","kanban-swimlane-icon").attr("transform",`translate(${e}, ${n})`);a.append("rect").attr("x",-5).attr("y",-5).attr("width",22).attr("height",18).attr("fill","transparent");let i=r?o.primary:o.textMuted,s=r?1:.35,l=[8,12,6],c=2,d=3;for(let u=0;u<l.length;u++)a.append("rect").attr("x",0).attr("y",u*d).attr("width",l[u]).attr("height",c).attr("rx",1).attr("fill",i).attr("opacity",s);return a}function Y7(t,e){let n=qt(e.name),r=new Map;for(let a of e.entries)r.set(a.value.toLowerCase(),{laneName:a.value,laneColor:a.color,isFallback:!1,cellsByColumn:{}});let o=`__no_${n}__`;for(let a of t)for(let i of a.cards){let s=i.tags[n]??e.defaultValue,l;s&&r.has(s.toLowerCase())?l=s.toLowerCase():(r.has(o)||r.set(o,{laneName:`No ${e.name}`,isFallback:!0,cellsByColumn:{}}),l=o);let c=r.get(l);(c.cellsByColumn[a.id]??=[]).push(i)}return Array.from(r.values())}function uD(t,e,n,r=gd,o=yd,a=hd,i=md){let l=mg(t,e,n).length+t.details.length,c=l>0?r+1+o+l*a:0;return i+o+c}function z7(t,e,n,r,o,a,i=Ef,s=dg,l=a1,c=Sf,d=pg,u=ig,f=sg,p=md,m=yd,h=lg,g=o1,v=i1,y=gd,b=hd){let E=t.title&&t.options["no-title"]!=="on"?s+8:0,x=i+E,L=[],S=i+l;for(let N of n.columns){let T=o?.has(N.column.id)??!1?d:N.width;L.push({column:N.column,x:S,width:T}),S+=T+c}let A=S-c+i,C=[],M=x+u+f,w=p+m+h;for(let N of e){if(r?.has(N.laneName)??!1){let H=L.map(O=>({column:O.column,cards:N.cellsByColumn[O.column.id]??[],cardLayouts:[]}));C.push({bucket:N,y:M,height:g,cells:H}),M+=g+v;continue}let T=w,R=[];for(let H of L){let O=o?.has(H.column.id)??!1,D=N.cellsByColumn[H.column.id]??[];if(O){R.push({column:H.column,cards:D,h:0});continue}let W=0;for(let z of D)W+=uD(z,t.tagGroups,a,y,m,b,p)+h;W=Math.max(W-(D.length>0?h:0),0),R.push({column:H.column,cards:D,h:W}),W>T&&(T=W)}let G=Math.max(T,w),I=R.map((H,O)=>{let D=L[O];if(o?.has(D.column.id)??!1)return{column:H.column,cards:H.cards,cardLayouts:[]};let z=[],P=0;for(let B of H.cards){let Y=uD(B,t.tagGroups,a,y,m,b,p);z.push({x:D.x+f,y:M+P,width:D.width-f*2,height:Y,card:B}),P+=Y+h}return{column:H.column,cards:H.cards,cardLayouts:z}});C.push({bucket:N,y:M,height:G,cells:I}),M+=G+v}let k=M-v+f+i;return{columnXs:L,lanes:C,totalWidth:A,totalHeight:k,startY:x}}function V7(t,e,n,r,o,a,i,s,l,c,d=Ef,u=dg,f=a1,p=Sf,m=pg,h=ig,g=sg,v=md,y=yd,b=lg,E=o1,x=i1,L=gd,S=hd,A=r1,C=pD,M=mD,w=fD,k=6,N=cg,_=n1,T=ug,R=fg){let G=e.columns.filter(P=>!ag(P.name)),I=Y7(G,r),H=z7(e,I,n,s,l,c,d,u,f,p,m,h,g,v,y,b,E,x,L,S),O=parseFloat(t.attr("width")||"0"),D=parseFloat(t.attr("height")||"0");H.totalWidth>O&&(t.attr("width",H.totalWidth),t.attr("viewBox",`0 0 ${H.totalWidth} ${Math.max(D,H.totalHeight)}`)),H.totalHeight>D&&(t.attr("height",H.totalHeight),t.attr("viewBox",`0 0 ${Math.max(O,H.totalWidth)} ${H.totalHeight}`));let W=a?Gt(o.surface,o.bg,50):Gt(o.surface,o.bg,30),z=a?Gt(o.surface,o.bg,70):Gt(o.surface,o.bg,50);for(let P of H.columnXs){let B=P.column,Y=l?.has(B.id)??!1,V=t.append("g").attr("class","kanban-column kanban-column-header").attr("data-column-id",B.id).attr("data-line-number",B.lineNumber),j=B.color?ie(o,B.color,a,{solid:e.options["solid-fill"]==="on"}):z;if(V.append("rect").attr("x",P.x).attr("y",H.startY).attr("width",P.width).attr("height",h).attr("rx",M).attr("fill",j),Y)V.append("text").attr("x",P.x+P.width/2).attr("y",H.startY+h/2+w/2-1).attr("font-size",w).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String(B.cards.length));else{V.append("text").attr("x",P.x+g).attr("y",H.startY+h/2+A/2-2).attr("font-size",A).attr("font-weight","bold").attr("fill",o.text).text(B.name);let K=B.wipLimit!=null&&B.cards.length>B.wipLimit,$=B.wipLimit!=null?`${B.cards.length}/${B.wipLimit}`:String(B.cards.length);V.append("text").attr("x",P.x+P.width-g).attr("y",H.startY+h/2+w/2-1).attr("text-anchor","end").attr("font-size",w).attr("fill",K?o.colors.red:o.textMuted).attr("font-weight",K?"bold":"normal").text($)}}for(let P of H.lanes){let B=s?.has(P.bucket.laneName)??!1,Y=t.append("g").attr("class","kanban-lane").attr("data-lane-name",P.bucket.laneName),V=Y.append("g").attr("class","kanban-lane-header").attr("transform",`translate(${d}, ${P.y-g})`);V.append("rect").attr("x",0).attr("y",0).attr("width",f-8).attr("height",P.height+g*2).attr("rx",C).attr("fill",W);let j=10,K=P.cells.reduce(($,U)=>$+U.cards.length,0);if(P.bucket.laneColor&&(V.append("circle").attr("cx",j+4).attr("cy",16).attr("r",4).attr("fill",P.bucket.laneColor),j+=14),B?V.append("text").attr("x",j).attr("y",20).attr("font-size",10).attr("fill",o.textMuted).text(`${P.bucket.laneName} (${K})`):V.append("text").attr("x",j).attr("y",20).attr("font-size",12).attr("font-weight","bold").attr("fill",P.bucket.isFallback?o.textMuted:o.text).text(P.bucket.laneName),B)for(let $ of P.cells){let U=l?.has($.column.id)??!1;if($.cards.length>0){let X=H.columnXs.find(tt=>tt.column.id===$.column.id);if(!X)continue;let q=P.bucket.laneColor?Gt(P.bucket.laneColor,o.bg,a?40:28):Gt(o.textMuted,o.bg,a?28:22),et=U?m-8:X.width-g*2;Y.append("rect").attr("x",X.x+(U?4:g)).attr("y",P.y).attr("width",et).attr("height",18).attr("rx",4).attr("fill",q),Y.append("text").attr("x",X.x+(U?4:g)+et/2).attr("y",P.y+13).attr("font-size",w).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String($.cards.length))}}if(Y.append("line").attr("x1",d+f).attr("x2",H.totalWidth-d).attr("y1",P.y+P.height+g).attr("y2",P.y+P.height+g).attr("stroke",o.border??o.textMuted).attr("stroke-opacity",.4).attr("stroke-width",1),!B)for(let $ of P.cells){if((l?.has($.column.id)??!1)&&$.cards.length>0){let X=H.columnXs.find(q=>q.column.id===$.column.id);if(X){let q=P.bucket.laneColor?Gt(P.bucket.laneColor,o.bg,a?40:28):Gt(o.textMuted,o.bg,a?28:22);Y.append("rect").attr("x",X.x+4).attr("y",P.y).attr("width",m-8).attr("height",22).attr("rx",4).attr("fill",q),Y.append("text").attr("x",X.x+m/2).attr("y",P.y+16).attr("font-size",w).attr("font-weight","bold").attr("fill",o.textMuted).attr("text-anchor","middle").text(String($.cards.length))}continue}for(let X of $.cardLayouts)U7(Y,X,e.tagGroups,i,o,a,c,e.options["solid-fill"]==="on",k,N,y,_,T,R,v,L,S)}}}function U7(t,e,n,r,o,a,i,s,l=6,c=cg,d=yd,u=n1,f=ug,p=fg,m=md,h=gd,g=hd){let v=e.card,y=hD(v,n,r),b=mg(v,n,i),E=b.length>0||v.details.length>0,x=ie(o,y??o.primary,a,{...s!==void 0&&{solid:s}}),L=y??o.textMuted,S=ve(x,o.textOnFillLight,o.textOnFillDark),A=t.append("g").attr("class","kanban-card").attr("data-card-id",v.id).attr("data-line-number",v.lineNumber);if(r){let k=qt(r),N=n.find(T=>T.name.toLowerCase()===k),_=v.tags[k]??N?.defaultValue;_&&A.attr(`data-tag-${k}`,_.toLowerCase())}let C=e.x,M=e.y;A.append("rect").attr("x",C).attr("y",M).attr("width",e.width).attr("height",e.height).attr("rx",l).attr("fill",x).attr("stroke",L).attr("stroke-width",u);let w=A.append("text").attr("x",C+c).attr("y",M+d+f).attr("font-size",f).attr("font-weight","500").attr("fill",S);if(gn(w,v.title,o,f),E){let k=M+m;A.append("line").attr("x1",C).attr("y1",k).attr("x2",C+e.width).attr("y2",k).attr("stroke",L).attr("stroke-opacity",.3).attr("stroke-width",1);let N=k+h+p;for(let _ of b){A.append("text").attr("x",C+c).attr("y",N).attr("font-size",p).attr("fill",o.textMuted).text(`${_.label}: `);let T=_t(`${_.label}: `,p);A.append("text").attr("x",C+c+T).attr("y",N).attr("font-size",p).attr("fill",S).text(_.value),N+=g}for(let _ of v.details){let T=A.append("text").attr("x",C+c).attr("y",N).attr("font-size",p).attr("fill",o.textMuted);gn(T,_,o,p),N+=g}}}var Ef,Sf,ig,sg,e1,md,hd,gd,lg,cg,yd,n1,dg,r1,ug,fg,fD,pD,mD,pg,o1,a1,i1,xD=st(()=>{"use strict";Ke();Xn();on();tn();_o();fh();dD();Mr();To();Br();fr();en();Ef=20,Sf=16,ig=36,sg=12,e1=200,md=24,hd=14,gd=4,lg=8,cg=10,yd=6,n1=1.5,dg=30,r1=13,ug=12,fg=10,fD=10,pD=8,mD=8,pg=40,o1=26;a1=140,i1=14});var ED={};ye(ED,{layoutClassDiagram:()=>l1});function Q7(t){let e=t.members.filter(d=>!d.isMethod),n=t.members.filter(d=>d.isMethod),r=t.modifier==="enum",o=_t(t.name,K7);t.modifier&&(o=Math.max(o,_t(`\xAB${t.modifier}\xBB`,wD)));for(let d of t.members){let u=d.name;d.isMethod?(u+=`(${d.params??""})`,d.type&&(u+=`: ${d.type}`)):d.type&&(u+=`: ${d.type}`),u=`+ ${u}`,o=Math.max(o,_t(u,wD))}let a=Math.max(X7,o+j7),i=q7+(t.modifier?Z7:0),s;if(r){let d=t.members;d.length>0?s=bd*2+d.length*s1+xd:s=xd+bd}else e.length>0?s=bd*2+e.length*s1+xd:s=xd+bd;let l=0;r||(n.length>0?l=bd*2+n.length*s1+xd:l=xd+bd);let c=i+s+l;return{width:a,height:c,headerHeight:i,fieldsHeight:s,methodsHeight:l}}function l1(t,e){if(t.classes.length===0)return{nodes:[],edges:[],width:0,height:0};let n=new er.graphlib.Graph;n.setGraph({rankdir:"TB",nodesep:60,ranksep:80,edgesep:20}),n.setDefaultEdgeLabel(()=>({}));let r=new Map;for(let x of t.classes){let L=Q7(x);r.set(x.id,L),n.setNode(x.id,{label:x.name,width:L.width,height:L.height})}for(let x of t.relationships)n.setEdge(x.source,x.target,{label:x.label??""});er.layout(n);let a=t.options?.["no-notes"]==="on"||!t.notes?new Map:no(t.notes,t.classes.map(x=>({id:x.id,label:x.name}))),i=$c(t.classes.map(x=>{let L=n.node(x.id);return{id:x.id,x:L.x,y:L.y,width:L.width,height:L.height}}),a,"TB",e?.collapsedNotes),s=t.classes.map(x=>{let L=n.node(x.id),S=r.get(x.id),A=i.get(x.id);return{...x,x:L.x,y:L.y,width:S.width,height:S.height,headerHeight:S.headerHeight,fieldsHeight:S.fieldsHeight,methodsHeight:S.methodsHeight,...A&&{note:A}}}),l=t.relationships.map(x=>{let L=n.edge(x.source,x.target);return{source:x.source,target:x.target,type:x.type,points:L?.points??[],...x.label!==void 0&&{label:x.label},lineNumber:x.lineNumber}}),c=1/0,d=1/0,u=-1/0,f=-1/0,p=(x,L,S,A)=>{x<c&&(c=x),L<d&&(d=L),S>u&&(u=S),A>f&&(f=A)};for(let x of s)p(x.x-x.width/2,x.y-x.height/2,x.x+x.width/2,x.y+x.height/2),x.note&&!x.note.collapsed&&p(x.x+x.note.x,x.y+x.note.y,x.x+x.note.x+x.note.width,x.y+x.note.y+x.note.height);Number.isFinite(c)||(c=0,d=0,u=0,f=0);let{shiftX:m,shiftY:h}=Hs(c,d),g=m!==0||h!==0,v=g?s.map(x=>({...x,x:x.x+m,y:x.y+h})):s,y=g?l.map(x=>({...x,points:x.points.map(L=>({x:L.x+m,y:L.y+h}))})):l,b=u+m+40,E=f+h+40;return{nodes:v,edges:y,width:b,height:E}}var X7,j7,q7,K7,wD,Z7,s1,bd,xd,c1=st(()=>{"use strict";ss();en();ts();X7=140,j7=24,q7=36,K7=13,wD=11,Z7=16,s1=18,bd=8,xd=1});var MD={};ye(MD,{renderClassDiagram:()=>ND,renderClassDiagramForExport:()=>hZ});function kD(t,e,n){if(n)return e.textMuted;switch(t){case"interface":return e.colors.blue;case"abstract":return e.colors.purple;case"enum":return e.colors.yellow;default:return e.colors.teal}}function iZ(t,e,n,r,o,a){let i=r??kD(n,t,o);return ie(t,i,e,{...a!==void 0&&{solid:a}})}function sZ(t,e,n,r){return n??kD(e,t,r)}function LD(t){if(t.options?.["no-auto-color"])return[];let e=new Set;for(let n of t.classes)n.color||e.add(n.modifier??"class");return cZ.filter(n=>e.has(n)).map(n=>lZ[n])}function dZ(t){return t??"class"}function vD(t){switch(t){case"public":return"+";case"private":return"-";case"protected":return"#"}}function fZ(t){return t==="implements"||t==="depends"}function pZ(t){switch(t){case"extends":return"cd-arrow-inherit";case"implements":return"cd-arrow-implement";case"composes":return"cd-arrow-compose";case"aggregates":return"cd-arrow-aggregate";case"depends":return"cd-arrow-depend";case"associates":return"cd-arrow-assoc"}}function mZ(t){return t==="composes"||t==="aggregates"}function ND(t,e,n,r,o,a,i,s,l){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let c=i?.width??t.clientWidth,d=i?.height??t.clientHeight;if(c<=0||d<=0)return;let u=Ee.identity(),f=u.aesthetic(d1),p=u.text(tZ),m=u.text(eZ),h=u.text(nZ),g=u.structural(1.5),v=u.structural(1.5),y=u.structural(rZ),b=u.structural(oZ),E=u.structural(aZ),x=u.text(20),L=u.structural(30),S=u.structural(Se),A=LD(e),C=A.length>1,M=!!e.title&&e.options["no-title"]!=="on",w=M?40:0,N=u.aesthetic(8),_=C?S+N:0,T=n.width,R=n.height,G=d-w-_,I=(c-f*2)/T,H=(G-f*2)/R,O=Math.min(J7,I,H),D=T*O,W=(c-D)/2,z=w+_+f,P=Rt(t).append("svg").attr("width",c).attr("height",d).attr("viewBox",`0 0 ${c} ${d}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It);u.isBelowFloor&&P.attr("width","100%");let B=P.append("defs"),Y=12,V=8;B.append("marker").attr("id","cd-arrow-inherit").attr("viewBox",`0 0 ${Y} ${V}`).attr("refX",Y).attr("refY",V/2).attr("markerWidth",Y).attr("markerHeight",V).attr("orient","auto").append("polygon").attr("points",`0,0 ${Y},${V/2} 0,${V}`).attr("fill",r.textMuted).attr("stroke",r.textMuted).attr("stroke-width",1),B.append("marker").attr("id","cd-arrow-implement").attr("viewBox",`0 0 ${Y} ${V}`).attr("refX",Y).attr("refY",V/2).attr("markerWidth",Y).attr("markerHeight",V).attr("orient","auto").append("polygon").attr("points",`0,0 ${Y},${V/2} 0,${V}`).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1);let j=12,K=8;if(B.append("marker").attr("id","cd-arrow-compose").attr("viewBox",`0 0 ${j} ${K}`).attr("refX",0).attr("refY",K/2).attr("markerWidth",j).attr("markerHeight",K).attr("orient","auto").append("polygon").attr("points",`${j/2},0 ${j},${K/2} ${j/2},${K} 0,${K/2}`).attr("fill",r.textMuted).attr("stroke",r.textMuted).attr("stroke-width",1),B.append("marker").attr("id","cd-arrow-aggregate").attr("viewBox",`0 0 ${j} ${K}`).attr("refX",0).attr("refY",K/2).attr("markerWidth",j).attr("markerHeight",K).attr("orient","auto").append("polygon").attr("points",`${j/2},0 ${j},${K/2} ${j/2},${K} 0,${K/2}`).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1),B.append("marker").attr("id","cd-arrow-depend").attr("viewBox",`0 0 ${Y} ${V}`).attr("refX",Y).attr("refY",V/2).attr("markerWidth",Y).attr("markerHeight",V).attr("orient","auto").append("polyline").attr("points",`0,0 ${Y},${V/2} 0,${V}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5),B.append("marker").attr("id","cd-arrow-assoc").attr("viewBox",`0 0 ${Y} ${V}`).attr("refX",Y).attr("refY",V/2).attr("markerWidth",Y).attr("markerHeight",V).attr("orient","auto").append("polyline").attr("points",`0,0 ${Y},${V/2} 0,${V}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5),M){let X=P.append("text").attr("class","chart-title").attr("x",c/2).attr("y",L).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",x).attr("font-weight","700").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(X.attr("data-line-number",e.titleLineNumber),a&&X.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){Rt(this).attr("opacity",.7)}).on("mouseleave",function(){Rt(this).attr("opacity",1)}))}let $=s!==!1;if(C){let X=[{name:SD,entries:A.map(et=>({value:et.label,color:r.colors[et.colorKey]}))}],q=P.append("g").attr("class","cd-legend").attr("transform",`translate(0,${w})`);fn(q,{groups:X,activeGroup:$?SD:null,mode:l?"export":"preview",palette:r,isDark:o,width:c})}let U=P.append("g").attr("transform",`translate(${W}, ${z}) scale(${O})`);for(let X of n.edges){if(X.points.length<2)continue;let q=U.append("g").attr("class","cd-edge-group").attr("data-line-number",String(X.lineNumber)).attr("data-source",X.source).attr("data-target",X.target),et=r.textMuted,tt=pZ(X.type),F=fZ(X.type),Q=mZ(X.type),ot=uZ(X.points);if(ot){let Z=q.append("path").attr("d",ot).attr("fill","none").attr("stroke",et).attr("stroke-width",g).attr("class","cd-edge");F&&Z.attr("stroke-dasharray","6 3"),Q?Z.attr("marker-start",`url(#${tt})`):Z.attr("marker-end",`url(#${tt})`)}if(X.label){let Z=Math.floor(X.points.length/2),lt=X.points[Z],nt=_t(X.label,h)+8,J=16;q.append("rect").attr("x",lt.x-nt/2).attr("y",lt.y-J/2-1).attr("width",nt).attr("height",J).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","cd-edge-label-bg"),q.append("text").attr("x",lt.x).attr("y",lt.y+4).attr("text-anchor","middle").attr("fill",et).attr("font-size",h).attr("class","cd-edge-label").text(X.label)}}for(let X of n.nodes){let q=U.append("g").attr("transform",`translate(${X.x}, ${X.y})`).attr("class","cd-class").attr("data-line-number",String(X.lineNumber)).attr("data-node-id",X.id).attr("data-cd-type",dZ(X.modifier));a&&q.style("cursor","pointer").on("click",()=>{a(X.lineNumber)});let et=X.width,tt=X.height,F=!!e.options?.["no-auto-color"],ot=C&&!$&&!X.color?r.primary:X.color,Z=e.options?.["solid-fill"]==="on",lt=iZ(r,o,X.modifier,ot,F,Z),nt=sZ(r,X.modifier,ot,F),J=ve(lt,r.textOnFillLight,r.textOnFillDark);q.append("rect").attr("x",-et/2).attr("y",-tt/2).attr("width",et).attr("height",tt).attr("rx",3).attr("ry",3).attr("fill",lt).attr("stroke",nt).attr("stroke-width",v);let at=-tt/2,it=at+X.headerHeight/2;if(X.modifier){let rt=`\xAB${X.modifier}\xBB`;q.append("text").attr("x",0).attr("y",it-6).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",J).attr("font-size",m).attr("font-style","italic").text(rt),q.append("text").attr("x",0).attr("y",it+10).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",J).attr("font-size",p).attr("font-weight","bold").attr("font-style",X.modifier==="abstract"?"italic":"normal").text(X.name)}else q.append("text").attr("x",0).attr("y",it).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",J).attr("font-size",p).attr("font-weight","bold").text(X.name);at+=X.headerHeight;let vt=X.modifier==="enum",Tt=X.members.filter(rt=>!rt.isMethod),At=X.members.filter(rt=>rt.isMethod);if(vt){q.append("line").attr("x1",-et/2).attr("y1",at).attr("x2",et/2).attr("y2",at).attr("stroke",Z?J:nt).attr("stroke-width",.5).attr("stroke-opacity",.5);let rt=at+b;for(let pt of X.members)q.append("text").attr("x",-et/2+E).attr("y",rt+y/2).attr("dominant-baseline","central").attr("fill",J).attr("font-size",m).text(pt.name),rt+=y}else{if(q.append("line").attr("x1",-et/2).attr("y1",at).attr("x2",et/2).attr("y2",at).attr("stroke",Z?J:nt).attr("stroke-width",.5).attr("stroke-opacity",.5),Tt.length>0){let rt=at+b;for(let pt of Tt){let dt=`${vD(pt.visibility)} ${pt.name}`;pt.type&&(dt+=`: ${pt.type}`);let ut=q.append("text").attr("x",-et/2+E).attr("y",rt+y/2).attr("dominant-baseline","central").attr("fill",J).attr("font-size",m);pt.isStatic&&ut.attr("text-decoration","underline"),ut.text(dt),rt+=y}}if(at+=X.fieldsHeight,q.append("line").attr("x1",-et/2).attr("y1",at).attr("x2",et/2).attr("y2",at).attr("stroke",Z?J:nt).attr("stroke-width",.5).attr("stroke-opacity",.5),At.length>0){let rt=at+b;for(let pt of At){let dt=`${vD(pt.visibility)} ${pt.name}(${pt.params??""})`;pt.type&&(dt+=`: ${pt.type}`);let ut=q.append("text").attr("x",-et/2+E).attr("y",rt+y/2).attr("dominant-baseline","central").attr("fill",J).attr("font-size",m);pt.isStatic&&ut.attr("text-decoration","underline"),ut.text(dt),rt+=y}}}if(X.note)if(X.note.collapsed)Ni(q,{x:et/2-Fo-3,y:-tt/2+Fo+3},r,{isDark:o,...X.note.color&&{color:X.note.color},lineNumber:X.note.lineNumber,endLineNumber:X.note.endLineNumber});else{let[rt,pt,ht,dt]=ki({width:et,height:tt},X.note);vi(q,rt,pt,ht,dt,r),Li(q,{x:X.note.x,y:X.note.y,width:X.note.width,height:X.note.height},X.note.lines,r,{isDark:o,...X.note.color&&{color:X.note.color},lineNumber:X.note.lineNumber,endLineNumber:X.note.endLineNumber,interactive:!0})}}}function hZ(t,e,n){let r=Fc(t,n);if(r.error||r.classes.length===0)return"";let o=l1(r),a=e==="dark",l=LD(r).length>1?Se+8:0,c=o.width+d1*2,d=o.height+d1*2+(r.title?40:0)+l;return ld(c,d,u=>(ND(u,r,o,n,a,void 0,{width:c,height:d},!0,!0),cd(u,e)))}var d1,J7,tZ,eZ,nZ,rZ,oZ,aZ,lZ,cZ,SD,uZ,TD=st(()=>{"use strict";Xn();Eo();on();Qh();Mr();Br();tn();Ku();c1();fr();en();Mi();d1=20,J7=3,tZ=13,eZ=11,nZ=11,rZ=18,oZ=8,aZ=10;lZ={class:{label:"Class",colorKey:"teal"},abstract:{label:"Abstract",colorKey:"purple"},interface:{label:"Interface",colorKey:"blue"},enum:{label:"Enum",colorKey:"yellow"}},cZ=["class","abstract","interface","enum"];SD="Type";uZ=Kn().x(t=>t.x).y(t=>t.y).curve(fo)});var _D={};ye(_D,{layoutERDiagram:()=>p1});function kZ(t){let e=_t(t.name,yZ);for(let i of t.columns){let s=i.name;i.type&&(s+=`: ${i.type}`);let l=_t(s,bZ);i.constraints.length>0&&(l+=wZ),e=Math.max(e,l)}let n=Math.max(u1,e+gZ),r=f1,o=0;t.columns.length>0&&(o=SZ*2+t.columns.length*EZ+vZ);let a=r+o+(o===0?4:0);return{width:n,height:a,headerHeight:r,columnsHeight:o}}function LZ(t,e){let n=new Map;for(let a of t)n.set(a,new Set);for(let a of e)n.get(a.source)?.add(a.target),n.get(a.target)?.add(a.source);let r=new Set,o=[];for(let a of t){if(r.has(a))continue;let i=[],s=[a];for(;s.length>0;){let l=s.shift();if(!r.has(l)){r.add(l),i.push(l);for(let c of n.get(l)??[])r.has(c)||s.push(c)}}o.push(i)}return o}function NZ(t,e,n){let r=new Map,o=new Map;if(t.length===1){let d=t[0],u=n.get(d.id);return r.set(d.id,{x:u.width/2,y:u.height/2,...u}),{nodePositions:r,edgePoints:o,width:u.width,height:u.height}}let a=new er.graphlib.Graph({multigraph:!0});a.setGraph({rankdir:"LR",nodesep:40,ranksep:80,edgesep:20}),a.setDefaultEdgeLabel(()=>({}));for(let d of t){let u=n.get(d.id);a.setNode(d.id,{width:u.width,height:u.height})}for(let d of e)a.setEdge(d.source,d.target,{label:d.label??""},String(d.lineNumber));er.layout(a);let i=1/0,s=1/0,l=-1/0,c=-1/0;for(let d of t){let u=a.node(d.id),f=n.get(d.id);i=Math.min(i,u.x-f.width/2),s=Math.min(s,u.y-f.height/2),l=Math.max(l,u.x+f.width/2),c=Math.max(c,u.y+f.height/2)}for(let d of e){let u=a.edge(d.source,d.target,String(d.lineNumber));for(let f of u?.points??[])i=Math.min(i,f.x),s=Math.min(s,f.y),l=Math.max(l,f.x),c=Math.max(c,f.y);if(d.label&&(u?.points??[]).length>0){let f=u.points,p=f[Math.floor(f.length/2)],m=(_t(d.label,xZ)+8)/2;i=Math.min(i,p.x-m),l=Math.max(l,p.x+m)}}for(let d of t){let u=a.node(d.id),f=n.get(d.id);r.set(d.id,{x:u.x-i,y:u.y-s,...f})}for(let d of e){let u=a.edge(d.source,d.target,String(d.lineNumber));o.set(d.lineNumber,(u?.points??[]).map(f=>({x:f.x-i,y:f.y-s})))}return{nodePositions:r,edgePoints:o,width:Math.max(0,l-i),height:Math.max(0,c-s)}}function MZ(t){if(t.length===0)return[];let e=[...t].sort((l,c)=>{let d=l.compIds.length>1?1:0,u=c.compIds.length>1?1:0;return d!==u?u-d:c.compLayout.height-l.compLayout.height}),n=t.reduce((l,c)=>l+(c.compLayout.width||u1)*(c.compLayout.height||f1),0),r=Math.max(Math.sqrt(n)*1.5,e[0].compLayout.width),o=[],a=0,i=0,s=0;for(let l of e){let c=l.compLayout.width||u1,d=l.compLayout.height||f1;a>0&&a+c>r&&(i+=s+CD,a=0,s=0),o.push({compIds:l.compIds,compLayout:l.compLayout,offsetX:a,offsetY:i}),a+=c+CD,s=Math.max(s,d)}return o}function p1(t,e){if(t.tables.length===0)return{nodes:[],edges:[],width:0,height:0};let n=new Map;for(let C of t.tables)n.set(C.id,kZ(C));let r=LZ(t.tables.map(C=>C.id),t.relationships),o=new Map(t.tables.map(C=>[C.id,C])),a=r.map(C=>{let M=C.map(k=>o.get(k)),w=t.relationships.filter(k=>C.includes(k.source));return{compIds:C,compLayout:NZ(M,w,n)}}),i=MZ(a),s=new Map;for(let C of i)for(let M of C.compIds)s.set(M,C);let l=new Map;for(let C of i)for(let M of C.compLayout.edgePoints.keys())l.set(M,C);let c=t.tables.map(C=>{let M=s.get(C.id),w=M.compLayout.nodePositions.get(C.id);return{...C,x:w.x+M.offsetX+wd,y:w.y+M.offsetY+wd,width:w.width,height:w.height,headerHeight:w.headerHeight,columnsHeight:w.columnsHeight}}),d=t.relationships.map(C=>{let M=l.get(C.lineNumber),w=M?.compLayout.edgePoints.get(C.lineNumber)??[];return{source:C.source,target:C.target,cardinality:C.cardinality,points:w.map(k=>({x:k.x+(M?.offsetX??0)+wd,y:k.y+(M?.offsetY??0)+wd})),...C.label!==void 0&&{label:C.label},lineNumber:C.lineNumber}}),f=t.options?.["no-notes"]==="on"||!t.notes?new Map:no(t.notes,t.tables.map(C=>({id:C.id,label:C.name}))),p=$c(c.map(C=>({id:C.id,x:C.x,y:C.y,width:C.width,height:C.height})),f,"TB",e?.collapsedNotes),m=c.map(C=>{let M=p.get(C.id);return M?{...C,note:M}:C}),h=1/0,g=1/0,v=-1/0,y=-1/0,b=(C,M,w,k)=>{C<h&&(h=C),M<g&&(g=M),w>v&&(v=w),k>y&&(y=k)};for(let C of m)b(C.x-C.width/2,C.y-C.height/2,C.x+C.width/2,C.y+C.height/2),C.note&&!C.note.collapsed&&b(C.x+C.note.x,C.y+C.note.y,C.x+C.note.x+C.note.width,C.y+C.note.y+C.note.height);for(let C of d)for(let M of C.points)b(M.x,M.y,M.x,M.y);Number.isFinite(h)||(h=0,g=0,v=0,y=0);let{shiftX:E,shiftY:x}=Hs(h,g),L=E!==0||x!==0,S=L?m.map(C=>({...C,x:C.x+E,y:C.y+x})):m,A=L?d.map(C=>({...C,points:C.points.map(M=>({x:M.x+E,y:M.y+x}))})):d;return{nodes:S,edges:A,width:v+E+wd,height:y+x+wd}}var u1,gZ,f1,yZ,bZ,xZ,wZ,EZ,SZ,vZ,wd,CD,m1=st(()=>{"use strict";ss();en();ts();u1=140,gZ=24,f1=36,yZ=13,bZ=11,xZ=11,wZ=16,EZ=18,SZ=8,vZ=1,wd=30,CD=60});function ID(t,e){let n=new Map;if(t.length===0)return n;let r={};for(let f of t)r[f.id]=0;for(let f of e)f.source!==f.target&&(f.cardinality.from==="1"&&f.cardinality.to!=="1"&&(r[f.source]=(r[f.source]??0)+1),f.cardinality.to==="1"&&f.cardinality.from!=="1"&&(r[f.target]=(r[f.target]??0)+1));let o=new Map;for(let f of e)f.source!==f.target&&(f.cardinality.from==="*"&&(o.has(f.source)||o.set(f.source,new Set),o.get(f.source).add(f.target)),f.cardinality.to==="*"&&(o.has(f.target)||o.set(f.target,new Set),o.get(f.target).add(f.source)));let a=new Set;for(let[f,p]of o)p.size>=2&&a.add(f);let i=Object.values(r),s=i.reduce((f,p)=>f+p,0)/i.length,l=i.reduce((f,p)=>f+(p-s)**2,0)/i.length,c=Math.sqrt(l),d=[...i].sort((f,p)=>f-p),u=d.length%2===0?(d[d.length/2-1]+d[d.length/2])/2:d[Math.floor(d.length/2)];for(let f of t){let p=f.id,m=f.columns,h=m.filter(N=>N.constraints.includes("fk")),g=m.filter(N=>N.constraints.includes("pk")&&N.constraints.includes("fk")),v=h.length,y=m.length===0?0:v/m.length,b=r[p]??0,E=f.name.toLowerCase(),x=e.filter(N=>(N.source===p||N.target===p)&&N.source!==N.target),L=e.some(N=>N.source===p&&N.target===p),S=new Set;for(let N of x)S.add(N.source===p?N.target:N.source);if(L&&x.length===0){n.set(p,"self-referential");continue}let A=g.length>=2&&S.size===1,C=y>=.6&&!A,M=g.length>=2&&S.size>=2,w=a.has(p);if(C||M||w){n.set(p,"junction");continue}if(y>=.4&&y<.6&&g.length<2&&!a.has(p)){n.set(p,"ambiguous");continue}if(TZ.some(N=>E.endsWith(N))&&m.length<=6&&v<=1&&b>u){n.set(p,"lookup");continue}if(t.length>=6&&b>0&&b>s+1.5*c&&b>=2*s){n.set(p,"hub");continue}if(v>0){n.set(p,"dependent");continue}n.set(p,"core")}return n}var h1,AD,RD,TZ,PD=st(()=>{"use strict";h1={core:"green",dependent:"blue",junction:"red",ambiguous:"purple",lookup:"yellow",hub:"orange","self-referential":"teal",unclassified:"gray"},AD={core:"Core entity",dependent:"Dependent",junction:"Junction / M:M",ambiguous:"Bridge",lookup:"Lookup / Reference",hub:"Hub","self-referential":"Self-referential",unclassified:"Unclassified"},RD=["core","dependent","junction","ambiguous","lookup","hub","self-referential","unclassified"],TZ=["_type","_status","_code","_category"]});var $D={};ye($D,{renderERDiagram:()=>GD,renderERDiagramForExport:()=>GZ});function DZ(t){switch(t){case"pk":return"\u2666";case"fk":return"\u2192";case"unique":return"\u25C6";case"nullable":return"\u25CB"}}function DD(t,e,n,r,o,a,i=OD,s=1.5){let l=e.x-n.x,c=e.y-n.y,d=Math.sqrt(l*l+c*c);if(d===0)return;let u=l/d,f=c/d,p=-f,m=u,h=s+.5;if(a){let b=e.x-u*15,E=e.y-f*15,x=r==="1"?"1":r==="*"?"*":"0..1";t.append("text").attr("x",b+p*12).attr("y",E+m*12).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",o).attr("font-size",i).text(x);return}let g=14,v=9;if(r==="1"){let y=e.x-u*g,b=e.y-f*g;t.append("line").attr("x1",y+p*v).attr("y1",b+m*v).attr("x2",y-p*v).attr("y2",b-m*v).attr("stroke",o).attr("stroke-width",h)}else if(r==="*"){let E=e.x-u*18,x=e.y-f*18,L=e.x-u*5,S=e.y-f*5;t.append("line").attr("x1",E).attr("y1",x).attr("x2",L+p*v).attr("y2",S+m*v).attr("stroke",o).attr("stroke-width",h),t.append("line").attr("x1",E).attr("y1",x).attr("x2",L-p*v).attr("y2",S-m*v).attr("stroke",o).attr("stroke-width",h),t.append("line").attr("x1",E).attr("y1",x).attr("x2",L).attr("y2",S).attr("stroke",o).attr("stroke-width",h)}else if(r==="?"){let b=g+10+2,E=e.x-u*b,x=e.y-f*b;t.append("circle").attr("cx",E).attr("cy",x).attr("r",5).attr("fill","none").attr("stroke",o).attr("stroke-width",h);let L=e.x-u*g,S=e.y-f*g;t.append("line").attr("x1",L+p*v).attr("y1",S+m*v).attr("x2",L-p*v).attr("y2",S-m*v).attr("stroke",o).attr("stroke-width",h)}}function GD(t,e,n,r,o,a,i,s,l,c){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let d=e.tagGroups.length===0&&n.nodes.every(V=>!V.color),u=8,f=e.tagGroups.length>0,p=d?Se+u:f?Se+u:0,m=!!e.title&&e.options["no-title"]!=="on",h=m?40:0,g=n.width,v=n.height,y=Ee.identity(),b=y.aesthetic(g1),E=y.text(_Z),x=y.text(AZ),L=y.text(OD),S=y.structural(1.5),A=y.structural(1.5),C=y.structural(RZ),M=y.structural(IZ),w=y.structural(PZ),k=y.text(20),N=y.structural(30),_=g+b*2,T=v+h+p+b*2,R,G,I,H,O;if(i){R=i.width??_,G=i.height??T;let V=G-h-p,j=(R-b*2)/g,K=(V-b*2)/v;I=Math.min(CZ,j,K);let $=g*I;H=(R-$)/2,O=h+p+b}else R=_,G=T,I=1,H=b,O=h+p+b;if(R<=0||G<=0)return;let D=Rt(t).append("svg").attr("width",i?R:"100%").attr("height",i?G:"100%").attr("viewBox",`0 0 ${R} ${G}`).attr("preserveAspectRatio","xMidYMid meet").style("font-family",It);if(m){let V=D.append("text").attr("class","chart-title").attr("x",R/2).attr("y",N).attr("text-anchor","middle").attr("fill",r.text).attr("font-size",k).attr("font-weight","700").style("cursor",a&&e.titleLineNumber?"pointer":"default").text(e.title);e.titleLineNumber&&(V.attr("data-line-number",e.titleLineNumber),a&&V.on("click",()=>a(e.titleLineNumber)).on("mouseenter",function(){Rt(this).attr("opacity",.7)}).on("mouseleave",function(){Rt(this).attr("opacity",1)}))}let W=D.append("g").attr("transform",`translate(${H}, ${O}) scale(${I})`),z=ir(r),P=d?ID([...e.tables],[...e.relationships]):null,B=P!==null&&(l??!0),Y=e.options.notation==="labels";for(let V of n.edges){if(V.points.length<2)continue;let j=W.append("g").attr("class","er-edge-group").attr("data-line-number",String(V.lineNumber)).attr("data-source",V.source).attr("data-target",V.target),K=r.textMuted,$=OZ(V.points);$&&j.append("path").attr("d",$).attr("fill","none").attr("stroke",K).attr("stroke-width",S).attr("class","er-edge");let U=V.points;if(DD(j,U[0],U[1],V.cardinality.from,K,Y,L,S),DD(j,U[U.length-1],U[U.length-2],V.cardinality.to,K,Y,L,S),V.label){let X=Math.floor(U.length/2),q=U[X],et=_t(V.label,L)+8,tt=16;j.append("rect").attr("x",q.x-et/2).attr("y",q.y-tt/2-1).attr("width",et).attr("height",tt).attr("rx",3).attr("fill",r.bg).attr("opacity",.85).attr("class","er-edge-label-bg"),j.append("text").attr("x",q.x).attr("y",q.y+4).attr("text-anchor","middle").attr("fill",K).attr("font-size",L).attr("class","er-edge-label").text(V.label)}}for(let V=0;V<n.nodes.length;V++){let j=n.nodes[V],K=ar(j.metadata,[...e.tagGroups],s??null),$=B?r.colors[h1[P.get(j.id)??"unclassified"]]:P?r.primary:void 0,U=j.color??K??$??z[V%z.length],X=W.append("g").attr("transform",`translate(${j.x}, ${j.y})`).attr("class","er-table").attr("data-line-number",String(j.lineNumber)).attr("data-node-id",j.id);if(s){let lt=qt(s),nt=j.metadata[lt];nt&&X.attr(`data-tag-${lt}`,nt.toLowerCase())}if(P){let lt=P.get(j.id);lt&&X.attr("data-er-role",lt)}a&&X.style("cursor","pointer").on("click",()=>{a(j.lineNumber)});let q=j.width,et=j.height,tt=ie(r,U,o,{solid:e.options["solid-fill"]==="on"}),F=U,Q=ve(tt,r.textOnFillLight,r.textOnFillDark);X.append("rect").attr("x",-q/2).attr("y",-et/2).attr("width",q).attr("height",et).attr("rx",3).attr("ry",3).attr("fill",tt).attr("stroke",F).attr("stroke-width",A);let ot=-et/2,Z=ot+j.headerHeight/2;if(X.append("text").attr("x",0).attr("y",Z).attr("text-anchor","middle").attr("dominant-baseline","central").attr("fill",Q).attr("font-size",E).attr("font-weight","bold").text(j.name),ot+=j.headerHeight,j.columns.length>0){X.append("line").attr("x1",-q/2).attr("y1",ot).attr("x2",q/2).attr("y2",ot).attr("stroke",F).attr("stroke-width",.5).attr("stroke-opacity",.5);let lt=ot+M;for(let nt of j.columns){let J=-q/2+w,at=nt.constraints[0];at&&X.append("text").attr("x",J).attr("y",lt+C/2).attr("dominant-baseline","central").attr("fill",Q).attr("font-size",x).text(DZ(at));let it=-q/2+w+(at?16:0),vt=nt.name;nt.type&&(vt+=`: ${nt.type}`),X.append("text").attr("x",it).attr("y",lt+C/2).attr("dominant-baseline","central").attr("fill",Q).attr("font-size",x).text(vt),lt+=C}}if(j.note)if(j.note.collapsed)Ni(X,{x:q/2-Fo-3,y:-et/2+Fo+3},r,{isDark:o,...j.note.color&&{color:j.note.color},lineNumber:j.note.lineNumber,endLineNumber:j.note.endLineNumber});else{let[lt,nt,J,at]=ki({width:q,height:et},j.note);vi(X,lt,nt,J,at,r),Li(X,{x:j.note.x,y:j.note.y,width:j.note.width,height:j.note.height},j.note.lines,r,{isDark:o,...j.note.color&&{color:j.note.color},lineNumber:j.note.lineNumber,endLineNumber:j.note.endLineNumber,interactive:!0})}}if(e.tagGroups.length>0){let V=b+h,j=D.append("g").attr("class","er-tag-legend").attr("transform",`translate(0,${V})`);fn(j,{groups:e.tagGroups,activeGroup:s??null,mode:c?"export":"preview",palette:r,isDark:o,width:R}),j.selectAll("[data-legend-group]").classed("er-legend-group",!0)}if(P){let V=RD.filter(j=>{for(let K of P.values())if(K===j)return!0;return!1});if(V.length>0){let j=b+h,K=[{name:"Role",entries:V.map(U=>({value:AD[U],color:r.colors[h1[U]]}))}],$=D.append("g").attr("class","er-semantic-legend").attr("transform",`translate(0,${j})`);fn($,{groups:K,activeGroup:B?"Role":null,mode:c?"export":"preview",palette:r,isDark:o,width:R}),$.selectAll("[data-legend-group]").classed("er-legend-group",!0)}}}function GZ(t,e,n){let r=Yc(t,n);if(r.error||r.tables.length===0)return"";let o=p1(r),a=e==="dark",i=document.createElement("div"),s=o.width+g1*2,l=o.height+g1*2+(r.title&&r.options["no-title"]!=="on"?40:0);i.style.width=`${s}px`,i.style.height=`${l}px`,i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i);try{GD(i,r,o,n,a,void 0,{width:s,height:l},void 0,void 0,!0);let c=i.querySelector("svg");return c?(e==="transparent"&&(c.style.background="none"),c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.style.fontFamily=It,c.outerHTML):""}finally{document.body.removeChild(i)}}var g1,CZ,_Z,AZ,OD,RZ,IZ,PZ,OZ,HD=st(()=>{"use strict";Ke();Xn();Eo();on();tn();gi();Ke();Mr();Br();fr();en();Mi();Zu();m1();PD();g1=20,CZ=3,_Z=13,AZ=11,OD=11,RZ=18,IZ=8,PZ=10;OZ=Kn().x(t=>t.x).y(t=>t.y).curve(fo)});var UD={};ye(UD,{renderBoxesAndLines:()=>VD,renderBoxesAndLinesForExport:()=>QZ});function jZ(t){let e=[],n=0;for(let r=1;r<t.length;r++){let o=t[r-1],a=t[r],i=r+1<t.length?t[r+1]:"",s=o>="a"&&o<="z"&&a>="A"&&a<="Z",l=o>="A"&&o<="Z"&&a>="A"&&a<="Z"&&i>="a"&&i<="z";(s||l)&&(e.push(t.slice(n,r)),n=r)}return e.push(t.slice(n)),e.length>1?e:[t]}function hg(t,e,n){let r=e-zD*2,o=t.split(/(\s+|-)/),a=[];for(let s of o)!s||/^\s+$/.test(s)||s==="-"||a.push(...jZ(s));for(let s=HZ;s>=gg;s--){if(r<_t("MM",s))continue;let l=[],c="";for(let p of a){let m=c?`${c} ${p}`:p;_t(m,s)<=r?c=m:(c&&l.push(c),c=p)}c&&l.push(c);let d=p=>_t(p,s)<=r;if(l.length<=n&&l.every(d))return{lines:l,fontSize:s};if(l.length<=n)return{lines:l.map(m=>d(m)?m:tr(m,s,r)),fontSize:s};let u=l.slice(0,n).map(p=>d(p)?p:tr(p,s,r)),f=u[n-1];return f.endsWith("\u2026")||(u[n-1]=tr(f+"\u2026",s,r)),{lines:u,fontSize:s}}return{lines:[tr(t,gg,r)],fontSize:gg}}function qZ(t,e,n,r,o,a,i){let s=Gt(r.bg,r.text,o?90:95);if(a.active){if(t.value===void 0){let g=ve(s,r.textOnFillLight,r.textOnFillDark);return{fill:s,stroke:a.hue,text:g}}let f=a.fillForValue(t.value),p=ie(r,f,o,{...i!==void 0&&{solid:i}}),m=a.twoColor?f:a.hue,h=ve(p,r.textOnFillLight,r.textOnFillDark);return{fill:p,stroke:m,text:h}}let l=ar(t.metadata,[...e],n);if(l){let f=ie(r,l,o,{...i!==void 0&&{solid:i}}),p=l,m=ve(f,r.textOnFillLight,r.textOnFillDark);return{fill:f,stroke:p,text:m}}let c=Gt(r.bg,r.text,o?90:95),d=Gt(r.text,r.bg,o?60:40),u=r.text;return{fill:c,stroke:d,text:u}}function KZ(t,e,n,r){if(Object.keys(t.metadata).length>0&&n!=null){let a=ar(t.metadata,[...e],n);if(a)return a}return r.textMuted}function ZZ(t,e){for(let n of e){let r=`bl-arrow-${n.replace("#","")}`;if(!t.select(`#${r}`).empty())continue;t.append("marker").attr("id",r).attr("viewBox",`0 0 ${Js*2} ${Pi*2}`).attr("refX",Js*2).attr("refY",Pi).attr("markerWidth",Js).attr("markerHeight",Pi).attr("orient","auto").append("polygon").attr("points",`0,0 ${Js*2},${Pi} 0,${Pi*2}`).attr("fill",n);let o=`bl-arrow-rev-${n.replace("#","")}`;t.select(`#${o}`).empty()&&t.append("marker").attr("id",o).attr("viewBox",`0 0 ${Js*2} ${Pi*2}`).attr("refX",0).attr("refY",Pi).attr("markerWidth",Js).attr("markerHeight",Pi).attr("orient","auto").append("polygon").attr("points",`${Js*2},0 0,${Pi} ${Js*2},${Pi*2}`).attr("fill",n)}}function VD(t,e,n,r,o,a){let{onClickItem:i,exportDims:s,activeTagGroup:l,hiddenTagValues:c,hideDescriptions:d,controlsExpanded:u,onToggleDescriptions:f,onToggleControlsExpand:p,exportMode:m=!1,controlsHost:h,rampDomain:g}=a??{};Rt(t).selectAll(":not([data-d3-tooltip])").remove();let v=s?.width??t.clientWidth,y=s?.height??t.clientHeight;if(v<=0||y<=0)return;let b=Ee.identity(),E=b.aesthetic($Z),x=b.text(gg),L=b.text(WZ),S=b.structural(1.5),A=b.structural(1.5),C=b.structural(BZ),M=b.text(WD),w=b.text(YZ),k=b.structural(zZ),N=b.text(20),_=b.structural(30),T=e.nodes.filter(ft=>ft.value!==void 0).map(ft=>ft.value),R=T.length>0,G=g?.min??(R?Math.min(...T):0),I=g?.max??Math.max(...T),H=Dn(e.boxMetricColor??"",r)??r.primary,O=e.boxMetricLowColor?Dn(e.boxMetricLowColor,r)??void 0:void 0,D=o?Gt(r.surface,r.text,28):r.bg,W=Gt(H,D,y1),z=ft=>{let Wt=I>G?(ft-G)/(I-G):1;if(O!==void 0)return Jp(O,H,Wt,{isDark:o});let he=y1+Math.max(0,Math.min(1,Wt))*(100-y1);return Gt(H,D,he)},P=R?e.boxMetric?.trim()||"Value":null,B=ft=>{let Wt=ft.trim().toLowerCase();if(Wt===""||Wt==="none")return null;let he=e.tagGroups.find(ne=>ne.name.toLowerCase()===Wt);return he?he.name:Wt===P?.toLowerCase()?P:ft},Y=l,V;Y!==void 0?V=Y===null?null:B(Y):e.options["active-tag"]!==void 0?V=B(e.options["active-tag"]):V=P??(e.tagGroups.length>0?e.tagGroups[0].name:null);let j=P!==null&&V===P,K=P!==null?{name:P,entries:[],gradient:{min:G,max:I,low:O??W,high:H}}:null,$=[...K?[K]:[],...e.tagGroups],U=e.nodes.some(ft=>ft.description&&ft.description.length>0),q=$.length>0||U&&h!=="app"?b.structural(Tr({groups:$,position:{placement:"top-center",titleRelation:"below-title"},mode:m?"export":"preview"},v)):0,et=c??e.initialHiddenTagValues,tt=new Map;for(let ft of e.nodes)tt.set(ft.label,ft);let F=new Map;for(let ft of n.nodes)F.set(ft.label,ft);let Q=!!e.title&&e.options["no-title"]!=="on",ot=Q?40:0,Z=e.nodes.some(ft=>ft.description&&ft.description.length>0),nt=$.length>0||Z&&f?q+8:0,J=new Set(n.groups.map(ft=>ft.label)),at=0;for(let ft of e.groups)ft.children.some(Wt=>J.has(Wt))&&(at+=k);let it=n.width,vt=n.height+ot+nt+at,Tt=v/(it+E*2),At=y/(vt+E*2),rt=Math.min(Tt,At,3),pt=0,ht=0;if(e.nodePositions&&e.nodePositions.size>0){let ft=1/0,Wt=1/0,he=-1/0,ne=-1/0,se=(Zt,Ie)=>{Zt<ft&&(ft=Zt),Zt>he&&(he=Zt),Ie<Wt&&(Wt=Ie),Ie>ne&&(ne=Ie)};for(let Zt of n.nodes)se(Zt.x-Zt.width/2,Zt.y-Zt.height/2),se(Zt.x+Zt.width/2,Zt.y+Zt.height/2);for(let Zt of n.groups)se(Zt.x-Zt.width/2,Zt.y-Zt.height/2),se(Zt.x+Zt.width/2,Zt.y+Zt.height/2);for(let Zt of n.edges)for(let Ie of Zt.points)se(Ie.x,Ie.y);Number.isFinite(ft)&&(pt=(n.width-he-ft)/2,ht=(n.height-ne-Wt)/2)}let dt=(v-it*rt)/2+pt*rt,ut=E+ot+nt+ht*rt,yt=Rt(t).append("svg").attr("width",v).attr("height",y).attr("viewBox",`0 0 ${v} ${y}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It).style("background",r.bg);b.isBelowFloor&&yt.attr("width","100%");let kt=yt.append("defs");Q&&yt.append("text").attr("x",v/2).attr("y",_).attr("text-anchor","middle").attr("font-size",N).attr("font-weight","700").attr("fill",r.text).text(e.title);let Ot=yt.append("g").attr("transform",`translate(${dt},${ut}) scale(${rt})`),Xt=new Set,bt=new Map;for(let ft=0;ft<n.edges.length;ft++){let Wt=KZ(n.edges[ft],e.tagGroups,V,r);Xt.add(Wt),bt.set(ft,Wt)}ZZ(kt,Xt);let Nt=[...n.groups].sort((ft,Wt)=>Wt.width*Wt.height-ft.width*ft.height),Vt=new Set(n.groups.map(ft=>ft.label)),xt=new Set;for(let ft of e.groups)for(let Wt of ft.children)Vt.has(Wt)&&xt.add(ft.label);for(let ft of Nt){let Wt=ft.x-ft.width/2,he=!ft.collapsed&&xt.has(ft.label),ne=he?ft.y-ft.height/2-k:ft.y-ft.height/2,se=he?ft.height+k:ft.height,Zt=Ot.append("g").attr("class",ft.collapsed?"bl-group bl-group-collapsed":"bl-group").attr("data-line-number",String(ft.lineNumber)).attr("data-node-id",ft.label).attr("data-group-toggle",ft.label).style("cursor","pointer");if(ft.collapsed){let Ie=nr(r,o),Ht=r.border;Zt.append("rect").attr("x",Wt).attr("y",ne).attr("width",ft.width).attr("height",ft.height).attr("rx",vf).attr("ry",vf).attr("fill",Ie).attr("stroke",Ht).attr("stroke-width",A);let Qt=`bl-clip-${ft.label.replace(/[[\]\s]/g,"")}`;Zt.append("clipPath").attr("id",Qt).append("rect").attr("x",Wt).attr("y",ne).attr("width",ft.width).attr("height",ft.height).attr("rx",vf),Zt.append("rect").attr("x",Wt).attr("y",ne+ft.height-C).attr("width",ft.width).attr("height",C).attr("fill",Ht).attr("clip-path",`url(#${Qt})`).attr("class","bl-collapse-bar");let Ut=Math.max(2,Math.floor((ft.height-16)/(x*1.3))),fe=hg(ft.label,ft.width,Ut),de=fe.fontSize*1.3,te=fe.lines.length*de;for(let ae=0;ae<fe.lines.length;ae++)Zt.append("text").attr("class","bl-group-label").attr("x",ft.x).attr("y",ft.y-te/2+de/2+ae*de).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family",It).attr("font-size",fe.fontSize).attr("font-weight","600").attr("fill",r.text).text(fe.lines[ae])}else Zt.append("rect").attr("x",Wt).attr("y",ne).attr("width",ft.width).attr("height",se).attr("rx",FD).attr("ry",FD).attr("fill",Gt(r.surface,r.bg,40)).attr("stroke",r.textMuted).attr("stroke-width",1).attr("stroke-opacity",.35),Zt.append("text").attr("class","bl-group-label").attr("x",Wt+ft.width/2).attr("y",ne+18).attr("text-anchor","middle").attr("font-family",It).attr("font-size",w).attr("font-weight","600").attr("fill",r.text).text(ft.label)}for(let ft=0;ft<n.edges.length;ft++){let Wt=n.edges[ft],he=bt.get(ft)??r.textMuted;if(et.size>0){let Qt=!1;for(let[Ut,fe]of et){let de=Wt.metadata[Ut];if(de&&fe.has(de.toLowerCase())){Qt=!0;break}}if(Qt)continue}if(Wt.source===Wt.target){let Qt=F.get(Wt.source);if(Qt){let Ut=Ot.append("g").attr("class","bl-edge-group").attr("data-line-number",String(Wt.lineNumber)).attr("data-from",Wt.source).attr("data-to",Wt.target),fe=`bl-arrow-${he.replace("#","")}`,de=Qt.x,te=Qt.y,ae=Qt.width/2,Te=Qt.height/2,Je=20,sn=de+ae,ze=te+Te*.4,Ce=de+ae*.4,ee=te+Te,oe=sn+ae+Je,Be=ze,dn=Ce,_n=ee+Te+Je;Ut.append("path").attr("class","bl-edge").attr("d",`M ${sn} ${ze} C ${oe} ${Be}, ${dn} ${_n}, ${Ce} ${ee}`).attr("fill","none").attr("stroke",he).attr("stroke-width",S).attr("marker-end",`url(#${fe})`)}continue}let ne;if(Wt.yOffset!==0&&Wt.parallelCount>1){let Qt=F.get(Wt.source),Ut=F.get(Wt.target),fe=Qt?.y??Wt.points[0]?.y??0,de=Ut?.y??Wt.points[Wt.points.length-1]?.y??0,te=Wt.points[0]?.x??0,ae=Wt.points[Wt.points.length-1]?.x??0,Te=(te+ae)/2,Je=(fe+de)/2;ne=[{x:te,y:fe},{x:te+(Te-te)*.3,y:fe+Wt.yOffset*.5},{x:Te,y:Je+Wt.yOffset},{x:ae-(ae-Te)*.3,y:de+Wt.yOffset*.5},{x:ae,y:de}]}else ne=Wt.points.map(Qt=>({x:Qt.x,y:Qt.y}));if(ne.length<2)continue;let se=Ot.append("g").attr("class","bl-edge-group").attr("data-line-number",String(Wt.lineNumber)).attr("data-from",Wt.source).attr("data-to",Wt.target),Zt=`bl-arrow-${he.replace("#","")}`,Ie=Wt.straight?XZ:e.direction==="TB"?UZ:VZ,Ht=se.append("path").attr("class","bl-edge").attr("d",Ie(ne)??"").attr("fill","none").attr("stroke",he).attr("stroke-width",S).attr("marker-end",`url(#${Zt})`);if(Wt.bidirectional){let Qt=`bl-arrow-rev-${he.replace("#","")}`;Ht.attr("marker-start",`url(#${Qt})`)}}for(let ft of n.nodes){let Wt=tt.get(ft.label);if(!Wt)continue;if(et.size>0){let Ut=!1;for(let[fe,de]of et){let te=Wt.metadata[fe];if(te&&de.has(te.toLowerCase())){Ut=!0;break}}if(Ut)continue}let he=e.options["solid-fill"]==="on",ne=qZ(Wt,e.tagGroups,V,r,o,{active:j,hue:H,twoColor:O!==void 0,fillForValue:z},he),se=he?ne.text:ne.stroke,Zt=Ot.append("g").attr("class","bl-node").attr("transform",`translate(${ft.x},${ft.y})`).attr("data-line-number",Wt.lineNumber).attr("data-node-id",Wt.label).style("cursor",i?"pointer":"default").style("--bl-node-stroke",ne.stroke);for(let[Ut,fe]of Object.entries(Wt.metadata))Zt.attr(`data-tag-${Ut.toLowerCase()}`,fe.toLowerCase());Wt.value!==void 0&&Zt.attr("data-value",Wt.value),i&&Zt.on("click",Ut=>{Ut.target?.closest("a")||i(Wt.lineNumber)});let Ie=-ft.width/2,Ht=-ft.height/2;Zt.append("rect").attr("x",Ie).attr("y",Ht).attr("width",ft.width).attr("height",ft.height).attr("rx",vf).attr("ry",vf).attr("fill",ne.fill).attr("stroke",ne.stroke).attr("stroke-width",A);let Qt=Wt.description;if(Qt&&Qt.length>0&&!d){let fe=hg(Wt.label,ft.width,3),de=fe.lines,te=fe.fontSize*1.3,ae=de.length*te,Te=ae+12,Je=-ft.height/2+Te/2;for(let An=0;An<de.length;An++)Zt.append("text").attr("x",0).attr("y",Je-ae/2+te/2+An*te).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",fe.fontSize).attr("font-weight","bold").attr("fill",ne.text).text(de[An]);let sn=-ft.height/2+Te;Zt.append("line").attr("x1",-ft.width/2).attr("y1",sn).attr("x2",ft.width/2).attr("y2",sn).attr("stroke",se).attr("stroke-opacity",.3).attr("stroke-width",1);let ze=sn+4+M,Ce=ft.width-zD*2,ee=Math.floor(Ce/(M*Wo)),oe=M*FZ,Be=An=>An.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/`(.+?)`/g,"$1").replace(/https?:\/\/\S+/g,In=>In.slice(0,20)).length,dn=[];for(let An of Qt){let In=An.startsWith("- ")?"\u2022 "+An.slice(2):An;In=In.replace(/\bhttps?\s+([\w][\w.-]+\.[a-z]{2,}(?:\/\S*)?)/gi,(Ar,lr)=>`https://${lr}`),dn.push(In)}let _n=qo(dn,ee,Be),He=_n.length>BD,Nn=He?_n.slice(0,BD):_n,jn=-ft.width/2+6,xo=jn+10,Sr=Ls(ne.fill)>.5?r.textMuted:Gt(ne.text,ne.fill,75);for(let An=0;An<Nn.length;An++){let In=Nn[An],Ar=In.text;He&&An===Nn.length-1&&(Ar=_t(Ar,M)>=Ce?tr(Ar,M,Ce):Ar+"\u2026");let lr=ze+An*oe;In.kind==="bullet-first"&&Zt.append("text").attr("x",jn).attr("y",lr).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size",M).attr("fill",Sr).text("\u2022");let Vr=In.kind==="bullet-first"||In.kind==="bullet-cont",Zn=Zt.append("text").attr("x",Vr?xo:0).attr("y",lr).attr("text-anchor",Vr?"start":"middle").attr("dominant-baseline","central").attr("font-size",WD).attr("fill",Sr);gn(Zn,Ar,r,M)}if(He){let An=Qt.join(" "),In=An.length>200?An.slice(0,199)+"\u2026":An;Zt.append("title").text(In)}if(e.showValues&&Wt.value!==void 0){let An=e.boxMetric?`${e.boxMetric}: ${Wt.value}`:String(Wt.value);Zt.append("text").attr("class","bl-node-value").attr("x",0).attr("y",ze+Nn.length*oe).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",YD).attr("font-weight","600").attr("fill",ne.text).text(An)}}else if(e.showValues&&Wt.value!==void 0){let Ut=e.boxMetric?`${e.boxMetric}: ${Wt.value}`:String(Wt.value),fe=ft.height/2,de=-ft.height/2+fe,te=hg(Wt.label,ft.width,2),ae=te.fontSize*1.3,Te=te.lines.length*ae,Je=-ft.height/2+fe/2;for(let sn=0;sn<te.lines.length;sn++)Zt.append("text").attr("x",0).attr("y",Je-Te/2+ae/2+sn*ae).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",te.fontSize).attr("font-weight","bold").attr("fill",ne.text).text(te.lines[sn]);Zt.append("line").attr("x1",-ft.width/2).attr("y1",de).attr("x2",ft.width/2).attr("y2",de).attr("stroke",se).attr("stroke-opacity",.3).attr("stroke-width",1),Zt.append("text").attr("class","bl-node-value").attr("x",0).attr("y",(de+ft.height/2)/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",YD).attr("fill",ne.text).attr("opacity",.85).text(Ut)}else{let Ut=Math.max(2,Math.floor((ft.height-16)/(x*1.3))),fe=hg(Wt.label,ft.width,Ut),de=fe.fontSize*1.3,te=fe.lines.length*de;for(let ae=0;ae<fe.lines.length;ae++)Zt.append("text").attr("x",0).attr("y",-te/2+de/2+ae*de).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",fe.fontSize).attr("font-weight","600").attr("fill",ne.text).text(fe.lines[ae])}if(ft.note)if(ft.note.collapsed)Ni(Zt,{x:ft.width/2-Fo-3,y:-ft.height/2+Fo+3},r,{isDark:o,...ft.note.color&&{color:ft.note.color},lineNumber:ft.note.lineNumber,endLineNumber:ft.note.endLineNumber});else{let[Ut,fe,de,te]=ki({width:ft.width,height:ft.height},ft.note);vi(Zt,Ut,fe,de,te,r),Li(Zt,{x:ft.note.x,y:ft.note.y,width:ft.note.width,height:ft.note.height},ft.note.lines,r,{isDark:o,...ft.note.color&&{color:ft.note.color},lineNumber:ft.note.lineNumber,endLineNumber:ft.note.endLineNumber,interactive:!0})}}let Lt=Ot.append("g").attr("class","bl-edge-labels"),Dt=L*1.3;for(let ft of n.edges){if(!ft.labelLines||ft.labelLines.length===0||ft.labelX===void 0||ft.labelY===void 0)continue;let Wt=ft.labelX,he=ft.labelY;if(et.size>0){let Ut=!1;for(let[fe,de]of et){let te=ft.metadata[fe];if(te&&de.has(te.toLowerCase())){Ut=!0;break}}if(Ut)continue}let ne=ft.labelWidth??0,se=ft.labelHeight??L+6,Zt=ft.labelLines,Ie=Lt.append("g").attr("class","bl-edge-label").attr("data-line-number",String(ft.lineNumber));Ie.append("rect").attr("x",Wt-ne/2).attr("y",he-se/2).attr("width",ne).attr("height",se).attr("rx",3).attr("fill",r.bg).attr("opacity",.72);let Ht=Ie.append("text").attr("x",Wt).attr("text-anchor","middle").attr("font-family",It).attr("font-size",L).attr("fill",r.textMuted),Qt=he-(Zt.length-1)/2*Dt+L/3;Zt.forEach((Ut,fe)=>{Ht.append("tspan").attr("x",Wt).attr("y",Qt+fe*Dt).text(Ut)})}let zt=e.nodes.some(ft=>ft.description&&ft.description.length>0);if($.length>0||zt&&h!=="app"){let ft;zt&&(f||h==="app")&&(ft={toggles:[{id:"descriptions",type:"toggle",label:"Descriptions",active:!d,onToggle:()=>{}}]});let Wt={...p!==void 0&&{onControlsExpand:p},onControlsToggle:(ne,se)=>{ne==="descriptions"&&f&&f(se)}},he=yt.append("g").attr("transform",`translate(0,${ot+4})`);fn(he,{groups:$,activeGroup:V,mode:m?"export":"preview",showInactivePills:!0,...ft!==void 0&&{controlsGroup:ft},...h!==void 0&&{controlsHost:h},...u!==void 0&&{controlsExpanded:u},callbacks:Wt,palette:r,isDark:o,width:v}),he.selectAll("[data-legend-group]").classed("bl-legend-group",!0)}if(!s&&!m){let Wt=yt.append("g").attr("class","bl-focus-icon").attr("data-export-ignore","true").style("display","none").style("pointer-events","auto").style("cursor","pointer");Wt.append("rect").attr("x",-3).attr("y",-3).attr("width",20).attr("height",20).attr("fill","transparent");let he=14/2,ne=14/2;Wt.append("circle").attr("cx",he).attr("cy",ne).attr("r",14/2-1).attr("fill",r.bg).attr("stroke",r.textMuted).attr("stroke-width",1.5),Wt.append("circle").attr("cx",he).attr("cy",ne).attr("r",2).attr("fill",r.textMuted)}}function QZ(t,e,n,r,o,a){VD(t,e,n,r,o,{...a?.exportDims!==void 0&&{exportDims:a.exportDims},...a?.activeTagGroup!==void 0&&{activeTagGroup:a.activeTagGroup},...a?.hiddenTagValues!==void 0&&{hiddenTagValues:a.hiddenTagValues},...a?.exportMode!==void 0&&{exportMode:a.exportMode}})}var $Z,HZ,gg,WZ,vf,BZ,Js,Pi,WD,FZ,BD,zD,FD,YZ,zZ,y1,YD,VZ,UZ,XZ,XD=st(()=>{"use strict";Xn();Mi();Eo();on();Br();To();tn();xr();Ke();_o();$s();fr();en();$Z=20,HZ=11,gg=9,WZ=11,vf=8,BZ=4,Js=5,Pi=4,WD=10,FZ=1.4,BD=6,zD=12,FD=8,YZ=14,zZ=32,y1=15,YD=11,VZ=Kn().x(t=>t.x).y(t=>t.y).curve(fo),UZ=Kn().x(t=>t.x).y(t=>t.y).curve(fo),XZ=Kn().x(t=>t.x).y(t=>t.y).curve(Zi)});function w1(t,e=xg,n=KD){let r=Tn(t,e,n,{hardBreak:!0});if(r.length>b1){let a=r.slice(0,b1-1),i=r.slice(b1-1).join(" ");a.push(tr(i,e,n)),r=a}let o=0;for(let a of r){let i=_t(a,e);i>o&&(o=i)}return{lines:r,width:o+2*tQ,height:r.length*e*JZ+2*eQ}}function oQ(t){return x1(t,.5).p}function x1(t,e){if(t.length===0)return{p:{x:0,y:0},nx:0,ny:1};if(t.length===1)return{p:{x:t[0].x,y:t[0].y},nx:0,ny:1};let n=[],r=0;for(let i=1;i<t.length;i++){let s=Math.hypot(t[i].x-t[i-1].x,t[i].y-t[i-1].y);n.push(s),r+=s}let o=r*Math.max(0,Math.min(1,e));for(let i=1;i<t.length;i++){let s=n[i-1];if(o<=s||i===t.length-1){let l=s===0?0:Math.min(1,o/s),c=t[i-1].x,d=t[i-1].y,u=t[i].x,f=t[i].y,p=u-c,m=f-d,h=Math.hypot(p,m)||1;return{p:{x:c+p*l,y:d+m*l},nx:-m/h,ny:p/h}}o-=s}let a=t[t.length-1];return{p:{x:a.x,y:a.y},nx:0,ny:1}}function qD(t,e,n,r){return{minX:t-n/2,minY:e-r/2,maxX:t+n/2,maxY:e+r/2}}function bg(t,e,n,r,o,a){let i=t-n/2-a,s=e-r/2-a,l=t+n/2+a,c=e+r/2+a;for(let d of o)if(i<d.maxX&&l>d.minX&&s<d.maxY&&c>d.minY)return!0;return!1}function aQ(){let t=[.5];for(let e=1;e<=rQ;e++){let n=e*.08;.5-n>=.12&&t.push(.5-n),.5+n<=.88&&t.push(.5+n)}return t}function iQ(t,e,n,r){let o=aQ();for(let a of o){let{p:i}=x1(n,a);if(!bg(i.x,i.y,t,e,r,yg))return i}for(let a=jD;a<=nQ;a+=jD)for(let i of o){let{p:s,nx:l,ny:c}=x1(n,i);for(let d of[-1,1]){let u=s.x+l*a*d,f=s.y+c*a*d;if(!bg(u,f,t,e,r,yg))return{x:u,y:f}}}return null}function sQ(t){for(let r=0;r<8;r++){let o=!1;for(let a=0;a<t.length;a++)for(let i=a+1;i<t.length;i++){let s=t[a],l=t[i],c=Math.abs(s.cx-l.cx),d=Math.abs(s.cy-l.cy),u=(s.w+l.w)/2+4-c,f=(s.h+l.h)/2+4-d;if(u>0&&f>0){let p=f/2+1;s.cy<l.cy?(s.cy-=p,l.cy+=p):(s.cy+=p,l.cy-=p),o=!0}}if(!o)break}}function E1(t,e){let n=e?.fontSize??xg,r=e?.maxWidth??KD,o=[];for(let l of t.nodes)o.push(qD(l.x,l.y,l.width,l.height));for(let l of t.groups)l.collapsed&&o.push(qD(l.x,l.y,l.width,l.height));let a=[];t.edges.forEach((l,c)=>{if(!l.label||l.points.length<2)return;let d=w1(l.label,n,r),u=oQ(l.points),f=u.y;l.parallelCount>1&&l.yOffset!==0&&(f+=(l.yOffset<0?-1:1)*(d.height/2)),a.push({edgeIdx:c,cx:u.x,cy:f,w:d.width,h:d.height,lines:d.lines,resolved:!0})});for(let l of a){if(!bg(l.cx,l.cy,l.w,l.h,o,yg))continue;let c=t.edges[l.edgeIdx],d=iQ(l.w,l.h,c.points,o);d?(l.cx=d.x,l.cy=d.y):l.resolved=!1}sQ(a);for(let l of a)bg(l.cx,l.cy,l.w,l.h,o,yg)&&(l.resolved=!1);let i=new Map;for(let l of a)i.set(l.edgeIdx,l);let s=t.edges.map((l,c)=>{let d=i.get(c);return d?{...l,labelX:d.cx,labelY:d.cy,labelWidth:d.w,labelHeight:d.h,labelLines:d.lines}:l});return{layout:{...t,edges:s},unresolved:a.filter(l=>!l.resolved).map(l=>l.edgeIdx)}}var xg,KD,b1,JZ,tQ,eQ,yg,jD,nQ,rQ,S1=st(()=>{"use strict";en();xg=11,KD=160,b1=3,JZ=1.3,tQ=6,eQ=3,yg=4,jD=8,nQ=40,rQ=9});function mQ(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function ZD(t,e,n){if(t.groups.length>0)return[];let r=t.nodes.length;if(r<3||r>40)return[];let o=t.direction==="TB",a=n?.nodesep??lQ,i=n?.ranksep??cQ,s=n?.backEdgeSide??"nearest",l=n?.restarts??(r<=14?28:r<=25?14:6),c=n?.keepK??3,d=t.nodes.map($=>$.label),u=new Set(d),f=t.edges.map(($,U)=>({e:$,i:U})).filter(({e:$})=>u.has($.source)&&u.has($.target)&&$.source!==$.target);if(f.length===0)return[];let p=new Map;for(let $ of d)p.set($,[]);for(let{e:$,i:U}of f)p.get($.source).push({to:$.target,idx:U});let m=new Set,h=new Map;for(let $ of d)h.set($,0);let g=$=>{h.set($,1);for(let{to:U,idx:X}of p.get($)){let q=h.get(U);q===1?m.add(X):q===0&&g(U)}h.set($,2)};for(let $ of d)h.get($)===0&&g($);let v=f.map(({e:$,i:U})=>m.has(U)?{from:$.target,to:$.source,idx:U,rev:!0}:{from:$.source,to:$.target,idx:U,rev:!1}),y=new Map,b=new Map;for(let $ of d)y.set($,[]),b.set($,0);for(let $ of v)y.get($.from).push($.to),b.set($.to,(b.get($.to)??0)+1);let E=new Map;for(let $ of d)E.set($,0);let x=d.filter($=>(b.get($)??0)===0),L=new Map(b),S=[];for(;x.length;){let $=x.shift();S.push($);for(let U of y.get($))E.set(U,Math.max(E.get(U),E.get($)+1)),L.set(U,L.get(U)-1),L.get(U)===0&&x.push(U)}if(S.length!==d.length)return[];let A=Math.max(...d.map($=>E.get($))),C=new Map;for(let $ of t.nodes){let U=e.get($.label)??{width:Na,height:oa};C.set($.label,{id:$.label,dummy:!1,rank:E.get($.label),cross:0,thick:o?U.width:U.height,depth:o?U.height:U.width,realW:U.width,realH:U.height})}let M=[],w=[],k=[];for(let $ of v){if($.rev){k.push({edgeIdx:$.idx,src:$.to,tgt:$.from});continue}let U=E.get($.from),X=E.get($.to),q=[$.from],et=$.from;for(let tt=U+1;tt<X;tt++){let F=`__d${$.idx}_${tt}`;C.set(F,{id:F,dummy:!0,rank:tt,cross:0,thick:dQ,depth:0,realW:0,realH:0}),M.push({a:et,b:F}),q.push(F),et=F}M.push({a:et,b:$.to}),q.push($.to),w.push({edgeIdx:$.idx,chain:$.rev?q.slice().reverse():q})}let N=Array.from({length:A+1},()=>[]);for(let $ of C.values())N[$.rank].push($.id);let _=new Map,T=new Map;for(let $ of C.keys())_.set($,[]),T.set($,[]);for(let $ of M)T.get($.a).push($.b),_.get($.b).push($.a);let R=new Map,G=$=>{for(let U of C.keys())R.set(U,$.get(U))},I=$=>{if(!N[$+1])return 0;let X=[];for(let et of N[$]){let tt=R.get(et);for(let F of T.get(et))X.push({p:tt,q:R.get(F)})}let q=0;for(let et=0;et<X.length;et++)for(let tt=et+1;tt<X.length;tt++){let F=X[et],Q=X[tt];(F.p-Q.p)*(F.q-Q.q)<0&&q++}return q},H=()=>{let $=0;for(let U=0;U<A;U++)$+=I(U);return $},O=$=>{if($.length===0)return-1;$.sort((et,tt)=>et-tt);let U=Math.floor($.length/2);if($.length%2===1)return $[U];if($.length===2)return($[0]+$[1])/2;let X=$[U-1]-$[0],q=$[$.length-1]-$[U];return X+q===0?($[U-1]+$[U])/2:($[U-1]*q+$[U]*X)/(X+q)},D=($,U)=>{let X=N[$],q=U?_:T,et=new Map;for(let Z of X)et.set(Z,O(q.get(Z).map(lt=>R.get(lt))));let tt=X.filter(Z=>et.get(Z)>=0).sort((Z,lt)=>et.get(Z)-et.get(lt)),F=new Array(X.length).fill(null);for(let Z of X)et.get(Z)<0&&(F[R.get(Z)]=Z);let Q=0;for(let Z=0;Z<F.length;Z++)F[Z]===null&&(F[Z]=tt[Q++]);let ot=F;ot.forEach((Z,lt)=>R.set(Z,lt)),N[$]=ot},W=()=>{let $=!0,U=0;for(;$&&U++<12;){$=!1;for(let X=0;X<=A;X++){let q=N[X];for(let et=0;et<q.length-1;et++){let tt=(X>0?I(X-1):0)+(X<A?I(X):0),F=q[et],Q=q[et+1];q[et]=Q,q[et+1]=F,R.set(Q,et),R.set(F,et+1),(X>0?I(X-1):0)+(X<A?I(X):0)<tt?$=!0:(q[et]=F,q[et+1]=Q,R.set(F,et),R.set(Q,et+1))}}}},z=$=>{let U=$===0?null:mQ($);for(let X=0;X<=A;X++){let q=N[X].slice();if(U)for(let et=q.length-1;et>0;et--){let tt=Math.floor(U()*(et+1));[q[et],q[tt]]=[q[tt],q[et]]}N[X]=q,q.forEach((et,tt)=>R.set(et,tt))}},P=[];for(let $=0;$<l;$++){z($);let U=H(),X=new Map(R);for(let et=0;et<8;et++){if(et%2===0)for(let Q=1;Q<=A;Q++)D(Q,!0);else for(let Q=A-1;Q>=0;Q--)D(Q,!1);W();let F=H();if(F<U&&(U=F,X=new Map(R)),F===0)break}G(X);for(let et=0;et<=A;et++)N[et].sort((tt,F)=>R.get(tt)-R.get(F));let q=N.map(et=>et.join(",")).join("|");P.some(et=>et.sig===q)||P.push({sig:q,cross:U,order:new Map(X)})}P.sort(($,U)=>$.cross-U.cross);let B=P.slice(0,c);if(B.length===0)return[];let Y=[];for(let $ of B){G($.order);let U=Array.from({length:A+1},()=>[]);for(let X of C.values())U[X.rank].push(X.id);for(let X=0;X<=A;X++)U[X].sort((q,et)=>$.order.get(q)-$.order.get(et));Y.push(V(U))}return Y;function V($){let U=$.map(xt=>Math.max(0,...xt.map(Lt=>C.get(Lt).depth))),X=[],q=Ul;for(let xt=0;xt<=A;xt++)X[xt]=q+U[xt]/2,q+=U[xt]+i;for(let xt=0;xt<=A;xt++){let Lt=Ul;for(let Dt of $[xt]){let zt=C.get(Dt);zt.cross=Lt+zt.thick/2,Lt+=zt.thick+a}}let et=18;for(let xt=0;xt<et;xt++){let Dt=xt%2===0?Array.from({length:A+1},(zt,$t)=>$t):Array.from({length:A+1},(zt,$t)=>A-$t);for(let zt of Dt){let $t=$[zt],ft=$t.map(Wt=>{let he=C.get(Wt),ne=0,se=0;for(let Zt of _.get(Wt)){let Ie=j(he,C.get(Zt));ne+=Ie,se+=Ie*C.get(Zt).cross}for(let Zt of T.get(Wt)){let Ie=j(he,C.get(Zt));ne+=Ie,se+=Ie*C.get(Zt).cross}return ne>0?se/ne:he.cross});K($t,ft)}}let tt=1/0;for(let xt of C.values())tt=Math.min(tt,xt.cross-xt.thick/2);let F=Ul-tt;for(let xt of C.values())xt.cross+=F;let Q=xt=>o?{x:xt.cross,y:X[xt.rank]}:{x:X[xt.rank],y:xt.cross},ot=t.nodes.map(xt=>{let Lt=C.get(xt.label),Dt=Q(Lt);return{label:xt.label,x:Dt.x,y:Dt.y,width:Lt.realW,height:Lt.realH}}),Z=new Map;for(let xt of w)Z.set(xt.edgeIdx,xt.chain);let lt=1/0,nt=-1/0;for(let xt of C.values())xt.dummy||(lt=Math.min(lt,xt.cross-xt.thick/2),nt=Math.max(nt,xt.cross+xt.thick/2));let J=34,at=28,it=xt=>s==="left"?-1:s==="right"||C.get(xt.src).cross-C.get(xt.tgt).cross>=0?1:-1,vt=k.map(xt=>({...xt,side:it(xt),span:Math.abs(C.get(xt.src).rank-C.get(xt.tgt).rank)})).sort((xt,Lt)=>xt.side-Lt.side||xt.span-Lt.span),Tt=new Map;for(let xt of vt)Tt.set(xt.side,(Tt.get(xt.side)??0)+1);let At=new Map,rt=new Map,pt=xt=>Math.max(0,xt/2-6),ht=new Map,dt=new Map;{let xt=new Map;for(let Lt of vt){let Dt=`${Lt.side}|${Lt.tgt}`,zt=xt.get(Dt)??0;xt.set(Dt,zt+1),ht.set(Lt.edgeIdx,zt)}for(let[Lt,Dt]of xt)dt.set(Lt,Dt)}for(let xt of vt){let Lt=xt.side,Dt=At.get(Lt)??0;At.set(Lt,Dt+1);let zt=Tt.get(Lt),$t=C.get(xt.src),ft=C.get(xt.tgt),Wt=Lt>0?nt+J+Dt*at:lt-J-Dt*at,he=X[$t.rank],ne=X[ft.rank],se=zt>1?(Dt+1)/(zt+1):0,Zt=he+se*pt($t.depth),Ie=ne-se*pt(ft.depth),Ht=(ae,Te)=>o?{x:ae,y:Te}:{x:Te,y:ae},Qt=10,Ut=$t.cross+Lt*($t.thick/2+Qt),fe=ft.cross+Lt*(ft.thick/2+Qt),de=ht.get(xt.edgeIdx),te=dt.get(`${Lt}|${xt.tgt}`);if(te>1&&de>0){let ae=ne-(ft.depth/2+J+(de-1)*at),Te=ft.cross+Lt*pt(ft.thick)*(de/te);rt.set(xt.edgeIdx,[Ht($t.cross,he),Ht(Ut,Zt),Ht(Wt,Zt),Ht(Wt,ae),Ht(Te,ae),Ht(ft.cross,ne)])}else rt.set(xt.edgeIdx,[Ht($t.cross,he),Ht(Ut,Zt),Ht(Wt,Zt),Ht(Wt,Ie),Ht(fe,Ie),Ht(ft.cross,ne)])}let ut=[];for(let xt=0;xt<t.edges.length;xt++){let Lt=t.edges[xt];if(!u.has(Lt.source)||!u.has(Lt.target))continue;let Dt;if(Lt.source===Lt.target){let zt=Q(C.get(Lt.source));Dt=[zt,zt]}else if(rt.has(xt))Dt=rt.get(xt);else{let zt=Z.get(xt);if(!zt)continue;Dt=zt.map($t=>Q(C.get($t)))}ut.push({source:Lt.source,target:Lt.target,...Lt.label!==void 0&&{label:Lt.label},bidirectional:Lt.bidirectional,lineNumber:Lt.lineNumber,points:Dt,yOffset:0,parallelCount:1,metadata:Lt.metadata})}let yt=1/0,kt=1/0,Ot=-1/0,Xt=-1/0;for(let xt of ot)yt=Math.min(yt,xt.x-xt.width/2),kt=Math.min(kt,xt.y-xt.height/2),Ot=Math.max(Ot,xt.x+xt.width/2),Xt=Math.max(Xt,xt.y+xt.height/2);for(let xt of ut)for(let Lt of xt.points)yt=Math.min(yt,Lt.x),kt=Math.min(kt,Lt.y),Ot=Math.max(Ot,Lt.x),Xt=Math.max(Xt,Lt.y);let bt=Ul-yt,Nt=Ul-kt,Vt=bt!==0||Nt!==0?{nodes:ot.map(xt=>({...xt,x:xt.x+bt,y:xt.y+Nt})),edges:ut.map(xt=>({...xt,points:xt.points.map(Lt=>({x:Lt.x+bt,y:Lt.y+Nt}))}))}:{nodes:ot,edges:ut};return{nodes:Vt.nodes,edges:Vt.edges,groups:[],width:Ot+bt+Ul,height:Xt+Nt+Ul}}function j($,U){return $.dummy&&U.dummy?pQ:$.dummy||U.dummy?fQ:uQ}function K($,U){let X=$.length;if(X===0)return;let q=$.map(ot=>C.get(ot).thick/2),et=[0];for(let ot=1;ot<X;ot++)et[ot]=et[ot-1]+q[ot-1]+a+q[ot];let tt=U.map((ot,Z)=>ot-et[Z]),F=[];for(let ot=0;ot<X;ot++){let Z={pos:tt[ot],count:1,sumOffset:tt[ot],first:ot};for(;F.length&&F[F.length-1].pos>=Z.pos;){let lt=F.pop(),nt=lt.count+Z.count,J=lt.sumOffset+Z.sumOffset;Z={pos:J/nt,count:nt,sumOffset:J,first:lt.first}}F.push(Z)}let Q=new Array(X);for(let ot of F)for(let Z=0;Z<ot.count;Z++)Q[ot.first+Z]=ot.pos;for(let ot=0;ot<X;ot++)C.get($[ot]).cross=Q[ot]+et[ot]}}var lQ,cQ,dQ,Ul,uQ,fQ,pQ,QD=st(()=>{"use strict";kf();lQ=50,cQ=60,dQ=10,Ul=40,uQ=1,fQ=2,pQ=8});function vQ(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function kQ(t){if(t.length===0)return-1;t.sort((o,a)=>o-a);let e=Math.floor(t.length/2);if(t.length%2===1)return t[e];if(t.length===2)return(t[0]+t[1])/2;let n=t[e-1]-t[0],r=t[t.length-1]-t[e];return n+r===0?(t[e-1]+t[e])/2:(t[e-1]*r+t[e]*n)/(n+r)}function wg(t,e){let n=new Map;for(let l of t)n.set(l,[]);for(let l of e)n.get(l.from)?.push({to:l.to,idx:l.idx});let r=new Set,o=new Map;for(let l of t)o.set(l,0);let a=[],i=l=>{a.push(l);let c=new Map;for(;a.length;){let d=a[a.length-1];o.get(d)===0&&o.set(d,1);let u=n.get(d),f=c.get(d)??0,p=!1;for(;f<u.length;f++){let{to:m,idx:h}=u[f],g=o.get(m);if(g===1)r.add(h);else if(g===0){c.set(d,f+1),a.push(m),p=!0;break}}p||(c.set(d,u.length),o.set(d,2),a.pop())}};for(let l of t)o.get(l)===0&&i(l);return{dag:e.map(l=>r.has(l.idx)?{from:l.to,to:l.from,idx:l.idx,rev:!0}:{from:l.from,to:l.to,idx:l.idx,rev:!1})}}function JD(t,e){let n=new Map,r=new Map;for(let l of t)n.set(l,[]),r.set(l,0);for(let l of e)n.get(l.from).push(l.to),r.set(l.to,(r.get(l.to)??0)+1);let o=new Map;for(let l of t)o.set(l,0);let a=t.filter(l=>(r.get(l)??0)===0),i=new Map(r),s=0;for(;a.length;){let l=a.shift();s++;for(let c of n.get(l))o.set(c,Math.max(o.get(c),o.get(l)+1)),i.set(c,i.get(c)-1),i.get(c)===0&&a.push(c)}return s===t.length?o:null}function eO(t,e,n){if(t.groups.length===0)return[];let r=t.nodes.length;if(r<3||r>60)return[];let o=t.direction==="TB",a=t.nodes.map(tt=>tt.label),i=new Set(a);for(let tt of t.edges)if(tt.source.startsWith("__group_")||tt.target.startsWith("__group_"))return[];let s=new Map(t.groups.map(tt=>[tt.label,tt])),l=new Map;for(let tt of t.groups)for(let F of tt.children)i.has(F)&&l.set(F,tt.label);let c=tt=>{let F=tt,Q=new Set;for(;;){let ot=s.get(F);if(!ot?.parentGroup||Q.has(F))return F;Q.add(F),F=ot.parentGroup}},d=tt=>{let F=l.get(tt);if(!F)return[];let Q=[F],ot=F,Z=new Set([F]);for(;;){let lt=s.get(ot);if(!lt?.parentGroup||Z.has(lt.parentGroup))break;Q.push(lt.parentGroup),Z.add(lt.parentGroup),ot=lt.parentGroup}return Q.reverse()},u="\0node\0",f=tt=>{let F=l.get(tt);return F?c(F):u+tt},p=t.edges.map((tt,F)=>({e:tt,i:F})).filter(({e:tt})=>i.has(tt.source)&&i.has(tt.target)&&tt.source!==tt.target);if(p.length===0)return[];let m=new Map;for(let tt of a)m.set(tt,f(tt));let h=Array.from(new Set(a.map(tt=>m.get(tt)))),g=p.filter(({e:tt})=>m.get(tt.source)!==m.get(tt.target)).map(({e:tt,i:F})=>({from:m.get(tt.source),to:m.get(tt.target),idx:F})),{dag:v}=wg(h,g),y=JD(h,v.map(tt=>({from:tt.from,to:tt.to})));if(!y)return[];let b=new Map,E=new Map;for(let tt of a){let F=m.get(tt);(E.get(F)??E.set(F,[]).get(F)).push(tt)}for(let[tt,F]of E){let Q=new Set(F),ot=p.filter(({e:nt})=>m.get(nt.source)===tt&&m.get(nt.target)===tt&&Q.has(nt.source)&&Q.has(nt.target)).map(({e:nt,i:J})=>({from:nt.source,to:nt.target,idx:J})),{dag:Z}=wg(F,ot),lt=JD(F,Z.map(nt=>({from:nt.from,to:nt.to})));if(!lt)return[];for(let nt of F)b.set(nt,lt.get(nt))}let x=Math.max(...h.map(tt=>y.get(tt))),L=Array.from({length:x+1},()=>1);for(let tt of h){let F=Math.max(...E.get(tt).map(ot=>b.get(ot)+1)),Q=y.get(tt);L[Q]=Math.max(L[Q],F)}let S=[],A=0;for(let tt=0;tt<=x;tt++)S[tt]=A,A+=L[tt];let C=new Set(S.slice(1)),M=new Map;for(let tt of a)M.set(tt,S[y.get(m.get(tt))]+b.get(tt));let w=Math.max(...a.map(tt=>M.get(tt))),k=new Map;for(let tt of t.nodes){let F=e.get(tt.label)??{width:Na,height:oa};k.set(tt.label,{id:tt.label,dummy:!1,rank:M.get(tt.label),cross:0,thick:o?F.width:F.height,depth:o?F.height:F.width,realW:F.width,realH:F.height,unit:m.get(tt.label),path:d(tt.label)})}let N=[],_=[],T=[],R=[];for(let{e:tt,i:F}of p){let Q=M.get(tt.source),ot=M.get(tt.target);if(Q===ot){R.push({edgeIdx:F,a:tt.source,b:tt.target});continue}if(ot<Q){T.push({edgeIdx:F,src:tt.source,tgt:tt.target});continue}let Z=[tt.source],lt=tt.source;for(let nt=Q+1;nt<ot;nt++){let J=`__d${F}_${nt}`;k.set(J,{id:J,dummy:!0,rank:nt,cross:0,thick:yQ,depth:0,realW:0,realH:0,unit:u+J,path:[]}),_.push({a:lt,b:J}),Z.push(J),lt=J}_.push({a:lt,b:tt.target}),Z.push(tt.target),N.push({edgeIdx:F,chain:Z})}let G=Array.from({length:w+1},()=>[]);for(let tt of k.values())G[tt.rank].push(tt.id);let I=new Map,H=new Map;for(let tt of k.keys())I.set(tt,[]),H.set(tt,[]);for(let tt of _)H.get(tt.a).push(tt.b),I.get(tt.b).push(tt.a);let O=new Map,D=tt=>{if(!G[tt+1])return 0;let Q=[];for(let Z of G[tt]){let lt=O.get(Z);for(let nt of H.get(Z))Q.push({p:lt,q:O.get(nt)})}let ot=0;for(let Z=0;Z<Q.length;Z++)for(let lt=Z+1;lt<Q.length;lt++){let nt=Q[Z],J=Q[lt];(nt.p-J.p)*(nt.q-J.q)<0&&ot++}return ot},W=()=>{let tt=0;for(let F=0;F<w;F++)tt+=D(F);return tt},z=(tt,F)=>{let Q=G[tt],ot=F?I:H,Z=new Map;for(let it of Q)Z.set(it,kQ(ot.get(it).map(vt=>O.get(vt))));let lt=Q.filter(it=>Z.get(it)>=0).sort((it,vt)=>Z.get(it)-Z.get(vt)),nt=new Array(Q.length).fill(null);for(let it of Q)Z.get(it)<0&&(nt[O.get(it)]=it);let J=0;for(let it=0;it<nt.length;it++)nt[it]===null&&(nt[it]=lt[J++]);let at=nt;at.forEach((it,vt)=>O.set(it,vt)),G[tt]=at},P=()=>{let tt=!0,F=0;for(;tt&&F++<12;){tt=!1;for(let Q=0;Q<=w;Q++){let ot=G[Q];for(let Z=0;Z<ot.length-1;Z++){let lt=(Q>0?D(Q-1):0)+(Q<w?D(Q):0),nt=ot[Z],J=ot[Z+1];ot[Z]=J,ot[Z+1]=nt,O.set(J,Z),O.set(nt,Z+1),(Q>0?D(Q-1):0)+(Q<w?D(Q):0)<lt?tt=!0:(ot[Z]=nt,ot[Z+1]=J,O.set(nt,Z),O.set(J,Z+1))}}}},B=tt=>{let F=tt===0?null:vQ(tt);for(let Q=0;Q<=w;Q++){let ot=G[Q].slice();if(F)for(let Z=ot.length-1;Z>0;Z--){let lt=Math.floor(F()*(Z+1));[ot[Z],ot[lt]]=[ot[lt],ot[Z]]}G[Q]=ot,ot.forEach((Z,lt)=>O.set(Z,lt))}},Y=n?.restarts??(r<=16?20:r<=30?12:6),V=n?.keepK??3,j=[];for(let tt=0;tt<Y;tt++){B(tt);let F=W(),Q=new Map(O);for(let Z=0;Z<8;Z++){if(Z%2===0)for(let nt=1;nt<=w;nt++)z(nt,!0);else for(let nt=w-1;nt>=0;nt--)z(nt,!1);P();let lt=W();if(lt<F&&(F=lt,Q=new Map(O)),lt===0)break}for(let[Z,lt]of Q)O.set(Z,lt);for(let Z=0;Z<=w;Z++)G[Z].sort((lt,nt)=>O.get(lt)-O.get(nt));let ot=G.map(Z=>Z.join(",")).join("|");j.some(Z=>Z.sig===ot)||j.push({sig:ot,cross:F,order:new Map(Q)})}j.sort((tt,F)=>tt.cross-F.cross);let K=j.slice(0,V);if(K.length===0)return[];let $=[];for(let tt of K){for(let[Q,ot]of tt.order)O.set(Q,ot);let F=Array.from({length:w+1},()=>[]);for(let Q of k.values())F[Q.rank].push(Q.id);for(let Q=0;Q<=w;Q++)F[Q].sort((ot,Z)=>tt.order.get(ot)-tt.order.get(Z));$.push(et(F))}return $;function U(tt,F){return tt.dummy&&F.dummy?SQ:tt.dummy||F.dummy?EQ:wQ}function X(tt,F,Q){let ot=tt.length;if(ot===0)return;let Z=[0];for(let at=1;at<ot;at++)Z[at]=Z[at-1]+Q[at];let lt=F.map((at,it)=>at-Z[it]),nt=[];for(let at=0;at<ot;at++){let it={pos:lt[at],count:1,sumOffset:lt[at],first:at};for(;nt.length&&nt[nt.length-1].pos>=it.pos;){let vt=nt.pop(),Tt=vt.count+it.count,At=vt.sumOffset+it.sumOffset;it={pos:At/Tt,count:Tt,sumOffset:At,first:vt.first}}nt.push(it)}let J=new Array(ot);for(let at of nt)for(let it=0;it<at.count;it++)J[at.first+it]=at.pos;for(let at=0;at<ot;at++)k.get(tt[at]).cross=J[at]+Z[at]}function q(tt,F){let Q=tt.thick/2+F.thick/2+hQ;if(tt.dummy||F.dummy)return Q;if(tt.unit!==F.unit)return Q+2*Ed+bQ;let ot=tt.path[tt.path.length-1],Z=F.path[F.path.length-1];return ot!==Z&&(ot||Z)?Q+2*Ed:Q}function et(tt){let F=tt.map(Ht=>Math.max(0,...Ht.map(Qt=>k.get(Qt).depth))),Q=[],ot=tl;for(let Ht=0;Ht<=w;Ht++)Ht>0&&(ot+=gQ+(C.has(Ht)?xQ:0)),Q[Ht]=ot+F[Ht]/2,ot+=F[Ht];let Z=Ht=>Ht.map((Qt,Ut)=>Ut===0?0:q(k.get(Ht[Ut-1]),k.get(Qt)));for(let Ht=0;Ht<=w;Ht++){let Qt=tt[Ht],Ut=Z(Qt),fe=tl;for(let de=0;de<Qt.length;de++){let te=k.get(Qt[de]);fe+=Ut[de],te.cross=de===0?tl+te.thick/2:fe}}let lt=18;for(let Ht=0;Ht<lt;Ht++){let Ut=Ht%2===0?Array.from({length:w+1},(fe,de)=>de):Array.from({length:w+1},(fe,de)=>w-de);for(let fe of Ut){let de=tt[fe],te=de.map(ae=>{let Te=k.get(ae),Je=0,sn=0;for(let ze of I.get(ae)){let Ce=U(Te,k.get(ze));Je+=Ce,sn+=Ce*k.get(ze).cross}for(let ze of H.get(ae)){let Ce=U(Te,k.get(ze));Je+=Ce,sn+=Ce*k.get(ze).cross}return Je>0?sn/Je:Te.cross});X(de,te,Z(de))}}let nt=1/0;for(let Ht of k.values())nt=Math.min(nt,Ht.cross-Ht.thick/2);let J=tl-nt;for(let Ht of k.values())Ht.cross+=J;let at=Ht=>o?{x:Ht.cross,y:Q[Ht.rank]}:{x:Q[Ht.rank],y:Ht.cross},it=t.nodes.map(Ht=>{let Qt=k.get(Ht.label),Ut=at(Qt);return{label:Ht.label,x:Ut.x,y:Ut.y,width:Qt.realW,height:Qt.realH}}),vt=new Map;for(let Ht of N)vt.set(Ht.edgeIdx,Ht.chain);let Tt=1/0,At=-1/0;for(let Ht of k.values())Ht.dummy||(Tt=Math.min(Tt,Ht.cross-Ht.thick/2),At=Math.max(At,Ht.cross+Ht.thick/2));let rt=34,pt=28,ht=Ht=>Math.max(0,Ht/2-6),dt=Ht=>k.get(Ht.src).cross-k.get(Ht.tgt).cross>=0?1:-1,ut=T.map(Ht=>({...Ht,side:dt(Ht),span:Math.abs(k.get(Ht.src).rank-k.get(Ht.tgt).rank)})).sort((Ht,Qt)=>Ht.side-Qt.side||Ht.span-Qt.span),yt=new Map;for(let Ht of ut)yt.set(Ht.side,(yt.get(Ht.side)??0)+1);let kt=new Map,Ot=new Map;for(let Ht of ut){let Qt=Ht.side,Ut=kt.get(Qt)??0;kt.set(Qt,Ut+1);let fe=yt.get(Qt),de=k.get(Ht.src),te=k.get(Ht.tgt),ae=Qt>0?At+rt+Ut*pt:Tt-rt-Ut*pt,Te=Q[de.rank],Je=Q[te.rank],sn=fe>1?(Ut+1)/(fe+1):0,ze=Te-sn*ht(de.depth),Ce=Je+sn*ht(te.depth),ee=(_n,He)=>o?{x:_n,y:He}:{x:He,y:_n},oe=10,Be=de.cross+Qt*(de.thick/2+oe),dn=te.cross+Qt*(te.thick/2+oe);Ot.set(Ht.edgeIdx,[ee(de.cross,Te),ee(Be,ze),ee(ae,ze),ee(ae,Ce),ee(dn,Ce),ee(te.cross,Je)])}let Xt=new Map;for(let Ht of R){let Qt=k.get(Ht.a),Ut=k.get(Ht.b),fe=Q[Qt.rank],de=fe-(Qt.depth/2+26),te=(ae,Te)=>o?{x:ae,y:Te}:{x:Te,y:ae};Xt.set(Ht.edgeIdx,[te(Qt.cross,fe),te(Qt.cross,de),te(Ut.cross,de),te(Ut.cross,fe)])}let bt=[];for(let Ht=0;Ht<t.edges.length;Ht++){let Qt=t.edges[Ht];if(!i.has(Qt.source)||!i.has(Qt.target))continue;let Ut;if(Qt.source===Qt.target){let fe=at(k.get(Qt.source));Ut=[fe,fe]}else if(Ot.has(Ht))Ut=Ot.get(Ht);else if(Xt.has(Ht))Ut=Xt.get(Ht);else{let fe=vt.get(Ht);if(!fe)continue;Ut=fe.map(de=>at(k.get(de)))}bt.push({source:Qt.source,target:Qt.target,...Qt.label!==void 0&&{label:Qt.label},bidirectional:Qt.bidirectional,lineNumber:Qt.lineNumber,points:Ut,yOffset:0,parallelCount:1,metadata:Qt.metadata})}let Nt=new Map(it.map(Ht=>[Ht.label,{l:Ht.x-Ht.width/2,r:Ht.x+Ht.width/2,t:Ht.y-Ht.height/2,b:Ht.y+Ht.height/2}])),Vt=Ht=>{let Qt=0,Ut=Ht,fe=new Set;for(;Ut&&!fe.has(Ut);)fe.add(Ut),Ut=s.get(Ut)?.parentGroup,Ut&&Qt++;return Qt},xt=new Map;for(let Ht of t.groups)Ht.parentGroup&&(xt.get(Ht.parentGroup)??xt.set(Ht.parentGroup,[]).get(Ht.parentGroup)).push(Ht.label);let Lt=new Map,Dt=[...t.groups].sort((Ht,Qt)=>Vt(Qt.label)-Vt(Ht.label)),zt=[];for(let Ht of Dt){let Qt=1/0,Ut=-1/0,fe=1/0,de=-1/0,te=ze=>{Qt=Math.min(Qt,ze.l),Ut=Math.max(Ut,ze.r),fe=Math.min(fe,ze.t),de=Math.max(de,ze.b)};for(let ze of Ht.children){let Ce=Nt.get(ze);Ce&&te(Ce)}for(let ze of xt.get(Ht.label)??[]){let Ce=Lt.get(ze);Ce&&te(Ce)}if(!Number.isFinite(Qt))continue;let ae=Qt-Ed,Te=Ut+Ed,Je=fe-tO,sn=de+Ed;Lt.set(Ht.label,{l:ae,r:Te,t:Je,b:sn}),zt.push({label:Ht.label,lineNumber:Ht.lineNumber,x:(ae+Te)/2,y:(Je+sn)/2,width:Te-ae,height:sn-Je,collapsed:!1,childCount:Ht.children.length})}let $t=1/0,ft=1/0,Wt=-1/0,he=-1/0,ne=(Ht,Qt,Ut,fe)=>{$t=Math.min($t,Ht),ft=Math.min(ft,Qt),Wt=Math.max(Wt,Ut),he=Math.max(he,fe)};for(let Ht of it)ne(Ht.x-Ht.width/2,Ht.y-Ht.height/2,Ht.x+Ht.width/2,Ht.y+Ht.height/2);for(let Ht of bt)for(let Qt of Ht.points)ne(Qt.x,Qt.y,Qt.x,Qt.y);for(let Ht of zt)ne(Ht.x-Ht.width/2,Ht.y-Ht.height/2,Ht.x+Ht.width/2,Ht.y+Ht.height/2);let se=tl-$t,Zt=tl-ft,Ie=se!==0||Zt!==0;return{nodes:Ie?it.map(Ht=>({...Ht,x:Ht.x+se,y:Ht.y+Zt})):it,edges:Ie?bt.map(Ht=>({...Ht,points:Ht.points.map(Qt=>({x:Qt.x+se,y:Qt.y+Zt}))})):bt,groups:Ie?zt.map(Ht=>({...Ht,x:Ht.x+se,y:Ht.y+Zt})):zt,width:Wt+se+tl,height:he+Zt+tl}}}var hQ,gQ,yQ,tl,Ed,tO,bQ,xQ,wQ,EQ,SQ,v1=st(()=>{"use strict";kf();hQ=50,gQ=60,yQ=10,tl=40,Ed=16,tO=32,bQ=24,xQ=tO+2*Ed,wQ=1,EQ=2,SQ=8});var cO={};ye(cO,{countEdgeNearMiss:()=>HQ,countEdgeNodePierces:()=>sO,countEdgeOverlaps:()=>iO,countGroupOverlaps:()=>Sg,countSplineCrossings:()=>aO,deroutePierces:()=>k1,detectEdgeNodePierces:()=>N1,detectEdgeOverlaps:()=>Eg,detectGroupOverlaps:()=>WQ,layoutBoxesAndLinesSearch:()=>zQ,separateGroupBands:()=>lO});function _Q(t){return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function AQ(t,e){let n=t.slice();for(let r=n.length-1;r>0;r--){let o=Math.floor(e()*(r+1));[n[r],n[o]]=[n[o],n[r]]}return n}function PQ(t){let e=t.match(IQ)??[],n=[],r=0,o=0,a=0,i="",s=()=>parseFloat(e[r++]),l=(c,d,u,f)=>{for(let p=0;p<=1;p+=.12){let m=1-p;u?n.push({x:m*m*m*c.x+3*m*m*p*d.x+3*m*p*p*u.x+p*p*p*f.x,y:m*m*m*c.y+3*m*m*p*d.y+3*m*p*p*u.y+p*p*p*f.y}):n.push({x:m*m*c.x+2*m*p*d.x+p*p*f.x,y:m*m*c.y+2*m*p*d.y+p*p*f.y})}};for(;r<e.length;){let c=e[r];if(/[MLQC]/i.test(c)&&(i=c,r++),i==="M"||i==="L"){let d=s(),u=s();n.push({x:d,y:u}),o=d,a=u}else if(i==="Q"){let d={x:s(),y:s()},u={x:s(),y:s()};l({x:o,y:a},d,null,u),o=u.x,a=u.y}else if(i==="C"){let d={x:s(),y:s()},u={x:s(),y:s()},f={x:s(),y:s()};l({x:o,y:a},d,u,f),o=f.x,a=f.y}else r++}return n}function L1(t){let e=t.edges,n=nO.get(e);if(n)return n;let r=t.edges.map(o=>{let a=o.points.length>=2?PQ(RQ(o.points)??""):[],i=1/0,s=1/0,l=-1/0,c=-1/0;for(let d of a)d.x<i&&(i=d.x),d.x>l&&(l=d.x),d.y<s&&(s=d.y),d.y>c&&(c=d.y);return{pts:a,x0:i,y0:s,x1:l,y1:c}});return nO.set(e,r),r}function DQ(t,e,n,r){let o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(Math.abs(o)<1e-9)return null;let a=((n.x-t.x)*(r.y-n.y)-(n.y-t.y)*(r.x-n.x))/o,i=((n.x-t.x)*(e.y-t.y)-(n.y-t.y)*(e.x-t.x))/o;return a>0&&a<1&&i>0&&i<1?{x:t.x+a*(e.x-t.x),y:t.y+a*(e.y-t.y)}:null}function aO(t,e=1/0){let n=new Map;for(let s of t.nodes)n.set(s.label,{x:s.x,y:s.y});for(let s of t.groups)s.collapsed&&n.set("__group_"+s.label,{x:s.x,y:s.y});let r=L1(t),o=t.edges,a=34,i=0;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){let c=r[s],d=r[l];if(c.pts.length<2||d.pts.length<2||c.x1<d.x0||d.x1<c.x0||c.y1<d.y0||d.y1<c.y0)continue;let u=o[s],f=o[l],p,m;(u.source===f.source||u.source===f.target)&&(p=n.get(u.source)),(u.target===f.source||u.target===f.target)&&(m=n.get(u.target));let h=[],g=c.pts,v=d.pts;for(let y=1;y<g.length;y++){let b=g[y-1],E=g[y],x=b.x<E.x?b.x:E.x,L=b.x>E.x?b.x:E.x,S=b.y<E.y?b.y:E.y,A=b.y>E.y?b.y:E.y;for(let C=1;C<v.length;C++){let M=v[C-1],w=v[C];if(L<(M.x<w.x?M.x:w.x)||(M.x>w.x?M.x:w.x)<x||A<(M.y<w.y?M.y:w.y)||(M.y>w.y?M.y:w.y)<S)continue;let k=DQ(b,E,M,w);k&&(p&&Math.hypot(k.x-p.x,k.y-p.y)<a||m&&Math.hypot(k.x-m.x,k.y-m.y)<a||h.some(N=>Math.hypot(N.x-k.x,N.y-k.y)<6)||h.push(k))}}if(i+=h.length,i>e)return i}return i}function OQ(t,e,n){let r=n.x-e.x,o=n.y-e.y,a=r*r+o*o;if(a<1e-9)return Math.hypot(t.x-e.x,t.y-e.y);let i=((t.x-e.x)*r+(t.y-e.y)*o)/a;return i=Math.max(0,Math.min(1,i)),Math.hypot(t.x-(e.x+i*r),t.y-(e.y+i*o))}function GQ(t,e){let n=1/0;for(let r=1;r<e.length;r++)n=Math.min(n,OQ(t,e[r-1],e[r]));return n}function rO(t,e){let n=Math.max(e.x-e.w/2-t.x,0,t.x-(e.x+e.w/2)),r=Math.max(e.y-e.h/2-t.y,0,t.y-(e.y+e.h/2));return Math.hypot(n,r)}function Eg(t,e){let n=e?.dist??8,r=e?.minLen??16,o=e?.nodeClear??12,a=new Map;for(let c of t.nodes)a.set(c.label,{x:c.x,y:c.y,w:c.width,h:c.height});for(let c of t.groups)c.collapsed&&a.set("__group_"+c.label,{x:c.x,y:c.y,w:c.width,h:c.height});let i=L1(t),s=t.edges,l=[];for(let c=0;c<i.length;c++)for(let d=c+1;d<i.length;d++){let u=i[c],f=i[d];if(u.pts.length<2||f.pts.length<2||u.x1+n<f.x0||f.x1+n<u.x0||u.y1+n<f.y0||f.y1+n<u.y0)continue;let p=s[c],m=s[d],h,g;(p.source===m.source||p.source===m.target)&&(h=a.get(p.source)),(p.target===m.source||p.target===m.target)&&(g=a.get(p.target));let v=[],y=0,b=()=>{y>=r&&v.length>=2&&l.push({mid:v[Math.floor(v.length/2)],length:y,pts:v.slice()}),v=[],y=0};for(let E of u.pts)!(h!==void 0&&rO(E,h)<o||g!==void 0&&rO(E,g)<o)&&GQ(E,f.pts)<n?(v.length&&(y+=Math.hypot(E.x-v[v.length-1].x,E.y-v[v.length-1].y)),v.push(E)):b();b()}return l}function iO(t,e){return Eg(t,e).length}function N1(t,e){let n=e?.inset??6,r=e?.minPts??2,o=[];for(let l of t.nodes)o.push({key:l.label,x:l.x,y:l.y,w:l.width,h:l.height});for(let l of t.groups)l.collapsed&&o.push({key:"__group_"+l.label,x:l.x,y:l.y,w:l.width,h:l.height});let a=(l,c)=>Math.abs(l.x-c.x)<c.w/2-n&&Math.abs(l.y-c.y)<c.h/2-n,i=[],s=L1(t);return t.edges.forEach((l,c)=>{if(l.points.length<2)return;let d=s[c].pts;for(let u of o){if(u.key===l.source||u.key===l.target||"__group_"+u.key===l.source||"__group_"+u.key===l.target)continue;let f=d.filter(p=>a(p,u));f.length>=r&&i.push({edgeIdx:c,node:u.key,pts:f})}}),i}function sO(t,e){return N1(t,e).length}function k1(t){let e=N1(t);if(!e.length)return t;let n=new Map;for(let a of t.nodes)n.set(a.label,{x:a.x,y:a.y,w:a.width,h:a.height});for(let a of t.groups)a.collapsed&&n.set("__group_"+a.label,{x:a.x,y:a.y,w:a.width,h:a.height});let r=new Map;for(let a of e){let i=r.get(a.edgeIdx);i?i.push(a.node):r.set(a.edgeIdx,[a.node])}let o=t.edges.map((a,i)=>{let s=r.get(i);if(!s)return a;let l=a.points.map(c=>({x:c.x,y:c.y}));for(let c of s){let d=n.get(c);d&&(l=$Q(l,d))}return{...a,points:l}});return{...t,edges:o}}function $Q(t,e){if(t.length<2)return t;let n={x:e.x,y:e.y},r=-1,o=0,a=1/0,i=t[0];for(let x=0;x<t.length-1;x++){let L=t[x],S=t[x+1],A=S.x-L.x,C=S.y-L.y,M=A*A+C*C||1e-9,w=((n.x-L.x)*A+(n.y-L.y)*C)/M;w=Math.max(0,Math.min(1,w));let k={x:L.x+w*A,y:L.y+w*C},N=Math.hypot(k.x-n.x,k.y-n.y);N<a&&(a=N,r=x,o=w,i=k)}if(r<0)return t;let s=i.x-n.x,l=i.y-n.y;Math.hypot(s,l)<1&&(e.w<=e.h?(s=1,l=0):(s=0,l=1));let c=Math.hypot(s,l)||1;s/=c,l/=c;let d=t[r],u=t[r+1],f=u.x-d.x,p=u.y-d.y,m=Math.hypot(f,p)||1;f/=m,p/=m;let h=Math.hypot(e.w,e.h)/2+18,g=Math.hypot(e.w,e.h)/2,v={x:i.x-f*g+s*h*.5,y:i.y-p*g+l*h*.5},y={x:n.x+s*h,y:n.y+l*h},b={x:i.x+f*g+s*h*.5,y:i.y+p*g+l*h*.5},E=t.slice(0,r+1);return E.push(v,y,b),E.push(...t.slice(r+1)),E}function HQ(t,e){let n=e?.near??14,r=e?.tight??8,o=e?.minLen??18,a=Eg(t,{dist:n,minLen:o}).length,i=Eg(t,{dist:r,minLen:o}).length;return Math.max(0,a-i)}function WQ(t,e){let n=e?.margin??4,r=t.groups.map(s=>({label:s.label,l:s.x-s.width/2,r:s.x+s.width/2,t:s.y-s.height/2,b:s.y+s.height/2})),o=(s,l)=>s.l<=l.l+n&&s.r>=l.r-n&&s.t<=l.t+n&&s.b>=l.b-n,a=r.map((s,l)=>r.some((d,u)=>u!==l&&o(s,d))?{...s,t:s.t-Lf}:s),i=new Set;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){if(o(r[s],r[l])||o(r[l],r[s]))continue;let c=a[s],d=a[l],u=Math.max(c.l-d.r,d.l-c.r),f=Math.max(c.t-d.b,d.t-c.b);Math.max(u,f)<n&&(i.add(r[s].label),i.add(r[l].label))}return[...i]}function Sg(t,e){let n=e?.margin??4,r=t.groups.map(s=>({l:s.x-s.width/2,r:s.x+s.width/2,t:s.y-s.height/2,b:s.y+s.height/2})),o=(s,l)=>s.l<=l.l+n&&s.r>=l.r-n&&s.t<=l.t+n&&s.b>=l.b-n,a=r.map((s,l)=>r.some((d,u)=>u!==l&&o(s,d))?{...s,t:s.t-Lf}:s),i=0;for(let s=0;s<r.length;s++)for(let l=s+1;l<r.length;l++){if(o(r[s],r[l])||o(r[l],r[s]))continue;let c=a[s],d=a[l],u=Math.max(c.l-d.r,d.l-c.r),f=Math.max(c.t-d.b,d.t-c.b);Math.max(u,f)<n&&i++}return i}function lO(t,e){if(t.groups.some(T=>T.collapsed)||Sg(t)===0)return t;let n=new Map;for(let T of e.groups)n.set(T.label,T.parentGroup);let r=T=>{let R=T,G=new Set;for(;;){let I=n.get(R);if(!I||G.has(I))return R;G.add(R),R=I}},o=e.groups.filter(T=>!T.parentGroup).map(T=>T.label);if(o.length<2)return t;let a=new Map;for(let T of e.groups)for(let R of T.children)e.groups.some(G=>G.label===R)||a.set(R,r(T.label));let i=e.direction==="TB"?"x":"y",s=new Map(t.groups.map(T=>[T.label,T])),l=o.map(T=>{let R=s.get(T),G=(i==="y"?R.height:R.width)/2,I=(i==="y"?R.y:R.x)-G,H=(i==="y"?R.y:R.x)+G,O=e.groups.some(D=>D.parentGroup===T);return i==="y"&&O&&(I-=Lf),{label:T,lo:I,hi:H,c:(I+H)/2}});l.sort((T,R)=>T.c-R.c);let c=16,d=l.map(T=>(T.hi-T.lo)/2),u=[0];for(let T=1;T<l.length;T++)u[T]=u[T-1]+d[T-1]+c+d[T];let f=l.map((T,R)=>T.c-u[R]),p=[];for(let T=0;T<l.length;T++){let R={pos:f[T],count:1,sum:f[T],first:T};for(;p.length&&p[p.length-1].pos>=R.pos;){let G=p.pop(),I=G.count+R.count,H=G.sum+R.sum;R={pos:H/I,count:I,sum:H,first:G.first}}p.push(R)}let m=new Array(l.length);for(let T of p)for(let R=0;R<T.count;R++)m[T.first+R]=T.pos+u[T.first+R];let h=new Map,g=!1;if(l.forEach((T,R)=>{let G=m[R]-T.c;h.set(T.label,G),Math.abs(G)>.5&&(g=!0)}),!g)return t;let v=T=>{if(T.startsWith("__group_"))return h.get(r(T.slice(8)))??0;let R=a.get(T);return R?h.get(R)??0:0},y=(T,R)=>i==="y"?{x:T.x,y:T.y+R}:{x:T.x+R,y:T.y},b=t.nodes.map(T=>{let R=v(T.label);return R?{...T,...i==="y"?{y:T.y+R}:{x:T.x+R}}:T}),E=t.groups.map(T=>{let R=h.get(r(T.label))??0;return R?{...T,...i==="y"?{y:T.y+R}:{x:T.x+R}}:T}),x=t.edges.map(T=>{let R=v(T.source),G=v(T.target);if(!R&&!G)return T;let I=T.points.length,H=T.points.map((O,D)=>{let W=I>1?D/(I-1):0;return y(O,R*(1-W)+G*W)});return{...T,points:H}}),L=1/0,S=1/0,A=-1/0,C=-1/0,M=(T,R)=>{T<L&&(L=T),T>A&&(A=T),R<S&&(S=R),R>C&&(C=R)};for(let T of b)M(T.x-T.width/2,T.y-T.height/2),M(T.x+T.width/2,T.y+T.height/2);for(let T of E)M(T.x-T.width/2,T.y-T.height/2-Lf),M(T.x+T.width/2,T.y+T.height/2);for(let T of x)for(let R of T.points)M(R.x,R.y);let w=40,k=w-L,N=w-S,_=k!==0||N!==0;return{nodes:_?b.map(T=>({...T,x:T.x+k,y:T.y+N})):b,groups:_?E.map(T=>({...T,x:T.x+k,y:T.y+N})):E,edges:_?x.map(T=>({...T,points:T.points.map(R=>({x:R.x+k,y:R.y+N}))})):x,width:A-L+2*w,height:C-S+2*w}}function BQ(t,e,n,r){let o=e.x-t.x,a=e.y-t.y,i=r.x-n.x,s=r.y-n.y,l=o*s-a*i;if(Math.abs(l)<1e-9)return!1;let c=((n.x-t.x)*s-(n.y-t.y)*i)/l,d=((n.x-t.x)*a-(n.y-t.y)*o)/l;return c>.001&&c<.999&&d>.001&&d<.999}function oO(t){let e=t.edges.filter(o=>o.points.length>=2),n=e.map(o=>{let a=1/0,i=1/0,s=-1/0,l=-1/0;for(let c of o.points)c.x<a&&(a=c.x),c.x>s&&(s=c.x),c.y<i&&(i=c.y),c.y>l&&(l=c.y);return{x0:a,y0:i,x1:s,y1:l}}),r=0;for(let o=0;o<e.length;o++)for(let a=o+1;a<e.length;a++){let i=e[o],s=e[a];if(i.source===s.source||i.source===s.target||i.target===s.source||i.target===s.target)continue;let l=n[o],c=n[a];if(l.x1<c.x0||c.x1<l.x0||l.y1<c.y0||c.y1<l.y0)continue;let d=i.points,u=s.points,f=!1;for(let p=0;p<d.length-1&&!f;p++)for(let m=0;m<u.length-1;m++)if(BQ(d[p],d[p+1],u[m],u[m+1])){f=!0;break}f&&r++}return r}function FQ(t,e){if(!e?.size)return 0;let n=0,r=0;for(let o of t.nodes){let a=e.get(o.label);a&&(n+=Math.hypot(o.x-a.x,o.y-a.y),r++)}return r?n/r:0}function YQ(t){let e=0;for(let n of t.edges)for(let r=1;r<n.points.length;r++)e+=Math.hypot(n.points[r].x-n.points[r-1].x,n.points[r].y-n.points[r-1].y);return e}async function zQ(t,e,n){let r=n?.hideDescriptions??!1,o=n?.reserveEdgeLabels??!1,a=n?.onProgress,i=a?()=>new Promise(nt=>setTimeout(nt)):()=>{},s=150,l=30,c=performance.now(),d=c,u=new Set;if(e){let nt=new Set;for(let J of e.originalGroups)t.groups.some(at=>at.label===J.label)||nt.add(J.label);for(let J of nt){let it=e.originalGroups.find(vt=>vt.label===J)?.parentGroup;(!it||!nt.has(it))&&u.add(J)}}let f=new Map,p=0;for(let nt of t.nodes){let J=r?{width:Na,height:oa}:M1(nt,t.showValues===!0);f.set(nt.label,J),!r&&nt.description&&nt.description.length>0&&(p=Math.max(p,J.height))}if(p>0){for(let nt of t.nodes)if(nt.description&&nt.description.length>0){let J=f.get(nt.label);f.set(nt.label,{width:J.width,height:p})}}let m=nt=>`__group_${nt}`,h=t.direction==="TB"?"TB":"LR",g=new Set(t.nodes.map(nt=>nt.label)),v=new Map,y=new Map;for(let nt of t.groups)if(v.set(nt.label,nt.children.filter(J=>g.has(J))),nt.parentGroup){let J=y.get(nt.parentGroup)??[];J.push(nt.label),y.set(nt.parentGroup,J)}let b=new Map,E=nt=>{let J=b.get(nt);if(J)return J;b.set(nt,[]);let at=[...v.get(nt)??[]];for(let it of y.get(nt)??[])at.push(...E(it));return b.set(nt,at),at},x=new Map,L=new Map;for(let nt of t.groups){let J=E(nt.label);if(J.length===0)continue;let at=new Set(J),it=new Map;for(let ht of t.edges)if(at.has(ht.source)&&at.has(ht.target)){let dt=it.get(ht.target)??[];dt.push(ht.source),it.set(ht.target,dt)}let vt=new Map,Tt=new Set,At=ht=>{let dt=vt.get(ht);if(dt!==void 0)return dt;if(Tt.has(ht))return 0;Tt.add(ht);let ut=0;for(let yt of it.get(ht)??[])ut=Math.max(ut,At(yt)+1);return Tt.delete(ht),vt.set(ht,ut),ut},rt=J[0],pt=J[0];for(let ht of J)At(ht)>At(rt)&&(rt=ht),At(ht)<At(pt)&&(pt=ht);x.set(m(nt.label),rt),L.set(m(nt.label),pt)}let S=nt=>x.get(nt)??nt,A=nt=>L.get(nt)??nt,C=nt=>`${nt.source}->${nt.target}#${nt.lineNumber}`,M=(nt,J)=>{let at=J.x-nt.x,it=J.y-nt.y,vt=at===0?1/0:nt.w/2/Math.abs(at),Tt=it===0?1/0:nt.h/2/Math.abs(it),At=Math.min(vt,Tt);return Number.isFinite(At)?{x:nt.x+at*At,y:nt.y+it*At}:{x:nt.x,y:nt.y}},w=(nt,J)=>Math.abs(nt.x-J.x)<=J.w/2&&Math.abs(nt.y-J.y)<=J.h/2,k=t.nodePositions,N=new Set(t.groups.map(nt=>nt.label)),_=t.groups.every(nt=>!nt.parentGroup&&!nt.children.some(J=>N.has(J))),T=new Set((e?.originalGroups??t.groups).map(nt=>nt.label)),R=u.size===0||k!==void 0&&e!==void 0&&[...u].every(nt=>{let J=e.originalGroups.find(at=>at.label===nt);return!J||J.parentGroup?!1:J.children.every(at=>k.has(at)&&!T.has(at))}),G=k!==void 0&&(t.nodes.length>0||u.size>0)&&t.nodes.every(nt=>k.has(nt.label))&&_&&R;function I(nt){let J=new Map,at=[];if(e)for(let Lt of u){let Dt=e.originalGroups.find(se=>se.label===Lt);if(!Dt)continue;let zt=1/0,$t=1/0,ft=-1/0,Wt=-1/0;for(let se of Dt.children){let Zt=nt.get(se);Zt&&(zt=Math.min(zt,Zt.x),ft=Math.max(ft,Zt.x),$t=Math.min($t,Zt.y),Wt=Math.max(Wt,Zt.y))}if(!Number.isFinite(zt))continue;let he=(zt+ft)/2,ne=($t+Wt)/2;J.set(`__group_${Lt}`,{x:he,y:ne}),at.push({label:Lt,lineNumber:Dt.lineNumber,childCount:e.collapsedChildCounts.get(Lt)??Dt.children.length,x:he,y:ne})}let it=Lt=>nt.get(Lt)??J.get(Lt),vt=Lt=>{let Dt=it(Lt),zt=f.get(Lt)??{width:Na,height:oa};return{x:Dt.x,y:Dt.y,w:zt.width,h:zt.height}},Tt=t.nodes.map(Lt=>{let Dt=vt(Lt.label);return{label:Lt.label,x:Dt.x,y:Dt.y,width:Dt.w,height:Dt.h}}),At=t.edges.flatMap(Lt=>{let Dt=it(Lt.source),zt=it(Lt.target);if(!Dt||!zt)return[];let $t=vt(Lt.source),ft=vt(Lt.target),Wt=M($t,zt),he=M(ft,Dt);return[{source:Lt.source,target:Lt.target,...Lt.label!==void 0&&{label:Lt.label},bidirectional:Lt.bidirectional,lineNumber:Lt.lineNumber,points:[Wt,he],yOffset:0,parallelCount:1,metadata:Lt.metadata,straight:!0}]}),rt=16,pt=new Map(Tt.map(Lt=>[Lt.label,Lt])),ht=[];for(let Lt of t.groups){let Dt=1/0,zt=1/0,$t=-1/0,ft=-1/0;for(let Zt of Lt.children){let Ie=pt.get(Zt);Ie&&(Dt=Math.min(Dt,Ie.x-Ie.width/2),$t=Math.max($t,Ie.x+Ie.width/2),zt=Math.min(zt,Ie.y-Ie.height/2),ft=Math.max(ft,Ie.y+Ie.height/2))}if(!Number.isFinite(Dt))continue;let Wt=Dt-rt,he=$t+rt,ne=zt-Lf,se=ft+rt;ht.push({label:Lt.label,lineNumber:Lt.lineNumber,x:(Wt+he)/2,y:(ne+se)/2,width:he-Wt,height:se-ne,collapsed:!1,childCount:Lt.children.length})}for(let Lt of at)ht.push({label:Lt.label,lineNumber:Lt.lineNumber,x:Lt.x,y:Lt.y,width:Na,height:oa,collapsed:!0,childCount:Lt.childCount});let dt=40,ut=1/0,yt=1/0,kt=-1/0,Ot=-1/0,Xt=(Lt,Dt)=>{Lt<ut&&(ut=Lt),Lt>kt&&(kt=Lt),Dt<yt&&(yt=Dt),Dt>Ot&&(Ot=Dt)};for(let Lt of Tt)Xt(Lt.x-Lt.width/2,Lt.y-Lt.height/2),Xt(Lt.x+Lt.width/2,Lt.y+Lt.height/2);for(let Lt of At)for(let Dt of Lt.points)Xt(Dt.x,Dt.y);for(let Lt of ht)Xt(Lt.x-Lt.width/2,Lt.y-Lt.height/2),Xt(Lt.x+Lt.width/2,Lt.y+Lt.height/2);let bt=2,Nt=ut<dt-bt?dt-ut:0,Vt=yt<dt-bt?dt-yt:0,xt=Nt!==0||Vt!==0;return{nodes:xt?Tt.map(Lt=>({...Lt,x:Lt.x+Nt,y:Lt.y+Vt})):Tt,edges:xt?At.map(Lt=>({...Lt,points:Lt.points.map(Dt=>({x:Dt.x+Nt,y:Dt.y+Vt}))})):At,groups:xt?ht.map(Lt=>({...Lt,x:Lt.x+Nt,y:Lt.y+Vt})):ht,width:kt+Nt+dt,height:Ot+Vt+dt}}function H(nt){let J=nt.seed===void 0?null:_Q(nt.seed+1),at=dt=>J?AQ(dt,J):dt.slice(),it=new er.graphlib.Graph({compound:!0,multigraph:!0});it.setGraph({rankdir:h,ranker:nt.ranker,nodesep:nt.nodesep,ranksep:nt.ranksep,edgesep:20,marginx:40,marginy:40}),it.setDefaultEdgeLabel(()=>({}));for(let dt of at(t.groups))it.setNode(m(dt.label),{label:dt.label});for(let dt of at(t.nodes)){let ut=f.get(dt.label);it.setNode(dt.label,{width:ut.width,height:ut.height})}for(let dt of u)it.setNode(m(dt),{width:Na,height:oa});for(let dt of t.groups){dt.parentGroup&&it.hasNode(m(dt.parentGroup))&&it.setParent(m(dt.label),m(dt.parentGroup));for(let ut of at(dt.children))it.hasNode(ut)&&it.setParent(ut,m(dt.label))}if(e)for(let dt of u){let ut=e.originalGroups.find(yt=>yt.label===dt);ut?.parentGroup&&!u.has(ut.parentGroup)&&it.hasNode(m(ut.parentGroup))&&it.setParent(m(dt),m(ut.parentGroup))}for(let dt of at(t.edges)){let ut=S(dt.source),yt=A(dt.target);if(ut!==yt&&it.hasNode(ut)&&it.hasNode(yt)){let kt={};if(o&&dt.label){let Ot=w1(dt.label,xg);kt={width:Ot.width,height:Ot.height,labelpos:"c"}}it.setEdge(ut,yt,kt,C(dt))}}er.layout(it);let vt=t.nodes.map(dt=>{let ut=it.node(dt.label);return{label:dt.label,x:ut.x,y:ut.y,width:ut.width,height:ut.height}}),Tt=t.groups.map(dt=>{let ut=it.node(m(dt.label));return{label:dt.label,lineNumber:dt.lineNumber,x:ut.x,y:ut.y,width:ut.width,height:ut.height,collapsed:!1,childCount:dt.children.length}});for(let dt of u){let ut=it.node(m(dt));Tt.push({label:dt,lineNumber:0,x:ut.x,y:ut.y,width:ut.width,height:ut.height,collapsed:!0,childCount:e?.collapsedChildCounts.get(dt)??0})}let At=new Map;for(let dt of t.groups){let ut=it.node(m(dt.label));ut&&At.set(m(dt.label),{x:ut.x,y:ut.y,w:ut.width,h:ut.height})}let rt=(dt,ut,yt)=>{if(dt.length<2)return dt;let kt=dt,Ot=At.get(ut);if(Ot){let bt=0;for(;bt<kt.length-1&&w(kt[bt],Ot);)bt++;kt=[M(Ot,kt[bt]),...kt.slice(bt)]}let Xt=At.get(yt);if(Xt){let bt=kt.length-1;for(;bt>0&&w(kt[bt],Xt);)bt--;kt=[...kt.slice(0,bt+1),M(Xt,kt[bt])]}return kt},pt=t.edges.flatMap(dt=>{let ut=S(dt.source),yt=A(dt.target),kt=C(dt);if(ut===yt||!it.hasEdge(ut,yt,kt))return[];let Ot=it.edge(ut,yt,kt),Xt=rt(Ot?.points??[],dt.source,dt.target);return[{source:dt.source,target:dt.target,...dt.label!==void 0&&{label:dt.label},bidirectional:dt.bidirectional,lineNumber:dt.lineNumber,points:Xt,yOffset:0,parallelCount:1,metadata:dt.metadata}]}),ht=it.graph();return{nodes:vt,edges:pt,groups:Tt,width:ht.width??800,height:ht.height??600}}if(G)return I(k);let O=t.nodes.length,D=n?.seeds??(O<=12?80:O<=22?40:O<=35?22:10),W=n?.refineK??6,z=n?.lambda??LQ,P=n?.previousPositions,B=["network-simplex","tight-tree","longest-path"],Y=[{nodesep:50,ranksep:60},{nodesep:34,ranksep:46},{nodesep:66,ranksep:82}],V=[];for(let nt of B)for(let J of Y)V.push({ranker:nt,...J});for(let nt=0;nt<D;nt++)V.push({ranker:"network-simplex",nodesep:50,ranksep:60,seed:nt});let j=(nt,J)=>{let at=aO(nt,J);return at>J?1/0:at+iO(nt)+sO(nt)+Sg(nt)},K=(nt,J)=>J*1e6+YQ(nt)+z*FQ(nt,P)*10,$=V.length+Math.min(n?.refineK??6,V.length),U=0,X=async nt=>{if(!a)return;a(++U,$,nt);let J=performance.now();J-c>s&&J-d>l&&(d=J,await i())},q=[];for(let nt of V){try{q.push(H(nt))}catch{}await X("Optimizing layout")}if(!q.length)return H({ranker:"network-simplex",nodesep:50,ranksep:60});let et=[];try{et=ZD(t,f)}catch{}if(t.groups.length>0&&u.size===0)try{et=et.concat(eO(t,f))}catch{}let tt=new Map;for(let nt of q)tt.set(nt,K(nt,oO(nt)));q.sort((nt,J)=>tt.get(nt)-tt.get(J));let F=Math.min(W,q.length),Q=q[0],ot=1/0,Z=1/0,lt=nt=>{let J=j(nt,Z);if(J===1/0)return;let at=K(nt,J);at<ot&&(ot=at,Z=J,Q=nt)};for(let nt of q.slice(0,F))lt(nt),await X("Refining layout");if(Z>=NQ&&O<=MQ){let nt=[];for(let at=D;at<D+TQ;at++)try{nt.push(H({ranker:"network-simplex",nodesep:50,ranksep:60,seed:at}))}catch{}let J=new Map;for(let at of nt)J.set(at,K(at,oO(at)));nt.sort((at,it)=>J.get(at)-J.get(it));for(let at of nt.slice(0,CQ))lt(at)}for(let nt of et){let J=[nt],at=k1(nt);at!==nt&&J.push(at);for(let it of J){let vt=j(it,Z-1);vt<Z&&(Z=vt,Q=it)}}if(Z>0){let nt=k1(Q);nt!==Q&&j(nt,Z-1)<Z&&(Q=nt)}if(Z>0&&Sg(Q)>0){let nt=lO(Q,t);nt!==Q&&j(nt,Z-1)<Z&&(Q=nt)}return Q}var LQ,NQ,MQ,TQ,CQ,RQ,IQ,nO,Lf,dO=st(()=>{"use strict";ss();Eo();kf();QD();v1();S1();LQ=4,NQ=4,MQ=45,TQ=18,CQ=10;RQ=Kn().x(t=>t.x).y(t=>t.y).curve(fo),IQ=/[MLQC]|-?\d*\.?\d+(?:e-?\d+)?/gi;nO=new WeakMap;Lf=32});var gO={};ye(gO,{NODE_HEIGHT:()=>oa,NODE_WIDTH:()=>Na,computeNodeSize:()=>M1,layoutBoxesAndLines:()=>eJ});function JQ(t){let e=[],n=0;for(let r=1;r<t.length;r++){let o=t.charAt(r-1),a=t.charAt(r),i=r+1<t.length?t.charAt(r+1):"",s=o>="a"&&o<="z"&&a>="A"&&a<="Z",l=o>="A"&&o<="Z"&&a>="A"&&a<="Z"&&i>="a"&&i<="z";(s||l)&&(e.push(t.slice(n,r)),n=r)}return e.push(t.slice(n)),e.length>1?e:[t]}function tJ(t,e=Na){let n=t.split(/[\s-]+/),r=[];for(let a of n)a&&r.push(...JQ(a));let o=e-24;for(let a=13;a>=9;a--){if(o<_t("MM",a))continue;let i=1,s="";for(let l of r){let c=s?`${s} ${l}`:l;_t(c,a)<=o?s=c:(i++,s=l)}if(i<=C1)return Math.min(i,C1)}return C1}function M1(t,e){if(!t.description||t.description.length===0)return{width:Na,height:oa};let n=XQ,o=tJ(t.label,n)*13*qQ+KQ,a=n-24,i=0;for(let c of t.description)_t(c,T1)<=a?i+=1:i+=Tn(c,T1,a,{hardBreak:!0}).length;i=Math.min(i,jQ);let s=i*T1*mO,l=o+hO+_1+s+_1+(e?QQ:0);return{width:n,height:Math.max(oa,l)}}async function eJ(t,e,n){let{layoutBoxesAndLinesSearch:r}=await Promise.resolve().then(()=>(dO(),cO)),o={...n?.hideDescriptions!==void 0&&{hideDescriptions:n.hideDescriptions},...n?.previousPositions!==void 0&&{previousPositions:n.previousPositions},...n?.onProgress!==void 0&&{onProgress:n.onProgress}},a=await r(t,e,o),i=E1(pO(a));if(i.unresolved.length>0){let s=await r(t,e,{...o,reserveEdgeLabels:!0}),l=E1(pO(s));l.unresolved.length<i.unresolved.length&&(i=l)}return nJ(i.layout,t,n?.collapsedNotes)}function nJ(t,e,n){let o=e.options?.["no-notes"]==="on"||!e.notes?new Map:no(e.notes,e.nodes.map(y=>({id:y.label,label:y.label})));if(o.size===0)return t;let a=$c(t.nodes.map(y=>({id:y.label,x:y.x,y:y.y,width:y.width,height:y.height})),o,e.direction==="TB"?"TB":"LR",n),i=t.nodes.map(y=>{let b=a.get(y.label);return b?{...y,note:b}:y}),s=1/0,l=1/0,c=-1/0,d=-1/0,u=(y,b,E,x)=>{y<s&&(s=y),b<l&&(l=b),E>c&&(c=E),x>d&&(d=x)};for(let y of i)u(y.x-y.width/2,y.y-y.height/2,y.x+y.width/2,y.y+y.height/2),y.note&&!y.note.collapsed&&u(y.x+y.note.x,y.y+y.note.y,y.x+y.note.x+y.note.width,y.y+y.note.y+y.note.height);for(let y of t.groups)u(y.x-y.width/2,y.y-y.height/2,y.x+y.width/2,y.y+y.height/2);if(!Number.isFinite(s))return{...t,nodes:i};let{shiftX:f,shiftY:p}=Hs(s,l),m=f!==0||p!==0,h=m?i.map(y=>({...y,x:y.x+f,y:y.y+p})):i,g=m?t.edges.map(y=>({...y,points:y.points.map(b=>({x:b.x+f,y:b.y+p})),...y.labelX!==void 0&&{labelX:y.labelX+f},...y.labelY!==void 0&&{labelY:y.labelY+p}})):t.edges,v=m?t.groups.map(y=>({...y,x:y.x+f,y:y.y+p})):t.groups;return{nodes:h,edges:g,groups:v,width:c+f+uO,height:d+p+uO}}function pO(t){let e=new Map;if(t.edges.forEach((o,a)=>{let[i,s]=o.source<o.target?[o.source,o.target]:[o.target,o.source],l=`${i}\0${s}`,c=e.get(l);c?c.push(a):e.set(l,[a])}),[...e.values()].every(o=>o.length<2))return t;let n=new Array(t.edges.length).fill(0),r=new Array(t.edges.length).fill(1);for(let o of e.values()){let a=o.slice(0,fO);for(let i of o.slice(fO))r[i]=0;a.length<2||a.forEach((i,s)=>{n[i]=(s-(a.length-1)/2)*VQ,r[i]=a.length})}return{...t,edges:t.edges.map((o,a)=>({...o,yOffset:n[a],parallelCount:r[a]}))}}var uO,fO,VQ,UQ,oa,Na,XQ,T1,mO,_1,hO,jQ,C1,qQ,KQ,ZQ,QQ,kf=st(()=>{"use strict";en();S1();ts();uO=40,fO=5,VQ=22,UQ=1.618,oa=60,Na=Math.round(oa*UQ),XQ=140,T1=10,mO=1.4,_1=8,hO=4,jQ=6,C1=3,qQ=1.3,KQ=12,ZQ=11,QQ=hO+ZQ*mO+_1});var MO={};ye(MO,{layoutSwimlane:()=>aJ});function oJ(t){return t==="exclusive"||t==="parallel"?{w:bO,h:bO}:t==="terminal"?{w:xO,h:xO}:{w:R1,h:LO}}function kO(t,e,n,r){let o=new Map,a=new Map;for(let c of t)o.set(c,[]),a.set(c,0);for(let c of e)o.get(c.from)?.push(c.to),a.set(c.to,(a.get(c.to)??0)+1);let i=new Map(t.map(c=>[c,0])),s=new Map;for(let c of t)s.set(c,new Map);let l=t.filter(c=>(a.get(c)??0)===0);for(let c=0;c<l.length;c++){let d=l[c],u=n(d),f=s.get(d),p=r?.get(d);p!==void 0&&(i.get(d)??0)<p&&i.set(d,p);let m=f.get(u);m!==void 0&&(i.get(d)??0)<=m&&i.set(d,m+1);let h=i.get(d),g=new Map(f);g.set(u,Math.max(g.get(u)??-1,h));for(let v of o.get(d)??[]){let y=h+(n(v)===u?1:0);y>(i.get(v)??0)&&i.set(v,y);let b=s.get(v);for(let[x,L]of g)L>(b.get(x)??-1)&&b.set(x,L);let E=(a.get(v)??0)-1;a.set(v,E),E===0&&l.push(v)}}return i}function aJ(t){let n=t.direction==="LR",r=new Map(t.nodes.map(F=>[F.id,F])),o=t.nodes.map(F=>F.id),a=new Map(t.nodes.map(F=>[F.id,oJ(F.shape)])),i=F=>{let Q=a.get(F);return n?Q.w:Q.h},s=F=>{let Q=a.get(F);return n?Q.h:Q.w},l=t.edges.map((F,Q)=>({from:F.source,to:F.target,idx:Q})).filter(F=>F.from!==F.to&&r.has(F.from)&&r.has(F.to)),{dag:c}=wg(o,l),d=F=>r.get(F).lane,u=kO(o,c.map(F=>({from:F.from,to:F.to})),d),f=new Map;for(let F of o)f.set(F,u.get(F)??0);{let F=new Map(t.lanes.map((Z,lt)=>[Z.id,lt])),Q=c.map(Z=>({from:Z.from,to:Z.to})),ot=new Map;for(let Z=0;Z<o.length;Z++){let lt=!1;for(let nt of l)if(!((f.get(nt.to)??0)>=(f.get(nt.from)??0)))for(let J of[nt.from,nt.to]){let at=f.get(J),it=F.get(d(J));for(let vt of o)vt===nt.from||vt===nt.to||f.get(vt)===at&&((F.get(d(vt))??0)<=it||(ot.get(vt)??0)<=at&&(ot.set(vt,at+1),lt=!0))}if(!lt)break;f=kO(o,Q,d,ot)}}let p=Array.from(new Set(o.map(F=>f.get(F)))).sort((F,Q)=>F-Q),m=new Map(p.map((F,Q)=>[F,Q])),h=p.length,g=F=>m.get(f.get(F))??0,v=wO+vg,y=Array.from({length:h},()=>0);for(let F of o){let Q=g(F);y[Q]=Math.max(y[Q],i(F))}let b=[],E=[];{let F=v;for(let Q=0;Q<h;Q++){let ot=Math.max(y[Q],R1);E[Q]=ot,b[Q]=F+ot/2,F+=ot+yO}}let x=F=>b[F]+E[F]/2+yO/2,L=(h>0?b[h-1]+Math.max(y[h-1],R1)/2:v)+vg,S=(t.phases.length?EO:0)+vg,A=new Map;for(let F of t.nodes){let Q=`${F.lane}\0${g(F.id)}`;(A.get(Q)??A.set(Q,[]).get(Q)).push(F.id)}let C=(F,Q)=>{let ot=A.get(`${F}\0${Q}`)??[];return ot.length===0?0:ot.reduce((Z,lt)=>Z+s(lt),0)+A1*(ot.length-1)},M=new Map,w=new Map,k=new Map;{let F=S;for(let Q of t.lanes){let ot=0;for(let lt=0;lt<h;lt++)ot=Math.max(ot,C(Q.id,lt));let Z=Math.max(rJ,ot+2*NO);M.set(Q.id,F),w.set(Q.id,Z),k.set(Q.id,F+Z/2),F+=Z}}let N=(()=>{let F=S;for(let Q of t.lanes)F+=w.get(Q.id);return F})(),_=new Map,T=new Map;for(let[F,Q]of A){let ot=F.indexOf("\0"),Z=F.slice(0,ot),lt=k.get(Z)??S,nt=Q.reduce((at,it)=>at+s(it),0)+A1*(Q.length-1),J=lt-nt/2;for(let at of Q){let it=s(at);T.set(at,J+it/2),J+=it+A1,_.set(at,b[g(at)])}}let R=0;for(let F of l)(f.get(F.to)??0)<(f.get(F.from)??0)&&R++;let I=R>0?SO+vO*(R-1):0,H=N+I+vg,O=(F,Q)=>n?{x:F,y:Q}:{x:Q,y:F},D=t.nodes.map(F=>{let Q=a.get(F.id),ot=O(_.get(F.id),T.get(F.id));return{id:F.id,label:F.label,shape:F.shape,event:F.event,lane:F.lane,...F.phase!==void 0&&{phase:F.phase},...F.color!==void 0&&{color:F.color},tags:F.tags,x:ot.x,y:ot.y,width:Q.w,height:Q.h,lineNumber:F.lineNumber}}),W=16,z=new Array(t.edges.length).fill(0);{let F=new Map;t.edges.forEach((Q,ot)=>{let Z=r.get(Q.source),lt=r.get(Q.target);if(!Z||!lt||Z.id===lt.id)return;let nt=f.get(Z.id)??0;if((f.get(lt.id)??0)<=nt||Math.abs((T.get(Z.id)??0)-(T.get(lt.id)??0))<.5)return;let at=`${Q.target}\0${nt}`;(F.get(at)??F.set(at,[]).get(at)).push(ot)});for(let Q of F.values())Q.length<2||(Q.sort((ot,Z)=>(T.get(t.edges[ot].source)??0)-(T.get(t.edges[Z].source)??0)),Q.forEach((ot,Z)=>{z[ot]=(Z-(Q.length-1)/2)*W}))}let P=4,B=(F,Q,ot,Z,lt,nt)=>{let J=1/0;for(let Tt of o){if(Tt===F)continue;let At=i(Tt)/2+P;if(Math.abs(_.get(Tt)-Q)>=At)continue;let rt=s(Tt)/2,pt=T.get(Tt);pt+rt<=ot||pt-rt>=Z||(J=Math.min(J,pt-rt))}if(J===1/0)return{flow:Q};let at=lt-1,it=lt<h-1?lt:-1,vt=nt<Q?at:it;return vt<0&&(vt=nt<Q?it:at),vt<0?{flow:Q}:{flow:x(vt),jogCross:(ot+J)/2}},Y=0,V=[];t.edges.forEach((F,Q)=>{let ot=r.get(F.source),Z=r.get(F.target);if(!ot||!Z||ot.id===Z.id)return;let lt=_.get(ot.id),nt=T.get(ot.id),J=_.get(Z.id),at=T.get(Z.id),it=i(ot.id)/2,vt=i(Z.id)/2,Tt=s(ot.id)/2,At=s(Z.id)/2,rt=f.get(ot.id)??0,pt=f.get(Z.id)??0,ht,dt=!1;if(pt>rt){let ut=lt+it,yt=J-vt;if(Math.abs(nt-at)<.5)ht=[O(ut,nt),O(yt,at)];else{let kt=(ut+yt)/2+z[Q];ht=[O(ut,nt),O(kt,nt),O(kt,at),O(yt,at)]}}else if(pt===rt){let ut=at>=nt,yt=nt+(ut?Tt:-Tt),kt=at+(ut?-At:At);if(Math.abs(lt-J)<.5)ht=[O(lt,yt),O(J,kt)];else{let Ot=(yt+kt)/2;ht=[O(lt,yt),O(lt,Ot),O(J,Ot),O(J,kt)]}}else{dt=!0;let ut=N+SO+vO*Y;Y++;let yt=nt+Tt,kt=at+At,Ot=B(ot.id,lt,yt,ut,g(ot.id),J),Xt=B(Z.id,J,kt,ut,g(Z.id),lt);ht=[O(lt,yt),...Ot.jogCross!==void 0?[O(lt,Ot.jogCross),O(Ot.flow,Ot.jogCross)]:[],O(Ot.flow,ut),O(Xt.flow,ut),...Xt.jogCross!==void 0?[O(Xt.flow,Xt.jogCross),O(J,Xt.jogCross)]:[],O(J,kt)]}V.push({source:F.source,target:F.target,...F.label!==void 0&&{label:F.label},points:ht,back:dt,lineNumber:F.lineNumber})});let j=(F,Q,ot,Z)=>n?{x:F,y:ot,width:Q,height:Z}:{x:ot,y:F,width:Z,height:Q},K=t.lanes.map(F=>{let Q=j(0,L,M.get(F.id),w.get(F.id));return{id:F.id,label:F.label,...F.color!==void 0&&{color:F.color},...Q,headerSize:wO,lineNumber:F.lineNumber}}),$=new Map(t.phases.map((F,Q)=>[F.id,Q])),U=Array.from({length:h},()=>{});for(let F of t.nodes){if(F.phase===void 0)continue;let Q=$.get(F.phase);if(Q===void 0)continue;let ot=g(F.id),Z=U[ot];(Z===void 0||Q<Z)&&(U[ot]=Q)}let X=Array.from({length:h},()=>0),q=0;for(let F=0;F<h;F++){let Q=U[F];Q!==void 0&&Q>q&&(q=Q),X[F]=q}let et=(F,Q)=>(b[F]+b[Q])/2,tt=[];if(t.phases.length>0&&h>0){let F=0;for(let Q=1;Q<=h;Q++)if(Q===h||X[Q]!==X[F]){let ot=F,Z=Q-1,lt=t.phases[X[F]],nt=ot===0?0:et(ot-1,ot),J=Z===h-1?L:et(Z,Z+1);tt.push({id:lt.id,label:lt.label,...j(nt,J-nt,0,H),headerSize:EO,lineNumber:lt.lineNumber}),F=Q}}return{nodes:D,edges:V,lanes:K,phases:tt,width:n?L:H,height:n?H:L}}var vg,yO,R1,LO,bO,xO,A1,NO,rJ,wO,EO,SO,vO,TO=st(()=>{"use strict";v1();vg=30,yO=64,R1=124,LO=44,bO=56,xO=40,A1=16,NO=22,rJ=LO+2*NO,wO=116,EO=30,SO=28,vO=18});function Sd(t,e){let{idPrefix:n,width:r,height:o,baseFill:a,colors:i}=e,s=(l,c)=>{t.append("marker").attr("id",l).attr("viewBox",`0 0 ${r} ${o}`).attr("refX",r).attr("refY",o/2).attr("markerWidth",r).attr("markerHeight",o).attr("orient","auto").append("polygon").attr("points",`0,0 ${r},${o/2} 0,${o}`).attr("fill",c)};s(`${n}-arrow`,a);for(let l of i??[])s(`${n}-arrow-${l.replace("#","")}`,l)}var kg=st(()=>{"use strict"});var IO={};ye(IO,{renderSwimlaneForExport:()=>mJ});function fJ(t,e){if(t.length<3)return t.map((o,a)=>`${a?"L":"M"}${o.x} ${o.y}`).join(" ");let n=`M${t[0].x} ${t[0].y}`;for(let o=1;o<t.length-1;o++){let a=t[o-1],i=t[o],s=t[o+1],l=Math.hypot(i.x-a.x,i.y-a.y),c=Math.hypot(s.x-i.x,s.y-i.y);if(l<.01||c<.01){n+=` L${i.x} ${i.y}`;continue}let d=Math.min(e,l/2,c/2),u=i.x-(i.x-a.x)/l*d,f=i.y-(i.y-a.y)/l*d,p=i.x+(s.x-i.x)/c*d,m=i.y+(s.y-i.y)/c*d;n+=` L${u} ${f} Q${i.x} ${i.y} ${p} ${m}`}let r=t[t.length-1];return n+=` L${r.x} ${r.y}`,n}function pJ(t,e,n,r,o,a){let i=o-n,s=a-r,l=i*i+s*s,c=l>0?((t-n)*i+(e-r)*s)/l:0;return c=Math.max(0,Math.min(1,c)),Math.hypot(t-(n+c*i),e-(r+c*s))}function AO(t,e,n,r,o={}){let a=Math.min(n,r)/2,i=Math.min(o.tl??0,a),s=Math.min(o.tr??0,a),l=Math.min(o.br??0,a),c=Math.min(o.bl??0,a);return[`M${t+i},${e}`,`H${t+n-s}`,s?`A${s},${s} 0 0 1 ${t+n},${e+s}`:"",`V${e+r-l}`,l?`A${l},${l} 0 0 1 ${t+n-l},${e+r}`:"",`H${t+c}`,c?`A${c},${c} 0 0 1 ${t},${e+r-c}`:"",`V${e+i}`,i?`A${i},${i} 0 0 1 ${t+i},${e}`:"","Z"].join(" ")}function mJ(t,e,n,r,o,a={}){Rt(t).selectAll(":not([data-d3-tooltip])").remove();let i=e.title?40:0,s=a.exportDims?.width??n.width,l=(a.exportDims?.height??n.height)+0,c=Rt(t).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("width",s).attr("height",l).attr("viewBox",`0 0 ${s} ${l}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It),d=c.append("defs"),u=nr(r,o),f={error:r.colors.red,success:r.colors.green,terminate:r.text,neutral:r.border};Sd(d,{idPrefix:"sw",width:dJ,height:uJ,baseFill:r.textMuted,colors:[f.error,f.success]});let p=c.append("g").attr("transform",`translate(0, ${i})`);e.title&&c.append("text").attr("x",s/2).attr("y",30).attr("text-anchor","middle").attr("font-size",20).attr("font-weight","700").attr("fill",r.text).text(e.title);let m=new Map;e.lanes.forEach((M,w)=>{let k=M.color??Dn(gl[w%gl.length],r)??r.border;m.set(M.id,k)});let h=e.direction==="LR",g=e.options["solid-fill"]==="on",v=M=>Gt(M,u,9),y=M=>{for(let w of n.lanes){let k=h?w.y:w.x,N=k+(h?w.height:w.width);if(M>=k&&M<=N)return v(m.get(w.id)??r.border)}return u},b=p.append("g").attr("class","dgmo-swimlane-lanes");for(let M of n.lanes){let w=m.get(M.id)??r.border,k=h?M.x:M.x+Ng,N=h?M.y+Ng:M.y,_=h?M.width:M.width-Ng*2,T=h?M.height-Ng*2:M.height;b.append("path").attr("d",AO(k,N,_,T,{tl:ls,tr:ls,br:ls,bl:ls})).attr("fill",Gt(w,u,9)).attr("stroke",Gt(r.border,u,60)).attr("stroke-width",1).attr("data-line-number",String(M.lineNumber));let R=h?M.headerSize:_,G=h?T:M.headerSize;b.append("path").attr("d",AO(k,N,R,G,h?{tl:ls,bl:ls}:{tl:ls,tr:ls})).attr("fill",Gt(w,u,16)).attr("opacity",.6),b.append("text").attr("x",h?k+12:k+_/2).attr("y",h?N+T/2:N+M.headerSize/2).attr("text-anchor",h?"start":"middle").attr("dominant-baseline","middle").attr("font-size",iJ).attr("font-weight","700").attr("fill",Gt(w,r.text,55)).text(M.label)}let E=p.append("g").attr("class","dgmo-swimlane-phases");n.phases.forEach((M,w)=>{w%2===1&&E.append("rect").attr("x",M.x).attr("y",M.y).attr("width",M.width).attr("height",M.height).attr("rx",ls).attr("fill",r.text).attr("opacity",.05).attr("pointer-events","none"),E.append("text").attr("x",h?M.x+M.width/2:M.headerSize/2).attr("y",h?M.headerSize/2:M.y+M.height/2).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-size",sJ).attr("font-weight","700").attr("letter-spacing","0.06em").attr("fill",r.textMuted).attr("data-line-number",String(M.lineNumber)).text(M.label)});let x=a.activeTagGroup??null,L=M=>{if(x){let k=qt(x);if(M.tags[k]){let N=ar(M.tags,[...e.tagGroups],x);if(N&&N!=="#999999")return{fill:g?N:Gt(N,u,22),stroke:N}}}if(M.shape==="terminal")return M.event==="error"?{fill:g?f.error:Gt(f.error,u,22),stroke:f.error}:M.event==="success"?{fill:g?f.success:Gt(f.success,u,22),stroke:f.success}:M.event==="terminate"?{fill:Gt(r.text,u,30),stroke:r.text}:{fill:r.bg,stroke:r.textMuted};if(M.shape==="exclusive"||M.shape==="parallel")return{fill:Gt(r.surface,u,80),stroke:r.textMuted};let w=m.get(M.lane)??r.border;return{fill:g?w:Gt(w,u,20),stroke:Gt(w,r.text,40)}},S=new Map(n.nodes.map(M=>[M.id,M])),A=p.append("g").attr("class","dgmo-swimlane-edges");for(let M of n.edges){let w=S.get(M.target),k=r.textMuted,N="sw-arrow";w?.shape==="terminal"&&w.event==="error"?(k=f.error,N=`sw-arrow-${f.error.replace("#","")}`):w?.shape==="terminal"&&w.event==="success"&&(k=f.success,N=`sw-arrow-${f.success.replace("#","")}`);let _=fJ(M.points,cJ);if(A.append("path").attr("d",_).attr("fill","none").attr("stroke",k).attr("stroke-width",lJ).attr("stroke-dasharray",M.back?"5 4":null).attr("marker-end",`url(#${N})`).attr("data-line-number",String(M.lineNumber)),M.label){let T=[],R=0;for(let q=0;q<M.points.length-1;q++){let et=M.points[q],tt=M.points[q+1],F=Math.abs(tt.x-et.x)+Math.abs(tt.y-et.y);T.push(F),R+=F}let G=R/2,I=0;for(let q=0;q<T.length;q++){if(G<=T[q]||q===T.length-1){I=q;break}G-=T[q]}let H=M.points[I],O=M.points[I+1]??H,D=T[I]>0?G/T[I]:.5,W={x:H.x+(O.x-H.x)*D,y:H.y+(O.y-H.y)*D},z=Math.abs(O.x-H.x)>=Math.abs(O.y-H.y),P=7,B=(q,et)=>{let tt=1/0;for(let F of n.edges)if(F!==M)for(let Q=0;Q<F.points.length-1;Q++){let ot=pJ(q,et,F.points[Q].x,F.points[Q].y,F.points[Q+1].x,F.points[Q+1].y);ot<tt&&(tt=ot)}return tt},Y=M.label.length*CO*.6,V=(q,et,tt)=>{let F=tt===0?[q-Y/2,q,q+Y/2]:[q,q+tt*Y/2,q+tt*Y];return Math.min(...F.map(Q=>B(Q,et)))},j=10,K,$,U,X;if(z){let q=V(W.x,W.y-P,0),et=V(W.x,W.y+P,0),tt=q<j&&et>q;K=W.x,$=W.y+(tt?P:-P),U="middle",X=tt?"hanging":"auto"}else{let q=V(W.x+P,W.y,1),et=V(W.x-P,W.y,-1),tt=q<j&&et>q;K=W.x+(tt?-P:P),$=W.y,U=tt?"end":"start",X="middle"}A.append("text").attr("x",K).attr("y",$).attr("text-anchor",U).attr("dominant-baseline",X).attr("font-size",CO).attr("fill",k===r.textMuted?r.textMuted:k).attr("stroke",y($)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(M.label)}}let C=p.append("g").attr("class","dgmo-swimlane-nodes");for(let M of n.nodes){let{fill:w,stroke:k}=L(M),N=C.append("g").attr("data-line-number",String(M.lineNumber)).attr("data-lane",M.lane),_=M.x,T=M.y;if(M.shape==="exclusive"||M.shape==="parallel"){let R=M.width/2;if(N.append("polygon").attr("points",`${_},${T-R} ${_+R},${T} ${_},${T+R} ${_-R},${T}`).attr("fill",w).attr("stroke",k).attr("stroke-width",I1),M.shape==="parallel"){let G=r.textMuted;N.append("line").attr("x1",_).attr("y1",T-R/2.4).attr("x2",_).attr("y2",T+R/2.4).attr("stroke",G).attr("stroke-width",2.4),N.append("line").attr("x1",_-R/2.4).attr("y1",T).attr("x2",_+R/2.4).attr("y2",T).attr("stroke",G).attr("stroke-width",2.4),N.append("text").attr("x",_).attr("y",T+R+12).attr("text-anchor","middle").attr("font-size",Lg-1).attr("fill",r.textMuted).attr("stroke",y(T+R+12)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(M.label)}else RO(N,M.label,_,T,r.text,Lg-1,!0,y(T))}else if(M.shape==="terminal"){let R=M.width/2;N.append("circle").attr("cx",_).attr("cy",T).attr("r",R).attr("fill",w).attr("stroke",k).attr("stroke-width",M.event==="none"?I1:2.4),M.event==="success"&&N.append("circle").attr("cx",_).attr("cy",T).attr("r",R-4).attr("fill","none").attr("stroke",k).attr("stroke-width",1);let G=!1;for(let H of n.edges){let O=H.target===M.id?H.points[H.points.length-1]:H.source===M.id?H.points[0]:void 0;O&&O.y>T+R*.5&&(G=!0)}let I=G?T-R-6:T+R+12;N.append("text").attr("x",_).attr("y",I).attr("text-anchor","middle").attr("font-size",Lg-1).attr("fill",r.text).attr("stroke",y(I)).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke").text(M.label)}else{N.append("rect").attr("x",_-M.width/2).attr("y",T-M.height/2).attr("width",M.width).attr("height",M.height).attr("rx",_O).attr("fill",w).attr("stroke",k).attr("stroke-width",I1),M.shape==="subprocess"&&N.append("rect").attr("x",_-M.width/2+3).attr("y",T-M.height/2+3).attr("width",M.width-6).attr("height",M.height-6).attr("rx",_O-2).attr("fill","none").attr("stroke",k).attr("stroke-width",1);let R=ve(w,r.textOnFillLight,r.textOnFillDark);RO(N,M.label,_,T,R,Lg)}}}function hJ(t,e){let n=[],r="";for(let o of t)r===""?r=o:r.length+1+o.length<=e?r+=" "+o:(n.push(r),r=o);return r&&n.push(r),n}function RO(t,e,n,r,o,a,i=!1,s){let l=e.split(/\s+/),c;if(i)c=l.length===1?[e]:hJ(l,7);else if(e.length<=14||l.length===1)c=[e];else{let f=Math.ceil(l.length/2);c=[l.slice(0,f).join(" "),l.slice(f).join(" ")]}let d=a*1.2,u=r-(c.length-1)*d/2;c.forEach((f,p)=>{let m=t.append("text").attr("x",n).attr("y",u+p*d).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-size",a).attr("fill",o);s&&m.attr("stroke",s).attr("stroke-width",3.5).attr("stroke-linejoin","round").attr("paint-order","stroke"),m.text(f)})}var Lg,iJ,sJ,CO,_O,I1,lJ,cJ,dJ,uJ,ls,Ng,PO=st(()=>{"use strict";Xn();on();kg();tn();xr();Ke();Lg=12,iJ=12,sJ=12,CO=11,_O=8,I1=1.5,lJ=1.6,cJ=11,dJ=9,uJ=6.4,ls=10,Ng=2});function yJ(t){let e=[],n=t.split(/(\s+)/);for(let r of n){if(/^\s+$/.test(r))continue;let o=r.split(/(?<=-)(?=\S)/);e.push(...o)}return e}function DO(t,e,n,r){let o=e-D1,a=[],i="";for(let s of t){let l=i&&!i.endsWith("-")?" ":"",c=i+l+s;if(_t(c,n)<=o)i=c;else if(!i)i=s;else{if(a.push(i),a.length>=r)return null;i=s}}return i&&a.push(i),a.length>r?null:a}function OO(t,e,n){let r=e-D1,o=[...t],a=o[o.length-1];return _t(a,n)>r&&(o[o.length-1]=tr(a,n,r)),o}function GO(t,e,n,r,o=$O){if(!t)return{lines:[""],fontSize:n};let a=yJ(t);for(let c=n;c>=r;c--){let d=DO(a,e,c,o);if(d)return{lines:OO(d,e,c),fontSize:c}}let i=DO(a,e,r,999)??[t],s=i.slice(0,o),l=OO(s,e,r);if(i.length>o){let c=l[l.length-1];if(!c.endsWith("\u2026")){let d=e-D1;_t(c+"\u2026",r)>d?l[l.length-1]=tr(c,r,d):l[l.length-1]=c+"\u2026"}}return{lines:l,fontSize:r}}function wJ(t){return Math.max(HO,bJ-t*xJ)}function Mg(t,e,n,r,o){let a=wJ(n),i=GO(t,r,a,HO,$O),s=[],l=P1;if(!o&&e&&e.length>0){let c=gJ;for(let d of e){if(c<=0)break;let u=ta(d),f=GO(u,r,P1,P1,c);s.push(...f.lines),c-=f.lines.length,l=f.fontSize}}return{labelLines:i.lines,labelFontSize:i.fontSize,descLines:s,descFontSize:l}}var D1,$O,gJ,bJ,HO,xJ,P1,O1=st(()=>{"use strict";Ka();en();D1=16,$O=3,gJ=2;bJ=17,HO=9,xJ=3,P1=10});var BO={};ye(BO,{layoutMindmap:()=>Cg});function Cg(t,e,n){let r=t.roots;if(r.length===0)return{nodes:[],edges:[],width:0,height:0};let o=n?.hiddenCounts??new Map,a=n?.activeTagGroup??null,i=n?.hideDescriptions??!1,s=n?.ctx??Ee.identity(),l={rootWidth:s.structural(EJ),depth1Width:s.structural(SJ),leafWidth:s.structural(vJ),hGap:s.aesthetic(TJ),vGap:s.aesthetic(CJ),margin:s.aesthetic(_J),multiRootGap:s.aesthetic(AJ)};$J(r);let c=[],d=f=>{for(let p of f)c.push(p),d(p.children)};d(r),wa(c,t.tagGroups);let u=t.tagGroups;return r.length===1?WO(r[0],o,i,u,a,l):RJ(r,t,o,i,u,a,l)}function WO(t,e,n,r=[],o=null,a){let i=[],s=W1(0,a),l=B1(t,n,a),c=t.children,{right:d,left:u}=DJ(c,n,a),f=Tg(d,1,n,a),p=Tg(u,1,n,a),m=Math.max(f,p,l),h=0,g=m/2-l/2;i.push({node:t,x:h,y:g,width:s,height:l,depth:0,direction:"right",subtreeHeight:m});let v=g+l/2,y=h+s+a.hGap;G1(d,y,v,1,"right",n,i,a);let b=h-a.hGap;return G1(u,b,v,1,"left",n,i,a),PJ(i,e,n,t,r,o,a)}function RJ(t,e,n,r,o,a,i){let s=[];for(let p of t)s.push(WO(p,n,r,o,a,i));let l=s.reduce((p,m)=>p+m.width,0)+i.multiRootGap*(s.length-1),c=Math.max(...s.map(p=>p.height)),d=[],u=[],f=0;for(let p of s){let m=(c-p.height)/2;for(let h of p.nodes)d.push({...h,x:h.x+f,y:h.y+m});for(let h of p.edges)u.push({sourceId:h.sourceId,targetId:h.targetId,path:OJ(h.path,f,m)});f+=p.width+i.multiRootGap}return{nodes:d,edges:u,width:l,height:c}}function G1(t,e,n,r,o,a,i,s){if(t.length===0)return;let l=Tg(t,r,a,s),c=n-l/2;for(let d of t){let u=W1(r,s),f=B1(d,a,s),p=H1(d,r,a,s),m=c+p/2-f/2,h=o==="right"?e:e-u;if(i.push({node:d,x:h,y:m,width:u,height:f,depth:r,direction:o,subtreeHeight:p}),d.children.length>0){let g=m+f/2,v=o==="right"?h+u+s.hGap:h-s.hGap;G1(d.children,v,g,r+1,o,a,i,s)}c+=p+s.vGap}}function Tg(t,e,n,r){if(t.length===0)return 0;let o=0;for(let a of t)o+=H1(a,e,n,r);return o+=r.vGap*(t.length-1),o}function H1(t,e,n,r){let o=B1(t,n,r);if(t.children.length===0)return o;let a=Tg(t.children,e+1,n,r);return Math.max(o,a)}function IJ(t,e,n){return t.color?t.color:ar(t.metadata,[...e],n)}function PJ(t,e,n,r,o=[],a=null,i){let s=1/0,l=1/0,c=-1/0,d=-1/0;for(let E of t)s=Math.min(s,E.x),l=Math.min(l,E.y),c=Math.max(c,E.x+E.width),d=Math.max(d,E.y+E.height);let u=-s+i.margin,f=-l+i.margin,p=c-s+i.margin*2,m=d-l+i.margin*2,h=new Map;for(let E of t)h.set(E.node.id,E);let g=[],v=[];for(let E of t){let x=IJ(E.node,o,a),L=e.get(E.node.id);g.push({id:E.node.id,label:E.node.label,...E.node.description!==void 0&&{description:[...E.node.description]},metadata:{...E.node.metadata},lineNumber:E.node.lineNumber,...x!==void 0&&{color:x},x:E.x+u,y:E.y+f,width:E.width,height:E.height,depth:E.depth,angle:0,radius:0,...L!==void 0&&{hiddenCount:L},hasChildren:e.has(E.node.id)||E.node.children.length>0})}let y=new Map;for(let E of t)if(E.node.parentId){let x=y.get(E.node.parentId)??[];x.push(E),y.set(E.node.parentId,x)}let b=[];for(let[E,x]of y){let L=x.filter(A=>A.direction==="right"),S=x.filter(A=>A.direction==="left");L.length>0&&b.push([E,L]),S.length>0&&b.push([E,S])}for(let[E,x]of b){let L=h.get(E),S=L.x+u,A=L.y+f,C=x[0].direction==="left",M=C?S:S+L.width,w=A+L.height/2,k=x[0],N=C?k.x+u+k.width:k.x+u,_=(M+N)/2;if(x.length===1){let T=x[0],R=C?T.x+u+T.width:T.x+u,G=T.y+f+T.height/2;v.push({sourceId:E,targetId:T.node.id,path:`M ${M} ${w} L ${_} ${w} L ${_} ${G} L ${R} ${G}`})}else{v.push({sourceId:E,targetId:E,path:`M ${M} ${w} L ${_} ${w}`});let T=x.map(I=>I.y+f+I.height/2),R=Math.min(...T),G=Math.max(...T);v.push({sourceId:E,targetId:E,path:`M ${_} ${R} L ${_} ${G}`});for(let I=0;I<x.length;I++){let H=x[I],O=C?H.x+u+H.width:H.x+u,D=T[I];v.push({sourceId:E,targetId:H.node.id,path:`M ${_} ${D} L ${O} ${D}`})}}}return{nodes:g,edges:v,width:p,height:m}}function DJ(t,e,n){if(t.length<=1)return{right:[...t],left:[]};if(t.length===2)return{right:[t[0]],left:[t[1]]};let r=t.map((l,c)=>({index:c,node:l,height:H1(l,1,e,n)})),o=[],a=[],i=0,s=0;for(let l of r)i<=s?(o.push(l.node),i+=l.height):(a.push(l.node),s+=l.height);return{right:o,left:a}}function OJ(t,e,n){return e===0&&n===0?t:t.replace(/([ML])\s*([\d.e+-]+)\s+([\d.e+-]+)/g,(r,o,a,i)=>`${o} ${parseFloat(a)+e} ${parseFloat(i)+n}`)}function W1(t,e){return t===0?e.rootWidth:t===1?e.depth1Width:e.leafWidth}function B1(t,e,n){let r=GJ(t),o=W1(r,n),a=Mg(t.label,t.description?[...t.description]:void 0,r,o,e),i=a.labelLines.length,l=(i<=1?kJ:LJ*i)+MJ;return a.descLines.length>0&&(l+=NJ*a.descLines.length+4),l}function GJ(t){return $1.get(t.id)??0}function $J(t){$1.clear();let e=(n,r)=>{for(let o of n)$1.set(o.id,r),e(o.children,r+1)};e(t,0)}var EJ,SJ,vJ,kJ,LJ,NJ,MJ,TJ,CJ,_J,AJ,$1,F1=st(()=>{"use strict";Ke();O1();fr();EJ=180,SJ=150,vJ=120,kJ=28,LJ=18,NJ=14,MJ=10,TJ=40,CJ=12,_J=40,AJ=60;$1=new Map});var YO={};ye(YO,{collapseMindmapTree:()=>WJ});function FO(t){return{id:t.id,label:t.label,...t.description!==void 0&&{description:[...t.description]},metadata:{...t.metadata},children:t.children.map(FO),parentId:t.parentId,lineNumber:t.lineNumber,...t.color!==void 0&&{color:t.color},...t.collapsed!==void 0&&{collapsed:t.collapsed}}}function WJ(t,e){return e.size===0?{roots:[...t],hiddenCounts:new Map}:sd(t,e,HJ)}var HJ,zO=st(()=>{"use strict";yf();HJ={getId:t=>t.id,getChildren:t=>t.children,clone:FO,setChildren:(t,e)=>{t.children=e},countsAsHidden:()=>!0}});var XO={};ye(XO,{renderMindmap:()=>UO,renderMindmapForExport:()=>jJ});function zJ(t,e,n,r){let o=n??t.primary;return ie(t,o,e,{...r!==void 0&&{solid:r}})}function VJ(t,e){return e??t.primary}function XJ(t,e){let n=UJ[t];return n&&n in e.colors?e.colors[n]:e.colors.gray}function UO(t,e,n,r,o,a,i,s,l,c,d){let u=!!i,f=i?.width??(t.getBoundingClientRect().width||800),p=i?.height??(t.getBoundingClientRect().height||600);Rt(t).selectAll("*").remove();let m=Rt(t).append("svg").attr("width",f).attr("height",p).attr("viewBox",`0 0 ${f} ${p}`).attr("preserveAspectRatio","xMidYMin meet").style("font-family",It),h=d?.controlsHost==="app",g=!!d?.onToggleColorByDepth||!!d?.onToggleDescriptions,v=e.tagGroups.length>0||g&&!h,y=!u&&v,b=y?Tr({groups:e.tagGroups,position:{placement:"top-center",titleRelation:"below-title"},mode:"preview"},f)+Wn:0,E=!!e.title&&e.options["no-title"]!=="on",x=!u&&E,L=x?VO:0,S=f,A=p-vd*2-b-L,C=u?Ee.identity():Ee.fromBox(S,n.width,A,n.height),M=n;if(C.factor<1){let G=new Map;for(let H of n.nodes)H.hiddenCount!=null&&H.hiddenCount>0&&G.set(H.id,H.hiddenCount);let I=H=>Cg(e,r,{interactive:!u,...G.size>0&&{hiddenCounts:G},activeTagGroup:c??null,...l!==void 0&&{hideDescriptions:l},ctx:H});M=I(C);for(let H=0;H<3&&!C.isBelowFloor;H++){let O=Math.min(S/M.width,A/M.height);if(O>=.999)break;C=Ee.fromFactor(C.factor*O),M=I(C)}}let w=u?1:Math.min(1,M.width>0?S/M.width:1,M.height>0?A/M.height:1),k=M.width*w,N=M.height*w,_=Math.max(0,(S-k)/2),T=vd+b+L+Math.max(0,(A-N)/2),R=m.append("g").attr("transform",`translate(${_}, ${T})${w<1?` scale(${w})`:""}`);if(C.isBelowFloor&&m.attr("width","100%"),E){let G=x?m:R,I=x?f/2:M.width/2,H=x?vd+20:20,O=G.append("text").attr("x",I).attr("y",H).attr("text-anchor","middle").attr("font-size",20).attr("font-weight","700").attr("fill",r.text).attr("class","chart-title").text(e.title);e.titleLineNumber&&O.attr("data-line-number",e.titleLineNumber),a&&e.titleLineNumber&&O.style("cursor","pointer").on("click",()=>a(e.titleLineNumber))}if(y){let G=m.append("g").attr("class","mindmap-legend-fixed").attr("transform",`translate(0, ${vd+L})`),I=new Map;for(let P of M.nodes)for(let B of e.tagGroups){let Y=B.name.toLowerCase(),V=P.metadata[Y];V&&(I.has(Y)||I.set(Y,new Set),I.get(Y).add(V.toLowerCase()))}let H=[];d?.onToggleDescriptions&&H.push({id:"descriptions",type:"toggle",label:"Descriptions",active:!l,onToggle:P=>d.onToggleDescriptions(P)}),d?.onToggleColorByDepth&&H.push({id:"depth-colors",type:"toggle",label:"Depth Colors",active:d.colorByDepth??!1,onToggle:d.onToggleColorByDepth});let O=H.length>0?{toggles:H}:void 0,D={groups:e.tagGroups.map(P=>{let B=I.get(P.name.toLowerCase());return{name:P.name,...P.alias!==void 0&&{alias:P.alias},entries:P.entries.filter(Y=>B?.has(Y.value.toLowerCase())).map(Y=>({value:Y.value,color:Y.color}))}}),position:{placement:"top-center",titleRelation:"below-title"},mode:d?.exportMode?"export":"preview",...O!==void 0&&{controlsGroup:O},...d?.controlsHost!==void 0&&{controlsHost:d.controlsHost}},W={text:r.text,textMuted:r.textMuted,bg:r.bg,surface:r.surface,primary:r.primary},z={...d?.onToggleControlsExpand!==void 0&&{onControlsExpand:d.onToggleControlsExpand},onControlsToggle:(P,B)=>{P==="depth-colors"&&d?.onToggleColorByDepth&&d.onToggleColorByDepth(B),P==="descriptions"&&d?.onToggleDescriptions&&d.onToggleDescriptions(B)}};fn(G,{...D,palette:W,isDark:o,width:f,activeGroup:d?.colorByDepth?null:c!==void 0?c:e.options["active-tag"]??null,hiddenAttributes:new Set,...d?.controlsExpanded!==void 0&&{controlsExpanded:d.controlsExpanded},callbacks:z})}for(let G of M.edges)R.append("path").attr("class","mindmap-edge").attr("d",G.path).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5).attr("stroke-opacity",.5);for(let G of M.nodes){let I=G.radius===0&&M.nodes.indexOf(G)===0,H=I?YJ:1.5,O=d?.colorByDepth?XJ(G.depth,r):G.color,D=zJ(r,o,O,e.options["solid-fill"]==="on"),W=VJ(r,O),z=ve(D,r.textOnFillLight,r.textOnFillDark),P=R.append("g").attr("class","mindmap-node").attr("data-line-number",G.lineNumber);if(c){let F=qt(c),Q=G.metadata[F];Q&&P.attr(`data-tag-${F}`,Q.toLowerCase())}G.hasChildren&&P.attr("data-node-toggle",G.id).attr("tabindex","0").attr("role","button").attr("aria-expanded",G.hiddenCount!=null&&G.hiddenCount>0?"false":"true").attr("aria-label",G.label),P.append("rect").attr("x",G.x).attr("y",G.y).attr("width",G.width).attr("height",G.height).attr("rx",_g).attr("ry",_g).attr("fill",D).attr("stroke",W).attr("stroke-width",H);let B=G.hiddenCount!=null&&G.hiddenCount>0,Y=!l&&!!G.description&&!B,V=Mg(G.label,G.description,G.depth,G.width,l||B),{labelLines:j,labelFontSize:K,descLines:$,descFontSize:U}=V,X=j.length,q=X<=1?BJ:Y1*X,et=Y?q:G.height,tt=G.x+G.width/2;if(X<=1){let F=G.y+et/2+K*.35;P.append("text").attr("x",tt).attr("y",F).attr("text-anchor","middle").attr("font-size",K).attr("font-weight",I?"bold":"normal").attr("fill",z).text(j[0])}else{let F=Y1*(X-1),Q=G.y+et/2-F/2+K*.35,ot=P.append("text").attr("x",tt).attr("text-anchor","middle").attr("font-size",K).attr("font-weight",I?"bold":"normal").attr("fill",z);for(let Z=0;Z<j.length;Z++)ot.append("tspan").attr("x",tt).attr("y",Q+Z*Y1).text(j[Z])}if((j.length>1||j[0]!==G.label)&&P.append("title").text(G.label),Y&&$.length>0){let F=G.y+q;if(P.append("line").attr("x1",G.x).attr("y1",F).attr("x2",G.x+G.width).attr("y2",F).attr("stroke",W).attr("stroke-opacity",.3).attr("stroke-width",1),$.length<=1){let Q=F+4+U,ot=ta($[0]),Z=P.append("text").attr("x",tt).attr("y",Q).attr("text-anchor","middle").attr("font-size",U).attr("fill",z);gn(Z,ot,r,U)}else{let Q=F+4+U;for(let ot=0;ot<$.length;ot++){let Z=ta($[ot]),lt=P.append("text").attr("x",tt).attr("y",Q+ot*FJ).attr("text-anchor","middle").attr("font-size",U).attr("fill",z);gn(lt,Z,r,U)}}}if(!u&&G.hiddenCount!=null&&G.hiddenCount>0){let F=`collapse-clip-${G.id}`;R.append("defs").append("clipPath").attr("id",F).append("rect").attr("x",G.x).attr("y",G.y).attr("width",G.width).attr("height",G.height).attr("rx",_g).attr("ry",_g),P.append("rect").attr("class","collapse-bar").attr("x",G.x).attr("y",G.y+G.height-6).attr("width",G.width).attr("height",6).attr("fill",W).attr("clip-path",`url(#${F})`)}a&&P.style("cursor","pointer").on("click",F=>{G.hasChildren&&s?(F.stopPropagation(),s(G.id)):a(G.lineNumber)}),u||P.on("mouseenter",function(){Rt(this).attr("opacity",.7)}).on("mouseleave",function(){Rt(this).attr("opacity",1)})}}function jJ(t,e,n){let r=ed(t,n);if(r.error)return"";let o=e==="dark",a=r.options["no-descriptions"]==="true",i=Cg(r,n,{interactive:!1,hideDescriptions:a}),s=r.title&&r.options["no-title"]!=="on"?VO:0,l=i.width+vd*2,c=i.height+vd*2+s;return ld(l,c,d=>(UO(d,r,i,n,o,void 0,{width:l,height:c},void 0,a),cd(d,e)))}var vd,VO,BJ,Y1,FJ,_g,YJ,UJ,jO=st(()=>{"use strict";Ke();Xn();on();Qh();tn();Sh();F1();O1();_o();Ka();Br();Mr();To();fr();vd=20,VO=30,BJ=28,Y1=18,FJ=14,_g=6,YJ=2.5;UJ=["red","orange","yellow","green","blue","purple","teal","cyan"]});var JO={};ye(JO,{layoutWireframe:()=>itt});function itt(t,e,n,r=!0){z1=r?QO:JJ;let o=t.formFactor==="mobile"?KJ:qJ,a=n??o,i=t.title&&t.options["no-title"]!=="on"?ntt:0,s=a-KO*2,l=stt(t.roots,s,t.formFactor),c=0;for(let p of l)c=Math.max(c,p.y+p.height);let d=[],u=c+24;for(let p of t.modals){let m=Math.min(s*.7,600),h=(s-m)/2,g=kd(p,h,u,m);d.push(g),u+=g.height+24}let f=(d.length>0?d[d.length-1].y+d[d.length-1].height:c)+KO*2+i;return{width:a,height:f,titleHeight:i,nodes:l,modalNodes:d}}function stt(t,e,n){let r=[],o=0,a=[],i=[];for(let s of t){let l=s.label.toLowerCase().split(/\s+/)[0];ZO.has(l)||n==="mobile"?(i.length>0&&(a.push(i),i=[]),a.push([s])):i.push(s)}i.length>0&&a.push(i);for(let s of a){if(s.length===1&&n!=="mobile"){let l=s[0],c=l.label.toLowerCase().split(/\s+/)[0];if(ZO.has(c)){let d=kd(l,0,o,e);c==="header"||c==="top"?d.height=Math.max(d.height,ott):d.height=Math.max(d.height,att),r.push(d),o+=d.height+16;continue}}if(n==="mobile"||s.length===1)for(let l of s){let c=kd(l,0,o,e);r.push(c),o+=c.height+16}else{let l=ltt(s,e),c=0,d=0,u=[];for(let f=0;f<s.length;f++){let p=l[f],m=kd(s[f],c,o,p);u.push(m),d=Math.max(d,m.height),c+=p+12}for(let f of u)f.height=d;r.push(...u),o+=d+16}}return r}function ltt(t,e){let r=(t.length-1)*12,o=e-r,a=new Array(t.length).fill(0),i=0,s=0;for(let l=0;l<t.length;l++){let c=t[l].label.toLowerCase().split(/\s+/)[0],d=rtt[c];d!==void 0&&d>0?(a[l]=o*d,i+=a[l]):s++}if(s>0){let c=Math.max(0,o-i)/s;for(let d=0;d<a.length;d++)a[d]===0&&(a[d]=Math.max(40,c))}for(let l=0;l<a.length;l++)a[l]=Math.max(40,a[l]);return a}function kd(t,e,n,r){let o={id:t.id,x:e,y:n,width:r,height:0,element:t,children:[]},a=t.type==="nav"||t.type==="tabs";if(!t.isContainer||t.children.length===0||a)return o.height=dtt(t),o;let i=t.metadata._inlineRow==="true"||t.metadata._labelField==="true",s=i?0:z1,l=i?0:ttt,c=i?0:ett,d=r-c*2,u=c;if(t.orientation==="horizontal"){let f=ctt(t.children,d),p=u,m=0,h=[];for(let g=0;g<t.children.length;g++){let v=t.children[g],y=f[g],b=kd(v,p,s,y);h.push(b),o.children.push(b),m=Math.max(m,b.height),p+=y+8}for(let g of h)g.height=m;o.height=s+m+l}else{let f=s,p=ftt(t.children);p>0&&(o.fieldAlignX=p);for(let m of t.children){let h=kd(m,u,f,d);o.children.push(h),f+=h.height+utt(m)}o.height=f+l}return t.states.includes("collapsed")&&(o.height=z1,o.children=[]),o}function ctt(t,e){let r=(t.length-1)*8,o=Math.max(40,(e-r)/t.length);return t.map(()=>o)}function dtt(t){return t.type==="heading"?t.headingLevel===2?Ag.subheading??36:Ag.heading??48:t.type==="textInput"&&t.fieldVariant==="textarea"?80:t.type==="table"?32+(t.tableData?.length||t.tableRows||0)*28+8:t.type==="image"?t.imageHint==="round"||t.imageHint==="wide"?80:Ag.image??120:t.metadata._labelField==="true"?36:Ag[t.type]??24}function utt(t){return t.type==="heading"&&t.headingLevel===2?qO.subheading??12:qO[t.type]??8}function ftt(t){let e=0,n=0;for(let r of t)if(r.metadata._labelField==="true"&&r.children.length>=2){let o=r.children[0],a=_t(o.label,QJ);e=Math.max(e,a),n++}return n<2?0:e+ZJ}var qJ,KJ,ZJ,QJ,Ag,qO,QO,JJ,ttt,z1,ett,KO,ntt,rtt,ZO,ott,att,tG=st(()=>{"use strict";en();qJ=1200,KJ=375,ZJ=16,QJ=13,Ag={textInput:36,button:40,dropdown:36,checkbox:24,radio:24,heading:48,subheading:36,divider:24,text:22,listItem:24,image:120,progress:28,chart:160,alert:40,nav:44,tabs:44},qO={heading:16,subheading:12,divider:12,textInput:8,dropdown:8,checkbox:8,radio:8,button:8,text:12,listItem:4,group:16,image:12,progress:12,chart:16,alert:12,nav:12,tabs:12,table:16},QO=32,JJ=10,ttt=12,z1=QO,ett=12,KO=20,ntt=40,rtt={sidebar:.25,side:.25,left:.25,right:.25,main:0,content:0,center:0},ZO=new Set(["header","top","footer","bottom"]),ott=60,att=40});var iG={};ye(iG,{renderWireframe:()=>htt});function mtt(t,e){let n=ptt[t];return n?n(e):null}function oG(t,e){for(let n of t.states){let r=mtt(n,e);if(r)return r}return null}function htt(t,e,n,r,o,a,i,s,l){let c=l??{},d=c.exportDims??i,u=c.theme??s;Rt(t).selectAll(":not([data-d3-tooltip])").remove();let f=!!d,p=d?.width??t.clientWidth,m=d?.height??t.clientHeight,h=f?Ee.identity():Ee.from(p,n.width),g=Rt(t).append("svg").attr("viewBox",`0 0 ${n.width} ${n.height}`).attr("preserveAspectRatio","xMidYMin meet").attr("xmlns","http://www.w3.org/2000/svg").style("font-family",It);f?g.attr("width",p).attr("height",m):g.attr("width","100%").attr("height","auto").style("display","block");let v={palette:r,isTransparent:u==="transparent",isDark:o,showGroupLabels:c.showGroupLabels??!0,solid:e.options["solid-fill"]==="on"};v.isTransparent||g.append("rect").attr("width",n.width).attr("height",n.height).attr("fill",r.bg).attr("rx",8);let y=g.append("g").attr("transform","translate(20, 20)"),b=0,E=!!e.title&&e.options["no-title"]!=="on",x=h.text(20);f&&E&&(y.append("text").attr("x",0).attr("y",x).attr("fill",r.text).attr("font-size",x).attr("font-weight","700").text(e.title),b=n.titleHeight);let L=y.append("g").attr("transform",`translate(0, ${b})`);for(let S of n.nodes)Mf(L,S,v,0);if(n.modalNodes.length>0){let S=L.append("g").attr("class","wireframe-modals");for(let A of n.modalNodes)Ptt(S,A,v)}}function Mf(t,e,n,r){let o=e.element,a=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`).attr("data-line-number",o.lineNumber);if(o.states.includes("disabled")&&a.attr("opacity",.5),o.isSkeleton&&o.type!=="skeleton"){aG(a,e,n);return}switch(o.type){case"group":gtt(a,e,n,r);break;case"textInput":ytt(a,e,n);break;case"button":btt(a,e,n);break;case"dropdown":xtt(a,e,n);break;case"checkbox":wtt(a,e,n);break;case"radio":Ett(a,e,n);break;case"heading":Stt(a,e,n);break;case"divider":vtt(a,e,n);break;case"text":nG(a,e,n);break;case"listItem":ktt(a,e,n);break;case"nav":Ltt(a,e,n);break;case"tabs":Ntt(a,e,n);break;case"table":Mtt(a,e,n);break;case"image":Ctt(a,e,n);break;case"skeleton":_tt(a,e,n);break;case"alert":Att(a,e,n);break;case"progress":Rtt(a,e,n);break;case"chart":Itt(a,e,n);break;default:nG(a,e,n)}}function gtt(t,e,n,r){let{palette:o,isTransparent:a}=n,i=e.element;if(i.metadata._inlineRow==="true"||i.metadata._labelField==="true"){for(let d of e.children)Mf(t,d,n,r);return}let s=[12,7,4,2],l=s[Math.min(r,s.length-1)],c=Gt(o.textMuted,o.bg,l);if(a?t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",o.border).attr("stroke-width",1).attr("rx",Nf):t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",c).attr("stroke",o.border).attr("stroke-width",1).attr("rx",Nf),i.label&&n.showGroupLabels&&t.append("text").attr("x",10).attr("y",18).attr("fill",o.textMuted).attr("font-size",11).attr("font-weight","600").attr("letter-spacing","0.5px").text(i.label.toUpperCase()),i.states.includes("collapsed")){t.append("text").attr("x",e.width-20).attr("y",18).attr("fill",o.textMuted).attr("font-size",12).attr("opacity",.6).text("\u25B6");return}i.states.includes("scrollable")&&t.append("rect").attr("x",e.width-6).attr("y",28).attr("width",3).attr("height",Math.min(e.height-36,40)).attr("fill",o.border).attr("rx",1.5);for(let d of e.children)Mf(t,d,n,r+1)}function ytt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=e.height;if(t.append("rect").attr("width",e.width).attr("height",i).attr("fill",o?"none":r.bg).attr("stroke",r.border).attr("rx",rG),a.fieldVariant==="password"?t.append("text").attr("x",10).attr("y",i/2+4).attr("fill",r.text).attr("font-size",16).text("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022"):t.append("text").attr("x",10).attr("y",i/2+4).attr("fill",r.textMuted).attr("font-size",13).text(a.label||"Text input"),a.fieldVariant!=="password"){let s=Math.min(_t(a.label||"Text input",13)+14,e.width-20);t.append("line").attr("x1",s).attr("y1",8).attr("x2",s).attr("y2",i-8).attr("stroke",r.primary).attr("stroke-width",1.5).attr("opacity",.6)}if(a.fieldVariant==="textarea")for(let s=0;s<3;s++)t.append("line").attr("x1",e.width-12+s*3).attr("y1",i-4).attr("x2",e.width-4).attr("y2",i-12+s*3).attr("stroke",r.border).attr("stroke-width",1)}function btt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=a.states.includes("ghost"),s=oG(a,r),c=a.states.includes("primary")?r.primary:r.secondary,d=r.bg;s&&(c=s),i||o?(t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",c).attr("stroke-width",1.5).attr("rx",eG),d=c):t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",c).attr("rx",eG),t.append("text").attr("x",e.width/2).attr("y",e.height/2+4).attr("fill",d).attr("font-size",13).attr("font-weight","600").attr("text-anchor","middle").text(a.label)}function xtt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":r.bg).attr("stroke",r.border).attr("rx",rG),t.append("text").attr("x",10).attr("y",e.height/2+4).attr("fill",r.text).attr("font-size",13).text(a.label||(a.options?.[0]??"Select..."));let i=e.width-16,s=e.height/2;t.append("path").attr("d",`M${i-4},${s-2} L${i},${s+2} L${i+4},${s-2}`).attr("fill","none").attr("stroke",r.textMuted).attr("stroke-width",1.5)}function wtt(t,e,n){let{palette:r}=n,o=e.element;if(o.states.includes("toggle")){let l=e.height/2;t.append("rect").attr("x",0).attr("y",l-18/2).attr("width",32).attr("height",18).attr("rx",18/2).attr("fill",o.checked?r.primary:r.border),t.append("circle").attr("cx",o.checked?32-18/2:18/2).attr("cy",l).attr("r",18/2-2).attr("fill",r.bg),o.label&&t.append("text").attr("x",40).attr("y",l+4).attr("fill",r.text).attr("font-size",13).text(o.label)}else{let s=e.height/2;t.append("rect").attr("x",0).attr("y",s-16/2).attr("width",16).attr("height",16).attr("fill",o.checked?r.primary:"none").attr("stroke",o.checked?r.primary:r.border).attr("rx",3),o.checked&&t.append("path").attr("d",`M3,${s} L6,${s+3} L13,${s-4}`).attr("fill","none").attr("stroke",r.bg).attr("stroke-width",2),o.label&&t.append("text").attr("x",24).attr("y",s+4).attr("fill",r.text).attr("font-size",13).text(o.label)}}function Ett(t,e,n){let{palette:r}=n,o=e.element,a=8,i=e.height/2;t.append("circle").attr("cx",a).attr("cy",i).attr("r",a).attr("fill","none").attr("stroke",o.selected?r.primary:r.border).attr("stroke-width",1.5),o.selected&&t.append("circle").attr("cx",a).attr("cy",i).attr("r",4).attr("fill",r.primary),t.append("text").attr("x",a*2+8).attr("y",i+4).attr("fill",r.text).attr("font-size",13).text(o.label)}function Stt(t,e,n){let{palette:r}=n,o=e.element,a=o.headingLevel===1;t.append("text").attr("x",0).attr("y",a?28:22).attr("fill",r.text).attr("font-size",a?22:16).attr("font-weight","bold").text(o.label)}function vtt(t,e,n){let{palette:r}=n;t.append("line").attr("x1",0).attr("y1",e.height/2).attr("x2",e.width).attr("y2",e.height/2).attr("stroke",r.border).attr("stroke-width",1)}function nG(t,e,n){let{palette:r}=n,o=e.element;if(o.metadata._labelField==="true"&&o.children.length>=2){for(let i of e.children)Mf(t,i,n,0);return}let a=o.labelFor?r.textMuted:r.text;t.append("text").attr("x",0).attr("y",15).attr("fill",a).attr("font-size",13).text(o.label)}function ktt(t,e,n){let{palette:r}=n,o=e.element;t.append("circle").attr("cx",4).attr("cy",e.height/2).attr("r",2.5).attr("fill",r.textMuted),t.append("text").attr("x",14).attr("y",e.height/2+4).attr("fill",r.text).attr("font-size",13).text(o.label)}function Ltt(t,e,n){let{palette:r}=n,o=e.element;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",Gt(r.textMuted,r.bg,8)).attr("rx",4);let a=12;for(let i of o.children){let s=i.states.includes("active");t.append("text").attr("x",a).attr("y",e.height/2+4).attr("fill",s?r.primary:r.text).attr("font-size",13).attr("font-weight",s?"600":"normal").text(i.label);let l=_t(i.label,13);s&&t.append("line").attr("x1",a).attr("y1",e.height-4).attr("x2",a+l).attr("y2",e.height-4).attr("stroke",r.primary).attr("stroke-width",2),a+=l+24}}function Ntt(t,e,n){let{palette:r}=n,o=e.element;t.append("line").attr("x1",0).attr("y1",e.height-1).attr("x2",e.width).attr("y2",e.height-1).attr("stroke",r.border).attr("stroke-width",1);let a=0;for(let i of o.children){let s=i.states.includes("active"),l=_t(i.label,13)+24;s&&t.append("line").attr("x1",a).attr("y1",e.height-1).attr("x2",a+l).attr("y2",e.height-1).attr("stroke",r.primary).attr("stroke-width",2),t.append("text").attr("x",a+12).attr("y",e.height/2+4).attr("fill",s?r.primary:r.textMuted).attr("font-size",13).attr("font-weight",s?"600":"normal").text(i.label),a+=l}}function Mtt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=a.tableHeaders||[],s=a.tableData||[],l=a.tableRows!==void 0&&a.tableCols!==void 0,c=i.length||a.tableCols||3,d=e.width/c,u=32,f=28;t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",r.border).attr("rx",4),t.append("rect").attr("width",e.width).attr("height",u).attr("fill",o?"none":Gt(r.textMuted,r.bg,8)).attr("rx",4);for(let m=0;m<c;m++){let h=i[m]||`Col ${m+1}`;t.append("text").attr("x",m*d+10).attr("y",u/2+4).attr("fill",r.text).attr("font-size",12).attr("font-weight","600").text(h)}t.append("line").attr("x1",0).attr("y1",u).attr("x2",e.width).attr("y2",u).attr("stroke",r.border);let p=l?a.tableRows||3:s.length;for(let m=0;m<p;m++){let h=u+m*f;m>0&&t.append("line").attr("x1",0).attr("y1",h).attr("x2",e.width).attr("y2",h).attr("stroke",r.border).attr("opacity",.3);for(let g=0;g<c;g++)if(l)t.append("rect").attr("x",g*d+10).attr("y",h+8).attr("width",d*.6).attr("height",12).attr("fill",r.textMuted).attr("opacity",.25).attr("rx",2);else if(s[m]){let v=s[m][g]||"";Ttt(t,v,g*d+10,h,d-20,f,n)}}}function Ttt(t,e,n,r,o,a,i){let{palette:s}=i,l=e.trim(),c=l.match(/^\(([^)]+)\)(?:\s*\|\s*(.+))?$/);if(c){let d=c[1],u=c[2]?.trim().toLowerCase(),f=u==="ghost",m=u==="destructive"?s.destructive:s.primary,h=Math.min(_t(d,10)+16,o),g=20,v=r+(a-g)/2;f?(t.append("rect").attr("x",n).attr("y",v).attr("width",h).attr("height",g).attr("fill","none").attr("stroke",m).attr("stroke-width",1).attr("rx",3),t.append("text").attr("x",n+h/2).attr("y",v+g/2+3).attr("fill",m).attr("font-size",10).attr("font-weight","600").attr("text-anchor","middle").text(d)):(t.append("rect").attr("x",n).attr("y",v).attr("width",h).attr("height",g).attr("fill",m).attr("rx",3),t.append("text").attr("x",n+h/2).attr("y",v+g/2+3).attr("fill",s.bg).attr("font-size",10).attr("font-weight","600").attr("text-anchor","middle").text(d));return}if(/^<\s*x?\s*>$/.test(l)){let d=/x/i.test(l),u=12,f=n,p=r+(a-u)/2;t.append("rect").attr("x",f).attr("y",p).attr("width",u).attr("height",u).attr("fill",d?s.primary:"none").attr("stroke",d?s.primary:s.border).attr("rx",2),d&&t.append("path").attr("d",`M${f+2},${p+u/2} L${f+4},${p+u/2+2} L${f+10},${p+2}`).attr("fill","none").attr("stroke",s.bg).attr("stroke-width",1.5);return}t.append("text").attr("x",n).attr("y",r+a/2+4).attr("fill",s.text).attr("font-size",12).text(l)}function Ctt(t,e,n){let{palette:r,isTransparent:o}=n;if(e.element.imageHint==="round"){let s=Math.min(e.width,e.height)/2,l=e.width/2,c=e.height/2;t.append("circle").attr("cx",l).attr("cy",c).attr("r",s).attr("fill",o?"none":Gt(r.border,r.bg,30)).attr("stroke",r.border),t.append("line").attr("x1",l-s*.7).attr("y1",c-s*.7).attr("x2",l+s*.7).attr("y2",c+s*.7).attr("stroke",r.border),t.append("line").attr("x1",l+s*.7).attr("y1",c-s*.7).attr("x2",l-s*.7).attr("y2",c+s*.7).attr("stroke",r.border)}else t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":Gt(r.border,r.bg,30)).attr("stroke",r.border).attr("rx",4),t.append("line").attr("x1",0).attr("y1",0).attr("x2",e.width).attr("y2",e.height).attr("stroke",r.border),t.append("line").attr("x1",e.width).attr("y1",0).attr("x2",0).attr("y2",e.height).attr("stroke",r.border)}function _tt(t,e,n){for(let r of e.children)aG(t,r,n)}function aG(t,e,n){let{palette:r,isTransparent:o}=n,a=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`);o?a.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",r.border).attr("opacity",.1).attr("rx",4):a.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",r.border).attr("opacity",.2).attr("rx",4)}function Att(t,e,n){let{palette:r,isDark:o,isTransparent:a}=n,i=e.element,s=oG(i,r)||r.accent,l=a?null:ie(r,s,o,{solid:n.solid});l&&t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",l).attr("rx",4),t.append("rect").attr("width",3).attr("height",e.height).attr("fill",s).attr("rx",1.5),a&&t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill","none").attr("stroke",s).attr("rx",4);let c=l?ve(l,r.textOnFillLight,r.textOnFillDark):r.text;t.append("text").attr("x",12).attr("y",e.height/2+4).attr("fill",c).attr("font-size",13).text(i.label)}function Rtt(t,e,n){let{palette:r,isTransparent:o}=n,i=e.element.progressValue??0,s=8,l=e.height/2;t.append("rect").attr("width",e.width-40).attr("height",s).attr("y",l-s/2).attr("fill",o?"none":Gt(r.border,r.bg,30)).attr("stroke",o?r.border:"none").attr("rx",s/2);let c=(e.width-40)*i/100;c>0&&t.append("rect").attr("width",c).attr("height",s).attr("y",l-s/2).attr("fill",r.primary).attr("rx",s/2),t.append("text").attr("x",e.width-32).attr("y",l+4).attr("fill",r.textMuted).attr("font-size",11).text(`${i}%`)}function Itt(t,e,n){let{palette:r,isTransparent:o}=n,i=e.element.chartHint||"line";t.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":Gt(r.textMuted,r.bg,8)).attr("stroke",r.border).attr("rx",4);let s=20,l=20,c=e.width-s*2,d=e.height-l*2;if(i==="line"){let f=[[0,d*.7],[c*.2,d*.4],[c*.4,d*.6],[c*.6,d*.2],[c*.8,d*.3],[c,d*.1]].map(([p,m],h)=>h===0?`M${s+p},${l+m}`:`L${s+p},${l+m}`).join(" ");t.append("path").attr("d",f).attr("fill","none").attr("stroke",r.primary).attr("stroke-width",2)}else if(i==="bar"){let f=c/10,p=[.6,.8,.5,.9,.7];for(let m=0;m<5;m++){let h=d*p[m];t.append("rect").attr("x",s+m*(c/5)+f/2).attr("y",l+d-h).attr("width",f).attr("height",h).attr("fill",r.primary).attr("opacity",.7).attr("rx",2)}}else if(i==="pie"){let u=e.width/2,f=e.height/2,p=Math.min(c,d)/2,m=[.35,.25,.2,.2],h=[r.primary,r.secondary,r.accent,r.border],g=0;for(let v=0;v<m.length;v++){let y=g+m[v]*Math.PI*2,b=u+p*Math.cos(g),E=f+p*Math.sin(g),x=u+p*Math.cos(y),L=f+p*Math.sin(y),S=m[v]>.5?1:0;t.append("path").attr("d",`M${u},${f} L${b},${E} A${p},${p} 0 ${S},1 ${x},${L} Z`).attr("fill",h[v]).attr("opacity",.7),g=y}}}function Ptt(t,e,n){let{palette:r,isTransparent:o}=n,a=e.element,i=t.append("g").attr("transform",`translate(${e.x}, ${e.y})`).attr("data-line-number",a.lineNumber);o||i.append("rect").attr("x",4).attr("y",4).attr("width",e.width).attr("height",e.height).attr("fill","rgba(0,0,0,0.1)").attr("rx",Nf),i.append("rect").attr("width",e.width).attr("height",e.height).attr("fill",o?"none":r.surface).attr("stroke",r.border).attr("rx",Nf),i.append("rect").attr("width",e.width).attr("height",36).attr("fill",o?"none":Gt(r.textMuted,r.bg,15)).attr("rx",Nf),i.append("text").attr("x",12).attr("y",24).attr("fill",r.text).attr("font-size",14).attr("font-weight","600").text(a.label||"Modal");let s=e.width-16;i.append("text").attr("x",s).attr("y",24).attr("fill",r.textMuted).attr("font-size",16).text("\xD7");for(let l of e.children){let c=i.append("g").attr("transform","translate(0, 36)");Mf(c,l,n,1)}}var rG,eG,Nf,ptt,sG=st(()=>{"use strict";Xn();on();tn();en();fr();rG=4,eG=6,Nf=8,ptt={destructive:t=>t.destructive,success:t=>t.colors.green,warning:t=>t.colors.yellow,info:t=>t.colors.blue}});var hG={};ye(hG,{collectCardMetadata:()=>Og,computeC4NodeDimensions:()=>Xl,layoutC4Components:()=>q1,layoutC4Containers:()=>j1,layoutC4Context:()=>X1,layoutC4Deployment:()=>K1,rollUpContextRelationships:()=>pG});function Pg(t,e,n,r){let o=0;for(let a of t){let i=e.get(a.source),s=e.get(a.target);if(i==null||s==null)continue;let l=Math.abs(i-s),c=Math.min(n.get(a.source)??1,n.get(a.target)??1);o+=l*c}if(r)for(let a of t){let i=r.get(a.source),s=r.get(a.target);if(!i||!s)continue;let l=e.get(a.source)??0,c=e.get(a.target)??0,d=i.y,u=s.y;if(d===u)continue;let f=Math.min(l,c),p=Math.max(l,c),m=Math.min(d,u),h=Math.max(d,u);for(let[g,v]of r){if(g===a.source||g===a.target)continue;let y=e.get(g)??0,b=v.y,E=v.width/2,x=v.height/2;y+E>f&&y-E<p&&b+x>m&&b-x<h&&(o+=Btt)}}return o}function Dg(t,e,n){if(e.length<2)return;let r=new Map;for(let s of e)r.set(s.source,(r.get(s.source)??0)+1),r.set(s.target,(r.get(s.target)??0)+1);let o=new Map;for(let s of t.nodes()){let l=cs(t,s);l&&o.set(s,{y:l.y,width:l.width,height:l.height})}let a=new Map;for(let s of t.nodes()){let l=cs(t,s);if(!l)continue;let c=Math.round(l.y);a.has(c)||a.set(c,[]),a.get(c).push(s)}for(let[,s]of a)s.sort((l,c)=>cs(t,l).x-cs(t,c).x);let i=!1;for(let[,s]of a){if(s.length<2)continue;let l=[];if(n&&n.size>0){let c=new Map,d=[];for(let u of s){let f=n.get(u);f?(c.has(f)||c.set(f,[]),c.get(f).push(u)):d.push(u)}for(let u of c.values())u.length>=2&&l.push(u);d.length>=2&&l.push(d)}else l.push(s);for(let c of l){if(c.length<2)continue;let d=c.map(h=>cs(t,h).x).sort((h,g)=>h-g),u=new Map;for(let h of t.nodes()){let g=cs(t,h);g&&u.set(h,g.x)}let f=Pg(e,u,r,o),p=[...c],m=f;if(c.length<=8){let h=Ftt(c);for(let g of h){let v=new Map(u);for(let b=0;b<g.length;b++)v.set(g[b],d[b]);let y=Pg(e,v,r,o);y<m&&(m=y,p=[...g])}}else{let h=[...c],g=!0,v=0;for(;g&&v<10;){g=!1,v++;for(let y=0;y<h.length-1;y++){let b=new Map(u);for(let S=0;S<h.length;S++)b.set(h[S],d[S]);let E=Pg(e,b,r,o);[h[y],h[y+1]]=[h[y+1],h[y]];let x=new Map(u);for(let S=0;S<h.length;S++)x.set(h[S],d[S]);let L=Pg(e,x,r,o);L<E?(g=!0,L<m&&(m=L,p=[...h])):[h[y],h[y+1]]=[h[y+1],h[y]]}}}if(p.some((h,g)=>h!==c[g])){for(let h=0;h<p.length;h++){cs(t,p[h]).x=d[h];let g=s.indexOf(c[h]);g>=0&&(s[g]=p[h])}i=!0}}}if(i)for(let s of e){let l=Dtt(t,s.source,s.target);if(!l)continue;let c=cs(t,s.source),d=cs(t,s.target);if(!c||!d)continue;let u={x:c.x,y:c.y+c.height/2},f={x:d.x,y:d.y-d.height/2},p=(u.y+f.y)/2;l.points=[u,{x:u.x,y:p},{x:f.x,y:p},f]}}function Ftt(t){let e=[],n=[...t],r=n.length,o=new Array(r).fill(0);e.push([...n]);let a=0;for(;a<r;)o[a]<a?(a%2===0?[n[0],n[a]]=[n[a],n[0]]:[n[o[a]],n[a]]=[n[a],n[o[a]]],e.push([...n]),o[a]++,a=0):(o[a]=0,a++);return e}function V1(t){let e=new Map;function n(r,o){e.set(r.name,o);for(let a of r.children)n(a,o);for(let a of r.groups)for(let i of a.children)n(i,o)}for(let r of t)n(r,r.name);return e}function U1(t,e){let n=[];function r(o){for(let a of o.relationships)n.push({sourceName:o.name,rel:a});for(let a of o.children)r(a);for(let a of o.groups)for(let i of a.children)r(i)}for(let o of t)r(o);return n}function pG(t){let e=V1(t.elements),n=U1(t.elements,e),r=new Set(t.elements.map(c=>c.name)),o=new Set,a=[],i=[];for(let{sourceName:c,rel:d}of n){let u=e.get(c)??c,f=e.get(d.target)??d.target;if(u===f)continue;let p={sourceName:u,targetName:f,...d.label!==void 0&&{label:d.label},...d.technology!==void 0&&{technology:d.technology},arrowType:d.arrowType,lineNumber:d.lineNumber};if(r.has(c)&&c===u){let m=`${u}\u2192${f}`;o.add(m),a.push(p)}else i.push(p)}let s=[...a],l=new Set(o);for(let c of i){let d=`${c.sourceName}\u2192${c.targetName}`;l.has(d)||(l.add(d),s.push(c))}return s}function Ld(t,e,n,r){let o=t.metadata.color;if(o)return o;if(!n)return;let a=e.find(c=>c.name.toLowerCase()===n.toLowerCase());if(!a)return;let i=qt(a.name),s=t.metadata[i];if(!s&&r){for(let c of r)if(s=c.metadata[i],s)break}let l=s??a.defaultValue;return l?a.entries.find(c=>c.value.toLowerCase()===l.toLowerCase())?.color??"#999999":"#999999"}function Og(t){let e=[],n=t.tech??t.technology;n&&e.push({key:"Technology",value:n});for(let[r,o]of Object.entries(t)){if(Ytt.has(r.toLowerCase()))continue;let a=r.charAt(0).toUpperCase()+r.slice(1);e.push({key:a,value:o})}return e}function Xl(t,e){let n=_t(t.name,$tt)+Ig*2,r=Math.max(Ott,Math.min(lG,n));if(e?.showTechnology){let i=Rg+dG,s=t.description?.join(`
212
212
  `);if(s){let c=r-Ig*2,d=Tn(s,fG,c);i+=d.length*uG}let l=Og(t.metadata);if(l.length>0){i+=cG,i+=l.length*Htt;let c=Math.max(...l.map(d=>_t(`${d.key}: ${d.value}`,Wtt)+Ig*2));c>r&&(r=Math.min(lG,c))}return i+=Rg,{width:r,height:i}}let o=Rg+Gtt+cG+dG,a=t.description?.join(`
213
213
  `);if(a){let i=r-Ig*2,s=Tn(a,fG,i);o+=s.length*uG}return o+=Rg,{width:r,height:o}}function Gg(t){let e=[];for(let n of t){let r=[];for(let i of n.entries)r.push({value:i.value,color:i.color});if(r.length===0)continue;let o=We(n.name,sr)+po*2,a=Rn;for(let i of r)a+=wr*2+Nr+We(i.value,Vn)+Kr;a+=Rn,e.push({name:n.name,entries:r,x:0,y:0,width:o+a,height:Se})}return e}function $g(t){let e=new Map;for(let i of t)(i.label||i.technology)&&e.set(i.sourceName,(e.get(i.sourceName)??0)+1);let n=Math.max(0,...e.values()),r=Math.max(80,60+n*20),o=Math.max(140,100+n*35),a=Math.max(30,20+n*8);return{nodesep:r,ranksep:o,edgesep:a}}function X1(t,e){let n=t.elements.filter(v=>v.type==="person"||v.type==="system");if(n.length===0)return{nodes:[],edges:[],legend:[],groupBoundaries:[],width:0,height:0};let r=pG(t),o=$g(r),a=new er.graphlib.Graph;a.setGraph({rankdir:"TB",nodesep:o.nodesep,ranksep:o.ranksep,edgesep:o.edgesep}),a.setDefaultEdgeLabel(()=>({}));let i=new Map;for(let v of n){i.set(v.name,v);let y=Xl(v);a.setNode(v.name,{width:y.width,height:y.height})}let s=[];for(let v of r)i.has(v.sourceName)&&i.has(v.targetName)&&(s.push(v),a.setEdge(v.sourceName,v.targetName,{label:v.label??""}));er.layout(a),Dg(a,s.map(v=>({source:v.sourceName,target:v.targetName})));let l=n.map(v=>{let y=a.node(v.name),b=Ld(v,t.tagGroups,e??null),E=v.children.some(S=>S.type==="container")||v.groups.some(S=>S.children.some(A=>A.type==="container")),x=v.description?.join(`
214
214
  `),L=E||v.importPath?!0:void 0;return{id:v.name,name:v.name,type:v.type,...x!==void 0&&{description:x},metadata:v.metadata,lineNumber:v.lineNumber,...b!==void 0&&{color:b},...L!==void 0&&{drillable:L},...v.importPath!==void 0&&{importPath:v.importPath},x:y.x,y:y.y,width:y.width,height:y.height}}),c=s.map(v=>{let y=a.edge(v.sourceName,v.targetName);return{source:v.sourceName,target:v.targetName,arrowType:v.arrowType,...v.label!==void 0&&{label:v.label},...v.technology!==void 0&&{technology:v.technology},lineNumber:v.lineNumber,points:y?.points??[]}}),d=1/0,u=1/0,f=-1/0,p=-1/0;for(let v of l){let y=v.x-v.width/2,b=v.y-v.height/2,E=v.x+v.width/2,x=v.y+v.height/2;y<d&&(d=y),b<u&&(u=b),E>f&&(f=E),x>p&&(p=x)}for(let v of c)for(let y of v.points)y.x<d&&(d=y.x),y.y<u&&(u=y.y),y.x>f&&(f=y.x),y.y>p&&(p=y.y);if(l.length>0){let v=_r-d,y=_r-u;for(let b of l)b.x+=v,b.y+=y;for(let b of c)for(let E of b.points)E.x+=v,E.y+=y}let m=l.length>0?f-d+_r*2:0,h=l.length>0?p-u+_r*2:0,g=Gg(t.tagGroups);if(g.length>0){let v=h+_r,y=_r;for(let x of g)x.x=y,x.y=v,y+=x.width+12;let b=y,E=v+Se;b>m&&(m=b),E>h&&(h=E)}return{nodes:l,edges:c,legend:g,groupBoundaries:[],width:m,height:h}}function j1(t,e,n){let r=t.elements.find(D=>D.name.toLowerCase()===e.toLowerCase());if(!r)return{nodes:[],edges:[],legend:[],groupBoundaries:[],width:0,height:0};let o=[];for(let D of r.children)D.type==="container"&&o.push(D);for(let D of r.groups)for(let W of D.children)W.type==="container"&&o.push(W);if(o.length===0)return{nodes:[],edges:[],legend:[],groupBoundaries:[],width:0,height:0};let a=new Set(o.map(D=>D.name.toLowerCase())),i=new Map;for(let D of t.elements)i.set(D.name.toLowerCase(),D);let s=new Set;for(let D of o)for(let W of D.relationships){let z=W.target.toLowerCase();a.has(z)||s.add(z)}let l=V1(t.elements),c=U1(t.elements,l);for(let{sourceName:D,rel:W}of c){let z=l.get(D)??D;z.toLowerCase()!==r.name.toLowerCase()&&a.has(W.target.toLowerCase())&&s.add(z.toLowerCase())}let d=[];for(let D of s){let W=i.get(D);W&&d.push(W)}let u=new Map;for(let D of r.groups)for(let W of D.children)W.type==="container"&&u.set(W.name,{name:D.name,lineNumber:D.lineNumber});let f=u.size>0,p=f?new er.graphlib.Graph({compound:!0}):new er.graphlib.Graph;if(p.setDefaultEdgeLabel(()=>({})),f){let D=new Set;for(let{name:W}of u.values())D.has(W)||(D.add(W),p.setNode("__group_"+W,{}))}let m=new Map;for(let D of o){m.set(D.name,D);let W=Xl(D,{showTechnology:!0});p.setNode(D.name,{width:W.width,height:W.height});let z=u.get(D.name);z&&p.setParent(D.name,"__group_"+z.name)}for(let D of d){m.set(D.name,D);let W=Xl(D);p.setNode(D.name,{width:W.width,height:W.height})}let h=[],g=new Set;for(let D of o)for(let W of D.relationships){if(!m.get(W.target))continue;let P=`${D.name}\u2192${W.target}`;g.has(P)||(g.add(P),h.push({sourceName:D.name,targetName:W.target,...W.label!==void 0&&{label:W.label},...W.technology!==void 0&&{technology:W.technology},arrowType:W.arrowType,lineNumber:W.lineNumber}))}for(let{sourceName:D,rel:W}of c){let z=l.get(D)??D;if(z.toLowerCase()!==r.name.toLowerCase()&&a.has(W.target.toLowerCase())){if(!m.get(z))continue;let B=`${z}\u2192${W.target}`;g.has(B)||(g.add(B),h.push({sourceName:z,targetName:W.target,...W.label!==void 0&&{label:W.label},...W.technology!==void 0&&{technology:W.technology},arrowType:W.arrowType,lineNumber:W.lineNumber}))}}let v=$g(h);p.setGraph({rankdir:"TB",nodesep:v.nodesep,ranksep:v.ranksep,edgesep:v.edgesep});for(let D of h)m.has(D.sourceName)&&m.has(D.targetName)&&p.setEdge(D.sourceName,D.targetName,{label:D.label??""});er.layout(p);let y=f?new Map([...u.entries()].map(([D,W])=>[D,W.name])):void 0;Dg(p,h.filter(D=>m.has(D.sourceName)&&m.has(D.targetName)).map(D=>({source:D.sourceName,target:D.targetName})),y);let b=[];for(let D of o){let W=p.node(D.name),z=Ld(D,t.tagGroups,n??null),P=D.metadata.tech??D.metadata.technology,B=D.children.some(j=>j.type==="component")||D.groups.some(j=>j.children.some(K=>K.type==="component")),Y=D.description?.join(`
@@ -525,7 +525,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
525
525
  .dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-comment,
526
526
  .dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-noteContent,
527
527
  .dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-punctuation { color: #616e88; }
528
- `;Xu();var PL="0.44.1",t5="https://online.diagrammo.app",vut=200,kut=1200,Lut="[dgmo]",Nut=/[\x00-\x1F‪-‮⁦-⁩]/g,IL="dgmoAutoStyles";function Yb(...t){typeof console<"u"&&console.warn&&console.warn(Lut,...t)}function e5(t){t.querySelectorAll("script, foreignObject").forEach(r=>r.remove());let n=[t,...Array.from(t.querySelectorAll("*"))];for(let r of n){for(let o of Array.from(r.attributes))o.name.toLowerCase().startsWith("on")&&r.removeAttribute(o.name);if(r.hasAttribute("href")&&Si(r.getAttribute("href"))===null&&r.removeAttribute("href"),r.hasAttributeNS("http://www.w3.org/1999/xlink","href")){let o=r.getAttributeNS("http://www.w3.org/1999/xlink","href");Si(o)===null&&r.removeAttributeNS("http://www.w3.org/1999/xlink","href")}}}function n5(t){if(t==="light"||t==="dark"||t==="transparent")return t;if(typeof document>"u")return"light";let e=document.documentElement,n=e.getAttribute("data-theme");return n==="dark"?"dark":n==="light"?"light":e.classList.contains("dark")?"dark":e.classList.contains("light")?"light":typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function r5(){if(typeof document>"u")return;let t=document.documentElement;if(t?.dataset?.[IL]==="1")return;if(document.querySelector('link[rel="stylesheet"][href*="auto.css"]')){t&&t.dataset&&(t.dataset[IL]="1");return}let n=document.createElement("style");n.setAttribute("data-dgmo-auto",""),n.textContent=J4,document.head.appendChild(n),t&&t.dataset&&(t.dataset[IL]="1")}function o5(t){let e=t.split(`
528
+ `;Xu();var PL="0.45.0",t5="https://online.diagrammo.app",vut=200,kut=1200,Lut="[dgmo]",Nut=/[\x00-\x1F‪-‮⁦-⁩]/g,IL="dgmoAutoStyles";function Yb(...t){typeof console<"u"&&console.warn&&console.warn(Lut,...t)}function e5(t){t.querySelectorAll("script, foreignObject").forEach(r=>r.remove());let n=[t,...Array.from(t.querySelectorAll("*"))];for(let r of n){for(let o of Array.from(r.attributes))o.name.toLowerCase().startsWith("on")&&r.removeAttribute(o.name);if(r.hasAttribute("href")&&Si(r.getAttribute("href"))===null&&r.removeAttribute("href"),r.hasAttributeNS("http://www.w3.org/1999/xlink","href")){let o=r.getAttributeNS("http://www.w3.org/1999/xlink","href");Si(o)===null&&r.removeAttributeNS("http://www.w3.org/1999/xlink","href")}}}function n5(t){if(t==="light"||t==="dark"||t==="transparent")return t;if(typeof document>"u")return"light";let e=document.documentElement,n=e.getAttribute("data-theme");return n==="dark"?"dark":n==="light"?"light":e.classList.contains("dark")?"dark":e.classList.contains("light")?"light":typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function r5(){if(typeof document>"u")return;let t=document.documentElement;if(t?.dataset?.[IL]==="1")return;if(document.querySelector('link[rel="stylesheet"][href*="auto.css"]')){t&&t.dataset&&(t.dataset[IL]="1");return}let n=document.createElement("style");n.setAttribute("data-dgmo-auto",""),n.textContent=J4,document.head.appendChild(n),t&&t.dataset&&(t.dataset[IL]="1")}function o5(t){let e=t.split(`
529
529
  `).map(n=>n.trim()).find(n=>n.length>0);return e?e.replace(Nut,"").slice(0,vut):"DGMO diagram"}function Mut(t){let e=document.createDocumentFragment(),n;try{n=Q4(t)}catch{return e.appendChild(document.createTextNode(t)),e}for(let r of n){if(!r.text)continue;let o=document.createElement("span");o.className=`dgmo-tok-${r.role}`,o.textContent=r.text,e.appendChild(o)}return e}var a5='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5V3a1.5 1.5 0 0 0-1.5-1.5H3A1.5 1.5 0 0 0 1.5 3v6A1.5 1.5 0 0 0 3 10.5h2.5"/></svg>',Tut='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 8.5 6.5 12 13 4.5"/></svg>',Cut='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 2h5v5"/><path d="M14 2L7 9"/><path d="M13 9v4a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4"/></svg>';function Fb(t,e){t.innerHTML=e}function i5(t,e,n){let r=document.createElement("div");r.className="dgmo-source-panel";let o=document.createElement("button");o.type="button",o.className="dgmo-source-toggle",o.setAttribute("aria-expanded","false");let a=document.createElement("span");a.className="dgmo-chevron",a.setAttribute("aria-hidden","true"),a.textContent="\u25B8",o.appendChild(a);let i=document.createElement("span");i.textContent="DGMO source",o.appendChild(i);let s=document.createElement("div");s.className="dgmo-source-body";let l=document.createElement("pre");l.className="dgmo-source-pre",l.appendChild(Mut(t)),s.appendChild(l);let c=document.createElement("div");c.className="dgmo-source-actions";let d=document.createElement("button");if(d.type="button",d.className="dgmo-btn dgmo-btn-copy",d.setAttribute("aria-label","Copy DGMO source"),d.title="Copy source",Fb(d,a5),d.addEventListener("click",()=>{_ut(t,d)}),c.appendChild(d),n){let u=document.createElement("a");u.className="dgmo-btn dgmo-btn-editor",u.target="_blank",u.rel="noopener noreferrer",u.setAttribute("aria-label","Open in editor"),Fb(u,Cut),e?(u.href=e,u.title="Open in editor"):(u.setAttribute("aria-disabled","true"),u.title="Diagram too large for share link; copy source and paste into editor",u.addEventListener("click",f=>f.preventDefault())),c.appendChild(u)}return s.appendChild(c),r.appendChild(o),r.appendChild(s),o.addEventListener("click",()=>{let u=s.classList.toggle("dgmo-open");o.setAttribute("aria-expanded",u?"true":"false")}),r}async function _ut(t,e){let n=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(t),n=!0)}catch{}if(!n&&typeof document<"u")try{let r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r),r.select(),n=document.execCommand("copy"),document.body.removeChild(r)}catch{n=!1}n?(Fb(e,Tut),e.classList.add("dgmo-btn-copied"),setTimeout(()=>{Fb(e,a5),e.classList.remove("dgmo-btn-copied")},kut)):Yb("clipboard write failed")}function s5(t){let e=document.createElement("div");e.className="dgmo-error-banner",e.setAttribute("role","alert");let n=document.createElement("div");if(n.className="dgmo-error-banner-title",n.textContent=`${t.severity??"error"}: ${t.message}`,e.appendChild(n),t.line!==void 0&&t.line>0){let r=document.createElement("div");r.className="dgmo-error-banner-loc",r.textContent=t.column!==void 0?`at ${t.line}:${t.column}`:`at line ${t.line}`,e.appendChild(r)}return e}function l5(t,e){let n=I4(t,{baseUrl:e.editorBase,palette:e.palette,theme:e.theme});if(!n.url)return null;let r=`utm_source=${encodeURIComponent(e.utmSource)}&utm_medium=html&utm_campaign=${encodeURIComponent(e.campaign)}`,o=n.url.indexOf("#"),a;if(o===-1){let i=n.url.includes("?")?"&":"?";a=n.url+i+r}else{let i=n.url.slice(0,o),s=n.url.slice(o+1),l=i.includes("?")?"&":"?",c=s.length>0?"&":"";a=i+l+r+"#"+s+c+r}return Si(a)?a:null}var Aut=`https://unpkg.com/@diagrammo/dgmo@${PL}/dist/map-data/`,zb={worldCoarse:"world-coarse.json",worldDetail:"world-detail.json",usStates:"us-states.json",gazetteer:"gazetteer.json"},Rut={lakes:"lakes.json",rivers:"rivers.json",mountainRanges:"mountain-ranges.json",naLand:"na-land.json",naLakes:"na-lakes.json",waterBodies:"water-bodies.json",airports:"airports.json"},DL=new Map;function Iut(t){return t.endsWith("/")?t:t+"/"}async function Ip(t,e){let n=await fetch(t+e);if(!n.ok)throw new Error(`map asset ${e} \u2192 HTTP ${n.status}`);return await n.json()}async function Put(t){let e=Iut(t),n=DL.get(e);if(n)return n;let r=(async()=>{let[o,a,i,s]=await Promise.all([Ip(e,zb.worldCoarse),Ip(e,zb.worldDetail),Ip(e,zb.usStates),Ip(e,zb.gazetteer)]),l=await Promise.all(Object.entries(Rut).map(async([d,u])=>{try{return[d,await Ip(e,u)]}catch{return[d,void 0]}})),c={};for(let[d,u]of l)u!==void 0&&(c[d]=u);return{worldCoarse:o,worldDetail:a,usStates:i,gazetteer:s,...c}})().catch(o=>{throw DL.delete(e),o});return DL.set(e,r),r}function OL(t){let e=t.replace(/\t/g," ").split(`
530
530
  `);for(;e.length&&e[0].trim()==="";)e.shift();for(;e.length&&e[e.length-1].trim()==="";)e.pop();if(e.length===0)return"";let n=1/0;for(let r of e){if(r.trim()==="")continue;let o=r.length-r.trimStart().length;o<n&&(n=o)}return!Number.isFinite(n)||n===0?e.join(`
531
531
  `):e.map(r=>r.slice(n)).join(`