filecat 6.56.1 → 6.56.2

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 (123) hide show
  1. package/build/dist/1045.0e4bdc838c37771a7f50.js +1 -0
  2. package/build/dist/1070.f9959455a7cb92f7cc56.js +1 -0
  3. package/build/dist/1297.f0c54354f6a56960f66e.js +1 -0
  4. package/build/dist/1327.4b8e684f28cdee892e00.js +1 -0
  5. package/build/dist/{1472.61f2ba5f4d19329f81a5.js → 1472.3cefc80d2c7aa7565696.js} +1 -1
  6. package/build/dist/1738.b8ab2bd79df131e60051.js +1 -0
  7. package/build/dist/1802.e43e833638f6ba8e22d7.js +1 -0
  8. package/build/dist/1964.bd3d684b50aa5191b413.js +1 -0
  9. package/build/dist/200.bb7f6ce5543bd7ff6d97.js +1 -0
  10. package/build/dist/2105.e4ba1c1d506b3fe14e8e.js +1 -0
  11. package/build/dist/2122.bc10dcdbbfc38e0ef883.js +1 -0
  12. package/build/dist/2637.9c1a442f4131e029385d.js +1 -0
  13. package/build/dist/{4619.1f7d8bf06c69e2ce9de7.js → 2822.9417e764a14f8f5f57dc.js} +1 -1
  14. package/build/dist/2824.2990d63b1d3564cf19fb.js +1 -0
  15. package/build/dist/2994.c492be0d907fa468a9be.js +1 -0
  16. package/build/dist/3300.b8a3bc571293a6280ed8.js +1 -0
  17. package/build/dist/3509.cbcb309fbf49db53229f.js +1 -0
  18. package/build/dist/{4625.a6a593542f4f2ebdae0f.js → 3510.b975b8bfdee5e8518215.js} +1 -1
  19. package/build/dist/3608.aff9429024b740ac5cd0.js +1 -0
  20. package/build/dist/3990.5e16453f57b90b01d539.js +1 -0
  21. package/build/dist/4061.c0eb5824eeb6a59fa827.js +1 -0
  22. package/build/dist/4193.58d3a34cac783ff289c6.js +1 -0
  23. package/build/dist/4253.f6c2ea8c7314d4df9c6d.js +1 -0
  24. package/build/dist/4306.9618c407f36d82608325.js +1 -0
  25. package/build/dist/4325.15c785b84773f0605fd4.js +1 -0
  26. package/build/dist/4376.b022a792fb34fbe50398.js +1 -0
  27. package/build/dist/453.8877eb10f13258c290bc.js +1 -0
  28. package/build/dist/4735.838cd0f656bbf7d99ff6.js +1 -0
  29. package/build/dist/4806.1e68bc623f8c369611a3.js +1 -0
  30. package/build/dist/4830.0042c6dcd47f7dcec003.js +1 -0
  31. package/build/dist/4985.44cb7d829ca477e368b8.js +1 -0
  32. package/build/dist/5315.0a806bc186510d2d0152.js +1 -0
  33. package/build/dist/5332.00d54e3fd946dafee80e.js +1 -0
  34. package/build/dist/5526.6b4867751becda056ed8.js +1 -0
  35. package/build/dist/583.cef46d6b21c6fa6454cf.js +1 -0
  36. package/build/dist/6164.7dae9989dd129479f952.js +1 -0
  37. package/build/dist/629.b75b024aacc43e0d69cf.js +1 -0
  38. package/build/dist/{7887.2edcfdeb215d33478936.js → 6344.291e5dadc74e62739774.js} +1 -1
  39. package/build/dist/6459.06eb5a8b0d8c8f7d3bd0.js +1 -0
  40. package/build/dist/6488.4de7c86754406277783e.js +1 -0
  41. package/build/dist/6506.ae8f7efceae47503af40.js +1 -0
  42. package/build/dist/{8535.9d68b1a6589a813c5bf1.js → 6535.a5c5040e658bc76d0da8.js} +1 -1
  43. package/build/dist/6571.b381c44055704e3ba649.js +1 -0
  44. package/build/dist/6731.6763296ce5ae210bc0fe.js +1 -0
  45. package/build/dist/6759.f88b50c41207cb8345d1.js +1 -0
  46. package/build/dist/{1715.b6871d580981169bbdc4.js → 6789.34921a30c8a81f0a6407.js} +1 -1
  47. package/build/dist/{5135.9c0adbfd935bc46dd00d.js → 6800.ee99fd0a88b6acbaaf2c.js} +1 -1
  48. package/build/dist/6803.fe4297b1e51c3bfc7f50.js +1 -0
  49. package/build/dist/6806.9ebf089eba60f3b8e946.js +1 -0
  50. package/build/dist/727.45aacafb8172bc2bb662.js +1 -0
  51. package/build/dist/{764.7c29eaf9d7edbee8467e.js → 7483.5e26ada69b33418c31a8.js} +1 -1
  52. package/build/dist/{1240.8141c3584667c9b102c5.js → 7486.fe0b5f867c08b40a3360.js} +1 -1
  53. package/build/dist/784.48a3b71205680f427109.js +1 -0
  54. package/build/dist/8079.f6f2be43e5d933ae1f6f.js +1 -0
  55. package/build/dist/821.1cd8faa58770da7e977c.js +1 -0
  56. package/build/dist/8677.860320b7f36947e57d11.js +1 -0
  57. package/build/dist/8947.7e10e5115cc7edc7fc85.js +2 -0
  58. package/build/dist/8947.7e10e5115cc7edc7fc85.js.LICENSE.txt +1 -0
  59. package/build/dist/9269.f5e25bc611f9230a1aae.js +1 -0
  60. package/build/dist/9324.ef229da9b943484298ba.js +1 -0
  61. package/build/dist/9364.d2570d78afc50fe1b23e.js +1 -0
  62. package/build/dist/9463.2629a7daf4c2865b9b96.js +1 -0
  63. package/build/dist/index.html +1 -1
  64. package/build/dist/{main.ca6dbdc5e09628b186de.js → main.e9aa2f10b4fa7ddad6e8.js} +2 -2
  65. package/build/main.js +1 -1
  66. package/package.json +1 -1
  67. package/build/dist/1081.74d56da1eab662a9c44a.js +0 -1
  68. package/build/dist/124.23fa0d2699d9618dda9b.js +0 -1
  69. package/build/dist/125.46b0b0838cec5442fdf6.js +0 -1
  70. package/build/dist/1437.9e4843f2e773b659da52.js +0 -1
  71. package/build/dist/1730.f999109734b2ec283532.js +0 -1
  72. package/build/dist/1750.36c146cd44049aaf79bc.js +0 -1
  73. package/build/dist/1772.7868dde9477de83bca1b.js +0 -1
  74. package/build/dist/2204.0759becd4d57dea31cec.js +0 -1
  75. package/build/dist/2449.0a762cd0483921adb91b.js +0 -1
  76. package/build/dist/2535.15ea6ba73588f47dc278.js +0 -1
  77. package/build/dist/2549.d0b9ca007ebae4995c22.js +0 -1
  78. package/build/dist/2862.b1506f9eda52fa4f64cd.js +0 -1
  79. package/build/dist/2979.a1aa1f822cfc6c15f4a7.js +0 -1
  80. package/build/dist/3061.d9a82470493a07566afe.js +0 -1
  81. package/build/dist/3064.4ce45ac4307075eaf0dd.js +0 -1
  82. package/build/dist/3263.226e1c7bd70ab6bac6dc.js +0 -1
  83. package/build/dist/3382.dde3926f74eb1cd9fadc.js +0 -1
  84. package/build/dist/3386.cc4b0d13967d3d1ac1ac.js +0 -1
  85. package/build/dist/3743.847ccbdcf5b607eec417.js +0 -1
  86. package/build/dist/3822.7e8ba22abbc6a60e6e20.js +0 -1
  87. package/build/dist/3889.d7b25d2a1cef2ff805dd.js +0 -1
  88. package/build/dist/3975.fde79b562d1f76f82274.js +0 -1
  89. package/build/dist/4376.619f767deddce165b717.js +0 -1
  90. package/build/dist/4450.838c3bb5cfbe9e05dc24.js +0 -1
  91. package/build/dist/4877.c31b8c8ee069225abc0d.js +0 -1
  92. package/build/dist/5014.ff2b55369c42ab3cdda2.js +0 -1
  93. package/build/dist/5222.540853902e9c52d28220.js +0 -1
  94. package/build/dist/5422.2425fc0ebb9e6676d7f4.js +0 -1
  95. package/build/dist/5431.3a2f1f3072d7c238f213.js +0 -1
  96. package/build/dist/5708.d62ffec88d557ee68f7b.js +0 -1
  97. package/build/dist/5773.7c00b7d46d038d1cad63.js +0 -1
  98. package/build/dist/5919.8a2c39a0e1623d795ee5.js +0 -1
  99. package/build/dist/5976.67aa23f2625209b8003b.js +0 -1
  100. package/build/dist/6002.1c2ff6a9c94ee343dded.js +0 -1
  101. package/build/dist/6110.a21be9c843a97bad11d5.js +0 -1
  102. package/build/dist/6402.dc70cc4e1530b8f1519d.js +0 -1
  103. package/build/dist/6428.8ce7efc20e65f396edc3.js +0 -1
  104. package/build/dist/648.ca43171884d81b27c3a3.js +0 -1
  105. package/build/dist/6794.2fe35b73c565a07ec864.js +0 -1
  106. package/build/dist/697.777c6ae21433eed0b0e9.js +0 -1
  107. package/build/dist/7017.274f83a8995232a6a9a0.js +0 -1
  108. package/build/dist/736.086cd9a8f1598c9f0ac7.js +0 -1
  109. package/build/dist/7690.7472ffd2aecc29343f18.js +0 -1
  110. package/build/dist/8018.02ea29dc6f59bbfaaee0.js +0 -1
  111. package/build/dist/8136.dc1403b91767ca089293.js +0 -1
  112. package/build/dist/8220.3ddda498d174349e189c.js +0 -1
  113. package/build/dist/8233.6f5cd229953db8462d7d.js +0 -1
  114. package/build/dist/8505.393a04f6a929ad5cb458.js +0 -1
  115. package/build/dist/8507.f94666637b2656ec4449.js +0 -1
  116. package/build/dist/8947.55d1c2f1238de7f51549.js +0 -2
  117. package/build/dist/8947.55d1c2f1238de7f51549.js.LICENSE.txt +0 -1
  118. package/build/dist/9256.5d9a03011b69d1504ae4.js +0 -1
  119. package/build/dist/9307.2c9d7f6089fef297b1c1.js +0 -1
  120. package/build/dist/9352.6ebe66d0487686642ec9.js +0 -1
  121. package/build/dist/942.ce695621242a81c499a1.js +0 -1
  122. package/build/dist/9838.fdfaf3dd7ab2adca7650.js +0 -1
  123. /package/build/dist/{main.ca6dbdc5e09628b186de.js.LICENSE.txt → main.e9aa2f10b4fa7ddad6e8.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9307],{99307(t,e,n){n.r(e),n.d(e,{render:()=>to});var o=n(62204),r=n(9290),s=n(9636),i=(n(14782),n(91865)),a=n(6129),c=(n(62979),n(5494),n(99087)),f=n(32178),d=n(31293),l=n(86827),u=n(697);async function h(t,e){const o=new u.T({multigraph:!0,compound:!0}),r=[...e.edges],i=(0,f.D7)(),a=t.insert("g").attr("class","root"),c=a.insert("g").attr("class","clusters"),d=a.insert("g").attr("class","edges edgePath"),l=a.insert("g").attr("class","edgeLabels"),h=a.insert("g").attr("class","nodes"),g=new Map,p=null!=t.node();await Promise.all(e.nodes.map(async t=>{if(t.isGroup)o.setNode(t.id,{...t});else{if(p){const e=await(0,s.on)(h,t,{config:i,dir:t.dir}),n=e.node()?.getBBox()??{width:0,height:0};g.set(t.id,e),t.width=n.width,t.height=n.height}o.setNode(t.id,{...t})}}));for(const t of r){o.setEdge(t.start,t.end,{...t},t.id);e.edges.some(e=>e.id===t.id)||e.edges.push(t)}if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:o}=await n.e(2857).then(n.bind(n,62857));o(t,e)}return{graph:o,groups:{clusters:c,edgePaths:d,edgeLabels:l,nodes:h,rootGroups:a},nodeElements:g}}(0,l.K)(h,"createGraphWithElements");var g=1e-5,p=1e-6;function x(t){const e=[];for(let n=0;n<t.length-1;n++)e.push({a:t[n],b:t[n+1]});return e}function m(t,e,n,o){const r=e.x-t.x,s=e.y-t.y,i=o.x-n.x,a=o.y-n.y,c=r*a-s*i;if(0===c)return null;const f=n.x-t.x,d=n.y-t.y,l=(f*a-d*i)/c,u=(f*s-d*r)/c;return l<=p||l>=.999999||u<=p||u>=.999999?null:{point:{x:t.x+l*r,y:t.y+l*s},tA:l,tB:u}}function y(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}function b(t){const e=[];for(let n=0;n<t.length;n++){const o=t[n],r=x(o.points);for(let s=n+1;s<t.length;s++){const n=t[s],i=x(n.points);for(const[t,s]of r.entries())for(const[r,a]of i.entries()){const i=m(s.a,s.b,a.a,a.b);if(!i)continue;const c=y(s);!!(c!==y(a))&&c?e.push({jumpEdgeId:o.id,otherEdgeId:n.id,segIndex:t,t:i.tA,point:i.point}):e.push({jumpEdgeId:n.id,otherEdgeId:o.id,segIndex:r,t:i.tB,point:i.point})}}}return e}function M(t){const e=Math.round(1e3*t)/1e3;return Number.isInteger(e),`${e}`}function K(t){return`${M(t.x)},${M(t.y)}`}function I(t){const e=t.b.x-t.a.x,n=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(n)?e>=0?1:0:n>=0?1:0}(0,l.K)(x,"buildSegmentList"),(0,l.K)(m,"segmentIntersection"),(0,l.K)(y,"isHorizontalSeg"),(0,l.K)(b,"findEdgeIntersections"),(0,l.K)(M,"fmt"),(0,l.K)(K,"pointToString"),(0,l.K)(I,"getArcSweepFlag");function w(t,e){if(t.length<2)return t.map(t=>({...t}));const n=t.map(t=>({...t})),o=e.arrowTypeStart&&i.hq[e.arrowTypeStart];if(o){const e=t[0],r=t[1],s=Math.atan2(r.y-e.y,r.x-e.x);n[0].x=e.x+o*Math.cos(s),n[0].y=e.y+o*Math.sin(s)}const r=e.arrowTypeEnd&&i.hq[e.arrowTypeEnd];if(r){const e=t.length,o=t[e-2],s=t[e-1],i=Math.atan2(s.y-o.y,s.x-o.x);n[e-1].x=s.x-r*Math.cos(i),n[e-1].y=s.y-r*Math.sin(i)}return n}function S(t,e,n,o,r){const s=t.point.x,i=t.point.y,a={x:s-e*t.r,y:i-n*t.r},c={x:s+e*t.r,y:i+n*t.r},f=[`L${K(a)}`];return"arc"===r?f.push(`A${M(t.r)},${M(t.r)} 0 0 ${o} ${K(c)}`):f.push(`M${K(c)}`),f}function v(t,e,n,o){const r=e.x-t.x,s=e.y-t.y,i=n.x-e.x,a=n.y-e.y,c=Math.hypot(r,s),f=Math.hypot(i,a);if(c<g||f<g)return null;const d=r/c,l=s/c,u=i/f,h=a/f,p=d*u+l*h,x=Math.max(-1,Math.min(1,p)),m=Math.acos(x);if(m<g||Math.abs(Math.PI-m)<g)return null;const y=Math.min(o/Math.sin(m/2),c/2,f/2);return{startX:e.x-d*y,startY:e.y-l*y,endX:e.x+u*y,endY:e.y+h*y,ctrlX:e.x,ctrlY:e.y,cutLen:y}}function C(t,e,n){const o=t.points;if(o.length<2)return"";const r=w(o,t),s="rounded"===t.curve,i=x(r),a=new Map;for(const t of e){const e=i[t.segIndex];if(!e)continue;const o=Math.hypot(e.b.x-e.a.x,e.b.y-e.a.y),r=a.get(t.segIndex)??[];r.push({t:t.t,point:t.point,d:t.t*o,r:n.jumpRadius}),a.set(t.segIndex,r)}const c=[`M${K(r[0])}`];for(let t=0;t<i.length;t++){const e=i[t],o=Math.hypot(e.b.x-e.a.x,e.b.y-e.a.y),f=0===o?0:(e.b.x-e.a.x)/o,d=0===o?0:(e.b.y-e.a.y)/o,l=I(e);let u=0;if(s&&t>0){const e=v(r[t-1],r[t],r[t+1]??r[t],5);e&&(u=e.cutLen)}let h=o,g=null;s&&t<i.length-1&&(g=v(r[t],r[t+1],r[t+2]??r[t+1],5),g&&(h=o-g.cutLen));const p=[...a.get(t)??[]].sort((t,e)=>t.t-e.t);for(const t of p)t.r=Math.min(t.r,t.d-u,h-t.d);for(let t=0;t<p.length-1;t++){const e=p[t+1].d-p[t].d;if(p[t].r+p[t+1].r>e){const n=e/2;p[t].r=Math.min(p[t].r,n),p[t+1].r=Math.min(p[t+1].r,n)}}for(const t of p)t.r<.001||c.push(...S(t,f,d,l,n.jumpStyle));s&&g?(c.push(`L${M(g.startX)},${M(g.startY)}`),c.push(`Q${M(g.ctrlX)},${M(g.ctrlY)} ${M(g.endX)},${M(g.endY)}`)):c.push(`L${K(e.b)}`)}return c.join(" ")}function L(t){return/^[\d\s+,.LMelm-]*$/.test(t)}function k(t){return!t||("linear"===t||"rounded"===t||"step"===t||"stepBefore"===t||"stepAfter"===t)}function T(t){if(!t)return null;try{const e="function"==typeof atob?atob(t):Buffer.from(t,"base64").toString(),n=JSON.parse(e);if(!Array.isArray(n))return null;const o=[];for(const t of n)t&&"number"==typeof t.x&&"number"==typeof t.y&&o.push({x:t.x,y:t.y});return o.length>=2?o:null}catch{return null}}function $(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const r=new Map;for(const t of e)r.set(t.id,t);const s=[],i=new Map;for(const t of e){const e="undefined"!=typeof CSS&&CSS.escape?CSS.escape(t.id):t.id,n=o.querySelector(`path[data-id="${e}"]`);if(!n)continue;i.set(t.id,n);const r=T(n.getAttribute("data-points"))??t.points;s.push({...t,points:r})}const a=b(s);if(0===a.length)return;const c=new Map;for(const t of a){const e=c.get(t.jumpEdgeId)??[];e.push(t),c.set(t.jumpEdgeId,e)}for(const t of s){const e=c.get(t.id);if(!e||0===e.length)continue;const o=r.get(t.id),s=o?.curve;if(void 0!==s&&!k(s))continue;const a=i.get(t.id);if(!a)continue;if(void 0===s){if(!L(a.getAttribute("d")??""))continue}const f=a.getAttribute("style")??"",d=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(f),l=d?Number.parseFloat(d[1]):null,u=d?Number.parseFloat(d[2]):null,h=C(t,e,n);if(a.setAttribute("d",h),null!==l&&null!==u&&"function"==typeof a.getTotalLength){const t=a.getTotalLength(),e=`0 ${l} ${Math.max(0,t-l-u)} ${u}`,n=f.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${e};`).replace(/;\s*;+/g,";");a.setAttribute("style",n)}}}async function R(t,e){for(const n of t.nodes)n.isGroup?await(0,s.U)(e.clusters,n):(0,s.U_)(n);const n=new Map;for(const e of t.nodes)e?.id&&n.set(e.id,e);for(const o of t.edges){const s=o.start?n.get(o.start)??{}:{},i=o.end?n.get(o.end)??{}:{},a=(0,r.Jo)(e.edgePaths,{...o},{},t.type,s,i,t.diagramId);o.label&&await(0,r.jP)(e.rootGroups,o),o.label&&O(o,a)}const o=t.config?.swimlane?.lineHops;if(!1!==o){const n="gap"===o?"gap":"arc",r=t.edges.filter(t=>Array.isArray(t.points)&&t.points.length>=2).map(t=>({id:t.id,points:t.points,curve:t.curve,arrowTypeStart:t.arrowTypeStart,arrowTypeEnd:t.arrowTypeEnd}));$(e.edgePaths,r,{enabled:!0,jumpRadius:6,jumpStyle:n})}}function O(t,e){const n=e?.updatedPath??e?.originalPath,o=(0,f.zj)(),{subGraphTitleTotalMargin:s}=(0,a.O)({flowchart:o.flowchart??{}});if(t.label){const o=r.lP.get(t.id);let i=t.x,a=t.y;if(n){const o=c._K.calcLabelPosition(n);d.R.debug("Moving label "+t.label+" from (",i,",",a,") to (",o.x,",",o.y,") abc88"),e&&(i=o.x,a=o.y)}o.attr("transform",`translate(${i}, ${a+s/2})`)}if(t?.startLabelLeft){const e=r.UQ.get(t.id).startLeft;let o=t?.x,s=t?.y;if(n){const e=c._K.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);o=e.x,s=e.y}e.attr("transform",`translate(${o}, ${s})`)}if(t.startLabelRight){const e=r.UQ.get(t.id).startRight;let o=t.x,s=t.y;if(n){const e=c._K.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);o=e.x,s=e.y}e.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelLeft){const e=r.UQ.get(t.id).endLeft;let o=t.x,s=t.y;if(n){const e=c._K.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);o=e.x,s=e.y}e.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelRight){const e=r.UQ.get(t.id).endRight;let o=t.x,s=t.y;if(n){const e=c._K.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);o=e.x,s=e.y}e.attr("transform",`translate(${o}, ${s})`)}}(0,l.K)(w,"applyMarkerOffsets"),(0,l.K)(S,"emitJump"),(0,l.K)(v,"computeRoundedCorner"),(0,l.K)(C,"rewriteEdgePath"),(0,l.K)(L,"isStraightPath"),(0,l.K)(k,"curveSupportsLineHops"),(0,l.K)(T,"decodeDataPoints"),(0,l.K)($,"applyLineJumpsToSvg"),(0,l.K)(R,"adjustLayout"),(0,l.K)(O,"positionEdgeLabel");var N="__swimlane_default__";function B(t){return Math.max(t.padding??20,20)}function E(t){const{x:e,y:n,width:o,height:r}=t,s=t.swimlaneContentTop;if("number"!=typeof e||"number"!=typeof n||"number"!=typeof o||"number"!=typeof r||"number"!=typeof s||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(r)||!Number.isFinite(s)||o<=0||r<=0)return void delete t.groupTitleRect;const i=n-r/2,a=Math.min(s,n+r/2),c=i+Math.min(21,Math.max(0,a-i));c<=i?delete t.groupTitleRect:t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:c}}function F(t){const e=t.direction,n=t.nodes??=[];for(const n of t.nodes??[])n.isGroup&&!n.parentId&&(n.shape="swimlane",e&&(n.direction=e));const o=n.filter(t=>!t.isGroup&&!t.parentId);if(0===o.length)return;let r=n.find(t=>t.id===N);r?r.isGroup&&(r.shape="swimlane",e&&(r.direction=e)):(r={id:N,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(r));for(const t of o)t.parentId=N}function Y(t){const e=new Map;for(const n of t.nodes??[])e.set(n.id,n);const n=[];for(const e of t.edges??[]){const t="string"==typeof e.start?e.start:void 0,o="string"==typeof e.end?e.end:void 0;t&&o&&(e.labelNodeId||n.push({id:e.id,src:t,dst:o,ref:e}))}const o=t.nodes??[],r=o.filter(t=>t.isGroup),s=o.filter(t=>!t.isGroup);return{nodes:[...[...r].reverse(),...s].map(t=>t.id),edges:n,layout:t,nodeById:e}}function X(t,e,n,o){const{layout:r}=t,s=t.nodeById,i=o?.layerGap??100,a=o?.nodeGap??40;let c=0;for(const t of e.layers){let e=0;for(const o of t){const t=s.get(o);if(!t){e++;continue}t.layer=c,t.order=e;const r=n.x[o]??e*a,f=n.y[o]??c*i;t.x=r,t.y=f,e++}c++}const f=r.nodes??[],d=new Map,l=[];for(const t of f){if(!t?.isGroup)continue;t.parentId||l.push(t);const e=f.filter(e=>e.parentId===t.id);let o=1/0,r=-1/0,s=1/0,i=-1/0;for(const t of e){const e=t.x??n.x[t.id],a=t.y??n.y[t.id],c=t.width??0,f=t.height??0;null!=e&&null!=a&&(o=Math.min(o,e-c/2),r=Math.max(r,e+c/2),s=Math.min(s,a-f/2),i=Math.max(i,a+f/2))}if(o===1/0||s===1/0)t.x=t.x??0,t.y=t.y??0,t.width=t.width??0,t.height=t.height??0;else{const e=t.padding??20,n=t.parentId?e:2*B(t),a=e,c=Math.max(0,r-o)+n,f=Math.max(0,i-s)+a,l=(o+r)/2,u=(s+i)/2;t.x=l,t.y=u,t.width=c,t.height=f,d.set(t.id,{minX:o,maxX:r,minY:s,maxY:i})}}if(l.length>0&&d.size>0){let t=1/0,e=-1/0,n=0;for(const o of l){const r=o.padding??20;r>n&&(n=r);const s=d.get(o.id);s&&(t=Math.min(t,s.minY),e=Math.max(e,s.maxY))}if(t!==1/0&&e!==-1/0){const o=36,r=Math.max(0,e-t)+2*Math.max(n,o),s=(t+e)/2;for(const e of l)e.y=s,e.height=r,e.swimlaneContentTop=t;const i=[...l].sort((t,e)=>(t.x??0)-(e.x??0)),a=[],c=[],f=[];for(const t of i){const e=d.get(t.id);if(!e)continue;const n=Math.max(0,e.maxX-e.minX)+2*B(t),o=(e.minX+e.maxX)/2;a.push(t.id),c.push(o),f.push(n)}const u=a.length;if(u>0){const t=new Map;if(1===u)t.set(a[0],f[0]);else{const e=[];for(let t=0;t<u-1;t++)e.push(c[t+1]-c[t]);const n=new Array(u);n[0]=0;for(let t=0;t<u-1;t++)n[t+1]=2*e[t]-n[t];let o=0,r=Number.POSITIVE_INFINITY;for(let t=0;t<u;t++){const e=f[t];t%2==0?o=Math.max(o,e-n[t]):r=Math.min(r,n[t]-e)}let s=o;s=o<=r?(o+r)/2:o;for(let e=0;e<u;e++){const o=n[e]+(e%2==0?s:-s),r=Math.max(f[e],o);t.set(a[e],r)}}for(const e of l){const n=t.get(e.id);null!=n&&(e.width=n),E(e)}}}}}(0,l.K)(B,"topLaneHorizontalPadding"),(0,l.K)(E,"assignTopLaneTitleRect"),(0,l.K)(F,"prepareLayoutForSwimlanes"),(0,l.K)(Y,"toGraphView"),(0,l.K)(X,"writeBackToLayoutData");function P(t){const e=[],n=[],o=new Map;for(const e of t.nodes)o.set(e.id,e);for(const r of t.edges){if(!r.label||0===r.label.length)continue;if(r.isLayoutOnly)continue;if(r.labelNodeId)continue;const t=r.start?o.get(r.start):void 0,s=r.end?o.get(r.end):void 0;if(!t||!s){d.R.warn("[EdgeLabelNodes]",`Edge ${r.id} has missing source or target node`);continue}const i=`edge-label-${r.start}-${r.end}-${r.id}`,a=t.parentId!==s.parentId?s.parentId:t.parentId,c={id:i,label:r.label,edgeStart:r.start??"",edgeEnd:r.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:a,isGroup:!1,labelStyle:Array.isArray(r.labelStyle)?r.labelStyle[0]:r.labelStyle??"",...t.dir?{dir:t.dir}:{}};e.push(c),r.labelNodeId=i,r.label=void 0,r.text=void 0;const f={id:`${r.id}-to-label`,start:r.start,end:i,type:"normal",isLayoutOnly:!0},l={id:`${r.id}-from-label`,start:i,end:r.end,type:"normal",isLayoutOnly:!0};n.push(f,l)}const r=[...t.nodes,...e],s=[...t.edges,...n];return{...t,nodes:r,edges:s}}(0,l.K)(P,"createEdgeLabelNodes");var z=.001;function A(t){const e=t.x??0,n=t.y??0,o=t.width??0,r=t.height??0;return o>0&&r>0?{cx:e,cy:n,rect:st(e,n,o,r)}:void 0}function G(t){if(t.isGroup)return;const e=A(t);if(!e)return;return{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}}function D(t,e,n=z){return Math.abs(t.x-e.x)<n&&Math.abs(t.y-e.y)<n}function H(t,e,n=z){return Math.abs(t.x-e.x)<n}function j(t,e,n=z){return Math.abs(t.y-e.y)<n}function _(t,e,n=z){return j(t,e,n)&&Math.abs(t.x-e.x)>n}function V(t,e,n=z){return H(t,e,n)&&Math.abs(t.y-e.y)>n}function W(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}function U(t,e,n=z){return t.horizontal&&e.horizontal&&j(t.a,e.a,n)?W(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&H(t.a,e.a,n)?W(t.a.y,t.b.y,e.a.y,e.b.y):0}function q(t,e=z){const n=[];for(let o=0;o<t.length-1;o++){const r=t[o],s=t[o+1],i=_(r,s,e),a=V(r,s,e);(i||a)&&n.push({index:o,a:r,b:s,horizontal:i,vertical:a})}return n}function J(t,e=z){const n=q(t,e);let o=0;for(let t=1;t<n.length;t++)n[t-1].horizontal!==n[t].horizontal&&o++;return o}function Q(t,e=z){const n=[];for(const o of t){const t=n.length>0?n[n.length-1]:void 0;t&&D(t,o,e)||n.push({x:o.x,y:o.y})}return n}function Z(t,e=z){if(!t||4!==t.length)return;const[n,o,r,s]=t;if(_(n,o,e)&&V(o,r,e)&&_(r,s,e))return{kind:"HVH",p0:n,p1:o,p2:r,p3:s};return V(n,o,e)&&_(o,r,e)&&V(r,s,e)?{kind:"VHV",p0:n,p1:o,p2:r,p3:s}:void 0}function tt(t,e,n,o=0){const r=Math.min(t.x,e.x),s=Math.max(t.x,e.x),i=Math.min(t.y,e.y),a=Math.max(t.y,e.y);return s>n.left-o&&r<n.right+o&&a>n.top-o&&i<n.bottom+o}function et(t,e,n=0){return t.x>e.left+n&&t.x<e.right-n&&t.y>e.top+n&&t.y<e.bottom-n}function nt(t,e){return t.left<=e.left&&t.right>=e.right&&t.top<=e.top&&t.bottom>=e.bottom}function ot(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}function rt(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}function st(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}function it(t){return A(t)?.rect}function at(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}function ct(t,e,n,o,r,s=z){const i="left"===e||"right"===e,a="left"===o||"right"===o;if(i&&a){if("right"===e&&"left"===o&&t.x<n.x||"left"===e&&"right"===o&&t.x>n.x){if(j(t,n,s))return[t,n];const e=(t.x+n.x)/2;return[t,{x:e,y:t.y},{x:e,y:n.y},n]}if(e===o){if(j(t,n,s))return;const o="left"===e?Math.min(t.x,n.x)-r:Math.max(t.x,n.x)+r;return[t,{x:o,y:t.y},{x:o,y:n.y},n]}return}if(!i&&!a){if(e===o){if(H(t,n,s))return;const o="top"===e?Math.min(t.y,n.y)-r:Math.max(t.y,n.y)+r;return[t,{x:t.x,y:o},{x:n.x,y:o},n]}if(!("bottom"===e&&"top"===o&&t.y<n.y||"top"===e&&"bottom"===o&&t.y>n.y))return;if(H(t,n,s))return[t,n];const i=(t.y+n.y)/2;return[t,{x:t.x,y:i},{x:n.x,y:i},n]}if(i&&!a){const r="right"===e&&n.x>t.x||"left"===e&&n.x<t.x,s="top"===o&&t.y<n.y||"bottom"===o&&t.y>n.y;return r&&s?[t,{x:n.x,y:t.y},n]:void 0}const c="bottom"===e&&n.y>t.y||"top"===e&&n.y<t.y,f="left"===o&&t.x<n.x||"right"===o&&t.x>n.x;return c&&f?[t,{x:t.x,y:n.y},n]:void 0}function ft(t,e,n,o){return"left"===e||"right"===e?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}function dt(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const t=G(o);t&&(e.set(t.id,t),n.push({id:t.id,rect:t.rect}))}return{nodeInfoById:e,realNodeRects:n}}function lt(t){const e=[],n=[];for(const o of t){const t=G(o);if(!t)continue;const r={id:t.id,rect:t.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}function ut(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const t=o.x??0,r=o.y??0,s=o.width??0,i=o.height??0;n.push({nodeId:o.id,...st(t,r,s,i)})}return n}function ht(t,e,n=z){const o=t.start,r=t.end;if(!o||!r)return;const s=e.get(o),i=e.get(r);return s&&i?{srcId:o,dstId:r,srcInfo:s,dstInfo:i,collinearX:Math.abs(s.cx-i.cx)<n,collinearY:Math.abs(s.cy-i.cy)<n}:void 0}function gt(t,e,n,o=[],r=0){for(const s of n)if(!o.includes(s.id)&&tt(t,e,s.rect,-r))return!0;return!1}function pt(t,e,n,o,r=z,s=1e-6){const i=j(t,e,r),a=H(t,e,r),c=j(n,o,r),f=H(n,o,r);if(i&&c||a&&f)return!1;if(!i&&!a||!c&&!f)return!1;const d=i?{a:t,b:e}:{a:n,b:o},l=a?{a:t,b:e}:{a:n,b:o},u=d.a.y,h=Math.min(d.a.x,d.b.x),g=Math.max(d.a.x,d.b.x),p=l.a.x,x=Math.min(l.a.y,l.b.y),m=Math.max(l.a.y,l.b.y);if(p<h||p>g||u<x||u>m)return!1;const y=Math.abs(p-d.a.x)<s&&Math.abs(u-d.a.y)<s||Math.abs(p-d.b.x)<s&&Math.abs(u-d.b.y)<s,b=Math.abs(p-l.a.x)<s&&Math.abs(u-l.a.y)<s||Math.abs(p-l.b.x)<s&&Math.abs(u-l.b.y)<s;return!(y&&b)}function xt(t,e,n,o,r=z){const s=j(t,e,r),i=H(t,e,r),a=j(n,o,r),c=H(n,o,r);return i&&c&&H(t,n,r)?W(t.y,e.y,n.y,o.y)>r:!!(s&&a&&j(t,n,r))&&W(t.x,e.x,n.x,o.x)>r}function mt(t,e,n,o,{epsilon:r=z,skipDegenerateOther:s=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const n=i.points;if(n&&!(n.length<2))for(let o=0;o<n.length-1;o++){const i=n[o],a=n[o+1];if((!s||!D(i,a,r))&&(pt(t,e,i,a,r)||xt(t,e,i,a,r)))return!0}}return!1}function yt(t,e,n,o,r=z){const s=j(t,e,r),i=H(t,e,r),a=j(n,o,r),c=H(n,o,r);if(!(s&&c||i&&a))return!1;const f=s?{a:t,b:e}:{a:n,b:o},d=s?{a:n,b:o}:{a:t,b:e},l=f.a.y,u=Math.min(f.a.x,f.b.x),h=Math.max(f.a.x,f.b.x),g=d.a.x,p=Math.min(d.a.y,d.b.y),x=Math.max(d.a.y,d.b.y);return g>u+r&&g<h-r&&l>p+r&&l<x-r}function bt(t,e,n){const o=Math.min(e,n),r=Math.max(e,n);return t>o+z&&t<r-z}function Mt(t,e,n){return H(t,e)&&H(e,n)?bt(e.y,t.y,n.y):!(!j(t,e)||!j(e,n))&&bt(e.x,t.x,n.x)}function Kt(t){let e=!1;const n=[];for(let o=0;o<t.length;o++){const r=n[n.length-1],s=t[o],i=o+1<t.length?t[o+1]:void 0;if(r&&i){if(D(r,i)){o++,e=!0;continue}if(Mt(r,s,i)){e=!0;continue}}n.push(s)}return{points:n,changed:e}}function It(t){const e=[t[0]];for(let n=1;n<t.length;n++){const o=e[e.length-1],r=t[n];if(!H(o,r)&&!j(o,r)){const t=e.length>=2?e[e.length-2]:void 0,n=!!t&&H(t,o)?{x:o.x,y:r.y}:{x:r.x,y:o.y};e.push(n)}e.push(r)}const n=[];for(const t of e){const e=n[n.length-1];e&&D(e,t)||n.push(t)}return n}function wt(t){if(t.length<3)return t;let e=[...t];for(let t=0;t<32;t++){const t=Kt(e);if(e=t.points,!t.changed)break}return e}(0,l.K)(A,"measuredNodeRect"),(0,l.K)(G,"nodeBoundsInfoFor"),(0,l.K)(D,"samePoint"),(0,l.K)(H,"sameX"),(0,l.K)(j,"sameY"),(0,l.K)(_,"isHorizontalSegment"),(0,l.K)(V,"isVerticalSegment"),(0,l.K)(W,"overlapLength"),(0,l.K)(U,"sameAxisSegmentOverlapLength"),(0,l.K)(q,"orthogonalSegmentsForPoints"),(0,l.K)(J,"countOrthogonalBends"),(0,l.K)(Q,"dedupeConsecutivePoints"),(0,l.K)(Z,"classifyThreeSegmentRoute"),(0,l.K)(tt,"segmentBoundsOverlapRect"),(0,l.K)(et,"pointInsideRect"),(0,l.K)(nt,"rectContainsRect"),(0,l.K)(ot,"rectsOverlap"),(0,l.K)(rt,"inflateRect"),(0,l.K)(st,"rectFromCenterSize"),(0,l.K)(it,"rectOfNodeBounds"),(0,l.K)(at,"portForRectSide"),(0,l.K)(ct,"buildOrthogonalPortPath"),(0,l.K)(ft,"buildSameSideTrackPath"),(0,l.K)(dt,"collectRealNodeBounds"),(0,l.K)(lt,"collectNodeRectEntries"),(0,l.K)(ut,"collectLayoutNodeRects"),(0,l.K)(ht,"getNodePairGeometry"),(0,l.K)(gt,"segmentHitsAnyRect"),(0,l.K)(pt,"orthogonalSegmentsCross"),(0,l.K)(xt,"sameAxisSegmentsOverlap"),(0,l.K)(mt,"segmentConflictsWithAnyEdge"),(0,l.K)(yt,"orthogonalSegmentsStrictlyCross"),(0,l.K)(bt,"strictlyBetween"),(0,l.K)(Mt,"isCollinearIntermediate"),(0,l.K)(Kt,"simplifyPolylineOnce"),(0,l.K)(It,"orthogonalizePolyline"),(0,l.K)(wt,"simplifyPolyline");var St=.001;function vt(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length<n)return;const r=o.start?e.get(o.start):void 0,s=o.end?e.get(o.end):void 0;return{edge:o,points:o.points,srcRect:r?it(r):void 0,dstRect:s?it(s):void 0}}function Ct(t,e,n){if(j(t,e,St)){return{x:t.x<n.left?n.left:n.right,y:t.y}}if(H(t,e,St)){const e=t.y<n.top?n.top:n.bottom;return{x:t.x,y:e}}return{x:Math.min(n.right,Math.max(n.left,t.x)),y:Math.min(n.bottom,Math.max(n.top,t.y))}}function Lt(t,e,n){const o=n?1:-1;let r=n?0:t.length-1;for(;r>=0&&r<t.length&&et(t[r],e,.5);)r+=o;if(r<0||r>=t.length)return t;const s=r-o;if(s<0||s>=t.length)return t;const i=Ct(t[r],t[s],e);return n?[i,...t.slice(r)]:[...t.slice(0,r+1),i]}function kt(t,e){for(const n of t){const t=vt(n,e,2);if(!t)continue;let o=[...t.points];t.srcRect&&(o=Lt(o,t.srcRect,!0)),t.dstRect&&(o=Lt(o,t.dstRect,!1)),o=wt(It(o)),o=Pt(o,t.srcRect,t.dstRect),t.edge.points=wt(It(o))}}function Tt(t,e,n,o=!1){if(j(t,e,St)){if(e.y<n.top-St||e.y>n.bottom+St)return e;if(o){if(t.x<n.left-St)return{x:n.left,y:t.y};if(t.x>n.right+St)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(H(t,e,St)){if(e.x<n.left-St||e.x>n.right+St)return e;if(o){if(t.y<n.top-St)return{x:t.x,y:n.top};if(t.y>n.bottom+St)return{x:t.x,y:n.bottom}}const r=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:r?n.top:n.bottom}}return e}function $t(t,e,n){const o=t[e];for(let r=e+n;r>=0&&r<t.length;r+=n){const e=t[r];if(!D(e,o,St))return e}return t[e+n]}function Rt(t,e){const n=t+4,o=e-4;return n<=o?{lo:n,hi:o}:{lo:(t+e)/2,hi:(t+e)/2}}function Ot(t,e,n){const{lo:o,hi:r}=Rt(e,n);return Math.min(r,Math.max(o,t))}function Nt(t){const e=Math.max(...t.map(t=>t.lo)),n=Math.min(...t.map(t=>t.hi));if(!(e>n))return{lo:e,hi:n}}function Bt(t,e){return"left"===e||"right"===e?Rt(t.top,t.bottom):Rt(t.left,t.right)}function Et(t,e,n){const o=t.y>=n.top-St&&t.y<=n.bottom+St,r=t.x>=n.left-St&&t.x<=n.right+St;if(j(t,e,St)&&o){if(Math.abs(t.x-n.left)<St)return"left";if(Math.abs(t.x-n.right)<St)return"right"}if(H(t,e,St)&&r){if(Math.abs(t.y-n.top)<St)return"top";if(Math.abs(t.y-n.bottom)<St)return"bottom"}}function Ft(t){return"left"===t||"right"===t}function Yt(t,e,n,o,r){const s=[],i=n?Et(t,e,n):void 0,a=o?Et(e,t,o):void 0;return n&&i&&Ft(i)===r&&s.push(Bt(n,i)),o&&a&&Ft(a)===r&&s.push(Bt(o,a)),s.length>0?Nt(s):void 0}function Xt(t,e,n,o,r){const s=Yt(t,e,n,o,r);if(!s)return;const i=r?t.y:t.x,a=Math.min(s.hi,Math.max(s.lo,i));return Math.abs(a-i)<St?void 0:r?[{x:t.x,y:a},{x:e.x,y:a}]:[{x:a,y:t.y},{x:a,y:e.y}]}function Pt(t,e,n){if(2!==t.length)return t;const[o,r]=t;return j(o,r,St)?Xt(o,r,e,n,!0)??t:H(o,r,St)?Xt(o,r,e,n,!1)??t:t}function zt(t,e,n){return Ft(n)?{x:t.x,y:Ot(t.y,e.top,e.bottom)}:{x:Ot(t.x,e.left,e.right),y:t.y}}function At(t,e,n,o,r,s){const i=t.map(t=>({...t}));for(let a=e;a>=0&&a<t.length;a+=n){const e=t[a];if(s&&!j(e,o,St))break;if(!s&&!H(e,o,St))break;s?i[a].y=r.y:i[a].x=r.x}return i}function Gt(t,e,n){if(t.length<2)return t;const o=n?0:t.length-1,r=n?1:-1,s=t[o],i=$t(t,o,r);if(!i)return t;const a=Et(s,i,e);if(!a)return t;const c=Ft(a),f=zt(s,e,a);return D(s,f,St)?t:At(t,o,r,s,f,c)}function Dt(t,e,n){const o=Math.min(t.x,e.x)>=n.left-St&&Math.max(t.x,e.x)<=n.right+St,r=Math.min(t.y,e.y)>=n.top-St&&Math.max(t.y,e.y)<=n.bottom+St;return Math.abs(t.y-n.top)<St&&Math.abs(e.y-n.top)<St&&o?"top":Math.abs(t.y-n.bottom)<St&&Math.abs(e.y-n.bottom)<St&&o?"bottom":Math.abs(t.x-n.left)<St&&Math.abs(e.x-n.left)<St&&r?"left":Math.abs(t.x-n.right)<St&&Math.abs(e.x-n.right)<St&&r?"right":void 0}function Ht(t,e,n,o){switch(t){case"top":return H(e,n,St)&&n.y<o.top-St;case"bottom":return H(e,n,St)&&n.y>o.bottom+St;case"left":return j(e,n,St)&&n.x<o.left-St;case"right":return j(e,n,St)&&n.x>o.right+St}}function jt(t,e,n){if(t.length<3)return t;if(n){const n=Dt(t[0],t[1],e);return n&&Ht(n,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,r=Dt(t[o-1],t[o],e);return r&&Ht(r,t[o-1],t[o-2],e)?t.slice(0,o):t}function _t(t,e,n){let o=t;if(e){const t=$t(o,0,1);if(t){const n=Tt(t,o[0],e);n!==o[0]&&(o=[n,...o.slice(1)])}o=jt(o,e,!0)}if(n){const t=o.length-1,e=$t(o,t,-1);if(e){const r=Tt(e,o[t],n,!0);r!==o[t]&&(o=[...o.slice(0,t),r])}o=jt(o,n,!1)}const r=Pt(o,e,n);return r!==o||2===o.length?r:(e&&(o=Gt(o,e,!0)),n&&(o=Gt(o,n,!1)),o)}function Vt(t,e){for(const n of t){const t=vt(n,e,2);if(!t)continue;const o=_t(Q(t.points,St),t.srcRect,t.dstRect);if(o.length<3){t.edge.points=o;continue}const r=[o[0],{...o[0]},...o.slice(1,-1),o[o.length-1],{...o[o.length-1]}];t.edge.points=r}}function Wt(t){return new Map(t.map(t=>[t.id,t]))}function Ut(t,e){let n=t.parentId,o=null;for(;n;){const t=e.get(n);if(!t?.isGroup)break;o=t.id,n=t.parentId}return o}function qt(t,e){let n=0,o=t.parentId;for(;o;){const t=e.get(o);if(!t?.isGroup)break;n++,o=t.parentId}return n}function Jt(t){let e=1/0,n=-1/0,o=1/0,r=-1/0;for(const s of t){const t=s.x,i=s.y;if("number"!=typeof t||"number"!=typeof i)continue;const a=s.width??0,c=s.height??0;e=Math.min(e,t-a/2),n=Math.max(n,t+a/2),o=Math.min(o,i-c/2),r=Math.max(r,i+c/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:r}}function Qt(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}function Zt(t){const e=Wt(t),n=t.filter(t=>t.isGroup&&t.parentId).sort((t,n)=>qt(n,e)-qt(t,e));for(const e of n){const n=Jt(t.filter(t=>t.parentId===e.id));n&&Qt(e,n)}}function te(t,e){const n=t.nodes??[],o=t.edges??[],r=n.filter(t=>!t.isGroup);let s=1/0,i=-1/0;for(const t of r){const n=t[e];"number"==typeof n&&(s=Math.min(s,n),i=Math.max(i,n))}if(!Number.isFinite(s)||!Number.isFinite(i))return!1;const a=(0,l.K)(t=>s+i-t,"mirror");for(const t of n){const n=t[e];"number"==typeof n&&(t[e]=a(n));const o=t.groupTitleRect;o&&(t.groupTitleRect="x"===e?{...o,left:a(o.right),right:a(o.left)}:{...o,top:a(o.bottom),bottom:a(o.top)})}for(const t of o)for(const n of t.points??[])n[e]=a(n[e]);return!0}function ee(t){return!(t.nodes??[]).some(t=>!t.isGroup)||te(t,"y")}function ne(t,e="LR"){const n=t.nodes??[],o=t.edges??[],r=n.filter(t=>!t.isGroup);let s=1/0,i=1/0;for(const t of r){const e=t.x??0,n=t.y??0;e<s&&(s=e),n<i&&(i=n)}if(!Number.isFinite(s)||!Number.isFinite(i))return!1;const a=36;let c=0,f=0;for(const t of r)c+=t.width??0,f+=t.height??0;const d=c/r.length,l=f/r.length,u=l>0?Math.max(1,d/l):1;for(const t of r){const e=t.x??0,n=((t.y??0)-i)*u+a,o=e-s;t.x=n,t.y=o}for(const t of o)if(t.points)for(const e of t.points){const t=e.x,n=(e.y-i)*u+a,o=t-s;e.x=n,e.y=o}Zt(n);const h=n.filter(t=>t.isGroup&&!t.parentId);if(0===h.length)return"RL"===e&&te(t,"x"),!0;const g=Wt(n),p=new Map;for(const t of n){if(t.isGroup)continue;const e=Ut(t,g);if(!e)continue;const n=p.get(e)??[];n.push(t),p.set(e,n)}let x=0;for(const t of h){const e=t.padding??0;e>x&&(x=e)}const m=[];let y=1/0,b=-1/0;for(const t of h){const e=Jt(p.get(t.id)??[]);e&&(y=Math.min(y,e.minX),b=Math.max(b,e.maxX),m.push({lane:t,contentTop:e.minY,contentBottom:e.maxY,centerY:(e.minY+e.maxY)/2}))}if(y===1/0||b===-1/0)return!0;const M=Math.max(0,b-y)+2*Math.max(x,10),K=a+M,I=(y+b)/2-M/2-a,w=I+K/2,S=Math.max(x,a);m.sort((t,e)=>t.centerY-e.centerY);for(let t=0;t<m.length;t++){const e=m[t];let n,o;if(0===t)n=e.contentTop-S;else{n=(m[t-1].contentBottom+e.contentTop)/2}if(t===m.length-1)o=e.contentBottom+S;else{const n=m[t+1];o=(e.contentBottom+n.contentTop)/2}const r=Math.max(0,o-n),s=(n+o)/2;e.lane.x=w,e.lane.y=s,e.lane.width=K,e.lane.height=r,e.lane.swimlaneContentTop=e.contentTop,e.lane.groupTitleRect={left:I,right:I+a,top:n,bottom:o}}return"RL"===e&&te(t,"x"),!0}(0,l.K)(vt,"endpointContextFor"),(0,l.K)(Ct,"segmentEnterPoint"),(0,l.K)(Lt,"clipEndpoint"),(0,l.K)(kt,"clipEdgeEndpointsToNodeBoundaries"),(0,l.K)(Tt,"snapEndpointToBoundary"),(0,l.K)($t,"firstDistinctAdjacent"),(0,l.K)(Rt,"cornerClearanceRange"),(0,l.K)(Ot,"clampToCornerClearance"),(0,l.K)(Nt,"intersectRanges"),(0,l.K)(Bt,"clearanceRangeForSide"),(0,l.K)(Et,"terminalSideForSegment"),(0,l.K)(Ft,"isHorizontalSide"),(0,l.K)(Yt,"straightClearanceRange"),(0,l.K)(Xt,"clearStraightEndpointCornerAxis"),(0,l.K)(Pt,"clearStraightEndpointCornerConnections"),(0,l.K)(zt,"cornerClearedEndpoint"),(0,l.K)(At,"moveCollinearEndpointRun"),(0,l.K)(Gt,"clearEndpointCornerConnection"),(0,l.K)(Dt,"borderSideForSegment"),(0,l.K)(Ht,"leavesOutward"),(0,l.K)(jt,"collapseOwnBorderStub"),(0,l.K)(_t,"snapAndCollapseEndpoints"),(0,l.K)(Vt,"prepareEdgeEndpointsForRenderer"),(0,l.K)(Wt,"buildNodeMap"),(0,l.K)(Ut,"resolveTopLevelGroupId"),(0,l.K)(qt,"groupDepth"),(0,l.K)(Jt,"boundsForChildren"),(0,l.K)(Qt,"applyGroupBounds"),(0,l.K)(Zt,"recomputeNestedGroupBounds"),(0,l.K)(te,"mirrorAxis"),(0,l.K)(ee,"applyBtDirectionTransform"),(0,l.K)(ne,"applyLrDirectionTransform");var oe=1e-6,re=[0,8,-8,16,-16];function se(t,e){const{nodeInfoById:n,realNodeRects:o}=dt(e);for(const e of t){if(e.isLayoutOnly)continue;const r=e.points;if(!r||r.length<4)continue;const s=Z(Q(r,oe),oe);if(!s)continue;const{p3:i}=s,a="HVH"===s.kind,c=ht(e,n,oe);if(!c)continue;const{srcId:f,dstId:d,srcInfo:l,dstInfo:u,collinearX:h,collinearY:g}=c;if(h||g)continue;let p;const x=l.rect;for(const n of re){let r,s,c;if(a){const t=u.cy>l.cy?x.bottom:x.top,e=l.cx+n;if(e<=x.left+oe||e>=x.right-oe)continue;r={x:e,y:t},s={x:e,y:i.y},c={x:i.x,y:i.y}}else{const t=u.cx>l.cx?x.right:x.left,e=l.cy+n;if(e<=x.top+oe||e>=x.bottom-oe)continue;r={x:t,y:e},s={x:i.x,y:e},c={x:i.x,y:i.y}}const h=D(r,s,oe),g=D(s,c,oe);if(h&&g)continue;if(!h&&gt(r,s,o,[f],1))continue;if(!g&&gt(s,c,o,[d],1))continue;const m=!h&&mt(r,s,t,e,{epsilon:oe,skipDegenerateOther:!0}),y=!g&&mt(s,c,t,e,{epsilon:oe,skipDegenerateOther:!0});if(!m&&!y){p=h?[s,c]:g?[r,s]:[r,s,c];break}}p&&(e.points=p)}}function ie(t,e){const n=.001,{realNodeRects:o,labelNodeRects:r}=lt(e.values());for(const s of t){if(s.isLayoutOnly)continue;const i=s.points;if(!i||i.length<4)continue;const a=Q(i,n);if(a.length<4)continue;const c=a.length-1,f=a[c],d=a[c-1],u=a[c-2],h=f.x-d.x,g=f.y-d.y,p=Math.hypot(h,g);if(p>=10||p<n)continue;const x=d.x-u.x,m=d.y-u.y;if(Math.hypot(x,m)<n)continue;const y=_(d,f,n),b=V(d,f,n),M=_(u,d,n),K=V(u,d,n);if(!(y&&K||b&&M))continue;const I=s.end,w=s.start,S=I?e.get(I):void 0;if(!S)continue;const v=S.x??0,C=S.y??0,L=it(S);if(!L)continue;let k,T;if(K){const t=m<0;k={x:v,y:u.y},T={x:v,y:t?L.bottom:L.top}}else{const t=x>0;k={x:u.x,y:C},T={x:t?L.right:L.left,y:C}}if(gt(k,T,o,I?[I]:[],-2))continue;if(gt(k,T,r,[],-2))continue;if(w){const t=e.get(w),n=t?it(t):void 0;if(n&&et(k,n,2))continue}const $=(0,l.K)((t,e)=>`${t.x.toFixed(3)},${t.y.toFixed(3)}|${e.x.toFixed(3)},${e.y.toFixed(3)}`,"ownSegmentKey"),R=new Set;for(let t=0;t<a.length-1;t++)R.add($(a[t],a[t+1]));const O=(0,l.K)((e,o)=>{for(const r of t){if(r===s)continue;if(r.isLayoutOnly)continue;const t=r.points;if(t&&!(t.length<2))for(let r=0;r<t.length-1;r++){const s=t[r],i=t[r+1];if(!R.has($(s,i))&&yt(e,o,s,i,n))return!0}}return!1},"segmentCrossesOtherEdge");if(O(k,T))continue;if(c-3>=0){const t=a[c-3];if(gt(t,k,o,[w,I].filter(t=>Boolean(t)),-2))continue;if(O(t,k))continue}const N=[...a.slice(0,c-2),k,T];s.points=N;const B=s.labelNodeId;if(B){const t=e.get(B);if(t){const e=t.width??0,o=t.height??0;if(e>0&&o>0){let r,s,i=-1;for(let t=0;t<N.length-1;t++){const a=N[t],c=N[t+1],f=Math.hypot(c.x-a.x,c.y-a.y),d=j(a,c,n),l=H(a,c,n);(d&&f>=e+2||l&&f>=o+2)&&(f>i&&(i=f,r=(a.x+c.x)/2,s=(a.y+c.y)/2))}void 0!==r&&void 0!==s&&(t.x=r,t.y=s)}}}}}(0,l.K)(se,"portSwapToLShape"),(0,l.K)(ie,"collapseShortTerminalStub");var ae=.001,ce=q,fe=(0,l.K)((t,e)=>H(t,e,ae)||j(t,e,ae),"orthogonallyAligned");function de(t,e){const n=(0,l.K)((t,e)=>{const n=t.x??0,o=t.y??0,r=e.x-n,s=e.y-o;let i=(t.width??0)/2,a=(t.height??0)/2;return Math.abs(s)*i>Math.abs(r)*a?(s<0&&(a=-a),{x:n+(0===s?0:a*r/s),y:o+a}):(r<0&&(i=-i),{x:n+i,y:o+(0===r?0:i*s/r)})},"rectIntersect"),o=(0,l.K)((t,o)=>{const r=Q(t.points??[]);if(r.length<2)return;const s=o?t.start:t.end,i=s?e.get(s):void 0,a=i?it(i):void 0;if(!i||!s||!a)return;const c=o?r[0]:r[r.length-1],f=o?r[1]:r[r.length-2],d=n(i,c);let l=c;return fe(f,d)&&(l=f),H(d,l,ae)?{edge:t,edgeId:String(t.id??""),nodeId:s,atStart:o,orientation:"V",coord:d.x,min:Math.min(d.y,l.y),max:Math.max(d.y,l.y),boundary:d,railEnd:l,rect:a}:j(d,l,ae)?{edge:t,edgeId:String(t.id??""),nodeId:s,atStart:o,orientation:"H",coord:d.y,min:Math.min(d.x,l.x),max:Math.max(d.x,l.x),boundary:d,railEnd:l,rect:a}:void 0},"terminalLaneFor"),r=(0,l.K)((t,e)=>Math.max(0,Math.min(t.max,e.max)-Math.max(t.min,e.min)),"projectedOverlapLength"),s=(0,l.K)((t,e)=>{if(t.nodeId!==e.nodeId||t.orientation!==e.orientation)return!1;if("H"===t.orientation){return(Math.abs(t.boundary.x-t.rect.left)<1||Math.abs(t.boundary.x-t.rect.right)<1)&&H(t.boundary,e.boundary,1)}return(Math.abs(t.boundary.y-t.rect.top)<1||Math.abs(t.boundary.y-t.rect.bottom)<1)&&j(t.boundary,e.boundary,1)},"sameTerminalFace"),i=(0,l.K)((t,e)=>{if(t.nodeId!==e.nodeId||t.orientation!==e.orientation)return!1;return r(t,e)>=8&&Math.abs(t.coord-e.coord)<.5},"exactTerminalLaneConflict"),a=(0,l.K)((t,e)=>{if(t.nodeId!==e.nodeId||t.orientation!==e.orientation||"H"!==t.orientation||t.atStart===e.atStart)return!1;const n=r(t,e);if(n<8)return!1;const o=t.rect.bottom-t.rect.top;return!(n<o||n>2*o)&&(s(t,e)&&Math.abs(t.coord-e.coord)<16)},"nearTerminalLaneConflict"),c=(0,l.K)((t,e)=>{const n=Q(t.edge.points??[]);if(n.length<2)return;const o="V"===t.orientation?{x:t.boundary.x+e,y:t.boundary.y}:{x:t.boundary.x,y:t.boundary.y+e},r="V"===t.orientation?{x:t.railEnd.x+e,y:t.railEnd.y}:{x:t.railEnd.x,y:t.railEnd.y+e};if(!(0,l.K)(()=>Math.abs(t.boundary.y-t.rect.top)<1||Math.abs(t.boundary.y-t.rect.bottom)<1?j(o,t.boundary,ae)&&o.x>=t.rect.left+1&&o.x<=t.rect.right-1:(Math.abs(t.boundary.x-t.rect.left)<1||Math.abs(t.boundary.x-t.rect.right)<1)&&(H(o,t.boundary,ae)&&o.y>=t.rect.top+1&&o.y<=t.rect.bottom-1),"boundaryStaysOnSameFace")())return;if(t.atStart){const e=n.length>1&&D(n[1],t.railEnd,ae),s=n.slice(e?2:1),i=s[0];if(i&&!fe(i,r))return;return[o,r,...s]}const s=n.length>1&&D(n[n.length-2],t.railEnd,ae),i=n.slice(0,s?-2:-1),a=i[i.length-1];return!a||fe(a,r)?[...i,r,o]:void 0},"shiftedCandidate"),f=(0,l.K)(t=>{const n=t.edge,o=Q(n.points??[]);if(2!==o.length)return!1;const r=n.start,s=n.end,i=r?e.get(r):void 0,a=s?e.get(s):void 0;if(!i||!a)return!1;const c=i.x??0,f=i.y??0,d=a.x??0,l=a.y??0,[u,h]=o;return j(u,h,ae)&&Math.abs(f-l)<1&&Math.abs(c-d)>1||H(u,h,ae)&&Math.abs(c-d)<1&&Math.abs(f-l)>1},"laneIsStraightCollinearConnector"),d=[-7,7,-14,14,-21,21];for(let e=0;e<8;e++){const e=t.filter(t=>!t.isLayoutOnly).flatMap(t=>[o(t,!0),o(t,!1)]).filter(t=>Boolean(t));let n=!1;for(let t=0;t<e.length&&!n;t++)for(let r=t+1;r<e.length&&!n;r++){const s=e[t],l=e[r];if(s.edge===l.edge||!i(s,l)&&!a(s,l))continue;const u=!i(s,l),h=[s,l].sort((t,e)=>{const n=f(t),o=f(e);return n!==o?Number(n)-Number(o):Number(!e.atStart)-Number(!t.atStart)});for(const t of h){for(const r of d){const s=c(t,r);if(!s)continue;const f=o({...t.edge,points:s},t.atStart);if(f&&!e.some(e=>e.edge!==t.edge&&(i(f,e)||u&&a(f,e)))){t.edge.points=s,n=!0;break}}if(n)break}}if(!n)return}}function le(t,e){const{realNodeRects:n,labelNodeRects:o}=lt(e.values()),r=(0,l.K)((e,r)=>{const s=e.start,i=e.end,a=ce(r);if(a.length!==r.length-1)return!1;const c=[s,i].filter(t=>Boolean(t));for(const t of a){if(gt(t.a,t.b,n,c,-2))return!1;if(gt(t.a,t.b,o,[],-2))return!1}for(const n of t){if(n===e||n.isLayoutOnly)continue;const t=n.points;if(t&&!(t.length<2))for(const e of a)for(const n of ce(Q(t))){if(U(e,n,.5)>=8)return!1;if(yt(e.a,e.b,n.a,n.b,ae))return!1}}return!0},"candidateIsSafe"),s=(0,l.K)((t,e)=>{if(e+4>=t.length)return;const n=t[e],o=t[e+1],r=t[e+2],s=t[e+3],i=t[e+4],a=_(n,o)&&V(o,r)&&_(r,s)&&V(s,i)&&H(n,s,ae)&&H(n,i,ae)&&H(o,r,ae)&&(o.x-n.x)*(s.x-r.x)<0,c=V(n,o)&&_(o,r)&&V(r,s)&&_(s,i)&&j(n,s,ae)&&j(n,i,ae)&&j(o,r,ae)&&(o.y-n.y)*(s.y-r.y)<0;if(a||c)return Q([...t.slice(0,e+1),i,...t.slice(e+5)]);if(e+5>=t.length)return;const f=t[e+5],d=V(n,o)&&_(o,r)&&V(r,s)&&_(s,i)&&V(i,f)&&H(n,i,ae)&&H(n,f,ae)&&H(r,s,ae)&&(r.x-o.x)*(i.x-s.x)<0,l=_(n,o)&&V(o,r)&&_(r,s)&&V(s,i)&&_(i,f)&&j(n,i,ae)&&j(n,f,ae)&&j(r,s,ae)&&(r.y-o.y)*(i.y-s.y)<0;return d||l?Q([...t.slice(0,e+1),f,...t.slice(e+6)]):void 0},"withoutDogleg");for(let e=0;e<8;e++){let e=!1;for(const n of t){if(n.isLayoutOnly)continue;const t=Q(n.points??[]);for(let o=0;o<=t.length-5;o++){const i=s(t,o);if(i&&r(n,i)){n.points=i,e=!0;break}}if(e)break}if(!e)return}}function ue(t,e){const{realNodeRects:n,labelNodeRects:o}=lt(e.values()),r=t.filter(t=>!t.isLayoutOnly),s=(0,l.K)((t,e,n)=>Q(t===e?n??[]:t.points??[]),"pointsFor"),i=(0,l.K)((t,e)=>{let n=0;for(let o=0;o<r.length;o++){const i=ce(s(r[o],t,e));for(let a=o+1;a<r.length;a++){const o=ce(s(r[a],t,e));for(const t of i)for(const e of o)yt(t.a,t.b,e.a,e.b,ae)&&n++}}return n},"strictCrossingCount"),a=(0,l.K)(t=>{const e=ce(t);if(3!==e.length)return;const n=e[1];return e[0].horizontal!==n.horizontal&&e[2].horizontal!==n.horizontal?{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}:void 0},"middleRail"),c=(0,l.K)((t,e)=>{const o=[t.start,t.end].filter(t=>Boolean(t));return n.filter(t=>{if(o.includes(t.id))return!1;const n=t.rect;if(e.horizontal){return W(e.a.x,e.b.x,n.left,n.right)>=8&&e.a.y>=n.top-2&&e.a.y<=n.bottom+2}return W(e.a.y,e.b.y,n.top,n.bottom)>=8&&e.a.x>=n.left-2&&e.a.x<=n.right+2})},"blockingRectsFor"),f=(0,l.K)((t,e,n)=>{const o=t.map(t=>({...t}));if(e.horizontal)o[e.index].y=n,o[e.index+1].y=n;else{if(!e.vertical)return;o[e.index].x=n,o[e.index+1].x=n}const r=wt(Q(o));return ce(r).length===r.length-1?r:void 0},"candidateByMovingRail"),d=(0,l.K)((t,e,a)=>{const c=[t.start,t.end].filter(t=>Boolean(t)),f=ce(e);if(f.length!==e.length-1)return!1;for(const t of f){if(gt(t.a,t.b,n,c,-2))return!1;if(gt(t.a,t.b,o,[],-2))return!1}for(const e of r)if(e!==t)for(const t of f)for(const n of ce(s(e)))if(U(t,n,.5)>=8)return!1;return i(t,e)<=a},"candidateIsSafe");for(let t=0;t<8;t++){const t=i();let e=!1;for(const n of r){const o=s(n),r=a(o);if(!r)continue;const i=c(n,r.segment);if(0===i.length)continue;const l=r.horizontal?[Math.min(...i.map(t=>t.rect.top))-20,Math.max(...i.map(t=>t.rect.bottom))+20]:[Math.min(...i.map(t=>t.rect.left))-20,Math.max(...i.map(t=>t.rect.right))+20];for(const s of l){const i=f(o,r.segment,s);if(i&&d(n,i,t)){n.points=i,e=!0;break}}if(e)break}if(!e)return}}function he(t,e){const n=(0,l.K)(t=>{const e=t.groupTitleRect;if(e&&"number"==typeof e.left&&"number"==typeof e.right&&"number"==typeof e.top&&"number"==typeof e.bottom&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&!(e.right<=e.left)&&!(e.bottom<=e.top))return{left:e.left,right:e.right,top:e.top,bottom:e.bottom}},"validTitleRect"),o=(0,l.K)(t=>{if(!t.isGroup||t.parentId)return;const e=t.direction,o="string"==typeof e?e.toUpperCase():"";if("LR"===o||"RL"===o||"BT"===o)return;const r=n(t),s=t.y,i=t.height;if(!r||"number"!=typeof s||"number"!=typeof i||!Number.isFinite(s)||!Number.isFinite(i)||i<=0)return;const a=r.right-r.left,c=r.bottom-r.top;return c<=0||a<c?void 0:{node:t,rect:r}},"topLaneTitleFor"),r=(0,l.K)((t,e)=>{if(!t.horizontal)return!1;const n=t.a.y;return!(n<=e.top+ae||n>=e.bottom-ae)&&W(t.a.x,t.b.x,e.left,e.right)>=8},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(o).filter(t=>Boolean(t));if(0===s.length)return;let i=0;for(const e of t){if(e.isLayoutOnly)continue;const t=Q(e.points??[]);for(const e of ce(t))for(const t of s)r(e,t.rect)&&(i=Math.max(i,t.rect.bottom-e.a.y+4))}if(!(i<=ae))for(const t of s){const e=t.node.y,n=t.node.height;"number"!=typeof e||"number"!=typeof n||!Number.isFinite(e)||!Number.isFinite(n)||n<=0||(t.node.y=e-i/2,t.node.height=n+i,t.node.groupTitleRect={...t.rect,top:t.rect.top-i,bottom:t.rect.bottom-i})}}function ge(t,e){const n=(0,l.K)(t=>{const e=t.groupTitleRect;if(e&&"number"==typeof e.left&&"number"==typeof e.right&&"number"==typeof e.top&&"number"==typeof e.bottom&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&!(e.right<=e.left)&&!(e.bottom<=e.top))return{left:e.left,right:e.right,top:e.top,bottom:e.bottom}},"validTitleRect"),o=(0,l.K)(t=>{if(!t.isGroup||t.parentId)return;if("LR"!==t.direction)return;const e=n(t),o=t.x,r=t.width;if(!e||"number"!=typeof o||"number"!=typeof r||!Number.isFinite(o)||!Number.isFinite(r)||r<=0)return;const s=e.right-e.left,i=e.bottom-e.top;return s<=0||i<s?void 0:{node:t,rect:e}},"leftLaneTitleFor"),r=(0,l.K)((t,e)=>{if(!t.vertical)return!1;const n=t.a.x;return!(n<=e.left+ae||n>=e.right-ae)&&W(t.a.y,t.b.y,e.top,e.bottom)>=8},"verticalSegmentIntersectsTitle"),s=(0,l.K)((t,e)=>{if(!t.horizontal)return!1;const n=t.a.y;return!(n<=e.top+ae||n>=e.bottom-ae)&&W(t.a.x,t.b.x,e.left,e.right)>=8},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(o).filter(t=>Boolean(t));if(0===i.length)return;let a=0;for(const e of t){if(e.isLayoutOnly)continue;const t=Q(e.points??[]);for(const e of ce(t))for(const t of i)if(r(e,t.rect))a=Math.max(a,t.rect.right-e.a.x+4);else if(s(e,t.rect)){const n=Math.min(e.a.x,e.b.x);a=Math.max(a,t.rect.right-n+4)}}if(!(a<=ae))for(const t of i){const e=t.node.x,n=t.node.width;"number"!=typeof e||"number"!=typeof n||!Number.isFinite(e)||!Number.isFinite(n)||n<=0||(t.node.x=e-a/2,t.node.width=n+a,t.node.groupTitleRect={...t.rect,left:t.rect.left-a,right:t.rect.right-a})}}function pe(t,e){const{realNodeRects:n}=lt(e.values()),o=t.filter(t=>!t.isLayoutOnly),r=(0,l.K)((t,e=new Map)=>Q(e.get(t)??t.points??[]),"replacementPointsFor"),s=(0,l.K)((t=new Map)=>{let e=0;for(let n=0;n<o.length;n++){const s=ce(r(o[n],t));for(let i=n+1;i<o.length;i++){const n=ce(r(o[i],t));for(const t of s)for(const o of n)yt(t.a,t.b,o.a,o.b,ae)&&e++}}return e},"crossingCount"),i=(0,l.K)((t=new Map)=>o.reduce((e,n)=>e+J(r(n,t)),0),"totalBends"),a=(0,l.K)(t=>{const e=r(t);if(e.length<4)return;const n=e[e.length-2],o=e[e.length-1];return _(n,o,ae)||V(n,o,ae)?{tailStart:n,terminal:o}:void 0},"terminalTailFor"),c=(0,l.K)((t,e)=>{const n=r(t);if(n.length<3)return;const o=n[0],s=n[1];let i;if(_(o,s,ae))i={x:s.x,y:e.tailStart.y};else{if(!V(o,s,ae))return;i={x:e.tailStart.x,y:s.y}}const a=wt(Q([o,s,i,e.tailStart,e.terminal]));return ce(a).length===a.length-1?a:void 0},"candidateWithDestinationTail"),f=(0,l.K)((t,e)=>{const o=[t.start,t.end].filter(t=>Boolean(t));for(const t of ce(e))if(gt(t.a,t.b,n,o,-2))return!0;return!1},"pathHasNodeHit"),d=(0,l.K)((t,e,n)=>{for(const s of o)if(s!==t)for(const t of ce(e))for(const e of ce(r(s,n)))if(U(t,e,.5)>=8)return!0;return!1},"pathHasSharedTrack"),u=(0,l.K)((t,e,n)=>!f(t,e)&&!d(t,e,n),"candidateIsSafe"),h=(0,l.K)(()=>{const t=new Map;for(const n of o){const o=n.end;if(!o||!e.has(o))continue;if(r(n).length<4)continue;const s=t.get(o)??[];s.push(n),t.set(o,s)}return t},"edgesByDestination");for(let t=0;t<4;t++){const t=s();if(0===t)return;let e,n=t,o=i();for(const r of h().values())for(let f=0;f<r.length;f++)for(let d=f+1;d<r.length;d++){const l=r[f],h=r[d],g=a(l),p=a(h);if(!g||!p)continue;const x=c(l,p),m=c(h,g);if(!x||!m)continue;const y=new Map([[l,x],[h,m]]);if(!u(l,x,y)||!u(h,m,y))continue;const b=s(y),M=i(y);b>=t||(b>n||b===n&&M>=o||(e=y,n=b,o=M))}if(!e)return;for(const[t,n]of e)t.points=n}}function xe(t,e){const{realNodeRects:n,labelNodeRects:o}=lt(e.values()),r=t.filter(t=>!t.isLayoutOnly),s=(0,l.K)((t,e=new Map)=>Q(e.get(t)??t.points??[]),"replacementPointsFor"),i=(0,l.K)((t=new Map)=>{let e=0;for(let n=0;n<r.length;n++){const o=ce(s(r[n],t));for(let i=n+1;i<r.length;i++){const n=ce(s(r[i],t));for(const t of o)for(const o of n)yt(t.a,t.b,o.a,o.b,ae)&&e++}}return e},"strictCrossingCount"),a=(0,l.K)((t=new Map)=>r.reduce((e,n)=>e+J(s(n,t)),0),"totalBends"),c=(0,l.K)(t=>{const n=t.start,o=t.end,r=n?e.get(n):void 0,s=o?e.get(o):void 0,i=r?it(r):void 0,a=s?it(s):void 0;return i&&a?{src:i,dst:a}:void 0},"endpointRectsFor"),f=(0,l.K)((t,e,n)=>{if(n.index<=0||n.index+1>=e.length-1)return;const o=c(t);if(o){if(n.vertical){const r=n.a.x,s=Math.min(o.src.left,o.dst.left),i=Math.max(o.src.right,o.dst.right),a=r<s-ae?"left":r>i+ae?"right":void 0;if(!a)return;return{edge:t,points:e,segmentIndex:n.index,axis:"vertical",side:a,coord:r,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}}if(n.horizontal){const r=n.a.y,s=Math.min(o.src.top,o.dst.top),i=Math.max(o.src.bottom,o.dst.bottom),a=r<s-ae?"top":r>i+ae?"bottom":void 0;if(!a)return;return{edge:t,points:e,segmentIndex:n.index,axis:"horizontal",side:a,coord:r,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}}}},"externalRailForSegment"),d=(0,l.K)(()=>{const t=[];for(const e of r){const n=s(e);for(const o of ce(n)){const r=f(e,n,o);r&&t.push(r)}}return t},"collectExternalRails"),u=(0,l.K)((t,e)=>t.edge!==e.edge&&t.axis===e.axis&&t.side===e.side&&W(t.min,t.max,e.min,e.max)>=8,"railsInteract"),h=(0,l.K)(t=>{const e=[],n=new Set;for(const o of t){if(n.has(o))continue;const r=[o],s=[];for(n.add(o);r.length>0;){const e=r.pop();s.push(e);for(const o of t)!n.has(o)&&u(e,o)&&(n.add(o),r.push(o))}s.length>1&&e.push(s)}return e},"connectedComponents"),g=(0,l.K)(t=>{const e=[];for(const n of t)e.some(t=>Math.abs(t-n.coord)<ae)||e.push(n.coord);for(;e.length<t.length;){const n=Math.min(...e),o=Math.max(...e),r=t[0].side;e.push("left"===r||"top"===r?n-12*(t.length-e.length):o+12*(t.length-e.length))}return e},"uniqueCoordsFor"),p=(0,l.K)(t=>{const e=t.map(t=>t.coord),n=g(t),o=[];if(t.length<=6){const r=new Array(n.length).fill(!1),s=[],i=(0,l.K)(()=>{if(s.length!==t.length)for(const[t,e]of n.entries())r[t]||(r[t]=!0,s.push(e),i(),s.pop(),r[t]=!1);else s.some((t,n)=>Math.abs(t-e[n])>=ae)&&o.push([...s])},"visit");return i(),o}for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){const r=[...e];[r[t],r[n]]=[r[n],r[t]],o.push(r)}return o},"coordinateAssignmentsFor"),x=(0,l.K)((t,e)=>{const n=new Map;for(const[o,r]of t.entries()){const t=e[o],s=n.get(r.edge)??r.points.map(t=>({x:t.x,y:t.y}));"vertical"===r.axis?(s[r.segmentIndex].x=t,s[r.segmentIndex+1].x=t):(s[r.segmentIndex].y=t,s[r.segmentIndex+1].y=t),n.set(r.edge,s)}const o=new Map;for(const[t,e]of n){const n=wt(Q(e));if(ce(n).length!==n.length-1)return;o.set(t,n)}return o},"replacementsForAssignment"),m=(0,l.K)(t=>{for(const[e,r]of t){const t=[e.start,e.end].filter(t=>Boolean(t));for(const e of ce(r)){if(gt(e.a,e.b,n,t,-2))return!1;if(gt(e.a,e.b,o,[],-2))return!1}}for(let e=0;e<r.length;e++){const n=r[e],o=t.has(n),i=ce(s(n,t));for(let n=e+1;n<r.length;n++){const e=r[n];if(!o&&!t.has(e))continue;const a=ce(s(e,t));for(const t of i)for(const e of a)if(U(t,e,.5)>=8)return!1}}return!0},"candidateIsSafe");for(let t=0;t<4;t++){const t=i();if(0===t)return;let e,n=t,o=a(),r=Number.POSITIVE_INFINITY;for(const s of h(d()))for(const c of p(s)){const f=x(s,c);if(!f||!m(f))continue;const d=i(f);if(d>=t)continue;const l=a(f),u=s.reduce((t,e,n)=>t+Math.abs(c[n]-e.coord),0);d>n||d===n&&(l>o||l===o&&u>=r)||(e=f,n=d,o=l,r=u)}if(!e)return;for(const[t,n]of e)t.points=n}}function me(t,e){const{realNodeRects:n,labelNodeRects:o}=lt(e.values()),r=t.filter(t=>!t.isLayoutOnly),s=(0,l.K)((t,e,n)=>Q(t===e?n??[]:t.points??[]),"pointsFor"),i=(0,l.K)(t=>ce(t).reduce((t,e)=>{const n=e.a.x-e.b.x,o=e.a.y-e.b.y;return t+Math.hypot(n,o)},0),"pathLength"),a=(0,l.K)((t,e)=>{let n=0;for(let o=0;o<r.length;o++){const i=ce(s(r[o],t,e));for(let a=o+1;a<r.length;a++){const o=ce(s(r[a],t,e));for(const t of i)for(const e of o)yt(t.a,t.b,e.a,e.b,ae)&&n++}}return n},"strictCrossingCount"),c=(0,l.K)((t,e)=>{if(t.horizontal){const n=t.a.y;return(Math.abs(n-e.top)<1||Math.abs(n-e.bottom)<1)&&W(t.a.x,t.b.x,e.left,e.right)>=8}if(t.vertical){const n=t.a.x;return(Math.abs(n-e.left)<1||Math.abs(n-e.right)<1)&&W(t.a.y,t.b.y,e.top,e.bottom)>=8}return!1},"segmentRunsAlongRectBorder"),f=(0,l.K)(t=>{const n=[t.start,t.end].filter(t=>Boolean(t)),o=[];for(const t of n){const n=e.get(t),r=n?it(n):void 0;r&&o.push(r)}return o},"endpointRectsFor"),d=(0,l.K)((t,e)=>{if(e+3>=t.length)return[];const n=t[e],o=t[e+1],r=t[e+2],s=t[e+3],i=_(n,o,ae)&&V(o,r,ae)&&_(r,s,ae),a=V(n,o,ae)&&_(o,r,ae)&&V(r,s,ae);if(!i&&!a)return[];if(!(i?Math.sign(o.x-n.x)!==Math.sign(s.x-r.x):Math.sign(o.y-n.y)!==Math.sign(s.y-r.y)))return[];const c=H(n,s,ae)||j(n,s,ae)?[]:[{x:n.x,y:s.y},{x:s.x,y:n.y}],f=0===c.length?[[...t.slice(0,e+1),...t.slice(e+3)]]:c.map(n=>[...t.slice(0,e+1),n,...t.slice(e+3)]),d=new Set;return f.map(t=>wt(Q(t))).filter(t=>{if(ce(t).length!==t.length-1)return!1;if(!t.some(t=>D(t,s,ae)))return!1;const e=t.map(t=>`${t.x.toFixed(3)},${t.y.toFixed(3)}`).join("|");return!d.has(e)&&(d.add(e),!0)})},"shortcutCandidatesAt"),u=(0,l.K)((t,e,i)=>{const d=[t.start,t.end].filter(t=>Boolean(t)),l=f(t);for(const t of ce(e)){if(gt(t.a,t.b,n,d,-2))return!1;if(gt(t.a,t.b,o,[],-2))return!1;if(l.some(e=>c(t,e)))return!1}for(const n of r)if(n!==t)for(const t of ce(e))for(const e of ce(s(n)))if(U(t,e,.5)>=8)return!1;return a(t,e)<=i},"candidateIsSafe");for(let t=0;t<8;t++){const t=a();let e,n,o=t,c=Number.POSITIVE_INFINITY,f=Number.POSITIVE_INFINITY;for(const l of r){const r=s(l),h=J(r,ae),g=i(r);for(let s=0;s<=r.length-4;s++)for(const p of d(r,s)){const r=J(p,ae),s=i(p);if(!(r<h||r===h&&s<g-ae)||!u(l,p,t))continue;const d=a(l,p);d>o||d===o&&(r>c||r===c&&s>=f)||(e=l,n=p,o=d,c=r,f=s)}}if(!e||!n)return;e.points=n}}function ye(t,e){const n=20,o=[];for(const t of e.values()){if(t.isGroup||t.isEdgeLabel)continue;const e=t.x??0,n=t.y??0,r=it(t);r&&o.push({id:String(t.id??""),cx:e,cy:n,rect:r})}if(0===o.length)return;const r=new Map(o.map(t=>[t.id,t])),s=o.map(t=>({id:t.id,rect:t.rect})),i=["top","bottom","left","right"],a={top:Math.min(...o.map(t=>t.rect.top))-n,bottom:Math.max(...o.map(t=>t.rect.bottom))+n,left:Math.min(...o.map(t=>t.rect.left))-n,right:Math.max(...o.map(t=>t.rect.right))+n},c=t.filter(t=>!t.isLayoutOnly),f=new Map(c.map((t,e)=>[t,e])),d=(0,l.K)(t=>{const e="left"===t||"top"===t?-1:1,o=[];for(let r=0;r<=2;r++)o.push(a[t]+e*n*r);return o},"outwardTracksForSide"),u=(0,l.K)((t,e=new Map)=>Q(e.get(t)??t.points??[]),"replacementPointsFor"),h=(0,l.K)((t,e)=>{let n=0;for(const o of t)for(const t of e)yt(o.a,o.b,t.a,t.b,ae)&&n++;return n},"crossingCountBetweenSegments"),g=(0,l.K)((t,e)=>h(ce(t),ce(e)),"crossingCountBetweenPaths"),p=(0,l.K)((t=new Map)=>{let e=0;const n=[],o=new Set,r=[],s=(0,l.K)(t=>{o.has(t)||(o.add(t),r.push(t))},"addEdge");for(let o=0;o<c.length;o++){const r=c[o],i=u(r,t);for(let a=o+1;a<c.length;a++){const o=c[a],f=g(i,u(o,t));f>0&&(e+=f,n.push({first:r,second:o,count:f}),s(r),s(o))}}return r.sort((t,e)=>(f.get(t)??0)-(f.get(e)??0)),{count:e,pairs:n,edgeSet:o,edges:r}},"crossingSnapshot"),x=(0,l.K)((t,e)=>{const n=new Set(e.keys());if(0===n.size)return t.count;let o=0;for(const e of t.pairs)(n.has(e.first)||n.has(e.second))&&(o+=e.count);let r=0;for(let t=0;t<c.length;t++){const o=c[t],s=n.has(o),i=u(o,e);for(let o=t+1;o<c.length;o++){const t=c[o];(s||n.has(t))&&(r+=g(i,u(t,e)))}}return t.count-o+r},"crossingCountWithReplacements"),m=(0,l.K)(t=>{const e=new Map;for(const n of t.pairs){const t=e.get(n.first)??new Set;t.add(n.second),e.set(n.first,t);const o=e.get(n.second)??new Set;o.add(n.first),e.set(n.second,o)}const n=[],o=new Set;for(const r of t.edges){if(o.has(r))continue;const t=[r],s=[];for(o.add(r);t.length>0;){const n=t.pop();s.push(n);for(const r of e.get(n)??[])o.has(r)||(o.add(r),t.push(r))}s.sort((t,e)=>(f.get(t)??0)-(f.get(e)??0)),s.length>1&&n.push(s)}return n},"crossingComponents"),y=(0,l.K)(t=>[t.start,t.end].filter(t=>Boolean(t)),"endpointIdsFor"),b=(0,l.K)(t=>{const e=[];for(const n of m(t)){const t=new Set(n),o=new Set(n.flatMap(t=>y(t))),r=[...n];for(const e of c)t.has(e)||y(e).some(t=>o.has(t))&&r.push(e);r.sort((t,e)=>(f.get(t)??0)-(f.get(e)??0)),e.push(r)}return e},"pairSearchGroups"),M=(0,l.K)((t,e,n)=>x(t,new Map([[e,n]])),"crossingCountWithSingleReplacement"),K=(0,l.K)(t=>{const e=new Map;for(const n of t.pairs)e.set(n.first,(e.get(n.first)??0)+n.count),e.set(n.second,(e.get(n.second)??0)+n.count);return e},"currentCrossingsByEdge"),I=(0,l.K)(t=>t.slice(1).reduce((e,n,o)=>{const r=t[o];return e+Math.abs(n.x-r.x)+Math.abs(n.y-r.y)},0),"pathLength"),w=(0,l.K)((t=new Map)=>c.reduce((e,n)=>e+J(u(n,t)),0),"totalBends"),S=(0,l.K)((t=new Map)=>c.reduce((e,n)=>e+I(u(n,t)),0),"totalLength"),v=(0,l.K)((t,e,n=new Map)=>{const o=ce(e);for(const e of c)if(e!==t)for(const t of o)for(const o of ce(u(e,n)))if(U(t,o,.5)>=8)return!0;return!1},"pathHasSegmentConflict"),C=(0,l.K)((t,e)=>{const n=[t.start,t.end].filter(t=>Boolean(t));for(const t of ce(e))if(gt(t.a,t.b,s,n,-2))return!0;return!1},"pathHitsNode"),L=(0,l.K)((t,e)=>{const n=wt(Q(e));ce(n).length===n.length-1&&t.push(n)},"pushOrthogonalCandidate"),k=(0,l.K)(t=>"left"===t||"right"===t,"sideIsHorizontal"),T=(0,l.K)((t,e,o)=>{switch(e){case"left":return Math.min(t.x,o.x)-n;case"right":return Math.max(t.x,o.x)+n;case"top":return Math.min(t.y,o.y)-n;case"bottom":return Math.max(t.y,o.y)+n}},"localTrackForSameSide"),$=(0,l.K)((t,e,o,r)=>{const s="left"===o||"top"===o?-1:1,i=[T(e,o,r),a[o]];for(const a of i)for(let i=0;i<=2;i++)L(t,ft(e,o,r,a+s*n*i))},"addSameSideCandidates"),R=(0,l.K)((t,e,n,o,r)=>{for(const s of d(n))for(const n of d(r))L(t,[e,{x:s,y:e.y},{x:s,y:n},{x:o.x,y:n},o])},"addHorizontalToVerticalCandidates"),O=(0,l.K)((t,e,n,o,r)=>{for(const s of d(n))for(const n of d(r))L(t,[e,{x:e.x,y:s},{x:n,y:s},{x:n,y:o.y},o])},"addVerticalToHorizontalCandidates"),N=(0,l.K)((t,e,n,o,r)=>{const s=[...d("top"),...d("bottom")];for(const i of d(n))for(const n of d(r))for(const r of s)L(t,[e,{x:i,y:e.y},{x:i,y:r},{x:n,y:r},{x:n,y:o.y},o])},"addHorizontalPairCandidates"),B=(0,l.K)((t,e,n,o,r)=>{const s=[...d("left"),...d("right")];for(const i of d(n))for(const n of d(r))for(const r of s)L(t,[e,{x:e.x,y:i},{x:r,y:i},{x:r,y:n},{x:o.x,y:n},o])},"addVerticalPairCandidates"),E=(0,l.K)(t=>{const e=new Set;return t.map(t=>Q(t)).filter(t=>{const n=t.map(t=>`${t.x.toFixed(3)},${t.y.toFixed(3)}`).join("|");return!(e.has(n)||t.length<2)&&(e.add(n),!0)})},"dedupeCandidatePaths"),F=(0,l.K)((t,e,o,r)=>{const s=[],i=ct(t,e,o,r,n,ae);i&&L(s,i),e===r&&$(s,t,e,o);const a=k(e),c=k(r);return a&&!c?R(s,t,e,o,r):!a&&c?O(s,t,e,o,r):a?N(s,t,e,o,r):B(s,t,e,o,r),E(s)},"buildCandidatesForSides"),Y=(0,l.K)((t,e,n,o)=>{const r=[...d("left"),...d("right")],s=[...d("top"),...d("bottom")];for(const a of i){const i=at(o,a),c="top"===a||"bottom"===a?d(a):s;for(const o of r){L(t,[e,n,{x:o,y:n.y},{x:o,y:i.y},i]);for(const r of c)L(t,[e,n,{x:o,y:n.y},{x:o,y:r},{x:i.x,y:r},i])}}},"addVerticalDepartureOuterTrackCandidates"),X=(0,l.K)((t,e,n,o)=>{const r=[...d("left"),...d("right")],s=[...d("top"),...d("bottom")];for(const a of i){const i=at(o,a),c="left"===a||"right"===a?d(a):r;for(const o of s){L(t,[e,n,{x:n.x,y:o},{x:i.x,y:o},i]);for(const r of c)L(t,[e,n,{x:n.x,y:o},{x:r,y:o},{x:r,y:i.y},i])}}},"addHorizontalDepartureOuterTrackCandidates"),P=(0,l.K)(t=>{const e=t.start,n=t.end,o=n?r.get(n):void 0;if(!e||!o)return[];const s=Q(t.points??[]);if(s.length<4)return[];const i=s[0],a=s[1],c=[];return V(i,a,ae)?Y(c,i,a,o):_(i,a,ae)&&X(c,i,a,o),c},"terminalPreservingOuterTrackCandidates"),z=(0,l.K)(t=>{const e=t.start,n=t.end,o=e?r.get(e):void 0,s=n?r.get(n):void 0;if(!o||!s)return[];const a=[];for(const t of i){const e=at(o,t);for(const n of i)a.push(...F(e,t,at(s,n),n))}return a.push(...P(t)),a},"candidatePathsFor"),A=(0,l.K)(()=>new Map(c.map(t=>[t,ce(u(t))])),"currentSegmentsByEdge"),G=(0,l.K)((t,e,n)=>{const o=new Set;for(const r of c){if(r===t)continue;const s=n.get(r)??ce(u(r));e.some(t=>s.some(e=>U(t,e,.5)>=8))&&o.add(r)}return o},"sharedTrackConflictsFor"),D=(0,l.K)((t,e,n,o)=>{const r=new Set;return z(t).map(t=>wt(Q(t))).filter(e=>{if(C(t,e))return!1;const n=e.map(t=>`${t.x.toFixed(3)},${t.y.toFixed(3)}`).join("|");return!(r.has(n)||e.length<2)&&(r.add(n),!0)}).map(r=>{const s=ce(r);let i=0;for(const e of c)e!==t&&(i+=h(s,n.get(e)??ce(u(e))));return{candidate:r,candidateSegments:s,crossings:e.count-(o.get(t)??0)+i,bends:J(r,ae),totalBends:J(r),length:I(r)}}).filter(({crossings:t})=>t<=e.count).sort((t,e)=>t.crossings-e.crossings||t.bends-e.bends||t.length-e.length).slice(0,48).map(e=>({path:e.candidate,segments:e.candidateSegments,sharedTrackConflicts:G(t,e.candidateSegments,n),totalBends:e.totalBends,length:e.length}))},"pairCandidatesFor"),H=(0,l.K)((t,e,n,o,r,s)=>{let i=0;for(const n of t.pairs)n.first!==e&&n.second!==e&&n.first!==o&&n.second!==o||(i+=n.count);let a=h(n.segments,r.segments);for(const t of c){if(t===e||t===o)continue;const i=s.get(t)??ce(u(t));a+=h(n.segments,i)+h(r.segments,i)}return t.count-i+a},"pairCrossingCount"),j=(0,l.K)((t,e)=>{for(const n of t.sharedTrackConflicts)if(n!==e)return!1;return!0},"conflictsOnlyWith"),W=(0,l.K)((t,e)=>t.segments.some(t=>e.segments.some(e=>U(t,e,.5)>=8)),"candidatesShareTrack"),q=(0,l.K)((t,e,n,o)=>j(e,n.edge)&&j(o,t.edge)&&!W(e,o),"pairCandidatesAreCompatible"),Z=(0,l.K)((t,e,n,o,r)=>{const s=H(t.current,e.edge,n,o.edge,r,t.baseSegments);if(!(s>=t.current.count))return{replacements:new Map([[e.edge,n.path],[o.edge,r.path]]),crossings:s,bends:t.currentBends-(t.baseBendsByEdge.get(e.edge)??0)-(t.baseBendsByEdge.get(o.edge)??0)+n.totalBends+r.totalBends,length:t.currentLength-(t.baseLengthByEdge.get(e.edge)??0)-(t.baseLengthByEdge.get(o.edge)??0)+n.length+r.length}},"scorePairReplacement"),tt=(0,l.K)((t,e)=>t.crossings<e.crossings||t.crossings===e.crossings&&(t.bends<e.bends||t.bends===e.bends&&t.length<e.length),"pairScoreIsBetter"),et=(0,l.K)((t,e,n,o)=>{let r=o;for(const o of e.candidates)for(const s of n.candidates){if(!q(e,o,n,s))continue;const i=Z(t,e,o,n,s);i&&tt(i,r)&&(r=i)}return r},"bestScoreForOptionPair"),nt=(0,l.K)(t=>{const e=w(),n=S(),o=A(),r=K(t),s=new Map(c.map(t=>[t,J(u(t))])),i=new Map(c.map(t=>[t,I(u(t))])),a=new Map,f=b(t);for(const e of f)for(const n of e){if(a.has(n))continue;const e=D(n,t,o,r);e.length>0&&a.set(n,{edge:n,candidates:e})}let d={replacements:new Map,crossings:t.count,bends:e,length:n};const l={current:t,currentBends:e,currentLength:n,baseBendsByEdge:s,baseLengthByEdge:i,baseSegments:o};for(const e of f){const n=new Set(e.filter(e=>t.edgeSet.has(e))),o=e.map(t=>a.get(t)).filter(t=>Boolean(t));for(let t=0;t<o.length;t++){const e=o[t];for(let r=t+1;r<o.length;r++){const t=o[r];(n.has(e.edge)||n.has(t.edge))&&(d=et(l,e,t,d))}}}return d.replacements.size>0?d.replacements:void 0},"bestPairedReplacement");for(let t=0;t<4;t++){const t=p(),e=t.count;if(0===e)return;let n,o,r=e,s=Number.POSITIVE_INFINITY;for(const i of t.edges){const a=J(u(i),ae);for(const c of z(i)){const f=C(i,c),d=!f&&v(i,c),l=M(t,i,c),u=J(c,ae);if(f||d)continue;(l<e||l===e&&u<a)&&(l>r||l===r&&u>=s||(n=i,o=c,r=l,s=u))}}if(n&&o){n.points=o;continue}const i=nt(t);if(!i)return;for(const[t,e]of i)t.points=e}}(0,l.K)(de,"separateSharedRenderedTerminalLanes"),(0,l.K)(le,"collapseRedundantRectangularDoglegs"),(0,l.K)(ue,"liftObstacleHuggingSameSideRails"),(0,l.K)(he,"liftTopLaneTitleBandsAboveRails"),(0,l.K)(ge,"shiftLeftLaneTitleBandsLeftOfRails"),(0,l.K)(pe,"swapDestinationTerminalTailsToReduceCrossings"),(0,l.K)(xe,"reassignCrossingExternalRailChannels"),(0,l.K)(me,"shortcutRedundantOrthogonalJogs"),(0,l.K)(ye,"resolveRenderedOrthogonalCrossings");var be=.001;function Me(t,e){const{nodeInfoById:n,realNodeRects:o}=dt(e),r=["top","bottom","left","right"],s={top:Math.min(...o.map(t=>t.rect.top))-20,bottom:Math.max(...o.map(t=>t.rect.bottom))+20,left:Math.min(...o.map(t=>t.rect.left))-20,right:Math.max(...o.map(t=>t.rect.right))+20},i=(0,l.K)((t,e,n,o)=>{const r=[],i=ct(t,e,n,o,20,be);return i&&r.push(i),e===o&&r.push(ft(t,e,n,s[e])),r},"buildOrthogonalPathCandidates"),a=(0,l.K)((t,e)=>{for(let n=0;n<t.length-1;n++){if(gt(t[n],t[n+1],o,e,1))return!0}return!1},"pathHitsNode"),c=(0,l.K)((e,n,o=!1)=>{let r=0;const s=q(e,be),i=n.start,a=n.end;for(const e of t){if(e===n||e.isLayoutOnly)continue;const t=e.start,c=e.end;if(!o&&i&&a&&(t===i||t===a||c===i||c===a))continue;const f=e.points;if(f&&!(f.length<2))for(const t of s)for(const e of q(f,be))(pt(t.a,t.b,e.a,e.b,be,be)||U(t,e,be)>=8)&&r++}return r},"pathConflictCount"),f=(0,l.K)((t,e)=>{const n=Math.abs(t.y-e.rect.top),o=Math.abs(t.y-e.rect.bottom),r=Math.abs(t.x-e.rect.left),s=Math.abs(t.x-e.rect.right);let i="top",a=n;return o<a&&(i="bottom",a=o),r<a&&(i="left",a=r),s<a&&(i="right",a=s),i},"nearestSideOfRect"),d=new Map,u=(0,l.K)((t,e,n)=>{const o=d.get(t)??[];o.push({side:e,edgeId:n}),d.set(t,o)},"addFaceClaim");for(const e of t){if(e.isLayoutOnly)continue;const t=e.points??[];if(t.length<1)continue;const o=e.id??"",r=e.start,s=e.end;if(r){const e=n.get(r);e&&u(r,f(t[0],e),o)}if(s){const e=n.get(s);e&&u(s,f(t[t.length-1],e),o)}}const h=(0,l.K)((t,e,n)=>d.get(t)?.some(t=>t.edgeId!==n&&t.side===e)??!1,"faceIsClaimed");for(const e of t){if(e.isLayoutOnly)continue;const t=e.points;if(!t||t.length<2)continue;const o=J(t,be);if(o<4)continue;const s=e.start,l=e.end;if(!s||!l)continue;const g=n.get(s),p=n.get(l);if(!g||!p)continue;const x=e.id??"",m=c(t,e,!0),y=c(t,e);let b,M=m,K=o;for(const t of r){if(h(s,t,x))continue;const n=at(g,t);for(const o of r){if(h(l,o,x))continue;const r=at(p,o);for(const f of i(n,t,r,o)){if(a(f,[s,l]))continue;const t=J(f,be);if(m>0){const n=c(f,e,!0);if(n>M||n===M&&t>=K)continue;M=n,K=t,b=f;continue}c(f,e)>y||t<K&&(K=t,b=f)}}}if(b){e.points=b;const t=d.get(s);t&&d.set(s,t.filter(t=>t.edgeId!==x));const n=d.get(l);n&&d.set(l,n.filter(t=>t.edgeId!==x)),u(s,f(b[0],g),x),u(l,f(b[b.length-1],p),x)}}}(0,l.K)(Me,"simplifyDetouredEdges");var Ke=.001;function Ie(t,e){const n=e?0:t.length-1,o=e?1:-1,r=t[n],s=t[n+o];if(!r||!s)return;const i=s.x-r.x,a=s.y-r.y;if(!(Math.abs(i)+Math.abs(a)<Ke)){if(Math.abs(a)<=Ke){const t=r.x+10*Math.sign(i);return{left:Math.min(r.x,t),right:Math.max(r.x,t),top:r.y-7,bottom:r.y+7}}if(Math.abs(i)<=Ke){const t=r.y+10*Math.sign(a);return{left:r.x-7,right:r.x+7,top:Math.min(r.y,t),bottom:Math.max(r.y,t)}}return{left:Math.min(r.x,s.x),right:Math.max(r.x,s.x),top:Math.min(r.y,s.y),bottom:Math.max(r.y,s.y)}}}function we(t){return{left:Math.min(t.left,t.right),right:Math.max(t.left,t.right),top:Math.min(t.top,t.bottom),bottom:Math.max(t.top,t.bottom)}}function Se(t,e){const n=Q(e);return[Ie(n,!0),Ie(n,!1)].some(e=>e&&ot(t,we(e)))}function ve(t,e){const n=[];for(const e of t){if(e.isLayoutOnly)continue;const t=e.points;if(t&&!(t.length<2))for(let o=0;o<t.length-1;o++)n.push({edgeId:e.id,p1:t[o],p2:t[o+1]})}const o=[],r=[];for(const t of e.values()){const e=t.isGroup,n=t.parentId;if(e&&!n){const e=it(t);e&&r.push({id:t.id,rect:e});continue}if(e)continue;if(t.isEdgeLabel)continue;const s=it(t);s&&o.push({nodeId:t.id,rect:s})}const s=(0,l.K)((t,e)=>{const n=rt(e,3);for(const{nodeId:e,rect:r}of o)if(e!==t&&ot(n,r))return!0;return!1},"labelOverlapsForeignNode"),i=(0,l.K)((t,e)=>{const o=rt(e,3);for(const e of n)if(e.edgeId!==t&&tt(e.p1,e.p2,o))return!0;return!1},"labelOverlapsForeignEdge"),a=(0,l.K)((t,e,n)=>s(t,n)||i(e,n),"labelOverlapsAnything"),c=[],f=(0,l.K)(t=>{for(const{id:e,rect:n}of r)if(nt(n,t))return e},"findContainingLane"),d=(0,l.K)((t,e)=>c.some(n=>n.labelId!==t&&ot(e,n.rect)),"overlapsPlacedLabel");for(const n of t){if(n.isLayoutOnly)continue;const t=n.labelNodeId;if(!t)continue;const o=e.get(t);if(!o)continue;const u=n.points;if(!u||u.length<2)continue;const h=o.width??0,g=o.height??0;if(h<=0||g<=0)continue;const p=[];for(let t=0;t<u.length-1;t++){const e=u[t],n=u[t+1],o=Math.abs(e.x-n.x),r=Math.abs(e.y-n.y);o<Ke&&r<Ke||(o>=Ke&&r>=Ke||p.push({idx:t,length:o+r,orientation:o>=Ke?"horizontal":"vertical",midX:(e.x+n.x)/2,midY:(e.y+n.y)/2}))}if(0===p.length)continue;const x=p.length>=3?p.filter(t=>t.idx>0&&t.idx<p.length-1):p,m=x.length>0?x:p,y=h>=g?"horizontal":"vertical",b=(0,l.K)(t=>[...t].sort((t,e)=>{const n=t.orientation===y;if(n!==(e.orientation===y))return n?-1:1;const o=t.length>=("horizontal"===t.orientation?h:g)+2;return o!==e.length>=("horizontal"===e.orientation?h:g)+2?o?-1:1:e.length-t.length}),"rankSegments"),M=p[0],K=p[p.length-1],I=[.5,.25,.75,.05,.95,.15,.85,.1,.9],w=(0,l.K)((t,e)=>{const n=u[t.idx],o=u[t.idx+1];return{midX:n.x+(o.x-n.x)*e,midY:n.y+(o.y-n.y)*e}},"anchorAtT"),S=(0,l.K)((t,e,n)=>Math.min(n,Math.max(e,t)),"clamp"),v=(0,l.K)((t,e)=>t.midX>=e.left-Ke&&t.midX<=e.right+Ke&&t.midY>=e.top-Ke&&t.midY<=e.bottom+Ke,"pointInsideRectInclusive"),C=(0,l.K)(t=>{const e=st(t.midX,t.midY,h,g),n=f(e);if(n)return{laneId:n,anchor:t,rect:e};const o=r.find(({rect:e})=>v(t,e));if(!o)return;const s=o.rect.left+h/2+1,i=o.rect.right-h/2-1,a=o.rect.top+g/2+1,c=o.rect.bottom-g/2-1;if(s>i||a>c)return;const d={midX:S(t.midX,s,i),midY:S(t.midY,a,c)},l=st(d.midX,d.midY,h,g);return v(t,l)?{laneId:o.id,anchor:d,rect:l}:void 0},"placementForAnchor"),L=(0,l.K)((t,e,n)=>"horizontal"===t.orientation?Math.abs(e.midX-n.x):Math.abs(e.midY-n.y),"distanceAlongSegment"),k=(0,l.K)((t,e)=>{const n=("horizontal"===t.orientation?h/2:g/2)+12;if(t===M){const o=u[t.idx];if(L(t,e,o)+Ke<n)return!1}if(t===K){const o=u[t.idx+1];if(L(t,e,o)+Ke<n)return!1}return!0},"labelClearsTerminalEndpoints"),T=(0,l.K)(e=>{const o=b(e);for(const e of o)for(const o of I){const r=w(e,o);if(!k(e,r))continue;const s=C(r);if(s&&(!Se(s.rect,u)&&!d(t,s.rect)&&!a(t,n.id,s.rect)))return{laneId:s.laneId,anchor:s.anchor}}},"tryPool"),$=(0,l.K)((e,o,r=!1)=>{const a=b(e);for(const e of a){const a={midX:e.midX,midY:e.midY};if(o&&!k(e,a))continue;const c=C(a);if(c&&!Se(c.rect,u)&&!d(t,c.rect)&&!s(t,c.rect)&&(r||!i(n.id,c.rect)))return{laneId:c.laneId,anchor:c.anchor}}},"findLaneContainingFallback"),R=T(m)??(m.length<p.length?T(p):void 0)??$(p,!0)??$(p,!1)??$(p,!1,!0);if(R){o.x=R.anchor.midX,o.y=R.anchor.midY,o.parentId=R.laneId;const e=st(R.anchor.midX,R.anchor.midY,h,g),n=c.findIndex(e=>e.labelId===t);n>=0?c[n]={labelId:t,rect:e}:c.push({labelId:t,rect:e})}}}(0,l.K)(Ie,"markerClearanceRectFor"),(0,l.K)(we,"normalizeRect"),(0,l.K)(Se,"labelOverlapsOwnMarker"),(0,l.K)(ve,"anchorLabelsToPolyline");var Ce=1e-6;function Le(t,e){return t<e?`${t}::${e}`:`${e}::${t}`}function ke(t,e){const{nodeInfoById:n,realNodeRects:o}=dt(e),r=new Map;for(const t of e){const e=t.id;t.isGroup||t.isEdgeLabel&&r.set(e,{w:t.width??0,h:t.height??0})}const s=(0,l.K)((e,n,o,s)=>{const i=Le(n,o);let a=0;const c=(0,l.K)(t=>{if(!t)return;const e=r.get(t);if(!e)return;const n="x"===s?e.w/2:e.h/2;n>a&&(a=n)},"consider");c(e.labelNodeId);for(const n of t){if(n===e)continue;if(n.isLayoutOnly)continue;const t=n.start,o=n.end;t&&o&&(Le(t,o)===i&&c(n.labelNodeId))}return a>0?a+3:0},"labelClearanceFor");for(const e of t){if(e.isLayoutOnly)continue;if(!Z(e.points,Ce))continue;const r=ht(e,n,Ce);if(!r)continue;const{srcId:i,dstId:a,srcInfo:c,dstInfo:f,collinearX:d,collinearY:l}=r;if(d===l)continue;let u,h;if(d){const t=f.cy>c.cy;u={x:c.cx,y:t?c.rect.bottom:c.rect.top},h={x:f.cx,y:t?f.rect.top:f.rect.bottom}}else{const t=f.cx>c.cx;u={x:t?c.rect.right:c.rect.left,y:c.cy},h={x:t?f.rect.left:f.rect.right,y:f.cy}}if(gt(u,h,o,[i,a],1))continue;const g=s(e,i,a,d?"x":"y"),p=g>4?g:4,x=[0,p,-p];for(const n of x){const r={...u},s={...h};if(d){if(r.x+=n,s.x+=n,r.x<=c.rect.left||r.x>=c.rect.right)continue;if(s.x<=f.rect.left||s.x>=f.rect.right)continue}else{if(r.y+=n,s.y+=n,r.y<=c.rect.top||r.y>=c.rect.bottom)continue;if(s.y<=f.rect.top||s.y>=f.rect.bottom)continue}if(!gt(r,s,o,[i,a],1)&&!mt(r,s,t,e,{epsilon:Ce})){e.points=[r,s];break}}}}function Te(t,e){const n=.001,{realNodeRects:o,labelNodeRects:r}=lt(e.values()),s=(0,l.K)((t,e)=>q(e,n).map(n=>({...n,edge:t,interior:n.index>=1&&n.index<=e.length-3})),"segmentsFor"),i=(0,l.K)(()=>{const e=[];for(const n of t){if(n.isLayoutOnly)continue;const t=n.points;!t||t.length<2||e.push(...s(n,Q(t)))}return e},"allSegments"),a=(0,l.K)((t,e)=>t.horizontal&&e.horizontal?W(t.a.x,t.b.x,e.a.x,e.b.x)>=8&&Math.abs(t.a.y-e.a.y)<7:!(!t.vertical||!e.vertical)&&(W(t.a.y,t.b.y,e.a.y,e.b.y)>=8&&Math.abs(t.a.x-e.a.x)<7),"hasCrowdedParallelTrack"),c=(0,l.K)((e,i)=>{const c=e.start,f=e.end,d=s(e,i);if(d.length!==i.length-1)return!1;const l=[c,f].filter(t=>Boolean(t)),u=e.labelNodeId?[e.labelNodeId]:[];for(const t of d){if(gt(t.a,t.b,o,l,-2))return!1;if(gt(t.a,t.b,r,u,-2))return!1}for(const o of t){if(o===e||o.isLayoutOnly)continue;const t=o.points;if(t&&!(t.length<2))for(const e of d)for(const r of s(o,Q(t))){if(a(e,r))return!1;if(yt(e.a,e.b,r.a,r.b,n))return!1}}return!0},"candidateIsSafe"),f=(0,l.K)((t,e)=>{const n=Q(t.edge.points??[]);if(n.length<4||t.index>=n.length-1)return;const o=n.map(t=>({...t}));if(t.horizontal)o[t.index].y+=e,o[t.index+1].y+=e;else{if(!t.vertical)return;o[t.index].x+=e,o[t.index+1].x+=e}return s(t.edge,o).length===o.length-1?o:void 0},"shiftedCandidate"),d=(0,l.K)((t,e)=>({x:t.x??(e.left+e.right)/2,y:t.y??(e.top+e.bottom)/2}),"nodeCenter"),u=(0,l.K)(t=>{const n=t.edge,o=Q(n.points??[]);if(4!==o.length||1!==t.index)return;const r=n.start?e.get(n.start):void 0,s=n.end?e.get(n.end):void 0,i=r?it(r):void 0,a=s?it(s):void 0,c=o.slice(t.index+2);return r&&s&&i&&a&&0!==c.length?{sourceCenter:d(r,i),targetCenter:d(s,a),sourceRect:i,tail:c}:void 0},"sourceDetourContextFor"),h=(0,l.K)((t,e,o,r,s,i)=>{const a=r.y>=o.y,c=a?s.bottom:s.top,f=c+(a?20:-20);if(a&&t.b.y<=f+n||!a&&t.b.y>=f-n)return;const d=t.a.x+e;return Q([{x:o.x,y:c},{x:o.x,y:f},{x:d,y:f},{x:d,y:t.b.y},...i],n)},"verticalSourceDetour"),g=(0,l.K)((t,e,o,r,s,i)=>{const a=r.x>=o.x,c=a?s.right:s.left,f=c+(a?20:-20);if(a&&t.b.x<=f+n||!a&&t.b.x>=f-n)return;const d=t.a.y+e;return Q([{x:c,y:o.y},{x:f,y:o.y},{x:f,y:d},{x:t.b.x,y:d},...i],n)},"horizontalSourceDetour"),p=(0,l.K)((t,e)=>{const n=u(t);if(n)return t.vertical?h(t,e,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail):t.horizontal?g(t,e,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail):void 0},"sourceDetourCandidate"),x=[-7,7,-14,14,-21,21];for(let t=0;t<12;t++){const t=i();let e=!1;for(let n=0;n<t.length&&!e;n++)for(let o=n+1;o<t.length&&!e;o++){const r=t[n],s=t[o];if(r.edge===s.edge||!a(r,s))continue;const i=[r,s].filter(t=>t.interior);for(const t of i){for(const n of x){const o=f(t,n);if(o&&c(t.edge,o)){t.edge.points=o,e=!0;break}const r=p(t,n);if(r&&c(t.edge,r)){t.edge.points=r,e=!0;break}}if(e)break}}if(!e)return}}function $e(t,e,n,o){const r=e.x-t.x,s=e.y-t.y,i=o.x-n.x,a=o.y-n.y,c=r*a-s*i;if(Math.abs(c)<1e-10)return!1;const f=n.x-t.x,d=n.y-t.y,l=(f*a-d*i)/c,u=(f*s-d*r)/c,h=.01;return l>h&&l<.99&&u>h&&u<.99}function Re(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const r=ut(e),s=[];for(const t of n){if(t.isLayoutOnly)continue;const e=t.points;if(!e||e.length<2)continue;const n=t.start,i=t.end,a=t.labelNodeId,c=t.id??`${n}->${i}`;for(const t of r)if(t.nodeId!==n&&t.nodeId!==i&&(!a||t.nodeId!==a))for(let n=0;n<e.length-1;n++)if(tt(e[n],e[n+1],t,-1)){o.push({type:"edge-node-overlap",edgeId:c,targetId:t.nodeId,detail:`segment ${n} passes through node "${t.nodeId}"`});break}for(let t=0;t<e.length-1;t++)s.push({edgeId:c,start:n,end:i,p1:e[t],p2:e[t+1]})}const i=new Set;for(let t=0;t<s.length;t++)for(let e=t+1;e<s.length;e++){const n=s[t],r=s[e];if(n.edgeId!==r.edgeId&&(n.start!==r.start&&n.start!==r.end&&n.end!==r.start&&n.end!==r.end&&$e(n.p1,n.p2,r.p1,r.p2))){const t=n.edgeId<r.edgeId?`${n.edgeId}|${r.edgeId}`:`${r.edgeId}|${n.edgeId}`;i.has(t)||(i.add(t),o.push({type:"edge-edge-crossing",edgeId:n.edgeId,targetId:r.edgeId,detail:`edges "${n.edgeId}" and "${r.edgeId}" cross`}))}}if(o.length>0){const t=o.filter(t=>"edge-node-overlap"===t.type).length,e=o.filter(t=>"edge-edge-crossing"===t.type).length;d.R.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${t} edge-node overlap(s), ${e} edge crossing(s)`);for(const t of o)d.R.warn(`[SWIMLANE_VALIDATE] ${t.type}: ${t.detail}`)}return o}function Oe(t,e){const n=t.nodes??[],o=t.edges??[],r=n.filter(t=>!t.isGroup);if(("LR"===e||"RL"===e)&&r.length>0&&!ne(t,e))return;if("BT"===e&&r.length>0&&!ee(t))return;for(const t of o){if(t.isLayoutOnly)continue;const e=t.points;!e||e.length<2||(t.points=wt(It(e)))}Me(o,n),ke(o,n),se(o,n);const s=new Map;for(const t of n)s.set(String(t.id),t);ve(o,s),kt(o,s),ie(o,s),Te(o,s),de(o,s),le(o,s),ue(o,s),pe(o,s);const i=(0,l.K)(()=>{ye(o,s),xe(o,s),me(o,s),ve(o,s),Vt(o,s),ue(o,s),ve(o,s),Vt(o,s)},"finalizeRenderedEdges");i(),Te(o,s),i(),he(o,s),ge(o,s),he(o,s),ge(o,s)}function Ne(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const t=`${r.id}:${r.src}->${r.dst}`;n.has(t)||(n.add(t),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}function Be(t,e){return t.edges.filter(t=>t.dst===e)}function Ee(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}function Fe(t){const e=Ee(t);for(const t of e.values())t.sort((t,e)=>t.localeCompare(e));return e}function Ye(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}function Xe(t){return[...t.entries()].filter(([,t])=>0===t).map(([t])=>t).sort((t,e)=>t.localeCompare(e))}function Pe(t,e=()=>!0){const n=new Map,o=new Map;for(const e of t.nodes)n.set(e,[]),o.set(e,[]);for(const r of t.edges)e(r)&&(o.get(r.src).push(r.dst),n.get(r.dst).push(r.src));return{preds:n,succs:o}}function ze(t,e,n,o){let r=0;for(const e of t.nodes)o?.skipGroups&&t.nodeById.get(e)?.isGroup||(r=Math.max(r,n[e]??0));const s=Array.from({length:r+1},()=>[]);for(const r of e)o?.skipGroups&&t.nodeById.get(r)?.isGroup||s[Math.max(0,n[r]??0)].push(r);return s}function Ae(t){const e=Ye(t),n=Xe(e),o=[],r=Fe(t);for(;n.length;){const t=n.shift();o.push(t);for(const o of r.get(t)??[])if(e.set(o,(e.get(o)??0)-1),0===(e.get(o)??0)){let t=0;for(;t<n.length&&n[t]<o;)t++;n.splice(t,0,o)}}return o.length===t.nodes.length?o:null}function Ge(t){const e=new Map;let n=0;for(const o of t)e.set(o,n),n++;return e}function De(t){const e=new Array(t.length),n=(0,l.K)((o,r)=>{if(r-o<=1)return 0;const s=o+r>>1;let i=n(o,s)+n(s,r),a=o,c=s,f=o;for(;a<s||c<r;)c>=r||a<s&&t[a]<=t[c]?e[f++]=t[a++]:(e[f++]=t[c++],i+=s-a);for(let n=o;n<r;n++)t[n]=e[n];return i},"count");return n(0,t.length)}function He(t){const e=Ne(t),n=new Map;for(const t of e.nodes)n.set(t,[]);for(const t of e.edges)n.get(t.src).push(t);for(const t of n.values())t.sort((t,e)=>t.dst===e.dst?t.id.localeCompare(e.id):t.dst.localeCompare(e.dst));const o=Object.create(null);for(const t of e.nodes)o[t]=0;const r=[],s=(0,l.K)(t=>{o[t]=1;for(const e of n.get(t)??[]){const t=e.dst;0===o[t]?s(t):1===o[t]&&r.push(e)}o[t]=2},"dfs"),i=[...e.nodes].sort((t,e)=>t.localeCompare(e));for(const t of i)0===o[t]&&s(t);const a=new Set(r.map(t=>`${t.id}:${t.src}->${t.dst}`)),c=e.edges.map(t=>a.has(`${t.id}:${t.src}->${t.dst}`)?{id:t.id,src:t.dst,dst:t.src,weight:t.weight,ref:t.ref}:t);return{acyclic:{nodes:[...e.nodes],edges:c,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:r}}function je(t){const e=new Map,n=(0,l.K)(o=>{if(e.has(o))return e.get(o);const r=t.nodeById.get(o);if(!r)return e.set(o,null),null;const s=r.parentId;if(!s)return e.set(o,null),null;const i=n(s)??s;return e.set(o,i),i},"resolve");for(const e of t.nodes)n(e);return e}function _e(t){const e=je(t);return t=>e.get(t)??null}function Ve(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}function We(t,e){const n=Ve(t);if(!e||0===e.length)return n;const o=new Set(n),r=new Set,s=[];for(const t of e)o.has(t)&&!r.has(t)&&(r.add(t),s.push(t));for(const t of n)r.has(t)||s.push(t);return s}(0,l.K)(Le,"pairKey"),(0,l.K)(ke,"straightenCollinearSiblingDetours"),(0,l.K)(Te,"nudgeSharedInteriorSubpaths"),(0,l.K)($e,"segmentsIntersect"),(0,l.K)(Re,"validateSwimlanesLayout"),(0,l.K)(Oe,"postProcessSwimlaneLayout"),(0,l.K)(Ne,"normalizeGraph"),(0,l.K)(Be,"incoming"),(0,l.K)(Ee,"buildSuccessorMap"),(0,l.K)(Fe,"buildSortedSuccessorMap"),(0,l.K)(Ye,"buildInDegreeMap"),(0,l.K)(Xe,"sortedZeroInDegreeNodes"),(0,l.K)(Pe,"buildPredecessorSuccessorMaps"),(0,l.K)(ze,"buildLayersFromRanks"),(0,l.K)(Ae,"topoSortIfAcyclic"),(0,l.K)(Ge,"buildLayerIndex"),(0,l.K)(De,"countInversions"),(0,l.K)(He,"removeCycles_DFS"),(0,l.K)(je,"buildTopLaneMap"),(0,l.K)(_e,"createTopLaneResolver"),(0,l.K)(Ve,"buildTopLaneOrder"),(0,l.K)(We,"resolveTopLaneOrder");var Ue=8,qe=4,Je=!0,Qe=100,Ze=40;function tn(t,e){const n=Ne(t),o=e?.laneOf??(()=>null),r=e?.rankHint,{preds:s}=Pe(n);for(const t of s.values())t.sort((t,e)=>t.localeCompare(e));const i=Ae(n)??[...n.nodes].sort((t,e)=>t.localeCompare(e)),a=new Map;for(const[t,e]of i.entries())a.set(e,t);const c=new Map,f=new Map;for(const t of n.nodes)f.set(t,[]);for(const t of i){const e=(s.get(t)??[]).filter(t=>c.has(t));if(e.length>0){const n=en(t,e,{laneOf:o,rankHint:r,topoIndex:a});c.set(t,n),f.get(n).push(t)}else c.has(t)||c.set(t,null)}for(const t of n.nodes)c.has(t)||c.set(t,null);const d=new Set;for(const t of n.nodes)null===(c.get(t)??null)&&d.add(t);const u=[...d].sort((t,e)=>{const n=a.get(t)??0,o=a.get(e)??0;return n===o?t.localeCompare(e):n-o}),h=nn(n),g=new Map;for(const[t,e]of h.entries())g.set(t,[...e].sort((t,e)=>t.localeCompare(e)));const p=on(g),x=rn(g),m=new Map;for(const t of n.nodes)m.set(t,[]);for(const t of x)for(const e of t.nodes){const n=m.get(e);n?n.push(t.id):m.set(e,[t.id])}const y=[],b=[],M=new Set,K=(0,l.K)(t=>{if(!M.has(t)){M.add(t),y.push(t);for(const e of f.get(t)??[])K(e);b.push(t)}},"walk");for(const t of u)K(t);for(const t of i)K(t);return{parent:c,children:f,roots:u,componentOf:p,blocks:x,nodeBlocks:m,adjacency:g,preorder:y,postorder:b,topologicalOrder:i}}function en(t,e,n){const o=n.laneOf(t);return[...e].sort((t,e)=>{const r=n.laneOf(t),s=n.laneOf(e),i=null!=r&&r===o;if(i!==(null!=s&&s===o))return i?-1:1;const a=n.rankHint?.[t],c=n.rankHint?.[e];if(null!=a&&null!=c&&a!==c)return c-a;const f=n.topoIndex.get(t)??0,d=n.topoIndex.get(e)??0;return f!==d?f-d:t.localeCompare(e)})[0]}function nn(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}function on(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const r=[o];for(;r.length>0;){const o=r.pop();if(!e.has(o)){e.set(o,n);for(const n of t.get(o)??[])e.has(n)||r.push(n)}}n++}return e}function rn(t){const e=new Map,n=new Map,o=[],r=[];let s=0;const i=(0,l.K)((a,c)=>{e.set(a,++s),n.set(a,s);for(const f of t.get(a)??[])f!==c&&(e.has(f)?(e.get(f)??0)<(e.get(a)??0)&&(o.push([a,f]),n.set(a,Math.min(n.get(a)??s,e.get(f)??s))):(o.push([a,f]),i(f,a),n.set(a,Math.min(n.get(a)??s,n.get(f)??s)),(n.get(f)??0)>=(e.get(a)??0)&&r.push(sn(a,f,o,r.length))))},"visit");for(const n of t.keys())e.has(n)||i(n,null);return r}function sn(t,e,n,o){const r=[],s=new Set;for(;n.length>0;){const o=n.pop();if(r.push(o),s.add(o[0]),s.add(o[1]),o[0]===t&&o[1]===e||o[0]===e&&o[1]===t)break}return{id:o,edges:r,nodes:[...s]}}function an(t,e,n){const o=[...t.nodes],r=new Map;for(const[t,e]of o.entries())r.set(e,t);const s=o.length,i=new Array(s).fill(-1),a=new Array(s).fill(0),c=[],f=new Set;for(const t of o){const e=n.parent.get(t)??null,o=r.get(t);null!=o&&(null==e&&(i[o]=-1,a[o]=0,f.has(t)||(f.add(t),c.push(t))))}for(;c.length>0;){const t=c.shift(),e=r.get(t);if(null==e)continue;const o=n.children.get(t)??[];for(const t of o){if(f.has(t))continue;const n=r.get(t);null!=n&&(i[n]=e,a[n]=a[e]+1,f.add(t),c.push(t))}}for(const t of o){if(f.has(t))continue;const e=r.get(t);null!=e&&(i[e]=-1,a[e]=0,f.add(t))}const d=Math.max(1,Math.ceil(Math.log2(Math.max(1,s)))+1),u=Array.from({length:d},()=>new Array(s).fill(-1));for(let t=0;t<s;t++)u[0][t]=i[t];for(let t=1;t<d;t++)for(let e=0;e<s;e++){const n=u[t-1][e];u[t][e]=-1===n?-1:u[t-1][n]}const h=(0,l.K)((t,e)=>{if(-1===t||-1===e)return-1;a[t]<a[e]&&([t,e]=[e,t]);const n=a[t]-a[e];for(let e=0;e<d;e++)if(n>>e&1&&-1===(t=u[e][t]))return-1;if(t===e)return t;for(let n=d-1;n>=0;n--){const o=u[n][t],r=u[n][e];-1!==o&&-1!==r&&(o!==r&&(t=o,e=r))}return u[0][t]},"lcaIndex"),g=Array.from({length:s},()=>new Map);for(const n of t.edges){let t=n.src,o=n.dst,s=e[t],i=e[o];if(null==s||null==i)continue;if(s>i&&([t,o]=[o,t],[s,i]=[i,s]),null==s||null==i||s===i)continue;const a=r.get(t),c=r.get(o);if(null==a||null==c)continue;const f=h(a,c);if(-1===f)continue;const d=g[f];for(let t=s;t<i;t++)d.set(t,(d.get(t)??0)+1)}const p=new Map,x=(0,l.K)((t,e)=>{if(0!==e.size)for(const[n,o]of e)t.set(n,(t.get(n)??0)+o)},"mergeInto"),m=new Set,y=(0,l.K)(t=>{const o=r.get(t);m.add(t);const s=null==o?void 0:g[o],i=s?new Map(s):new Map,a=n.children.get(t)??[];for(const n of a){const o=y(n),r=e[t];if(null!=r){let s=p.get(t);s||(s=new Map,p.set(t,s));let i=o.get(r)??0;const a=e[n];null!=a&&a>r&&(i+=1),s.set(n,i)}x(i,o)}return i},"dfs");for(const t of n.roots)m.has(t)||y(t);for(const t of o)m.has(t)||y(t);return p}function cn(t,e,n){const o=new Map,r=(0,l.K)(t=>{let s=n[t]??0;const i=[...e.get(t)??[]];i.sort(fn(n));for(const t of i){r(t);const e=o.get(t);null!=e&&(s=Math.min(s,e))}o.set(t,s)},"annotate");for(const e of t)r(e);return o}function fn(t){return(e,n)=>{const o=t[e]??0,r=t[n]??0;return o===r?e.localeCompare(n):o-r}}function dn(t,e,n,o){let r=0;for(const t of e){const e=n[t]??0;e>r&&(r=e)}const s=Array.from({length:r+1},()=>[]),i=new Set,a=(0,l.K)(t=>{if(i.has(t))return;i.add(t);const e=n[t]??0;s[e]||(s[e]=[]),s[e].push(t);for(const e of o(t))a(e)},"emit");for(const e of t)a(e);for(const t of e)if(!i.has(t)){const e=n[t]??0;s[e]||(s[e]=[]),s[e].push(t),i.add(t)}return s}function ln(t){const e=[];for(const n of t){const t=new Set,o=[];for(const e of n)t.has(e)||(t.add(e),o.push(e));e.push(o)}return e}function un(t,e,n,o){return r=>{const s=t.get(r)??[];if(0===s.length)return[];const i=e[r]??0,a=[],c=[],f=n.get(r);for(const t of s){const e=o.get(t)??i;e>i?a.push({child:t,min:e}):c.push(t)}return a.sort((t,e)=>t.min===e.min?t.child.localeCompare(e.child):t.min-e.min),c.sort((t,e)=>{const n=f?.get(t)??0,r=f?.get(e)??0;if(n!==r)return n-r;const s=o.get(t)??i,a=o.get(e)??i;return s!==a?s-a:t.localeCompare(e)}),[...a.map(t=>t.child),...c]}}function hn(t,e,n){const o=tn(t,{rankHint:e,laneOf:n}),{children:r,roots:s}=o;for(const e of t.nodes)r.has(e)||r.set(e,[]);const i=an(t,e,o),a=[...s].sort(fn(e)),c=un(r,e,i,cn(a,r,e));let f=dn(a,t.nodes,e,c);return f=ln(f),f}function gn(t,e,n){const o=new Set(t),r=new Set(e),s=Ge(e),i=[];for(const t of n)o.has(t.src)&&r.has(t.dst)&&i.push(s.get(t.dst));return De(i)}function pn(t,e,n){const o=[];for(const t of e){const e=n[t.src],r=n[t.dst];if(null==e||null==r||e===r)continue;let s=t.src,i=t.dst,a=e,c=r;e>r&&(s=t.dst,i=t.src,a=r,c=e);for(let e=a;e<c;e++)o.push({id:`${t.id}@${e}`,src:s,dst:i,ref:t.ref})}let r=0;for(let e=0;e+1<t.length;e++)r+=gn(t[e],t[e+1],o);return r}function xn(t,e){const n={...e},{preds:o}=Pe(t),r=_e(t);let s=pn(hn(t,n,r),t.edges,n);const i=qe;for(let e=0;e<i;e++){let e=!1;const i=[...t.nodes].sort((t,e)=>(n[e]??0)-(n[t]??0));for(const a of i){const i=n[a]??0;if(0===i)continue;let c=0;for(const t of o.get(a)??[])c=Math.max(c,(n[t]??0)+1);if(c>=i)continue;const f=i;n[a]=c;const d=pn(hn(t,n,r),t.edges,n);d<s?(s=d,e=!0):n[a]=f}if(!e)break}return n}function mn(t,e){const n=_e(t),o=[...t.nodes].sort((t,n)=>(e[t]??0)-(e[n]??0)||t.localeCompare(n));for(const r of o){const o=n(r);if(!o)continue;const s=t.edges.filter(t=>t.src===r);if(0===s.length)continue;let i=!1,a=0;for(const t of s){const e=n(t.dst);null==e||e===o?i=!0:a++}if(0===a||i)continue;let c=0,f=!1;for(const e of t.edges){if(e.dst!==r)continue;const t=n(e.src);t&&(t===o?f=!0:c++)}if(c>0||!f)continue;const d=e[r]??0,l=d+a;let u=0;for(const n of t.edges)n.dst===r&&(u=Math.max(u,(e[n.src]??0)+1));const h=Math.max(d,u,l);h!==d&&(e[r]=h)}}function yn(t,e){const n=Ne(t),o=Ae(n)??[...n.nodes].sort(),r=e?.compactSingleInput??!1,s=_e(n);let i=Object.create(null);for(const t of o){const o=Be(n,t),a=e?.ignoreCrossLaneEdges?o.filter(e=>{const n=s(e.src),o=s(t);return!n||!o||n===o}):o;if(0===a.length)i[t]=0;else if(r&&1===a.length){const e=a[0].src,n=s(e),o=s(t);i[t]=n!==o?i[e]??0:(i[e]??0)+1}else{let e=-1/0;for(const t of a)e=Math.max(e,(i[t.src]??0)+1);i[t]=e===-1/0?0:e}}e?.optimizeRanksByCrossings&&(i=xn(n,i)),e?.ignoreCrossLaneEdges&&mn(n,i);return{layers:hn(n,i,s),rankOf:i,dummy:new Set}}function bn(t,e){const n=Ne(t),o={...yn(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=_e(n),{preds:s,succs:i}=Pe(n,t=>{if(e?.ignoreCrossLaneEdges){const e=r(t.src),n=r(t.dst);if(e&&n&&e!==n)return!1}return!0}),a=Ae(n)??[...n.nodes],c=[...a].reverse(),f=(0,l.K)((t,e)=>{let n=0;for(const e of s.get(t)??[])n=Math.max(n,(o[e]??0)+1);let r=Number.POSITIVE_INFINITY;const a=i.get(t)??[];return a.length>0&&(r=Math.min(...a.map(t=>(o[t]??0)-1))),Number.isFinite(r)||(r=Math.max(n,e)),Math.min(Math.max(e,n),r)},"clampFeasible"),d=Ue,u=(0,l.K)(t=>{let e=!1;for(const n of t){const t=s.get(n)??[],r=i.get(n)??[];if(0===t.length&&0===r.length)continue;const a=t.length>0?t.reduce((t,e)=>t+(o[e]??0)+1,0)/t.length:o[n]??0,c=r.length>0?r.reduce((t,e)=>t+(o[e]??0)-1,0)/r.length:o[n]??0,d=Math.round((a+c)/2),l=f(n,d);l!==o[n]&&(o[n]=l,e=!0)}return e},"relaxOrder");for(let t=0;t<d;t++){const t=u(a),e=u(c);if(!t&&!e)break}for(const t of a){let e=0;for(const n of s.get(t)??[])e=Math.max(e,(o[n]??0)+1);(o[t]??0)<e&&(o[t]=e)}for(const t of c){const e=i.get(t)??[];if(e.length>0){const n=Math.min(...e.map(t=>(o[t]??0)-1));(o[t]??0)>n&&(o[t]=n)}}return{layers:ze(n,a,o),rankOf:o,dummy:new Set}}function Mn(t){const e=Ye(t),n=Fe(t);let o=Xe(e);const r=[];for(;o.length>0;){const t=[];for(const s of o){r.push(s);for(const o of n.get(s)??[])e.set(o,(e.get(o)??0)-1),0===(e.get(o)??0)&&t.push(o)}o=t.sort((t,e)=>t.localeCompare(e))}return r.length===t.nodes.length?r:null}function Kn(t,e){const n=Ne(t),o="LR"===e?.direction?Mn(n)??[...n.nodes].sort():Ae(n)??[...n.nodes].sort(),r=_e(n),s=(0,l.K)(t=>r(t)??t,"laneOf"),i=Object.create(null),a=new Map,c=(0,l.K)((t,n)=>e?.ignoreCrossLaneEdges??!0?s(t)===s(n)?1:0:1,"edgeWeight");for(const t of o){const e=n.nodeById.get(t);if(e?.isGroup)continue;const o=Be(n,t);let r=0;if(o.length>0)for(const e of o){const n=e.src,o=i[n]??0;r=Math.max(r,o+c(n,t))}const f=s(t),d=a.get(f)??0,l=Math.max(r,d);i[t]=l,a.set(f,l+1)}return{layers:ze(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}function In(t,e){const n=Ne(e),{rankOf:o}=t,r=t.layers.map(t=>[...t]),s=new Set(t.dummy?[...t.dummy]:[]);let i=0;const a=new Map(n.nodeById),c=(0,l.K)(t=>{const e="placeholder-"+i++,n={id:e,isGroup:!1,isDummy:!0,width:0,height:0};for(a.set(e,n),s.add(e);r.length<=t;)r.push([]);return r[t].push(e),o[e]=t,e},"addDummyAt"),f=[...n.edges].sort((t,e)=>t.id===e.id?t.src===e.src?t.dst.localeCompare(e.dst):t.src.localeCompare(e.src):t.id.localeCompare(e.id)),d=[];for(const t of f){const e=o[t.src]??0,n=o[t.dst]??0;if(n-e<=1){d.push(t);continue}let r=t.src;for(let o=e+1,s=0;o<n;o++,s++){const e=c(o);d.push({id:`${t.id}#${s}`,src:r,dst:e,weight:t.weight,ref:t.ref}),r=e}const s=n-e-2;d.push({id:`${t.id}#${Math.max(s+1,0)}`,src:r,dst:t.dst,weight:t.weight,ref:t.ref})}const u={nodes:[...n.nodes,...[...s].filter(t=>!n.nodes.includes(t))],edges:d,layout:n.layout,nodeById:a};return{layering:{layers:r,rankOf:o,dummy:s},graphWithDummies:u}}function wn(t){const e=t.length;if(0===e)return Number.POSITIVE_INFINITY;const n=[...t].sort((t,e)=>t-e);return e%2==1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}function Sn(t){if(0===t.length)return Number.POSITIVE_INFINITY;return t.reduce((t,e)=>t+e,0)/t.length}function vn(t,e,n,o){const r=new Map;for(const e of t)r.set(e,[]);for(const t of n)"down"===o?e.has(t.src)&&r.has(t.dst)&&r.get(t.dst).push(e.get(t.src)):e.has(t.dst)&&r.has(t.src)&&r.get(t.src).push(e.get(t.dst));return r}function Cn(t,e,n){const o=n.get(t)??0,r=n.get(e)??0;return o!==r?o-r:t.localeCompare(e)}function Ln(t,e,n){const o=new Set(t),r=new Set(e),s=Ge(t),i=Ge(e),a=[];for(const t of n)o.has(t.src)&&r.has(t.dst)&&a.push({u:s.get(t.src),v:i.get(t.dst)});a.sort((t,e)=>t.u===e.u?t.v-e.v:t.u-e.u);return De(a.map(t=>t.v))}function kn(t,e,n){return[...t].sort((t,o)=>{const r=wn(e.get(t)??[]),s=wn(e.get(o)??[]);return r===s?Cn(t,o,n):isFinite(r)?isFinite(s)?r-s:-1:1})}function Tn(t,e,n,o,r,s){const i=Ge(t),a=Ge(e),c=vn(e,i,n,o);if(!r||!s||0===s.length)return kn(e,c,a);const f=new Map;for(const t of e){const e=r(t),n=f.get(e)??[];n.push(t),f.set(e,n)}const d=[];for(const t of s){const e=f.get(t);if(!e||0===e.length)continue;const n=kn(e,c,a);d.push(...n)}const l=f.get(null);if(l&&l.length>0){const t=kn(l,c,a);for(const e of t){const t=Sn(c.get(e)??[]);let n=d.length;if(isFinite(t))for(const[e,o]of d.entries()){if(t<Sn(c.get(o)??[])){n=e;break}}d.splice(n,0,e)}}return d}function $n(t,e,n,o,r){const s=[...e],i=new Set(t),a=new Set(e),c=o?new Set(o):null,f=n.filter(t=>i.has(t.src)&&a.has(t.dst)),d=c?n.filter(t=>a.has(t.src)&&c.has(t.dst)):void 0,u=(0,l.K)(e=>{let n=Ln(t,e,f);return d&&o&&(n+=Ln(e,o,d)),n},"crossingScore"),h=r?new Map:null;if(r&&h)for(const t of e)h.set(t,r(t));let g=!0,p=u(s);for(;g;){g=!1;for(let t=0;t+1<s.length;t++){if(h){if(h.get(s[t])!==h.get(s[t+1]))continue}const e=p;[s[t],s[t+1]]=[s[t+1],s[t]];const n=u(s);n<e?(p=n,g=!0):[s[t],s[t+1]]=[s[t+1],s[t]]}}return s}function Rn(t,e,n){const o=t.layers.map(t=>[...t]),r=e.edges,s=_e(e),i=We(e,n?.laneOrder);for(let t=0;t<3;t++){for(let t=1;t<o.length;t++)o[t]=Tn(o[t-1],o[t],r,"down",s,i),o[t]=$n(o[t-1],o[t],r,o[t+1],s);for(let t=o.length-2;t>=0;t--)o[t]=Tn(o[t+1],o[t],r,"up",s,i),o[t]=$n(o[t+1],o[t],r,o[t-1],s)}return{layers:o}}function On(t,e,n){const o=n?.layerGap??Qe,r=n?.nodeGap??Ze,s=n?.laneGap??2*r,i=n?.direction??"TB",a="LR"===i||"RL"===i,c=t.layers,f=Object.create(null),d=Object.create(null),u=(0,l.K)(t=>e.nodeById.get(t),"getNode"),h=(0,l.K)(t=>u(t)?.width??0,"getWidth"),g=(0,l.K)(t=>u(t)?.height??0,"getHeight"),p=_e(e),x=We(e,n?.laneOrder),m=c.map(t=>t.reduce((t,e)=>Math.max(t,g(e)),0)),y=[];if(a)for(let t=0;t+1<c.length;t++){const e=c[t].reduce((t,e)=>Math.max(t,h(e)),0),n=c[t+1].reduce((t,e)=>Math.max(t,h(e)),0),r=m[t]/2+m[t+1]/2,s=(e+n)/2,i=Math.max(0,s-r-o);y.push(i)}const b=new Set;for(const t of c)for(const e of t)b.add(p(e));const M=b.has(null),K=x.filter(t=>b.has(t)),I=[...M?[null]:[],...K],w=Object.create(null);for(const t of K)w[t]=0;M&&(w.null=0);for(const t of c){const e=Object.create(null),n=[];for(const o of t){const t=p(o);null===t?n.push(o):(e[t]||=[]).push(o)}for(const[t,n]of Object.entries(e)){const e=n.reduce((t,e)=>t+h(e),0)+r*Math.max(0,n.length-1);w[t]=Math.max(w[t]??0,e)}if(M&&n.length){const t=n.reduce((t,e)=>t+h(e),0)+r*Math.max(0,n.length-1);w.null=Math.max(w.null??0,t)}}const S=new Map;{const t=I.map(t=>(null===t?w.null:w[t])??0);let e=-(t.reduce((t,e)=>t+e,0)+s*Math.max(0,I.length-1))/2;for(let n=0;n<I.length;n++){const o=I[n],r=t[n]??0,i=e+r/2;S.set(o,i),e+=r,n<I.length-1&&(e+=s)}}let v=0;for(const[t,e]of c.entries()){const n=m[t]??0,s=new Map;for(const t of e){const e=p(t),n=s.get(e)??[];n.push(t),s.set(e,n)}for(const t of I){const e=s.get(t)??[];if(0===e.length)continue;const o=S.get(t);if(1===e.length){const t=e[0];f[t]=o,d[t]=v+n/2}else{const t=e.map(t=>h(t));let s=o-(t.reduce((t,e)=>t+e,0)+r*(e.length-1))/2;for(const[o,i]of e.entries()){const e=t[o];f[i]=s+e/2,d[i]=v+n/2,s+=e+r}}}v+=n+o+(y[t]??0)}const C=new Map;for(const t of e.edges){const e=t.ref.id;C.has(e)||C.set(e,[]),C.get(e).push(t)}for(const[,t]of C){if(0===t.length)continue;const n=t[0].ref,o=n.start,r=n.end;if(null==o||null==r)continue;const s=Math.round(((f[o]??0)+(f[r]??0))/2),i=new Set;for(const e of t)i.add(e.src),i.add(e.dst);for(const t of i){if(t===o||t===r)continue;const n=e.nodeById.get(t);n?.isDummy&&(f[t]=s)}}return{x:f,y:d}}(0,l.K)(tn,"buildDrivingTree"),(0,l.K)(en,"chooseParent"),(0,l.K)(nn,"buildAdjacency"),(0,l.K)(on,"assignComponents"),(0,l.K)(rn,"computeBlocks"),(0,l.K)(sn,"popBlock"),(0,l.K)(an,"computeSubtreeCrossCounts"),(0,l.K)(cn,"annotateMinimumLayers"),(0,l.K)(fn,"compareByRankThenId"),(0,l.K)(dn,"emitNodesInTreeOrder"),(0,l.K)(ln,"deduplicateLayers"),(0,l.K)(un,"createChildOrderer"),(0,l.K)(hn,"buildMultitreeLayerOrder"),(0,l.K)(gn,"countCrossingsBetweenAdjacent"),(0,l.K)(pn,"totalCrossings"),(0,l.K)(xn,"optimizeRanksByCrossings"),(0,l.K)(mn,"adjustCrossLaneSources"),(0,l.K)(yn,"assignLayers_LongestPath"),(0,l.K)(bn,"assignLayers_Gravity"),(0,l.K)(Mn,"topoSortByGenerationIfAcyclic"),(0,l.K)(Kn,"assignLayers_LaneAwareCompact"),(0,l.K)(In,"makeProperLayering"),(0,l.K)(wn,"median"),(0,l.K)(Sn,"barycenter"),(0,l.K)(vn,"neighborPositionsFor"),(0,l.K)(Cn,"currentOrderTieBreak"),(0,l.K)(Ln,"countCrossingsBetweenAdjacent"),(0,l.K)(kn,"sortByHeuristic"),(0,l.K)(Tn,"reorderLayer"),(0,l.K)($n,"transposeImprove"),(0,l.K)(Rn,"orderLayers"),(0,l.K)(On,"assignCoordinates");function Nn(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}function Bn(t){let e=t>>>0;return()=>{e+=1831565813;let t=e;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}}function En(t,e){const n=[...t],o=Bn(e);for(let t=n.length-1;t>0;t--){const e=Math.floor(o()*(t+1));[n[t],n[e]]=[n[e],n[t]]}return n}function Fn(t,e){let n=0;for(const[o,r]of t.entries())n+=Math.abs(o-(e.get(r)??o));return n}function Yn(t,e){const n=new Map;for(const[e,o]of t.entries())n.set(o,e);let o=0;for(const{a:t,b:r,weight:s}of e){const e=n.get(t),i=n.get(r);null!=e&&null!=i&&(o+=s*Math.abs(e-i))}return o}function Xn(t){const e=Ve(t);if(e.length<2)return[];const n=new Map(e.map((t,e)=>[t,e])),o=_e(t),r=new Map;for(const e of t.layout.edges??[]){if(e.isLayoutOnly)continue;const s="string"==typeof e.start?e.start:void 0,i="string"==typeof e.end?e.end:void 0;if(!(s&&i&&t.nodeById.has(s)&&t.nodeById.has(i)))continue;const a=o(s),c=o(i);if(!a||!c||a===c)continue;const f=n.get(a),d=n.get(c);if(null==f||null==d)continue;const[l,u]=f<=d?[a,c]:[c,a],h=`${l}\0${u}`,g=r.get(h);g?g.weight++:r.set(h,{a:l,b:u,weight:1})}return[...r.values()]}function Pn(t,e,n){const o=[...t];let r=Yn(o,e),s=!0,i=0;const a=Math.max(1,o.length);for(;s&&i<a;){s=!1,i++;for(let t=0;t+1<o.length;t++){[o[t],o[t+1]]=[o[t+1],o[t]];const n=Yn(o,e);n<r?(r=n,s=!0):[o[t],o[t+1]]=[o[t+1],o[t]]}}return{order:o,cost:r,sourceDistance:Fn(o,n)}}function zn(t,e){return t.cost!==e.cost?t.cost<e.cost:t.sourceDistance<e.sourceDistance}function An(t,e,n){const o=[...e].sort((t,e)=>t.a===e.a?t.b.localeCompare(e.b):t.a.localeCompare(e.a)).map(({a:t,b:e,weight:n})=>`${t}:${e}:${n}`).join("|");return Nn(`${t.join("|")}#${o}#${n}`)}function Gn(t,e={}){const n=Ve(t);if(n.length<2)return n;const o=Xn(t);if(0===o.length)return n;const r=new Map(n.map((t,e)=>[t,e]));let s=Pn(n,o,r);const i=Math.max(0,e.restarts??8);for(let t=0;t<i;t++){const e=Pn(En(n,An(n,o,t)),o,r);zn(e,s)&&(s=e)}return s.order}function Dn(t,e){const n=e?.ignoreCrossLaneEdges??!0,o=e?.optimizeRanksByCrossings??!0,r=Ne(t),s=e?.automaticLaneOrdering?Gn(r,{restarts:8}):void 0,i=He(r),a=i.acyclic,c=n?Kn(a,{compactSingleInput:e?.compactSingleInput??Je,ignoreCrossLaneEdges:!0,direction:e?.direction}):bn(a,{compactSingleInput:e?.compactSingleInput??Je,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:o}),{layering:f,graphWithDummies:d}=In(c,a),l=Rn(f,d,{laneOrder:s}),u=On(l,d,{layerGap:e?.layerGap,nodeGap:e?.nodeGap,direction:e?.direction,laneOrder:s});return{acyclic:a,reversed:i.reversed,layering:f,ordered:l,coordinates:u}}(0,l.K)(Nn,"hashString"),(0,l.K)(Bn,"mulberry32"),(0,l.K)(En,"deterministicShuffle"),(0,l.K)(Fn,"sourceDistance"),(0,l.K)(Yn,"laneArrangementCost"),(0,l.K)(Xn,"buildWeightedLaneEdges"),(0,l.K)(Pn,"greedySwitch"),(0,l.K)(zn,"isBetterCandidate"),(0,l.K)(An,"seedForRestart"),(0,l.K)(Gn,"optimizeTopLaneOrder"),(0,l.K)(Dn,"sugiyamaLayout");var Hn=1e-6,jn=15,_n=15,Vn=20;function Wn(t,e,n){const o=t.x??0,r=t.y??0,s=e.x-o,i=e.y-r,a=Math.abs(s),c=Math.abs(i);if(a<Hn&&c<Hn)return n;return c>Hn&&3*c>=a?i>0?"bottom":"top":a>Hn?s>0?"right":"left":n}function Un(t,e){return Math.abs(t.to-e.from)<Hn||Math.abs(t.to-e.to)<Hn?t.to:t.from}function qn(t,e){return"vertical"===t.orient?{x:t.coord,y:e}:{x:e,y:t.coord}}function Jn(t,e){const n=t.nodes??[],o=t.edges??[],r=[];for(const t of o)t.isLayoutOnly||r.push({...t,__originalEdge:t});const s=new Map,i=new Map,a=[],c="LR"===e;for(const t of n)s.set(t.id,t);const f=n.filter(t=>t.isGroup&&!t.parentId);for(const t of f){const e={id:t.id},o=(0,l.K)(t=>{i.set(t.id,e),n.filter(e=>e.parentId===t.id).forEach(o)},"assignLane");o(t)}const d=n.filter(t=>!t.isGroup&&!t.isEdgeLabel).map(t=>{const e=t.width??10,n=t.height??10,o=t.x??0,r=t.y??0;return{nodeId:t.id,minX:o-e/2-8,maxX:o+e/2+8,minY:r-n/2-8,maxY:r+n/2+8,visualXHalfExtent:c?n/2+8:e/2+8}}),u=(0,l.K)((t,e,n,o)=>{let r=a.find(n=>n.orientation===t&&Math.abs(n.coord-e)<1);return r||(r={id:`pipe-${t}-${e.toFixed(0)}`,orientation:t,coord:e,spanMin:n,spanMax:o,tracks:[]},a.push(r)),r.spanMin=Math.min(r.spanMin,n),r.spanMax=Math.max(r.spanMax,o),r},"getOrAddPipe"),h=(0,l.K)((t,e)=>{const n=t.width??10,o=t.height??10,r=t.x??0,s=t.y??0;switch(e){case"top":return{x:r,y:s-o/2};case"bottom":return{x:r,y:s+o/2};case"left":return{x:r-n/2,y:s};case"right":return{x:r+n/2,y:s}}},"portForSide"),g=(0,l.K)((t,e,n)=>h(t,Wn(t,e,n?"bottom":"top")),"getOrthogonalPort"),p=[],x=[],m=new Set,y=(0,l.K)((t,e,n)=>{if(0===p.length)return 0;const o=Math.abs(e.y-n.y)<Hn,r=Math.abs(e.x-n.x)<Hn;if(!o&&!r)return 0;let s=0;if(o){const o=e.y,r=Math.min(e.x,n.x)-Hn,i=Math.max(e.x,n.x)+Hn;if(i<=r)return 0;for(const e of p)e.edgeIndex!==t&&"vertical"===e.orientation&&(e.pipe.coord<r||e.pipe.coord>i||e.from-Hn<=o&&e.to+Hn>=o&&(s+=1e3))}else if(r){const o=e.x,r=Math.min(e.y,n.y)-Hn,i=Math.max(e.y,n.y)+Hn;if(i<=r)return 0;for(const e of p)e.edgeIndex!==t&&"horizontal"===e.orientation&&(e.pipe.coord<r||e.pipe.coord>i||e.from-Hn<=o&&e.to+Hn>=o&&(s+=1e3))}return s},"crossingPenalty"),b=r.map((t,e)=>{if(!t.start||!t.end)return{idx:e,crossLane:0,dx:0,dy:0};const n=s.get(t.start),o=s.get(t.end),r=i.get(t.start),a=i.get(t.end);return{idx:e,crossLane:r&&a&&r.id!==a.id?1:0,dx:n&&o?Math.abs((o.x??0)-(n.x??0)):0,dy:n&&o?Math.abs((o.y??0)-(n.y??0)):0}}).sort((t,e)=>{if(t.crossLane!==e.crossLane)return e.crossLane-t.crossLane;const n=t.dx+t.dy,o=e.dx+e.dy;return Math.abs(n-o)>1?n-o:t.idx-e.idx}).map(t=>t.idx),M=(0,l.K)((t,e,n,o)=>{const r=Math.min(t.x,e.x),s=Math.max(t.x,e.x),i=Math.min(t.y,e.y),a=Math.max(t.y,e.y);return!!d.find(c=>(!n||c.nodeId!==n)&&((!o||c.nodeId!==o)&&(Math.abs(t.x-e.x)>Hn?c.minY<t.y&&c.maxY>t.y&&c.maxX>r&&c.minX<s:c.minX<t.x&&c.maxX>t.x&&c.maxY>i&&c.minY<a)))},"isSegmentBlocked"),K=new Map,I=new Map;for(const t of r)t.start&&t.end&&t.start!==t.end&&(I.set(t.start,(I.get(t.start)??0)+1),I.set(t.end,(I.get(t.end)??0)+1));const w=(0,l.K)((t,e)=>Wn(t,e,"bottom"),"determineSide"),S=new Map;for(const[t,e]of r.entries()){if(!e.start||!e.end||e.start===e.end)continue;if(e.points&&e.points.length>0)continue;const n=s.get(e.start),o=s.get(e.end);if(!n||!o)continue;const r=(o.x??0)-(n.x??0),i=(o.y??0)-(n.y??0);S.set(t,{edgeIdx:t,srcId:e.start,dstId:e.end,srcSide:w(n,{x:o.x??0,y:o.y??0}),dstSide:w(o,{x:n.x??0,y:n.y??0}),absDx:Math.abs(r),absDy:Math.abs(i),dxSign:Math.sign(r),dySign:Math.sign(i)})}const v=(0,l.K)(t=>"top"===t.srcSide||"bottom"===t.srcSide?0===t.absDx?1/0:t.absDy/t.absDx:0===t.absDy?1/0:t.absDx/t.absDy,"preferenceStrength"),C=(0,l.K)(t=>"top"===t.srcSide||"bottom"===t.srcSide?t.dxSign>=0?"right":"left":t.dySign>=0?"bottom":"top","secondarySide"),L=new Map;for(const t of S.values()){const e=`${t.srcId}:${t.srcSide}`;L.has(e)||L.set(e,[]),L.get(e).push(t)}const k=new Map,T=(0,l.K)((t,e)=>`${t}:${e}`,"loadKey");for(const t of S.values())k.set(T(t.srcId,t.srcSide),(k.get(T(t.srcId,t.srcSide))??0)+1),k.set(T(t.dstId,t.dstSide),(k.get(T(t.dstId,t.dstSide))??0)+1);for(const t of L.values())if(!(t.length<2)){t.sort((t,e)=>{const n=v(t),o=v(e);return Math.abs(n-o)>1e-9?o-n:t.edgeIdx-e.edgeIdx});for(let e=1;e<t.length;e++){const n=t[e],o=C(n),r=k.get(T(n.srcId,n.srcSide))??0,s=k.get(T(n.srcId,o))??0;s>=r||(k.set(T(n.srcId,n.srcSide),r-1),k.set(T(n.srcId,o),s+1),n.srcSide=o)}}const $=(0,l.K)(t=>{const e=t?.shape;return"question"===e||"diamond"===e},"isDiamondNode"),R=new Map;for(const t of S.values())R.has(t.dstId)||R.set(t.dstId,new Set),R.get(t.dstId).add(t.dstSide);for(const t of S.values()){if(!$(s.get(t.srcId)))continue;const e=R.get(t.srcId);if(!e?.has(t.srcSide))continue;const n=C(t);if(e.has(n)||(k.get(T(t.srcId,n))??0)>0)continue;const o=k.get(T(t.srcId,t.srcSide))??0;k.set(T(t.srcId,t.srcSide),Math.max(0,o-1)),k.set(T(t.srcId,n),1),t.srcSide=n}for(const t of S.values()){const{edgeIdx:e,srcId:n,dstId:o,srcSide:r,dstSide:i}=t,a=s.get(n),c=s.get(o),f=`${n}:${r}:src`,d="top"===r||"bottom"===r?c.x??0:c.y??0;K.has(f)||K.set(f,[]),K.get(f).push({edgeIdx:e,oppositeCoord:d});const l=`${o}:${i}:dst`,u="top"===i||"bottom"===i?a.x??0:a.y??0;K.has(l)||K.set(l,[]),K.get(l).push({edgeIdx:e,oppositeCoord:u})}const O=new Map;for(const[t,e]of K){if(e.length<2)continue;e.sort((t,e)=>t.oppositeCoord-e.oppositeCoord);const n=t.split(":"),o=n.slice(0,-2).join(":"),r=n[n.length-2],i=n[n.length-1],a=s.get(o);if(!a)continue;const c="left"===r||"right"===r?a.height??10:a.width??10,f=a.shape,d="question"===f||"diamond"===f?.3*c:c,l=20,u=Math.min(l,Math.max(8,d/(e.length+1))),h=-(u*(e.length-1))/2;for(const[t,n]of e.entries()){const e=h+t*u,o=`${n.edgeIdx}:${i}`;O.set(o,e)}}const N=(0,l.K)(t=>Boolean(r[t]?.labelNodeId),"edgeHasLabelNode"),B=(0,l.K)((t,e)=>!!t&&((K.get(`${t}:${e}:src`)??[]).some(({edgeIdx:t})=>N(t))||(K.get(`${t}:${e}:dst`)??[]).some(({edgeIdx:t})=>N(t))),"faceHasLabelNode"),E=(0,l.K)((t,e,n)=>"top"===e||"bottom"===e?{x:t.x+n,y:t.y}:{x:t.x,y:t.y+n},"applyPortOffset"),F=(0,l.K)((t,e,n)=>{const o=S.get(t),r={x:n.x??0,y:n.y??0},s={x:e.x??0,y:e.y??0},i=o?.srcSide??w(e,r),a=o?.dstSide??w(n,s);let c=o?h(e,o.srcSide):g(e,r,!0),f=o?h(n,o.dstSide):g(n,s,!1);const d=O.get(`${t}:src`),l=O.get(`${t}:dst`);return void 0!==d&&(c=E(c,i,d)),void 0!==l&&(f=E(f,a,l)),{pSrcPort:c,pDstPort:f,srcSide:i,dstSide:a}},"portsForEdge");for(const t of b){const e=r[t];if(x[t]=[],!e.start||!e.end)continue;if(e.points&&e.points.length>0)continue;if(e.start===e.end)continue;const n=s.get(e.start),o=s.get(e.end);if(!n||!o)continue;const{pSrcPort:i,pDstPort:f,srcSide:h,dstSide:g}=F(t,n,o),b={...i},w={...f},S="top"===h||"bottom"===h,v="top"===g||"bottom"===g;if(S){const t=i.y>(n.y??0);b.y=t?i.y+Vn:i.y-Vn}else{const t=i.x>(n.x??0);b.x=t?i.x+Vn:i.x-Vn}if(v){const t=f.y>(o.y??0);w.y=t?f.y+Vn:f.y-Vn}else{const t=f.x>(o.x??0);w.x=t?f.x+Vn:f.x-Vn}const C=(0,l.K)((t,e)=>{for(const n of d)if(!e.includes(n.nodeId)&&t.x>n.minX&&t.x<n.maxX&&t.y>n.minY&&t.y<n.maxY)return{inside:!0,obstacle:n};return{inside:!1}},"isPointInObstacle"),L=(0,l.K)((t,e,n,o,r)=>{if(r){const r=t.y>(e.y??0);return{x:(n.x??0)>=t.x?o.maxX+jn:o.minX-jn,y:r?o.maxY+_n:o.minY-_n,leavesPositiveSide:r}}const s=t.x>(e.x??0),i=(n.y??0)>=t.y;return{x:s?o.maxX+jn:o.minX-jn,y:i?o.maxY+_n:o.minY-_n,leavesPositiveSide:s}},"obstacleDetour");let k=[];const T=[e.start,e.end],$=C(b,T);if($.inside&&$.obstacle){const t=$.obstacle;if(S){const e=L(i,n,o,t,!0);b.x=e.x,b.y=e.y;const r=e.leavesPositiveSide?Math.min(t.minY-2,i.y+Vn):Math.max(t.maxY+2,i.y-Vn);k=[{x:i.x,y:r},{x:e.x,y:r},{x:e.x,y:e.y}]}else{const e=L(i,n,o,t,!1),r=e.leavesPositiveSide?Math.min(t.minX-2,i.x+Vn):Math.max(t.maxX+2,i.x-Vn);b.x=e.x,b.y=e.y,k=[{x:r,y:i.y},{x:r,y:e.y},{x:e.x,y:e.y}]}}let R=[];const N=C(w,T);if(N.inside&&N.obstacle){const t=N.obstacle;if(v){const e=L(f,o,n,t,!0);w.x=e.x,w.y=e.y,R=[{x:e.x,y:e.y},{x:f.x,y:e.y}]}else{const e=L(f,o,n,t,!1);w.x=e.x,w.y=e.y,R=[{x:e.x,y:e.y},{x:e.x,y:f.y}]}}if(0===k.length&&0===R.length){const n=jn,o=Math.abs(b.x-w.x)<n,r=Math.abs(b.y-w.y)<n,s=void 0!==O.get(`${t}:src`)||void 0!==O.get(`${t}:dst`),a=(K.get(`${e.start??""}:${h}:src`)?.length??0)+(K.get(`${e.start??""}:${h}:dst`)?.length??0),c=(K.get(`${e.end??""}:${g}:src`)?.length??0)+(K.get(`${e.end??""}:${g}:dst`)?.length??0),d=a>1||c>1,l=I.get(e.start??"")??0,u=I.get(e.end??"")??0,x=a>1&&B(e.start,h)||c>1&&B(e.end,g);if((o||r)&&!s&&(!d||d&&!x&&(a<=1||l<=2)&&(c<=1||u<=2))){if(!M(i,f,e.start,e.end)){e.points=[{...i},{...b},{...w},{...f}],m.add(t);const n=r?"horizontal":"vertical",o=r?i.y:i.x,s=r?Math.min(i.x,f.x):Math.min(i.y,f.y),a=r?Math.max(i.x,f.x):Math.max(i.y,f.y),c={id:`fast-path-${n}-${o.toFixed(0)}-${t}`,orientation:n,coord:o,spanMin:s,spanMax:a,tracks:[]};p.push({edgeIndex:t,segmentIndex:0,orientation:n,pipe:c,trackIndex:0,from:s,to:a});continue}}}const E=u("vertical",b.x,b.y,b.y);b.x=E.coord;const Y=u("vertical",w.x,w.y,w.y);w.x=Y.coord;let X=Math.min(b.x,w.x)-50,P=Math.max(b.x,w.x)+50,z=Math.min(b.y,w.y)-50,A=Math.max(b.y,w.y)+50;for(const t of d){const e=Math.min(b.x,w.x),n=Math.max(b.x,w.x),o=Math.min(b.y,w.y),r=Math.max(b.y,w.y);t.minX<n&&t.maxX>e&&t.minY<r&&t.maxY>o&&(X=Math.min(X,t.minX-25),P=Math.max(P,t.maxX+25),z=Math.min(z,t.minY-25),A=Math.max(A,t.maxY+25))}for(const t of d){if(t.maxX<X||t.minX>P||t.maxY<z||t.minY>A)continue;const e=jn;u("horizontal",t.minY-e,X,P),u("horizontal",t.maxY+e,X,P);const n=_n;u("vertical",t.minX-n,z,A),u("vertical",t.maxX+n,z,A)}u("horizontal",b.y,X,P),u("horizontal",w.y,X,P);const G=a.filter(t=>"horizontal"===t.orientation&&t.coord>=z&&t.coord<=A),D=a.filter(t=>"vertical"===t.orientation&&t.coord>=X&&t.coord<=P),H=(0,l.K)((t,e)=>`${t.toFixed(1)},${e.toFixed(1)}`,"getKey"),j=H(b.x,b.y),_=H(w.x,w.y),V=new Map,W=new Map,U=new Map,q=new Set,J=[];V.set(j,0),U.set(j,"n"),J.push({key:j,f:Math.hypot(w.x-b.x,w.y-b.y),pt:b}),q.add(j);let Q=[];const Z=(0,l.K)((t,n)=>M(t,n,e.start,e.end),"checkSegmentBlocked"),tt={x:w.x,y:b.y},et=Z(b,tt),nt=Z(tt,w),ot=et||nt,rt={x:b.x,y:w.y},st=Z(b,rt),it=Z(rt,w);if(ot?st||it||(Q=Math.abs(b.x-w.x)<Hn?[b,w]:[b,rt,w]):Q=Math.abs(b.y-w.y)<Hn||Math.abs(b.x-w.x)<Hn?[b,w]:[b,tt,w],0===Q.length)for(;J.length>0;){J.sort((t,e)=>t.f-e.f);const n=J.shift();if(q.delete(n.key),n.key===_){let t=_,e=w;for(Q=[e];W.has(t);){const n=W.get(t);Q.unshift(n),e=n,t=H(n.x,n.y)}break}const o=n.pt.x,r=n.pt.y,s=D.sort((t,e)=>t.coord-e.coord),i=s.findIndex(t=>Math.abs(t.coord-o)<1),a=G.sort((t,e)=>t.coord-e.coord),c=a.findIndex(t=>Math.abs(t.coord-r)<1),f=[];i>0&&f.push({x:s[i-1].coord,y:r}),i>=0&&i<s.length-1&&f.push({x:s[i+1].coord,y:r}),c>0&&f.push({x:o,y:a[c-1].coord}),c>=0&&c<a.length-1&&f.push({x:o,y:a[c+1].coord});for(const s of f){const i=Math.min(o,s.x),a=Math.max(o,s.x),c=Math.min(r,s.y),f=Math.max(r,s.y);if(d.some(t=>t.nodeId!==e.start&&t.nodeId!==e.end&&(i!==a?t.minY<r&&t.maxY>r&&t.maxX>i&&t.minX<a:t.minX<o&&t.maxX>o&&t.maxY>c&&t.minY<f)))continue;const l=H(s.x,s.y),u=Math.abs(s.x-o)+Math.abs(s.y-r),h=y(t,n.pt,s);let g=0;const p=w.x-b.x,x=w.y-b.y,m=s.x-o,M=s.y-r;(x>10&&M<-5||x<-10&&M>5)&&(g=100*Math.abs(M)),(p>10&&m<-5||p<-10&&m>5)&&(g+=50*Math.abs(m));let K=0;const I=U.get(n.key)??"n",S=Math.abs(m)>Hn?"h":"v";"n"!==I&&I!==S&&(K=50);const v=u+h+g+K,C=(V.get(n.key)??1/0)+v,L=Math.abs(w.x-s.x)+Math.abs(w.y-s.y);if(C<(V.get(l)??1/0))if(W.set(l,n.pt),V.set(l,C),U.set(l,S),q.has(l)){const t=J.findIndex(t=>t.key===l);-1!==t&&(J[t].f=C+L)}else J.push({key:l,f:C+L,pt:s}),q.add(l)}}if(0===Q.length&&(Q=[b,{x:b.x,y:w.y},w]),Q.length>4){const t=Q[0],e=Q[Q.length-1];let n=Math.min(t.x,e.x),o=Math.max(t.x,e.x),r=Math.min(t.y,e.y),s=Math.max(t.y,e.y);for(const t of Q)n=Math.min(n,t.x),o=Math.max(o,t.x),r=Math.min(r,t.y),s=Math.max(s,t.y);const i=o>Math.max(t.x,e.x),a=n<Math.min(t.x,e.x);if(c){const r=_n;if(i){const n=Math.max(t.x,e.x),s=Math.min(t.y,e.y),i=Math.max(t.y,e.y),a=d.filter(t=>t.minX<n&&t.maxX>n&&t.minY<i&&t.maxY>s);if(a.length>0){let n=Math.max(t.x,e.x);for(const t of a){const e=(t.minX+t.maxX)/2;if(void 0===t.visualXHalfExtent||isNaN(t.visualXHalfExtent))continue;const o=e+t.visualXHalfExtent+r;n=Math.max(n,o)}isNaN(n)||(o=n)}}if(a){const o=d.filter(n=>n.minX<Math.min(t.x,e.x)+r&&n.minY<Math.max(t.y,e.y)&&n.maxY>Math.min(t.y,e.y));if(o.length>0){let s=Math.min(t.x,e.x);for(const t of o){const e=(t.minX+t.maxX)/2-t.visualXHalfExtent-r;s=Math.min(s,e)}n=s}}}const f=(0,l.K)(n=>{const o=e.y>t.y,r=d.filter(n=>{const o=Math.min(t.x,e.x)<n.maxX&&Math.max(t.x,e.x)>n.minX,r=Math.min(t.y,e.y)<n.maxY&&Math.max(t.y,e.y)>n.minY;return o&&r});let s=r;if(c&&r.length>0){const t=r.filter(t=>t.minX<n&&t.maxX>n);t.length>0&&(s=t)}if(0===s.length)return e.y;if(o){const t=Math.max(...s.map(t=>t.maxY))+15;if(t<e.y-Hn)return t}else{const t=Math.min(...s.map(t=>t.minY))-15;if(t>e.y+Hn)return t}return e.y},"findBestReturnY"),u=(0,l.K)(n=>{const o=f(n),r={x:n,y:t.y},s={x:n,y:o},i={x:e.x,y:o},a=Z(t,r),c=Z(r,s),d=Z(s,i),l=o!==e.y&&Z(i,e);return a||c||d||l?null:Math.abs(o-e.y)<Hn?[t,r,s,e]:[t,r,s,i,e]},"trySimplifyWithDetourX"),h=i&&!a?u(o):a&&!i?u(n):null;h&&(Q=h)}const at=[i,...k,...Q,...R.reverse(),f];if(at.length>=3){const t=at[at.length-1],e=at[at.length-2],n=at[at.length-3],o=Math.abs(n.y-e.y)<Hn&&Math.abs(e.y-t.y)<Hn,r=Math.abs(n.x-e.x)<Hn&&Math.abs(e.x-t.x)<Hn;if(o){const o=Math.sign(e.x-n.x),r=Math.sign(t.x-n.x);0!==o&&o===r&&Math.abs(e.x-n.x)>Math.abs(t.x-n.x)&&at.splice(-2,1)}else if(r){const o=Math.sign(e.y-n.y),r=Math.sign(t.y-n.y);0!==o&&o===r&&Math.abs(e.y-n.y)>Math.abs(t.y-n.y)&&at.splice(-2,1)}}const ct=[at[0]];for(let t=1;t<at.length-1;t++){if(1===t){ct.push(at[t]);continue}const e=ct[ct.length-1],n=at[t],o=at[t+1];if(Math.abs(e.y-n.y)<Hn&&Math.abs(n.y-o.y)<Hn){if(n.x>e.x!==o.x>n.x){ct.push(n);continue}continue}if(Math.abs(e.x-n.x)<Hn&&Math.abs(n.x-o.x)<Hn){if(n.y>e.y!==o.y>n.y){ct.push(n);continue}continue}ct.push(n)}ct.push(at[at.length-1]);for(let e=0;e<ct.length-1;e++){const n=ct[e],o=ct[e+1],r=Math.abs(n.x-o.x)<Hn?"vertical":"horizontal",s="vertical"===r?n.x:n.y,i="vertical"===r?Math.min(n.y,o.y):Math.min(n.x,o.x),a="vertical"===r?Math.max(n.y,o.y):Math.max(n.x,o.x),c=u(r,s,i,a),f={edgeIndex:t,segmentIndex:e,orientation:r,pipe:c,trackIndex:0,from:i,to:a};p.push(f),x[t].push(p.length-1),c.tracks[0]||(c.tracks[0]={index:0,coord:c.coord,segments:[]}),c.tracks[0].segments.push({edgeIndex:t,segmentIndex:e,from:i,to:a})}}const Y=(0,l.K)((t,e)=>t.from<e.to&&e.from<t.to,"segmentsOverlap"),X=(0,l.K)((t,e,n,o)=>{const r=!o.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&Y(n,t)),s=!n.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&Y(n,e));return!(!r||!s)&&(t.trackIndex=o.index,e.trackIndex=n.index,n.segments=[...n.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],o.segments=[...o.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],!0)},"trySwapSegmentsAcrossTracks"),P=(0,l.K)(t=>{const e=t.tracks.length;return t.tracks[e]={index:e,coord:t.coord,segments:[]},e},"createNewTrack"),z=(0,l.K)((t,e)=>{const n=t.pipe.tracks[t.trackIndex];n.segments=n.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),t.trackIndex=e;t.pipe.tracks[e].segments.push({edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to})},"moveSegmentToTrack"),A=(0,l.K)((t,e)=>{const n=x[t.edgeIndex];for(const o of n){const n=p[o];n.pipe===t.pipe&&z(n,e)}},"moveSegmentChainToTrack"),G=(0,l.K)(t=>{const e=x[t.edgeIndex],n=e.indexOf(p.indexOf(t)),o=[];return n>0&&o.push(p[e[n-1]]),n<e.length-1&&o.push(p[e[n+1]]),o},"getAdjacentSegmentsAlongEdge"),D=(0,l.K)((t,e)=>{if(t.orientation===e.orientation)return!1;const n="horizontal"===t.orientation?t:e,o="horizontal"===t.orientation?e:t;return o.pipe.coord>n.from&&o.pipe.coord<n.to&&n.pipe.coord>o.from&&n.pipe.coord<o.to},"haveAnyCrossing"),H=(0,l.K)((t,e)=>{for(const n of t.tracks){if(!n.segments.some(t=>(t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex)&&Y(t,e)))return n.index}return-1},"findAvailableTrack"),j=(0,l.K)((t,e)=>{if(t.trackIndex===e.trackIndex)return Y(t,e);const n=G(t),o=G(e);return n.some(t=>o.some(e=>D(t,e)))},"segmentsConflict"),_=(0,l.K)((t,e,n)=>{if(X(t,e,t.pipe.tracks[t.trackIndex],e.pipe.tracks[e.trackIndex]))return;const o=H(t.pipe,e);n(e,-1!==o?o:P(t.pipe))},"resolveTrackConflict"),V=(0,l.K)(t=>{let e=0;for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++){const r=t[n],s=t[o];r.pipe===s.pipe&&(j(r,s)&&(e++,_(r,s,A)))}return e},"resolveHandleConflicts"),W=new Map,U=(0,l.K)(t=>{if(W.has(t))return W.get(t);const e=x[t];if(0===e.length){const e={dest:0,deviation:0,base:0,delta:0};return W.set(t,e),e}const n=p[e[0]].pipe.coord;let o=n;for(let t=1;t<e.length;t++){const r=p[e[t]];if("horizontal"===r.orientation){const t=r.from,e=r.to;o=Math.abs(t-n)>Math.abs(e-n)?t:e;break}}const r={dest:o,deviation:Math.abs(o-n),base:n,delta:o-n};return W.set(t,r),r},"getDestInfo"),q=(0,l.K)(()=>{let t=0;const e=new Map;for(const[t,n]of r.entries())0!==x[t].length&&n.start&&(e.has(n.start)||e.set(n.start,[]),e.get(n.start).push(t));const n=(0,l.K)(t=>{const e=r[t];if(!e.start||!e.end)return 0;const n=s.get(e.start),o=s.get(e.end);if(!n||!o)return 0;const i=(o.x??0)-(n.x??0),a=(o.y??0)-(n.y??0);return Math.abs(i)+Math.abs(a)},"getEdgeDistance");for(const o of e.values()){o.sort((t,e)=>{const o=U(t),r=U(e);if(Math.abs(o.deviation-r.deviation)>1)return o.deviation-r.deviation;if(Math.abs(o.dest-r.dest)>1)return o.dest-r.dest;const s=n(t),i=n(e);if(Math.abs(s-i)>1)return i-s;const a=x[t].length,c=x[e].length;if(a!==c)return a-c;if(1===a){const n=x[t][0],o=x[e][0];if(p[n]&&p[o]){const t=p[n],e=p[o],r=Math.abs(t.to-t.from),s=Math.abs(e.to-e.from);if(Math.abs(r-s)>1)return r-s}}return 0});const e=o.map(t=>p[x[t][0]]);t+=V(e)}return t},"fixSourceHandleCrossings"),J=(0,l.K)(()=>{let t=0;const e=new Map;for(const[t,n]of r.entries()){0!==x[t].length&&(n.end&&(e.has(n.end)||e.set(n.end,[]),e.get(n.end).push(t)))}for(const n of e.values()){n.sort((t,e)=>{const n=(0,l.K)(t=>{const e=x[t];if(e.length<2)return 0;const n=p[e[e.length-2]];return Math.abs(n.to-n.from)},"getDist"),o=n(t),r=n(e);return Math.abs(o-r)>.1?o-r:t-e});const e=n.map(t=>p[x[t][x[t].length-1]]);t+=V(e)}return t},"fixTargetHandleCrossings"),Q=(0,l.K)(()=>{let t=0;for(const e of a){const n=[];for(const t of e.tracks)for(const e of t.segments){const t=x[e.edgeIndex].find(t=>p[t].segmentIndex===e.segmentIndex);void 0!==t&&n.push(p[t])}n.sort((t,e)=>t.edgeIndex-e.edgeIndex||t.segmentIndex-e.segmentIndex);for(let e=0;e<n.length;e++)for(let o=e+1;o<n.length;o++){const r=n[e],s=n[o];j(r,s)&&(t++,_(r,s,z))}}return t},"fixPipeCrossings");let Z=0;for(;Z<10;){let t=0;if(t+=q(),t+=J(),t+=Q(),0===t)break;Z++}const tt=new Map;for(const t of a){const e=[];t.tracks.forEach(t=>{t.segments.forEach(n=>{e.push({edgeIndex:n.edgeIndex,segmentIndex:n.segmentIndex,trackIndex:t.index,from:n.from,to:n.to})})}),e.sort((t,e)=>t.from-e.from);const n=[];if(e.length>0){let t=[e[0]],o=e[0].to;for(let r=1;r<e.length;r++){const s=e[r];s.from<o?(t.push(s),o=Math.max(o,s.to)):(n.push(t),t=[s],o=s.to)}n.push(t)}for(const e of n){const n=new Set;e.forEach(t=>n.add(t.trackIndex));const o=new Map;e.forEach(t=>{const e=U(t.edgeIndex);o.set(t.trackIndex,(o.get(t.trackIndex)??0)+e.delta)});const r=[...n].filter(t=>(o.get(t)??0)<-1),s=[...n].filter(t=>(o.get(t)??0)>1),i=[...n].filter(t=>Math.abs(o.get(t)??0)<=1);r.sort((t,e)=>(o.get(e)??0)-(o.get(t)??0)),s.sort((t,e)=>(o.get(t)??0)-(o.get(e)??0));const a=(0,l.K)((n,o)=>{e.filter(t=>t.trackIndex===n).forEach(e=>{const n=m.has(e.edgeIndex)?t.coord:o;tt.set(`${e.edgeIndex}-${e.segmentIndex}`,n)})},"assignCoord");let c=0;for(const e of r)c++,a(e,t.coord-10*c);if(0===i.length&&n.size>0){const t=[...n].sort((t,e)=>Math.abs(o.get(t)??0)-Math.abs(o.get(e)??0))[0],e=r.indexOf(t);-1!==e&&r.splice(e,1);const a=s.indexOf(t);-1!==a&&s.splice(a,1),i.push(t)}let f=0;for(const e of i){if(0===f)a(e,t.coord);else{const n=f%2==1?1:-1,o=Math.ceil(f/2);a(e,t.coord+n*o*10*.5)}f++}let d=0;for(const e of s)d++,a(e,t.coord+10*d)}}for(const[t,e]of r.entries()){const n=x[t]??[];if(0===n.length)continue;const o=[],r=s.get(e.start),i=s.get(e.end),{pSrcPort:a,pDstPort:c}=F(t,r,i),f=n.map(t=>{const e=p[t],n=tt.get(`${e.edgeIndex}-${e.segmentIndex}`)??e.pipe.coord;return{orient:e.orientation,coord:n,from:e.from,to:e.to}});o.push(a);for(let t=0;t<f.length;t++){const e=f[t],n=o[o.length-1],r="vertical"===e.orient?n.y:n.x,s="vertical"===e.orient?n.x:n.y,i=f[t+1],a=t<f.length-1;if(Math.abs(s-e.coord)>Hn&&o.push(qn(e,r)),a&&i.orient===e.orient)if(Math.abs(e.coord-i.coord)>Hn){const t="vertical"===e.orient?(r+i.from)/2:Un(e,i);o.push(qn(e,t),qn(i,t))}else 0!==t&&t!==f.length-2||o.push(qn(e,Un(e,i)));else if(a)o.push(qn(e,i.coord));else{const t=Math.abs(e.from-r)<Math.abs(e.to-r)?e.to:e.from;o.push(qn(e,t))}}const d=o[o.length-1];(Math.abs(d.x-c.x)>Hn||Math.abs(d.y-c.y)>Hn)&&o.push(c);const l=[];o.length>0&&l.push(o[0]);for(let t=1;t<o.length;t++){const e=o[t],n=l[l.length-1];(Math.abs(e.x-n.x)>Hn||Math.abs(e.y-n.y)>Hn)&&l.push(e)}e.points=l}for(const t of r){const e=t.__originalEdge;e&&t.points&&(e.points=t.points)}t.edges=(t.edges??[]).filter(t=>!t.isLayoutOnly);const et=(0,l.K)((t,e)=>{const n=e.x??0,o=e.y??0,r=e.width??0,s=e.height??0;if(r<=0||s<=0)return t;const i=n-r/2,a=n+r/2,c=o-s/2,f=o+s/2;if(t.x<i||t.x>a||t.y<c||t.y>f)return t;const d=t.x-i,l=a-t.x,u=t.y-c,h=f-t.y,g=Math.min(d,l,u,h);return g===d?{x:i,y:t.y}:g===l?{x:a,y:t.y}:g===u?{x:t.x,y:c}:{x:t.x,y:f}},"nodeBoundaryClamp");for(const e of t.edges){const t=e.points;if(!t||t.length<2)continue;const n=e.start,o=e.end,r=n?s.get(n):void 0,i=o?s.get(o):void 0;r&&(t[0]=et(t[0],r)),i&&(t[t.length-1]=et(t[t.length-1],i))}return t}function Qn(t){return t.direction??"TB"}function Zn(t){const e=Y(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,r=t.config.swimlane?.ignoreCrossLaneEdges??!0,s=t.config.swimlane?.optimizeRanksByCrossings??!0,i=t.config.swimlane?.automaticLaneOrdering??!1,a=Qn(t),{ordered:c,coordinates:f}=Dn(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:r,optimizeRanksByCrossings:s,automaticLaneOrdering:i,direction:a});X(e,c,f,{nodeGap:n,layerGap:o});for(const e of t.edges??[])delete e.points;Jn(t,a);for(const e of t.edges??[])e.curve&&"basis"!==e.curve||(e.curve="rounded");return Oe(t,a),Re(t),a}async function to(t,e){const n=e.select("g");(0,r.g0)(n,t.markers,t.type,t.diagramId),(0,s.gh)(),(0,r.IU)(),(0,s.IU)(),(0,o.IU)(),F(t);const i=P(t);t.nodes=i.nodes,t.edges=i.edges;const{groups:a}=await h(n,t);Zn(t),await R(t,a)}(0,l.K)(Wn,"chooseOrthogonalSide"),(0,l.K)(Un,"sharedLineEndpointCoord"),(0,l.K)(qn,"pointOnLine"),(0,l.K)(Jn,"routeEdgesOrthogonal"),(0,l.K)(Qn,"getSwimlaneDirection"),(0,l.K)(Zn,"runSwimlaneLayoutCore"),(0,l.K)(to,"render")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9352],{75937(t,e,s){var i=s(86309),r=s(51931);const n=(t,e)=>i.A.lang.round(r.A.parse(t)[e]);s.d(e,["A",0,n])},91730(t,e,s){s.d(e,{CP:()=>h,Ck:()=>g,HT:()=>p,PB:()=>d,aC:()=>c,lC:()=>o,m:()=>l,tk:()=>u});var i=s(32178),r=s(86827),n=s(62559),a=s(51444),u=(0,r.K)((t,e)=>{const s=t.append("rect");if(s.attr("x",e.x),s.attr("y",e.y),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("width",e.width),s.attr("height",e.height),e.name&&s.attr("name",e.name),e.rx&&s.attr("rx",e.rx),e.ry&&s.attr("ry",e.ry),void 0!==e.attrs)for(const t in e.attrs)s.attr(t,e.attrs[t]);return e.class&&s.attr("class",e.class),s},"drawRect"),o=(0,r.K)((t,e)=>{const s={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};u(t,s).lower()},"drawBackgroundRect"),l=(0,r.K)((t,e)=>{const s=e.text.replace(i.H1," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),e.class&&r.attr("class",e.class);const n=r.append("tspan");return n.attr("x",e.x+2*e.textMargin),n.text(s),r},"drawText"),c=(0,r.K)((t,e,s,i)=>{const r=t.append("image");r.attr("x",e),r.attr("y",s);const a=(0,n.J)(i);r.attr("xlink:href",a)},"drawImage"),h=(0,r.K)((t,e,s,i)=>{const r=t.append("use");r.attr("x",e),r.attr("y",s);const a=(0,n.J)(i);r.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),d=(0,r.K)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,r.K)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),g=(0,r.K)(()=>{let t=(0,a.Ltv)(".mermaidTooltip");return t.empty()&&(t=(0,a.Ltv)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip")},64918(t,e,s){s.d(e,{o:()=>i});var i=(0,s(86827).K)(()=>"\n /* Font Awesome icon styling - consolidated */\n .label-icon {\n display: inline-block;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n \n .node .label-icon path {\n fill: currentColor;\n stroke: revert;\n stroke-width: revert;\n }\n","getIconStyles")},49352(t,e,s){s.d(e,{AC:()=>S,tM:()=>T,ur:()=>F});var i=s(64918),r=s(96755),n=s(78257),a=s(81818),u=s(21570),o=s(91730),l=s(9636),c=s(99087),h=s(32178),d=s(31293),p=s(86827),g=s(51444),y=s(99418),A=s(25582),b=s(75937),k=class{constructor(){this.vertexCounter=0,this.config=(0,h.D7)(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=h.SV,this.setAccDescription=h.EI,this.setDiagramTitle=h.ke,this.getAccTitle=h.iN,this.getAccDescription=h.m7,this.getDiagramTitle=h.ab,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{(0,p.K)(this,"FlowDB")}sanitizeText(t){return h.Y2.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(const e of this.vertices.values())if(e.id===t)return this.diagramId?`${this.diagramId}-${e.domId}`:e.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,e,s,i,r,n,u={},o){if(!t||0===t.trim().length)return;let c;if(void 0!==o){let t;t=o.includes("\n")?o+"\n":"{\n"+o+"\n}",c=(0,a.H)(t,{schema:a.r})}const p=this.edges.find(e=>e.id===t);if(p){const t=c;return void 0!==t?.animate&&(p.animate=t.animate),void 0!==t?.animation&&(p.animation=t.animation),void(void 0!==t?.curve&&(p.interpolate=t.curve))}let g,y=this.vertices.get(t);if(void 0===y&&(void 0===e&&void 0===s&&null!=i&&d.R.warn(`Style applied to unknown node "${t}". This may indicate a typo. The node will be created automatically.`),y={id:t,labelType:"text",domId:"flowchart-"+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,y)),this.vertexCounter++,void 0!==e?(this.config=(0,h.D7)(),g=this.sanitizeText(e.text.trim()),y.labelType=e.type,g.startsWith('"')&&g.endsWith('"')&&(g=g.substring(1,g.length-1)),y.text=g):void 0===y.text&&(y.text=t),void 0!==s&&(y.type=s),null!=i&&i.forEach(t=>{y.styles.push(t)}),null!=r&&r.forEach(t=>{y.classes.push(t)}),void 0!==n&&(y.dir=n),void 0===y.props?y.props=u:void 0!==u&&Object.assign(y.props,u),void 0!==c){if(c.shape){if(c.shape!==c.shape.toLowerCase()||c.shape.includes("_"))throw new Error(`No such shape: ${c.shape}. Shape names should be lowercase.`);if(!(0,l.aP)(c.shape))throw new Error(`No such shape: ${c.shape}.`);y.type=c?.shape}c?.label&&(y.text=c?.label,y.labelType=this.sanitizeNodeLabelType(c?.labelType)),c?.icon&&(y.icon=c?.icon,c.label?.trim()||y.text!==t||(y.text="")),c?.form&&(y.form=c?.form),c?.pos&&(y.pos=c?.pos),c?.img&&(y.img=c?.img,c.label?.trim()||y.text!==t||(y.text="")),c?.constraint&&(y.constraint=c.constraint),c.w&&(y.assetWidth=Number(c.w)),c.h&&(y.assetHeight=Number(c.h))}}addSingleLink(t,e,s,i){const r={start:t,end:e,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};d.R.info("abc78 Got edge...",r);const n=s.text;if(void 0!==n&&(r.text=this.sanitizeText(n.text.trim()),r.text.startsWith('"')&&r.text.endsWith('"')&&(r.text=r.text.substring(1,r.text.length-1)),r.labelType=this.sanitizeNodeLabelType(n.type)),void 0!==s&&(r.type=s.type,r.stroke=s.stroke,r.length=s.length>10?10:s.length),i&&!this.edges.some(t=>t.id===i))r.id=i,r.isUserDefinedId=!0;else{const t=this.edges.filter(t=>t.start===r.start&&t.end===r.end);0===t.length?r.id=(0,c.rY)(r.start,r.end,{counter:0,prefix:"L"}):r.id=(0,c.rY)(r.start,r.end,{counter:t.length+1,prefix:"L"})}if(!(this.edges.length<(this.config.maxEdges??500)))throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`);d.R.info("Pushing edge..."),this.edges.push(r)}isLinkData(t){return null!==t&&"object"==typeof t&&"id"in t&&"string"==typeof t.id}addLink(t,e,s){const i=this.isLinkData(s)?s.id.replace("@",""):void 0;d.R.info("addLink",t,e,i);for(const r of t)for(const n of e){const a=r===t[t.length-1],u=n===e[0];a&&u?this.addSingleLink(r,n,s,i):this.addSingleLink(r,n,s,void 0)}}updateLinkInterpolate(t,e){t.forEach(t=>{"default"===t?this.edges.defaultInterpolate=e:this.edges[t].interpolate=e})}updateLink(t,e){t.forEach(t=>{if("number"==typeof t&&t>=this.edges.length)throw new Error(`The index ${t} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);"default"===t?this.edges.defaultStyle=e:(this.edges[t].style=e,(this.edges[t]?.style?.length??0)>0&&!this.edges[t]?.style?.some(t=>t?.startsWith("fill"))&&this.edges[t]?.style?.push("fill:none"))})}addClass(t,e){const s=e.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach(t=>{let e=this.classes.get(t);void 0===e&&(e={id:t,styles:[],textStyles:[]},this.classes.set(t,e)),null!=s&&s.forEach(t=>{if(/color/.exec(t)){const s=t.replace("fill","bgFill");e.textStyles.push(s)}e.styles.push(t)})})}setDirection(t){this.direction=t.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),"TD"===this.direction&&(this.direction="TB")}setClass(t,e){for(const s of t.split(",")){const t=this.vertices.get(s);t&&t.classes.push(e);const i=this.edges.find(t=>t.id===s);i&&i.classes.push(e);const r=this.subGraphLookup.get(s);r&&r.classes.push(e)}}setTooltip(t,e){if(void 0!==e){e=this.sanitizeText(e);for(const s of t.split(","))this.tooltips.set("gen-1"===this.version?this.lookUpDomId(s):s,e)}}setClickFun(t,e,s){if("loose"!==(0,h.D7)().securityLevel)return;if(void 0===e)return;let i=[];if("string"==typeof s){i=s.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<i.length;t++){let e=i[t].trim();e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),i[t]=e}}0===i.length&&i.push(t);const r=this.vertices.get(t);r&&(r.haveCallback=!0,this.funs.push(()=>{const s=this.lookUpDomId(t),r=document.querySelector(`[id="${s}"]`);null!==r&&r.addEventListener("click",()=>{c._K.runFunc(e,...i)},!1)}))}setLink(t,e,s){t.split(",").forEach(t=>{const i=this.vertices.get(t);void 0!==i&&(i.link=c._K.formatUrl(e,this.config),i.linkTarget=s)}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,e,s){t.split(",").forEach(t=>{this.setClickFun(t,e,s)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){const e=(0,o.Ck)();(0,g.Ltv)(t).select("svg").selectAll("g.node").on("mouseover",t=>{const s=(0,g.Ltv)(t.currentTarget),i=s.attr("title");if(null===i)return;const r=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(s.attr("title")).style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.bottom+"px"),e.html(y.A.sanitize(i)),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0);(0,g.Ltv)(t.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=(0,h.D7)(),(0,h.IU)()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,e,s){let i=t.text.trim(),r=s.text;t===s&&/\s/.exec(s.text)&&(i=void 0);const n=(0,p.K)(t=>{const e={boolean:{},number:{},string:{}},s=[];let i;return{nodeList:t.filter(function(t){const r=typeof t;return t.stmt&&"dir"===t.stmt?(i=t.value,!1):""!==t.trim()&&(r in e?!e[r].hasOwnProperty(t)&&(e[r][t]=!0):!s.includes(t)&&s.push(t))}),dir:i}},"uniq")(e.flat()),a=n.nodeList,u=n.dir,o=void 0!==u,l=(0,h.D7)().flowchart??{},c=u??(l.inheritDir?this.getDirection()??(0,h.D7)().direction??void 0:void 0);if("gen-1"===this.version)for(let t=0;t<a.length;t++)a[t]=this.lookUpDomId(a[t]);i=i??"subGraph"+this.subCount,r=r||"",r=this.sanitizeText(r),this.subCount=this.subCount+1;const g={id:i,nodes:a,title:r.trim(),classes:[],dir:c,hasExplicitDir:o,labelType:this.sanitizeNodeLabelType(s?.type)};return d.R.info("Adding",g.id,g.nodes,g.dir),g.nodes=this.makeUniq(g,this.subGraphs).nodes,this.subGraphs.push(g),this.subGraphLookup.set(i,g),i}getPosForId(t){for(const[e,s]of this.subGraphs.entries())if(s.id===t)return e;return-1}indexNodes2(t,e){const s=this.subGraphs[e].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=e,this.subGraphs[e].id===t)return{result:!0,count:0};let i=0,r=1;for(;i<s.length;){const e=this.getPosForId(s[i]);if(e>=0){const s=this.indexNodes2(t,e);if(s.result)return{result:!0,count:r+s.count};r+=s.count}i+=1}return{result:!1,count:r}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return!!this.firstGraphFlag&&(this.firstGraphFlag=!1,!0)}destructStartLink(t){let e=t.trim(),s="arrow_open";switch(e[0]){case"<":s="arrow_point",e=e.slice(1);break;case"x":s="arrow_cross",e=e.slice(1);break;case"o":s="arrow_circle",e=e.slice(1)}let i="normal";return e.includes("=")&&(i="thick"),e.includes(".")&&(i="dotted"),{type:s,stroke:i}}countChar(t,e){const s=e.length;let i=0;for(let r=0;r<s;++r)e[r]===t&&++i;return i}destructEndLink(t){const e=t.trim();let s=e.slice(0,-1),i="arrow_open";switch(e.slice(-1)){case"x":i="arrow_cross",e.startsWith("x")&&(i="double_"+i,s=s.slice(1));break;case">":i="arrow_point",e.startsWith("<")&&(i="double_"+i,s=s.slice(1));break;case"o":i="arrow_circle",e.startsWith("o")&&(i="double_"+i,s=s.slice(1))}let r="normal",n=s.length-1;s.startsWith("=")&&(r="thick"),s.startsWith("~")&&(r="invisible");const a=this.countChar(".",s);return a&&(r="dotted",n=a),{type:i,stroke:r,length:n}}destructLink(t,e){const s=this.destructEndLink(t);let i;if(e){if(i=this.destructStartLink(e),i.stroke!==s.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===i.type)i.type=s.type;else{if(i.type!==s.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return"double_arrow"===i.type&&(i.type="double_arrow_point"),i.length=s.length,i}return s}exists(t,e){for(const s of t)if(s.nodes.includes(e))return!0;return!1}makeUniq(t,e){const s=[];return t.nodes.forEach((i,r)=>{this.exists(e,i)||s.push(t.nodes[r])}),{nodes:s}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon)return"circle"===t.form?"iconCircle":"square"===t.form?"iconSquare":"rounded"===t.form?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,e){return t.find(t=>t.id===e)}destructEdgeType(t){let e="none",s="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":s=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),s=e}return{arrowTypeStart:e,arrowTypeEnd:s}}addNodeFromVertex(t,e,s,i,r,n){const a=s.get(t.id),u=i.get(t.id)??!1,o=this.findNode(e,t.id);if(o)o.cssStyles=t.styles,o.cssCompiledStyles=this.getCompiledStyles(t.classes),o.cssClasses=t.classes.join(" ");else{const s={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:a,padding:r.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:n,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};u?e.push({...s,isGroup:!0,shape:"rect"}):e.push({...s,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let e=[];for(const s of t){const t=this.classes.get(s);t?.styles&&(e=[...e,...t.styles??[]].map(t=>t.trim())),t?.textStyles&&(e=[...e,...t.textStyles??[]].map(t=>t.trim()))}return e}getData(){const t=(0,h.D7)(),e=[],s=[],i=this.getSubGraphs(),r=new Map,n=new Map;for(let t=i.length-1;t>=0;t--){const e=i[t];e.nodes.length>0&&n.set(e.id,!0);for(const t of e.nodes)r.set(t,e.id)}for(let s=i.length-1;s>=0;s--){const n=i[s];e.push({id:n.id,label:n.title,labelStyle:"",labelType:n.labelType,parentId:r.get(n.id),padding:8,cssCompiledStyles:this.getCompiledStyles(n.classes),cssClasses:n.classes.join(" "),shape:"rect",dir:"TD"===n.dir?"TB":n.dir,explicitDir:n.hasExplicitDir,isGroup:!0,look:t.look})}this.getVertices().forEach(s=>{this.addNodeFromVertex(s,e,r,n,t,t.look||"classic")});const a=this.getEdges();return a.forEach((e,i)=>{const{arrowTypeStart:r,arrowTypeEnd:n}=this.destructEdgeType(e.type),u=[...a.defaultStyle??[]];e.style&&u.push(...e.style);const o={id:(0,c.rY)(e.start,e.end,{counter:i,prefix:"L"},e.id),isUserDefinedId:e.isUserDefinedId,start:e.start,end:e.end,type:e.type??"normal",label:e.text,labelType:e.labelType,labelpos:"c",thickness:e.stroke,minlen:e.length,classes:"invisible"===e?.stroke?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:"invisible"===e?.stroke||"arrow_open"===e?.type?"none":r,arrowTypeEnd:"invisible"===e?.stroke||"arrow_open"===e?.type?"none":n,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(e.classes),labelStyle:u,style:u,pattern:e.stroke,look:t.look,animate:e.animate,animation:e.animation,curve:e.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};s.push(o)}),{nodes:e,edges:s,other:{},config:t}}defaultConfig(){return h.ME.flowchart}},f={getClasses:(0,p.K)(function(t,e){return e.db.getClasses()},"getClasses"),draw:(0,p.K)(async function(t,e,s,i,a){d.R.info("REF0:"),d.R.info("Drawing state diagram (v2)",e);const{securityLevel:o,flowchart:l,layout:p}=(0,h.D7)();i.db.setDiagramId(e),d.R.debug("Before getData: ");const g=i.db.getData();d.R.debug("Data: ",g);const y=(0,r.A)(e,o),A=i.db.getDirection();g.type=i.type,g.layoutAlgorithm=(0,u.q7)(p),"dagre"===g.layoutAlgorithm&&"elk"===p&&d.R.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),g.direction=A,g.nodeSpacing=l?.nodeSpacing||50,g.rankSpacing=l?.rankSpacing||50,g.markers=["point","circle","cross"],g.diagramId=e,d.R.debug("REF1:",g),await(0,u.XX)(g,y,a);const b=g.config.flowchart?.diagramPadding??8;c._K.insertTitle(y,"flowchartTitleText",l?.titleTopMargin||0,i.db.getDiagramTitle()),(0,n.P)(y,b,"flowchart",l?.useMaxWidth||!1)},"draw")},m=function(){var t=(0,p.K)(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,4],s=[1,3],i=[1,5],r=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],n=[2,2],a=[1,13],u=[1,14],o=[1,15],l=[1,16],c=[1,23],h=[1,25],d=[1,26],g=[1,27],y=[1,50],A=[1,49],b=[1,29],k=[1,30],f=[1,31],m=[1,32],x=[1,33],E=[1,45],D=[1,47],C=[1,43],T=[1,48],F=[1,44],S=[1,51],_=[1,46],v=[1,52],B=[1,53],w=[1,34],L=[1,35],$=[1,36],I=[1,37],R=[1,38],N=[1,58],K=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],P=[1,62],G=[1,61],O=[1,63],M=[8,9,11,75,77,78],V=[1,79],U=[1,92],W=[1,97],z=[1,96],j=[1,93],Y=[1,89],H=[1,95],X=[1,91],q=[1,98],Q=[1,94],J=[1,99],Z=[1,90],tt=[8,9,10,11,40,75,77,78],et=[8,9,10,11,40,46,75,77,78],st=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],it=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],rt=[44,60,89,102,105,106,109,111,114,115,116],nt=[1,122],at=[1,123],ut=[1,125],ot=[1,124],lt=[44,60,62,74,89,102,105,106,109,111,114,115,116],ct=[1,134],ht=[1,148],dt=[1,149],pt=[1,150],gt=[1,151],yt=[1,136],At=[1,138],bt=[1,142],kt=[1,143],ft=[1,144],mt=[1,145],xt=[1,146],Et=[1,147],Dt=[1,152],Ct=[1,153],Tt=[1,132],Ft=[1,133],St=[1,140],_t=[1,135],vt=[1,139],Bt=[1,137],wt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Lt=[1,155],$t=[1,157],It=[8,9,11],Rt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Nt=[1,177],Kt=[1,173],Pt=[1,174],Gt=[1,178],Ot=[1,175],Mt=[1,176],Vt=[77,116,119],Ut=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Wt=[10,106],zt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],jt=[1,248],Yt=[1,246],Ht=[1,250],Xt=[1,244],qt=[1,245],Qt=[1,247],Jt=[1,249],Zt=[1,251],te=[1,269],ee=[8,9,11,106],se=[8,9,10,11,60,84,105,106,109,110,111,112],ie={trace:(0,p.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:(0,p.K)(function(t,e,s,i,r,n,a){var u=n.length-1;switch(r){case 2:case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 3:(!Array.isArray(n[u])||n[u].length>0)&&n[u-1].push(n[u]),this.$=n[u-1];break;case 4:case 183:case 44:case 54:case 76:case 181:this.$=n[u];break;case 11:i.setDirection("TB"),this.$="TB";break;case 12:i.setDirection(n[u-1]),this.$=n[u-1];break;case 27:this.$=n[u-1].nodes;break;case 33:this.$=i.addSubGraph(n[u-6],n[u-1],n[u-4]);break;case 34:this.$=i.addSubGraph(n[u-3],n[u-1],n[u-3]);break;case 35:this.$=i.addSubGraph(void 0,n[u-1],void 0);break;case 37:this.$=n[u].trim(),i.setAccTitle(this.$);break;case 38:case 39:this.$=n[u].trim(),i.setAccDescription(this.$);break;case 43:case 133:this.$=n[u-1]+n[u];break;case 45:i.addVertex(n[u-1][n[u-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,n[u]),i.addLink(n[u-3].stmt,n[u-1],n[u-2]),this.$={stmt:n[u-1],nodes:n[u-1].concat(n[u-3].nodes)};break;case 46:i.addLink(n[u-2].stmt,n[u],n[u-1]),this.$={stmt:n[u],nodes:n[u].concat(n[u-2].nodes)};break;case 47:i.addLink(n[u-3].stmt,n[u-1],n[u-2]),this.$={stmt:n[u-1],nodes:n[u-1].concat(n[u-3].nodes)};break;case 48:this.$={stmt:n[u-1],nodes:n[u-1]};break;case 49:i.addVertex(n[u-1][n[u-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,n[u]),this.$={stmt:n[u-1],nodes:n[u-1],shapeData:n[u]};break;case 50:this.$={stmt:n[u],nodes:n[u]};break;case 51:case 128:case 130:this.$=[n[u]];break;case 52:i.addVertex(n[u-5][n[u-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,n[u-4]),this.$=n[u-5].concat(n[u]);break;case 53:this.$=n[u-4].concat(n[u]);break;case 55:this.$=n[u-2],i.setClass(n[u-2],n[u]);break;case 56:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"square");break;case 57:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"doublecircle");break;case 58:this.$=n[u-5],i.addVertex(n[u-5],n[u-2],"circle");break;case 59:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"ellipse");break;case 60:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"stadium");break;case 61:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"subroutine");break;case 62:this.$=n[u-7],i.addVertex(n[u-7],n[u-1],"rect",void 0,void 0,void 0,Object.fromEntries([[n[u-5],n[u-3]]]));break;case 63:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"cylinder");break;case 64:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"round");break;case 65:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"diamond");break;case 66:this.$=n[u-5],i.addVertex(n[u-5],n[u-2],"hexagon");break;case 67:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"odd");break;case 68:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"trapezoid");break;case 69:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"inv_trapezoid");break;case 70:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"lean_right");break;case 71:this.$=n[u-3],i.addVertex(n[u-3],n[u-1],"lean_left");break;case 72:this.$=n[u],i.addVertex(n[u]);break;case 73:n[u-1].text=n[u],this.$=n[u-1];break;case 74:case 75:n[u-2].text=n[u-1],this.$=n[u-2];break;case 77:var o=i.destructLink(n[u],n[u-2]);this.$={type:o.type,stroke:o.stroke,length:o.length,text:n[u-1]};break;case 78:o=i.destructLink(n[u],n[u-2]);this.$={type:o.type,stroke:o.stroke,length:o.length,text:n[u-1],id:n[u-3]};break;case 79:case 86:case 101:case 103:this.$={text:n[u],type:"text"};break;case 80:case 87:case 102:this.$={text:n[u-1].text+""+n[u],type:n[u-1].type};break;case 81:case 88:this.$={text:n[u],type:"string"};break;case 82:case 89:case 104:this.$={text:n[u],type:"markdown"};break;case 83:o=i.destructLink(n[u]);this.$={type:o.type,stroke:o.stroke,length:o.length};break;case 84:o=i.destructLink(n[u]);this.$={type:o.type,stroke:o.stroke,length:o.length,id:n[u-1]};break;case 85:this.$=n[u-1];break;case 105:this.$=n[u-4],i.addClass(n[u-2],n[u]);break;case 106:this.$=n[u-4],i.setClass(n[u-2],n[u]);break;case 107:case 115:this.$=n[u-1],i.setClickEvent(n[u-1],n[u]);break;case 108:case 116:this.$=n[u-3],i.setClickEvent(n[u-3],n[u-2]),i.setTooltip(n[u-3],n[u]);break;case 109:this.$=n[u-2],i.setClickEvent(n[u-2],n[u-1],n[u]);break;case 110:this.$=n[u-4],i.setClickEvent(n[u-4],n[u-3],n[u-2]),i.setTooltip(n[u-4],n[u]);break;case 111:this.$=n[u-2],i.setLink(n[u-2],n[u]);break;case 112:this.$=n[u-4],i.setLink(n[u-4],n[u-2]),i.setTooltip(n[u-4],n[u]);break;case 113:this.$=n[u-4],i.setLink(n[u-4],n[u-2],n[u]);break;case 114:this.$=n[u-6],i.setLink(n[u-6],n[u-4],n[u]),i.setTooltip(n[u-6],n[u-2]);break;case 117:this.$=n[u-1],i.setLink(n[u-1],n[u]);break;case 118:this.$=n[u-3],i.setLink(n[u-3],n[u-2]),i.setTooltip(n[u-3],n[u]);break;case 119:this.$=n[u-3],i.setLink(n[u-3],n[u-2],n[u]);break;case 120:this.$=n[u-5],i.setLink(n[u-5],n[u-4],n[u]),i.setTooltip(n[u-5],n[u-2]);break;case 121:this.$=n[u-4],i.addVertex(n[u-2],void 0,void 0,n[u]);break;case 122:this.$=n[u-4],i.updateLink([n[u-2]],n[u]);break;case 123:this.$=n[u-4],i.updateLink(n[u-2],n[u]);break;case 124:this.$=n[u-8],i.updateLinkInterpolate([n[u-6]],n[u-2]),i.updateLink([n[u-6]],n[u]);break;case 125:this.$=n[u-8],i.updateLinkInterpolate(n[u-6],n[u-2]),i.updateLink(n[u-6],n[u]);break;case 126:this.$=n[u-6],i.updateLinkInterpolate([n[u-4]],n[u]);break;case 127:this.$=n[u-6],i.updateLinkInterpolate(n[u-4],n[u]);break;case 129:case 131:n[u-2].push(n[u]),this.$=n[u-2];break;case 182:case 184:this.$=n[u-1]+""+n[u];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"}}},"anonymous"),table:[{3:1,4:2,9:e,10:s,12:i},{1:[3]},t(r,n,{5:6}),{4:7,9:e,10:s,12:i},{4:8,9:e,10:s,12:i},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:a,9:u,10:o,11:l,20:17,22:18,23:19,24:20,25:21,26:22,27:c,33:24,34:h,36:d,38:g,42:28,43:39,44:y,45:40,47:41,60:A,84:b,85:k,86:f,87:m,88:x,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B,121:w,122:L,123:$,124:I,125:R},t(r,[2,9]),t(r,[2,10]),t(r,[2,11]),{8:[1,55],9:[1,56],10:N,15:54,18:57},t(K,[2,3]),t(K,[2,4]),t(K,[2,5]),t(K,[2,6]),t(K,[2,7]),t(K,[2,8]),{8:P,9:G,11:O,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:P,9:G,11:O,21:68},{8:P,9:G,11:O,21:69},{8:P,9:G,11:O,21:70},{8:P,9:G,11:O,21:71},{8:P,9:G,11:O,21:72},{8:P,9:G,10:[1,73],11:O,21:74},t(K,[2,36]),{35:[1,75]},{37:[1,76]},t(K,[2,39]),t(M,[2,50],{18:77,39:78,10:N,40:V}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:U,44:W,60:z,80:[1,87],89:j,95:[1,84],97:[1,85],101:86,105:Y,106:H,109:X,111:q,114:Q,115:J,116:Z,120:88},t(K,[2,185]),t(K,[2,186]),t(K,[2,187]),t(K,[2,188]),t(K,[2,189]),t(tt,[2,51]),t(tt,[2,54],{46:[1,100]}),t(et,[2,72],{113:113,29:[1,101],44:y,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:A,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:E,102:D,105:C,106:T,109:F,111:S,114:_,115:v,116:B}),t(st,[2,181]),t(st,[2,142]),t(st,[2,143]),t(st,[2,144]),t(st,[2,145]),t(st,[2,146]),t(st,[2,147]),t(st,[2,148]),t(st,[2,149]),t(st,[2,150]),t(st,[2,151]),t(st,[2,152]),t(r,[2,12]),t(r,[2,18]),t(r,[2,19]),{9:[1,114]},t(it,[2,26],{18:115,10:N}),t(K,[2,27]),{42:116,43:39,44:y,45:40,47:41,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B},t(K,[2,40]),t(K,[2,41]),t(K,[2,42]),t(rt,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:nt,81:at,116:ut,119:ot},{75:[1,126],77:[1,127]},t(lt,[2,83]),t(K,[2,28]),t(K,[2,29]),t(K,[2,30]),t(K,[2,31]),t(K,[2,32]),{10:ct,12:ht,14:dt,27:pt,28:128,32:gt,44:yt,60:At,75:bt,80:[1,130],81:[1,131],83:141,84:kt,85:ft,86:mt,87:xt,88:Et,89:Dt,90:Ct,91:129,105:Tt,109:Ft,111:St,114:_t,115:vt,116:Bt},t(wt,n,{5:154}),t(K,[2,37]),t(K,[2,38]),t(M,[2,48],{44:Lt}),t(M,[2,49],{18:156,10:N,40:$t}),t(tt,[2,44]),{44:y,47:158,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B},{102:[1,159],103:160,105:[1,161]},{44:y,47:162,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B},{44:y,47:163,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B},t(It,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(It,[2,115],{120:168,10:[1,167],14:U,44:W,60:z,89:j,105:Y,106:H,109:X,111:q,114:Q,115:J,116:Z}),t(It,[2,117],{10:[1,169]}),t(Rt,[2,183]),t(Rt,[2,170]),t(Rt,[2,171]),t(Rt,[2,172]),t(Rt,[2,173]),t(Rt,[2,174]),t(Rt,[2,175]),t(Rt,[2,176]),t(Rt,[2,177]),t(Rt,[2,178]),t(Rt,[2,179]),t(Rt,[2,180]),{44:y,47:170,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B},{30:171,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:179,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:181,50:[1,180],67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:182,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:183,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:184,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{109:[1,185]},{30:186,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:187,65:[1,188],67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:189,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:190,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{30:191,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},t(st,[2,182]),t(r,[2,20]),t(it,[2,25]),t(M,[2,46],{39:192,18:193,10:N,40:V}),t(rt,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{77:[1,197],79:198,116:ut,119:ot},t(Vt,[2,79]),t(Vt,[2,81]),t(Vt,[2,82]),t(Vt,[2,168]),t(Vt,[2,169]),{76:199,79:121,80:nt,81:at,116:ut,119:ot},t(lt,[2,84]),{8:P,9:G,10:ct,11:O,12:ht,14:dt,21:201,27:pt,29:[1,200],32:gt,44:yt,60:At,75:bt,83:141,84:kt,85:ft,86:mt,87:xt,88:Et,89:Dt,90:Ct,91:202,105:Tt,109:Ft,111:St,114:_t,115:vt,116:Bt},t(Ut,[2,101]),t(Ut,[2,103]),t(Ut,[2,104]),t(Ut,[2,157]),t(Ut,[2,158]),t(Ut,[2,159]),t(Ut,[2,160]),t(Ut,[2,161]),t(Ut,[2,162]),t(Ut,[2,163]),t(Ut,[2,164]),t(Ut,[2,165]),t(Ut,[2,166]),t(Ut,[2,167]),t(Ut,[2,90]),t(Ut,[2,91]),t(Ut,[2,92]),t(Ut,[2,93]),t(Ut,[2,94]),t(Ut,[2,95]),t(Ut,[2,96]),t(Ut,[2,97]),t(Ut,[2,98]),t(Ut,[2,99]),t(Ut,[2,100]),{6:11,7:12,8:a,9:u,10:o,11:l,20:17,22:18,23:19,24:20,25:21,26:22,27:c,32:[1,203],33:24,34:h,36:d,38:g,42:28,43:39,44:y,45:40,47:41,60:A,84:b,85:k,86:f,87:m,88:x,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B,121:w,122:L,123:$,124:I,125:R},{10:N,18:204},{44:[1,205]},t(tt,[2,43]),{10:[1,206],44:y,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:113,114:_,115:v,116:B},{10:[1,207]},{10:[1,208],106:[1,209]},t(Wt,[2,128]),{10:[1,210],44:y,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:113,114:_,115:v,116:B},{10:[1,211],44:y,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:113,114:_,115:v,116:B},{80:[1,212]},t(It,[2,109],{10:[1,213]}),t(It,[2,111],{10:[1,214]}),{80:[1,215]},t(Rt,[2,184]),{80:[1,216],98:[1,217]},t(tt,[2,55],{113:113,44:y,60:A,89:E,102:D,105:C,106:T,109:F,111:S,114:_,115:v,116:B}),{31:[1,218],67:Nt,82:219,116:Gt,117:Ot,118:Mt},t(zt,[2,86]),t(zt,[2,88]),t(zt,[2,89]),t(zt,[2,153]),t(zt,[2,154]),t(zt,[2,155]),t(zt,[2,156]),{49:[1,220],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{30:221,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{51:[1,222],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{53:[1,223],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{55:[1,224],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{57:[1,225],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{60:[1,226]},{64:[1,227],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{66:[1,228],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{30:229,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},{31:[1,230],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{67:Nt,69:[1,231],71:[1,232],82:219,116:Gt,117:Ot,118:Mt},{67:Nt,69:[1,234],71:[1,233],82:219,116:Gt,117:Ot,118:Mt},t(M,[2,45],{18:156,10:N,40:$t}),t(M,[2,47],{44:Lt}),t(rt,[2,75]),t(rt,[2,74]),{62:[1,235],67:Nt,82:219,116:Gt,117:Ot,118:Mt},t(rt,[2,77]),t(Vt,[2,80]),{77:[1,236],79:198,116:ut,119:ot},{30:237,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},t(wt,n,{5:238}),t(Ut,[2,102]),t(K,[2,35]),{43:239,44:y,45:40,47:41,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B},{10:N,18:240},{10:jt,60:Yt,84:Ht,92:241,105:Xt,107:242,108:243,109:qt,110:Qt,111:Jt,112:Zt},{10:jt,60:Yt,84:Ht,92:252,104:[1,253],105:Xt,107:242,108:243,109:qt,110:Qt,111:Jt,112:Zt},{10:jt,60:Yt,84:Ht,92:254,104:[1,255],105:Xt,107:242,108:243,109:qt,110:Qt,111:Jt,112:Zt},{105:[1,256]},{10:jt,60:Yt,84:Ht,92:257,105:Xt,107:242,108:243,109:qt,110:Qt,111:Jt,112:Zt},{44:y,47:258,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B},t(It,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(It,[2,116]),t(It,[2,118],{10:[1,262]}),t(It,[2,119]),t(et,[2,56]),t(zt,[2,87]),t(et,[2,57]),{51:[1,263],67:Nt,82:219,116:Gt,117:Ot,118:Mt},t(et,[2,64]),t(et,[2,59]),t(et,[2,60]),t(et,[2,61]),{109:[1,264]},t(et,[2,63]),t(et,[2,65]),{66:[1,265],67:Nt,82:219,116:Gt,117:Ot,118:Mt},t(et,[2,67]),t(et,[2,68]),t(et,[2,70]),t(et,[2,69]),t(et,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(rt,[2,78]),{31:[1,266],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{6:11,7:12,8:a,9:u,10:o,11:l,20:17,22:18,23:19,24:20,25:21,26:22,27:c,32:[1,267],33:24,34:h,36:d,38:g,42:28,43:39,44:y,45:40,47:41,60:A,84:b,85:k,86:f,87:m,88:x,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B,121:w,122:L,123:$,124:I,125:R},t(tt,[2,53]),{43:268,44:y,45:40,47:41,60:A,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B},t(It,[2,121],{106:te}),t(ee,[2,130],{108:270,10:jt,60:Yt,84:Ht,105:Xt,109:qt,110:Qt,111:Jt,112:Zt}),t(se,[2,132]),t(se,[2,134]),t(se,[2,135]),t(se,[2,136]),t(se,[2,137]),t(se,[2,138]),t(se,[2,139]),t(se,[2,140]),t(se,[2,141]),t(It,[2,122],{106:te}),{10:[1,271]},t(It,[2,123],{106:te}),{10:[1,272]},t(Wt,[2,129]),t(It,[2,105],{106:te}),t(It,[2,106],{113:113,44:y,60:A,89:E,102:D,105:C,106:T,109:F,111:S,114:_,115:v,116:B}),t(It,[2,110]),t(It,[2,112],{10:[1,273]}),t(It,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:P,9:G,11:O,21:278},t(K,[2,34]),t(tt,[2,52]),{10:jt,60:Yt,84:Ht,105:Xt,107:279,108:243,109:qt,110:Qt,111:Jt,112:Zt},t(se,[2,133]),{14:U,44:W,60:z,89:j,101:280,105:Y,106:H,109:X,111:q,114:Q,115:J,116:Z,120:88},{14:U,44:W,60:z,89:j,101:281,105:Y,106:H,109:X,111:q,114:Q,115:J,116:Z,120:88},{98:[1,282]},t(It,[2,120]),t(et,[2,58]),{30:283,67:Nt,80:Kt,81:Pt,82:172,116:Gt,117:Ot,118:Mt},t(et,[2,66]),t(wt,n,{5:284}),t(ee,[2,131],{108:270,10:jt,60:Yt,84:Ht,105:Xt,109:qt,110:Qt,111:Jt,112:Zt}),t(It,[2,126],{120:168,10:[1,285],14:U,44:W,60:z,89:j,105:Y,106:H,109:X,111:q,114:Q,115:J,116:Z}),t(It,[2,127],{120:168,10:[1,286],14:U,44:W,60:z,89:j,105:Y,106:H,109:X,111:q,114:Q,115:J,116:Z}),t(It,[2,114]),{31:[1,287],67:Nt,82:219,116:Gt,117:Ot,118:Mt},{6:11,7:12,8:a,9:u,10:o,11:l,20:17,22:18,23:19,24:20,25:21,26:22,27:c,32:[1,288],33:24,34:h,36:d,38:g,42:28,43:39,44:y,45:40,47:41,60:A,84:b,85:k,86:f,87:m,88:x,89:E,102:D,105:C,106:T,109:F,111:S,113:42,114:_,115:v,116:B,121:w,122:L,123:$,124:I,125:R},{10:jt,60:Yt,84:Ht,92:289,105:Xt,107:242,108:243,109:qt,110:Qt,111:Jt,112:Zt},{10:jt,60:Yt,84:Ht,92:290,105:Xt,107:242,108:243,109:qt,110:Qt,111:Jt,112:Zt},t(et,[2,62]),t(K,[2,33]),t(It,[2,124],{106:te}),t(It,[2,125],{106:te})],defaultActions:{},parseError:(0,p.K)(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:(0,p.K)(function(t){var e=this,s=[0],i=[],r=[null],n=[],a=this.table,u="",o=0,l=0,c=0,h=n.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);d.setInput(t,g.yy),g.yy.lexer=d,g.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var A=d.yylloc;n.push(A);var b=d.options&&d.options.ranges;function k(){var t;return"number"!=typeof(t=i.pop()||d.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,p.K)(function(t){s.length=s.length-2*t,r.length=r.length-t,n.length=n.length-t},"popStack"),(0,p.K)(k,"lex");for(var f,m,x,E,D,C,T,F,S,_={};;){if(x=s[s.length-1],this.defaultActions[x]?E=this.defaultActions[x]:(null==f&&(f=k()),E=a[x]&&a[x][f]),void 0===E||!E.length||!E[0]){var v="";for(C in S=[],a[x])this.terminals_[C]&&C>2&&S.push("'"+this.terminals_[C]+"'");v=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[f]||f,line:d.yylineno,loc:A,expected:S})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+f);switch(E[0]){case 1:s.push(f),r.push(d.yytext),n.push(d.yylloc),s.push(E[1]),f=null,m?(f=m,m=null):(l=d.yyleng,u=d.yytext,o=d.yylineno,A=d.yylloc,c>0&&c--);break;case 2:if(T=this.productions_[E[1]][1],_.$=r[r.length-T],_._$={first_line:n[n.length-(T||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(T||1)].first_column,last_column:n[n.length-1].last_column},b&&(_._$.range=[n[n.length-(T||1)].range[0],n[n.length-1].range[1]]),void 0!==(D=this.performAction.apply(_,[u,l,o,g.yy,E[1],r,n].concat(h))))return D;T&&(s=s.slice(0,-1*T*2),r=r.slice(0,-1*T),n=n.slice(0,-1*T)),s.push(this.productions_[E[1]][0]),r.push(_.$),n.push(_._$),F=a[s[s.length-2]][s[s.length-1]],s.push(F);break;case 3:return!0}}return!0},"parse")},re=function(){return{EOF:1,parseError:(0,p.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,p.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,p.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,p.K)(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,p.K)(function(){return this._more=!0,this},"more"),reject:(0,p.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,p.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,p.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,p.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,p.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,p.K)(function(t,e){var s,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var n in r)this[n]=r[n];return!1}return!1},"test_match"),next:(0,p.K)(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),n=0;n<r.length;n++)if((s=this._input.match(this.rules[r[n]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,r[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,p.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,p.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,p.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,p.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,p.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,p.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,p.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:(0,p.K)(function(t,e,s,i){switch(s){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:case 12:case 14:case 17:case 20:case 23:case 33:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),e.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const s=/\n\s*/g;return e.yytext=e.yytext.replace(s,"<br/>"),40;case 11:return 40;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 18:return 96;case 19:return"MD_STR";case 21:this.begin("md_string");break;case 22:return"STR";case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 34:return 88;case 35:case 36:case 37:case 38:return t.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:case 42:case 43:case 44:return 98;case 45:return this.popState(),13;case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:case 104:return 111;case 64:return 46;case 65:return 60;case 66:case 105:return 44;case 67:return 8;case 68:return 106;case 69:case 103:return 115;case 70:case 73:case 76:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:case 75:case 78:return 119;case 74:return this.pushState("thickEdgeText"),75;case 77:return this.pushState("dottedEdgeText"),75;case 79:return 77;case 80:return this.popState(),53;case 81:case 117:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}}}();function ne(){this.yy={}}return ie.lexer=re,(0,p.K)(ne,"Parser"),ne.prototype=ie,ie.Parser=ne,new ne}();m.parser=m;var x=m,E=Object.assign({},x);E.parse=t=>{const e=t.replace(/}\s*\n/g,"}\n");return x.parse(e)};var D=E,C=(0,p.K)((t,e)=>{const s=b.A,i=s(t,"r"),r=s(t,"g"),n=s(t,"b");return A.A(i,r,n,e)},"fade"),T=(0,p.K)(t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span {\n color: ${t.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: ${t.strokeWidth??1}px;\n }\n .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {\n text-anchor: middle;\n }\n\n .node .katex path {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n }\n\n .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n\n .root .anchor path {\n fill: ${t.lineColor} !important;\n stroke-width: 0;\n stroke: ${t.lineColor};\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth??2}px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${C(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .cluster rect {\n fill: ${t.clusterBkg};\n stroke: ${t.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n\n rect.text {\n fill: none;\n stroke-width: 0;\n }\n\n .icon-shape, .image-shape {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n padding: 2px;\n }\n .label rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n ${(0,i.o)()}\n`,"getStyles"),F=(0,p.K)(({defaultLayout:t,styles:e=T}={})=>({parser:D,get db(){return new k},renderer:f,styles:e,init:(0,p.K)(e=>{e.flowchart||(e.flowchart={});const s=(0,h.TM)().layout??t??e.layout;s&&(0,h.XV)({layout:s}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,(0,h.XV)({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),S=F()},78257(t,e,s){s.d(e,{P:()=>a});var i=s(32178),r=s(31293),n=s(86827),a=(0,n.K)((t,e,s,n)=>{t.attr("class",s);const{width:a,height:l,x:c,y:h}=u(t,e);(0,i.a$)(t,l,a,n);const d=o(c,h,a,l,e);t.attr("viewBox",d),r.R.debug(`viewBox configured: ${d} with padding: ${e}`)},"setupViewPortForSVG"),u=(0,n.K)((t,e)=>{const s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*e,height:s.height+2*e,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),o=(0,n.K)((t,e,s,i,r)=>`${t-r} ${e-r} ${s} ${i}`,"createViewBox")},96755(t,e,s){s.d(e,{A:()=>n});var i=s(86827),r=s(51444),n=(0,i.K)((t,e)=>{let s;"sandbox"===e&&(s=(0,r.Ltv)("#i"+t));return("sandbox"===e?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body")).select(`[id="${t}"]`)},"getDiagramElement")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[942],{50942(e,c,a){a.d(c,{createInfoServices:()=>s.v});var s=a(46560);a(45615)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9838],{29838(e,c,a){a.d(c,{createPacketServices:()=>s.$});var s=a(64714);a(45615)}}]);