0&&(l.style.minWidth=Ki(h)),l},"stretchySvg"),R6n=i(function(t,a,o,l,h){var f,p=t.height+t.depth+o+l;if(/fbox|color|angl/.test(a)){if(f=Di(["stretchy",a],[],h),a==="fbox"){var m=h.color&&h.getColor();m&&(f.style.borderColor=m)}}else{var b=[];/^[bx]cancel$/.test(a)&&b.push(new Tee({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(a)&&b.push(new Tee({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var v=new J3(b,{width:"100%",height:Ki(p)});f=uL([],[v],h)}return f.height=p,f.style.height=Ki(p),f},"stretchyEnclose"),L6n={bin:1,close:1,inner:1,open:1,punct:1,rel:1},D6n={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};i(_6n,"isAtom");i(vl,"assertNodeType");i(tbe,"assertSymbolNodeType");i(rbe,"checkSymbolNodeType");Lor=i(r=>{if(r instanceof yb)return r;if(i6n(r)&&r.children.length===1)return Lor(r.children[0])},"getBaseSymbol"),Nqe=i((r,t)=>{var a,o,l;r&&r.type==="supsub"?(o=vl(r.base,"accent"),a=o.base,r.base=a,l=n6n(wu(r,t)),r.base=o):(o=vl(r,"accent"),a=o.base);var h=wu(a,t.havingCrampedStyle()),f=o.isShifty&&H6(a),p=0;if(f){var m,b;p=(m=(b=Lor(h))==null?void 0:b.skew)!=null?m:0}var v=o.label==="\\c",T=v?h.height+h.depth:Math.min(h.height,t.fontMetrics().xHeight),C;if(o.isStretchy)C=ebe(o,t),C=vu({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"elem",elem:C,wrapperClasses:["svg-align"],wrapperStyle:p>0?{width:"calc(100% - "+Ki(2*p)+")",marginLeft:Ki(2*p)}:void 0}]});else{var E,S;o.label==="\\vec"?(E=kor("vec",t),S=Tor.vec[1]):(E=Jye({type:"textord",mode:o.mode,text:o.label},t,"textord"),E=r6n(E),E.italic=0,S=E.width,v&&(T+=E.depth)),C=Di(["accent-body"],[E]);var R=o.label==="\\textcircled";R&&(C.classes.push("accent-full"),T=h.height);var L=p;R||(L-=S/2),C.style.left=Ki(L),o.label==="\\textcircled"&&(C.style.top=".2em"),C=vu({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:-T},{type:"elem",elem:C}]})}var _=Di(["mord","accent"],[C],t);return l?(l.children[0]=_,l.height=Math.max(_.height,l.height),l.classes[0]="mord",l):_},"htmlBuilder$a"),Dor=i((r,t)=>{var a=r.isStretchy?Zye(r.label):new Fi("mo",[GT(r.label,r.mode)]),o=new Fi("mover",[$h(r.base,t),a]);return o.setAttribute("accent","true"),o},"mathmlBuilder$9"),M6n=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));Ca({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:i((r,t)=>{var a=qye(t[0]),o=!M6n.test(r.funcName),l=!o||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:o,isShifty:l,base:a}},"handler"),htmlBuilder:Nqe,mathmlBuilder:Dor});Ca({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:i((r,t)=>{var a=t[0],o=r.parser.mode;return o==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),o="text"),{type:"accent",mode:o,label:r.funcName,isStretchy:!1,isShifty:!0,base:a}},"handler"),htmlBuilder:Nqe,mathmlBuilder:Dor});Ca({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:i((r,t)=>{var{parser:a,funcName:o}=r,l=t[0];return{type:"accentUnder",mode:a.mode,label:o,base:l}},"handler"),htmlBuilder:i((r,t)=>{var a=wu(r.base,t),o=ebe(r,t),l=r.label==="\\utilde"?.12:0,h=vu({positionType:"top",positionData:a.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:l},{type:"elem",elem:a}]});return Di(["mord","accentunder"],[h],t)},"htmlBuilder"),mathmlBuilder:i((r,t)=>{var a=Zye(r.label),o=new Fi("munder",[$h(r.base,t),a]);return o.setAttribute("accentunder","true"),o},"mathmlBuilder")});Pye=i(r=>{var t=new Fi("mpadded",r?[r]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t},"paddedNode");Ca({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,t,a){var{parser:o,funcName:l}=r;return{type:"xArrow",mode:o.mode,label:l,body:t[0],below:a[0]}},htmlBuilder(r,t){var a=t.style,o=t.havingStyle(a.sup()),l=qj(wu(r.body,o,t),t),h=r.label.slice(0,2)==="\\x"?"x":"cd";l.classes.push(h+"-arrow-pad");var f;r.below&&(o=t.havingStyle(a.sub()),f=qj(wu(r.below,o,t),t),f.classes.push(h+"-arrow-pad"));var p=ebe(r,t),m=-t.fontMetrics().axisHeight+.5*p.height,b=-t.fontMetrics().axisHeight-.5*p.height-.111;(l.depth>.25||r.label==="\\xleftequilibrium")&&(b-=l.depth);var v;if(f){var T=-t.fontMetrics().axisHeight+f.height+.5*p.height+.111;v=vu({positionType:"individualShift",children:[{type:"elem",elem:l,shift:b},{type:"elem",elem:p,shift:m,wrapperClasses:["svg-align"]},{type:"elem",elem:f,shift:T}]})}else v=vu({positionType:"individualShift",children:[{type:"elem",elem:l,shift:b},{type:"elem",elem:p,shift:m,wrapperClasses:["svg-align"]}]});return Di(["mrel","x-arrow"],[v],t)},mathmlBuilder(r,t){var a=Zye(r.label);a.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var o;if(r.body){var l=Pye($h(r.body,t));if(r.below){var h=Pye($h(r.below,t));o=new Fi("munderover",[a,h,l])}else o=new Fi("mover",[a,l])}else if(r.below){var f=Pye($h(r.below,t));o=new Fi("munder",[a,f])}else o=Pye(),o=new Fi("mover",[a,o]);return o}});i(_or,"htmlBuilder$9");i(Mor,"mathmlBuilder$8");Ca({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,t){var{parser:a,funcName:o}=r,l=t[0];return{type:"mclass",mode:a.mode,mclass:"m"+o.slice(5),body:Ag(l),isCharacterBox:H6(l)}},htmlBuilder:_or,mathmlBuilder:Mor});nbe=i(r=>{var t=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"},"binrelClass");Ca({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,t){var{parser:a}=r;return{type:"mclass",mode:a.mode,mclass:nbe(t[0]),body:Ag(t[1]),isCharacterBox:H6(t[1])}}});Ca({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,t){var{parser:a,funcName:o}=r,l=t[1],h=t[0],f;o!=="\\stackrel"?f=nbe(l):f="mrel";var p={type:"op",mode:l.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:o!=="\\stackrel",body:Ag(l)},m={type:"supsub",mode:h.mode,base:p,sup:o==="\\underset"?null:h,sub:o==="\\underset"?h:null};return{type:"mclass",mode:a.mode,mclass:f,body:[m],isCharacterBox:H6(m)}},htmlBuilder:_or,mathmlBuilder:Mor});Ca({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,t){var{parser:a}=r;return{type:"pmb",mode:a.mode,mclass:nbe(t[0]),body:Ag(t[0])}},htmlBuilder(r,t){var a=p0(r.body,t,!0),o=Di([r.mclass],a,t);return o.style.textShadow="0.02em 0.01em 0.04px",o},mathmlBuilder(r,t){var a=Ow(r.body,t),o=new Fi("mstyle",a);return o.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),o}});I6n={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Hsr=i(()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),"newCell"),qsr=i(r=>r.type==="textord"&&r.text==="@","isStartOfArrow"),N6n=i((r,t)=>(r.type==="mathord"||r.type==="atom")&&r.text===t,"isLabelEnd");i(O6n,"cdArrow");i(P6n,"parseCD");Ca({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,t){var{parser:a,funcName:o}=r;return{type:"cdlabel",mode:a.mode,side:o.slice(4),label:t[0]}},htmlBuilder(r,t){var a=t.havingStyle(t.style.sup()),o=qj(wu(r.label,a,t),t);return o.classes.push("cd-label-"+r.side),o.style.bottom=Ki(.8-o.depth),o.height=0,o.depth=0,o},mathmlBuilder(r,t){var a=new Fi("mrow",[$h(r.label,t)]);return a=new Fi("mpadded",[a]),a.setAttribute("width","0"),r.side==="left"&&a.setAttribute("lspace","-1width"),a.setAttribute("voffset","0.7em"),a=new Fi("mstyle",[a]),a.setAttribute("displaystyle","false"),a.setAttribute("scriptlevel","1"),a}});Ca({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,t){var{parser:a}=r;return{type:"cdlabelparent",mode:a.mode,fragment:t[0]}},htmlBuilder(r,t){var a=qj(wu(r.fragment,t),t);return a.classes.push("cd-vert-arrow"),a},mathmlBuilder(r,t){return new Fi("mrow",[$h(r.fragment,t)])}});Ca({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,t){for(var{parser:a}=r,o=vl(t[0],"ordgroup"),l=o.body,h="",f=0;f 0?S=3*C:S=7*C,R=t.fontMetrics().denom1):(T>0?(E=t.fontMetrics().num2,S=C):(E=t.fontMetrics().num3,S=3*C),R=t.fontMetrics().denom2);var L;if(v){var M=t.fontMetrics().axisHeight;E-f.depth-(M+.5*T) 0))return[];if(r===t)return[r];let o=t {"use strict";b8n=Math.sqrt(50),v8n=Math.sqrt(10),w8n=Math.sqrt(2);i(xbe,"tickSpec");i(Tbe,"ticks");i(Oee,"tickIncrement");i(ez,"tickStep")});function kbe(r,t){let a;if(t===void 0)for(let o of r)o!=null&&(a {"use strict";Yv();i(K7n,"tweenRemove");i(X7n,"tweenFunction");i(GYe,"default");i(fz,"tweenValue")});function rte(r,t){var a;return(typeof t=="number"?dm:t instanceof a4?DN:(a=a4(t))?(t=a,DN):cz)(r,t)}var jYe=ie(()=>{"use strict";oz();uz();i(rte,"default")});function Q7n(r){return function(){this.removeAttribute(r)}}function J7n(r){return function(){this.removeAttributeNS(r.space,r.local)}}function Z7n(r,t,a){var o,l=a+"",h;return function(){var f=this.getAttribute(r);return f===l?null:f===o?h:h=t(o=f,a)}}function eRn(r,t,a){var o,l=a+"",h;return function(){var f=this.getAttributeNS(r.space,r.local);return f===l?null:f===o?h:h=t(o=f,a)}}function tRn(r,t,a){var o,l,h;return function(){var f,p=a(this),m;return p==null?void this.removeAttribute(r):(f=this.getAttribute(r),m=p+"",f===m?null:f===o&&m===l?h:(l=m,h=t(o=f,p)))}}function rRn(r,t,a){var o,l,h;return function(){var f,p=a(this),m;return p==null?void this.removeAttributeNS(r.space,r.local):(f=this.getAttributeNS(r.space,r.local),m=p+"",f===m?null:f===o&&m===l?h:(l=m,h=t(o=f,p)))}}function zYe(r,t){var a=GE(r),o=a==="transform"?OYe:rte;return this.attrTween(r,typeof t=="function"?(a.local?rRn:tRn)(a,o,fz(this,"attr."+r,t)):t==null?(a.local?J7n:Q7n)(a):(a.local?eRn:Z7n)(a,o,t))}var Fur=ie(()=>{"use strict";uz();n4();tte();jYe();i(Q7n,"attrRemove");i(J7n,"attrRemoveNS");i(Z7n,"attrConstant");i(eRn,"attrConstantNS");i(tRn,"attrFunction");i(rRn,"attrFunctionNS");i(zYe,"default")});function nRn(r,t){return function(a){this.setAttribute(r,t.call(this,a))}}function iRn(r,t){return function(a){this.setAttributeNS(r.space,r.local,t.call(this,a))}}function aRn(r,t){var a,o;function l(){var h=t.apply(this,arguments);return h!==o&&(a=(o=h)&&iRn(r,h)),a}return i(l,"tween"),l._value=t,l}function sRn(r,t){var a,o;function l(){var h=t.apply(this,arguments);return h!==o&&(a=(o=h)&&nRn(r,h)),a}return i(l,"tween"),l._value=t,l}function UYe(r,t){var a="attr."+r;if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;var o=GE(r);return this.tween(a,(o.local?aRn:sRn)(o,t))}var $ur=ie(()=>{"use strict";n4();i(nRn,"attrInterpolate");i(iRn,"attrInterpolateNS");i(aRn,"attrTweenNS");i(sRn,"attrTween");i(UYe,"default")});function oRn(r,t){return function(){Zee(this,r).delay=+t.apply(this,arguments)}}function lRn(r,t){return t=+t,function(){Zee(this,r).delay=t}}function VYe(r){var t=this._id;return arguments.length?this.each((typeof r=="function"?oRn:lRn)(t,r)):g0(this.node(),t).delay}var Gur=ie(()=>{"use strict";Yv();i(oRn,"delayFunction");i(lRn,"delayConstant");i(VYe,"default")});function cRn(r,t){return function(){o1(this,r).duration=+t.apply(this,arguments)}}function uRn(r,t){return t=+t,function(){o1(this,r).duration=t}}function HYe(r){var t=this._id;return arguments.length?this.each((typeof r=="function"?cRn:uRn)(t,r)):g0(this.node(),t).duration}var jur=ie(()=>{"use strict";Yv();i(cRn,"durationFunction");i(uRn,"durationConstant");i(HYe,"default")});function hRn(r,t){if(typeof t!="function")throw new Error;return function(){o1(this,r).ease=t}}function qYe(r){var t=this._id;return arguments.length?this.each(hRn(t,r)):g0(this.node(),t).ease}var zur=ie(()=>{"use strict";Yv();i(hRn,"easeConstant");i(qYe,"default")});function fRn(r,t){return function(){var a=t.apply(this,arguments);if(typeof a!="function")throw new Error;o1(this,r).ease=a}}function WYe(r){if(typeof r!="function")throw new Error;return this.each(fRn(this._id,r))}var Uur=ie(()=>{"use strict";Yv();i(fRn,"easeVarying");i(WYe,"default")});function YYe(r){typeof r!="function"&&(r=rz(r));for(var t=this._groups,a=t.length,o=new Array(a),l=0;l{"use strict";n4();MN();i(YYe,"default")});function KYe(r){if(r._id!==this._id)throw new Error;for(var t=this._groups,a=r._groups,o=t.length,l=a.length,h=Math.min(o,l),f=new Array(o),p=0;p {"use strict";i(RKe,"default")});function LKe(r,t){let a=-1;for(let o of this)if(r.call(t,o,++a,this))return o}var zhr=ie(()=>{"use strict";i(LKe,"default")});function DKe(r){return this.eachAfter(function(t){for(var a=+r(t.data)||0,o=t.children,l=o&&o.length;--l>=0;)a+=o[l].value;t.value=a})}var Uhr=ie(()=>{"use strict";i(DKe,"default")});function _Ke(r){return this.eachBefore(function(t){t.children&&t.children.sort(r)})}var Vhr=ie(()=>{"use strict";i(_Ke,"default")});function MKe(r){for(var t=this,a=ORn(t,r),o=[t];t!==a;)t=t.parent,o.push(t);for(var l=o.length;r!==a;)o.splice(l,0,r),r=r.parent;return o}function ORn(r,t){if(r===t)return r;var a=r.ancestors(),o=t.ancestors(),l=null;for(r=a.pop(),t=o.pop();r===t;)l=r,r=a.pop(),t=o.pop();return l}var Hhr=ie(()=>{"use strict";i(MKe,"default");i(ORn,"leastCommonAncestor")});function IKe(){for(var r=this,t=[r];r=r.parent;)t.push(r);return t}var qhr=ie(()=>{"use strict";i(IKe,"default")});function NKe(){return Array.from(this)}var Whr=ie(()=>{"use strict";i(NKe,"default")});function OKe(){var r=[];return this.eachBefore(function(t){t.children||r.push(t)}),r}var Yhr=ie(()=>{"use strict";i(OKe,"default")});function PKe(){var r=this,t=[];return r.each(function(a){a!==r&&t.push({source:a.parent,target:a})}),t}var Khr=ie(()=>{"use strict";i(PKe,"default")});function*BKe(){var r=this,t,a=[r],o,l,h;do for(t=a.reverse(),a=[];r=t.pop();)if(yield r,o=r.children)for(l=0,h=o.length;l {"use strict";bve();hXe();qKe();ste();mfr();i(vDn,"date");i(wDn,"number");i(Yfr,"calendar");i(vve,"time")});var Xfr=ie(()=>{"use strict";ufr();gfr();zKe();Kfr()});function fXe(r){for(var t=r.length/6|0,a=new Array(t),o=0;o ${this.parser.parseInline(r)} An error occurred: ${r.replace(/\\n|\n/g," ${l.tokens?.map(o).join("")} 2*Math.PI&&(G=0,V=2*Math.PI);let Y=(V-G)/M.curveStepCount,K=[];for(let J=G;J<=V;J+=Y)K.push([I+O*Math.cos(J),F+P*Math.sin(J)]);return K.push([I+O*Math.cos(V),F+P*Math.sin(V)]),K.push([I,F]),Lz([K],M)})(t,a,o,l,h,f,b));return b.stroke!==zw&&v.push(T),this._d("arc",v,b)}curve(t,a){let o=this._o(a),l=[],h=xgr(t,o);if(o.fill&&o.fill!==zw)if(o.fillStyle==="solid"){let f=xgr(t,Object.assign(Object.assign({},o),{disableMultiStroke:!0,roughness:o.roughness?o.roughness+o.fillShapeRoughnessGain:0}));l.push({type:"fillPath",ops:this._mergedShape(f.ops)})}else{let f=[],p=t;if(p.length){let m=typeof p[0][0]=="number"?[p]:p;for(let b of m)b.length<3?f.push(...b):b.length===3?f.push(...bQe(Agr([b[0],b[0],b[1],b[2]]),10,(1+o.roughness)/2)):f.push(...bQe(Agr(b),10,(1+o.roughness)/2))}f.length&&l.push(Lz([f],o))}return o.stroke!==zw&&l.push(h),this._d("curve",l,o)}polygon(t,a){let o=this._o(a),l=[],h=x2e(t,!0,o);return o.fill&&(o.fillStyle==="solid"?l.push(yQe([t],o)):l.push(Lz([t],o))),o.stroke!==zw&&l.push(h),this._d("polygon",l,o)}path(t,a){let o=this._o(a),l=[];if(!t)return this._d("path",l,o);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let h=o.fill&&o.fill!=="transparent"&&o.fill!==zw,f=o.stroke!==zw,p=!!(o.simplification&&o.simplification<1),m=(function(v,T,C){let E=Lgr(Rgr(DQe(v))),S=[],R=[],L=[0,0],_=[],M=i(()=>{_.length>=4&&R.push(...bQe(_,T)),_=[]},"i"),I=i(()=>{M(),R.length&&(S.push(R),R=[])},"c");for(let{key:O,data:P}of E)switch(O){case"M":I(),L=[P[0],P[1]],R.push(L);break;case"L":M(),R.push([P[0],P[1]]);break;case"C":if(!_.length){let G=R.length?R[R.length-1]:L;_.push([G[0],G[1]])}_.push([P[0],P[1]]),_.push([P[2],P[3]]),_.push([P[4],P[5]]);break;case"Z":M(),R.push([L[0],L[1]])}if(I(),!C)return S;let F=[];for(let O of S){let P=dMn(O,C);P.length&&F.push(P)}return F})(t,1,p?4-4*(o.simplification||1):(1+o.roughness)/2),b=kgr(t,o);if(h)if(o.fillStyle==="solid")if(m.length===1){let v=kgr(t,Object.assign(Object.assign({},o),{disableMultiStroke:!0,roughness:o.roughness?o.roughness+o.fillShapeRoughnessGain:0}));l.push({type:"fillPath",ops:this._mergedShape(v.ops)})}else l.push(yQe(m,o));else l.push(Lz(m,o));return f&&(p?m.forEach((v=>{l.push(x2e(v,!1,o))})):l.push(b)),this._d("path",l,o)}opsToPath(t,a){let o="";for(let l of t.ops){let h=typeof a=="number"&&a>=0?l.data.map((f=>+f.toFixed(a))):l.data;switch(l.op){case"move":o+=`M${h[0]} ${h[1]} `;break;case"bcurveTo":o+=`C${h[0]} ${h[1]}, ${h[2]} ${h[3]}, ${h[4]} ${h[5]} `;break;case"lineTo":o+=`L${h[0]} ${h[1]} `}}return o.trim()}toPaths(t){let a=t.sets||[],o=t.options||this.defaultOptions,l=[];for(let h of a){let f=null;switch(h.type){case"path":f={d:this.opsToPath(h),stroke:o.stroke,strokeWidth:o.strokeWidth,fill:zw};break;case"fillPath":f={d:this.opsToPath(h),stroke:zw,strokeWidth:0,fill:o.fill||zw};break;case"fillSketch":f=this.fillSketch(h,o)}f&&l.push(f)}return l}fillSketch(t,a){let o=a.fillWeight;return o<0&&(o=a.strokeWidth/2),{d:this.opsToPath(t),stroke:a.fill||zw,strokeWidth:o,fill:zw}}_mergedShape(t){return t.filter(((a,o)=>o===0||a.op!=="move"))}},RQe=class{static{i(this,"st")}constructor(t,a){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Dz(a)}draw(t){let a=t.sets||[],o=t.options||this.getDefaultOptions(),l=this.ctx,h=t.options.fixedDecimalPlaceDigits;for(let f of a)switch(f.type){case"path":l.save(),l.strokeStyle=o.stroke==="none"?"transparent":o.stroke,l.lineWidth=o.strokeWidth,o.strokeLineDash&&l.setLineDash(o.strokeLineDash),o.strokeLineDashOffset&&(l.lineDashOffset=o.strokeLineDashOffset),this._drawToContext(l,f,h),l.restore();break;case"fillPath":{l.save(),l.fillStyle=o.fill||"";let p=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(l,f,h,p),l.restore();break}case"fillSketch":this.fillSketch(l,f,o)}}fillSketch(t,a,o){let l=o.fillWeight;l<0&&(l=o.strokeWidth/2),t.save(),o.fillLineDash&&t.setLineDash(o.fillLineDash),o.fillLineDashOffset&&(t.lineDashOffset=o.fillLineDashOffset),t.strokeStyle=o.fill||"",t.lineWidth=l,this._drawToContext(t,a,o.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,a,o,l="nonzero"){t.beginPath();for(let h of a.ops){let f=typeof o=="number"&&o>=0?h.data.map((p=>+p.toFixed(o))):h.data;switch(h.op){case"move":t.moveTo(f[0],f[1]);break;case"bcurveTo":t.bezierCurveTo(f[0],f[1],f[2],f[3],f[4],f[5]);break;case"lineTo":t.lineTo(f[0],f[1])}}a.type==="fillPath"?t.fill(l):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,a,o,l,h){let f=this.gen.line(t,a,o,l,h);return this.draw(f),f}rectangle(t,a,o,l,h){let f=this.gen.rectangle(t,a,o,l,h);return this.draw(f),f}ellipse(t,a,o,l,h){let f=this.gen.ellipse(t,a,o,l,h);return this.draw(f),f}circle(t,a,o,l){let h=this.gen.circle(t,a,o,l);return this.draw(h),h}linearPath(t,a){let o=this.gen.linearPath(t,a);return this.draw(o),o}polygon(t,a){let o=this.gen.polygon(t,a);return this.draw(o),o}arc(t,a,o,l,h,f,p=!1,m){let b=this.gen.arc(t,a,o,l,h,f,p,m);return this.draw(b),b}curve(t,a){let o=this.gen.curve(t,a);return this.draw(o),o}path(t,a){let o=this.gen.path(t,a);return this.draw(o),o}},w2e="http://www.w3.org/2000/svg",LQe=class{static{i(this,"ot")}constructor(t,a){this.svg=t,this.gen=new Dz(a)}draw(t){let a=t.sets||[],o=t.options||this.getDefaultOptions(),l=this.svg.ownerDocument||window.document,h=l.createElementNS(w2e,"g"),f=t.options.fixedDecimalPlaceDigits;for(let p of a){let m=null;switch(p.type){case"path":m=l.createElementNS(w2e,"path"),m.setAttribute("d",this.opsToPath(p,f)),m.setAttribute("stroke",o.stroke),m.setAttribute("stroke-width",o.strokeWidth+""),m.setAttribute("fill","none"),o.strokeLineDash&&m.setAttribute("stroke-dasharray",o.strokeLineDash.join(" ").trim()),o.strokeLineDashOffset&&m.setAttribute("stroke-dashoffset",`${o.strokeLineDashOffset}`);break;case"fillPath":m=l.createElementNS(w2e,"path"),m.setAttribute("d",this.opsToPath(p,f)),m.setAttribute("stroke","none"),m.setAttribute("stroke-width","0"),m.setAttribute("fill",o.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||m.setAttribute("fill-rule","evenodd");break;case"fillSketch":m=this.fillSketch(l,p,o)}m&&h.appendChild(m)}return h}fillSketch(t,a,o){let l=o.fillWeight;l<0&&(l=o.strokeWidth/2);let h=t.createElementNS(w2e,"path");return h.setAttribute("d",this.opsToPath(a,o.fixedDecimalPlaceDigits)),h.setAttribute("stroke",o.fill||""),h.setAttribute("stroke-width",l+""),h.setAttribute("fill","none"),o.fillLineDash&&h.setAttribute("stroke-dasharray",o.fillLineDash.join(" ").trim()),o.fillLineDashOffset&&h.setAttribute("stroke-dashoffset",`${o.fillLineDashOffset}`),h}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,a){return this.gen.opsToPath(t,a)}line(t,a,o,l,h){let f=this.gen.line(t,a,o,l,h);return this.draw(f)}rectangle(t,a,o,l,h){let f=this.gen.rectangle(t,a,o,l,h);return this.draw(f)}ellipse(t,a,o,l,h){let f=this.gen.ellipse(t,a,o,l,h);return this.draw(f)}circle(t,a,o,l){let h=this.gen.circle(t,a,o,l);return this.draw(h)}linearPath(t,a){let o=this.gen.linearPath(t,a);return this.draw(o)}polygon(t,a){let o=this.gen.polygon(t,a);return this.draw(o)}arc(t,a,o,l,h,f,p=!1,m){let b=this.gen.arc(t,a,o,l,h,f,p,m);return this.draw(b)}curve(t,a){let o=this.gen.curve(t,a);return this.draw(o)}path(t,a){let o=this.gen.path(t,a);return this.draw(o)}},Kr={canvas:i((r,t)=>new RQe(r,t),"canvas"),svg:i((r,t)=>new LQe(r,t),"svg"),generator:i(r=>new Dz(r),"generator"),newSeed:i(()=>Dz.newSeed(),"newSeed")}});function Ngr(r,t){let{labelStyles:a}=tn(t);t.labelStyle=a;let o=Nn(t),l=o;o||(l="anchor");let h=r.insert("g").attr("class",l).attr("id",t.domId||t.id),f=1,{cssStyles:p}=t,m=Kr.svg(h),b=nn(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(b.roughness=0);let v=m.circle(0,0,f*2,b),T=h.insert(()=>v,":first-child");return T.attr("class","anchor").attr("style",Ac(p)),un(t,T),t.intersect=function(C){return Pe.info("Circle intersect",t,f,C),Vr.circle(t,f,C)},h}var Ogr=ie(()=>{"use strict";Xn();na();wa();da();ba();Ia();i(Ngr,"anchor")});function Pgr(r,t,a,o,l,h,f){let m=(r+a)/2,b=(t+o)/2,v=Math.atan2(o-t,a-r),T=(a-r)/2,C=(o-t)/2,E=T/l,S=C/h,R=Math.sqrt(E**2+S**2);if(R>1)throw new Error("The given radii are too small to create an arc between the points.");let L=Math.sqrt(1-R**2),_=m+L*h*Math.sin(v)*(f?-1:1),M=b-L*l*Math.cos(v)*(f?-1:1),I=Math.atan2((t-M)/h,(r-_)/l),O=Math.atan2((o-M)/h,(a-_)/l)-I;f&&O<0&&(O+=2*Math.PI),!f&&O>0&&(O-=2*Math.PI);let P=[];for(let G=0;G<20;G++){let V=G/19,Y=I+V*O,K=_+l*Math.cos(Y),J=M+h*Math.sin(Y);P.push({x:K,y:J})}return P}function pMn(r,t,a){let[o,l]=[t,a].sort((h,f)=>f-h);return l*(1-Math.sqrt(1-(r/o/2)**2))}async function Bgr(r,t){let{labelStyles:a,nodeStyles:o}=tn(t);t.labelStyle=a;let l=t.padding??0,h=t.look==="neo"?16:l,f=t.look==="neo"?12:l,p=i(Y=>Y+f,"calcTotalHeight"),m=i(Y=>{let K=Y/2;return[K/(2.5+Y/50),K]},"calcEllipseRadius"),{shapeSvg:b,bbox:v}=await In(r,t,Nn(t)),T=p(t?.height?t?.height:v.height),[C,E]=m(T),S=pMn(T,C,E),L=(t?.width?t?.width:v.width)+h*2+S-S,_=T,{cssStyles:M}=t,I=[{x:L/2,y:-_/2},{x:-L/2,y:-_/2},...Pgr(-L/2,-_/2,-L/2,_/2,C,E,!1),{x:L/2,y:_/2},...Pgr(L/2,_/2,L/2,-_/2,C,E,!0)],F=Kr.svg(b),O=nn(t,{});t.look!=="handDrawn"&&(O.roughness=0,O.fillStyle="solid");let P=ps(I),G=F.path(P,O),V=b.insert(()=>G,":first-child");return V.attr("class","basic label-container outer-path"),M&&t.look!=="handDrawn"&&V.selectAll("path").attr("style",M),o&&t.look!=="handDrawn"&&V.selectAll("path").attr("style",o),V.attr("transform",`translate(${C/2}, 0)`),un(t,V),t.intersect=function(Y){return Vr.polygon(t,I,Y)},b}var Fgr=ie(()=>{"use strict";na();wa();da();ba();i(Pgr,"generateArcPoints");i(pMn,"calculateArcSagitta");i(Bgr,"bowTieRect")});async function $gr(r,t,{config:{themeVariables:a}}){let{labelStyles:o,nodeStyles:l}=tn(t);t.labelStyle=o;let{shapeSvg:h,bbox:f,label:p}=await In(r,t,Nn(t)),m=a?.nodeBorder??a?.lineColor??"currentColor",b=t.padding??12,v=Math.max(f.width+b*2,t.width??0,80),T=Math.max(Math.min(v*.08,12),5),C=Math.max(f.height+b*2+T,t.height??0),E=-C/2+T,S=C/2,R=v*.72,L=[`M${-v/2},${E}`,`L${-R/2},${S}`,`A${R/2},${T} 0 0 0 ${R/2},${S}`,`L${v/2},${E}`,`A${v/2},${T} 0 0 0 ${-v/2},${E}`,"Z"].join(" "),{cssStyles:_}=t,M=h.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let V=Kr.svg(h).path(L,nn(t,{}));M.node()?.appendChild(V),_&&M.attr("style",_)}else M.append("path").attr("d",L).attr("style",l);M.append("ellipse").attr("cx",0).attr("cy",E).attr("rx",v/2).attr("ry",T).attr("style",`fill:none;stroke:${m};stroke-width:1px`),un(t,M);let I=E+(S-E)/2;p.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${I-f.height/2-(f.y-(f.top??0))})`);let F=12,O=i((G,V,Y)=>Array.from({length:F+1},(K,J)=>{let H=Math.PI-J*Math.PI/F;return{x:G*Math.cos(H),y:V+Y*T*Math.sin(H)}}),"arc"),P=[...O(v/2,E,-1),...O(R/2,S,1).reverse()];return t.intersect=function(G){return Vr.polygon(t,P,G)},h}var Ggr=ie(()=>{"use strict";na();wa();da();ba();i($gr,"bucket")});var Md,d4=ie(()=>{"use strict";Md=i((r,t,a,o,l)=>["M",r+l,t,"H",r+a-l,"A",l,l,0,0,1,r+a,t+l,"V",t+o-l,"A",l,l,0,0,1,r+a-l,t+o,"H",r+l,"A",l,l,0,0,1,r,t+o-l,"V",t+l,"A",l,l,0,0,1,r+l,t,"Z"].join(" "),"createRoundedRectPathD")});var Jte,gMn,mMn,m0,y0,yMn,Lg,XE,KT,dp,b0=ie(()=>{"use strict";Jte=new Set(["redux-color","redux-dark-color"]),gMn=12,mMn=64,m0=i(r=>Array.isArray(r)&&r.length>0,"hasPalette"),y0=i((r,t)=>r!=null&&Jte.has(r)&&m0(t),"isColorTheme"),yMn=/^[\w-]+$/,Lg=i(r=>{let t=typeof r=="string"||typeof r=="number"?String(r):"";return yMn.test(t)?t:"classic"},"safeLook"),XE=i(r=>m0(r)?r.length:0,"paletteSlotCount"),KT=i((r,t)=>m0(t)?XE(t):typeof r=="number"&&Number.isInteger(r)&&r>0&&r<=mMn?r:gMn,"colorSlotCount"),dp=i((r,t,a,o)=>{if(t===void 0||!y0(a,o))return;let l=t%XE(o);r.attr("data-color-id",`color-${l}`)},"stampColorSlot")});function wMn(r){let{themeVariables:t}=Zt(),a=t.clusterBkg,o=t.clusterBorder;switch(r){case"flow":return{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"};default:return{rx:vMn,fill:a,stroke:o,cssClass:"collapsed-group"}}}async function jgr(r,t){let a=wMn(t.metadata?.containerType),{fill:o,stroke:l}=a,{nodeStyles:h}=tn(t),{shapeSvg:f,bbox:p}=await In(r,t,Nn(t)),{theme:m,themeVariables:b}=Zt();dp(f,t.colorIndex,m,b.borderColorArray);let v=t.padding??8,T=p.height,C=Math.max(p.width+v*2,bMn,t?.width??0),E=Math.max(T+MQe+_Qe+v*2,t?.height??0),S=-C/2,R=-E/2,L=-(MQe+_Qe)/2,_=f.select(".label");_&&(t.useHtmlLabels??Fh(Zt())?_.attr("transform",`translate(${-p.width/2}, ${-p.height/2+L})`):_.attr("transform",`translate(0, ${-p.height/2+L})`));let M;if(t.look==="handDrawn"){let G=Kr.svg(f),V=nn(t,{fill:o,stroke:l,...a.strokeWidth===void 0?{}:{strokeWidth:a.strokeWidth},...o==="none"?{fillWeight:0}:{fillStyle:"solid"}}),Y=G.path(Md(S,R,C,E,a.rx),V);M=f.insert(()=>Y,":first-child"),M.attr("class","basic label-container "+a.cssClass).attr("style",Ac(t.cssStyles))}else M=f.insert("rect",":first-child"),M.attr("class","basic label-container "+a.cssClass).attr("style",h).attr("rx",a.rx).attr("ry",a.rx).attr("x",S).attr("y",R).attr("width",C).attr("height",E).attr("fill",o).attr("stroke",l),a.strokeWidth!==void 0&&M.attr("stroke-width",a.strokeWidth+"px");let I=R+v+T+MQe;f.append("line").attr("class","collapsed-separator").attr("x1",S+8).attr("y1",I).attr("x2",S+C-8).attr("y2",I).attr("stroke",l).attr("stroke-dasharray","3, 3");let F=I+_Qe/2,O=2.5,P=10;for(let G=-1;G<=1;G++)f.append("circle").attr("class","collapsed-indicator").attr("cx",G*P).attr("cy",F).attr("r",O).attr("fill",l);return un(t,M),t.calcIntersect=function(G,V){return Vr.rect(G,V)},t.intersect=function(G){return Vr.rect(t,G)},f}var _Qe,MQe,bMn,vMn,zgr=ie(()=>{"use strict";ma();Qs();na();wa();d4();da();ba();Ia();b0();_Qe=20,MQe=8,bMn=80,vMn=8;i(wMn,"getCollapsedStyle");i(jgr,"collapsedGroup")});function mm(r,t,a,o){return r.insert("polygon",":first-child").attr("points",o.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}var QE=ie(()=>{"use strict";i(mm,"insertPolygonShape")});async function Vgr(r,t){let a=t,{shapeSvg:o,bbox:l}=await In(r,a,Nn(a)),h=a.padding??0,f=l.height+2*h,p=f/2,m=l.width+2*p+h,b=a.width??0,T=a.positioned&&(a.widthInColumns??1)>1&&b>m?b:m,C=CMn(a.directions??[],l,a,T),E=mm(o,T,f,C);return E.attr("style",a.style??null),un(a,E),a.intersect=function(S){return Vr.polygon(a,C,S)},o}var xMn,IQe,TMn,kMn,Ugr,CMn,Hgr=ie(()=>{"use strict";wa();QE();na();xMn=["right","left","up","down"],IQe="point",TMn=i(r=>{let t=new Set;for(let a of r)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),kMn=i(r=>xMn.filter(t=>r.has(t)).join("|")||IQe,"getDirectionKey"),Ugr={"right|left|up|down":i(({height:r,midpoint:t,padding:a,width:o})=>[{x:0,y:0},{x:t,y:0},{x:o/2,y:2*a},{x:o-t,y:0},{x:o,y:0},{x:o,y:-r/3},{x:o+2*a,y:-r/2},{x:o,y:-2*r/3},{x:o,y:-r},{x:o-t,y:-r},{x:o/2,y:-r-2*a},{x:t,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*a,y:-r/2},{x:0,y:-r/3}],"right|left|up|down"),"right|left|up":i(({height:r,midpoint:t,width:a})=>[{x:t,y:0},{x:a-t,y:0},{x:a,y:-r/2},{x:a-t,y:-r},{x:t,y:-r},{x:0,y:-r/2}],"right|left|up"),"right|left|down":i(({height:r,midpoint:t,width:a})=>[{x:0,y:0},{x:t,y:-r},{x:a-t,y:-r},{x:a,y:0}],"right|left|down"),"right|up|down":i(({height:r,midpoint:t,width:a})=>[{x:0,y:0},{x:a,y:-t},{x:a,y:-r+t},{x:0,y:-r}],"right|up|down"),"left|up|down":i(({height:r,midpoint:t,width:a})=>[{x:a,y:0},{x:0,y:-t},{x:0,y:-r+t},{x:a,y:-r}],"left|up|down"),"right|left":i(({height:r,midpoint:t,padding:a,width:o})=>[{x:t,y:0},{x:t,y:-a},{x:o-t,y:-a},{x:o-t,y:0},{x:o,y:-r/2},{x:o-t,y:-r},{x:o-t,y:-r+a},{x:t,y:-r+a},{x:t,y:-r},{x:0,y:-r/2}],"right|left"),"up|down":i(({height:r,midpoint:t,padding:a,width:o})=>[{x:o/2,y:0},{x:0,y:-a},{x:t,y:-a},{x:t,y:-r+a},{x:0,y:-r+a},{x:o/2,y:-r},{x:o,y:-r+a},{x:o-t,y:-r+a},{x:o-t,y:-a},{x:o,y:-a}],"up|down"),"right|up":i(({height:r,midpoint:t,width:a})=>[{x:0,y:0},{x:a,y:-t},{x:0,y:-r}],"right|up"),"right|down":i(({height:r,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-r}],"right|down"),"left|up":i(({height:r,midpoint:t,width:a})=>[{x:a,y:0},{x:0,y:-t},{x:a,y:-r}],"left|up"),"left|down":i(({height:r,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-r}],"left|down"),right:i(({height:r,midpoint:t,padding:a,width:o})=>[{x:t,y:-a},{x:t,y:-a},{x:o-t,y:-a},{x:o-t,y:0},{x:o,y:-r/2},{x:o-t,y:-r},{x:o-t,y:-r+a},{x:t,y:-r+a},{x:t,y:-r+a}],"right"),left:i(({height:r,midpoint:t,padding:a,width:o})=>[{x:t,y:0},{x:t,y:-a},{x:o-t,y:-a},{x:o-t,y:-r+a},{x:t,y:-r+a},{x:t,y:-r},{x:0,y:-r/2}],"left"),up:i(({height:r,midpoint:t,padding:a,width:o})=>[{x:t,y:-a},{x:t,y:-r+a},{x:0,y:-r+a},{x:o/2,y:-r},{x:o,y:-r+a},{x:o-t,y:-r+a},{x:o-t,y:-a}],"up"),down:i(({height:r,midpoint:t,padding:a,width:o})=>[{x:o/2,y:0},{x:0,y:-a},{x:t,y:-a},{x:t,y:-r+a},{x:o-t,y:-r+a},{x:o-t,y:-a},{x:o,y:-a}],"down"),[IQe]:()=>[{x:0,y:0}]},CMn=i((r,t,a,o)=>{let l=TMn(r),h=(a.padding??0)/2,f=t.height+4*h,p=f/2,m=o??t.width+2*p+2*h,b=kMn(l);return(Ugr[b]??Ugr[IQe])({height:f,midpoint:p,padding:h,width:m})},"getArrowPoints");i(Vgr,"block_arrow")});async function qgr(r,t,{config:{themeVariables:a}}){let{labelStyles:o,nodeStyles:l}=tn(t);t.labelStyle=o;let{shapeSvg:h,bbox:f,label:p}=await In(r,t,Nn(t)),m=a?.nodeBorder??a?.lineColor??"currentColor",b=t.padding??12,v=18,T=12,C=Math.max(f.width+b*2,t.width??0,90),E=Math.max(f.height+b*2+v,t.height??0),S=-E/2,{cssStyles:R}=t,L=h.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let I=Kr.svg(h).path(Md(-C/2,S,C,E,T),nn(t,{}));L.node()?.appendChild(I),R&&L.attr("style",R)}else L.append("rect").attr("x",-C/2).attr("y",S).attr("width",C).attr("height",E).attr("rx",T).attr("ry",T).attr("style",l);L.append("line").attr("x1",-C/2).attr("y1",S+v).attr("x2",C/2).attr("y2",S+v).attr("style",`stroke:${m};stroke-width:1px`);for(let M=0;M<3;M++)L.append("circle").attr("cx",-C/2+12+M*9).attr("cy",S+v/2).attr("r",2.5).attr("style",`fill:${m};stroke:none`);L.append("rect").attr("class","browser-address-bar").attr("x",-C/2+44).attr("y",S+4).attr("width",Math.max(C-56,10)).attr("height",v-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${m};stroke-width:1px;opacity:0.6`),un(t,L);let _=S+v+(E-v)/2;return p.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${_-f.height/2-(f.y-(f.top??0))})`),t.intersect=function(M){return Vr.rect(t,M)},h}var Wgr=ie(()=>{"use strict";na();wa();d4();da();ba();i(qgr,"browser")});async function Ygr(r,t){let{labelStyles:a,nodeStyles:o}=tn(t);t.labelStyle=a;let l=t.padding??0,h=t.look==="neo"?28:l,f=t.look==="neo"?24:l,{shapeSvg:p,bbox:m}=await In(r,t,Nn(t)),b=(t?.width??m.width)+(t.look==="neo"?h*2:h+A2e),v=(t?.height??m.height)+(t.look==="neo"?f*2:f),T=0,C=b,E=-v,S=0,R=[{x:T+A2e,y:E},{x:C,y:E},{x:C,y:S},{x:T,y:S},{x:T,y:E+A2e},{x:T+A2e,y:E}],L,{cssStyles:_}=t;if(t.look==="handDrawn"){let M=Kr.svg(p),I=nn(t,{}),F=ps(R),O=M.path(F,I);L=p.insert(()=>O,":first-child").attr("transform",`translate(${-b/2}, ${v/2})`),_&&L.attr("style",_)}else L=mm(p,b,v,R);return o&&L.attr("style",o),un(t,L),t.intersect=function(M){return Vr.polygon(t,R,M)},p}var A2e,Kgr=ie(()=>{"use strict";na();wa();da();ba();QE();na();A2e=12;i(Ygr,"card")});function Xgr(r,t){let{nodeStyles:a}=tn(t);t.label="";let o=r.insert("g").attr("class",Nn(t)).attr("id",t.domId??t.id),{cssStyles:l}=t,h=Math.max(28,t.width??0),f=[{x:0,y:h/2},{x:h/2,y:0},{x:0,y:-h/2},{x:-h/2,y:0}],p=Kr.svg(o),m=nn(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let b=ps(f),v=p.path(b,m),T=o.insert(()=>v,":first-child");return l&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",l),a&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",a),t.width=28,t.height=28,t.intersect=function(C){return Vr.polygon(t,f,C)},o}var Qgr=ie(()=>{"use strict";wa();ba();da();na();i(Xgr,"choice")});async function R2e(r,t,a){let{labelStyles:o,nodeStyles:l}=tn(t);t.labelStyle=o;let{shapeSvg:h,bbox:f,halfPadding:p}=await In(r,t,Nn(t)),m=16,b=a?.padding??p,v=Math.sqrt(f.width**2+f.height**2)/2,T=t.look==="neo"?v+m*2:v+b,C,{cssStyles:E}=t;if(t.look==="handDrawn"){let S=Kr.svg(h),R=nn(t,{}),L=S.circle(0,0,T*2,R);C=h.insert(()=>L,":first-child"),C.attr("class","basic label-container").attr("style",Ac(E))}else C=h.insert("circle",":first-child").attr("class","basic label-container").attr("style",l).attr("r",T).attr("cx",0).attr("cy",0);return un(t,C),t.calcIntersect=function(S,R){let L=S.width/2;return Vr.circle(S,L,R)},t.intersect=function(S){return Pe.info("Circle intersect",t,T,S),Vr.circle(t,T,S)},h}var NQe=ie(()=>{"use strict";ba();Xn();Ia();wa();da();na();i(R2e,"circle")});async function Jgr(r,t){let a=t,o=["node",a.cssClasses,a.class].filter(Boolean).join(" "),{shapeSvg:l,bbox:h,halfPadding:f}=await In(r,a,o),p=l.insert("rect",":first-child"),m=a.padding??0,b=a.positioned?a.width??0:h.width+m,v=a.positioned?a.height??0:h.height+m,T=a.positioned?-b/2:-h.width/2-f,C=a.positioned?-v/2:-h.height/2-f;return p.attr("class","basic cluster composite label-container").attr("style",a.style??null).attr("rx",a.rx??null).attr("ry",a.ry??null).attr("x",T).attr("y",C).attr("width",b).attr("height",v),un(a,p),a.intersect=function(E){return Vr.rect(a,E)},l}var Zgr=ie(()=>{"use strict";wa();na();i(Jgr,"composite")});async function e0r(r,t,{config:{themeVariables:a}}){let{labelStyles:o,nodeStyles:l}=tn(t);t.labelStyle=o;let{shapeSvg:h,bbox:f,label:p}=await In(r,t,Nn(t)),m=a?.nodeBorder??a?.lineColor??"currentColor",b=t.padding??12,v=20,T=12,C=Math.max(f.width+b*2,t.width??0,90),E=Math.max(f.height+b*2+v,t.height??0),S=-E/2,{cssStyles:R}=t,L=h.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let I=Kr.svg(h).path(Md(-C/2,S,C,E,T),nn(t,{}));L.node()?.appendChild(I),R&&L.attr("style",R)}else L.append("rect").attr("x",-C/2).attr("y",S).attr("width",C).attr("height",E).attr("rx",T).attr("ry",T).attr("style",l);L.append("text").attr("x",-C/2+12).attr("y",S+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${m}`).text(">_"),un(t,L);let _=S+v+(E-v)/2;return p.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${_-f.height/2-(f.y-(f.top??0))})`),t.intersect=function(M){return Vr.rect(t,M)},h}var t0r=ie(()=>{"use strict";na();wa();d4();da();ba();i(e0r,"consoleWindow")});function EMn(r){let t=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),o=r*2,l={x:o/2*t,y:o/2*a},h={x:-(o/2)*t,y:o/2*a},f={x:-(o/2)*t,y:-(o/2)*a},p={x:o/2*t,y:-(o/2)*a};return`M ${h.x},${h.y} L ${p.x},${p.y}
M ${l.x},${l.y} L ${f.x},${f.y}`}function r0r(r,t){let{labelStyles:a,nodeStyles:o}=tn(t);t.labelStyle=a,t.label="";let l=r.insert("g").attr("class",Nn(t)).attr("id",t.domId??t.id),h=Math.max(30,t?.width??0),{cssStyles:f}=t,p=Kr.svg(l),m=nn(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let b=p.circle(0,0,h*2,m),v=EMn(h),T=p.path(v,m),C=l.insert(()=>b,":first-child");return C.insert(()=>T),C.attr("class","outer-path"),f&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",o),un(t,C),t.intersect=function(E){return Pe.info("crossedCircle intersect",t,{radius:h,point:E}),Vr.circle(t,h,E)},l}var n0r=ie(()=>{"use strict";Xn();na();da();ba();wa();i(EMn,"createLine");i(r0r,"crossedCircle")});function NL(r,t,a,o=100,l=0,h=180){let f=[],p=l*Math.PI/180,v=(h*Math.PI/180-p)/(o-1);for(let T=0;T{var a=new Fi("mfrac",[$h(r.numer,t),$h(r.denom,t)]);if(!r.hasBarLine)a.setAttribute("linethickness","0px");else if(r.barSize){var o=_d(r.barSize,t);a.setAttribute("linethickness",Ki(o))}if(r.leftDelim!=null||r.rightDelim!=null){var l=[];if(r.leftDelim!=null){var h=new Fi("mo",[new hp(r.leftDelim.replace("\\",""))]);h.setAttribute("fence","true"),l.push(h)}if(l.push(a),r.rightDelim!=null){var f=new Fi("mo",[new hp(r.rightDelim.replace("\\",""))]);f.setAttribute("fence","true"),l.push(f)}return Mqe(l)}return a},"mathmlBuilder$3"),Xor=i((r,t)=>{if(!t)return r;var a={type:"styling",mode:r.mode,style:t,body:[r]};return a},"wrapWithStyle");Ca({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:i((r,t)=>{var{parser:a,funcName:o}=r,l=t[0],h=t[1],f,p=null,m=null;switch(o){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":f=!0;break;case"\\\\atopfrac":f=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":f=!1,p="(",m=")";break;case"\\\\bracefrac":f=!1,p="\\{",m="\\}";break;case"\\\\brackfrac":f=!1,p="[",m="]";break;default:throw new Error("Unrecognized genfrac command")}var b=o==="\\cfrac",v=null;return b||o.startsWith("\\d")?v="display":o.startsWith("\\t")&&(v="text"),Xor({type:"genfrac",mode:a.mode,numer:l,denom:h,continued:b,hasBarLine:f,leftDelim:p,rightDelim:m,barSize:null},v)},"handler"),htmlBuilder:X6n,mathmlBuilder:Q6n});Ca({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:t,funcName:a,token:o}=r,l;switch(a){case"\\over":l="\\frac";break;case"\\choose":l="\\binom";break;case"\\atop":l="\\\\atopfrac";break;case"\\brace":l="\\\\bracefrac";break;case"\\brack":l="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:l,token:o}}});Zsr=["display","text","script","scriptscript"],eor=i(function(t){var a=null;return t.length>0&&(a=t,a=a==="."?null:a),a},"delimFromValue");Ca({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,t){var{parser:a}=r,o=t[4],l=t[5],h=qye(t[0]),f=h.type==="atom"&&h.family==="open"?eor(h.text):null,p=qye(t[1]),m=p.type==="atom"&&p.family==="close"?eor(p.text):null,b=vl(t[2],"size"),v,T=null;b.isBlank?v=!0:(T=b.value,v=T.number>0);var C=null,E=t[3];if(E.type==="ordgroup"){if(E.body.length>0){var S=vl(E.body[0],"textord");C=Zsr[Number(S.text)]}}else E=vl(E,"textord"),C=Zsr[Number(E.text)];return Xor({type:"genfrac",mode:a.mode,numer:o,denom:l,continued:!1,hasBarLine:v,barSize:T,leftDelim:f,rightDelim:m},C)}});Ca({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,t){var{parser:a,funcName:o,token:l}=r;return{type:"infix",mode:a.mode,replaceWith:"\\\\abovefrac",size:vl(t[0],"size").value,token:l}}});Ca({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:i((r,t)=>{var{parser:a,funcName:o}=r,l=t[0],h=vl(t[1],"infix").size;if(!h)throw new Error("\\\\abovefrac expected size, but got "+String(h));var f=t[2],p=h.number>0;return{type:"genfrac",mode:a.mode,numer:l,denom:f,continued:!1,hasBarLine:p,barSize:h,leftDelim:null,rightDelim:null}},"handler")});Qor=i((r,t)=>{var a=t.style,o,l;r.type==="supsub"?(o=r.sup?wu(r.sup,t.havingStyle(a.sup()),t):wu(r.sub,t.havingStyle(a.sub()),t),l=vl(r.base,"horizBrace")):l=vl(r,"horizBrace");var h=wu(l.base,t.havingBaseStyle(Wo.DISPLAY)),f=ebe(l,t),p;if(l.isOver?p=vu({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.1},{type:"elem",elem:f,wrapperClasses:["svg-align"]}]}):p=vu({positionType:"bottom",positionData:h.depth+.1+f.height,children:[{type:"elem",elem:f,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:h}]}),o){var m=Di(["minner",l.isOver?"mover":"munder"],[p],t);l.isOver?p=vu({positionType:"firstBaseline",children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:o}]}):p=vu({positionType:"bottom",positionData:m.depth+.2+o.height+o.depth,children:[{type:"elem",elem:o},{type:"kern",size:.2},{type:"elem",elem:m}]})}return Di(["minner",l.isOver?"mover":"munder"],[p],t)},"htmlBuilder$3"),J6n=i((r,t)=>{var a=Zye(r.label);return new Fi(r.isOver?"mover":"munder",[$h(r.base,t),a])},"mathmlBuilder$2");Ca({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(r,t){var{parser:a,funcName:o}=r;return{type:"horizBrace",mode:a.mode,label:o,isOver:o.includes("\\over"),base:t[0]}},htmlBuilder:Qor,mathmlBuilder:J6n});Ca({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:i((r,t)=>{var{parser:a}=r,o=t[1],l=vl(t[0],"url").url;return a.settings.isTrusted({command:"\\href",url:l})?{type:"href",mode:a.mode,href:l,body:Ag(o)}:a.formatUnsupportedCmd("\\href")},"handler"),htmlBuilder:i((r,t)=>{var a=p0(r.body,t,!1);return h6n(r.href,[],a,t)},"htmlBuilder"),mathmlBuilder:i((r,t)=>{var a=hL(r.body,t);return a instanceof Fi||(a=new Fi("mrow",[a])),a.setAttribute("href",r.href),a},"mathmlBuilder")});Ca({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:i((r,t)=>{var{parser:a}=r,o=vl(t[0],"url").url;if(!a.settings.isTrusted({command:"\\url",url:o}))return a.formatUnsupportedCmd("\\url");for(var l=[],h=0;h
"),"placeholderToBreak"),blr=i(r=>r.replace(xN,"#br#"),"breakToPlaceholder"),Uqe=i(r=>{let t="";return r&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),kAn=i(function(...r){let t=r.filter(a=>!isNaN(a));return Math.max(...t)},"getMax"),CAn=i(function(...r){let t=r.filter(a=>!isNaN(a));return Math.min(...t)},"getMin"),$E=i(function(r){let t=r.split(/(,)/),a=[];for(let o=0;o{"use strict";r4();MWe();icr();i(G8n,"bindIndex");i(j8n,"bindKey");i(z8n,"datum");i(NWe,"default");i(U8n,"arraylike")});function OWe(){return new fp(this._exit||this._groups.map(Fee),this._parents)}var scr=ie(()=>{"use strict";DWe();r4();i(OWe,"default")});function PWe(r,t,a){var o=this.enter(),l=this,h=this.exit();return typeof r=="function"?(o=r(o),o&&(o=o.selection())):o=o.append(r+""),t!=null&&(l=t(l),l&&(l=l.selection())),a==null?h.remove():a(h),o&&l?o.merge(l).order():l}var ocr=ie(()=>{"use strict";i(PWe,"default")});function BWe(r){for(var t=r.selection?r.selection():r,a=this._groups,o=t._groups,l=a.length,h=o.length,f=Math.min(l,h),p=new Array(l),m=0;mW||W>57){q=(W===46?l+J.slice(Z+1):J.slice(Z))+q,J=J.slice(0,Z);break}}}M&&!L&&(J=t(J,1/0));var z=H.length+J.length+q.length,re=z<_?new Array(_-z+1).join(C):"";switch(M&&L&&(J=t(re+J,re.length?_-q.length:1/0),re=""),E){case"<":J=H+J+q+re;break;case"=":J=H+re+J+q;break;case"^":J=re.slice(0,z=re.length>>1)+H+J+q+re.slice(z);break;default:J=re+H+J+q;break}return h(J)}return i(K,"format"),K.toString=function(){return T+""},K}i(b,"newFormat");function v(T,C){var E=b((T=kL(T),T.type="f",T)),S=Math.max(-8,Math.min(8,Math.floor(s4(C)/3)))*3,R=Math.pow(10,-S),L=_hr[8+S/3];return function(_){return E(R*_)+L}}return i(v,"formatPrefix"),{format:b,formatPrefix:v}}var Dhr,_hr,Mhr=ie(()=>{"use strict";ite();Chr();Ehr();mKe();Shr();Rhr();wKe();Lhr();Dhr=Array.prototype.map,_hr=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];i(TKe,"default")});function kKe(r){return nve=TKe(r),UE=nve.format,ive=nve.formatPrefix,nve}var nve,UE,ive,Ihr=ie(()=>{"use strict";Mhr();kKe({thousands:",",grouping:[3],currency:["$",""]});i(kKe,"defaultLocale")});function ave(r){return Math.max(0,-s4(Math.abs(r)))}var Nhr=ie(()=>{"use strict";ite();i(ave,"default")});function sve(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s4(t)/3)))*3-s4(Math.abs(r)))}var Ohr=ie(()=>{"use strict";ite();i(sve,"default")});function ove(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,s4(t)-s4(r))+1}var Phr=ie(()=>{"use strict";ite();i(ove,"default")});var CKe=ie(()=>{"use strict";Ihr();mKe();Nhr();Ohr();Phr()});var Bhr=ie(()=>{"use strict"});function NRn(r){var t=0,a=r.children,o=a&&a.length;if(!o)t=1;else for(;--o>=0;)t+=a[o].value;r.value=t}function EKe(){return this.eachAfter(NRn)}var Fhr=ie(()=>{"use strict";i(NRn,"count");i(EKe,"default")});function SKe(r,t){let a=-1;for(let o of this)r.call(t,o,++a,this);return this}var $hr=ie(()=>{"use strict";i(SKe,"default")});function AKe(r,t){for(var a=this,o=[a],l,h,f=-1;a=o.pop();)if(r.call(t,a,++f,this),l=a.children)for(h=l.length-1;h>=0;--h)o.push(l[h]);return this}var Ghr=ie(()=>{"use strict";i(AKe,"default")});function RKe(r,t){for(var a=this,o=[a],l=[],h,f,p,m=-1;a=o.pop();)if(l.push(a),h=a.children)for(f=0,p=h.length;f
{"use strict";rfr();nfr();jRn=(1+Math.sqrt(5))/2;i(zRn,"squarifyRatio");ifr=i((function r(t){function a(o,l,h,f,p){zRn(t,o,l,h,f,p)}return i(a,"squarify"),a.ratio=function(o){return r((o=+o)>1?o:1)},a}),"custom")(jRn)});function lve(){var r=ifr,t=!1,a=1,o=1,l=[0],h=pz,f=pz,p=pz,m=pz,b=pz;function v(C){return C.x0=C.y0=0,C.x1=a,C.y1=o,C.eachBefore(T),l=[0],t&&C.eachBefore(FKe),C}i(v,"treemap");function T(C){var E=l[C.depth],S=C.x0+E,R=C.y0+E,L=C.x1-E,_=C.y1-E;L{"use strict";tfr();afr();Zhr();efr();i(lve,"default")});var ofr=ie(()=>{"use strict";Qhr();sfr()});var lfr=ie(()=>{"use strict"});var cfr=ie(()=>{"use strict"});function CL(r,t){switch(arguments.length){case 0:break;case 1:this.range(r);break;default:this.range(t).domain(r);break}return this}var ste=ie(()=>{"use strict";i(CL,"initRange")});function Pw(){var r=new Zj,t=[],a=[],o=jKe;function l(h){let f=r.get(h);if(f===void 0){if(o!==jKe)return o;r.set(h,f=t.push(h)-1)}return a[f%a.length]}return i(l,"scale"),l.domain=function(h){if(!arguments.length)return t.slice();t=[],r=new Zj;for(let f of h)r.has(f)||r.set(f,t.push(f)-1);return l},l.range=function(h){return arguments.length?(a=Array.from(h),l):a.slice()},l.unknown=function(h){return arguments.length?(o=h,l):o},l.copy=function(){return Pw(t,a).unknown(o)},CL.apply(l,arguments),l}var jKe,zKe=ie(()=>{"use strict";yL();ste();jKe=Symbol("implicit");i(Pw,"ordinal")});function gz(){var r=Pw().unknown(void 0),t=r.domain,a=r.range,o=0,l=1,h,f,p=!1,m=0,b=0,v=.5;delete r.unknown;function T(){var C=t().length,E=l
"},a),Wn.hasBreaks(r)))return r;let o=r.split(" ").filter(Boolean),l=[],h="";return o.forEach((f,p)=>{let m=c1(`${f} `,a),b=c1(h,a);if(m>t){let{hyphenatedStrings:C,remainingWord:E}=e_n(f,t,"-",a);l.push(h,...C),h=E}else b+m>=t?(l.push(h),h=f):h=[h,f].filter(Boolean).join(" ");p+1===o.length&&l.push(h)}),l.filter(f=>f!=="").join(a.joinWith)},(r,t,a)=>`${r}${t}${a.fontSize}${a.fontWeight}${a.fontFamily}${a.joinWith}`),e_n=XN((r,t,a="-",o)=>{o=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},o);let l=[...r],h=[],f="";return l.forEach((p,m)=>{let b=`${f}${p}`;if(c1(b,o)>=t){let T=m+1,C=l.length===T,E=`${b}${a}`;h.push(C?b:E),f=""}else f=b}),{hyphenatedStrings:h,remainingWord:f}},(r,t,a="-",o)=>`${r}${t}${a}${o.fontSize}${o.fontWeight}${o.fontFamily}`);i(s2e,"calculateTextHeight");i(c1,"calculateTextWidth");jte=XN((r,t)=>{let{fontSize:a=12,fontFamily:o="Arial",fontWeight:l=400}=t;if(!r)return{width:0,height:0};let[,h]=Tb(a),f=["sans-serif",o],p=r.split(Wn.lineBreakRegex),m=[],b=dn("body");if(!b.remove)return{width:0,height:0,lineHeight:0};let v=b.append("svg");for(let C of f){let E=0,S={width:0,height:0,lineHeight:0};for(let R of p){let L=JDn();L.text=R||zXe;let _=ZDn(v,L).style("font-size",h).style("font-weight",l).style("font-family",C),M=(_._groups||_)[0][0].getBBox();if(M.width===0&&M.height===0)throw new Error("svg element not in render tree");S.width=Math.round(Math.max(S.width,M.width)),E=Math.round(M.height),S.height+=E,S.lineHeight=Math.round(Math.max(S.lineHeight,E))}m.push(S)}v.remove();let T=isNaN(m[1].height)||isNaN(m[1].width)||isNaN(m[1].lineHeight)||m[0].height>m[1].height&&m[0].width>m[1].width&&m[0].lineHeight>m[1].lineHeight?0:1;return m[T]},(r,t)=>`${r}${t.fontSize}${t.fontWeight}${t.fontFamily}`),jXe=class{constructor(t=!1,a){this.count=0;this.count=a?a.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{i(this,"InitIDGenerator")}},t_n=i(function(r){return a2e=a2e||document.createElement("div"),r=escape(r).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),a2e.innerHTML=r,unescape(a2e.textContent)},"entityDecode");i(YXe,"isDetailedError");i(Tpr,"getErrorMessage");r_n=i((r,t,a,o)=>{if(!o)return;let l=r.node()?.getBBox();l&&r.append("text").text(o).attr("text-anchor","middle").attr("x",l.x+l.width/2).attr("y",-a).attr("class",t)},"insertTitle"),Tb=i(r=>{if(typeof r=="number")return[r,r+"px"];let t=parseInt(r??"",10);return Number.isNaN(t)?[void 0,void 0]:r===String(t)?[t,r+"px"]:[t,r]},"parseFontSize");i(nl,"cleanAndMerge");Ya={assignWithDepth:Bh,wrapLabel:QN,calculateTextHeight:s2e,calculateTextWidth:c1,calculateTextDimensions:jte,cleanAndMerge:nl,detectInit:UDn,detectDirective:vpr,isSubstringInArray:VDn,interpolateToCurve:UXe,calcLabelPosition:YDn,calcCardinalityPosition:KDn,calcTerminalLabelPosition:XDn,formatUrl:HDn,getStylesFromArray:HXe,generateId:qXe,random:WXe,runFunc:qDn,entityDecode:t_n,insertTitle:r_n,isLabelCoordinateInPath:n_n,parseFontSize:Tb,InitIDGenerator:jXe},kpr=i(function(r){let t=r;return t=t.replace(/style.*:\S*#.*;/g,function(a){return a.substring(0,a.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(a){return a.substring(0,a.length-1)}),t=t.replace(/#\w+;/g,function(a){let o=a.substring(1,a.length-1);return/^\+?\d+$/.test(o)?"\uFB02\xB0\xB0"+o+"\xB6\xDF":"\uFB02\xB0"+o+"\xB6\xDF"}),t},"encodeEntities"),Kv=i(function(r){return r.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Xv=i((r,t,{counter:a=0,prefix:o,suffix:l},h)=>h||`${o?`${o}_`:""}${r}_${t}_${a}${l?`_${l}`:""}`,"getEdgeId");i(Ac,"handleUndefinedAttr");i(n_n,"isLabelCoordinateInPath")});var Cpr,Epr=ie(()=>{"use strict";Yo();Cpr=i((r,t)=>{if(t==="sandbox"){let o=dn("#i"+r).node()?.contentDocument;if(!o)throw new Error(`Sandbox iframe #i${r} is missing its content document`);return{root:dn(o.body),doc:o}}return{root:dn("body"),doc:document}},"getDiagramRoot")});var Qda,Rz=ie(()=>{"use strict";Qda=typeof performance<"u"&&typeof performance.now=="function";globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"}});function JXe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function _pr(r){ZN=r}function $u(r,t=""){let a=typeof r=="string"?r:r.source,o={replace:i((l,h)=>{let f=typeof h=="string"?h:h.source;return f=f.replace(kb.caret,"$1"),a=a.replace(l,f),o},"replace"),getRegex:i(()=>new RegExp(a,t),"getRegex")};return o}function YE(r,t){if(t){if(kb.escapeTest.test(r))return r.replace(kb.escapeReplace,Apr)}else if(kb.escapeTestNoEncode.test(r))return r.replace(kb.escapeReplaceNoEncode,Apr);return r}function Rpr(r){try{r=encodeURI(r).replace(kb.percentDecode,"%")}catch{return null}return r}function Lpr(r,t){let a=r.replace(kb.findPipe,(h,f,p)=>{let m=!1,b=f;for(;--b>=0&&p[b]==="\\";)m=!m;return m?"|":" |"}),o=a.split(kb.splitPipe),l=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),t)if(o.length>t)o.splice(t);else for(;o.length
`:"'+(a?l:YE(l,!0))+`
`}blockquote({tokens:r}){return`"+(a?l:YE(l,!0))+`
${this.parser.parse(r)}
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:t}){return`
`}list(r){let t=r.ordered,a=r.start,o="";for(let f=0;f
`+t+`
`+o+`
`}tablerow({text:r}){return`
${r}
`}tablecell(r){let t=this.parser.parseInline(r.tokens),a=r.header?"th":"td";return(r.align?`<${a} align="${r.align}">`:`<${a}>`)+t+`${a}>
`}strong({tokens:r}){return`${this.parser.parseInline(r)}`}em({tokens:r}){return`${this.parser.parseInline(r)}`}codespan({text:r}){return`${YE(r,!0)}`}br(r){return"
"}del({tokens:r}){return`${this.parser.parseInline(r)}`}link({href:r,title:t,tokens:a}){let o=this.parser.parseInline(a),l=Rpr(r);if(l===null)return o;r=l;let h='"+o+"",h}image({href:r,title:t,text:a,tokens:o}){o&&(a=this.parser.parseInline(o,this.parser.textRenderer));let l=Rpr(r);if(l===null)return YE(a);r=l;let h=`",h}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:YE(r.text)}},sQe=class{static{i(this,"$")}strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},lA=class QXe{static{i(this,"l")}options;renderer;textRenderer;constructor(t){this.options=t||ZN,this.options.renderer=this.options.renderer||new u2e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new sQe}static parse(t,a){return new QXe(a).parse(t)}static parseInline(t,a){return new QXe(a).parseInline(t)}parse(t,a=!0){let o="";for(let l=0;l
"+YE(a.message+"",!0)+"
";return t?Promise.resolve(o):o}if(t)return Promise.reject(a);throw a}}},JN=new $_n;i(Tu,"d");Tu.options=Tu.setOptions=function(r){return JN.setOptions(r),Tu.defaults=JN.defaults,_pr(Tu.defaults),Tu};Tu.getDefaults=JXe;Tu.defaults=ZN;Tu.use=function(...r){return JN.use(...r),Tu.defaults=JN.defaults,_pr(Tu.defaults),Tu};Tu.walkTokens=function(r,t){return JN.walkTokens(r,t)};Tu.parseInline=JN.parseInline;Tu.Parser=lA;Tu.parser=lA.parse;Tu.Renderer=u2e;Tu.TextRenderer=sQe;Tu.Lexer=oA;Tu.lexer=oA.lex;Tu.Tokenizer=c2e;Tu.Hooks=Vte;Tu.parse=Tu;epa=Tu.options,tpa=Tu.setOptions,rpa=Tu.use,npa=Tu.walkTokens,ipa=Tu.parseInline,apa=lA.parse,spa=oA.lex});function G_n(r,{markdownAutoWrap:t}){let o=r.replace(/
/g,`
`).replace(/\n{2,}/g,`
`);return hbe(o)}function Upr(r){return r.split(/\\n|\n|
/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(a=>({content:a,type:"normal"}))??[])}function d2e(r,t={}){let a=G_n(r,t),o=Tu.lexer(a),l=[[]],h=0;function f(p,m="normal"){p.type==="text"?p.text.split(`
`).forEach((v,T)=>{T!==0&&(h++,l.push([])),v.split(" ").forEach(C=>{C=C.replace(/'/g,"'"),C&&l[h].push({content:C,type:m})})}):p.type==="strong"||p.type==="em"?p.tokens.forEach(b=>{f(b,p.type)}):p.type==="html"&&l[h].push({content:p.text,type:"normal"})}return i(f,"processNode"),o.forEach(p=>{p.type==="paragraph"?p.tokens?.forEach(m=>{f(m)}):p.type==="html"?l[h].push({content:p.text,type:"normal"}):l[h].push({content:p.raw,type:"normal"})}),l}function Vpr(r){return r?`
")}
").replace(/ /g," "):l.text.replace(/\n */g,"
"):l.type==="strong"?`${l.tokens?.map(o).join("")}`:l.type==="em"?`${l.tokens?.map(o).join("")}`:l.type==="paragraph"?`
/g,"
")),E=f?d2e(C.replace("
","
"),T):Upr(C),S=q_n(m,r,E,t?v:!1,!p);if(p){/stroke:/.exec(a)&&(a=a.replace("stroke:","lineColor:"));let R=a.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");dn(S).attr("style",R)}else{let R=a.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");dn(S).select("rect").attr("style",R.replace(/background:/g,"fill:"));let L=a.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");dn(S).select("text").attr("style",L)}return o?dn(S).selectAll("tspan.text-outer-tspan").classed("title-row",!0):dn(S).selectAll("tspan.text-outer-tspan").classed("row",!0),S}},"createText")});async function g2e(r){let t=r.getElementsByTagName("img");if(!t||t.length===0)return;let a=!agr(r);await Promise.all([...t].map(o=>new Promise(l=>{function h(){if(o.style.display="flex",o.style.flexDirection="column",a){let f=Zt().fontSize?Zt().fontSize:window.getComputedStyle(document.body).fontSize,p=5,[m=hs.fontSize]=Tb(f),b=m*p+"px";o.style.minWidth=b,o.style.maxWidth=b}else o.style.width="100%";l(o)}i(h,"setupImage"),setTimeout(()=>{o.complete&&h()}),o.addEventListener("error",h),o.addEventListener("load",h)})))}function agr(r){return r.nodeType===K_n?r.textContent?.trim()!=="":r.nodeType!==Y_n||r.tagName.toLowerCase()==="img"?!1:[...r.childNodes].some(agr)}var Y_n,K_n,hQe=ie(()=>{"use strict";ma();up();Ia();Y_n=1,K_n=3;i(g2e,"configureLabelImages");i(agr,"hasTextBesidesImages")});var sgr,X_n,ogr,lgr=ie(()=>{"use strict";Yo();Gw();ma();rl();Ia();sgr=3,X_n=32,ogr=i(async(r,t,a)=>{let o=Zt(),l=r.insert("g").attr("class",a??"node default").attr("id",t.domId||t.id),h=l.insert("g").attr("class","label").attr("style",Ac(t.labelStyle)),p=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(_=>({text:_,cssClass:"c4-descr"}))].filter(_=>_.text),m=t.width?Math.max(t.width-2*(t.padding??0),X_n):Zt().flowchart?.wrappingWidth??200,v=o.c4?.wrap??!0?m:Number.POSITIVE_INFINITY,T=await Promise.all(p.map(async _=>{let M=h.append("g").attr("class",_.cssClass),I=await zh(M,Ns(Kv(_.text??""),o),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:v,style:t.labelStyle},o);return dn(I).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),dn(I).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:M,box:M.node().getBBox()}})),C=Math.max(...T.map(({box:_})=>_.width),0),E=0;for(let{el:_,box:M}of T)_.attr("transform",`translate(${C/2-M.x-M.width/2}, ${E-M.y})`),E+=M.height+sgr;let S=T.length>0?E-sgr:0;h.insert("rect",":first-child"),h.attr("transform",`translate(${-C/2}, ${-S/2})`);let R=h.node().getBBox(),L=(t.padding??0)/2;return{shapeSvg:l,bbox:R,halfPadding:L,label:h}},"c4LabelHelper")});function ps(r){let t=r.map((a,o)=>`${o===0?"M":"L"}${a.x},${a.y}`);return t.push("Z"),t.join(" ")}function WT(r,t,a,o,l,h){let f=[],m=a-r,b=o-t,v=m/h,T=2*Math.PI/v,C=t+b/2;for(let E=0;E<=50;E++){let S=E/50,R=r+S*m,L=C+l*Math.sin(T*(R-r));f.push({x:R,y:L})}return f}function jw(r,t,a,o,l,h){let f=[],p=l*Math.PI/180,v=(h*Math.PI/180-p)/(o-1);for(let T=0;T
"):C,t.labelStyle,!0,!0),R=S.children[0],L=dn(S);T=R.getBoundingClientRect(),L.attr("width",T.width),L.attr("height",T.height);let _=(t.padding||0)/2;dn(S).attr("transform","translate( "+(T.width>E.width?0:(E.width-T.width)/2)+", "+(E.height+_+5)+")"),dn(v).attr("transform","translate( "+(T.width
").length,T.innerHTML.includes("")&&(v+=T.innerHTML.split("