b&&(b=h),k=v*v*w,T=Math.max(b/k,k/x),T>E){v-=h;break}E=T}s.push(u={value:v,dice:m ma))l.moveTo(0,0);else if(v>zg-ma)l.moveTo(m*Pf(g),m*cc(g)),l.arc(0,0,m,g,y,!x),p>ma&&(l.moveTo(p*Pf(y),p*cc(y)),l.arc(0,0,p,y,g,x));else{var b=g,T=y,E=g,w=y,k=v,S=v,A=s.apply(this,arguments)/2,L=A>ma&&(n?+n.apply(this,arguments):n0(p*p+m*m)),I=G5(F9(m-p)/2,+r.apply(this,arguments)),N=I,C=I,_,D;if(L>ma){var M=$9(L/p*cc(A)),R=$9(L/m*cc(A));(k-=M*2)>ma?(M*=x?1:-1,E+=M,w-=M):(k=0,E=w=(g+y)/2),(S-=R*2)>ma?(R*=x?1:-1,b+=R,T-=R):(S=0,b=T=(g+y)/2)}var P=m*Pf(b),B=m*cc(b),F=p*Pf(w),G=p*cc(w);if(I>ma){var $=m*Pf(T),V=m*cc(T),X=p*Pf(E),Q=p*cc(E),H;if(v<$g)if(H=INe(P,B,X,Q,$,V,F,G)){var ie=P-H[0],Y=B-H[1],le=$-H[0],ee=V-H[1],J=1/cc(JJ((ie*le+Y*ee)/(n0(ie*ie+Y*Y)*n0(le*le+ee*ee)))/2),te=n0(H[0]*H[0]+H[1]*H[1]);N=G5(I,(p-te)/(J-1)),C=G5(I,(m-te)/(J+1))}else N=C=0}S>ma?C>ma?(_=U5(X,Q,P,B,m,C,x),D=U5($,V,F,G,m,C,x),l.moveTo(_.cx+_.x01,_.cy+_.y01),Cma)||!(k>ma)?l.lineTo(F,G):N>ma?(_=U5(F,G,$,V,p,-N,x),D=U5(P,B,X,Q,p,-N,x),l.lineTo(_.cx+_.x01,_.cy+_.y01),N{"use strict";z5();V5();z9();o(DNe,"arcInnerRadius");o(RNe,"arcOuterRadius");o(LNe,"arcStartAngle");o(NNe,"arcEndAngle");o(MNe,"arcPadAngle");o(INe,"intersect");o(U5,"cornerTangents");o(uc,"default")});function Ex(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var j6t,G9=O(()=>{"use strict";j6t=Array.prototype.slice;o(Ex,"default")});function tee(t){this._context=t}function au(t){return new tee(t)}var V9=O(()=>{"use strict";o(tee,"Linear");tee.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}},"point")};o(au,"default")});function ree(t){return t[0]}function nee(t){return t[1]}var iee=O(()=>{"use strict";o(ree,"x");o(nee,"y")});function hc(t,e){var r=ei(!0),n=null,i=au,a=null,s=q5(l);t=typeof t=="function"?t:t===void 0?ree:ei(t),e=typeof e=="function"?e:e===void 0?nee:ei(e);function l(u){var h,f=(u=Ex(u)).length,d,p=!1,m;for(n==null&&(a=i(m=s())),h=0;h<=f;++h)!(h "),t.result!==null&&g.kind!==t.kind&&sr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):sr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||f}function hFe(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(qi(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!lo(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&sr(t,"directive name must not be less than one character in length");s!==0;){for(;p0(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!fu(s));break}if(fu(s))break;for(r=t.position;s!==0&&!lo(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&jN(t),jf.call(ane,n)?ane[n](t,n,i):Ik(t,'unknown document directive "'+n+'"')}if(qi(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,qi(t,!0,-1)):a&&sr(t,"directives end mark is expected"),f1(t,t.lineIndent-1,Mk,!1,!0),qi(t,!0,-1),t.checkLineBreaks&&XBe.test(t.input.slice(e,t.position))&&Ik(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Bk(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,qi(t,!0,-1));return}if(t.position ${this.parser.parseInline(t)} An error occurred: ${t.replace(/\\n|\n/g," ${i.tokens?.map(n).join("")}0;){if(h=W2(s,l,r),h===u)return n[i]=s,n[a]=l,e(n);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;u=h}return t},t}function sc(){var t=yx();return t.copy=function(){return D5(t,sc())},Mf.apply(t,arguments),t9e(t)}var dJ=O(()=>{"use strict";Cf();g9();gx();fJ();o(t9e,"linearish");o(sc,"linear")});function v9(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a{"use strict";o(v9,"nice")});function In(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return o(i,"interval"),i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{let s=i(a),l=i.ceil(a);return a-s0))return u;let h;do u.push(h=new Date(+a)),e(a,l),t(a);while(hIn(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!a(s););else for(;--l>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(x9.setTime(+a),b9.setTime(+s),t(x9),t(b9),Math.floor(r(x9,b9))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}var x9,b9,gh=O(()=>{"use strict";x9=new Date,b9=new Date;o(In,"timeInterval")});var ru,mJ,T9=O(()=>{"use strict";gh();ru=In(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);ru.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?In(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):ru);mJ=ru.range});var $o,gJ,w9=O(()=>{"use strict";gh();$o=In(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),gJ=$o.range});var yh,r9e,R5,n9e,k9=O(()=>{"use strict";gh();yh=In(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),r9e=yh.range,R5=In(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),n9e=R5.range});var vh,i9e,L5,a9e,E9=O(()=>{"use strict";gh();vh=In(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),i9e=vh.range,L5=In(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),a9e=L5.range});var gl,s9e,xx,o9e,N5,l9e,S9=O(()=>{"use strict";gh();gl=In(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),s9e=gl.range,xx=In(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),o9e=xx.range,N5=In(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),l9e=N5.range});function Jp(t){return In(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}function e0(t){return In(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var oc,If,M5,I5,iu,O5,P5,vJ,c9e,u9e,h9e,f9e,d9e,p9e,t0,Bg,xJ,bJ,Of,TJ,wJ,kJ,m9e,g9e,y9e,v9e,x9e,b9e,C9=O(()=>{"use strict";gh();o(Jp,"timeWeekday");oc=Jp(0),If=Jp(1),M5=Jp(2),I5=Jp(3),iu=Jp(4),O5=Jp(5),P5=Jp(6),vJ=oc.range,c9e=If.range,u9e=M5.range,h9e=I5.range,f9e=iu.range,d9e=O5.range,p9e=P5.range;o(e0,"utcWeekday");t0=e0(0),Bg=e0(1),xJ=e0(2),bJ=e0(3),Of=e0(4),TJ=e0(5),wJ=e0(6),kJ=t0.range,m9e=Bg.range,g9e=xJ.range,y9e=bJ.range,v9e=Of.range,x9e=TJ.range,b9e=wJ.range});var xh,T9e,B5,w9e,A9=O(()=>{"use strict";gh();xh=In(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),T9e=xh.range,B5=In(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),w9e=B5.range});var zo,k9e,lc,E9e,_9=O(()=>{"use strict";gh();zo=In(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());zo.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:In(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});k9e=zo.range,lc=In(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());lc.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:In(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});E9e=lc.range});function SJ(t,e,r,n,i,a){let s=[[$o,1,1e3],[$o,5,5*1e3],[$o,15,15*1e3],[$o,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function l(h,f,d){let p=f{"use strict";Cf();T9();w9();k9();E9();S9();C9();A9();_9();o(SJ,"ticker");[C9e,A9e]=SJ(lc,B5,t0,N5,L5,R5),[D9,R9]=SJ(zo,xh,oc,gl,vh,yh)});var F5=O(()=>{"use strict";T9();w9();k9();E9();S9();C9();A9();_9();CJ()});function L9(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function N9(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function bx(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function M9(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,u=t.shortMonths,h=Tx(i),f=wx(i),d=Tx(a),p=wx(a),m=Tx(s),g=wx(s),y=Tx(l),v=wx(l),x=Tx(u),b=wx(u),T={a:P,A:B,b:F,B:G,c:null,d:NJ,e:NJ,f:K9e,g:sNe,G:lNe,H:Y9e,I:j9e,j:X9e,L:BJ,m:Q9e,M:Z9e,p:$,q:V,Q:OJ,s:PJ,S:J9e,u:eNe,U:tNe,V:rNe,w:nNe,W:iNe,x:null,X:null,y:aNe,Y:oNe,Z:cNe,"%":IJ},E={a:X,A:Q,b:H,B:ie,c:null,d:MJ,e:MJ,f:dNe,g:kNe,G:SNe,H:uNe,I:hNe,j:fNe,L:$J,m:pNe,M:mNe,p:Y,q:le,Q:OJ,s:PJ,S:gNe,u:yNe,U:vNe,V:xNe,w:bNe,W:TNe,x:null,X:null,y:wNe,Y:ENe,Z:CNe,"%":IJ},w={a:I,A:N,b:C,B:_,c:D,d:RJ,e:RJ,f:q9e,g:DJ,G:_J,H:LJ,I:LJ,j:$9e,L:V9e,m:F9e,M:z9e,p:L,q:B9e,Q:W9e,s:H9e,S:G9e,u:N9e,U:M9e,V:I9e,w:L9e,W:O9e,x:M,X:R,y:DJ,Y:_J,Z:P9e,"%":U9e};T.x=k(r,T),T.X=k(n,T),T.c=k(e,T),E.x=k(r,E),E.X=k(n,E),E.c=k(e,E);function k(ee,J){return function(te){var Z=[],xe=-1,de=0,Se=ee.length,Me,ke,we;for(te instanceof Date||(te=new Date(+te));++xe{"use strict";o1();Zg();o(ROe,"copyObject");kl=ROe});function LOe(t,e){for(var r=-1,n=Array(t);++r
"},r),st.lineBreakRegex.test(t)))return t;let n=t.split(" ").filter(Boolean),i=[],a="";return n.forEach((s,l)=>{let u=xa(`${s} `,r),h=xa(a,r);if(u>e){let{hyphenatedStrings:p,remainingWord:m}=vPe(s,e,"-",r);i.push(a,...p),a=m}else h+u>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");l+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),vPe=Xg((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);let i=[...t],a=[],s="";return i.forEach((l,u)=>{let h=`${s}${l}`;if(xa(h,n)>=e){let d=u+1,p=i.length===d,m=`${h}${r}`;a.push(p?h:m),s=""}else s=h}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);o(Ak,"calculateTextHeight");o(xa,"calculateTextWidth");IN=Xg((t,e)=>{let{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};let[,a]=Uo(r),s=["sans-serif",n],l=t.split(st.lineBreakRegex),u=[],h=je("body");if(!h.remove)return{width:0,height:0,lineHeight:0};let f=h.append("svg");for(let p of s){let m=0,g={width:0,height:0,lineHeight:0};for(let y of l){let v=gPe();v.text=y||AN;let x=yPe(f,v).style("font-size",a).style("font-weight",i).style("font-family",p),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),m=Math.round(b.height),g.height+=m,g.lineHeight=Math.round(Math.max(g.lineHeight,m))}u.push(g)}f.remove();let d=isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1;return u[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),CN=class{constructor(e=!1,r){this.count=0;this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{o(this,"InitIDGenerator")}},xPe=o(function(t){return Ck=Ck||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ck.innerHTML=t,unescape(Ck.textContent)},"entityDecode");o(ON,"isDetailedError");bPe=o((t,e,r,n)=>{if(!n)return;let i=t.node()?.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Uo=o(t=>{if(typeof t=="number")return[t,t+"px"];let e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");o(Pn,"cleanAndMerge");Xt={assignWithDepth:Vn,wrapLabel:MN,calculateTextHeight:Ak,calculateTextWidth:xa,calculateTextDimensions:IN,cleanAndMerge:Pn,detectInit:oPe,detectDirective:zre,isSubstringInArray:lPe,interpolateToCurve:_N,calcLabelPosition:fPe,calcCardinalityPosition:dPe,calcTerminalLabelPosition:pPe,formatUrl:cPe,getStylesFromArray:RN,generateId:LN,random:NN,runFunc:uPe,entityDecode:xPe,insertTitle:bPe,isLabelCoordinateInPath:TPe,parseFontSize:Uo,InitIDGenerator:CN},qre=o(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){let n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"\uFB02\xB0\xB0"+n+"\xB6\xDF":"\uFB02\xB0"+n+"\xB6\xDF"}),e},"encodeEntities"),ao=o(function(t){return t.replace(/๏ฌยฐยฐ/g,"").replace(/๏ฌยฐ/g,"&").replace(/ยถร/g,";")},"decodeEntities"),hu=o((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");o(Bn,"handleUndefinedAttr");o(TPe,"isLabelCoordinateInPath")});function gc(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=MN(e[t].text,i,n),e[t].textLines=e[t].text.split(st.lineBreakRegex).length,e[t].width=i,e[t].height=Ak(e[t].text,n);else{let a=e[t].text.split(st.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(let l of a)e[t].width=Math.max(xa(l,n),e[t].width),s=Ak(l,n),e[t].height=e[t].height+s}}function jre(t,e,r,n,i){let a=new Lk(i);a.data.widthLimit=r.data.widthLimit/Math.min(PN,n.length);for(let[s,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);let h=l.wrap&&Jt.wrap,f=_k(Jt);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",gc("label",l,h,f,a.data.widthLimit),l.label.Y=u+8,u=l.label.Y+l.label.height,l.type&&l.type.text!==""){l.type.text="["+l.type.text+"]";let g=_k(Jt);gc("type",l,h,g,a.data.widthLimit),l.type.Y=u+5,u=l.type.Y+l.type.height}if(l.descr&&l.descr.text!==""){let g=_k(Jt);g.fontSize=g.fontSize-2,gc("descr",l,h,g,a.data.widthLimit),l.descr.Y=u+20,u=l.descr.Y+l.descr.height}if(s==0||s%PN===0){let g=r.data.startx+Jt.diagramMarginX,y=r.data.stopy+Jt.diagramMarginY+u;a.setData(g,g,y,y)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Jt.diagramMarginX:a.data.startx,y=a.data.starty;a.setData(g,g,y,y)}a.name=l.alias;let d=i.db.getC4ShapeArray(l.alias),p=i.db.getC4ShapeKeys(l.alias);p.length>0&&Yre(a,t,d,p),e=l.alias;let m=i.db.getBoundaries(e);m.length>0&&jre(t,e,a,m,i),l.alias!=="global"&&Hre(t,l,a),r.data.stopy=Math.max(a.data.stopy+Jt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Jt.c4ShapeMargin,r.data.stopx),Dk=Math.max(Dk,r.data.stopx),Rk=Math.max(Rk,r.data.stopy)}}var Dk,Rk,Wre,PN,Jt,Lk,BN,Zx,_k,wPe,Hre,Yre,so,Ure,kPe,EPe,SPe,FN,Xre=O(()=>{"use strict";Ar();Uee();xt();TD();Ur();LD();jt();sg();ar();Ti();Dk=0,Rk=0,Wre=4,PN=2;F2.yy=U2;Jt={},Lk=class{static{o(this,"Bounds")}constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,BN(e.db.getConfig())}setData(e,r,n,i){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(e,r,n,i){e[r]===void 0?e[r]=n:e[r]=i(n,e[r])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let r=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+e.margin:this.nextData.stopx+e.margin*2,n=r+e.width,i=this.nextData.starty+e.margin*2,a=i+e.height;(r>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Wre)&&(r=this.nextData.startx+e.margin+Jt.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},BN(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},BN=o(function(t){Vn(Jt,t),t.fontFamily&&(Jt.personFontFamily=Jt.systemFontFamily=Jt.messageFontFamily=t.fontFamily),t.fontSize&&(Jt.personFontSize=Jt.systemFontSize=Jt.messageFontSize=t.fontSize),t.fontWeight&&(Jt.personFontWeight=Jt.systemFontWeight=Jt.messageFontWeight=t.fontWeight)},"setConf"),Zx=o((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),_k=o(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),wPe=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");o(gc,"calcC4ShapeTextWH");Hre=o(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Jt.c4ShapeMargin-35;let n=e.wrap&&Jt.wrap,i=_k(Jt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=xa(e.label.text,i);gc("label",e,n,i,a),dc.drawBoundary(t,e,Jt)},"drawBoundary"),Yre=o(function(t,e,r,n){let i=0;for(let a of n){i=0;let s=r[a],l=Zx(Jt,s.typeC4Shape.text);switch(l.fontSize=l.fontSize-2,s.typeC4Shape.width=xa("\xAB"+s.typeC4Shape.text+"\xBB",l),s.typeC4Shape.height=l.fontSize+2,s.typeC4Shape.Y=Jt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let u=s.wrap&&Jt.wrap,h=Jt.width-Jt.c4ShapePadding*2,f=Zx(Jt,s.typeC4Shape.text);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",gc("label",s,u,f,h),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let m=Zx(Jt,s.typeC4Shape.text);gc("type",s,u,m,h),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let m=Zx(Jt,s.techn.text);gc("techn",s,u,m,h),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,p=s.label.width;if(s.descr&&s.descr.text!==""){let m=Zx(Jt,s.typeC4Shape.text);gc("descr",s,u,m,h),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,p=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}p=p+Jt.c4ShapePadding,s.width=Math.max(s.width||Jt.width,p,Jt.width),s.height=Math.max(s.height||Jt.height,d,Jt.height),s.margin=s.margin||Jt.c4ShapeMargin,t.insert(s),dc.drawC4Shape(e,s,Jt)}t.bumpLastMargin(Jt.c4ShapeMargin)},"drawC4ShapeArray"),so=class{static{o(this,"Point")}constructor(e,r){this.x=e,this.y=r}},Ure=o(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,l=n+t.height/2,u=Math.abs(r-i),h=Math.abs(n-a),f=h/u,d=t.height/t.width,p=null;return n==a&&ri?p=new so(r,l):r==i&&na&&(p=new so(s,n)),r>i&&n=f?p=new so(r,l+f*t.width/2):p=new so(s-u/h*t.height/2,n+t.height):r=f?p=new so(r+t.width,l+f*t.width/2):p=new so(s+u/h*t.height/2,n+t.height):ra?d>=f?p=new so(r+t.width,l-f*t.width/2):p=new so(s+t.height/2*u/h,n):r>i&&n>a&&(d>=f?p=new so(r,l-t.width/2*f):p=new so(s-t.height/2*u/h,n)),p},"getIntersectPoint"),kPe=o(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Ure(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Ure(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),EPe=o(function(t,e,r,n){let i=0;for(let a of e){i=i+1;let s=a.wrap&&Jt.wrap,l=wPe(Jt);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=i+": "+a.label.text);let h=xa(a.label.text,l);gc("label",a,s,l,h),a.techn&&a.techn.text!==""&&(h=xa(a.techn.text,l),gc("techn",a,s,l,h)),a.descr&&a.descr.text!==""&&(h=xa(a.descr.text,l),gc("descr",a,s,l,h));let f=r(a.from),d=r(a.to),p=kPe(f,d);a.startPoint=p.startPoint,a.endPoint=p.endPoint}dc.drawRels(t,e,Jt)},"drawRels");o(jre,"drawInsideBoundary");SPe=o(function(t,e,r,n){Jt=ve().c4;let i=ve().securityLevel,a;i==="sandbox"&&(a=je("#i"+e));let s=i==="sandbox"?je(a.nodes()[0].contentDocument.body):je("body"),l=n.db;n.db.setWrap(Jt.wrap),Wre=l.getC4ShapeInRow(),PN=l.getC4BoundaryInRow(),K.debug(`C:${JSON.stringify(Jt,null,2)}`);let u=i==="sandbox"?s.select(`[id="${e}"]`):je(`[id="${e}"]`);dc.insertComputerIcon(u),dc.insertDatabaseIcon(u),dc.insertClockIcon(u);let h=new Lk(n);h.setData(Jt.diagramMarginX,Jt.diagramMarginX,Jt.diagramMarginY,Jt.diagramMarginY),h.data.widthLimit=screen.availWidth,Dk=Jt.diagramMarginX,Rk=Jt.diagramMarginY;let f=n.db.getTitle(),d=n.db.getBoundaries("");jre(u,"",h,d,n),dc.insertArrowHead(u),dc.insertArrowEnd(u),dc.insertArrowCrossHead(u),dc.insertArrowFilledHead(u),EPe(u,n.db.getRels(),n.db.getC4Shape,n),h.data.stopx=Dk,h.data.stopy=Rk;let p=h.data,g=p.stopy-p.starty+2*Jt.diagramMarginY,v=p.stopx-p.startx+2*Jt.diagramMarginX;f&&u.append("text").text(f).attr("x",(p.stopx-p.startx)/2-4*Jt.diagramMarginX).attr("y",p.starty+Jt.diagramMarginY),Zr(u,g,v,Jt.useMaxWidth);let x=f?60:0;u.attr("viewBox",p.startx-Jt.diagramMarginX+" -"+(Jt.diagramMarginY+x)+" "+v+" "+(g+x)),K.debug("models:",p)},"draw"),FN={drawPersonOrSystemArray:Yre,drawBoundary:Hre,setConf:BN,draw:SPe}});var CPe,Kre,Qre=O(()=>{"use strict";CPe=o(t=>`.person {
stroke: ${t.personBorder};
fill: ${t.personBkg};
}
`,"getStyles"),Kre=CPe});var Zre={};vr(Zre,{diagram:()=>APe});var APe,Jre=O(()=>{"use strict";TD();LD();Xre();Qre();APe={parser:EX,db:U2,renderer:FN,styles:Kre,init:o(({c4:t,wrap:e})=>{FN.setConf(t),U2.setWrap(e)},"init")}});function gne(t){return typeof t>"u"||t===null}function LPe(t){return typeof t=="object"&&t!==null}function NPe(t){return Array.isArray(t)?t:gne(t)?[]:[t]}function MPe(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;r"u"&&Sh(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}function pne(t,e,r,n){var i="",a=t.tag,s,l,u;for(s=0,l=r.length;s tag resolver accepts not "'+u+'" style');t.dump=n}return!0}return!1}function Sh(t,e,r,n,i,a,s){t.tag=null,t.dump=r,mne(t,r,!1)||mne(t,r,!0);var l=Nne.call(t.dump),u=n,h;n&&(n=t.flowLevel<0||t.flowLevel>e);var f=l==="[object Object]"||l==="[object Array]",d,p;if(f&&(d=t.duplicates.indexOf(r),p=d!==-1),(t.tag!==null&&t.tag!=="?"||p||t.indent!==2&&e>0)&&(i=!1),p&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(f&&p&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(YFe(t,e,t.dump,i),p&&(t.dump="&ref_"+d+t.dump)):(HFe(t,e,t.dump),p&&(t.dump="&ref_"+d+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?pne(t,e-1,t.dump,i):pne(t,e,t.dump,i),p&&(t.dump="&ref_"+d+t.dump)):(WFe(t,e,t.dump),p&&(t.dump="&ref_"+d+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&VFe(t,t.dump,e,a,u);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new oo("unacceptable kind of an object to dump "+l)}t.tag!==null&&t.tag!=="?"&&(h=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",t.dump=h+" "+t.dump)}return!0}function jFe(t,e){var r=[],n=[],i,a;for(HN(t,r,n),i=0,a=n.length;i{"use strict";o(gne,"isNothing");o(LPe,"isObject");o(NPe,"toArray");o(MPe,"extend");o(IPe,"repeat");o(OPe,"isNegativeZero");PPe=gne,BPe=LPe,FPe=NPe,$Pe=IPe,zPe=OPe,GPe=MPe,ra={isNothing:PPe,isObject:BPe,toArray:FPe,repeat:$Pe,isNegativeZero:zPe,extend:GPe};o(yne,"formatError");o(eb,"YAMLException$1");eb.prototype=Object.create(Error.prototype);eb.prototype.constructor=eb;eb.prototype.toString=o(function(e){return this.name+": "+yne(this,e)},"toString");oo=eb;o($N,"getLine");o(zN,"padStart");o(VPe,"makeSnippet");qPe=VPe,UPe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],WPe=["scalar","sequence","mapping"];o(HPe,"compileStyleAliases");o(YPe,"Type$1");es=YPe;o(tne,"compileList");o(jPe,"compileMap");o(VN,"Schema$1");VN.prototype.extend=o(function(e){var r=[],n=[];if(e instanceof es)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new oo("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(a){if(!(a instanceof es))throw new oo("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new oo("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new oo("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(a){if(!(a instanceof es))throw new oo("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(VN.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=tne(i,"implicit"),i.compiledExplicit=tne(i,"explicit"),i.compiledTypeMap=jPe(i.compiledImplicit,i.compiledExplicit),i},"extend");XPe=VN,KPe=new es("tag:yaml.org,2002:str",{kind:"scalar",construct:o(function(t){return t!==null?t:""},"construct")}),QPe=new es("tag:yaml.org,2002:seq",{kind:"sequence",construct:o(function(t){return t!==null?t:[]},"construct")}),ZPe=new es("tag:yaml.org,2002:map",{kind:"mapping",construct:o(function(t){return t!==null?t:{}},"construct")}),JPe=new XPe({explicit:[KPe,QPe,ZPe]});o(eBe,"resolveYamlNull");o(tBe,"constructYamlNull");o(rBe,"isNull");nBe=new es("tag:yaml.org,2002:null",{kind:"scalar",resolve:eBe,construct:tBe,predicate:rBe,represent:{canonical:o(function(){return"~"},"canonical"),lowercase:o(function(){return"null"},"lowercase"),uppercase:o(function(){return"NULL"},"uppercase"),camelcase:o(function(){return"Null"},"camelcase"),empty:o(function(){return""},"empty")},defaultStyle:"lowercase"});o(iBe,"resolveYamlBoolean");o(aBe,"constructYamlBoolean");o(sBe,"isBoolean");oBe=new es("tag:yaml.org,2002:bool",{kind:"scalar",resolve:iBe,construct:aBe,predicate:sBe,represent:{lowercase:o(function(t){return t?"true":"false"},"lowercase"),uppercase:o(function(t){return t?"TRUE":"FALSE"},"uppercase"),camelcase:o(function(t){return t?"True":"False"},"camelcase")},defaultStyle:"lowercase"});o(lBe,"isHexCode");o(cBe,"isOctCode");o(uBe,"isDecCode");o(hBe,"resolveYamlInteger");o(fBe,"constructYamlInteger");o(dBe,"isInteger");pBe=new es("tag:yaml.org,2002:int",{kind:"scalar",resolve:hBe,construct:fBe,predicate:dBe,represent:{binary:o(function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:o(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:o(function(t){return t.toString(10)},"decimal"),hexadecimal:o(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),mBe=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");o(gBe,"resolveYamlFloat");o(yBe,"constructYamlFloat");vBe=/^[-+]?[0-9]+e/;o(xBe,"representYamlFloat");o(bBe,"isFloat");TBe=new es("tag:yaml.org,2002:float",{kind:"scalar",resolve:gBe,construct:yBe,predicate:bBe,represent:xBe,defaultStyle:"lowercase"}),vne=JPe.extend({implicit:[nBe,oBe,pBe,TBe]}),wBe=vne,xne=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),bne=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");o(kBe,"resolveYamlTimestamp");o(EBe,"constructYamlTimestamp");o(SBe,"representYamlTimestamp");CBe=new es("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:kBe,construct:EBe,instanceOf:Date,represent:SBe});o(ABe,"resolveYamlMerge");_Be=new es("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ABe}),YN=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;o(DBe,"resolveYamlBinary");o(RBe,"constructYamlBinary");o(LBe,"representYamlBinary");o(NBe,"isBinary");MBe=new es("tag:yaml.org,2002:binary",{kind:"scalar",resolve:DBe,construct:RBe,predicate:NBe,represent:LBe}),IBe=Object.prototype.hasOwnProperty,OBe=Object.prototype.toString;o(PBe,"resolveYamlOmap");o(BBe,"constructYamlOmap");FBe=new es("tag:yaml.org,2002:omap",{kind:"sequence",resolve:PBe,construct:BBe}),$Be=Object.prototype.toString;o(zBe,"resolveYamlPairs");o(GBe,"constructYamlPairs");VBe=new es("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:zBe,construct:GBe}),qBe=Object.prototype.hasOwnProperty;o(UBe,"resolveYamlSet");o(WBe,"constructYamlSet");HBe=new es("tag:yaml.org,2002:set",{kind:"mapping",resolve:UBe,construct:WBe}),Tne=wBe.extend({implicit:[CBe,_Be],explicit:[MBe,FBe,VBe,HBe]}),jf=Object.prototype.hasOwnProperty,Nk=1,wne=2,kne=3,Mk=4,GN=1,YBe=2,rne=3,jBe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,XBe=/[\x85\u2028\u2029]/,KBe=/[,\[\]\{\}]/,Ene=/^(?:!|!!|![a-z\-]+!)$/i,Sne=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;o(nne,"_class");o(fu,"is_EOL");o(p0,"is_WHITE_SPACE");o(lo,"is_WS_OR_EOL");o(u1,"is_FLOW_INDICATOR");o(QBe,"fromHexCode");o(ZBe,"escapedHexLen");o(JBe,"fromDecimalCode");o(ine,"simpleEscapeSequence");o(eFe,"charFromCodepoint");o(Cne,"setProperty");Ane=new Array(256),_ne=new Array(256);for(d0=0;d0<256;d0++)Ane[d0]=ine(d0)?1:0,_ne[d0]=ine(d0);o(tFe,"State$1");o(Dne,"generateError");o(sr,"throwError");o(Ik,"throwWarning");ane={YAML:o(function(e,r,n){var i,a,s;e.version!==null&&sr(e,"duplication of %YAML directive"),n.length!==1&&sr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&sr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&sr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&Ik(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:o(function(e,r,n){var i,a;n.length!==2&&sr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],Ene.test(i)||sr(e,"ill-formed tag handle (first argument) of the TAG directive"),jf.call(e.tagMap,i)&&sr(e,'there is a previously declared suffix for "'+i+'" tag handle'),Sne.test(a)||sr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{sr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};o(Yf,"captureSegment");o(sne,"mergeMappings");o(h1,"storeMappingPair");o(jN,"readLineBreak");o(qi,"skipSeparationSpace");o(Bk,"testDocumentSeparator");o(XN,"writeFoldedLines");o(rFe,"readPlainScalar");o(nFe,"readSingleQuotedScalar");o(iFe,"readDoubleQuotedScalar");o(aFe,"readFlowCollection");o(sFe,"readBlockScalar");o(one,"readBlockSequence");o(oFe,"readBlockMapping");o(lFe,"readTagProperty");o(cFe,"readAnchorProperty");o(uFe,"readAlias");o(f1,"composeNode");o(hFe,"readDocument");o(Rne,"loadDocuments");o(fFe,"loadAll$1");o(dFe,"load$1");pFe=fFe,mFe=dFe,Lne={loadAll:pFe,load:mFe},Nne=Object.prototype.toString,Mne=Object.prototype.hasOwnProperty,KN=65279,gFe=9,tb=10,yFe=13,vFe=32,xFe=33,bFe=34,qN=35,TFe=37,wFe=38,kFe=39,EFe=42,Ine=44,SFe=45,Ok=58,CFe=61,AFe=62,_Fe=63,DFe=64,One=91,Pne=93,RFe=96,Bne=123,LFe=124,Fne=125,ts={};ts[0]="\\0";ts[7]="\\a";ts[8]="\\b";ts[9]="\\t";ts[10]="\\n";ts[11]="\\v";ts[12]="\\f";ts[13]="\\r";ts[27]="\\e";ts[34]='\\"';ts[92]="\\\\";ts[133]="\\N";ts[160]="\\_";ts[8232]="\\L";ts[8233]="\\P";NFe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],MFe=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;o(IFe,"compileStyleMap");o(OFe,"encodeHex");PFe=1,rb=2;o(BFe,"State");o(lne,"indentString");o(UN,"generateNextLine");o(FFe,"testImplicitResolving");o(Pk,"isWhitespace");o(nb,"isPrintable");o(cne,"isNsCharOrWhitespace");o(une,"isPlainSafe");o($Fe,"isPlainSafeFirst");o(zFe,"isPlainSafeLast");o(Jx,"codePointAt");o($ne,"needIndentIndicator");zne=1,WN=2,Gne=3,Vne=4,c1=5;o(GFe,"chooseScalarStyle");o(VFe,"writeScalar");o(hne,"blockHeader");o(fne,"dropEndingNewline");o(qFe,"foldString");o(dne,"foldLine");o(UFe,"escapeString");o(WFe,"writeFlowSequence");o(pne,"writeBlockSequence");o(HFe,"writeFlowMapping");o(YFe,"writeBlockMapping");o(mne,"detectType");o(Sh,"writeNode");o(jFe,"getDuplicateReferences");o(HN,"inspectNode");o(XFe,"dump$1");KFe=XFe,QFe={dump:KFe};o(QN,"renamed");Xf=vne,Kf=Lne.load,EMt=Lne.loadAll,SMt=QFe.dump,CMt=QN("safeLoad","load"),AMt=QN("safeLoadAll","loadAll"),_Mt=QN("safeDump","dump")});function tM(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function jne(t){g0=t}function bn(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:o((i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Ds.caret,"$1"),r=r.replace(i,s),n},"replace"),getRegex:o(()=>new RegExp(r,e),"getRegex")};return n}function du(t,e){if(e){if(Ds.escapeTest.test(t))return t.replace(Ds.escapeReplace,Une)}else if(Ds.escapeTestNoEncode.test(t))return t.replace(Ds.escapeReplaceNoEncode,Une);return t}function Wne(t){try{t=encodeURI(t).replace(Ds.percentDecode,"%")}catch{return null}return t}function Hne(t,e){let r=t.replace(Ds.findPipe,(a,s,l)=>{let u=!1,h=s;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Ds.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length
`:"'+(r?i:du(i,!0))+`
`}blockquote({tokens:t}){return`"+(r?i:du(i,!0))+`
${this.parser.parse(t)}
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`
`}list(t){let e=t.ordered,r=t.start,n="";for(let s=0;s
`+e+`
`+n+`
`}tablerow({text:t}){return`
${t}
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`${r}>
`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${du(t,!0)}`}br(t){return"
"}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:r}){let n=this.parser.parseInline(r),i=Wne(t);if(i===null)return n;t=i;let a='"+n+"",a}image({href:t,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let i=Wne(t);if(i===null)return du(r);t=i;let a=`",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:du(t.text)}},cM=class{static{o(this,"$")}strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ah=class eM{static{o(this,"l")}options;renderer;textRenderer;constructor(e){this.options=e||g0,this.options.renderer=this.options.renderer||new Vk,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cM}static parse(e,r){return new eM(r).parse(e)}static parseInline(e,r){return new eM(r).parseInline(e)}parse(e,r=!0){let n="";for(let i=0;i
"+du(r.message+"",!0)+"
";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},m0=new M$e;o(yn,"d");yn.options=yn.setOptions=function(t){return m0.setOptions(t),yn.defaults=m0.defaults,jne(yn.defaults),yn};yn.getDefaults=tM;yn.defaults=g0;yn.use=function(...t){return m0.use(...t),yn.defaults=m0.defaults,jne(yn.defaults),yn};yn.walkTokens=function(t,e){return m0.walkTokens(t,e)};yn.parseInline=m0.parseInline;yn.Parser=Ah;yn.parser=Ah.parse;yn.Renderer=Vk;yn.TextRenderer=cM;yn.Lexer=Ch;yn.lexer=Ch.lex;yn.Tokenizer=Gk;yn.Hooks=ob;yn.parse=yn;RMt=yn.options,LMt=yn.setOptions,NMt=yn.use,MMt=yn.walkTokens,IMt=yn.parseInline,OMt=Ah.parse,PMt=Ch.lex});function I$e(t,{markdownAutoWrap:e}){let n=t.replace(/
/g,`
`).replace(/\n{2,}/g,`
`);return Mw(n)}function sie(t){return t.split(/\\n|\n|
/gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}function oie(t,e={}){let r=I$e(t,e),n=yn.lexer(r),i=[[]],a=0;function s(l,u="normal"){l.type==="text"?l.text.split(`
`).forEach((f,d)=>{d!==0&&(a++,i.push([])),f.split(" ").forEach(p=>{p=p.replace(/'/g,"'"),p&&i[a].push({content:p,type:u})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(h=>{s(h,l.type)}):l.type==="html"&&i[a].push({content:l.text,type:"normal"})}return o(s,"processNode"),n.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(u=>{s(u)}):l.type==="html"?i[a].push({content:l.text,type:"normal"}):i[a].push({content:l.raw,type:"normal"})}),i}function lie(t){return t?`
")}
").replace(/ /g," "):i.text.replace(/\n */g,"
"):i.type==="strong"?`${i.tokens?.map(n).join("")}`:i.type==="em"?`${i.tokens?.map(n).join("")}`:i.type==="paragraph"?`
/g,"
"),p=s?oie(d.replace("
","
"),f):sie(d),m=$$e(u,t,p,e?h:!1,!l);if(l){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");je(m).attr("style",g)}else{let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");je(m).select("rect").attr("style",g.replace(/background:/g,"fill:"));let y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");je(m).select("text").attr("style",y)}return n?je(m).selectAll("tspan.text-outer-tspan").classed("title-row",!0):je(m).selectAll("tspan.text-outer-tspan").classed("row",!0),m}},"createText")});async function Wk(t,e){let r=t.getElementsByTagName("img");if(!r||r.length===0)return;let n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){let l=ve().fontSize?ve().fontSize:window.getComputedStyle(document.body).fontSize,u=5,[h=gr.fontSize]=Uo(l),f=h*u+"px";i.style.minWidth=f,i.style.maxWidth=f}else i.style.width="100%";a(i)}o(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}var dM=O(()=>{"use strict";jt();La();ar();o(Wk,"configureLabelImages")});function er(t){let e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}function El(t,e,r,n,i,a){let s=[],u=r-t,h=n-e,f=u/a,d=2*Math.PI/f,p=e+h/2;for(let m=0;m<=50;m++){let g=m/50,y=t+g*u,v=p+i*Math.sin(d*(y-t));s.push({x:y,y:v})}return s}function y0(t,e,r,n,i,a){let s=[],l=i*Math.PI/180,f=(a*Math.PI/180-l)/(n-1);for(let d=0;d
"):p,e.labelStyle,!0,!0),y=g.children[0],v=je(g);d=y.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);let x=(e.padding||0)/2;je(g).attr("transform","translate( "+(d.width>m.width?0:(m.width-d.width)/2)+", "+(m.height+x+5)+")"),je(f).attr("transform","translate( "+(d.width
").length,d.innerHTML.includes("")&&(f+=d.innerHTML.split("]*>/g,"").trim()==="";await Promise.all([...m].map(y=>new Promise(v=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",g){let b=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,E=parseInt(b,10)*5+"px";y.style.minWidth=E,y.style.maxWidth=E}else y.style.width="100%";v(y)}o(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}h=d.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}else{n.includes("font-weight: bolder")&&je(u).selectAll("tspan").attr("font-weight",""),f=u.children.length;let d=u.children[0];(u.textContent===""||u.textContent.includes(">"))&&(d.textContent=l[0]+l.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),l[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),h=u.getBBox()}return i.attr("transform","translate(0,"+(-h.height/(2*f)+r)+")"),h.height}var Hse=O(()=>{"use strict";Ar();$r();$t();ar();jt();co();Ur();o(Wse,"textHelper");o(aE,"addText")});async function Yse(t,e){let r=ve(),n=r.class.padding??12,i=n,a=e.useHtmlLabels??Xs(r.htmlLabels)??!0,s=e;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];let{shapeSvg:l,bbox:u}=await Wse(t,e,r,a,i),{labelStyles:h,nodeStyles:f}=Ze(e);e.labelStyle=h,e.cssStyles=s.styles||"";let d=s.styles?.join(";")||f||"";e.cssStyles||(e.cssStyles=d.replaceAll("!important","").split(";"));let p=s.members.length===0&&s.methods.length===0&&!r.class?.hideEmptyMembersBox,m=Je.svg(l),g=nt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=u.width,v=u.height;s.members.length===0&&s.methods.length===0?v+=i:s.members.length>0&&s.methods.length===0&&(v+=i*2);let x=-y/2,b=-v/2,T=m.rectangle(x-n,b-n-(p?n:s.members.length===0&&s.methods.length===0?-n/2:0),y+2*n,v+2*n+(p?n*2:s.members.length===0&&s.methods.length===0?-n:0),g),E=l.insert(()=>T,":first-child");E.attr("class","basic label-container");let w=E.node().getBBox();l.selectAll(".text").each((L,I,N)=>{let C=je(N[I]),_=C.attr("transform"),D=0;if(_){let B=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(_);B&&(D=parseFloat(B[2]))}let M=D+b+n-(p?n:s.members.length===0&&s.methods.length===0?-n/2:0);a||(M-=4);let R=x;(C.attr("class").includes("label-group")||C.attr("class").includes("annotation-group"))&&(R=-C.node()?.getBBox().width/2||0,l.selectAll("text").each(function(P,B,F){window.getComputedStyle(F[B]).textAnchor==="middle"&&(R=0)})),C.attr("transform",`translate(${R}, ${M})`)});let k=l.select(".annotation-group").node().getBBox().height-(p?n/2:0)||0,S=l.select(".label-group").node().getBBox().height-(p?n/2:0)||0,A=l.select(".members-group").node().getBBox().height-(p?n/2:0)||0;if(s.members.length>0||s.methods.length>0||p){let L=m.line(w.x,k+S+b+n,w.x+w.width,k+S+b+n,g);l.insert(()=>L).attr("class","divider").attr("style",d)}if(p||s.members.length>0||s.methods.length>0){let L=m.line(w.x,k+S+A+b+i*2+n,w.x+w.width,k+S+A+b+n+i*2,g);l.insert(()=>L).attr("class","divider").attr("style",d)}if(s.look!=="handDrawn"&&l.selectAll("path").attr("style",d),E.select(":nth-child(2)").attr("style",d),l.selectAll(".divider").select("path").attr("style",d),e.labelStyle?l.selectAll("span").attr("style",e.labelStyle):l.selectAll("span").attr("style",d),!a){let L=RegExp(/color\s*:\s*([^;]*)/),I=L.exec(d);if(I){let N=I[0].replace("color","fill");l.selectAll("tspan").attr("style",N)}else if(h){let N=L.exec(h);if(N){let C=N[0].replace("color","fill");l.selectAll("tspan").attr("style",C)}}}return rt(e,E),e.intersect=function(L){return Qe.rect(e,L)},l}var jse=O(()=>{"use strict";$t();jt();Ar();Wt();Ut();Yt();Hse();Ur();o(Yse,"classBox")});async function Xse(t,e){let{labelStyles:r,nodeStyles:n}=Ze(e);e.labelStyle=r;let i=e,a=e,s=20,l=20,u="verifyMethod"in e,h=ht(e),f=t.insert("g").attr("class",h).attr("id",e.domId??e.id),d;u?d=await Rh(f,`<<${i.type}>>`,0,e.labelStyle):d=await Rh(f,"<<Element>>",0,e.labelStyle);let p=d,m=await Rh(f,i.name,p,e.labelStyle+"; font-weight: bold;");if(p+=m+l,u){let k=await Rh(f,`${i.requirementId?`ID: ${i.requirementId}`:""}`,p,e.labelStyle);p+=k;let S=await Rh(f,`${i.text?`Text: ${i.text}`:""}`,p,e.labelStyle);p+=S;let A=await Rh(f,`${i.risk?`Risk: ${i.risk}`:""}`,p,e.labelStyle);p+=A,await Rh(f,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,p,e.labelStyle)}else{let k=await Rh(f,`${a.type?`Type: ${a.type}`:""}`,p,e.labelStyle);p+=k,await Rh(f,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,p,e.labelStyle)}let g=(f.node()?.getBBox().width??200)+s,y=(f.node()?.getBBox().height??200)+s,v=-g/2,x=-y/2,b=Je.svg(f),T=nt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let E=b.rectangle(v,x,g,y,T),w=f.insert(()=>E,":first-child");if(w.attr("class","basic label-container").attr("style",n),f.selectAll(".label").each((k,S,A)=>{let L=je(A[S]),I=L.attr("transform"),N=0,C=0;if(I){let R=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);R&&(N=parseFloat(R[1]),C=parseFloat(R[2]))}let _=C-y/2,D=v+s/2;(S===0||S===1)&&(D=N),L.attr("transform",`translate(${D}, ${_+s})`)}),p>d+m+l){let k=b.line(v,x+d+m+l,v+g,x+d+m+l,T);f.insert(()=>k).attr("style",n)}return rt(e,w),e.intersect=function(k){return Qe.rect(e,k)},f}async function Rh(t,e,r,n=""){if(e==="")return 0;let i=t.insert("g").attr("class","label").attr("style",n),a=ve(),s=a.htmlLabels??!0,l=await Fn(i,G2(ao(e)),{width:xa(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a),u;if(s){let h=l.children[0],f=je(l);u=h.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{let h=l.children[0];for(let f of h.children)f.textContent=f.textContent.replaceAll(">",">").replaceAll("<","<"),n&&f.setAttribute("style",n);u=l.getBBox(),u.height+=6}return i.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}var Kse=O(()=>{"use strict";$t();Yt();Ut();Wt();ar();jt();co();Ar();o(Xse,"requirementBox");o(Rh,"addText")});async function Qse(t,e,{config:r}){let{labelStyles:n,nodeStyles:i}=Ze(e);e.labelStyle=n||"";let a=10,s=e.width;e.width=(e.width??200)-10;let{shapeSvg:l,bbox:u,label:h}=await pt(t,e,ht(e)),f=e.padding||10,d="",p;"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),p=l.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));let m={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1},g,y;p?{label:g,bbox:y}=await Hk(p,"ticket"in e&&e.ticket||"",m):{label:g,bbox:y}=await Hk(l,"ticket"in e&&e.ticket||"",m);let{label:v,bbox:x}=await Hk(l,"assigned"in e&&e.assigned||"",m);e.width=s;let b=10,T=e?.width||0,E=Math.max(y.height,x.height)/2,w=Math.max(u.height+b*2,e?.height||0)+E,k=-T/2,S=-w/2;h.attr("transform","translate("+(f-T/2)+", "+(-E-u.height/2)+")"),g.attr("transform","translate("+(f-T/2)+", "+(-E+u.height/2)+")"),v.attr("transform","translate("+(f+T/2-x.width-2*a)+", "+(-E+u.height/2)+")");let A,{rx:L,ry:I}=e,{cssStyles:N}=e;if(e.look==="handDrawn"){let C=Je.svg(l),_=nt(e,{}),D=L||I?C.path(ho(k,S,T,w,L||0),_):C.rectangle(k,S,T,w,_);A=l.insert(()=>D,":first-child"),A.attr("class","basic label-container").attr("style",N||null)}else{A=l.insert("rect",":first-child"),A.attr("class","basic label-container __APA__").attr("style",i).attr("rx",L??5).attr("ry",I??5).attr("x",k).attr("y",S).attr("width",T).attr("height",w);let C="priority"in e&&e.priority;if(C){let _=l.append("line"),D=k+2,M=S+Math.floor((L??0)/2),R=S+w-Math.floor((L??0)/2);_.attr("x1",D).attr("y1",M).attr("x2",D).attr("y2",R).attr("stroke-width","4").attr("stroke",gze(C))}}return rt(e,A),e.height=w,e.intersect=function(C){return Qe.rect(e,C)},l}var gze,Zse=O(()=>{"use strict";$t();Yt();x0();Ut();Wt();gze=o(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");o(Qse,"kanbanItem")});async function Jse(t,e){let{labelStyles:r,nodeStyles:n}=Ze(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s,label:l}=await pt(t,e,ht(e)),u=a.width+10*s,h=a.height+8*s,f=.15*u,{cssStyles:d}=e,p=a.width+20,m=a.height+20,g=Math.max(u,p),y=Math.max(h,m);l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let v,x=`M0 0
a${f},${f} 1 0,0 ${g*.25},${-1*y*.1}
a${f},${f} 1 0,0 ${g*.25},0
a${f},${f} 1 0,0 ${g*.25},0
a${f},${f} 1 0,0 ${g*.25},${y*.1}
a${f},${f} 1 0,0 ${g*.15},${y*.33}
a${f*.8},${f*.8} 1 0,0 0,${y*.34}
a${f},${f} 1 0,0 ${-1*g*.15},${y*.33}
a${f},${f} 1 0,0 ${-1*g*.25},${y*.15}
a${f},${f} 1 0,0 ${-1*g*.25},0
a${f},${f} 1 0,0 ${-1*g*.25},0
a${f},${f} 1 0,0 ${-1*g*.25},${-1*y*.15}
a${f},${f} 1 0,0 ${-1*g*.1},${-1*y*.33}
a${f*.8},${f*.8} 1 0,0 0,${-1*y*.34}
a${f},${f} 1 0,0 ${g*.1},${-1*y*.33}
H0 V0 Z`;if(e.look==="handDrawn"){let b=Je.svg(i),T=nt(e,{}),E=b.path(x,T);v=i.insert(()=>E,":first-child"),v.attr("class","basic label-container").attr("style",Bn(d))}else v=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",x);return v.attr("transform",`translate(${-g/2}, ${-y/2})`),rt(e,v),e.calcIntersect=function(b,T){return Qe.rect(b,T)},e.intersect=function(b){return K.info("Bang intersect",e,b),Qe.rect(e,b)},i}var eoe=O(()=>{"use strict";xt();$t();Yt();Ut();Wt();ar();o(Jse,"bang")});async function toe(t,e){let{labelStyles:r,nodeStyles:n}=Ze(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s,label:l}=await pt(t,e,ht(e)),u=a.width+2*s,h=a.height+2*s,f=.15*u,d=.25*u,p=.35*u,m=.2*u,{cssStyles:g}=e,y,v=`M0 0
a${f},${f} 0 0,1 ${u*.25},${-1*u*.1}
a${p},${p} 1 0,1 ${u*.4},${-1*u*.1}
a${d},${d} 1 0,1 ${u*.35},${u*.2}
a${f},${f} 1 0,1 ${u*.15},${h*.35}
a${m},${m} 1 0,1 ${-1*u*.15},${h*.65}
a${d},${f} 1 0,1 ${-1*u*.25},${u*.15}
a${p},${p} 1 0,1 ${-1*u*.5},0
a${f},${f} 1 0,1 ${-1*u*.25},${-1*u*.15}
a${f},${f} 1 0,1 ${-1*u*.1},${-1*h*.35}
a${m},${m} 1 0,1 ${u*.1},${-1*h*.65}
H0 V0 Z`;if(e.look==="handDrawn"){let x=Je.svg(i),b=nt(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Bn(g))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),y.attr("transform",`translate(${-u/2}, ${-h/2})`),rt(e,y),e.calcIntersect=function(x,b){return Qe.rect(x,b)},e.intersect=function(x){return K.info("Cloud intersect",e,x),Qe.rect(e,x)},i}var roe=O(()=>{"use strict";Wt();xt();ar();Yt();Ut();$t();o(toe,"cloud")});async function noe(t,e){let{labelStyles:r,nodeStyles:n}=Ze(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s,label:l}=await pt(t,e,ht(e)),u=a.width+8*s,h=a.height+2*s,f=5,d=`
M${-u/2} ${h/2-f}
v${-h+2*f}
q0,-${f} ${f},-${f}
h${u-2*f}
q${f},0 ${f},${f}
v${h-2*f}
q0,${f} -${f},${f}
h${-u+2*f}
q-${f},0 -${f},-${f}
Z
`,p=i.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-u/2).attr("y1",h/2).attr("x2",u/2).attr("y2",h/2),l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>l.node()),rt(e,p),e.calcIntersect=function(m,g){return Qe.rect(m,g)},e.intersect=function(m){return Qe.rect(e,m)},i}var ioe=O(()=>{"use strict";Yt();Ut();$t();o(noe,"defaultMindmapNode")});async function aoe(t,e){let r={padding:e.padding??0};return nE(t,e,r)}var soe=O(()=>{"use strict";MM();o(aoe,"mindmapCircle")});function ooe(t){return t in OM}var yze,vze,OM,PM=O(()=>{"use strict";Vie();Wie();Yie();Xie();MM();Qie();Jie();tae();nae();aae();oae();cae();hae();dae();mae();yae();xae();Tae();kae();Sae();Aae();Dae();Lae();Mae();Oae();Bae();$ae();Gae();qae();Wae();Yae();Xae();Qae();Jae();tse();nse();ase();ose();cse();hse();dse();mse();yse();xse();Tse();kse();Sse();Ase();Dse();Lse();Mse();Ose();Bse();$se();Gse();qse();Use();jse();Kse();Zse();eoe();roe();ioe();soe();yze=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:fse},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:sse},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:pse},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:wse},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:sae},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:nE},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Jse},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:toe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:ese},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:bae},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:zae},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Fae},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Nse},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Iae},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:uae},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:_se},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Hie},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:lse},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:bse},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:vse},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:gae},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:wae},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Zie},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:eae},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:rae},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Vae},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Fse},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:vae},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Rse},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Uae},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:iae},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:lae},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Pse},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Vse},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:fae},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Ise},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:pae},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:use},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Kae},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:jae},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Uie},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Kie},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Cse},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Ese},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:zse},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:rse},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Hae}],vze=o(()=>{let e=[...Object.entries({state:gse,choice:jie,note:Zae,rectWithTitle:ise,labelRect:Pae,iconSquare:Rae,iconCircle:Cae,icon:Eae,iconRounded:_ae,imageSquare:Nae,anchor:Gie,kanbanItem:Qse,mindmapCircle:aoe,defaultMindmapNode:noe,classBox:Yse,erBox:IM,requirementBox:Xse}),...yze.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),OM=vze();o(ooe,"isValidShape")});var xze,sE,loe=O(()=>{"use strict";Ar();ib();jt();xt();PM();ar();Ur();si();a0();S2();xze="flowchart-",sE=class{constructor(){this.vertexCounter=0;this.config=ve();this.vertices=new Map;this.edges=[];this.classes=new Map;this.subGraphs=[];this.subGraphLookup=new Map;this.tooltips=new Map;this.subCount=0;this.firstGraphFlag=!0;this.secCount=-1;this.posCrossRef=[];this.funs=[];this.setAccTitle=Lr;this.setAccDescription=Pr;this.setDiagramTitle=zr;this.getAccTitle=Or;this.getAccDescription=Br;this.getDiagramTitle=Fr;this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{o(this,"FlowDB")}sanitizeText(e){return st.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return r.domId;return e}addVertex(e,r,n,i,a,s,l={},u){if(!e||e.trim().length===0)return;let h;if(u!==void 0){let m;u.includes(`
`)?m=u+`
`:m=`{
`+u+`
}`,h=Kf(m,{schema:Xf})}let f=this.edges.find(m=>m.id===e);if(f){let m=h;m?.animate!==void 0&&(f.animate=m.animate),m?.animation!==void 0&&(f.animation=m.animation),m?.curve!==void 0&&(f.interpolate=m.curve);return}let d,p=this.vertices.get(e);if(p===void 0&&(p={id:e,labelType:"text",domId:xze+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,r!==void 0?(this.config=ve(),d=this.sanitizeText(r.text.trim()),p.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),p.text=d):p.text===void 0&&(p.text=e),n!==void 0&&(p.type=n),i?.forEach(m=>{p.styles.push(m)}),a?.forEach(m=>{p.classes.push(m)}),s!==void 0&&(p.dir=s),p.props===void 0?p.props=l:l!==void 0&&Object.assign(p.props,l),h!==void 0){if(h.shape){if(h.shape!==h.shape.toLowerCase()||h.shape.includes("_"))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);if(!ooe(h.shape))throw new Error(`No such shape: ${h.shape}.`);p.type=h?.shape}h?.label&&(p.text=h?.label,p.labelType=this.sanitizeNodeLabelType(h?.labelType)),h?.icon&&(p.icon=h?.icon,!h.label?.trim()&&p.text===e&&(p.text="")),h?.form&&(p.form=h?.form),h?.pos&&(p.pos=h?.pos),h?.img&&(p.img=h?.img,!h.label?.trim()&&p.text===e&&(p.text="")),h?.constraint&&(p.constraint=h.constraint),h.w&&(p.assetWidth=Number(h.w)),h.h&&(p.assetHeight=Number(h.h))}}addSingleLink(e,r,n,i){let l={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};K.info("abc78 Got edge...",l);let u=n.text;if(u!==void 0&&(l.text=this.sanitizeText(u.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(u.type)),n!==void 0&&(l.type=n.type,l.stroke=n.stroke,l.length=n.length>10?10:n.length),i&&!this.edges.some(h=>h.id===i))l.id=i,l.isUserDefinedId=!0;else{let h=this.edges.filter(f=>f.start===l.start&&f.end===l.end);h.length===0?l.id=hu(l.start,l.end,{counter:0,prefix:"L"}):l.id=hu(l.start,l.end,{counter:h.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))K.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
Initialize mermaid with maxEdges set to a higher number to allow more edges.
You cannot set this config via configuration inside the diagram as it is a secure config.
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){let i=this.isLinkData(n)?n.id.replace("@",""):void 0;K.info("addLink",e,r,i);for(let a of e)for(let s of r){let l=a===e[e.length-1],u=s===r[0];l&&u?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some(i=>i?.startsWith("fill"))&&this.edges[n]?.style?.push("fill:none"))})}addClass(e,r){let n=r.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/ยงยงยง/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n?.forEach(s=>{if(/color/.exec(s)){let l=s.replace("fill","bgFill");a.textStyles.push(l)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(let n of e.split(",")){let i=this.vertices.get(n);i&&i.classes.push(r);let a=this.edges.find(l=>l.id===n);a&&a.classes.push(r);let s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(let n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){let i=this.lookUpDomId(e);if(ve().securityLevel!=="loose"||r===void 0)return;let a=[];if(typeof n=="string"){a=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l
0&&r(l)?e>1?Joe(l,e-1,r,n,i):E1(i,l):n||(i[i.length]=l)}return i}var vu,S1=O(()=>{"use strict";CE();Zoe();o(Joe,"baseFlatten");vu=Joe});function HGe(t){var e=t==null?0:t.length;return e?vu(t,1):[]}var fn,AE=O(()=>{"use strict";S1();o(HGe,"flatten");fn=HGe});function YGe(t){return Ek(kk(t,void 0,fn),t+"")}var ele,tle=O(()=>{"use strict";AE();TN();kN();o(YGe,"flatRest");ele=YGe});function jGe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n{"use strict";o(jGe,"baseSlice");_E=jGe});function nVe(t){return rVe.test(t)}var XGe,KGe,QGe,ZGe,JGe,eVe,tVe,rVe,rle,nle=O(()=>{"use strict";XGe="\\ud800-\\udfff",KGe="\\u0300-\\u036f",QGe="\\ufe20-\\ufe2f",ZGe="\\u20d0-\\u20ff",JGe=KGe+QGe+ZGe,eVe="\\ufe0e\\ufe0f",tVe="\\u200d",rVe=RegExp("["+tVe+XGe+JGe+eVe+"]");o(nVe,"hasUnicode");rle=nVe});function iVe(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i{"use strict";o(iVe,"arrayReduce");ile=iVe});function aVe(t,e){return t&&kl(e,nn(e),t)}var sle,ole=O(()=>{"use strict";h0();gu();o(aVe,"baseAssign");sle=aVe});function sVe(t,e){return t&&kl(e,no(e),t)}var lle,cle=O(()=>{"use strict";h0();Wf();o(sVe,"baseAssignIn");lle=sVe});function oVe(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r