@bkm016/basalt 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/{chunk-0xd9mnc2.js → chunk-jymx3a77.js} +165 -152
  2. package/{chunk-66h5qpc6.js → chunk-zq32mwxj.js} +134 -134
  3. package/compiled.js +1 -1
  4. package/package.json +1 -1
  5. package/ui-test-worker.js +1 -1
  6. package/web/{chunk-9yfftz38.js → chunk-05mvzx00.js} +1 -1
  7. package/web/chunk-086dshck.js +1 -0
  8. package/web/chunk-0fy590s0.js +1 -0
  9. package/web/{chunk-4a6gdrbs.js → chunk-0hvxb5d5.js} +1 -1
  10. package/web/chunk-0mdf1qja.js +1 -0
  11. package/web/{chunk-dz7g1gnv.js → chunk-0y971zgq.js} +2 -2
  12. package/web/{chunk-fjb3ksfd.js → chunk-1t38sgrk.js} +2 -2
  13. package/web/{chunk-66wb0p6e.js → chunk-1zfxaafq.js} +1 -1
  14. package/web/{chunk-p9hfcamx.js → chunk-27812gqr.js} +5 -5
  15. package/web/{chunk-sk1wkgjw.js → chunk-2ds0a2z1.js} +3 -3
  16. package/web/{chunk-ddyyc20r.js → chunk-2f2agfpj.js} +11 -11
  17. package/web/{chunk-3ecrkvr3.js → chunk-2tsxj613.js} +3 -3
  18. package/web/{chunk-y2rzeb4v.js → chunk-2weaa3gn.js} +2 -2
  19. package/web/{chunk-0pghpg4y.js → chunk-3020mmp1.js} +1 -1
  20. package/web/{chunk-mykrm8ba.js → chunk-30aeb767.js} +2 -2
  21. package/web/chunk-32zmk3f5.js +1 -0
  22. package/web/{chunk-zb2bkr7f.js → chunk-36dc7tcg.js} +2 -2
  23. package/web/{chunk-nnyc889n.js → chunk-3a57m7xm.js} +3 -3
  24. package/web/{chunk-8w7fyb3v.js → chunk-3b4wqmnh.js} +7 -7
  25. package/web/chunk-3d3wnh8a.js +2 -0
  26. package/web/{chunk-601k823s.js → chunk-3ftb27f3.js} +8 -8
  27. package/web/{chunk-c6yacwbc.js → chunk-47mbbmst.js} +3 -3
  28. package/web/chunk-48479gnx.js +1 -0
  29. package/web/{chunk-qsqtwf34.js → chunk-4gc663j0.js} +2 -2
  30. package/web/{chunk-kcjz03h5.js → chunk-4rwwtfnd.js} +2 -2
  31. package/web/{chunk-eqndhs21.js → chunk-4wwd3pfz.js} +2 -2
  32. package/web/{chunk-myd6sc76.js → chunk-57pyz29y.js} +2 -2
  33. package/web/{chunk-mdfksj61.js → chunk-59nk506k.js} +1 -1
  34. package/web/{chunk-db3twjvk.js → chunk-5ahx98zj.js} +9 -9
  35. package/web/chunk-6cjm2yr7.js +1 -0
  36. package/web/{chunk-frnh4zqf.js → chunk-6jb2zyp6.js} +2 -2
  37. package/web/{chunk-ts6jsfdk.js → chunk-793m5jjh.js} +1 -1
  38. package/web/{chunk-3ak5dg10.js → chunk-7dycbjxn.js} +4 -4
  39. package/web/chunk-7ycxz39p.js +1 -0
  40. package/web/{chunk-tftc5v89.js → chunk-8151c970.js} +1 -1
  41. package/web/{chunk-jccz14ye.js → chunk-885kpj14.js} +2 -2
  42. package/web/{chunk-79e08rk1.js → chunk-8csw0mvf.js} +2 -2
  43. package/web/{chunk-m9q5nr8f.js → chunk-8z7texmv.js} +1 -1
  44. package/web/{chunk-v1exk5wd.js → chunk-90fkdzx3.js} +8 -8
  45. package/web/chunk-94denx9h.js +39 -0
  46. package/web/{chunk-5baeh8q7.js → chunk-96xhmmqz.js} +6 -6
  47. package/web/chunk-9jy8nc4r.js +1 -0
  48. package/web/{chunk-5dr4tkem.js → chunk-9kkzmss7.js} +3 -3
  49. package/web/chunk-9wr33d0t.js +1 -0
  50. package/web/{chunk-3pd0qt83.js → chunk-a3pye9ag.js} +3 -3
  51. package/web/chunk-a4tdrxdh.js +1 -0
  52. package/web/chunk-a9fvsyc1.js +1 -0
  53. package/web/chunk-apvbvg4d.js +1 -0
  54. package/web/{chunk-gn8kyz76.js → chunk-b3j07x0n.js} +6 -6
  55. package/web/{chunk-ff1pmd3g.js → chunk-b6sqwmq7.js} +1 -1
  56. package/web/chunk-bkxcc7v5.js +1 -0
  57. package/web/chunk-bve354k7.js +1 -0
  58. package/web/{chunk-zdyys4ar.js → chunk-cbwvfedy.js} +8 -8
  59. package/web/{chunk-eadfxfkw.js → chunk-cpshsp24.js} +1 -1
  60. package/web/chunk-cwpxakby.js +1 -0
  61. package/web/chunk-d3f763n7.js +2 -0
  62. package/web/{chunk-8z0r0wtk.js → chunk-d4519smc.js} +14 -14
  63. package/web/chunk-de29pe57.js +1 -0
  64. package/web/chunk-dk0fnj87.js +1 -0
  65. package/web/{chunk-c57f714b.js → chunk-drchr3yn.js} +2 -2
  66. package/web/chunk-dsbyfvwz.js +1 -0
  67. package/web/{chunk-3hr3ew9w.js → chunk-dtrh40vr.js} +1 -1
  68. package/web/chunk-e68jw0bg.js +1 -0
  69. package/web/{chunk-veam6vk4.js → chunk-e763h2px.js} +67 -67
  70. package/web/{chunk-nvpp0ghj.js → chunk-enryqmj7.js} +5 -5
  71. package/web/{chunk-fpb2dd2d.js → chunk-f79ajymt.js} +2 -2
  72. package/web/{chunk-qq6m2my8.js → chunk-fj753yzt.js} +2 -2
  73. package/web/{chunk-9ctg0f30.js → chunk-g0rtcedn.js} +3 -3
  74. package/web/{chunk-2x4g9t37.js → chunk-g31dbnzm.js} +4 -4
  75. package/web/{chunk-w3w18stt.js → chunk-g4as4zzd.js} +4 -4
  76. package/web/{chunk-6e87m0nm.js → chunk-gten0rpx.js} +2 -2
  77. package/web/{chunk-a0ryzdnp.js → chunk-gyhr27dm.js} +1 -1
  78. package/web/{chunk-98y92vmh.js → chunk-hjyev38w.js} +6 -6
  79. package/web/{chunk-wzd2a4k5.js → chunk-hm8thq7c.js} +4 -4
  80. package/web/{chunk-07agqp8h.js → chunk-j4gvtszc.js} +2 -2
  81. package/web/chunk-jd7npyv9.js +8 -0
  82. package/web/chunk-jhpg2kcf.js +1 -0
  83. package/web/{chunk-9fnr00kv.js → chunk-jqqbkdtw.js} +2 -2
  84. package/web/chunk-jzz5htxp.js +1 -0
  85. package/web/chunk-ka3q31t1.js +1 -0
  86. package/web/chunk-kahab58k.js +1139 -0
  87. package/web/{chunk-af9evdza.js → chunk-kfbgvh0c.js} +1 -1
  88. package/web/chunk-krgvx75q.js +1 -0
  89. package/web/chunk-kxeaj44h.js +1 -0
  90. package/web/chunk-m1rdyvb5.js +1 -0
  91. package/web/{chunk-5v2c0aqk.js → chunk-m24yb8md.js} +2 -2
  92. package/web/chunk-m7k4wr3k.js +1 -0
  93. package/web/chunk-mdj3r75b.js +1 -0
  94. package/web/{chunk-ewx42c11.js → chunk-mpdeqzc9.js} +10 -10
  95. package/web/{chunk-b5h52neg.js → chunk-mykbcvqz.js} +1 -1
  96. package/web/{chunk-7qkav30b.js → chunk-n33753da.js} +1 -1
  97. package/web/{chunk-rasjtvsb.js → chunk-nafe18y9.js} +10 -10
  98. package/web/chunk-nbcpbqq4.js +1 -0
  99. package/web/{chunk-24jhbz82.js → chunk-nhx8pw7p.js} +1 -1
  100. package/web/chunk-nkpdd9hw.js +1 -0
  101. package/web/{chunk-dwjmr0zj.js → chunk-p1yc8hwn.js} +1 -1
  102. package/web/chunk-p29brxyt.js +1 -0
  103. package/web/chunk-p8fbes0t.js +1 -0
  104. package/web/chunk-pbp1p5ex.js +1 -0
  105. package/web/{chunk-xx11yv61.js → chunk-ppjw1mps.js} +4 -4
  106. package/web/{chunk-7tkgbbf9.js → chunk-pq56b3mq.js} +2 -2
  107. package/web/{chunk-vvvd3grf.js → chunk-pzg25qqe.js} +2 -2
  108. package/web/{chunk-spbs56wz.js → chunk-q65zxczs.js} +7 -7
  109. package/web/{chunk-t893141g.js → chunk-q8v5j963.js} +2 -2
  110. package/web/{chunk-vsjpnwsr.js → chunk-qykt7avq.js} +2 -2
  111. package/web/chunk-r6q1301x.js +1 -0
  112. package/web/chunk-r8kghrkb.js +1 -0
  113. package/web/chunk-rhxn7mxg.js +1 -0
  114. package/web/{chunk-2dvbeqt0.js → chunk-rqympya7.js} +2 -2
  115. package/web/{chunk-30b33r2w.js → chunk-s0xy00v5.js} +2 -2
  116. package/web/chunk-svqshmpg.js +1 -0
  117. package/web/chunk-swzxq7r3.css +1 -0
  118. package/web/{chunk-8jcvdd5d.js → chunk-t18tn37m.js} +2 -2
  119. package/web/chunk-tbsaseer.js +1 -0
  120. package/web/{chunk-5jdrev9p.js → chunk-tggja45g.js} +3 -3
  121. package/web/chunk-tgkdyxbn.js +1 -0
  122. package/web/{chunk-rrpn5r5w.js → chunk-tpdcrrf1.js} +1 -1
  123. package/web/chunk-v0zfnvc1.js +1 -0
  124. package/web/{chunk-5a4mj3qz.js → chunk-v3dn9bfw.js} +1 -1
  125. package/web/chunk-vj31fs16.js +1 -0
  126. package/web/chunk-vr79r8vh.js +1 -0
  127. package/web/chunk-wb9tax0m.js +1 -0
  128. package/web/{chunk-rayf24gy.js → chunk-wbwets5x.js} +23 -23
  129. package/web/chunk-x9eghjjd.js +1 -0
  130. package/web/{chunk-awkdw9rw.js → chunk-xbyrgyy0.js} +2 -2
  131. package/web/{chunk-60axh4sa.js → chunk-xjc5fmcr.js} +24 -24
  132. package/web/{chunk-qh62nkem.js → chunk-ydtrc1ay.js} +2 -2
  133. package/web/chunk-yrh86m0n.js +1 -0
  134. package/web/chunk-z3ky5ews.js +2 -0
  135. package/web/{chunk-ctzkqx2g.js → chunk-zdhyq3ch.js} +13 -13
  136. package/web/{chunk-0zwc2rvh.js → chunk-zv73g4qq.js} +2 -2
  137. package/web/index.html +1 -1
  138. package/web/chunk-08sq3cwm.js +0 -1
  139. package/web/chunk-12qf1r6m.js +0 -1
  140. package/web/chunk-24fjnnee.js +0 -1
  141. package/web/chunk-2hrswh3d.js +0 -2
  142. package/web/chunk-2j2atyjw.js +0 -1
  143. package/web/chunk-3h3g3ca3.js +0 -1
  144. package/web/chunk-3pcrxg6m.js +0 -1
  145. package/web/chunk-3txxt0a7.js +0 -1
  146. package/web/chunk-43g4wd7a.js +0 -1
  147. package/web/chunk-5z2n4z9x.css +0 -1
  148. package/web/chunk-6y55gk1n.js +0 -1
  149. package/web/chunk-7qq1ypvj.js +0 -1
  150. package/web/chunk-814kkkmq.js +0 -8
  151. package/web/chunk-8w8atrdh.js +0 -1
  152. package/web/chunk-935mjq1c.js +0 -39
  153. package/web/chunk-942g3eqn.js +0 -1
  154. package/web/chunk-a61zrp66.js +0 -1
  155. package/web/chunk-arnzrqnm.js +0 -1
  156. package/web/chunk-avxk6jpc.js +0 -2
  157. package/web/chunk-bwy3e58v.js +0 -1
  158. package/web/chunk-dnv8dx72.js +0 -1
  159. package/web/chunk-f7jpakwh.js +0 -1
  160. package/web/chunk-fmthkpff.js +0 -1
  161. package/web/chunk-gv99c8zv.js +0 -1
  162. package/web/chunk-h0767tjv.js +0 -1
  163. package/web/chunk-h0c42zy3.js +0 -1
  164. package/web/chunk-hqynf99g.js +0 -1
  165. package/web/chunk-ket6g0yd.js +0 -1
  166. package/web/chunk-mbwwj216.js +0 -1
  167. package/web/chunk-me7dza1c.js +0 -1
  168. package/web/chunk-mzzaet63.js +0 -1
  169. package/web/chunk-n0wazxgz.js +0 -1
  170. package/web/chunk-nvt9tkt4.js +0 -1139
  171. package/web/chunk-ph1dgffm.js +0 -1
  172. package/web/chunk-q34as3v6.js +0 -1
  173. package/web/chunk-qz6r9v1z.js +0 -1
  174. package/web/chunk-rad2s9ha.js +0 -1
  175. package/web/chunk-s37beysw.js +0 -1
  176. package/web/chunk-s60s09mb.js +0 -1
  177. package/web/chunk-tfvcs2xx.js +0 -1
  178. package/web/chunk-tj1fn8v2.js +0 -1
  179. package/web/chunk-vqmj6peg.js +0 -1
  180. package/web/chunk-wdq2tp9e.js +0 -1
  181. package/web/chunk-wkf5xfyr.js +0 -1
  182. package/web/chunk-xa43ndfj.js +0 -2
  183. package/web/chunk-xh4xn1az.js +0 -1
  184. package/web/chunk-xzwxcxb4.js +0 -1
  185. package/web/chunk-y1qty77a.js +0 -1
  186. package/web/chunk-ys2tns0p.js +0 -1
  187. package/web/chunk-z05x9cbm.js +0 -1
  188. package/web/chunk-zgavhnt8.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t,a,l,I,Tt,ko,yt,en,At,Yn,tn}from"./chunk-veam6vk4.js";import{xe,Oe,Ke,Ee,ut,Wt,H,me,it,Gt,ot,cr,ha,ga,ya,yn,Ct,va,vn,$e,bn,$t,St,xn,Ht,_n,ba,xa,ur,_e,_a,wn,Yt,kn,dr,pr,Zt,wa,mr,ka,jr,dt,fr,Ca,Sa,Ta,Ge,hr,gr,Cn,Ea,yr,h,Qe,pt,we,Xt,re}from"./chunk-kcjz03h5.js";import{pa,ma,W,Bn,so,fa,lr}from"./chunk-zb2bkr7f.js";import{Lt}from"./chunk-nvt9tkt4.js";var br={};Lt(br,{default:()=>rr});var lo=/\s/;function mo(r){var e=r.length;while(e--&&lo.test(r.charAt(e)));return e}var te=mo;var ho=/^\s+/;function go(r){return r?r.slice(0,te(r)+1).replace(ho,""):r}var ne=go;var oe=NaN,vo=/^[-+]0x[0-9a-f]+$/i,bo=/^0b[01]+$/i,yo=/^0o[0-7]+$/i,wo=parseInt;function _o(r){if(typeof r=="number")return r;if(ut(r))return oe;if(me(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=me(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=ne(r);var n=bo.test(r);return n||yo.test(r)?wo(r.slice(2),n?2:8):vo.test(r)?oe:+r}var ie=_o;var ae=1/0,Eo=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function xo(r){if(!r)return r===0?r:0;if(r=ie(r),r===ae||r===-ae){var e=r<0?-1:1;return e*Eo}return r===r?r:0}var V=xo;function Oo(r){var e=V(r),n=e%1;return e===e?n?e-n:e:0}var fe=Oo;var se=Object.create,Lo=function(){function r(){}return function(e){if(!me(e))return{};if(se)return se(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),ue=Lo;function Io(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var sr=Io;function So(r,e,n){if(e=="__proto__"&&cr)cr(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var M=So;var Po=Object.prototype,To=Po.hasOwnProperty;function Co(r,e,n){var o=r[e];if(!(To.call(r,e)&&Ct(o,n))||n===void 0&&!(e in r))M(r,e,n)}var j=Co;function Ao(r,e,n,o){var i=!n;n||(n={});var f=-1,s=e.length;while(++f<s){var u=e[f],d=o?o(n[u],r[u],u,n,r):void 0;if(d===void 0)d=r[u];if(i)M(n,u,d);else j(n,u,d)}return n}var k=Ao;function Ro(r,e,n){if(!me(n))return!1;var o=typeof e;if(o=="number"?$e(n)&&yn(e,n.length):o=="string"&&(e in n))return Ct(n[e],r);return!1}var C=Ro;function jo(r){return vn(function(e,n){var o=-1,i=n.length,f=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;if(f=r.length>3&&typeof f=="function"?(i--,f):void 0,s&&C(n[0],n[1],s))f=i<3?void 0:f,i=1;e=Object(e);while(++o<i){var u=n[o];if(u)r(e,u,o,f)}return e})}var de=jo;function Bo(r){var e=[];if(r!=null)for(var n in Object(r))e.push(n);return e}var ce=Bo;var Fo=Object.prototype,Go=Fo.hasOwnProperty;function Xo(r){if(!me(r))return ce(r);var e=bn(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!Go.call(r,o))))n.push(o);return n}var pe=Xo;function Uo(r){return $e(r)?ba(r,!0):pe(r)}var L=Uo;function Vo(r){var e=r==null?0:r.length;return e?pr(r,1):[]}var N=Vo;function Yo(r){return ha(va(r,void 0,N),r+"")}var le=Yo;var zo=xa(Object.getPrototypeOf,Object),Y=zo;var Wo="[object Object]",qo=Function.prototype,Ho=Object.prototype,he=qo.toString,Ko=Ho.hasOwnProperty,Jo=he.call(Object);function Zo(r){if(!Ee(r)||Ke(r)!=Wo)return!1;var e=Y(r);if(e===null)return!0;var n=Ko.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&he.call(n)==Jo}var ge=Zo;var $o="\\ud800-\\udfff",Qo="\\u0300-\\u036f",ri="\\ufe20-\\ufe2f",ei="\\u20d0-\\u20ff",ti=Qo+ri+ei,ni="\\ufe0e\\ufe0f",oi="\\u200d",ii=RegExp("["+oi+$o+ti+ni+"]");function ai(r){return ii.test(r)}var ve=ai;function fi(r,e){return r&&k(e,_e(e),r)}var be=fi;function si(r,e){return r&&k(e,L(e),r)}var ye=si;var Ne=typeof br=="object"&&br&&!br.nodeType&&br,Le=Ne&&typeof vr=="object"&&vr&&!vr.nodeType&&vr,ui=Le&&Le.exports===Ne,Ie=ui?xe.Buffer:void 0,Se=Ie?Ie.allocUnsafe:void 0;function di(r,e){if(e)return r.slice();var n=r.length,o=Se?Se(n):new r.constructor(n);return r.copy(o),o}var rr=di;function ci(r,e){return k(r,mr(r),e)}var Pe=ci;var pi=Object.getOwnPropertySymbols,li=!pi?wa:function(r){var e=[];while(r)dr(e,mr(r)),r=Y(r);return e},wr=li;function mi(r,e){return k(r,wr(r),e)}var ke=mi;function hi(r){return ka(r,L,wr)}var Te=hi;var gi=Object.prototype,vi=gi.hasOwnProperty;function bi(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&vi.call(r,"index"))n.index=r.index,n.input=r.input;return n}var Ce=bi;function yi(r){var e=new r.constructor(r.byteLength);return new fr(e).set(new fr(r)),e}var z=yi;function wi(r,e){var n=e?z(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var Ae=wi;var _i=/\w*$/;function Ei(r){var e=new r.constructor(r.source,_i.exec(r));return e.lastIndex=r.lastIndex,e}var Re=Ei;var Me=Oe?Oe.prototype:void 0,je=Me?Me.valueOf:void 0;function xi(r){return je?Object(je.call(r)):{}}var Be=xi;function Oi(r,e){var n=e?z(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var _r=Oi;var Li="[object Boolean]",Ii="[object Date]",Si="[object Map]",Ni="[object Number]",Pi="[object RegExp]",ki="[object Set]",Ti="[object String]",Ci="[object Symbol]",Ai="[object ArrayBuffer]",Ri="[object DataView]",Mi="[object Float32Array]",ji="[object Float64Array]",Bi="[object Int8Array]",Di="[object Int16Array]",Fi="[object Int32Array]",Gi="[object Uint8Array]",Xi="[object Uint8ClampedArray]",Ui="[object Uint16Array]",Vi="[object Uint32Array]";function Yi(r,e,n){var o=r.constructor;switch(e){case Ai:return z(r);case Li:case Ii:return new o(+r);case Ri:return Ae(r,n);case Mi:case ji:case Bi:case Di:case Fi:case Gi:case Xi:case Ui:case Vi:return _r(r,n);case Si:return new o;case Ni:case Ti:return new o(r);case Pi:return Re(r);case ki:return new o;case Ci:return Be(r)}}var De=Yi;function zi(r){return typeof r.constructor=="function"&&!bn(r)?ue(Y(r)):{}}var Er=zi;var Wi="[object Map]";function qi(r){return Ee(r)&&dt(r)==Wi}var Fe=qi;var Xe=Ht&&Ht.isMap,Hi=Xe?xn(Xe):Fe,Ue=Hi;var Ki="[object Set]";function Ji(r){return Ee(r)&&dt(r)==Ki}var Ve=Ji;var Ye=Ht&&Ht.isSet,Zi=Ye?xn(Ye):Ve,ze=Zi;var $i=1,Qi=2,ra=4,We="[object Arguments]",ea="[object Array]",ta="[object Boolean]",na="[object Date]",oa="[object Error]",qe="[object Function]",ia="[object GeneratorFunction]",aa="[object Map]",sa="[object Number]",He="[object Object]",ua="[object RegExp]",da="[object Set]",ca="[object String]",la="[object Symbol]",Oa="[object WeakMap]",La="[object ArrayBuffer]",Ia="[object DataView]",Na="[object Float32Array]",Pa="[object Float64Array]",Aa="[object Int8Array]",Ra="[object Int16Array]",Ma="[object Int32Array]",ja="[object Uint8Array]",Ba="[object Uint8ClampedArray]",Da="[object Uint16Array]",Fa="[object Uint32Array]",x={};x[We]=x[ea]=x[La]=x[Ia]=x[ta]=x[na]=x[Na]=x[Pa]=x[Aa]=x[Ra]=x[Ma]=x[aa]=x[sa]=x[He]=x[ua]=x[da]=x[ca]=x[la]=x[ja]=x[Ba]=x[Da]=x[Fa]=!0;x[oa]=x[qe]=x[Oa]=!1;function xr(r,e,n,o,i,f){var s,u=e&$i,d=e&Qi,c=e&ra;if(n)s=i?n(r,o,i,f):n(r);if(s!==void 0)return s;if(!me(r))return r;var p=H(r);if(p){if(s=Ce(r),!u)return sr(r,s)}else{var m=dt(r),g=m==qe||m==ia;if(St(r))return rr(r,u);if(m==He||m==We||g&&!i){if(s=d||g?{}:Er(r),!u)return d?ke(r,ye(s,r)):Pe(r,be(s,r))}else{if(!x[m])return i?r:{};s=De(r,m,u)}}f||(f=new Zt);var b=f.get(r);if(b)return b;if(f.set(r,s),ze(r))r.forEach(function(v){s.add(xr(v,e,n,v,r,f))});else if(Ue(r))r.forEach(function(v,_){s.set(_,xr(v,e,n,_,r,f))});var w=c?d?Te:jr:d?L:_e,y=p?void 0:w(r);return ga(y||r,function(v,_){if(y)_=v,v=r[_];j(s,_,xr(v,e,n,_,r,f))}),s}var Je=xr;var Ga=1,Xa=4;function Ua(r){return Je(r,Ga|Xa)}var Ze=Ua;var Va=function(){return xe.Date.now()},kr=Va;var rt=Object.prototype,Ya=rt.hasOwnProperty,za=vn(function(r,e){r=Object(r);var n=-1,o=e.length,i=o>2?e[2]:void 0;if(i&&C(e[0],e[1],i))o=1;while(++n<o){var f=e[n],s=L(f),u=-1,d=s.length;while(++u<d){var c=s[u],p=r[c];if(p===void 0||Ct(p,rt[c])&&!Ya.call(r,c))r[c]=f[c]}}return r}),et=za;function Wa(r,e,n){if(n!==void 0&&!Ct(r[e],n)||n===void 0&&!(e in r))M(r,e,n)}var er=Wa;function qa(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var tr=qa;function Ha(r){return k(r,L(r))}var tt=Ha;function Ka(r,e,n,o,i,f,s){var u=tr(r,n),d=tr(e,n),c=s.get(d);if(c){er(r,n,c);return}var p=f?f(u,d,n+"",r,e,s):void 0,m=p===void 0;if(m){var g=H(d),b=!g&&St(d),w=!g&&!b&&_n(d);if(p=d,g||b||w)if(H(u))p=u;else if(Ea(u))p=sr(u);else if(b)m=!1,p=rr(d,!0);else if(w)m=!1,p=_r(d,!0);else p=[];else if(ge(d)||$t(d)){if(p=u,$t(u))p=tt(u);else if(!me(u)||Gt(u))p=Er(d)}else m=!1}if(m)s.set(d,p),i(p,d,o,f,s),s.delete(d);er(r,n,p)}var nt=Ka;function at(r,e,n,o,i){if(r===e)return;hr(e,function(f,s){if(i||(i=new Zt),me(f))nt(r,e,s,n,at,o,i);else{var u=o?o(tr(r,s),f,s+"",r,e,i):void 0;if(u===void 0)u=f;er(r,s,u)}},L)}var ft=at;function Ja(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var X=Ja;function Za(r){return function(e,n,o){var i=Object(e);if(!$e(e)){var f=Ge(n,3);e=_e(e),n=function(u){return f(i[u],u,i)}}var s=r(e,n,o);return s>-1?i[f?e[s]:s]:void 0}}var st=Za;var $a=Math.max;function Qa(r,e,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:fe(n);if(i<0)i=$a(o+i,0);return ya(r,Ge(e,3),i)}var ct=Qa;var rf=st(ct),nr=rf;function ef(r,e){var n=-1,o=$e(r)?Array(r.length):[];return Cn(r,function(i,f,s){o[++n]=e(i,f,s)}),o}var Or=ef;function tf(r,e){var n=H(r)?Wt:Or;return n(r,Ge(e,3))}var E=tf;function nf(r,e){return r==null?r:hr(r,yr(e),L)}var lt=nf;function of(r,e){return r&&gr(r,yr(e))}var mt=of;function af(r,e){return r>e}var ht=af;var ff=Object.prototype,sf=ff.hasOwnProperty;function uf(r,e){return r!=null&&sf.call(r,e)}var gt=uf;function df(r,e){return r!=null&&Ca(r,e,gt)}var Lr=df;var cf="[object String]";function pf(r){return typeof r=="string"||!H(r)&&Ee(r)&&Ke(r)==cf}var vt=pf;function lf(r,e){return r<e}var Ir=lf;function mf(r,e){var n={};return e=Ge(e,3),gr(r,function(o,i,f){M(n,i,e(o,i,f))}),n}var q=mf;function hf(r,e,n){var o=-1,i=r.length;while(++o<i){var f=r[o],s=e(f);if(s!=null&&(u===void 0?s===s&&!ut(s):n(s,u)))var u=s,d=f}return d}var K=hf;function gf(r){return r&&r.length?K(r,it,ht):void 0}var S=gf;var vf=de(function(r,e,n){ft(r,e,n)}),or=vf;function bf(r){return r&&r.length?K(r,it,Ir):void 0}var B=bf;function yf(r,e){return r&&r.length?K(r,Ge(e,2),Ir):void 0}var J=yf;function wf(r,e,n,o){if(!me(r))return r;e=wn(e,r);var i=-1,f=e.length,s=f-1,u=r;while(u!=null&&++i<f){var d=Yt(e[i]),c=n;if(d==="__proto__"||d==="constructor"||d==="prototype")return r;if(i!=s){var p=u[d];if(c=o?o(p,d,u):void 0,c===void 0)c=me(p)?p:yn(e[i+1])?[]:{}}j(u,d,c),u=u[d]}return r}var bt=wf;function _f(r,e,n){var o=-1,i=e.length,f={};while(++o<i){var s=e[o],u=kn(r,s);if(n(u,s))bt(f,wn(s,r),u)}return f}var wt=_f;function Ef(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var _t=Ef;function xf(r,e){if(r!==e){var n=r!==void 0,o=r===null,i=r===r,f=ut(r),s=e!==void 0,u=e===null,d=e===e,c=ut(e);if(!u&&!c&&!f&&r>e||f&&s&&d&&!u&&!c||o&&s&&d||!n&&d||!i)return 1;if(!o&&!f&&!c&&r<e||c&&n&&i&&!o&&!f||u&&n&&i||!s&&i||!d)return-1}return 0}var Et=xf;function Of(r,e,n){var o=-1,i=r.criteria,f=e.criteria,s=i.length,u=n.length;while(++o<s){var d=Et(i[o],f[o]);if(d){if(o>=u)return d;var c=n[o];return d*(c=="desc"?-1:1)}}return r.index-e.index}var xt=Of;function Lf(r,e,n){if(e.length)e=Wt(e,function(f){if(H(f))return function(s){return kn(s,f.length===1?f[0]:f)};return f});else e=[it];var o=-1;e=Wt(e,xn(Ge));var i=Or(r,function(f,s,u){var d=Wt(e,function(c){return c(f)});return{criteria:d,index:++o,value:f}});return _t(i,function(f,s){return xt(f,s,n)})}var Ot=Lf;var If=Ta("length"),It=If;var Pt="\\ud800-\\udfff",Sf="\\u0300-\\u036f",Nf="\\ufe20-\\ufe2f",Pf="\\u20d0-\\u20ff",kf=Sf+Nf+Pf,Tf="\\ufe0e\\ufe0f",Cf="["+Pt+"]",Tr="["+kf+"]",Cr="\\ud83c[\\udffb-\\udfff]",Af="(?:"+Tr+"|"+Cr+")",kt="[^"+Pt+"]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",Rf="\\u200d",jt=Af+"?",Bt="["+Tf+"]?",Mf="(?:"+Rf+"(?:"+[kt,Rt,Mt].join("|")+")"+Bt+jt+")*",jf=Bt+jt+Mf,Bf="(?:"+[kt+Tr+"?",Tr,Rt,Mt,Cf].join("|")+")",Nt=RegExp(Cr+"(?="+Cr+")|"+Bf+jf,"g");function Df(r){var e=Nt.lastIndex=0;while(Nt.test(r))++e;return e}var Dt=Df;function Ff(r){return ve(r)?Dt(r):It(r)}var Ft=Ff;function Gf(r,e){return wt(r,e,function(n,o){return Sa(r,o)})}var Ut=Gf;var Xf=le(function(r,e){return r==null?{}:Ut(r,e)}),Z=Xf;var{ceil:Uf,max:Vf}=Math;function Yf(r,e,n,o){var i=-1,f=Vf(Uf((e-r)/(n||1)),0),s=Array(f);while(f--)s[o?f:++i]=r,r+=n;return s}var Vt=Yf;function zf(r){return function(e,n,o){if(o&&typeof o!="number"&&C(e,n,o))n=o=void 0;if(e=V(e),n===void 0)n=e,e=0;else n=V(n);return o=o===void 0?e<n?1:-1:V(o),Vt(e,n,o,r)}}var zt=zf;var Wf=zt(),P=Wf;var qf="[object Map]",Hf="[object Set]";function Kf(r){if(r==null)return 0;if($e(r))return vt(r)?Ft(r):r.length;var e=dt(r);if(e==qf||e==Hf)return r.size;return ur(r).length}var qt=Kf;var Jf=vn(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&C(r,e[0],e[1]))e=[];else if(n>2&&C(e[0],e[1],e[2]))e=[e[0]];return Ot(r,pr(e,1),[])}),A=Jf;var Zf=0;function $f(r){var e=++Zf;return _a(r)+e}var Q=$f;function Qf(r,e,n){var o=-1,i=r.length,f=e.length,s={};while(++o<i){var u=o<f?e[o]:void 0;n(s,r[o],u)}return s}var Kt=Qf;function rs(r,e){return Kt(r||[],e||[],j)}var Ar=rs;class Rr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return Jt(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)Jt(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,es)),n=n._prev;return"["+r.join(", ")+"]"}}function Jt(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function es(r,e){if(r!=="_next"&&r!=="_prev")return e}var ts=ot(1);function Qt(r,e){if(r.nodeCount()<=1)return[];var n=os(r,e||ts),o=ns(n.graph,n.buckets,n.zeroIdx);return N(E(o,function(i){return r.outEdges(i.v,i.w)}))}function ns(r,e,n){var o=[],i=e[e.length-1],f=e[0],s;while(r.nodeCount()){while(s=f.dequeue())Mr(r,e,n,s);while(s=i.dequeue())Mr(r,e,n,s);if(r.nodeCount()){for(var u=e.length-2;u>0;--u)if(s=e[u].dequeue(),s){o=o.concat(Mr(r,e,n,s,!0));break}}}return o}function Mr(r,e,n,o,i){var f=i?[]:void 0;return h(r.inEdges(o.v),function(s){var u=r.edge(s),d=r.node(s.v);if(i)f.push({v:s.v,w:s.w});d.out-=u,Br(e,n,d)}),h(r.outEdges(o.v),function(s){var u=r.edge(s),d=s.w,c=r.node(d);c.in-=u,Br(e,n,c)}),r.removeNode(o.v),f}function os(r,e){var n=new re,o=0,i=0;h(r.nodes(),function(u){n.setNode(u,{v:u,in:0,out:0})}),h(r.edges(),function(u){var d=n.edge(u.v,u.w)||0,c=e(u),p=d+c;n.setEdge(u.v,u.w,p),i=Math.max(i,n.node(u.v).out+=c),o=Math.max(o,n.node(u.w).in+=c)});var f=P(i+o+3).map(function(){return new Rr}),s=o+1;return h(n.nodes(),function(u){Br(f,s,n.node(u))}),{graph:n,buckets:f,zeroIdx:s}}function Br(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function rn(r){var e=r.graph().acyclicer==="greedy"?Qt(r,n(r)):is(r);h(e,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,Q("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function is(r){var e=[],n={},o={};function i(f){if(Object.prototype.hasOwnProperty.call(o,f))return;o[f]=!0,n[f]=!0,h(r.outEdges(f),function(s){if(Object.prototype.hasOwnProperty.call(n,s.w))e.push(s);else i(s.w)}),delete n[f]}return h(r.nodes(),i),e}function nn(r){h(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,o)}})}function T(r,e,n,o){var i;do i=Q(o);while(r.hasNode(i));return n.dummy=e,r.setNode(i,n),i}function an(r){var e=new re().setGraph(r.graph());return h(r.nodes(),function(n){e.setNode(n,r.node(n))}),h(r.edges(),function(n){var o=e.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),e}function Sr(r){var e=new re({multigraph:r.isMultigraph()}).setGraph(r.graph());return h(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),h(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function Dr(r,e){var{x:n,y:o}=r,i=e.x-n,f=e.y-o,s=r.width/2,u=r.height/2;if(!i&&!f)throw Error("Not possible to find intersection inside of the rectangle");var d,c;if(Math.abs(f)*s>Math.abs(i)*u){if(f<0)u=-u;d=u*i/f,c=u}else{if(i<0)s=-s;d=s,c=s*f/i}return{x:n+d,y:o+c}}function D(r){var e=E(P(Gr(r)+1),function(){return[]});return h(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!we(i))e[i][o.order]=n}),e}function fn(r){var e=B(E(r.nodes(),function(n){return r.node(n).rank}));h(r.nodes(),function(n){var o=r.node(n);if(Lr(o,"rank"))o.rank-=e})}function sn(r){var e=B(E(r.nodes(),function(f){return r.node(f).rank})),n=[];h(r.nodes(),function(f){var s=r.node(f).rank-e;if(!n[s])n[s]=[];n[s].push(f)});var o=0,i=r.graph().nodeRankFactor;h(n,function(f,s){if(we(f)&&s%i!==0)--o;else if(o)h(f,function(u){r.node(u).rank+=o})})}function Fr(r,e,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return T(r,"border",i,e)}function Gr(r){return S(E(r.nodes(),function(e){var n=r.node(e).rank;if(!we(n))return n}))}function un(r,e){var n={lhs:[],rhs:[]};return h(r,function(o){if(e(o))n.lhs.push(o);else n.rhs.push(o)}),n}function dn(r,e){var n=kr();try{return e()}finally{console.log(r+" time: "+(kr()-n)+"ms")}}function cn(r,e){return e()}function ln(r){function e(n){var o=r.children(n),i=r.node(n);if(o.length)h(o,e);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var f=i.minRank,s=i.maxRank+1;f<s;++f)pn(r,"borderLeft","_bl",n,i,f),pn(r,"borderRight","_br",n,i,f)}}h(r.children(),e)}function pn(r,e,n,o,i,f){var s={width:0,height:0,rank:f,borderType:e},u=i[e][f-1],d=T(r,"border",s,n);if(i[e][f]=d,r.setParent(d,o),u)r.setEdge(u,d,{weight:1})}function hn(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")En(r)}function gn(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")as(r);if(e==="lr"||e==="rl")fs(r),En(r)}function En(r){h(r.nodes(),function(e){mn(r.node(e))}),h(r.edges(),function(e){mn(r.edge(e))})}function mn(r){var e=r.width;r.width=r.height,r.height=e}function as(r){h(r.nodes(),function(e){Xr(r.node(e))}),h(r.edges(),function(e){var n=r.edge(e);if(h(n.points,Xr),Object.prototype.hasOwnProperty.call(n,"y"))Xr(n)})}function Xr(r){r.y=-r.y}function fs(r){h(r.nodes(),function(e){Ur(r.node(e))}),h(r.edges(),function(e){var n=r.edge(e);if(h(n.points,Ur),Object.prototype.hasOwnProperty.call(n,"x"))Ur(n)})}function Ur(r){var e=r.x;r.x=r.y,r.y=e}function On(r){r.graph().dummyChains=[],h(r.edges(),function(e){us(r,e)})}function us(r,e){var n=e.v,o=r.node(n).rank,i=e.w,f=r.node(i).rank,s=e.name,u=r.edge(e),d=u.labelRank;if(f===o+1)return;r.removeEdge(e);var c=void 0,p,m;for(m=0,++o;o<f;++m,++o){if(u.points=[],c={width:0,height:0,edgeLabel:u,edgeObj:e,rank:o},p=T(r,"edge",c,"_d"),o===d)c.width=u.width,c.height=u.height,c.dummy="edge-label",c.labelpos=u.labelpos;if(r.setEdge(n,p,{weight:u.weight},s),m===0)r.graph().dummyChains.push(p);n=p}r.setEdge(n,i,{weight:u.weight},s)}function Ln(r){h(r.graph().dummyChains,function(e){var n=r.node(e),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(e)[0],r.removeNode(e),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;e=i,n=r.node(e)}})}function ir(r){var e={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(e,o))return i.rank;e[o]=!0;var f=B(E(r.outEdges(o),function(s){return n(s.w)-r.edge(s).minlen}));if(f===Number.POSITIVE_INFINITY||f===void 0||f===null)f=0;return i.rank=f}h(r.sources(),n)}function U(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function Nr(r){var e=new re({directed:!1}),n=r.nodes()[0],o=r.nodeCount();e.setNode(n,{});var i,f;while(ds(e,r)<o)i=cs(e,r),f=e.hasNode(i.v)?U(r,i):-U(r,i),ps(e,r,f);return e}function ds(r,e){function n(o){h(e.nodeEdges(o),function(i){var f=i.v,s=o===f?i.w:f;if(!r.hasNode(s)&&!U(e,i))r.setNode(s,{}),r.setEdge(o,s,{}),n(s)})}return h(r.nodes(),n),r.nodeCount()}function cs(r,e){return J(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return U(e,n)})}function ps(r,e,n){h(r.nodes(),function(o){e.node(o).rank+=n})}var dh=ot(1);var vh=ot(1);Vr.CycleException=ar;function Vr(r){var e={},n={},o=[];function i(f){if(Object.prototype.hasOwnProperty.call(n,f))throw new ar;if(!Object.prototype.hasOwnProperty.call(e,f))n[f]=!0,e[f]=!0,h(r.predecessors(f),i),delete n[f],o.push(f)}if(h(r.sinks(),i),qt(e)!==r.nodeCount())throw new ar;return o}function ar(){}ar.prototype=Error();function Pr(r,e,n){if(!H(e))e=[e];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],f={};return h(e,function(s){if(!r.hasNode(s))throw Error("Graph does not have node: "+s);Sn(r,s,n==="post",f,o,i)}),i}function Sn(r,e,n,o,i,f){if(!Object.prototype.hasOwnProperty.call(o,e)){if(o[e]=!0,!n)f.push(e);if(h(i(e),function(s){Sn(r,s,n,o,i,f)}),n)f.push(e)}}function Yr(r,e){return Pr(r,e,"post")}function zr(r,e){return Pr(r,e,"pre")}G.initLowLimValues=qr;G.initCutValues=Wr;G.calcCutValue=Pn;G.leaveEdge=An;G.enterEdge=Rn;G.exchangeEdges=Mn;function G(r){r=an(r),ir(r);var e=Nr(r);qr(e),Wr(e,r);var n,o;while(n=An(e))o=Rn(e,r,n),Mn(e,r,n,o)}function Wr(r,e){var n=Yr(r,r.nodes());n=n.slice(0,n.length-1),h(n,function(o){vs(r,e,o)})}function vs(r,e,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Pn(r,e,n)}function Pn(r,e,n){var o=r.node(n),i=o.parent,f=!0,s=e.edge(n,i),u=0;if(!s)f=!1,s=e.edge(i,n);return u=s.weight,h(e.nodeEdges(n),function(d){var c=d.v===n,p=c?d.w:d.v;if(p!==i){var m=c===f,g=e.edge(d).weight;if(u+=m?g:-g,ys(r,n,p)){var b=r.edge(n,p).cutvalue;u+=m?-b:b}}}),u}function qr(r,e){if(arguments.length<2)e=r.nodes()[0];Tn(r,{},1,e)}function Tn(r,e,n,o,i){var f=n,s=r.node(o);if(e[o]=!0,h(r.neighbors(o),function(u){if(!Object.prototype.hasOwnProperty.call(e,u))n=Tn(r,e,n,u,o)}),s.low=f,s.lim=n++,i)s.parent=i;else delete s.parent;return n}function An(r){return nr(r.edges(),function(e){return r.edge(e).cutvalue<0})}function Rn(r,e,n){var{v:o,w:i}=n;if(!e.hasEdge(o,i))o=n.w,i=n.v;var f=r.node(o),s=r.node(i),u=f,d=!1;if(f.lim>s.lim)u=s,d=!0;var c=Qe(e.edges(),function(p){return d===Nn(r,r.node(p.v),u)&&d!==Nn(r,r.node(p.w),u)});return J(c,function(p){return U(e,p)})}function Mn(r,e,n,o){var{v:i,w:f}=n;r.removeEdge(i,f),r.setEdge(o.v,o.w,{}),qr(r),Wr(r,e),bs(r,e)}function bs(r,e){var n=nr(r.nodes(),function(i){return!e.node(i).parent}),o=zr(r,n);o=o.slice(1),h(o,function(i){var f=r.node(i).parent,s=e.edge(i,f),u=!1;if(!s)s=e.edge(f,i),u=!0;e.node(i).rank=e.node(f).rank+(u?s.minlen:-s.minlen)})}function ys(r,e,n){return r.hasEdge(e,n)}function Nn(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Hr(r){switch(r.graph().ranker){case"network-simplex":jn(r);break;case"tight-tree":_s(r);break;case"longest-path":ws(r);break;default:jn(r)}}var ws=ir;function _s(r){ir(r),Nr(r)}function jn(r){G(r)}function Dn(r){var e=T(r,"root",{},"_root"),n=Es(r),o=S(pt(n))-1,i=2*o+1;r.graph().nestingRoot=e,h(r.edges(),function(s){r.edge(s).minlen*=i});var f=xs(r)+1;h(r.children(),function(s){Fn(r,e,i,f,o,n,s)}),r.graph().nodeRankFactor=i}function Fn(r,e,n,o,i,f,s){var u=r.children(s);if(!u.length){if(s!==e)r.setEdge(e,s,{weight:0,minlen:n});return}var d=Fr(r,"_bt"),c=Fr(r,"_bb"),p=r.node(s);if(r.setParent(d,s),p.borderTop=d,r.setParent(c,s),p.borderBottom=c,h(u,function(m){Fn(r,e,n,o,i,f,m);var g=r.node(m),b=g.borderTop?g.borderTop:m,w=g.borderBottom?g.borderBottom:m,y=g.borderTop?o:2*o,v=b!==w?1:i-f[s]+1;r.setEdge(d,b,{weight:y,minlen:v,nestingEdge:!0}),r.setEdge(w,c,{weight:y,minlen:v,nestingEdge:!0})}),!r.parent(s))r.setEdge(e,d,{weight:0,minlen:i+f[s]})}function Es(r){var e={};function n(o,i){var f=r.children(o);if(f&&f.length)h(f,function(s){n(s,i+1)});e[o]=i}return h(r.children(),function(o){n(o,1)}),e}function xs(r){return Xt(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function Gn(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,h(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function Xn(r,e,n){var o={},i;h(n,function(f){var s=r.parent(f),u,d;while(s){if(u=r.parent(s),u)d=o[u],o[u]=s;else d=i,i=s;if(d&&d!==s){e.setEdge(d,s);return}s=u}})}function Un(r,e,n){var o=Ls(r),i=new re({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(f){return r.node(f)});return h(r.nodes(),function(f){var s=r.node(f),u=r.parent(f);if(s.rank===e||s.minRank<=e&&e<=s.maxRank){if(i.setNode(f),i.setParent(f,u||o),h(r[n](f),function(d){var c=d.v===f?d.w:d.v,p=i.edge(c,f),m=!we(p)?p.weight:0;i.setEdge(c,f,{weight:r.edge(d).weight+m})}),Object.prototype.hasOwnProperty.call(s,"minRank"))i.setNode(f,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]})}}),i}function Ls(r){var e;while(r.hasNode(e=Q("_root")));return e}function Vn(r,e){var n=0;for(var o=1;o<e.length;++o)n+=Is(r,e[o-1],e[o]);return n}function Is(r,e,n){var o=Ar(n,E(n,function(c,p){return p})),i=N(E(e,function(c){return A(E(r.outEdges(c),function(p){return{pos:o[p.w],weight:r.edge(p).weight}}),"pos")})),f=1;while(f<n.length)f<<=1;var s=2*f-1;f-=1;var u=E(Array(s),function(){return 0}),d=0;return h(i.forEach(function(c){var p=c.pos+f;u[p]+=c.weight;var m=0;while(p>0){if(p%2)m+=u[p+1];p=p-1>>1,u[p]+=c.weight}d+=c.weight*m})),d}function zn(r){var e={},n=Qe(r.nodes(),function(u){return!r.children(u).length}),o=S(E(n,function(u){return r.node(u).rank})),i=E(P(o+1),function(){return[]});function f(u){if(Lr(e,u))return;e[u]=!0;var d=r.node(u);i[d.rank].push(u),h(r.successors(u),f)}var s=A(n,function(u){return r.node(u).rank});return h(s,f),i}function Wn(r,e){return E(e,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=Xt(o,function(f,s){var u=r.edge(s),d=r.node(s.v);return{sum:f.sum+u.weight*d.order,weight:f.weight+u.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function qn(r,e){var n={};h(r,function(i,f){var s=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:f};if(!we(i.barycenter))s.barycenter=i.barycenter,s.weight=i.weight}),h(e.edges(),function(i){var f=n[i.v],s=n[i.w];if(!we(f)&&!we(s))s.indegree++,f.out.push(n[i.w])});var o=Qe(n,function(i){return!i.indegree});return Ss(o)}function Ss(r){var e=[];function n(f){return function(s){if(s.merged)return;if(we(s.barycenter)||we(f.barycenter)||s.barycenter>=f.barycenter)Ns(f,s)}}function o(f){return function(s){if(s.in.push(f),--s.indegree===0)r.push(s)}}while(r.length){var i=r.pop();e.push(i),h(i.in.reverse(),n(i)),h(i.out,o(i))}return E(Qe(e,function(f){return!f.merged}),function(f){return Z(f,["vs","i","barycenter","weight"])})}function Ns(r,e){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(e.weight)n+=e.barycenter*e.weight,o+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(e.i,r.i),e.merged=!0}function Kn(r,e){var n=un(r,function(p){return Object.prototype.hasOwnProperty.call(p,"barycenter")}),o=n.lhs,i=A(n.rhs,function(p){return-p.i}),f=[],s=0,u=0,d=0;o.sort(Ps(!!e)),d=Hn(f,i,d),h(o,function(p){d+=p.vs.length,f.push(p.vs),s+=p.barycenter*p.weight,u+=p.weight,d=Hn(f,i,d)});var c={vs:N(f)};if(u)c.barycenter=s/u,c.weight=u;return c}function Hn(r,e,n){var o;while(e.length&&(o=X(e)).i<=n)e.pop(),r.push(o.vs),n++;return n}function Ps(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Kr(r,e,n,o){var i=r.children(e),f=r.node(e),s=f?f.borderLeft:void 0,u=f?f.borderRight:void 0,d={};if(s)i=Qe(i,function(w){return w!==s&&w!==u});var c=Wn(r,i);h(c,function(w){if(r.children(w.v).length){var y=Kr(r,w.v,n,o);if(d[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Ts(w,y)}});var p=qn(c,n);ks(p,d);var m=Kn(p,o);if(s){if(m.vs=N([s,m.vs,u]),r.predecessors(s).length){var g=r.node(r.predecessors(s)[0]),b=r.node(r.predecessors(u)[0]);if(!Object.prototype.hasOwnProperty.call(m,"barycenter"))m.barycenter=0,m.weight=0;m.barycenter=(m.barycenter*m.weight+g.order+b.order)/(m.weight+2),m.weight+=2}}return m}function ks(r,e){h(r,function(n){n.vs=N(n.vs.map(function(o){if(e[o])return e[o].vs;return o}))})}function Ts(r,e){if(!we(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function $n(r){var e=Gr(r),n=Jn(r,P(1,e+1),"inEdges"),o=Jn(r,P(e-1,-1,-1),"outEdges"),i=zn(r);Zn(r,i);var f=Number.POSITIVE_INFINITY,s;for(var u=0,d=0;d<4;++u,++d){Cs(u%2?n:o,u%4>=2),i=D(r);var c=Vn(r,i);if(c<f)d=0,s=Ze(i),f=c}Zn(r,s)}function Jn(r,e,n){return E(e,function(o){return Un(r,o,n)})}function Cs(r,e){var n=new re;h(r,function(o){var i=o.graph().root,f=Kr(o,i,n,e);h(f.vs,function(s,u){o.node(s).order=u}),Xn(o,n,f.vs)})}function Zn(r,e){h(e,function(n){h(n,function(o,i){r.node(o).order=i})})}function Qn(r){var e=Rs(r);h(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,f=As(r,e,i.v,i.w),{path:s,lca:u}=f,d=0,c=s[d],p=!0;while(n!==i.w){if(o=r.node(n),p){while((c=s[d])!==u&&r.node(c).maxRank<o.rank)d++;if(c===u)p=!1}if(!p){while(d<s.length-1&&r.node(c=s[d+1]).minRank<=o.rank)d++;c=s[d]}r.setParent(n,c),n=r.successors(n)[0]}})}function As(r,e,n,o){var i=[],f=[],s=Math.min(e[n].low,e[o].low),u=Math.max(e[n].lim,e[o].lim),d,c;d=n;do d=r.parent(d),i.push(d);while(d&&(e[d].low>s||u>e[d].lim));c=d,d=o;while((d=r.parent(d))!==c)f.push(d);return{path:i.concat(f.reverse()),lca:c}}function Rs(r){var e={},n=0;function o(i){var f=n;h(r.children(i),o),e[i]={low:f,lim:n++}}return h(r.children(),o),e}function Ms(r,e){var n={};function o(i,f){var s=0,u=0,d=i.length,c=X(f);return h(f,function(p,m){var g=Bs(r,p),b=g?r.node(g).order:d;if(g||p===c)h(f.slice(u,m+1),function(w){h(r.predecessors(w),function(y){var v=r.node(y),_=v.order;if((_<s||b<_)&&!(v.dummy&&r.node(w).dummy))ro(n,y,w)})}),u=m+1,s=b}),f}return Xt(e,o),n}function js(r,e){var n={};function o(f,s,u,d,c){var p;h(P(s,u),function(m){if(p=f[m],r.node(p).dummy)h(r.predecessors(p),function(g){var b=r.node(g);if(b.dummy&&(b.order<d||b.order>c))ro(n,g,p)})})}function i(f,s){var u=-1,d,c=0;return h(s,function(p,m){if(r.node(p).dummy==="border"){var g=r.predecessors(p);if(g.length)d=r.node(g[0]).order,o(s,c,m,u,d),c=m,u=d}o(s,c,s.length,d,f.length)}),s}return Xt(e,i),n}function Bs(r,e){if(r.node(e).dummy)return nr(r.predecessors(e),function(n){return r.node(n).dummy})}function ro(r,e,n){if(e>n){var o=e;e=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[e];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ds(r,e,n){if(e>n){var o=e;e=n,n=o}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function Fs(r,e,n,o){var i={},f={},s={};return h(e,function(u){h(u,function(d,c){i[d]=d,f[d]=d,s[d]=c})}),h(e,function(u){var d=-1;h(u,function(c){var p=o(c);if(p.length){p=A(p,function(y){return s[y]});var m=(p.length-1)/2;for(var g=Math.floor(m),b=Math.ceil(m);g<=b;++g){var w=p[g];if(f[c]===c&&d<s[w]&&!Ds(n,c,w))f[w]=c,f[c]=i[c]=i[w],d=s[w]}}})}),{root:i,align:f}}function Gs(r,e,n,o,i){var f={},s=Xs(r,e,n,i),u=i?"borderLeft":"borderRight";function d(m,g){var b=s.nodes(),w=b.pop(),y={};while(w){if(y[w])m(w);else y[w]=!0,b.push(w),b=b.concat(g(w));w=b.pop()}}function c(m){f[m]=s.inEdges(m).reduce(function(g,b){return Math.max(g,f[b.v]+s.edge(b))},0)}function p(m){var g=s.outEdges(m).reduce(function(w,y){return Math.min(w,f[y.w]-s.edge(y))},Number.POSITIVE_INFINITY),b=r.node(m);if(g!==Number.POSITIVE_INFINITY&&b.borderType!==u)f[m]=Math.max(f[m],g)}return d(c,s.predecessors.bind(s)),d(p,s.successors.bind(s)),h(o,function(m){f[m]=f[n[m]]}),f}function Xs(r,e,n,o){var i=new re,f=r.graph(),s=zs(f.nodesep,f.edgesep,o);return h(e,function(u){var d;h(u,function(c){var p=n[c];if(i.setNode(p),d){var m=n[d],g=i.edge(m,p);i.setEdge(m,p,Math.max(s(r,c,d),g||0))}d=c})}),i}function Us(r,e){return J(pt(e),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return lt(n,function(f,s){var u=Ws(r,s)/2;o=Math.max(f+u,o),i=Math.min(f-u,i)}),o-i})}function Vs(r,e){var n=pt(e),o=B(n),i=S(n);h(["u","d"],function(f){h(["l","r"],function(s){var u=f+s,d=r[u],c;if(d===e)return;var p=pt(d);if(c=s==="l"?o-B(p):i-S(p),c)r[u]=q(d,function(m){return m+c})})})}function Ys(r,e){return q(r.ul,function(n,o){if(e)return r[e.toLowerCase()][o];else{var i=A(E(r,o));return(i[1]+i[2])/2}})}function eo(r){var e=D(r),n=or(Ms(r,e),js(r,e)),o={},i;h(["u","d"],function(s){i=s==="u"?e:pt(e).reverse(),h(["l","r"],function(u){if(u==="r")i=E(i,function(m){return pt(m).reverse()});var d=(s==="u"?r.predecessors:r.successors).bind(r),c=Fs(r,i,n,d),p=Gs(r,i,c.root,c.align,u==="r");if(u==="r")p=q(p,function(m){return-m});o[s+u]=p})});var f=Us(r,o);return Vs(o,f),Ys(o,r.graph().align)}function zs(r,e,n){return function(o,i,f){var s=o.node(i),u=o.node(f),d=0,c;if(d+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=-s.width/2;break;case"r":c=s.width/2;break}if(c)d+=n?c:-c;if(c=0,d+=(s.dummy?e:r)/2,d+=(u.dummy?e:r)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":c=u.width/2;break;case"r":c=-u.width/2;break}if(c)d+=n?c:-c;return c=0,d}}function Ws(r,e){return r.node(e).width}function to(r){r=Sr(r),qs(r),mt(eo(r),function(e,n){r.node(n).x=e})}function qs(r){var e=D(r),n=r.graph().ranksep,o=0;h(e,function(i){var f=S(E(i,function(s){return r.node(s).height}));h(i,function(s){r.node(s).y=o+f/2}),o+=f+n})}function $r(r,e){var n=e&&e.debugTiming?dn:cn;n("layout",()=>{var o=n(" buildLayoutGraph",()=>ou(r));n(" runLayout",()=>Hs(o,n)),n(" updateInputGraph",()=>Ks(r,o))})}function Hs(r,e){e(" makeSpaceForEdgeLabels",()=>iu(r)),e(" removeSelfEdges",()=>mu(r)),e(" acyclic",()=>rn(r)),e(" nestingGraph.run",()=>Dn(r)),e(" rank",()=>Hr(Sr(r))),e(" injectEdgeLabelProxies",()=>au(r)),e(" removeEmptyRanks",()=>sn(r)),e(" nestingGraph.cleanup",()=>Gn(r)),e(" normalizeRanks",()=>fn(r)),e(" assignRankMinMax",()=>fu(r)),e(" removeEdgeLabelProxies",()=>su(r)),e(" normalize.run",()=>On(r)),e(" parentDummyChains",()=>Qn(r)),e(" addBorderSegments",()=>ln(r)),e(" order",()=>$n(r)),e(" insertSelfEdges",()=>hu(r)),e(" adjustCoordinateSystem",()=>hn(r)),e(" position",()=>to(r)),e(" positionSelfEdges",()=>gu(r)),e(" removeBorderNodes",()=>lu(r)),e(" normalize.undo",()=>Ln(r)),e(" fixupEdgeLabelCoords",()=>cu(r)),e(" undoCoordinateSystem",()=>gn(r)),e(" translateGraph",()=>uu(r)),e(" assignNodeIntersects",()=>du(r)),e(" reversePoints",()=>pu(r)),e(" acyclic.undo",()=>nn(r))}function Ks(r,e){h(r.nodes(),function(n){var o=r.node(n),i=e.node(n);if(o){if(o.x=i.x,o.y=i.y,e.children(n).length)o.width=i.width,o.height=i.height}}),h(r.edges(),function(n){var o=r.edge(n),i=e.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var Js=["nodesep","edgesep","ranksep","marginx","marginy"],Zs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$s=["acyclicer","ranker","rankdir","align"],Qs=["width","height"],ru={width:0,height:0},eu=["minlen","weight","width","height","labeloffset"],tu={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nu=["labelpos"];function ou(r){var e=new re({multigraph:!0,compound:!0}),n=Zr(r.graph());return e.setGraph(or({},Zs,Jr(n,Js),Z(n,$s))),h(r.nodes(),function(o){var i=Zr(r.node(o));e.setNode(o,et(Jr(i,Qs),ru)),e.setParent(o,r.parent(o))}),h(r.edges(),function(o){var i=Zr(r.edge(o));e.setEdge(o,or({},tu,Jr(i,eu),Z(i,nu)))}),e}function iu(r){var e=r.graph();e.ranksep/=2,h(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function au(r){h(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var o=r.node(e.v),i=r.node(e.w),f={rank:(i.rank-o.rank)/2+o.rank,e};T(r,"edge-proxy",f,"_ep")}})}function fu(r){var e=0;h(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,e=S(e,o.maxRank)}),r.graph().maxRank=e}function su(r){h(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function uu(r){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,f=r.graph(),s=f.marginx||0,u=f.marginy||0;function d(c){var{x:p,y:m,width:g,height:b}=c;e=Math.min(e,p-g/2),n=Math.max(n,p+g/2),o=Math.min(o,m-b/2),i=Math.max(i,m+b/2)}h(r.nodes(),function(c){d(r.node(c))}),h(r.edges(),function(c){var p=r.edge(c);if(Object.prototype.hasOwnProperty.call(p,"x"))d(p)}),e-=s,o-=u,h(r.nodes(),function(c){var p=r.node(c);p.x-=e,p.y-=o}),h(r.edges(),function(c){var p=r.edge(c);if(h(p.points,function(m){m.x-=e,m.y-=o}),Object.prototype.hasOwnProperty.call(p,"x"))p.x-=e;if(Object.prototype.hasOwnProperty.call(p,"y"))p.y-=o}),f.width=n-e+s,f.height=i-o+u}function du(r){h(r.edges(),function(e){var n=r.edge(e),o=r.node(e.v),i=r.node(e.w),f,s;if(!n.points)n.points=[],f=i,s=o;else f=n.points[0],s=n.points[n.points.length-1];n.points.unshift(Dr(o,f)),n.points.push(Dr(i,s))})}function cu(r){h(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function pu(r){h(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function lu(r){h(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),o=r.node(n.borderTop),i=r.node(n.borderBottom),f=r.node(X(n.borderLeft)),s=r.node(X(n.borderRight));n.width=Math.abs(s.x-f.x),n.height=Math.abs(i.y-o.y),n.x=f.x+n.width/2,n.y=o.y+n.height/2}}),h(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function mu(r){h(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function hu(r){var e=D(r);h(e,function(n){var o=0;h(n,function(i,f){var s=r.node(i);s.order=f+o,h(s.selfEdges,function(u){T(r,"selfedge",{width:u.label.width,height:u.label.height,rank:s.rank,order:f+ ++o,e:u.e,label:u.label},"_se")}),delete s.selfEdges})})}function gu(r){h(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,f=o.y,s=n.x-i,u=o.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:i+2*s/3,y:f-u},{x:i+5*s/6,y:f-u},{x:i+s,y:f},{x:i+5*s/6,y:f+u},{x:i+2*s/3,y:f+u}],n.label.x=n.x,n.label.y=n.y}})}function Jr(r,e){return q(Z(r,e),Number)}function Zr(r){var e={};return h(r,function(n,o){e[o.toLowerCase()]=n}),e}var no=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),fo=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),vu=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),bu=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],yu=t((r,e,n,o,i)=>{let f=[],s=new Set;if(n.forEach(({start:p,end:m})=>{if(p!==o)s.add(p);if(m!==o)s.add(m)}),s.forEach((p)=>{let m=r.node(p);if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)}),f.length===0)n.forEach(({edge:p})=>{(p.points??[]).forEach((m)=>{if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)})});if(f.length===0)return fo(i);let u=f.reduce((p,m)=>({x:p.x+m.x/f.length,y:p.y+m.y/f.length}),{x:0,y:0}),d=u.x-e.x,c=u.y-e.y;if(Math.abs(d)>Math.abs(c))return d>0?"right":"left";if(Math.abs(c)>0)return c>0?"bottom":"top";return fo(i)},"getSelfLoopSide"),wu=t((r,e="top",n=0,o=0)=>{let i=r.x,f=r.y-n,s=r.width/2,u=r.height/2,d=Math.max(36,Math.min(100,r.width*0.8)),c=no(Math.max(o,r.width*0.35),36,d),p=no(Math.min(r.width,r.height)*0.45,24,48);switch(e){case"bottom":{let m=f+u;return[{x:i-c/2,y:m},{x:i-c/2,y:m+p},{x:i+c/2,y:m+p},{x:i+c/2,y:m}]}case"right":{let m=i+s;return[{x:m,y:f-c/2},{x:m+p,y:f-c/2},{x:m+p,y:f+c/2},{x:m,y:f+c/2}]}case"left":{let m=i-s;return[{x:m,y:f-c/2},{x:m-p,y:f-c/2},{x:m-p,y:f+c/2},{x:m,y:f+c/2}]}case"top":default:{let m=f-u;return[{x:i-c/2,y:m},{x:i-c/2,y:m-p},{x:i+c/2,y:m-p},{x:i+c/2,y:m}]}}},"getSelfLoopPoints"),_u=t((r,e,n="top",o=0,i={})=>{let s=r.x,u=r.y-o,d=i.width??0,c=i.height??0;switch(n){case"bottom":return{x:s,y:Math.max(...e.map((p)=>p.y))+c/2+4};case"right":return{x:Math.max(...e.map((p)=>p.x))+d/2+4,y:u};case"left":return{x:Math.min(...e.map((p)=>p.x))-d/2-4,y:u};case"top":default:return{x:s,y:Math.min(...e.map((p)=>p.y))-c/2-4}}},"getSelfLoopLabelPosition"),ao=t((r,e=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],f=r.graph()?.rankdir;return r.edges().forEach((s)=>{let u=r.edge(s);if(n&&u.selfLoop){let d=u.selfLoop.id;if(!o.has(d))o.set(d,[]);o.get(d).push({edge:u,start:s.v,end:s.w})}else i.push({edge:u,start:s.v,end:s.w})}),o.forEach((s)=>{if(s.length!==3){s.forEach((_)=>i.push(_));return}s.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[u,d,c]=s,p=u.edge.originalEdge??d.edge.originalEdge??c.edge.originalEdge??d.edge,m=r.node(p.start);if(!m){s.forEach((_)=>i.push(_));return}let g={width:d.edge.width,height:d.edge.height},b=yu(r,m,s,p.start,f),w=wu(m,b,e,g.width??0),y=_u(m,w,b,e,g),v={...d.edge,...p,id:p.id,points:w,start:p.start,end:p.end,x:y.x,y:y.y,width:g.width,height:g.height,labelStyle:d.edge.labelStyle,fromCluster:u.edge.fromCluster??d.edge.fromCluster??c.edge.fromCluster,toCluster:u.edge.toCluster??d.edge.toCluster??c.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),co=t(async({element:r,graph:e,diagramType:n,id:o,parentCluster:i,siteConfig:f})=>{let s=e.graph().rankdir;a.trace("Dir in recursive render - dir:",s);let{clusters:u,edgePaths:d,edgeLabels:c,nodes:p,rootGroups:m}=pa(r,{edgePathsClass:"edgePaths"});if(!e.nodes())a.info("No nodes found for",e);else a.info("Recursive render XXX",e.nodes());if(e.edges().length>0)a.info("Recursive edges",e.edge(e.edges()[0]));let g=vu(n);await Promise.all(e.nodes().map(async function(y){let v=e.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(a.trace(`Setting data for parent cluster XXX
1
+ import{t,a,l,I,St,_o,bt,Qt,Et,Gn,Jt}from"./chunk-e763h2px.js";import{xe,Oe,Qe,Ee,pt,qt,H,me,st,Vt,lt,sr,ma,fa,ha,hn,kt,ga,gn,$e,yn,Ot,Ct,vn,Wt,bn,ya,va,lr,_e,ba,xn,Gt,_n,cr,ur,Ht,xa,dr,_a,zr,mt,pr,wa,ka,Ca,He,mr,fr,wn,Sa,hr,h,Je,ft,we,Yt,re}from"./chunk-4rwwtfnd.js";import{ua,da,W,On,io,pa,or}from"./chunk-36dc7tcg.js";import{Rt}from"./chunk-kahab58k.js";var yr={};Rt(yr,{default:()=>rr});var lo=/\s/;function mo(r){var e=r.length;while(e--&&lo.test(r.charAt(e)));return e}var te=mo;var ho=/^\s+/;function go(r){return r?r.slice(0,te(r)+1).replace(ho,""):r}var ne=go;var oe=NaN,vo=/^[-+]0x[0-9a-f]+$/i,bo=/^0b[01]+$/i,yo=/^0o[0-7]+$/i,wo=parseInt;function Eo(r){if(typeof r=="number")return r;if(pt(r))return oe;if(me(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=me(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=ne(r);var n=bo.test(r);return n||yo.test(r)?wo(r.slice(2),n?2:8):vo.test(r)?oe:+r}var ie=Eo;var ae=1/0,xo=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function Oo(r){if(!r)return r===0?r:0;if(r=ie(r),r===ae||r===-ae){var e=r<0?-1:1;return e*xo}return r===r?r:0}var V=Oo;function So(r){var e=V(r),n=e%1;return e===e?n?e-n:e:0}var fe=So;var se=Object.create,No=function(){function r(){}return function(e){if(!me(e))return{};if(se)return se(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),ue=No;function Po(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var vr=Po;function ko(r,e,n){if(e=="__proto__"&&sr)sr(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var M=ko;var To=Object.prototype,Co=To.hasOwnProperty;function Ao(r,e,n){var o=r[e];if(!(Co.call(r,e)&&kt(o,n))||n===void 0&&!(e in r))M(r,e,n)}var j=Ao;function Ro(r,e,n,o){var i=!n;n||(n={});var f=-1,s=e.length;while(++f<s){var u=e[f],d=o?o(n[u],r[u],u,n,r):void 0;if(d===void 0)d=r[u];if(i)M(n,u,d);else j(n,u,d)}return n}var k=Ro;function Mo(r,e,n){if(!me(n))return!1;var o=typeof e;if(o=="number"?$e(n)&&hn(e,n.length):o=="string"&&(e in n))return kt(n[e],r);return!1}var C=Mo;function jo(r){return gn(function(e,n){var o=-1,i=n.length,f=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;if(f=r.length>3&&typeof f=="function"?(i--,f):void 0,s&&C(n[0],n[1],s))f=i<3?void 0:f,i=1;e=Object(e);while(++o<i){var u=n[o];if(u)r(e,u,o,f)}return e})}var de=jo;function Bo(r){var e=[];if(r!=null)for(var n in Object(r))e.push(n);return e}var ce=Bo;var Fo=Object.prototype,Go=Fo.hasOwnProperty;function Xo(r){if(!me(r))return ce(r);var e=yn(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!Go.call(r,o))))n.push(o);return n}var pe=Xo;function Uo(r){return $e(r)?ya(r,!0):pe(r)}var L=Uo;function Vo(r){var e=r==null?0:r.length;return e?ur(r,1):[]}var N=Vo;function Yo(r){return ma(ga(r,void 0,N),r+"")}var le=Yo;var zo=va(Object.getPrototypeOf,Object),Y=zo;var Wo="[object Object]",qo=Function.prototype,Ho=Object.prototype,he=qo.toString,Ko=Ho.hasOwnProperty,Jo=he.call(Object);function Zo(r){if(!Ee(r)||Qe(r)!=Wo)return!1;var e=Y(r);if(e===null)return!0;var n=Ko.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&he.call(n)==Jo}var ge=Zo;var $o="\\ud800-\\udfff",Qo="\\u0300-\\u036f",ri="\\ufe20-\\ufe2f",ei="\\u20d0-\\u20ff",ti=Qo+ri+ei,ni="\\ufe0e\\ufe0f",oi="\\u200d",ii=RegExp("["+oi+$o+ti+ni+"]");function ai(r){return ii.test(r)}var ve=ai;function fi(r,e){return r&&k(e,_e(e),r)}var be=fi;function si(r,e){return r&&k(e,L(e),r)}var ye=si;var Ne=typeof yr=="object"&&yr&&!yr.nodeType&&yr,Le=Ne&&typeof br=="object"&&br&&!br.nodeType&&br,ui=Le&&Le.exports===Ne,Ie=ui?xe.Buffer:void 0,Se=Ie?Ie.allocUnsafe:void 0;function di(r,e){if(e)return r.slice();var n=r.length,o=Se?Se(n):new r.constructor(n);return r.copy(o),o}var rr=di;function ci(r,e){return k(r,dr(r),e)}var Pe=ci;var pi=Object.getOwnPropertySymbols,li=!pi?xa:function(r){var e=[];while(r)cr(e,dr(r)),r=Y(r);return e},wr=li;function mi(r,e){return k(r,wr(r),e)}var ke=mi;function hi(r){return _a(r,L,wr)}var Te=hi;var gi=Object.prototype,vi=gi.hasOwnProperty;function bi(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&vi.call(r,"index"))n.index=r.index,n.input=r.input;return n}var Ce=bi;function yi(r){var e=new r.constructor(r.byteLength);return new pr(e).set(new pr(r)),e}var z=yi;function wi(r,e){var n=e?z(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var Ae=wi;var _i=/\w*$/;function Ei(r){var e=new r.constructor(r.source,_i.exec(r));return e.lastIndex=r.lastIndex,e}var Re=Ei;var Me=Oe?Oe.prototype:void 0,je=Me?Me.valueOf:void 0;function xi(r){return je?Object(je.call(r)):{}}var Be=xi;function Oi(r,e){var n=e?z(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var _r=Oi;var Li="[object Boolean]",Ii="[object Date]",Si="[object Map]",Ni="[object Number]",Pi="[object RegExp]",ki="[object Set]",Ti="[object String]",Ci="[object Symbol]",Ai="[object ArrayBuffer]",Ri="[object DataView]",Mi="[object Float32Array]",ji="[object Float64Array]",Bi="[object Int8Array]",Di="[object Int16Array]",Fi="[object Int32Array]",Gi="[object Uint8Array]",Xi="[object Uint8ClampedArray]",Ui="[object Uint16Array]",Vi="[object Uint32Array]";function Yi(r,e,n){var o=r.constructor;switch(e){case Ai:return z(r);case Li:case Ii:return new o(+r);case Ri:return Ae(r,n);case Mi:case ji:case Bi:case Di:case Fi:case Gi:case Xi:case Ui:case Vi:return _r(r,n);case Si:return new o;case Ni:case Ti:return new o(r);case Pi:return Re(r);case ki:return new o;case Ci:return Be(r)}}var De=Yi;function zi(r){return typeof r.constructor=="function"&&!yn(r)?ue(Y(r)):{}}var Er=zi;var Wi="[object Map]";function qi(r){return Ee(r)&&mt(r)==Wi}var Fe=qi;var Ge=Wt&&Wt.isMap,Hi=Ge?vn(Ge):Fe,Xe=Hi;var Ki="[object Set]";function Ji(r){return Ee(r)&&mt(r)==Ki}var Ue=Ji;var Ve=Wt&&Wt.isSet,Zi=Ve?vn(Ve):Ue,Ye=Zi;var $i=1,Qi=2,ra=4,ze="[object Arguments]",ea="[object Array]",ta="[object Boolean]",na="[object Date]",oa="[object Error]",We="[object Function]",ia="[object GeneratorFunction]",aa="[object Map]",sa="[object Number]",qe="[object Object]",ca="[object RegExp]",la="[object Set]",Ea="[object String]",Oa="[object Symbol]",La="[object WeakMap]",Ia="[object ArrayBuffer]",Na="[object DataView]",Pa="[object Float32Array]",Ta="[object Float64Array]",Aa="[object Int8Array]",Ra="[object Int16Array]",Ma="[object Int32Array]",ja="[object Uint8Array]",Ba="[object Uint8ClampedArray]",Da="[object Uint16Array]",Fa="[object Uint32Array]",x={};x[ze]=x[ea]=x[Ia]=x[Na]=x[ta]=x[na]=x[Pa]=x[Ta]=x[Aa]=x[Ra]=x[Ma]=x[aa]=x[sa]=x[qe]=x[ca]=x[la]=x[Ea]=x[Oa]=x[ja]=x[Ba]=x[Da]=x[Fa]=!0;x[oa]=x[We]=x[La]=!1;function xr(r,e,n,o,i,f){var s,u=e&$i,d=e&Qi,c=e&ra;if(n)s=i?n(r,o,i,f):n(r);if(s!==void 0)return s;if(!me(r))return r;var p=H(r);if(p){if(s=Ce(r),!u)return vr(r,s)}else{var m=mt(r),g=m==We||m==ia;if(Ct(r))return rr(r,u);if(m==qe||m==ze||g&&!i){if(s=d||g?{}:Er(r),!u)return d?ke(r,ye(s,r)):Pe(r,be(s,r))}else{if(!x[m])return i?r:{};s=De(r,m,u)}}f||(f=new Ht);var b=f.get(r);if(b)return b;if(f.set(r,s),Ye(r))r.forEach(function(v){s.add(xr(v,e,n,v,r,f))});else if(Xe(r))r.forEach(function(v,_){s.set(_,xr(v,e,n,_,r,f))});var w=c?d?Te:zr:d?L:_e,y=p?void 0:w(r);return fa(y||r,function(v,_){if(y)_=v,v=r[_];j(s,_,xr(v,e,n,_,r,f))}),s}var Ke=xr;var Ga=1,Xa=4;function Ua(r){return Ke(r,Ga|Xa)}var Ze=Ua;var Va=function(){return xe.Date.now()},kr=Va;var rt=Object.prototype,Ya=rt.hasOwnProperty,za=gn(function(r,e){r=Object(r);var n=-1,o=e.length,i=o>2?e[2]:void 0;if(i&&C(e[0],e[1],i))o=1;while(++n<o){var f=e[n],s=L(f),u=-1,d=s.length;while(++u<d){var c=s[u],p=r[c];if(p===void 0||kt(p,rt[c])&&!Ya.call(r,c))r[c]=f[c]}}return r}),et=za;function Wa(r,e,n){if(n!==void 0&&!kt(r[e],n)||n===void 0&&!(e in r))M(r,e,n)}var er=Wa;function qa(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var tr=qa;function Ha(r){return k(r,L(r))}var tt=Ha;function Ka(r,e,n,o,i,f,s){var u=tr(r,n),d=tr(e,n),c=s.get(d);if(c){er(r,n,c);return}var p=f?f(u,d,n+"",r,e,s):void 0,m=p===void 0;if(m){var g=H(d),b=!g&&Ct(d),w=!g&&!b&&bn(d);if(p=d,g||b||w)if(H(u))p=u;else if(Sa(u))p=vr(u);else if(b)m=!1,p=rr(d,!0);else if(w)m=!1,p=_r(d,!0);else p=[];else if(ge(d)||Ot(d)){if(p=u,Ot(u))p=tt(u);else if(!me(u)||Vt(u))p=Er(d)}else m=!1}if(m)s.set(d,p),i(p,d,o,f,s),s.delete(d);er(r,n,p)}var nt=Ka;function ot(r,e,n,o,i){if(r===e)return;mr(e,function(f,s){if(i||(i=new Ht),me(f))nt(r,e,s,n,ot,o,i);else{var u=o?o(tr(r,s),f,s+"",r,e,i):void 0;if(u===void 0)u=f;er(r,s,u)}},L)}var it=ot;function Ja(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var X=Ja;function Za(r){return function(e,n,o){var i=Object(e);if(!$e(e)){var f=He(n,3);e=_e(e),n=function(u){return f(i[u],u,i)}}var s=r(e,n,o);return s>-1?i[f?e[s]:s]:void 0}}var at=Za;var $a=Math.max;function Qa(r,e,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:fe(n);if(i<0)i=$a(o+i,0);return ha(r,He(e,3),i)}var ut=Qa;var rf=at(ut),nr=rf;function ef(r,e){var n=-1,o=$e(r)?Array(r.length):[];return wn(r,function(i,f,s){o[++n]=e(i,f,s)}),o}var Or=ef;function tf(r,e){var n=H(r)?qt:Or;return n(r,He(e,3))}var E=tf;function nf(r,e){return r==null?r:mr(r,hr(e),L)}var dt=nf;function of(r,e){return r&&fr(r,hr(e))}var ct=of;function af(r,e){return r>e}var ht=af;var ff=Object.prototype,sf=ff.hasOwnProperty;function uf(r,e){return r!=null&&sf.call(r,e)}var gt=uf;function df(r,e){return r!=null&&wa(r,e,gt)}var Lr=df;var cf="[object String]";function pf(r){return typeof r=="string"||!H(r)&&Ee(r)&&Qe(r)==cf}var vt=pf;function lf(r,e){return r<e}var Ir=lf;function mf(r,e){var n={};return e=He(e,3),fr(r,function(o,i,f){M(n,i,e(o,i,f))}),n}var q=mf;function hf(r,e,n){var o=-1,i=r.length;while(++o<i){var f=r[o],s=e(f);if(s!=null&&(u===void 0?s===s&&!pt(s):n(s,u)))var u=s,d=f}return d}var K=hf;function gf(r){return r&&r.length?K(r,st,ht):void 0}var S=gf;var vf=de(function(r,e,n){it(r,e,n)}),ir=vf;function bf(r){return r&&r.length?K(r,st,Ir):void 0}var B=bf;function yf(r,e){return r&&r.length?K(r,He(e,2),Ir):void 0}var J=yf;function wf(r,e,n,o){if(!me(r))return r;e=xn(e,r);var i=-1,f=e.length,s=f-1,u=r;while(u!=null&&++i<f){var d=Gt(e[i]),c=n;if(d==="__proto__"||d==="constructor"||d==="prototype")return r;if(i!=s){var p=u[d];if(c=o?o(p,d,u):void 0,c===void 0)c=me(p)?p:hn(e[i+1])?[]:{}}j(u,d,c),u=u[d]}return r}var yt=wf;function _f(r,e,n){var o=-1,i=e.length,f={};while(++o<i){var s=e[o],u=_n(r,s);if(n(u,s))yt(f,xn(s,r),u)}return f}var wt=_f;function Ef(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var _t=Ef;function xf(r,e){if(r!==e){var n=r!==void 0,o=r===null,i=r===r,f=pt(r),s=e!==void 0,u=e===null,d=e===e,c=pt(e);if(!u&&!c&&!f&&r>e||f&&s&&d&&!u&&!c||o&&s&&d||!n&&d||!i)return 1;if(!o&&!f&&!c&&r<e||c&&n&&i&&!o&&!f||u&&n&&i||!s&&i||!d)return-1}return 0}var xt=xf;function Of(r,e,n){var o=-1,i=r.criteria,f=e.criteria,s=i.length,u=n.length;while(++o<s){var d=xt(i[o],f[o]);if(d){if(o>=u)return d;var c=n[o];return d*(c=="desc"?-1:1)}}return r.index-e.index}var Lt=Of;function Lf(r,e,n){if(e.length)e=qt(e,function(f){if(H(f))return function(s){return _n(s,f.length===1?f[0]:f)};return f});else e=[st];var o=-1;e=qt(e,vn(He));var i=Or(r,function(f,s,u){var d=qt(e,function(c){return c(f)});return{criteria:d,index:++o,value:f}});return _t(i,function(f,s){return Lt(f,s,n)})}var It=Lf;var If=Ca("length"),Nt=If;var Tt="\\ud800-\\udfff",Sf="\\u0300-\\u036f",Nf="\\ufe20-\\ufe2f",Pf="\\u20d0-\\u20ff",kf=Sf+Nf+Pf,Tf="\\ufe0e\\ufe0f",Cf="["+Tt+"]",Tr="["+kf+"]",Cr="\\ud83c[\\udffb-\\udfff]",Af="(?:"+Tr+"|"+Cr+")",At="[^"+Tt+"]",Mt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Rf="\\u200d",Bt=Af+"?",Dt="["+Tf+"]?",Mf="(?:"+Rf+"(?:"+[At,Mt,jt].join("|")+")"+Dt+Bt+")*",jf=Dt+Bt+Mf,Bf="(?:"+[At+Tr+"?",Tr,Mt,jt,Cf].join("|")+")",Pt=RegExp(Cr+"(?="+Cr+")|"+Bf+jf,"g");function Df(r){var e=Pt.lastIndex=0;while(Pt.test(r))++e;return e}var Ft=Df;function Ff(r){return ve(r)?Ft(r):Nt(r)}var Xt=Ff;function Gf(r,e){return wt(r,e,function(n,o){return ka(r,o)})}var Ut=Gf;var Xf=le(function(r,e){return r==null?{}:Ut(r,e)}),Z=Xf;var{ceil:Uf,max:Vf}=Math;function Yf(r,e,n,o){var i=-1,f=Vf(Uf((e-r)/(n||1)),0),s=Array(f);while(f--)s[o?f:++i]=r,r+=n;return s}var zt=Yf;function zf(r){return function(e,n,o){if(o&&typeof o!="number"&&C(e,n,o))n=o=void 0;if(e=V(e),n===void 0)n=e,e=0;else n=V(n);return o=o===void 0?e<n?1:-1:V(o),zt(e,n,o,r)}}var Kt=zf;var Wf=Kt(),P=Wf;var qf="[object Map]",Hf="[object Set]";function Kf(r){if(r==null)return 0;if($e(r))return vt(r)?Xt(r):r.length;var e=mt(r);if(e==qf||e==Hf)return r.size;return lr(r).length}var Zt=Kf;var Jf=gn(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&C(r,e[0],e[1]))e=[];else if(n>2&&C(e[0],e[1],e[2]))e=[e[0]];return It(r,ur(e,1),[])}),A=Jf;var Zf=0;function $f(r){var e=++Zf;return ba(r)+e}var Q=$f;function Qf(r,e,n){var o=-1,i=r.length,f=e.length,s={};while(++o<i){var u=o<f?e[o]:void 0;n(s,r[o],u)}return s}var $t=Qf;function rs(r,e){return $t(r||[],e||[],j)}var Ar=rs;class Rr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return rn(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)rn(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,es)),n=n._prev;return"["+r.join(", ")+"]"}}function rn(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function es(r,e){if(r!=="_next"&&r!=="_prev")return e}var ts=lt(1);function en(r,e){if(r.nodeCount()<=1)return[];var n=os(r,e||ts),o=ns(n.graph,n.buckets,n.zeroIdx);return N(E(o,function(i){return r.outEdges(i.v,i.w)}))}function ns(r,e,n){var o=[],i=e[e.length-1],f=e[0],s;while(r.nodeCount()){while(s=f.dequeue())Mr(r,e,n,s);while(s=i.dequeue())Mr(r,e,n,s);if(r.nodeCount()){for(var u=e.length-2;u>0;--u)if(s=e[u].dequeue(),s){o=o.concat(Mr(r,e,n,s,!0));break}}}return o}function Mr(r,e,n,o,i){var f=i?[]:void 0;return h(r.inEdges(o.v),function(s){var u=r.edge(s),d=r.node(s.v);if(i)f.push({v:s.v,w:s.w});d.out-=u,jr(e,n,d)}),h(r.outEdges(o.v),function(s){var u=r.edge(s),d=s.w,c=r.node(d);c.in-=u,jr(e,n,c)}),r.removeNode(o.v),f}function os(r,e){var n=new re,o=0,i=0;h(r.nodes(),function(u){n.setNode(u,{v:u,in:0,out:0})}),h(r.edges(),function(u){var d=n.edge(u.v,u.w)||0,c=e(u),p=d+c;n.setEdge(u.v,u.w,p),i=Math.max(i,n.node(u.v).out+=c),o=Math.max(o,n.node(u.w).in+=c)});var f=P(i+o+3).map(function(){return new Rr}),s=o+1;return h(n.nodes(),function(u){jr(f,s,n.node(u))}),{graph:n,buckets:f,zeroIdx:s}}function jr(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function tn(r){var e=r.graph().acyclicer==="greedy"?en(r,n(r)):is(r);h(e,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,Q("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function is(r){var e=[],n={},o={};function i(f){if(Object.prototype.hasOwnProperty.call(o,f))return;o[f]=!0,n[f]=!0,h(r.outEdges(f),function(s){if(Object.prototype.hasOwnProperty.call(n,s.w))e.push(s);else i(s.w)}),delete n[f]}return h(r.nodes(),i),e}function nn(r){h(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,o)}})}function T(r,e,n,o){var i;do i=Q(o);while(r.hasNode(i));return n.dummy=e,r.setNode(i,n),i}function an(r){var e=new re().setGraph(r.graph());return h(r.nodes(),function(n){e.setNode(n,r.node(n))}),h(r.edges(),function(n){var o=e.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),e}function Sr(r){var e=new re({multigraph:r.isMultigraph()}).setGraph(r.graph());return h(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),h(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function Br(r,e){var{x:n,y:o}=r,i=e.x-n,f=e.y-o,s=r.width/2,u=r.height/2;if(!i&&!f)throw Error("Not possible to find intersection inside of the rectangle");var d,c;if(Math.abs(f)*s>Math.abs(i)*u){if(f<0)u=-u;d=u*i/f,c=u}else{if(i<0)s=-s;d=s,c=s*f/i}return{x:n+d,y:o+c}}function D(r){var e=E(P(Fr(r)+1),function(){return[]});return h(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!we(i))e[i][o.order]=n}),e}function fn(r){var e=B(E(r.nodes(),function(n){return r.node(n).rank}));h(r.nodes(),function(n){var o=r.node(n);if(Lr(o,"rank"))o.rank-=e})}function sn(r){var e=B(E(r.nodes(),function(f){return r.node(f).rank})),n=[];h(r.nodes(),function(f){var s=r.node(f).rank-e;if(!n[s])n[s]=[];n[s].push(f)});var o=0,i=r.graph().nodeRankFactor;h(n,function(f,s){if(we(f)&&s%i!==0)--o;else if(o)h(f,function(u){r.node(u).rank+=o})})}function Dr(r,e,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return T(r,"border",i,e)}function Fr(r){return S(E(r.nodes(),function(e){var n=r.node(e).rank;if(!we(n))return n}))}function un(r,e){var n={lhs:[],rhs:[]};return h(r,function(o){if(e(o))n.lhs.push(o);else n.rhs.push(o)}),n}function dn(r,e){var n=kr();try{return e()}finally{console.log(r+" time: "+(kr()-n)+"ms")}}function cn(r,e){return e()}function ln(r){function e(n){var o=r.children(n),i=r.node(n);if(o.length)h(o,e);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var f=i.minRank,s=i.maxRank+1;f<s;++f)pn(r,"borderLeft","_bl",n,i,f),pn(r,"borderRight","_br",n,i,f)}}h(r.children(),e)}function pn(r,e,n,o,i,f){var s={width:0,height:0,rank:f,borderType:e},u=i[e][f-1],d=T(r,"border",s,n);if(i[e][f]=d,r.setParent(d,o),u)r.setEdge(u,d,{weight:1})}function En(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")In(r)}function Ln(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")as(r);if(e==="lr"||e==="rl")fs(r),In(r)}function In(r){h(r.nodes(),function(e){mn(r.node(e))}),h(r.edges(),function(e){mn(r.edge(e))})}function mn(r){var e=r.width;r.width=r.height,r.height=e}function as(r){h(r.nodes(),function(e){Gr(r.node(e))}),h(r.edges(),function(e){var n=r.edge(e);if(h(n.points,Gr),Object.prototype.hasOwnProperty.call(n,"y"))Gr(n)})}function Gr(r){r.y=-r.y}function fs(r){h(r.nodes(),function(e){Xr(r.node(e))}),h(r.edges(),function(e){var n=r.edge(e);if(h(n.points,Xr),Object.prototype.hasOwnProperty.call(n,"x"))Xr(n)})}function Xr(r){var e=r.x;r.x=r.y,r.y=e}function Sn(r){r.graph().dummyChains=[],h(r.edges(),function(e){us(r,e)})}function us(r,e){var n=e.v,o=r.node(n).rank,i=e.w,f=r.node(i).rank,s=e.name,u=r.edge(e),d=u.labelRank;if(f===o+1)return;r.removeEdge(e);var c=void 0,p,m;for(m=0,++o;o<f;++m,++o){if(u.points=[],c={width:0,height:0,edgeLabel:u,edgeObj:e,rank:o},p=T(r,"edge",c,"_d"),o===d)c.width=u.width,c.height=u.height,c.dummy="edge-label",c.labelpos=u.labelpos;if(r.setEdge(n,p,{weight:u.weight},s),m===0)r.graph().dummyChains.push(p);n=p}r.setEdge(n,i,{weight:u.weight},s)}function Nn(r){h(r.graph().dummyChains,function(e){var n=r.node(e),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(e)[0],r.removeNode(e),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;e=i,n=r.node(e)}})}function ar(r){var e={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(e,o))return i.rank;e[o]=!0;var f=B(E(r.outEdges(o),function(s){return n(s.w)-r.edge(s).minlen}));if(f===Number.POSITIVE_INFINITY||f===void 0||f===null)f=0;return i.rank=f}h(r.sources(),n)}function U(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function Nr(r){var e=new re({directed:!1}),n=r.nodes()[0],o=r.nodeCount();e.setNode(n,{});var i,f;while(ds(e,r)<o)i=cs(e,r),f=e.hasNode(i.v)?U(r,i):-U(r,i),ps(e,r,f);return e}function ds(r,e){function n(o){h(e.nodeEdges(o),function(i){var f=i.v,s=o===f?i.w:f;if(!r.hasNode(s)&&!U(e,i))r.setNode(s,{}),r.setEdge(o,s,{}),n(s)})}return h(r.nodes(),n),r.nodeCount()}function cs(r,e){return J(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return U(e,n)})}function ps(r,e,n){h(r.nodes(),function(o){e.node(o).rank+=n})}var dh=lt(1);var vh=lt(1);Ur.CycleException=gr;function Ur(r){var e={},n={},o=[];function i(f){if(Object.prototype.hasOwnProperty.call(n,f))throw new gr;if(!Object.prototype.hasOwnProperty.call(e,f))n[f]=!0,e[f]=!0,h(r.predecessors(f),i),delete n[f],o.push(f)}if(h(r.sinks(),i),Zt(e)!==r.nodeCount())throw new gr;return o}function gr(){}gr.prototype=Error();function Pr(r,e,n){if(!H(e))e=[e];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],f={};return h(e,function(s){if(!r.hasNode(s))throw Error("Graph does not have node: "+s);kn(r,s,n==="post",f,o,i)}),i}function kn(r,e,n,o,i,f){if(!Object.prototype.hasOwnProperty.call(o,e)){if(o[e]=!0,!n)f.push(e);if(h(i(e),function(s){kn(r,s,n,o,i,f)}),n)f.push(e)}}function Vr(r,e){return Pr(r,e,"post")}function Yr(r,e){return Pr(r,e,"pre")}G.initLowLimValues=qr;G.initCutValues=Wr;G.calcCutValue=Cn;G.leaveEdge=Rn;G.enterEdge=Mn;G.exchangeEdges=jn;function G(r){r=an(r),ar(r);var e=Nr(r);qr(e),Wr(e,r);var n,o;while(n=Rn(e))o=Mn(e,r,n),jn(e,r,n,o)}function Wr(r,e){var n=Vr(r,r.nodes());n=n.slice(0,n.length-1),h(n,function(o){vs(r,e,o)})}function vs(r,e,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Cn(r,e,n)}function Cn(r,e,n){var o=r.node(n),i=o.parent,f=!0,s=e.edge(n,i),u=0;if(!s)f=!1,s=e.edge(i,n);return u=s.weight,h(e.nodeEdges(n),function(d){var c=d.v===n,p=c?d.w:d.v;if(p!==i){var m=c===f,g=e.edge(d).weight;if(u+=m?g:-g,ys(r,n,p)){var b=r.edge(n,p).cutvalue;u+=m?-b:b}}}),u}function qr(r,e){if(arguments.length<2)e=r.nodes()[0];An(r,{},1,e)}function An(r,e,n,o,i){var f=n,s=r.node(o);if(e[o]=!0,h(r.neighbors(o),function(u){if(!Object.prototype.hasOwnProperty.call(e,u))n=An(r,e,n,u,o)}),s.low=f,s.lim=n++,i)s.parent=i;else delete s.parent;return n}function Rn(r){return nr(r.edges(),function(e){return r.edge(e).cutvalue<0})}function Mn(r,e,n){var{v:o,w:i}=n;if(!e.hasEdge(o,i))o=n.w,i=n.v;var f=r.node(o),s=r.node(i),u=f,d=!1;if(f.lim>s.lim)u=s,d=!0;var c=Je(e.edges(),function(p){return d===Tn(r,r.node(p.v),u)&&d!==Tn(r,r.node(p.w),u)});return J(c,function(p){return U(e,p)})}function jn(r,e,n,o){var{v:i,w:f}=n;r.removeEdge(i,f),r.setEdge(o.v,o.w,{}),qr(r),Wr(r,e),bs(r,e)}function bs(r,e){var n=nr(r.nodes(),function(i){return!e.node(i).parent}),o=Yr(r,n);o=o.slice(1),h(o,function(i){var f=r.node(i).parent,s=e.edge(i,f),u=!1;if(!s)s=e.edge(f,i),u=!0;e.node(i).rank=e.node(f).rank+(u?s.minlen:-s.minlen)})}function ys(r,e,n){return r.hasEdge(e,n)}function Tn(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Hr(r){switch(r.graph().ranker){case"network-simplex":Bn(r);break;case"tight-tree":_s(r);break;case"longest-path":ws(r);break;default:Bn(r)}}var ws=ar;function _s(r){ar(r),Nr(r)}function Bn(r){G(r)}function Dn(r){var e=T(r,"root",{},"_root"),n=Es(r),o=S(ft(n))-1,i=2*o+1;r.graph().nestingRoot=e,h(r.edges(),function(s){r.edge(s).minlen*=i});var f=xs(r)+1;h(r.children(),function(s){Fn(r,e,i,f,o,n,s)}),r.graph().nodeRankFactor=i}function Fn(r,e,n,o,i,f,s){var u=r.children(s);if(!u.length){if(s!==e)r.setEdge(e,s,{weight:0,minlen:n});return}var d=Dr(r,"_bt"),c=Dr(r,"_bb"),p=r.node(s);if(r.setParent(d,s),p.borderTop=d,r.setParent(c,s),p.borderBottom=c,h(u,function(m){Fn(r,e,n,o,i,f,m);var g=r.node(m),b=g.borderTop?g.borderTop:m,w=g.borderBottom?g.borderBottom:m,y=g.borderTop?o:2*o,v=b!==w?1:i-f[s]+1;r.setEdge(d,b,{weight:y,minlen:v,nestingEdge:!0}),r.setEdge(w,c,{weight:y,minlen:v,nestingEdge:!0})}),!r.parent(s))r.setEdge(e,d,{weight:0,minlen:i+f[s]})}function Es(r){var e={};function n(o,i){var f=r.children(o);if(f&&f.length)h(f,function(s){n(s,i+1)});e[o]=i}return h(r.children(),function(o){n(o,1)}),e}function xs(r){return Yt(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function Xn(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,h(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function Un(r,e,n){var o={},i;h(n,function(f){var s=r.parent(f),u,d;while(s){if(u=r.parent(s),u)d=o[u],o[u]=s;else d=i,i=s;if(d&&d!==s){e.setEdge(d,s);return}s=u}})}function Vn(r,e,n){var o=Ls(r),i=new re({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(f){return r.node(f)});return h(r.nodes(),function(f){var s=r.node(f),u=r.parent(f);if(s.rank===e||s.minRank<=e&&e<=s.maxRank){if(i.setNode(f),i.setParent(f,u||o),h(r[n](f),function(d){var c=d.v===f?d.w:d.v,p=i.edge(c,f),m=!we(p)?p.weight:0;i.setEdge(c,f,{weight:r.edge(d).weight+m})}),Object.prototype.hasOwnProperty.call(s,"minRank"))i.setNode(f,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]})}}),i}function Ls(r){var e;while(r.hasNode(e=Q("_root")));return e}function Yn(r,e){var n=0;for(var o=1;o<e.length;++o)n+=Is(r,e[o-1],e[o]);return n}function Is(r,e,n){var o=Ar(n,E(n,function(c,p){return p})),i=N(E(e,function(c){return A(E(r.outEdges(c),function(p){return{pos:o[p.w],weight:r.edge(p).weight}}),"pos")})),f=1;while(f<n.length)f<<=1;var s=2*f-1;f-=1;var u=E(Array(s),function(){return 0}),d=0;return h(i.forEach(function(c){var p=c.pos+f;u[p]+=c.weight;var m=0;while(p>0){if(p%2)m+=u[p+1];p=p-1>>1,u[p]+=c.weight}d+=c.weight*m})),d}function zn(r){var e={},n=Je(r.nodes(),function(u){return!r.children(u).length}),o=S(E(n,function(u){return r.node(u).rank})),i=E(P(o+1),function(){return[]});function f(u){if(Lr(e,u))return;e[u]=!0;var d=r.node(u);i[d.rank].push(u),h(r.successors(u),f)}var s=A(n,function(u){return r.node(u).rank});return h(s,f),i}function Wn(r,e){return E(e,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=Yt(o,function(f,s){var u=r.edge(s),d=r.node(s.v);return{sum:f.sum+u.weight*d.order,weight:f.weight+u.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function qn(r,e){var n={};h(r,function(i,f){var s=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:f};if(!we(i.barycenter))s.barycenter=i.barycenter,s.weight=i.weight}),h(e.edges(),function(i){var f=n[i.v],s=n[i.w];if(!we(f)&&!we(s))s.indegree++,f.out.push(n[i.w])});var o=Je(n,function(i){return!i.indegree});return Ss(o)}function Ss(r){var e=[];function n(f){return function(s){if(s.merged)return;if(we(s.barycenter)||we(f.barycenter)||s.barycenter>=f.barycenter)Ns(f,s)}}function o(f){return function(s){if(s.in.push(f),--s.indegree===0)r.push(s)}}while(r.length){var i=r.pop();e.push(i),h(i.in.reverse(),n(i)),h(i.out,o(i))}return E(Je(e,function(f){return!f.merged}),function(f){return Z(f,["vs","i","barycenter","weight"])})}function Ns(r,e){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(e.weight)n+=e.barycenter*e.weight,o+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(e.i,r.i),e.merged=!0}function Kn(r,e){var n=un(r,function(p){return Object.prototype.hasOwnProperty.call(p,"barycenter")}),o=n.lhs,i=A(n.rhs,function(p){return-p.i}),f=[],s=0,u=0,d=0;o.sort(Ps(!!e)),d=Hn(f,i,d),h(o,function(p){d+=p.vs.length,f.push(p.vs),s+=p.barycenter*p.weight,u+=p.weight,d=Hn(f,i,d)});var c={vs:N(f)};if(u)c.barycenter=s/u,c.weight=u;return c}function Hn(r,e,n){var o;while(e.length&&(o=X(e)).i<=n)e.pop(),r.push(o.vs),n++;return n}function Ps(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Kr(r,e,n,o){var i=r.children(e),f=r.node(e),s=f?f.borderLeft:void 0,u=f?f.borderRight:void 0,d={};if(s)i=Je(i,function(w){return w!==s&&w!==u});var c=Wn(r,i);h(c,function(w){if(r.children(w.v).length){var y=Kr(r,w.v,n,o);if(d[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Ts(w,y)}});var p=qn(c,n);ks(p,d);var m=Kn(p,o);if(s){if(m.vs=N([s,m.vs,u]),r.predecessors(s).length){var g=r.node(r.predecessors(s)[0]),b=r.node(r.predecessors(u)[0]);if(!Object.prototype.hasOwnProperty.call(m,"barycenter"))m.barycenter=0,m.weight=0;m.barycenter=(m.barycenter*m.weight+g.order+b.order)/(m.weight+2),m.weight+=2}}return m}function ks(r,e){h(r,function(n){n.vs=N(n.vs.map(function(o){if(e[o])return e[o].vs;return o}))})}function Ts(r,e){if(!we(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function $n(r){var e=Fr(r),n=Jn(r,P(1,e+1),"inEdges"),o=Jn(r,P(e-1,-1,-1),"outEdges"),i=zn(r);Zn(r,i);var f=Number.POSITIVE_INFINITY,s;for(var u=0,d=0;d<4;++u,++d){Cs(u%2?n:o,u%4>=2),i=D(r);var c=Yn(r,i);if(c<f)d=0,s=Ze(i),f=c}Zn(r,s)}function Jn(r,e,n){return E(e,function(o){return Vn(r,o,n)})}function Cs(r,e){var n=new re;h(r,function(o){var i=o.graph().root,f=Kr(o,i,n,e);h(f.vs,function(s,u){o.node(s).order=u}),Un(o,n,f.vs)})}function Zn(r,e){h(e,function(n){h(n,function(o,i){r.node(o).order=i})})}function Qn(r){var e=Rs(r);h(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,f=As(r,e,i.v,i.w),{path:s,lca:u}=f,d=0,c=s[d],p=!0;while(n!==i.w){if(o=r.node(n),p){while((c=s[d])!==u&&r.node(c).maxRank<o.rank)d++;if(c===u)p=!1}if(!p){while(d<s.length-1&&r.node(c=s[d+1]).minRank<=o.rank)d++;c=s[d]}r.setParent(n,c),n=r.successors(n)[0]}})}function As(r,e,n,o){var i=[],f=[],s=Math.min(e[n].low,e[o].low),u=Math.max(e[n].lim,e[o].lim),d,c;d=n;do d=r.parent(d),i.push(d);while(d&&(e[d].low>s||u>e[d].lim));c=d,d=o;while((d=r.parent(d))!==c)f.push(d);return{path:i.concat(f.reverse()),lca:c}}function Rs(r){var e={},n=0;function o(i){var f=n;h(r.children(i),o),e[i]={low:f,lim:n++}}return h(r.children(),o),e}function Ms(r,e){var n={};function o(i,f){var s=0,u=0,d=i.length,c=X(f);return h(f,function(p,m){var g=Bs(r,p),b=g?r.node(g).order:d;if(g||p===c)h(f.slice(u,m+1),function(w){h(r.predecessors(w),function(y){var v=r.node(y),_=v.order;if((_<s||b<_)&&!(v.dummy&&r.node(w).dummy))eo(n,y,w)})}),u=m+1,s=b}),f}return Yt(e,o),n}function js(r,e){var n={};function o(f,s,u,d,c){var p;h(P(s,u),function(m){if(p=f[m],r.node(p).dummy)h(r.predecessors(p),function(g){var b=r.node(g);if(b.dummy&&(b.order<d||b.order>c))eo(n,g,p)})})}function i(f,s){var u=-1,d,c=0;return h(s,function(p,m){if(r.node(p).dummy==="border"){var g=r.predecessors(p);if(g.length)d=r.node(g[0]).order,o(s,c,m,u,d),c=m,u=d}o(s,c,s.length,d,f.length)}),s}return Yt(e,i),n}function Bs(r,e){if(r.node(e).dummy)return nr(r.predecessors(e),function(n){return r.node(n).dummy})}function eo(r,e,n){if(e>n){var o=e;e=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[e];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ds(r,e,n){if(e>n){var o=e;e=n,n=o}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function Fs(r,e,n,o){var i={},f={},s={};return h(e,function(u){h(u,function(d,c){i[d]=d,f[d]=d,s[d]=c})}),h(e,function(u){var d=-1;h(u,function(c){var p=o(c);if(p.length){p=A(p,function(y){return s[y]});var m=(p.length-1)/2;for(var g=Math.floor(m),b=Math.ceil(m);g<=b;++g){var w=p[g];if(f[c]===c&&d<s[w]&&!Ds(n,c,w))f[w]=c,f[c]=i[c]=i[w],d=s[w]}}})}),{root:i,align:f}}function Gs(r,e,n,o,i){var f={},s=Xs(r,e,n,i),u=i?"borderLeft":"borderRight";function d(m,g){var b=s.nodes(),w=b.pop(),y={};while(w){if(y[w])m(w);else y[w]=!0,b.push(w),b=b.concat(g(w));w=b.pop()}}function c(m){f[m]=s.inEdges(m).reduce(function(g,b){return Math.max(g,f[b.v]+s.edge(b))},0)}function p(m){var g=s.outEdges(m).reduce(function(w,y){return Math.min(w,f[y.w]-s.edge(y))},Number.POSITIVE_INFINITY),b=r.node(m);if(g!==Number.POSITIVE_INFINITY&&b.borderType!==u)f[m]=Math.max(f[m],g)}return d(c,s.predecessors.bind(s)),d(p,s.successors.bind(s)),h(o,function(m){f[m]=f[n[m]]}),f}function Xs(r,e,n,o){var i=new re,f=r.graph(),s=zs(f.nodesep,f.edgesep,o);return h(e,function(u){var d;h(u,function(c){var p=n[c];if(i.setNode(p),d){var m=n[d],g=i.edge(m,p);i.setEdge(m,p,Math.max(s(r,c,d),g||0))}d=c})}),i}function Us(r,e){return J(ft(e),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return dt(n,function(f,s){var u=Ws(r,s)/2;o=Math.max(f+u,o),i=Math.min(f-u,i)}),o-i})}function Vs(r,e){var n=ft(e),o=B(n),i=S(n);h(["u","d"],function(f){h(["l","r"],function(s){var u=f+s,d=r[u],c;if(d===e)return;var p=ft(d);if(c=s==="l"?o-B(p):i-S(p),c)r[u]=q(d,function(m){return m+c})})})}function Ys(r,e){return q(r.ul,function(n,o){if(e)return r[e.toLowerCase()][o];else{var i=A(E(r,o));return(i[1]+i[2])/2}})}function to(r){var e=D(r),n=ir(Ms(r,e),js(r,e)),o={},i;h(["u","d"],function(s){i=s==="u"?e:ft(e).reverse(),h(["l","r"],function(u){if(u==="r")i=E(i,function(m){return ft(m).reverse()});var d=(s==="u"?r.predecessors:r.successors).bind(r),c=Fs(r,i,n,d),p=Gs(r,i,c.root,c.align,u==="r");if(u==="r")p=q(p,function(m){return-m});o[s+u]=p})});var f=Us(r,o);return Vs(o,f),Ys(o,r.graph().align)}function zs(r,e,n){return function(o,i,f){var s=o.node(i),u=o.node(f),d=0,c;if(d+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=-s.width/2;break;case"r":c=s.width/2;break}if(c)d+=n?c:-c;if(c=0,d+=(s.dummy?e:r)/2,d+=(u.dummy?e:r)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":c=u.width/2;break;case"r":c=-u.width/2;break}if(c)d+=n?c:-c;return c=0,d}}function Ws(r,e){return r.node(e).width}function oo(r){r=Sr(r),qs(r),ct(to(r),function(e,n){r.node(n).x=e})}function qs(r){var e=D(r),n=r.graph().ranksep,o=0;h(e,function(i){var f=S(E(i,function(s){return r.node(s).height}));h(i,function(s){r.node(s).y=o+f/2}),o+=f+n})}function $r(r,e){var n=e&&e.debugTiming?dn:cn;n("layout",()=>{var o=n(" buildLayoutGraph",()=>ou(r));n(" runLayout",()=>Hs(o,n)),n(" updateInputGraph",()=>Ks(r,o))})}function Hs(r,e){e(" makeSpaceForEdgeLabels",()=>iu(r)),e(" removeSelfEdges",()=>mu(r)),e(" acyclic",()=>tn(r)),e(" nestingGraph.run",()=>Dn(r)),e(" rank",()=>Hr(Sr(r))),e(" injectEdgeLabelProxies",()=>au(r)),e(" removeEmptyRanks",()=>sn(r)),e(" nestingGraph.cleanup",()=>Xn(r)),e(" normalizeRanks",()=>fn(r)),e(" assignRankMinMax",()=>fu(r)),e(" removeEdgeLabelProxies",()=>su(r)),e(" normalize.run",()=>Sn(r)),e(" parentDummyChains",()=>Qn(r)),e(" addBorderSegments",()=>ln(r)),e(" order",()=>$n(r)),e(" insertSelfEdges",()=>hu(r)),e(" adjustCoordinateSystem",()=>En(r)),e(" position",()=>oo(r)),e(" positionSelfEdges",()=>gu(r)),e(" removeBorderNodes",()=>lu(r)),e(" normalize.undo",()=>Nn(r)),e(" fixupEdgeLabelCoords",()=>cu(r)),e(" undoCoordinateSystem",()=>Ln(r)),e(" translateGraph",()=>uu(r)),e(" assignNodeIntersects",()=>du(r)),e(" reversePoints",()=>pu(r)),e(" acyclic.undo",()=>nn(r))}function Ks(r,e){h(r.nodes(),function(n){var o=r.node(n),i=e.node(n);if(o){if(o.x=i.x,o.y=i.y,e.children(n).length)o.width=i.width,o.height=i.height}}),h(r.edges(),function(n){var o=r.edge(n),i=e.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var Js=["nodesep","edgesep","ranksep","marginx","marginy"],Zs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$s=["acyclicer","ranker","rankdir","align"],Qs=["width","height"],ru={width:0,height:0},eu=["minlen","weight","width","height","labeloffset"],tu={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nu=["labelpos"];function ou(r){var e=new re({multigraph:!0,compound:!0}),n=Zr(r.graph());return e.setGraph(ir({},Zs,Jr(n,Js),Z(n,$s))),h(r.nodes(),function(o){var i=Zr(r.node(o));e.setNode(o,et(Jr(i,Qs),ru)),e.setParent(o,r.parent(o))}),h(r.edges(),function(o){var i=Zr(r.edge(o));e.setEdge(o,ir({},tu,Jr(i,eu),Z(i,nu)))}),e}function iu(r){var e=r.graph();e.ranksep/=2,h(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function au(r){h(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var o=r.node(e.v),i=r.node(e.w),f={rank:(i.rank-o.rank)/2+o.rank,e};T(r,"edge-proxy",f,"_ep")}})}function fu(r){var e=0;h(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,e=S(e,o.maxRank)}),r.graph().maxRank=e}function su(r){h(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function uu(r){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,f=r.graph(),s=f.marginx||0,u=f.marginy||0;function d(c){var{x:p,y:m,width:g,height:b}=c;e=Math.min(e,p-g/2),n=Math.max(n,p+g/2),o=Math.min(o,m-b/2),i=Math.max(i,m+b/2)}h(r.nodes(),function(c){d(r.node(c))}),h(r.edges(),function(c){var p=r.edge(c);if(Object.prototype.hasOwnProperty.call(p,"x"))d(p)}),e-=s,o-=u,h(r.nodes(),function(c){var p=r.node(c);p.x-=e,p.y-=o}),h(r.edges(),function(c){var p=r.edge(c);if(h(p.points,function(m){m.x-=e,m.y-=o}),Object.prototype.hasOwnProperty.call(p,"x"))p.x-=e;if(Object.prototype.hasOwnProperty.call(p,"y"))p.y-=o}),f.width=n-e+s,f.height=i-o+u}function du(r){h(r.edges(),function(e){var n=r.edge(e),o=r.node(e.v),i=r.node(e.w),f,s;if(!n.points)n.points=[],f=i,s=o;else f=n.points[0],s=n.points[n.points.length-1];n.points.unshift(Br(o,f)),n.points.push(Br(i,s))})}function cu(r){h(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function pu(r){h(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function lu(r){h(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),o=r.node(n.borderTop),i=r.node(n.borderBottom),f=r.node(X(n.borderLeft)),s=r.node(X(n.borderRight));n.width=Math.abs(s.x-f.x),n.height=Math.abs(i.y-o.y),n.x=f.x+n.width/2,n.y=o.y+n.height/2}}),h(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function mu(r){h(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function hu(r){var e=D(r);h(e,function(n){var o=0;h(n,function(i,f){var s=r.node(i);s.order=f+o,h(s.selfEdges,function(u){T(r,"selfedge",{width:u.label.width,height:u.label.height,rank:s.rank,order:f+ ++o,e:u.e,label:u.label},"_se")}),delete s.selfEdges})})}function gu(r){h(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,f=o.y,s=n.x-i,u=o.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:i+2*s/3,y:f-u},{x:i+5*s/6,y:f-u},{x:i+s,y:f},{x:i+5*s/6,y:f+u},{x:i+2*s/3,y:f+u}],n.label.x=n.x,n.label.y=n.y}})}function Jr(r,e){return q(Z(r,e),Number)}function Zr(r){var e={};return h(r,function(n,o){e[o.toLowerCase()]=n}),e}var fo=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),so=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),vu=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),bu=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],yu=t((r,e,n,o,i)=>{let f=[],s=new Set;if(n.forEach(({start:p,end:m})=>{if(p!==o)s.add(p);if(m!==o)s.add(m)}),s.forEach((p)=>{let m=r.node(p);if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)}),f.length===0)n.forEach(({edge:p})=>{(p.points??[]).forEach((m)=>{if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)})});if(f.length===0)return so(i);let u=f.reduce((p,m)=>({x:p.x+m.x/f.length,y:p.y+m.y/f.length}),{x:0,y:0}),d=u.x-e.x,c=u.y-e.y;if(Math.abs(d)>Math.abs(c))return d>0?"right":"left";if(Math.abs(c)>0)return c>0?"bottom":"top";return so(i)},"getSelfLoopSide"),wu=t((r,e="top",n=0,o=0)=>{let i=r.x,f=r.y-n,s=r.width/2,u=r.height/2,d=Math.max(36,Math.min(100,r.width*0.8)),c=fo(Math.max(o,r.width*0.35),36,d),p=fo(Math.min(r.width,r.height)*0.45,24,48);switch(e){case"bottom":{let m=f+u;return[{x:i-c/2,y:m},{x:i-c/2,y:m+p},{x:i+c/2,y:m+p},{x:i+c/2,y:m}]}case"right":{let m=i+s;return[{x:m,y:f-c/2},{x:m+p,y:f-c/2},{x:m+p,y:f+c/2},{x:m,y:f+c/2}]}case"left":{let m=i-s;return[{x:m,y:f-c/2},{x:m-p,y:f-c/2},{x:m-p,y:f+c/2},{x:m,y:f+c/2}]}case"top":default:{let m=f-u;return[{x:i-c/2,y:m},{x:i-c/2,y:m-p},{x:i+c/2,y:m-p},{x:i+c/2,y:m}]}}},"getSelfLoopPoints"),_u=t((r,e,n="top",o=0,i={})=>{let s=r.x,u=r.y-o,d=i.width??0,c=i.height??0;switch(n){case"bottom":return{x:s,y:Math.max(...e.map((p)=>p.y))+c/2+4};case"right":return{x:Math.max(...e.map((p)=>p.x))+d/2+4,y:u};case"left":return{x:Math.min(...e.map((p)=>p.x))-d/2-4,y:u};case"top":default:return{x:s,y:Math.min(...e.map((p)=>p.y))-c/2-4}}},"getSelfLoopLabelPosition"),no=t((r,e=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],f=r.graph()?.rankdir;return r.edges().forEach((s)=>{let u=r.edge(s);if(n&&u.selfLoop){let d=u.selfLoop.id;if(!o.has(d))o.set(d,[]);o.get(d).push({edge:u,start:s.v,end:s.w})}else i.push({edge:u,start:s.v,end:s.w})}),o.forEach((s)=>{if(s.length!==3){s.forEach((_)=>i.push(_));return}s.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[u,d,c]=s,p=u.edge.originalEdge??d.edge.originalEdge??c.edge.originalEdge??d.edge,m=r.node(p.start);if(!m){s.forEach((_)=>i.push(_));return}let g={width:d.edge.width,height:d.edge.height},b=yu(r,m,s,p.start,f),w=wu(m,b,e,g.width??0),y=_u(m,w,b,e,g),v={...d.edge,...p,id:p.id,points:w,start:p.start,end:p.end,x:y.x,y:y.y,width:g.width,height:g.height,labelStyle:d.edge.labelStyle,fromCluster:u.edge.fromCluster??d.edge.fromCluster??c.edge.fromCluster,toCluster:u.edge.toCluster??d.edge.toCluster??c.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),co=t(async({element:r,graph:e,diagramType:n,id:o,parentCluster:i,siteConfig:f})=>{let s=e.graph().rankdir;a.trace("Dir in recursive render - dir:",s);let{clusters:u,edgePaths:d,edgeLabels:c,nodes:p,rootGroups:m}=ua(r,{edgePathsClass:"edgePaths"});if(!e.nodes())a.info("No nodes found for",e);else a.info("Recursive render XXX",e.nodes());if(e.edges().length>0)a.info("Recursive edges",e.edge(e.edges()[0]));let g=vu(n);await Promise.all(e.nodes().map(async function(y){let v=e.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(a.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,y,`
3
3
  data=`,_.height,`
4
- Parent cluster`,i.height),e.setNode(i.id,_),!e.parent(y))a.trace("Setting parent",y,i.id),e.setParent(y,i.id,_)}if(a.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),v?.clusterNode){a.info("Cluster identified XBX",y,v.width,e.node(y));let{ranksep:_,nodesep:R}=e.graph();v.graph.setGraph({...v.graph.graph(),ranksep:_+25,nodesep:R});let Qr=await Lu({element:p,graph:v.graph,diagramType:n,id:o,parentCluster:e.node(y),siteConfig:f}),ee=Qr.elem;I(v,ee),v.diff=Qr.diff||0,a.info("New compound node after recursive render XAX",y,"width",v.width,"height",v.height),ko(ee,v)}else if(e.children(y).length>0)a.trace("Cluster - the non recursive path XBX",y,v.id,v,v.width,"Graph:",e),a.trace(Bn(v.id,e)),W.set(v.id,{id:Bn(v.id,e),node:v});else a.trace("Node - the non recursive path XAX",y,p,e.node(y),s),await ma(p,e.node(y),{config:f,dir:s})})),await t(async()=>{let y=e.edges().map(async function(v){let _=e.edge(v.v,v.w,v.name);if(a.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),a.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(e.edge(v))),a.info("Fix",W,"ids:",v.v,v.w,"Translating: ",W.get(v.v),W.get(v.w)),g&&_.selfLoop){if(_.selfLoop.order!==1)return;let R={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await At(c,R),_.width=R.width,_.height=R.height,_.labelStyle=R.labelStyle;return}await At(c,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=Tt(f);return{elem:m,graph:e,groups:{clusters:u,edgePaths:d,edgeLabels:c,nodes:p,rootGroups:m},diagramType:n,id:o,mergeSelfLoops:g,subGraphTitleTotalMargin:w}},"measureDagreGraph"),po=t((r)=>{a.info("############################################# XXX"),a.info("### Layout ### XXX"),a.info("############################################# XXX"),$r(r)},"runDagreGraphLayout"),Eu=t((r,e,n)=>{let o=r.node(e);if(!o)return;let i={...o};if(o?.clusterNode)i.y=(o.y??0)+n;else if(r.children(e).length>0)i.height=(o.height??0)+n;else i.y=(o.y??0)+n/2;return i},"normalizeDagreNode"),uo=t((r,e)=>{bu.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]})},"applyDagreNodeLayout"),xu=t((r,e,n,o)=>({...r,start:r.start??e,end:r.end??n,points:(r.points??[]).map((i)=>({...i,y:typeof i.y==="number"?i.y+o:i.y}))}),"normalizeDagreEdge"),Do=t((r,e)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=e,f=new Map(r.nodes.map((u)=>[u.id,u]));fa(n).forEach((u)=>{let d=Eu(n,u,i);if(!d)return;uo(n.node(u),d);let c=f.get(u);if(c)uo(c,d)});let s=i/2;return r.edges=ao(n,s,{mergeSelfLoops:o}).map(({edge:u,start:d,end:c})=>xu(u,d,c,s)),r},"applyDagreLayoutResult"),Ou=t(async({elem:r,graph:e,groups:{clusters:n,edgePaths:o},diagramType:i,id:f,mergeSelfLoops:s,subGraphTitleTotalMargin:u})=>{let d=0;await Promise.all(fa(e).map(async function(m){let g=e.node(m);if(a.info("Position XBX => "+m+": ("+g.x,","+g.y,") width: ",g.width," height: ",g.height),g?.clusterNode)g.y+=u,a.info("A tainted cluster node XBX1",m,g.id,g.width,g.height,g.x,g.y,e.parent(m)),W.get(g.id).node=g,yt(g);else if(e.children(m).length>0){a.info("A pure cluster node XBX1",m,g.id,g.x,g.y,g.width,g.height,e.parent(m)),g.height+=u,e.node(g.parentId);let b=g?.padding/2||0,w=g?.labelBBox?.height||0,y=w-b||0;a.debug("OffsetY",y,"labelHeight",w,"halfPadding",b),await en(n,g),W.get(g.id).node=g}else{let b=e.node(g.parentId);g.y+=u/2,a.info("A regular node XBX1 - using the padding",g.id,"parent",g.parentId,g.width,g.height,g.x,g.y,"offsetY",g.offsetY,"parent",b,b?.offsetY,g),yt(g)}}));let c=u/2;return ao(e,c,{mergeSelfLoops:s}).forEach(function({edge:m,start:g,end:b}){a.info("Edge "+g+" -> "+b+": "+JSON.stringify(m),m),m.points.forEach((_)=>_.y+=c);let w=e.node(g),y=e.node(b),v=tn(o,m,W,i,w,y,f);Yn(m,v)}),e.nodes().forEach(function(m){let g=e.node(m);if(a.info(m,g.type,g.diff),g.isGroup)d=g.diff}),a.warn("Returning from recursive render XAX",r,d),{elem:r,diff:d}},"paintDagreLayoutCore"),Lu=t(async(r)=>{let e=await co(r);return po(e.graph),await Ou(e)},"renderDagreSubgraph"),io=t((r)=>{let e=new re({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((n)=>{if(e.setNode(n.id,{...n}),n.parentId)e.setParent(n.id,n.parentId)}),a.debug("Edges:",r.edges),r.edges.forEach((n)=>{if(n.start===n.end){let o=n.start,i=o+"---"+o+"---1",f=o+"---"+o+"---2",s=e.node(o);e.setNode(i,{domId:i,id:i,parentId:s.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(i,s.parentId),e.setNode(f,{domId:f,id:f,parentId:s.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,s.parentId);let u=structuredClone(n),d=structuredClone(n),c=structuredClone(n),p=structuredClone(n);if(d.originalEdge=u,d.selfLoop={id:u.id,order:0},c.originalEdge=u,c.selfLoop={id:u.id,order:1},p.originalEdge=u,p.selfLoop={id:u.id,order:2},d.label="",d.arrowTypeEnd="none",d.endLabelLeft="",d.endLabelRight="",d.startLabelLeft="",d.id=o+"-cyclic-special-1",c.startLabelRight="",c.startLabelLeft="",c.endLabelLeft="",c.endLabelRight="",c.arrowTypeStart="none",c.arrowTypeEnd="none",c.id=o+"-cyclic-special-mid",p.label="",p.startLabelRight="",p.startLabelLeft="",p.arrowTypeStart="none",s.isGroup)d.fromCluster=o,p.toCluster=o;p.id=o+"-cyclic-special-2",p.arrowTypeStart="none",e.setEdge(o,i,d,o+"-cyclic-special-0"),e.setEdge(i,f,c,o+"-cyclic-special-1"),e.setEdge(f,o,p,o+"-cyclic-special-2")}else e.setEdge(n.start,n.end,{...n},n.id)}),so(e),{graph:e}},"prepareLayoutForDagre"),No=t(async(r,{element:e,preparedLayout:n})=>{let o=n??io(r),i=l(),f=await co({element:e,graph:o.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:i});return o.measuredLayout=f,f},"measureDagreLayout"),Mo=t((r,e)=>{let n=e.preparedLayout?.measuredLayout;if(!n)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return po(n.graph),Do(r,n),n},"runDagreLayoutCore"),Iu=t((r,{measure:e})=>fa(e.graph).map((n)=>e.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),Su=t((r,e,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),oo=lr({prepareLayout:io,measureLayout:No,runLayoutCore:Mo,paintOptions:{clusterDb:W,getNodes:Iu,getEdgeNode:Su,skipNode:t((r,{measure:e})=>!e.graph.hasNode(r.id),"skipNode"),isCluster:t((r,{measure:e})=>e.graph.hasNode(r.id)&&(e.graph.children(r.id)??[]).length>0,"isCluster")}});export{ao,Do,io,No,Mo,oo};
4
+ Parent cluster`,i.height),e.setNode(i.id,_),!e.parent(y))a.trace("Setting parent",y,i.id),e.setParent(y,i.id,_)}if(a.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),v?.clusterNode){a.info("Cluster identified XBX",y,v.width,e.node(y));let{ranksep:_,nodesep:R}=e.graph();v.graph.setGraph({...v.graph.graph(),ranksep:_+25,nodesep:R});let Qr=await Lu({element:p,graph:v.graph,diagramType:n,id:o,parentCluster:e.node(y),siteConfig:f}),ee=Qr.elem;I(v,ee),v.diff=Qr.diff||0,a.info("New compound node after recursive render XAX",y,"width",v.width,"height",v.height),_o(ee,v)}else if(e.children(y).length>0)a.trace("Cluster - the non recursive path XBX",y,v.id,v,v.width,"Graph:",e),a.trace(On(v.id,e)),W.set(v.id,{id:On(v.id,e),node:v});else a.trace("Node - the non recursive path XAX",y,p,e.node(y),s),await da(p,e.node(y),{config:f,dir:s})})),await t(async()=>{let y=e.edges().map(async function(v){let _=e.edge(v.v,v.w,v.name);if(a.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),a.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(e.edge(v))),a.info("Fix",W,"ids:",v.v,v.w,"Translating: ",W.get(v.v),W.get(v.w)),g&&_.selfLoop){if(_.selfLoop.order!==1)return;let R={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await Et(c,R),_.width=R.width,_.height=R.height,_.labelStyle=R.labelStyle;return}await Et(c,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=St(f);return{elem:m,graph:e,groups:{clusters:u,edgePaths:d,edgeLabels:c,nodes:p,rootGroups:m},diagramType:n,id:o,mergeSelfLoops:g,subGraphTitleTotalMargin:w}},"measureDagreGraph"),po=t((r)=>{a.info("############################################# XXX"),a.info("### Layout ### XXX"),a.info("############################################# XXX"),$r(r)},"runDagreGraphLayout"),Eu=t((r,e,n)=>{let o=r.node(e);if(!o)return;let i={...o};if(o?.clusterNode)i.y=(o.y??0)+n;else if(r.children(e).length>0)i.height=(o.height??0)+n;else i.y=(o.y??0)+n/2;return i},"normalizeDagreNode"),uo=t((r,e)=>{bu.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]})},"applyDagreNodeLayout"),xu=t((r,e,n,o)=>({...r,start:r.start??e,end:r.end??n,points:(r.points??[]).map((i)=>({...i,y:typeof i.y==="number"?i.y+o:i.y}))}),"normalizeDagreEdge"),Lo=t((r,e)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=e,f=new Map(r.nodes.map((u)=>[u.id,u]));pa(n).forEach((u)=>{let d=Eu(n,u,i);if(!d)return;uo(n.node(u),d);let c=f.get(u);if(c)uo(c,d)});let s=i/2;return r.edges=no(n,s,{mergeSelfLoops:o}).map(({edge:u,start:d,end:c})=>xu(u,d,c,s)),r},"applyDagreLayoutResult"),Ou=t(async({elem:r,graph:e,groups:{clusters:n,edgePaths:o},diagramType:i,id:f,mergeSelfLoops:s,subGraphTitleTotalMargin:u})=>{let d=0;await Promise.all(pa(e).map(async function(m){let g=e.node(m);if(a.info("Position XBX => "+m+": ("+g.x,","+g.y,") width: ",g.width," height: ",g.height),g?.clusterNode)g.y+=u,a.info("A tainted cluster node XBX1",m,g.id,g.width,g.height,g.x,g.y,e.parent(m)),W.get(g.id).node=g,bt(g);else if(e.children(m).length>0){a.info("A pure cluster node XBX1",m,g.id,g.x,g.y,g.width,g.height,e.parent(m)),g.height+=u,e.node(g.parentId);let b=g?.padding/2||0,w=g?.labelBBox?.height||0,y=w-b||0;a.debug("OffsetY",y,"labelHeight",w,"halfPadding",b),await Qt(n,g),W.get(g.id).node=g}else{let b=e.node(g.parentId);g.y+=u/2,a.info("A regular node XBX1 - using the padding",g.id,"parent",g.parentId,g.width,g.height,g.x,g.y,"offsetY",g.offsetY,"parent",b,b?.offsetY,g),bt(g)}}));let c=u/2;return no(e,c,{mergeSelfLoops:s}).forEach(function({edge:m,start:g,end:b}){a.info("Edge "+g+" -> "+b+": "+JSON.stringify(m),m),m.points.forEach((_)=>_.y+=c);let w=e.node(g),y=e.node(b),v=Jt(o,m,W,i,w,y,f);Gn(m,v)}),e.nodes().forEach(function(m){let g=e.node(m);if(a.info(m,g.type,g.diff),g.isGroup)d=g.diff}),a.warn("Returning from recursive render XAX",r,d),{elem:r,diff:d}},"paintDagreLayoutCore"),Lu=t(async(r)=>{let e=await co(r);return po(e.graph),await Ou(e)},"renderDagreSubgraph"),ro=t((r)=>{let e=new re({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((n)=>{if(e.setNode(n.id,{...n}),n.parentId)e.setParent(n.id,n.parentId)}),a.debug("Edges:",r.edges),r.edges.forEach((n)=>{if(n.start===n.end){let o=n.start,i=o+"---"+o+"---1",f=o+"---"+o+"---2",s=e.node(o);e.setNode(i,{domId:i,id:i,parentId:s.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(i,s.parentId),e.setNode(f,{domId:f,id:f,parentId:s.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,s.parentId);let u=structuredClone(n),d=structuredClone(n),c=structuredClone(n),p=structuredClone(n);if(d.originalEdge=u,d.selfLoop={id:u.id,order:0},c.originalEdge=u,c.selfLoop={id:u.id,order:1},p.originalEdge=u,p.selfLoop={id:u.id,order:2},d.label="",d.arrowTypeEnd="none",d.endLabelLeft="",d.endLabelRight="",d.startLabelLeft="",d.id=o+"-cyclic-special-1",c.startLabelRight="",c.startLabelLeft="",c.endLabelLeft="",c.endLabelRight="",c.arrowTypeStart="none",c.arrowTypeEnd="none",c.id=o+"-cyclic-special-mid",p.label="",p.startLabelRight="",p.startLabelLeft="",p.arrowTypeStart="none",s.isGroup)d.fromCluster=o,p.toCluster=o;p.id=o+"-cyclic-special-2",p.arrowTypeStart="none",e.setEdge(o,i,d,o+"-cyclic-special-0"),e.setEdge(i,f,c,o+"-cyclic-special-1"),e.setEdge(f,o,p,o+"-cyclic-special-2")}else e.setEdge(n.start,n.end,{...n},n.id)}),io(e),{graph:e}},"prepareLayoutForDagre"),Io=t(async(r,{element:e,preparedLayout:n})=>{let o=n??ro(r),i=l(),f=await co({element:e,graph:o.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:i});return o.measuredLayout=f,f},"measureDagreLayout"),Do=t((r,e)=>{let n=e.preparedLayout?.measuredLayout;if(!n)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return po(n.graph),Lo(r,n),n},"runDagreLayoutCore"),Iu=t((r,{measure:e})=>pa(e.graph).map((n)=>e.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),Su=t((r,e,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),ao=or({prepareLayout:ro,measureLayout:Io,runLayoutCore:Do,paintOptions:{clusterDb:W,getNodes:Iu,getEdgeNode:Su,skipNode:t((r,{measure:e})=>!e.graph.hasNode(r.id),"skipNode"),isCluster:t((r,{measure:e})=>e.graph.hasNode(r.id)&&(e.graph.children(r.id)??[]).length>0,"isCluster")}});export{no,Lo,ro,Io,Do,ao};
@@ -0,0 +1 @@
1
+ import{Ei}from"./chunk-xjc5fmcr.js";export{Ei as createInfoServices};
@@ -0,0 +1 @@
1
+ import{cn}from"./chunk-ydtrc1ay.js";export{cn as default};