@zombie-mermaid/svg-renderer 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DEFAULTS as e, buildStyleBlock as t, detectDiagramType as n, escapeAttr as r, escapeXml as i, f as a, formatCssColor as o, getReadableTextColor as s, isMonospaceFont as c, measureMultilineText as l, measureTextWidth as u, mixSrgb as d, parseCssColor as f, renderMultilineText as p, renderMultilineTextWithBackground as m, resolveNodeStyle as h, safeHref as g, sanitizeClassName as _, setMonospaceMetrics as v, splitStatements as y, styleOpenTag as b, svgOpenTag as x, themeStyleDeclarations as S, withDirectionOverride as C, withoutOwnClusterEdges as w } from "@zombie-mermaid/core";
2
2
  import T from "elkjs/lib/elk.bundled.js";
3
- import { CHART_ACCENT_FALLBACK as E, architectureToGraph as D, c4BoundaryTypeLine as O, c4RelLabelLines as k, c4TypeLine as A, formatClassMember as ee, getSeriesColor as te, parseArchitecture as j, parseC4Diagram as M, parseClassDiagram as N, parseErDiagram as ne, parseMermaid as re, parseSequenceDiagram as ie, parseXYChart as ae } from "@zombie-mermaid/mermaid-parser";
3
+ import { CHART_ACCENT_FALLBACK as E, architectureToGraph as D, c4BoundaryTypeLine as O, c4RelLabelLines as k, c4TypeLine as A, formatClassMember as j, getSeriesColor as ee, parseArchitecture as M, parseC4Diagram as N, parseClassDiagram as P, parseErDiagram as te, parseMermaid as ne, parsePieChart as re, parseSequenceDiagram as ie, parseXYChart as ae } from "@zombie-mermaid/mermaid-parser";
4
4
  import { decodeXML as oe } from "entities";
5
5
  //#region packages/svg-renderer/src/edge-curves.ts
6
6
  function se(e) {
@@ -112,29 +112,29 @@ function ye(e, t) {
112
112
  var be = "JetBrains Mono NL", xe = "@font-face {\n font-family: 'JetBrains Mono NL';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(data:font/woff2;base64,d09GMgABAAAAABvAAAwAAAAAPWAAABtwAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGkAGYACDNhEICuRsz2ELgyYAATYCJAOGPgQgBYREByAbWjAjEcHGARCEduZRlMfRhcj+eWAbMx8MXsFY1AMYgxQLh2GYMVuWSbQZOjzvQhHrXnbH28KzVPg3QpJZomrI6lliLI+KSSeVPYryGIWmPDYrgaI8OLLE8fIV9/c6y/e+ZNB7khbIPiKu+INtefkIygBJXcZuFw+Bd3fmquSqTJ+0GZ7fZg+wWJs7K0AUEQHJD5//iQ+S309/SlLBBtTtTnc7t3bhLlxduEx3nbtd9Lz0omqTc5mf7DQLP00WgKwmeiAKtX1uOXD1m1fn56okB8lB6wJO7Z8Opg7bqe/enmXs3EmWrFiWq4A+OTnKTz74OFCwi3by/3t2iVFFoK29qd2IthumsRuv5Xn6e1P/ycxLsdVgFa8K29qdH9DYWoB6t0RxwVKIsolbF+tMMrFCOoWXa82cBTkvrXqlGUCkBSmWlle2L8Cg7fNXktAIFKNoUCxjQbGaHYUWR7FZBsVRWY/ipJrCrkymZYO6nIcBR5tZcoafBSsL9MHZOmiHe0D1qMY169//GZD7sGUAoFx/yQfatPi2mSk5ooSsSbQx17Jy+Db1SxKE8aTWuFYD7VPayMwe5T74XysImHYWcGebWTc76pJ7HHCbGbucsMV+m91iqylnnXbGDnejcBCXr0KRYiXKVahUpVotlmZsLThaCbQTEpHY61b7XHSH50ihVDQwRiZmFnZOLm4eXmFRMXE9EgYMGjIsY7eH7HHBIdsddswRxz3sPs+634g7nXe7B7zgQeess97z5txr2mWTRt1low022SmbYEmwxSWxcsuVyldmpeuUWmoAhjr1GjU4iYmPqw2PWJNuCjIQJTkYQs1AR6+DDa4TQYsU5OMXEnBKl35JvfqkRKRRYGuWAzwD5AHwBgy9AuPzAHQsA6g2F22ArcaiJK4FLOGUTfjczAOi09DoW3devO+kaxMaMa8gmnNPE88T2D03jpQesXjo+WQRF27Tt5wdHcEoo7TDA4JxlJjjLGRDj8UmgjlF4RiYpa9Nr1NqlzlOnwlLqNR3aYDrlnrxyvJlfnUiwY7vVPolzqhkudc/tZz68DiHq/w+E/R2Bropp6LvsiryPX9oFRUdp8BvtcqR7CIEljGybitd4ruc7rukT/USp5/rkpd79y6sKFzS297oZdW3bV9AVbVqbEVWvNXyckZjXtK24167T7KvPySRHH0TsyHX4Hml8T5eBXzPCH+oy/YcP2IVSWmpc4SYu18gsbiXXbG/z+0x13MtaZIB68OiuoUN4HoPCFiBkC7evAOLOMZFDiFbAtd4cUuU46LESBDZpLWxINCKJI9F1FJgIEL+yPhsWiHIncwpme575DUoqWOTewANVUiYELRy/RO3pFfZItSupWVguD7kgQsIROA4PoueKBIyhIxjLNhimywSjBwj9IBsBpHtmAsdCvuxKeBMlnKiv2Y8kNlAyI1kz+BMSP9L+EnW7nZPJ1nXeWUqJwYLvTVsWDjXnC9fdrmY5Tmajwpnsl4El4XXsg1kznl9lEhYzay/WxAZZCqcsVEXnknVgaxQOfWpbhIXTCHqqHHqTNPdLCMpbjZYPaRTVaWcd/AGN0oQXW8dZw/x9B45OOD8Zlrtvv31r989wDzV7Re9OlifPAc5Vp2FqvZSb+NPhd5drG7JpyRbIS3b+aP99Q5uWjBuc9GDzR6ogjm7ZoyUgtGHepyrE9JBzNDVHQhdFpIxBJv3gSLZ98DXrgEIQshFnGarRL+9LOBhmQAWBiRNG29iEAHFGCQfEcER6/ERIw8A/t02Sq0rOixukCY4wmD+muTjZAhCQI4zkPWziP1rZCRyXUAjDcUDMNPcVh2nJRrNCw1I9eiOsNIIBe0a7gJw1SX69+e8n0n/If5h4GzQw/X/i107vaGDjEzRGfdx+kiNxz1AHPF7LqUkY41tnmBQ2BuZu8HVCKMR2gqB1yY53axDZkje4gE7kWbfb1oXKEbzO8zQWRH9dbmghC1bONNchvbTxSwvAehKLQtMuBCcptpZxrHVzKnbWgkdR/uICkx8z0wlGCTaE5HtZaO3OoQtaP0YEEZZlUOToc3G6E4/T1Zc9SZpt0VUMCDcVV3jH+1/ZMjlzzIEA4RkEmJ5wm5Yxg0JJmleMuYIHujwjnTO9L5IJtYfnyQ7QW8TIdRyu6MbhFOZdOvHjK+adNvnNrxXSmXq2GZObgLrtU0Fi9sZ68KCdoriWgKAhR3jcT0LMetcKHpIzLeBWwmdlVuj862GEKqYoUYXYI7J1aB0GDw7kQZT6GLUg1oHwvbQPSTRMI8yBl88Q8cJdO8IUnpDuuFBbozvlV0RXqMeuriJ1wMjC6aVlgeuagm0NzZPDjhTtWdmdO6CNd7mwhgpNrNJgzEOhtJgnzcXy1Z1g+qWMd0L8R9+Qsai1gJky00glgdozpR8yAyQBzSy60cQkhmSYVM7Ixm3UJJIGmV400psSVeuloAjOWB6Bs3kEYIuErS3mIG17CGtXHpqOgSgw3vBJ0oAZ665B5LZxtbQWEAYYb58CGFfBZzZdB7NHGmZQUqUv7SquY7z8jlZCNFB/vj1XGv6Bo3JgS6BCrFirdTDI8uRoeHfCgajzR5t9PHhMG3UscnQ3VFEhjCcOjEbbpQ8qg85RdNK6t1qrw6SYkP4MZ3ldKA0GSswd61+4R8bf+afGmeDuoGnbOxo61qqsEem1mi3xq5WVTfmCLJ8GA/S3UP0TRt91SEmu/gAudfkEfZG7X76sFz+XAw2ByxOTOk9CB8y/YHyKw1fvRQHK3HYFA/QA6XtzdqwVG4+d7PRrKS7g005zjSigW8fMnRxRfu9aeKG35+/Mgm5kE+1rjrQrG8qhS251jwORdt6nbozX9w0a+QlEJZTqql9cmMe5e/qatQcukutYVOwThBJmBoZHRJ1ACu1L/xlxz1VM57xn2C0Ssi7q5dnT2M09YWVe2kG6nzi+zjEA4OMZ0KrBf2Aw0eRMDXHwi8HZq3R65RZI9VqnWpc9oTgeSKQDVjrL9l8olXT1hzWhI2wqwmboeFovbK1MbSRkbPlDM3o8mITq5N7hVOIWwmeK6rT+8XT/W0CCALOUm73b3XLdyoTlBsMxsO0V8SD8Y9tOJqECYjqcq0DNobGQHPOSU/SgbXd6RhyRU1aH1Us0oxrerqYAx7oyzUVfA/pBXeZLm4Lna76lVVrleOc0PBMVfeW6esxHFyOU9ZUVYRDBZPaFDhmFh4KrkmM1GnXubN05M22m2OZMVjSlo8q2hsiZmIXZL65XOsiajVdjrO4VNa0UgkP1GrDWIVVskQjIAHiT6YxUHFq+lWC44HFIq/RuhSI0hHa2qxZbTUs0VGkk2Cdi9YWsb/bQlhX6J4Ou03T3EDnVIuQzta2ZS4O+3nC+m/v/Kz3mvhZs/rZsPxZ1/z9rJh0L/jpbhCMf/R+q0C9m+t/XctXffrIe+5/VdNB8er6/76rfeD6lfumU3J74wvC4htTEuCffzk6FPFIMM9W2mGE12BqDaT6ohsOjspUCqEQVcjGJONKvUom1xuU40BAj6YHw4awsCioh0IkjKggSKWCDTCgCSBFMmT9iIBXXxBjJUeX5if4KxH9ciJBMD+GMI2y+ea0rawObRMB3/zDurhQElLXqyVhvB5d2BpRGTpU9Wh3tUaAz0oYCYT6O/+xz9gHovOHCePHLJyVZSRAcP4s4fxZTsg0gGu6hsLGhLpVDUdvJb6/x/xG/zwp+VpC9lX8axzky28T3UZsBDVYSk+MjcRJNaZHEH0vqfPIvPiqEeCbJ2V9B6ThS8FHVnefwBOdYHKe3GwggH5+gw/qgjbMuzw86prsmwQjqyxDg7kd2eciHkDOr/pg6LosPRVv2OdaN3t/aCVNxdgH2PTw8HBSlMyscJlJiGshHIJ9BmApUwKiBwQajRv6FIbw8GDYN7TIrh3PExpPrs+RZOllUsWH2z7SnZOr8yqpm67e9AfwzX8TX5UJh/W1i+9qmdgFYXoFjOmgXYCcJ2f2qrp4Qo/cO9IX2Xspa68MRcQSlVK6FxyZi5/Mms6OjWbCSFjs2O4+qKURfeaxhb8grEOBwJgegtCBEYX3uQX++QU01C70Kw3GxKe3wpEdwtWiTZslakwGqbWSzYBLT04MhkmFWYPAHTpZSyvy4ECVptASx2QCl79NAQfahE4pyVfDQiEK81nHk8PV+kJ8wNS1ehhc2zwmviae2wzY9HjvUKiALJDLtAo5pJXHz2E4OQi+f/Cqb/zHJ1e4RKIC95NjP/gfugp6nVdtkvI2GpZVlIO16cpDaLRFLlZUlPXay8qt7qvDKINHQ/LzaQiKMQDr1eFnunuG3l7LJA3Mtam3I8+EXh3rHv9iLdNoZKyd+BJcy3/3ua7t7PteW7ny4/tK5id/PnCQeo6GuCv/w7UR4B+6igTMAo6xs1l4kt070v5bPpmFDNh90WTQeb0nSk05ZG1GlVkpNs+2RFtanwIX6Gin32iwkepOY5O8ptpZY0UNuJynbtPpkLZW1OrWTX+QZJlqanQ1dtTaibIR3tiYlpcxbzU1mmuq/Y27LbX9jUlrta2FvQ4Y6bBVHqMkyHlyljJOyeAK2BbqDx4IhPqHzNJ/1LOav6ViRAvPwIi2P4MxbSY8pgxmYlQX2YBKJBAmX3s3jKkhCSqtJ6muTAy8QoBjYuyHC9KoT090MZ0I9wcOBEP9NhhXZCiU8VlynkxQYlZ5tVmiNAR1r7VE+rdmVv0PaKZrusWSmFrdHg6IlC1HDiyT/noJIQ8a8TGxLtzz6C0aPNFmHnq0fTuCSXviUq0VMVlRlPsQuPACNj00mume7MYPegjtEgj9SNjdrtBiMj7C7CLzNGn8LSOoQFWYQqHCUPD2llliNo12GvQHiAOILL1ALGwBs3PEfq6dw6d4aEPmdsgR6g1kAqF+B2QWD1GDHqYt3uVZ0WB2KuHCqGRCAngc+FxWUuJGSGkLxdwpMgLDKpEE0SIB4CCenDxH0N+4nwCeOWIc1qgVd2cRgdzQ2HAMhObJ3Ym9H3efz36gOnHXr72/gfEOpx377hHiOmWds+YkAeRMSwdVs5TZUHqIEqEzhbBFedB+qPb3ivLfag8bpkx5xemBj0kmdK8bVirZuZFMumdNIp2KRtVJrOnxPGErpEKRm5GsAsnUOwStgIMPn1fPjCI7N/E+9NpGFnS7T54m7tjC/Syfc7n69za5Sg2vWSlXaRQzxfyXG/4G3rk4roBtob5ghDezKqK0Ax37o7UdufPE+jZp21rrkRaOfcdYOjDnNqJFraPBcB+R2Pt79Y8285n9CzmJ/AWGmGSCGjUqEKcvHuSS3FUjkEKNBEBxri9KmEgmyWvh97J0SN7u4jGFSakPd7pa8KhF6a1gNLW0Shtkuu2FU4XT5qjdB3wlinZfQKBU+lvbO8UQ4pHT5s3dernYGxaoZEQbbNLJZDqdU4q3ClWo8PkVqbSSEhDRdFpU6juJO/eT+xeIBXUFtXyWAM304PBQKEAG5EpMLEEw+YJnGeVPDzBCY8Oz/7Yh702XLOjdJljtYVjE6xh2sEIj1Kwj26IwWj5hO0O6zuBnROAboIEVYI0RvQHwnyi7Z1Gy70TyeXHj81h9z+LHS5Mjc8kX9ZJvrx8/kuDCHP7mi7TQTbb0u1zuu5FVtmD+VUCSgtUtxC5SulpLgPzHOYHGxgkeWbmyuapMWMvXPs8Tftj8JFdM2891NM5Vl5FiTkkpYD/U/hUX537Vni0VVwoqcTXgCQDf3DwZgCGtWAJr4QDJdCdoDX4Y/q8h9EcC2PRZQ4EKu8LtKpNcb+KiQj/miA/6uXxpRfmS8vYNr1gKnohnZE/f0n34+hs2HySA0/YzbTnb1SzXYJAC08MkNTyWjsRGh8PtkrRG99QVEwFq6LGRoRAp12rlhPPRWsFqufhwC3Gz/dwDnpzuAS8/NDoEpmcN2+mn48WPNf54kTwMGFUeAEeu1sqejWwgeJRHRmP9AzHO9mVsoWNJGdSjbauPfn68NTonqX2MV412SUQRFQYleyDMiuIOrRZ3oMULBR6hbSoZJZ97xU7ZANh0bUIo61JqLRF0EW2b2i2TCp1dbUokOMsxmV/dRkMXhYta5bG3R6g9J1GjQqGWJWLNiGBWUQCxGuQKC4G0Qv4NgSfnJLV3ETXKgEQYUemgRALS6hKm7WnAjs/jbRPotGabvSONdd2YRsH+CfM9d7RlSuq/rq9b3KAru0vT0NSiqdvR3HAHPDX6HgrYq3SeTpWOUcViVTEYlawmbcr1Jlqpz3jv0RtlKk8nyF556zX+6LeiohNvYlq5o7A394lSx59XF5AxjbaRXcmvbBvkhRqFSCJrnF99eaNPsOjAbSX9/EqbhYpfbHxMG7Fz+MRZ7caHVqQ98lfB3p0yrZQrLzVXV5lLi/tSWSXF4dv5b4vt6NNjzVyt9MrO813ufGw643I94wqjfTD1l8Grd4l4fVoeYO9v2l1Xt7sJ75915KQMavc2QzUna4oife7rkXK71LcWU5PtluJ3y/LLnKrKj4aVBWWg4uK5Hq+1Shcq1fHFVGIxFZhvneQjBgyCDBg64ZjA4u2SoErKJe3CVFBe3bVcrPipdEJg3JKFcc6eLlTG9QiyFs2IIc8HOB/XtCG+x58UzH1Ykmwst/Q2Zq/u78AKJ+wThc6OiURxr4FMX8mHc4I3ziO+k/fFf778/vvLLgAb81UXGq6dC6F9M8MSPvvV+dLhFczGvllg6C8RnA7qIDiz9346tqP69sv7Lu3LUKpy/R+w8cetlyz8icn7P0iNuZBlftvGsVyyWggRFlyM9wVc7nd3O3Msyw5p1qBpPI2u0eRo6+12ujk4hyuTkWtAMUNO46DmjhT5jGuVQaDfViaT1x3aLLWwGqXazTPydLORA7mZLR0Z8GXOohP4BPJI7KRbDIYCAi/2n/4N379k/01wGy6eyG+nwVQtjuAAihg/MoLLjY/+8MgPPU9+9+RPjjyZLIL8QO3Hx75PXHAHSnbfFwDO5LLjOWywYmq9nR7p88x4OpT+aVkvX2fPiUWonSRH/PTM02IOSe2MRew56/bZ2vnI/bfez20H3w85ne8p4G/t9vcJG1AiKxyO712ufyDl/zbbiwSxoKjO+8JuB0pJh1Eq7TBKGBfZTCb7IiiYWufPTfZQHCTvjDPnmKEE7+3Aw9223PXydURupBt0ktxFz/w5ri+x9huInl5X3ro9d3O46JXP7snesyTX29bSijw8B4zRVBGrtFzXgxuvviJhOtKRcCQVBe4gH4XEsj+F9anq7+/HD9WXsOv0DRMpHEBjxifLI8zet3bdijx79taNP7mKXAWuBbRH8UefdH+5YP+m+m114/a67dump+sjNDDBRgXYlxnv1NW9w2A+l17uc98dNk4bn/3hygfse/Gz+Jkf0vsH7IhLuJu1ZPimylzhHvLMW1FARRDF9Fa6Im81wLAHFvQ9toUHMHDnfZMQPv0a0P6PQTpMxigtOXq1iCvGHOsSTAfdPSZgtV3cYD+/oXOQkn6qSfrGuhQFvO9EDPql6NLORnYAdi/v/OmqId81+npVfTVaXV/1WELfOWLwqZQxCdeUmqq6p0x15X/JZXVAM+eYwDSTbvumnfvWpCYnU8stDtLQ4XTpMgYtjjQFp6iYw+7ByUi6xx5NpvwDxjoOc5o90nInk3lXS4Y9Dd7Kc8fibinuCRppc0JMrAu6zGKC22qXuvmWFsZ3zMannviHHI7uODf9UKTrxiOlBIuBS1MCdPyuKm5SIBWcBP/Pfe3o8Ztwc4/Pge8gd+A7QMFeb5LQBevGuHz+dlZD3UrvsrfVAkYHSybTiaiQ2CgxxJwuvjVmzlEFFQWN/FYjs1bx21gJtgQPKWRqzcdUtKsJEVgSpC/Lfo8YFdbfzehYcu+NAuaxYsDuN6UgZa9+Rq/sTUEm8/AJGL4tntzTynNIZ6Q8u4crlysaMWKOgAexSzRw+2R750gk6smHloOyclA+qW4ZKEfbX8cts7foB/G9kku+f56/AinRl23a+9HbENmUaNsjorL3ylq1CLAfVxM4ghJWtVqKKLIqVGLmRyzWApPxUzHrj+D//tPk6abHx8lxD5eV4KHNlbWVVXWVlXVVU/Qf7AL25trOaFOitpZ4jjqBan1qKto/BQbXJ6ZCA1Pgo/Vbp2xTU5FOs9UM2EERCgsEKkSF114OKioo5eUU99UB+GxLlX1/Jr+qvgqt4uSzTvZIAbM7jIgRbP3zdLy6gNT0p+hgvc4zbGGRoNmWhStpzeQIVYXNZL7/O5rLIlzyxeaYgAIAyAUWNQzOsm2qGzayTaol7pQLF8QyeaIPDIiGATaEKRIvsQMugUvgkni15nitBLgWroVr4Vq4FW6FW+HWuAhS0sNTavdZtkr1wyibUG1xrVzoIDB5qfBkLOoGGCFIWVJWge0wUDalDsfV8jgCQbBwSEgdj3usgr2wF/bCXuGFlBtOwAk4ASfiwyLRYS4tdyH8OUuGRRz2bFaWD1wNu/vGOeqdHx4refhUHpVnC89n2/n7+2FtJvN9/89F5G0AuOhdawXKP2Bd40fWdfzQpfP6e5mo3vPoLFSJj/ML9QVAjv78NXf7XYDzqIfOoYpcwf/Po7NorR6oLeqv/rXy4SE6FE1jCchlkXUR1A7MHEAt+D3Ug0vxYTPlSRjnXerILH+eKx5ycFz8UD6q6ehI1I6rDr7bgW/Jwt9z1LbU4duk7MzZPF/z/M2UfwQTJmpL3u2gw+HakAyNvoRqrnl1ue78o/rKlSbE3cpQgDp5aQzG+4PL5f/1Lrf+Afj6if8Ec6Vv/DP5/1D9Z3cBugmAQPcfnwd1erB8LfgM8doZB0ek7pevin+7D27RXlHBuHkfS0A4oibpQ8JebvVxYyQ8fpEivhDhK8Iq9Rz7Vau+69PJBXvMDnfF9jzHAUKqyItvL7v62GlxgaE4rp/CdZNIdfjHPkY6537+4JgpGDBCEFFhM24xdTcbzHvNVVfKgsmkaRrUxwjuTxonKGIm2xC5Kgw7/VUAN3b0ouqhEg9F/Rv0+i7WNrAuw0kpjTkcZGZ87WMVwB/DdgbTqvlK+2iETDiYL20eXxFpXm66pmu6lvs/CvCc+wywyupZ6VijjHP7Y50OgKc05FtoUMSW4Pt3y7LApS3bJJNbMVIrs+Jwf4FDMRkqKSEJA9LMBh3SJ2dhwkGI6TaiT0iKU0xKWoJ+/TX4Wgm0aQd5/oyMuJAREoP/k7YyIT/LKJ5WEk20zy7GIRQ9qrAm7YWa3K7Jt6YmrPHcNFCBHAifTVS3pYbykNWHyxO69bhj8Ql/ILLsb4nYhF0o41JgJS/ZEQkc9ZPuegalpIlkRNaQt3MZLq5uCap+ZWlYq0h0VP24evYJ1/16E5rXbdc24AMC) format('woff2');\n unicode-range: U+0020-007E, U+00A0-00FF;\n}";
113
113
  //#endregion
114
114
  //#region packages/svg-renderer/src/styles.ts
115
- function P(e, t, n) {
115
+ function F(e, t, n) {
116
116
  return u(e, t, n);
117
117
  }
118
118
  function Se(e, t) {
119
119
  return e.length * t * .6;
120
120
  }
121
- var Ce = "'JetBrains Mono'", we = `${Ce}, 'SF Mono', 'Fira Code', ui-monospace, monospace`, F = {
121
+ var Ce = "'JetBrains Mono'", we = `${Ce}, 'SF Mono', 'Fira Code', ui-monospace, monospace`, I = {
122
122
  nodeLabel: 13,
123
123
  edgeLabel: 11,
124
124
  groupHeader: 12
125
125
  };
126
- function I(e) {
126
+ function Te(e) {
127
127
  return {
128
- nodeLabel: e?.nodeLabel ?? F.nodeLabel,
129
- edgeLabel: e?.edgeLabel ?? F.edgeLabel,
130
- groupHeader: e?.groupHeader ?? F.groupHeader
128
+ nodeLabel: e?.nodeLabel ?? I.nodeLabel,
129
+ edgeLabel: e?.edgeLabel ?? I.edgeLabel,
130
+ groupHeader: e?.groupHeader ?? I.groupHeader
131
131
  };
132
132
  }
133
133
  var L = {
134
134
  nodeLabel: 500,
135
135
  edgeLabel: 400,
136
136
  groupHeader: 600
137
- }, Te = 12, Ee = {
137
+ }, Ee = 12, De = {
138
138
  horizontal: 20,
139
139
  vertical: 10,
140
140
  diamondExtra: 24
@@ -142,11 +142,11 @@ var L = {
142
142
  outerBox: 1,
143
143
  innerBox: .75,
144
144
  connector: 1
145
- }, z = "0.35em", B = {
145
+ }, z = "0.35em", Oe = {
146
146
  width: 8,
147
147
  height: 5
148
148
  };
149
- function De(e, n, r) {
149
+ function ke(e, n, r) {
150
150
  return t(e, n ? {
151
151
  family: be,
152
152
  faceCss: xe
@@ -154,18 +154,18 @@ function De(e, n, r) {
154
154
  }
155
155
  //#endregion
156
156
  //#region packages/svg-renderer/src/layout-engine/constants.ts
157
- var V = {
157
+ var B = {
158
158
  font: "Inter",
159
159
  padding: 40,
160
160
  nodeSpacing: 28,
161
161
  layerSpacing: 48,
162
162
  mergeEdges: !0,
163
163
  thoroughness: 3,
164
- fontSizes: F
164
+ fontSizes: I
165
165
  };
166
166
  //#endregion
167
167
  //#region packages/svg-renderer/src/layout-engine/back-edges.ts
168
- function Oe(e, t) {
168
+ function Ae(e, t) {
169
169
  let n = /* @__PURE__ */ new Map();
170
170
  e.edges.forEach((e, t) => {
171
171
  if (e.source === e.target) return;
@@ -196,14 +196,14 @@ function Oe(e, t) {
196
196
  }
197
197
  //#endregion
198
198
  //#region packages/svg-renderer/src/layout-engine/elk-graph-builder.ts
199
- var ke = {
199
+ var je = {
200
200
  flowchart: "DOWN",
201
201
  state: "DOWN",
202
202
  class: "DOWN",
203
203
  er: "DOWN",
204
204
  c4: "DOWN"
205
205
  };
206
- function Ae(e, t) {
206
+ function Me(e, t) {
207
207
  switch (e) {
208
208
  case "LR": return "RIGHT";
209
209
  case "RL": return "LEFT";
@@ -213,7 +213,7 @@ function Ae(e, t) {
213
213
  default: return t;
214
214
  }
215
215
  }
216
- function je(e) {
216
+ function Ne(e) {
217
217
  let t = typeof e == "number" ? {
218
218
  top: e,
219
219
  left: e,
@@ -222,17 +222,17 @@ function je(e) {
222
222
  } : e;
223
223
  return `[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`;
224
224
  }
225
- function Me(e) {
225
+ function Pe(e) {
226
226
  return {
227
227
  "elk.algorithm": "layered",
228
228
  "elk.direction": e.direction,
229
229
  "elk.spacing.nodeNode": String(e.nodeSpacing),
230
230
  "elk.layered.spacing.nodeNodeBetweenLayers": String(e.layerSpacing),
231
- "elk.padding": je(e.padding),
231
+ "elk.padding": Ne(e.padding),
232
232
  "elk.edgeRouting": "ORTHOGONAL"
233
233
  };
234
234
  }
235
- function Ne(e, t, n) {
235
+ function Fe(e, t, n) {
236
236
  let r = {
237
237
  id: e,
238
238
  width: t.width,
@@ -240,11 +240,11 @@ function Ne(e, t, n) {
240
240
  };
241
241
  return n !== void 0 && (r.labels = [{ text: n }]), r;
242
242
  }
243
- var Pe = {
243
+ var Ie = {
244
244
  "elk.edgeLabels.inline": "true",
245
245
  "elk.edgeLabels.placement": "CENTER"
246
246
  };
247
- function Fe(e, t) {
247
+ function Le(e, t) {
248
248
  let n = l(e, t.fontSize, L.edgeLabel), r = {
249
249
  text: e,
250
250
  width: n.width + 8,
@@ -252,47 +252,47 @@ function Fe(e, t) {
252
252
  };
253
253
  return t.layoutOptions && (r.layoutOptions = { ...t.layoutOptions }), r;
254
254
  }
255
- function H(e) {
255
+ function Re(e) {
256
256
  let t = {
257
257
  id: e.id,
258
258
  sources: [e.source],
259
259
  targets: [e.target]
260
260
  };
261
- return e.label && (t.labels = [Fe(e.label, e.labelStyle)]), t;
261
+ return e.label && (t.labels = [Le(e.label, e.labelStyle)]), t;
262
262
  }
263
263
  //#endregion
264
264
  //#region packages/svg-renderer/src/layout-engine/to-elk.ts
265
- var Ie = { "state-start": "FIRST" }, Le = {
265
+ var ze = { "state-start": "FIRST" }, Be = {
266
266
  "elk.layered.cycleBreaking.strategy": "MODEL_ORDER",
267
267
  "elk.layered.compaction.postCompaction.strategy": "NONE"
268
268
  };
269
- function Re(e) {
269
+ function Ve(e) {
270
270
  for (let t of e.nodes.values()) if (t.shape === "state-start" || t.shape === "state-end") return !0;
271
271
  return !1;
272
272
  }
273
- var ze = {
273
+ var He = {
274
274
  top: 44,
275
275
  left: 16,
276
276
  bottom: 16,
277
277
  right: 16
278
- }, Be = /* @__PURE__ */ new WeakMap();
279
- function Ve(e, t) {
280
- let n = Be.get(e);
281
- return n || (n = Re(e) || Je(e.subgraphs) ? /* @__PURE__ */ new Set() : Oe(e, t?.walkOrder), Be.set(e, n)), n;
278
+ }, Ue = /* @__PURE__ */ new WeakMap();
279
+ function We(e, t) {
280
+ let n = Ue.get(e);
281
+ return n || (n = Ve(e) || Ze(e.subgraphs) ? /* @__PURE__ */ new Set() : Ae(e, t?.walkOrder), Ue.set(e, n)), n;
282
282
  }
283
- function He(e, t) {
283
+ function Ge(e, t) {
284
284
  for (let n = 0; n < e.edges.length; n++) {
285
285
  let r = e.edges[n];
286
286
  if (t.has(r.source) || t.has(r.target)) return n;
287
287
  }
288
288
  return Infinity;
289
289
  }
290
- function Ue(e) {
291
- return Ae(e, ke.flowchart);
290
+ function Ke(e) {
291
+ return Me(e, je.flowchart);
292
292
  }
293
- function We(e) {
293
+ function qe(e) {
294
294
  return {
295
- ...Me(e),
295
+ ...Pe(e),
296
296
  "elk.spacing.edgeEdge": "12",
297
297
  "elk.layered.spacing.edgeEdgeBetweenLayers": "12",
298
298
  "elk.layered.spacing.edgeNodeBetweenLayers": "12",
@@ -300,23 +300,23 @@ function We(e) {
300
300
  "elk.contentAlignment": "H_CENTER V_CENTER"
301
301
  };
302
302
  }
303
- function Ge(e) {
303
+ function Je(e) {
304
304
  return {
305
305
  fontSize: e.fontSizes.edgeLabel,
306
- layoutOptions: Pe
306
+ layoutOptions: Ie
307
307
  };
308
308
  }
309
- function Ke(e, t, n, r) {
310
- let i = l(t, r, L.nodeLabel), a = i.width + Ee.horizontal * 2, o = i.height + Ee.vertical * 2;
309
+ function Ye(e, t, n, r) {
310
+ let i = l(t, r, L.nodeLabel), a = i.width + De.horizontal * 2, o = i.height + De.vertical * 2;
311
311
  if (n === "diamond") {
312
- let e = Math.max(a, o) + Ee.diamondExtra;
312
+ let e = Math.max(a, o) + De.diamondExtra;
313
313
  a = e, o = e;
314
314
  }
315
315
  if (n === "circle" || n === "doublecircle") {
316
316
  let e = Math.ceil(Math.sqrt(a * a + o * o)) + 8;
317
317
  a = n === "doublecircle" ? e + 12 : e, o = a;
318
318
  }
319
- return n === "hexagon" && (a += Ee.horizontal), (n === "trapezoid" || n === "trapezoid-alt" || n === "parallelogram" || n === "parallelogram-alt") && (a += Ee.horizontal), n === "asymmetric" && (a += 12), n === "cylinder" && (o += 14), n === "state-start" || n === "state-end" ? {
319
+ return n === "hexagon" && (a += De.horizontal), (n === "trapezoid" || n === "trapezoid-alt" || n === "parallelogram" || n === "parallelogram-alt") && (a += De.horizontal), n === "asymmetric" && (a += 12), n === "cylinder" && (o += 14), n === "state-start" || n === "state-end" ? {
320
320
  width: 28,
321
321
  height: 28
322
322
  } : (a = Math.max(a, 60), o = Math.max(o, 36), {
@@ -324,22 +324,22 @@ function Ke(e, t, n, r) {
324
324
  height: o
325
325
  });
326
326
  }
327
- var qe = " root";
328
- function Je(e) {
329
- for (let t of e) if (t.direction !== void 0 || Je(t.children)) return !0;
327
+ var Xe = " root";
328
+ function Ze(e) {
329
+ for (let t of e) if (t.direction !== void 0 || Ze(t.children)) return !0;
330
330
  return !1;
331
331
  }
332
- function Ye(e, t) {
332
+ function Qe(e, t) {
333
333
  for (let n of e.nodeIds) t.add(n);
334
- for (let n of e.children) Ye(n, t);
334
+ for (let n of e.children) Qe(n, t);
335
335
  }
336
- function Xe(e, t) {
336
+ function $e(e, t) {
337
337
  let n = /* @__PURE__ */ new Set();
338
- if (Ye(e, n), n.size === 0) return !0;
338
+ if (Qe(e, n), n.size === 0) return !0;
339
339
  let r = (t) => n.has(t) || t === e.id;
340
340
  return !t.edges.some((e) => r(e.source) !== r(e.target));
341
341
  }
342
- function Ze(e) {
342
+ function et(e) {
343
343
  let t = /* @__PURE__ */ new Map();
344
344
  function n(e, r) {
345
345
  let i = [...r, e.id];
@@ -349,15 +349,15 @@ function Ze(e) {
349
349
  for (let t of e) n(t, []);
350
350
  return t;
351
351
  }
352
- function Qe(e, t) {
352
+ function tt(e, t) {
353
353
  let n = 0;
354
354
  for (; n < e.length && n < t.length && e[n] === t[n];) n++;
355
355
  return n;
356
356
  }
357
- function $e(e, t, n) {
357
+ function nt(e, t, n) {
358
358
  let r = t, i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
359
- for (let t of e.subgraphs) a.add(t.id), tt(t, i, a);
360
- let o = nt(e.subgraphs), s = Ze(e.subgraphs), c = (e) => e ? s.get(e) ?? [] : [], l = /* @__PURE__ */ new Map();
359
+ for (let t of e.subgraphs) a.add(t.id), it(t, i, a);
360
+ let o = at(e.subgraphs), s = et(e.subgraphs), c = (e) => e ? s.get(e) ?? [] : [], l = /* @__PURE__ */ new Map();
361
361
  l.set(null, []);
362
362
  let u = [];
363
363
  for (let t = 0; t < e.edges.length; t++) {
@@ -378,20 +378,20 @@ function $e(e, t, n) {
378
378
  tgtChain: c(i)
379
379
  });
380
380
  }
381
- let d = Je(e.subgraphs), f = [], p = [], m = {
382
- ...We({
383
- direction: Ue(e.direction),
381
+ let d = Ze(e.subgraphs), f = [], p = [], m = {
382
+ ...qe({
383
+ direction: Ke(e.direction),
384
384
  nodeSpacing: r.nodeSpacing,
385
385
  layerSpacing: r.layerSpacing,
386
386
  padding: r.padding
387
387
  }),
388
- "elk.layered.thoroughness": String(V.thoroughness),
388
+ "elk.layered.thoroughness": String(B.thoroughness),
389
389
  "elk.layered.highDegreeNodes.treatment": "true",
390
390
  "elk.layered.highDegreeNodes.threshold": "8",
391
391
  "elk.layered.compaction.postCompaction.strategy": "LEFT_RIGHT_CONSTRAINT_LOCKING",
392
392
  "elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
393
393
  ...n?.forceNodeOrder ? { "elk.layered.crossingMinimization.forceNodeModelOrder": "true" } : {},
394
- ...Re(e) ? Le : {},
394
+ ...Ve(e) ? Be : {},
395
395
  "elk.layered.wrapping.strategy": "OFF",
396
396
  "elk.hierarchyHandling": d ? "SEPARATE" : "INCLUDE_CHILDREN"
397
397
  }, h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
@@ -404,7 +404,7 @@ function $e(e, t, n) {
404
404
  g.set(e, n), n.push(t);
405
405
  }
406
406
  if (d) for (let { index: e, edge: t, srcChain: n, tgtChain: i } of u) {
407
- let a = Qe(n, i), o = t.source;
407
+ let a = tt(n, i), o = t.source;
408
408
  if (n.length > a) {
409
409
  for (let r = n.length - 1; r >= a; r--) {
410
410
  let i = n[r], a = `${i}_out_${e}`;
@@ -432,54 +432,54 @@ function $e(e, t, n) {
432
432
  }
433
433
  s = `${i[a]}_in_${e}`;
434
434
  }
435
- v(a > 0 ? n[a - 1] : qe, H({
435
+ v(a > 0 ? n[a - 1] : Xe, Re({
436
436
  id: `e${e}`,
437
437
  source: o,
438
438
  target: s,
439
439
  label: t.label,
440
- labelStyle: Ge(r)
440
+ labelStyle: Je(r)
441
441
  }));
442
442
  }
443
443
  for (let [t, o] of e.nodes) if (!i.has(t) && !a.has(t)) {
444
- let i = Ke(t, o.label, o.shape, r.fontSizes.nodeLabel), a = n?.fixedWidths?.get(t);
444
+ let i = Ye(t, o.label, o.shape, r.fontSizes.nodeLabel), a = n?.fixedWidths?.get(t);
445
445
  a !== void 0 && (i.width = a);
446
- let s = Ne(t, i, o.label), c = Re(e) ? Ie[o.shape] : void 0;
446
+ let s = Fe(t, i, o.label), c = Ve(e) ? ze[o.shape] : void 0;
447
447
  c !== void 0 && (s.layoutOptions = { "elk.layered.layering.layerConstraint": c }), f.push(s);
448
448
  }
449
- let y = Re(e), b = f.length, x = y ? e.subgraphs : [...e.subgraphs].reverse();
450
- for (let t of x) f.push(et(t, e, r, l, h, g, e.direction));
449
+ let y = Ve(e), b = f.length, x = y ? e.subgraphs : [...e.subgraphs].reverse();
450
+ for (let t of x) f.push(rt(t, e, r, l, h, g, e.direction));
451
451
  if (y && e.subgraphs.length > 0) {
452
452
  let t = f.map((t, n) => {
453
- if (n < b) return He(e, /* @__PURE__ */ new Set([t.id]));
454
- let r = e.subgraphs[n - b], i = He(e, /* @__PURE__ */ new Set([r.id]));
453
+ if (n < b) return Ge(e, /* @__PURE__ */ new Set([t.id]));
454
+ let r = e.subgraphs[n - b], i = Ge(e, /* @__PURE__ */ new Set([r.id]));
455
455
  if (i !== Infinity) return i;
456
456
  let a = /* @__PURE__ */ new Set();
457
- return Ye(r, a), He(e, a);
457
+ return Qe(r, a), Ge(e, a);
458
458
  }), n = f.map((e, t) => t).sort((e, n) => t[e] - t[n] || e - n).map((e) => f[e]);
459
459
  f.splice(0, f.length, ...n);
460
460
  }
461
- let S = Ve(e, n);
461
+ let S = We(e, n);
462
462
  for (let { index: e, edge: t } of l.get(null)) {
463
463
  if (t.source === t.target || n?.detachedEdges?.has(e)) continue;
464
- let i = H({
464
+ let i = Re({
465
465
  id: `e${e}`,
466
466
  source: S.has(e) ? t.target : t.source,
467
467
  target: S.has(e) ? t.source : t.target,
468
468
  label: t.label,
469
- labelStyle: Ge(r)
469
+ labelStyle: Je(r)
470
470
  });
471
471
  n?.looseEdges?.has(e) && (i.layoutOptions = {
472
472
  ...i.layoutOptions,
473
473
  "elk.layered.priority.straightness": "0"
474
474
  }), p.push(i);
475
475
  }
476
- if (d) for (let e of g.get(qe) ?? []) p.push(e);
477
- else for (let { index: e, edge: t } of u) p.push(H({
476
+ if (d) for (let e of g.get(Xe) ?? []) p.push(e);
477
+ else for (let { index: e, edge: t } of u) p.push(Re({
478
478
  id: `e${e}`,
479
479
  source: S.has(e) ? t.target : t.source,
480
480
  target: S.has(e) ? t.source : t.target,
481
481
  label: t.label,
482
- labelStyle: Ge(r)
482
+ labelStyle: Je(r)
483
483
  }));
484
484
  return {
485
485
  id: "root",
@@ -488,30 +488,30 @@ function $e(e, t, n) {
488
488
  edges: p
489
489
  };
490
490
  }
491
- function et(e, t, n, r, i, a, o) {
492
- let s = e.direction !== void 0 && Xe(e, t) ? e.direction : o, c = We({
493
- direction: Ue(s),
491
+ function rt(e, t, n, r, i, a, o) {
492
+ let s = e.direction !== void 0 && $e(e, t) ? e.direction : o, c = qe({
493
+ direction: Ke(s),
494
494
  nodeSpacing: n.nodeSpacing,
495
495
  layerSpacing: n.layerSpacing,
496
- padding: ze
496
+ padding: He
497
497
  }), l, u = i.get(e.id);
498
498
  u && u.size > 0 && (l = [...u].map((e) => ({ id: e })));
499
499
  let d = [];
500
500
  for (let r of e.nodeIds) {
501
501
  let e = t.nodes.get(r);
502
502
  if (e) {
503
- let t = Ke(r, e.label, e.shape, n.fontSizes.nodeLabel);
504
- d.push(Ne(r, t, e.label));
503
+ let t = Ye(r, e.label, e.shape, n.fontSizes.nodeLabel);
504
+ d.push(Fe(r, t, e.label));
505
505
  }
506
506
  }
507
- for (let o of [...e.children].reverse()) d.push(et(o, t, n, r, i, a, s));
508
- let f = [], p = r.get(e.id) ?? [], m = Ve(t);
509
- for (let { index: e, edge: t } of p) t.source !== t.target && f.push(H({
507
+ for (let o of [...e.children].reverse()) d.push(rt(o, t, n, r, i, a, s));
508
+ let f = [], p = r.get(e.id) ?? [], m = We(t);
509
+ for (let { index: e, edge: t } of p) t.source !== t.target && f.push(Re({
510
510
  id: `e${e}`,
511
511
  source: m.has(e) ? t.target : t.source,
512
512
  target: m.has(e) ? t.source : t.target,
513
513
  label: t.label,
514
- labelStyle: Ge(n)
514
+ labelStyle: Je(n)
515
515
  }));
516
516
  for (let t of a.get(e.id) ?? []) f.push(t);
517
517
  return {
@@ -523,11 +523,11 @@ function et(e, t, n, r, i, a, o) {
523
523
  edges: f
524
524
  };
525
525
  }
526
- function tt(e, t, n) {
526
+ function it(e, t, n) {
527
527
  for (let n of e.nodeIds) t.add(n);
528
- for (let r of e.children) n.add(r.id), tt(r, t, n);
528
+ for (let r of e.children) n.add(r.id), it(r, t, n);
529
529
  }
530
- function nt(e) {
530
+ function at(e) {
531
531
  let t = /* @__PURE__ */ new Map();
532
532
  function n(e) {
533
533
  for (let n of e.nodeIds) t.set(n, e.id);
@@ -538,19 +538,19 @@ function nt(e) {
538
538
  }
539
539
  //#endregion
540
540
  //#region packages/svg-renderer/src/shape-clipping.ts
541
- function rt(e, t, n) {
541
+ function ot(e, t, n) {
542
542
  if (e.length < 2 || t.shape === "rectangle" || t.shape === "rounded" || t.shape === "stadium") return e;
543
543
  let r = [...e];
544
544
  if (t.shape === "diamond") {
545
- if (n) r[0] = it(e[0], e[1], t);
545
+ if (n) r[0] = st(e[0], e[1], t);
546
546
  else {
547
547
  let n = e.length - 1;
548
- r[n] = it(e[n], e[n - 1], t);
548
+ r[n] = st(e[n], e[n - 1], t);
549
549
  }
550
550
  }
551
551
  return r;
552
552
  }
553
- function it(e, t, n) {
553
+ function st(e, t, n) {
554
554
  let r = n.x + n.width / 2, i = n.y + n.height / 2, a = {
555
555
  x: r,
556
556
  y: n.y
@@ -566,14 +566,14 @@ function it(e, t, n) {
566
566
  }, l = e.x - t.x, u = e.y - t.y;
567
567
  if (Math.abs(l) < Math.abs(u)) {
568
568
  let t = e.x;
569
- return u > 0 ? t <= r ? ot(t, c, a) ?? a : ot(t, a, o) ?? a : t <= r ? ot(t, s, c) ?? s : ot(t, o, s) ?? s;
569
+ return u > 0 ? t <= r ? lt(t, c, a) ?? a : lt(t, a, o) ?? a : t <= r ? lt(t, s, c) ?? s : lt(t, o, s) ?? s;
570
570
  }
571
571
  {
572
572
  let t = e.y;
573
- return l > 0 ? t <= i ? at(t, a, c) ?? c : at(t, c, s) ?? c : t <= i ? at(t, a, o) ?? o : at(t, o, s) ?? o;
573
+ return l > 0 ? t <= i ? ct(t, a, c) ?? c : ct(t, c, s) ?? c : t <= i ? ct(t, a, o) ?? o : ct(t, o, s) ?? o;
574
574
  }
575
575
  }
576
- function at(e, t, n) {
576
+ function ct(e, t, n) {
577
577
  let r = n.y - t.y;
578
578
  if (Math.abs(r) < .001) return null;
579
579
  let i = (e - t.y) / r;
@@ -582,7 +582,7 @@ function at(e, t, n) {
582
582
  y: e
583
583
  };
584
584
  }
585
- function ot(e, t, n) {
585
+ function lt(e, t, n) {
586
586
  let r = n.x - t.x;
587
587
  if (Math.abs(r) < .001) return null;
588
588
  let i = (e - t.x) / r;
@@ -593,11 +593,11 @@ function ot(e, t, n) {
593
593
  }
594
594
  //#endregion
595
595
  //#region packages/svg-renderer/src/layout-engine/layer-alignment.ts
596
- function st(e, t, n) {
596
+ function ut(e, t, n) {
597
597
  if (e.length === 0) return;
598
598
  let r = n === "LR" || n === "RL", i = /* @__PURE__ */ new Set();
599
599
  for (let e of t) i.add(`${e.source}:${e.target}`), i.add(`${e.target}:${e.source}`);
600
- let a = V.layerSpacing * .6, o = [...e].sort((e, t) => r ? e.x - t.x : e.y - t.y), s = [], c = [o[0]];
600
+ let a = B.layerSpacing * .6, o = [...e].sort((e, t) => r ? e.x - t.x : e.y - t.y), s = [], c = [o[0]];
601
601
  for (let e = 1; e < o.length; e++) {
602
602
  let t = (r ? o[e].x : o[e].y) - (r ? o[e - 1].x : o[e - 1].y), n = c.some((t) => i.has(`${t.id}:${o[e].id}`));
603
603
  t <= a && !n ? c.push(o[e]) : (s.push(c), c = [o[e]]);
@@ -637,37 +637,37 @@ function st(e, t, n) {
637
637
  }
638
638
  //#endregion
639
639
  //#region packages/svg-renderer/src/layout-engine/edge-bundling.ts
640
- var ct = .5;
641
- function lt(e, t, n) {
640
+ var dt = .5;
641
+ function ft(e, t, n) {
642
642
  for (let r = 0; r < e.length - 1; r++) {
643
643
  let i = e[r], a = e[r + 1], o = Math.min(i.x, a.x), s = Math.max(i.x, a.x), c = Math.min(i.y, a.y), l = Math.max(i.y, a.y);
644
644
  for (let e of t) {
645
645
  if (n.has(e.id)) continue;
646
- let t = e.x + ct, r = e.x + e.width - ct, i = e.y + ct, a = e.y + e.height - ct;
646
+ let t = e.x + dt, r = e.x + e.width - dt, i = e.y + dt, a = e.y + e.height - dt;
647
647
  if (!(t >= r || i >= a) && o < r && s > t && c < a && l > i) return !1;
648
648
  }
649
649
  }
650
650
  return !0;
651
651
  }
652
- function ut(e, t, n) {
652
+ function pt(e, t, n) {
653
653
  let r = [];
654
- for (let i of n) e >= i.x && e <= i.x + i.width && t >= i.y && t <= i.y + i.height && (r.push(i), r.push(...ut(e, t, i.children)));
654
+ for (let i of n) e >= i.x && e <= i.x + i.width && t >= i.y && t <= i.y + i.height && (r.push(i), r.push(...pt(e, t, i.children)));
655
655
  return r;
656
656
  }
657
- function dt(e, t, n, r, i) {
658
- let a = i === "LR", o = i === "RL", s = i === "BT", c = a || o, l = new Set(ut(t, n, r).map((e) => e.id)), u = ut(c ? e : t, c ? n : e, r).find((e) => !l.has(e.id));
657
+ function mt(e, t, n, r, i) {
658
+ let a = i === "LR", o = i === "RL", s = i === "BT", c = a || o, l = new Set(pt(t, n, r).map((e) => e.id)), u = pt(c ? e : t, c ? n : e, r).find((e) => !l.has(e.id));
659
659
  return u ? a ? u.x - 12 : o ? u.x + u.width + 12 : s ? u.y + u.height + 12 : u.y - 12 : e;
660
660
  }
661
- var ft = 2;
662
- function pt(e, t, n, r, i) {
661
+ var ht = 2;
662
+ function gt(e, t, n, r, i) {
663
663
  for (let a of e) {
664
664
  if (t.has(a) || a.source === a.target) continue;
665
665
  let e = a.source === n ? a.points[0] : a.target === n ? a.points[a.points.length - 1] : void 0;
666
- if (e && Math.abs((i ? e.x : e.y) - r) <= ft) return !0;
666
+ if (e && Math.abs((i ? e.x : e.y) - r) <= ht) return !0;
667
667
  }
668
668
  return !1;
669
669
  }
670
- function mt(e, t, n, r) {
670
+ function _t(e, t, n, r) {
671
671
  let i = new Map(t.map((e) => [e.id, e])), a = /* @__PURE__ */ new Set(), o = r === "LR", s = r === "RL", c = r === "BT", l = o || s, u = /* @__PURE__ */ new Map();
672
672
  for (let t of e) {
673
673
  if (t.source === t.target) continue;
@@ -692,9 +692,9 @@ function mt(e, t, n, r) {
692
692
  let h = p.x + p.width / 2, g = p.y + p.height / 2;
693
693
  if (l) {
694
694
  let i = o ? p.x + p.width : p.x, s = g;
695
- if (pt(e, new Set(m.map((e) => e.edge)), d, i, !0)) continue;
695
+ if (gt(e, new Set(m.map((e) => e.edge)), d, i, !0)) continue;
696
696
  let c = i + ((o ? Math.min(...m.map((e) => e.node.x)) : Math.max(...m.map((e) => e.node.x + e.node.width))) - i) / 2;
697
- c = dt(c, h, g, n, r);
697
+ c = mt(c, h, g, n, r);
698
698
  let l = [];
699
699
  for (let { edge: e, node: n } of m) {
700
700
  let r = o ? n.x : n.x + n.width, a = n.y + n.height / 2, u = [
@@ -715,7 +715,7 @@ function mt(e, t, n, r) {
715
715
  y: a
716
716
  }
717
717
  ];
718
- lt(u, t, /* @__PURE__ */ new Set([d, n.id])) && l.push({
718
+ ft(u, t, /* @__PURE__ */ new Set([d, n.id])) && l.push({
719
719
  edge: e,
720
720
  points: u
721
721
  });
@@ -724,9 +724,9 @@ function mt(e, t, n, r) {
724
724
  for (let { edge: e, points: t } of l) e.points = t, a.add(e);
725
725
  } else {
726
726
  let i = h, o = c ? p.y : p.y + p.height;
727
- if (pt(e, new Set(m.map((e) => e.edge)), d, o, !1)) continue;
727
+ if (gt(e, new Set(m.map((e) => e.edge)), d, o, !1)) continue;
728
728
  let s = o + ((c ? Math.max(...m.map((e) => e.node.y + e.node.height)) : Math.min(...m.map((e) => e.node.y))) - o) / 2;
729
- s = dt(s, h, g, n, r);
729
+ s = mt(s, h, g, n, r);
730
730
  let l = [];
731
731
  for (let { edge: e, node: n } of m) {
732
732
  let r = n.x + n.width / 2, a = c ? n.y + n.height : n.y, u = [
@@ -747,7 +747,7 @@ function mt(e, t, n, r) {
747
747
  y: a
748
748
  }
749
749
  ];
750
- lt(u, t, /* @__PURE__ */ new Set([d, n.id])) && l.push({
750
+ ft(u, t, /* @__PURE__ */ new Set([d, n.id])) && l.push({
751
751
  edge: e,
752
752
  points: u
753
753
  });
@@ -780,9 +780,9 @@ function mt(e, t, n, r) {
780
780
  let m = f.x + f.width / 2, h = f.y + f.height / 2;
781
781
  if (l) {
782
782
  let i = o ? f.x : f.x + f.width, s = h;
783
- if (pt(e, new Set(p.map((e) => e.edge)), a, i, !0)) continue;
783
+ if (gt(e, new Set(p.map((e) => e.edge)), a, i, !0)) continue;
784
784
  let c = o ? Math.max(...p.map((e) => e.node.x + e.node.width)) : Math.min(...p.map((e) => e.node.x)), l = c + (i - c) / 2;
785
- l = dt(l, m, h, n, r);
785
+ l = mt(l, m, h, n, r);
786
786
  let u = [];
787
787
  for (let { edge: e, node: n } of p) {
788
788
  let r = o ? n.x + n.width : n.x, c = n.y + n.height / 2, d = [
@@ -803,7 +803,7 @@ function mt(e, t, n, r) {
803
803
  y: s
804
804
  }
805
805
  ];
806
- lt(d, t, /* @__PURE__ */ new Set([n.id, a])) && u.push({
806
+ ft(d, t, /* @__PURE__ */ new Set([n.id, a])) && u.push({
807
807
  edge: e,
808
808
  points: d
809
809
  });
@@ -812,9 +812,9 @@ function mt(e, t, n, r) {
812
812
  for (let { edge: e, points: t } of u) e.points = t;
813
813
  } else {
814
814
  let i = m, o = c ? f.y + f.height : f.y;
815
- if (pt(e, new Set(p.map((e) => e.edge)), a, o, !1)) continue;
815
+ if (gt(e, new Set(p.map((e) => e.edge)), a, o, !1)) continue;
816
816
  let s = c ? Math.min(...p.map((e) => e.node.y)) : Math.max(...p.map((e) => e.node.y + e.node.height)), l = s + (o - s) / 2;
817
- l = dt(l, m, h, n, r);
817
+ l = mt(l, m, h, n, r);
818
818
  let u = [];
819
819
  for (let { edge: e, node: n } of p) {
820
820
  let r = n.x + n.width / 2, s = [
@@ -835,7 +835,7 @@ function mt(e, t, n, r) {
835
835
  y: o
836
836
  }
837
837
  ];
838
- lt(s, t, /* @__PURE__ */ new Set([n.id, a])) && u.push({
838
+ ft(s, t, /* @__PURE__ */ new Set([n.id, a])) && u.push({
839
839
  edge: e,
840
840
  points: s
841
841
  });
@@ -847,7 +847,7 @@ function mt(e, t, n, r) {
847
847
  }
848
848
  //#endregion
849
849
  //#region packages/svg-renderer/src/layout-engine/elk-adapter-utils.ts
850
- function ht(e, t = 0, n = 0) {
850
+ function vt(e, t = 0, n = 0) {
851
851
  let r = [];
852
852
  if (!e.sections || e.sections.length === 0) return r;
853
853
  let i = e.sections[0];
@@ -863,7 +863,7 @@ function ht(e, t = 0, n = 0) {
863
863
  y: i.endPoint.y + n
864
864
  }), r;
865
865
  }
866
- function gt(e, t = 0, n = 0) {
866
+ function yt(e, t = 0, n = 0) {
867
867
  if (!e.labels || e.labels.length === 0) return;
868
868
  let r = e.labels[0];
869
869
  if (r.x != null && r.y != null) return {
@@ -873,11 +873,11 @@ function gt(e, t = 0, n = 0) {
873
873
  }
874
874
  //#endregion
875
875
  //#region packages/svg-renderer/src/layout-engine/from-elk.ts
876
- var _t = 16, vt = 28, yt = 18, bt = 28, xt = 10;
877
- function St(e, t) {
878
- let n = e.x + e.width, r = e.y + e.height / 2, i = Math.min(bt, e.height * .6) / 2, a = vt + t * yt, o = [];
879
- for (let e = 0; e <= _t; e++) {
880
- let t = Math.PI * e / _t;
876
+ var bt = 16, xt = 28, St = 18, Ct = 28, wt = 10;
877
+ function Tt(e, t) {
878
+ let n = e.x + e.width, r = e.y + e.height / 2, i = Math.min(Ct, e.height * .6) / 2, a = xt + t * St, o = [];
879
+ for (let e = 0; e <= bt; e++) {
880
+ let t = Math.PI * e / bt;
881
881
  o.push({
882
882
  x: n + a * Math.sin(t),
883
883
  y: r - i * Math.cos(t)
@@ -886,12 +886,12 @@ function St(e, t) {
886
886
  return {
887
887
  points: o,
888
888
  labelPosition: {
889
- x: n + a + xt,
889
+ x: n + a + wt,
890
890
  y: r
891
891
  }
892
892
  };
893
893
  }
894
- function Ct(e, t, n) {
894
+ function Et(e, t, n) {
895
895
  let r = /* @__PURE__ */ new Map();
896
896
  for (let i = 0; i < e.edges.length; i++) {
897
897
  let a = e.edges[i];
@@ -900,7 +900,7 @@ function Ct(e, t, n) {
900
900
  if (!o) continue;
901
901
  let s = r.get(o.id) ?? 0;
902
902
  r.set(o.id, s + 1);
903
- let { points: c, labelPosition: l } = St(o, s);
903
+ let { points: c, labelPosition: l } = Tt(o, s);
904
904
  n.push({
905
905
  source: a.source,
906
906
  target: a.target,
@@ -910,38 +910,38 @@ function Ct(e, t, n) {
910
910
  hasArrowEnd: a.hasArrowEnd,
911
911
  points: c,
912
912
  labelPosition: a.label ? l : void 0,
913
- inlineStyle: Ft(i, e),
913
+ inlineStyle: Rt(i, e),
914
914
  id: a.id,
915
915
  animate: a.animate
916
916
  });
917
917
  }
918
918
  }
919
- function wt(e) {
919
+ function Dt(e) {
920
920
  let t = [];
921
921
  for (let n of e) t.push({
922
922
  x: n.x,
923
923
  y: n.y,
924
924
  right: n.x + n.width,
925
925
  bottom: n.y + n.height
926
- }), t.push(...wt(n.children));
926
+ }), t.push(...Dt(n.children));
927
927
  return t;
928
928
  }
929
- function Tt(e, t, n = !1) {
929
+ function Ot(e, t, n = !1) {
930
930
  let r = [], i = [], a = [], o = /* @__PURE__ */ new Set();
931
- for (let e of t.subgraphs) Pt(e, o);
932
- Et(e, t, o, r, a, 0, 0);
933
- let s = wt(a);
934
- kt(e, t, i, 0, 0, s.length > 0 ? {
931
+ for (let e of t.subgraphs) Lt(e, o);
932
+ kt(e, t, o, r, a, 0, 0);
933
+ let s = Dt(a);
934
+ Mt(e, t, i, 0, 0, s.length > 0 ? {
935
935
  leftX: Math.min(...s.map((e) => e.x)) - 20,
936
936
  rightX: Math.max(...s.map((e) => e.right)) + 20
937
- } : void 0), st(r, i, t.direction);
937
+ } : void 0), ut(r, i, t.direction);
938
938
  let c = new Map(r.map((e) => [e.id, e]));
939
- Ct(t, c, i), n && mt(i, r, a, t.direction);
939
+ Et(t, c, i), n && _t(i, r, a, t.direction);
940
940
  for (let e of i) {
941
941
  let t = c.get(e.source), n = c.get(e.target);
942
- t && (e.points = rt(e.points, t, !0)), n && (e.points = rt(e.points, n, !1));
942
+ t && (e.points = ot(e.points, t, !0)), n && (e.points = ot(e.points, n, !1));
943
943
  }
944
- let l = e.width ?? 800, u = e.height ?? 600, d = B.width, f = V.padding;
944
+ let l = e.width ?? 800, u = e.height ?? 600, d = Oe.width, f = B.padding;
945
945
  for (let e of i) {
946
946
  for (let t of e.points) l = Math.max(l, t.x + d + f), u = Math.max(u, t.y + d + f);
947
947
  e.labelPosition && (l = Math.max(l, e.labelPosition.x + 60 + f), u = Math.max(u, e.labelPosition.y + 20 + f));
@@ -954,13 +954,13 @@ function Tt(e, t, n = !1) {
954
954
  groups: a
955
955
  };
956
956
  }
957
- function Et(e, t, n, r, i, a, o) {
957
+ function kt(e, t, n, r, i, a, o) {
958
958
  if (e.children) for (let s of e.children) {
959
959
  let e = (s.x ?? 0) + a, c = (s.y ?? 0) + o, l = s.width ?? 0, u = s.height ?? 0;
960
960
  if (n.has(s.id)) {
961
961
  let a = [];
962
- Et(s, t, n, r, a, e, c);
963
- let o = Nt(t.subgraphs, s.id);
962
+ kt(s, t, n, r, a, e, c);
963
+ let o = It(t.subgraphs, s.id);
964
964
  i.push({
965
965
  id: s.id,
966
966
  label: o?.label ?? "",
@@ -987,11 +987,11 @@ function Et(e, t, n, r, i, a, o) {
987
987
  interaction: t.interactions.get(s.id)
988
988
  });
989
989
  }
990
- s.children && s.children.length > 0 && Et(s, t, n, r, i, e, c);
990
+ s.children && s.children.length > 0 && kt(s, t, n, r, i, e, c);
991
991
  }
992
992
  }
993
993
  }
994
- function Dt(e) {
994
+ function At(e) {
995
995
  let t = /^e(\d+)$/.exec(e);
996
996
  if (t) return {
997
997
  edgeIndex: parseInt(t[1], 10),
@@ -1004,7 +1004,7 @@ function Dt(e) {
1004
1004
  level: parseInt(n[3], 10)
1005
1005
  };
1006
1006
  }
1007
- function Ot(e) {
1007
+ function jt(e) {
1008
1008
  if (e.length === 0) return {
1009
1009
  x: 0,
1010
1010
  y: 0
@@ -1029,11 +1029,11 @@ function Ot(e) {
1029
1029
  }
1030
1030
  return e[e.length - 1];
1031
1031
  }
1032
- function kt(e, t, n, r, i, a) {
1032
+ function Mt(e, t, n, r, i, a) {
1033
1033
  let o = /* @__PURE__ */ new Map();
1034
- At(e, o, 0, 0);
1034
+ Nt(e, o, 0, 0);
1035
1035
  let s = /* @__PURE__ */ new Map();
1036
- Mt(e, s, 0, 0, o);
1036
+ Ft(e, s, 0, 0, o);
1037
1037
  let c = 0;
1038
1038
  for (let [e, r] of s) {
1039
1039
  let i = t.edges[e];
@@ -1046,24 +1046,24 @@ function kt(e, t, n, r, i, a) {
1046
1046
  let u = [...r.targetHops.keys()].sort((e, t) => e - t);
1047
1047
  for (let e of u) s(r.targetHops.get(e));
1048
1048
  let d;
1049
- i.label && o.length >= 2 && (d = r.bridge?.labelPosition ?? Ot(o));
1050
- let f = jt(o, a, c);
1051
- f !== o && c++, i.label && f !== o && f.length >= 2 && (d = Ot(f)), n.push({
1049
+ i.label && o.length >= 2 && (d = r.bridge?.labelPosition ?? jt(o));
1050
+ let f = Pt(o, a, c);
1051
+ f !== o && c++, i.label && f !== o && f.length >= 2 && (d = jt(f)), n.push({
1052
1052
  source: i.source,
1053
1053
  target: i.target,
1054
1054
  label: i.label,
1055
1055
  style: i.style,
1056
1056
  hasArrowStart: i.hasArrowStart,
1057
1057
  hasArrowEnd: i.hasArrowEnd,
1058
- points: Ve(t).has(e) ? [...f].reverse() : f,
1058
+ points: We(t).has(e) ? [...f].reverse() : f,
1059
1059
  labelPosition: d,
1060
- inlineStyle: Ft(e, t),
1060
+ inlineStyle: Rt(e, t),
1061
1061
  id: i.id,
1062
1062
  animate: i.animate
1063
1063
  });
1064
1064
  }
1065
1065
  }
1066
- function At(e, t, n, r) {
1066
+ function Nt(e, t, n, r) {
1067
1067
  t.set(e.id, {
1068
1068
  x: n,
1069
1069
  y: r
@@ -1071,10 +1071,10 @@ function At(e, t, n, r) {
1071
1071
  for (let i of e.children ?? []) {
1072
1072
  /* v8 ignore next */
1073
1073
  let e = i.x ?? 0, a = i.y ?? 0;
1074
- At(i, t, n + e, r + a);
1074
+ Nt(i, t, n + e, r + a);
1075
1075
  }
1076
1076
  }
1077
- function jt(e, t, n = 0) {
1077
+ function Pt(e, t, n = 0) {
1078
1078
  if (e.length < 2) return e;
1079
1079
  let r = !1;
1080
1080
  for (let t = 1; t < e.length; t++) {
@@ -1113,11 +1113,11 @@ function jt(e, t, n = 0) {
1113
1113
  }
1114
1114
  return i;
1115
1115
  }
1116
- function Mt(e, t, n, r, i) {
1116
+ function Ft(e, t, n, r, i) {
1117
1117
  if (e.edges) for (let a of e.edges) {
1118
- let e = Dt(a.id);
1118
+ let e = At(a.id);
1119
1119
  if (!e) continue;
1120
- let { edgeIndex: o } = e, s = a.container, c = s ? i.get(s) : void 0, l = c?.x ?? n, u = c?.y ?? r, d = ht(a, l, u), f = gt(a, l, u), p = t.get(o) ?? {
1120
+ let { edgeIndex: o } = e, s = a.container, c = s ? i.get(s) : void 0, l = c?.x ?? n, u = c?.y ?? r, d = vt(a, l, u), f = yt(a, l, u), p = t.get(o) ?? {
1121
1121
  sourceHops: /* @__PURE__ */ new Map(),
1122
1122
  targetHops: /* @__PURE__ */ new Map()
1123
1123
  };
@@ -1129,20 +1129,20 @@ function Mt(e, t, n, r, i) {
1129
1129
  };
1130
1130
  e.role === "bridge" ? p.bridge = m : e.role === "source" ? p.sourceHops.set(e.level, m) : p.targetHops.set(e.level, m);
1131
1131
  }
1132
- if (e.children) for (let a of e.children) Mt(a, t, n + (a.x ?? 0), r + (a.y ?? 0), i);
1132
+ if (e.children) for (let a of e.children) Ft(a, t, n + (a.x ?? 0), r + (a.y ?? 0), i);
1133
1133
  }
1134
- function Nt(e, t) {
1134
+ function It(e, t) {
1135
1135
  for (let n of e) {
1136
1136
  if (n.id === t) return n;
1137
- let e = Nt(n.children, t);
1137
+ let e = It(n.children, t);
1138
1138
  if (e) return e;
1139
1139
  }
1140
1140
  }
1141
- function Pt(e, t) {
1141
+ function Lt(e, t) {
1142
1142
  t.add(e.id);
1143
- for (let n of e.children) Pt(n, t);
1143
+ for (let n of e.children) Lt(n, t);
1144
1144
  }
1145
- function Ft(e, t) {
1145
+ function Rt(e, t) {
1146
1146
  let n, r = t.linkStyles.get("default");
1147
1147
  r && (n = { ...r });
1148
1148
  let i = t.linkStyles.get(e);
@@ -1153,12 +1153,12 @@ function Ft(e, t) {
1153
1153
  }
1154
1154
  //#endregion
1155
1155
  //#region packages/svg-renderer/src/layout-engine/inner-edges.ts
1156
- var It = 10, Lt = 14, Rt = 14, zt = 10, Bt = 24, Vt = 400, Ht = /* @__PURE__ */ new Set([
1156
+ var zt = 10, Bt = 14, Vt = 14, Ht = 10, Ut = 24, Wt = 400, Gt = /* @__PURE__ */ new Set([
1157
1157
  "rectangle",
1158
1158
  "rounded",
1159
1159
  "subroutine"
1160
1160
  ]);
1161
- function Ut(e) {
1161
+ function Kt(e) {
1162
1162
  let t = e === "TD" || e === "TB" || e === "BT", n = e === "BT" || e === "RL" ? -1 : 1;
1163
1163
  return {
1164
1164
  span: (e) => {
@@ -1179,17 +1179,17 @@ function Ut(e) {
1179
1179
  }
1180
1180
  };
1181
1181
  }
1182
- function Wt(e, t, n) {
1182
+ function qt(e, t, n) {
1183
1183
  let r = Math.min(e.a, t.a), i = Math.max(e.a, t.a), a = Math.min(e.c, t.c), o = Math.max(e.c, t.c);
1184
1184
  return i > n.a0 && r < n.a1 && o > n.c0 && a < n.c1;
1185
1185
  }
1186
- var Gt = (e, t) => ({
1186
+ var Jt = (e, t) => ({
1187
1187
  a0: e.a0 - t,
1188
1188
  a1: e.a1 + t,
1189
1189
  c0: e.c0 - t,
1190
1190
  c1: e.c1 + t
1191
1191
  });
1192
- function Kt(e, t) {
1192
+ function Yt(e, t) {
1193
1193
  let n = e.span({
1194
1194
  x: t.x,
1195
1195
  y: t.y,
@@ -1201,23 +1201,23 @@ function Kt(e, t) {
1201
1201
  c: n.c0
1202
1202
  };
1203
1203
  }
1204
- function qt(e, t, n) {
1204
+ function Xt(e, t, n) {
1205
1205
  let r = e.c === t.c;
1206
1206
  for (let i = 1; i < n.length; i++) {
1207
1207
  let a = n[i - 1], o = n[i];
1208
1208
  if (a.c === o.c === r) {
1209
1209
  if (r) {
1210
1210
  let n = Math.abs(e.c - a.c), r = Math.min(Math.max(e.a, t.a), Math.max(a.a, o.a)) - Math.max(Math.min(e.a, t.a), Math.min(a.a, o.a));
1211
- if (n < Lt && r > 0) return !0;
1211
+ if (n < Bt && r > 0) return !0;
1212
1212
  } else {
1213
1213
  let n = Math.abs(e.a - a.a), r = Math.min(Math.max(e.c, t.c), Math.max(a.c, o.c)) - Math.max(Math.min(e.c, t.c), Math.min(a.c, o.c));
1214
- if (n < Lt && r > 0) return !0;
1214
+ if (n < Bt && r > 0) return !0;
1215
1215
  }
1216
1216
  }
1217
1217
  }
1218
1218
  return !1;
1219
1219
  }
1220
- function Jt(e) {
1220
+ function Zt(e) {
1221
1221
  let t = [];
1222
1222
  for (let n of e) {
1223
1223
  let e = t[t.length - 1];
@@ -1229,24 +1229,24 @@ function Jt(e) {
1229
1229
  }
1230
1230
  return t;
1231
1231
  }
1232
- var Yt = (e) => {
1232
+ var Qt = (e) => {
1233
1233
  let t = 0;
1234
1234
  for (let n = 1; n < e.length; n++) t += Math.abs(e[n].a - e[n - 1].a) + Math.abs(e[n].c - e[n - 1].c);
1235
1235
  return t;
1236
1236
  };
1237
- function Xt(e, t, n, r, i, a = []) {
1238
- let o = Ut(i), s = o.span(e), c = o.span(t), l = s.a1 <= c.a0, u = c.a1 <= s.a0;
1237
+ function $t(e, t, n, r, i, a = []) {
1238
+ let o = Kt(i), s = o.span(e), c = o.span(t), l = s.a1 <= c.a0, u = c.a1 <= s.a0;
1239
1239
  if (!l && !u) return;
1240
1240
  let d = o.span(r), f = {
1241
- a0: d.a0 + zt,
1242
- a1: d.a1 - zt,
1243
- c0: d.c0 + zt,
1244
- c1: d.c1 - zt
1245
- }, p = a.map((e) => e.map((e) => Kt(o, e))), m = n.map((e) => Gt(o.span(e), It)), h = (e) => (e.c0 + e.c1) / 2, g = (e) => (e.a0 + e.a1) / 2, _ = (e) => Ht.has(e.shape), v = (e) => {
1241
+ a0: d.a0 + Ht,
1242
+ a1: d.a1 - Ht,
1243
+ c0: d.c0 + Ht,
1244
+ c1: d.c1 - Ht
1245
+ }, p = a.map((e) => e.map((e) => Yt(o, e))), m = n.map((e) => Jt(o.span(e), zt)), h = (e) => (e.c0 + e.c1) / 2, g = (e) => (e.a0 + e.a1) / 2, _ = (e) => Gt.has(e.shape), v = (e) => {
1246
1246
  for (let t of e) if (t.a < f.a0 || t.a > f.a1 || t.c < f.c0 || t.c > f.c1) return !1;
1247
1247
  for (let t = 1; t < e.length; t++) {
1248
1248
  let n = e[t - 1], r = e[t];
1249
- if (n.a !== r.a && n.c !== r.c || m.some((e) => Wt(n, r, e)) || Wt(n, r, s) || Wt(n, r, c) || p.some((e) => qt(n, r, e))) return !1;
1249
+ if (n.a !== r.a && n.c !== r.c || m.some((e) => qt(n, r, e)) || qt(n, r, s) || qt(n, r, c) || p.some((e) => Xt(n, r, e))) return !1;
1250
1250
  }
1251
1251
  return !0;
1252
1252
  }, y = /* @__PURE__ */ new Set([
@@ -1256,10 +1256,10 @@ function Xt(e, t, n, r, i, a = []) {
1256
1256
  f.c1
1257
1257
  ]);
1258
1258
  for (let e of m) y.add(e.c0 - 1), y.add(e.c1 + 1);
1259
- for (let e of [s, c]) y.add(e.c0 - It), y.add(e.c1 + It);
1259
+ for (let e of [s, c]) y.add(e.c0 - zt), y.add(e.c1 + zt);
1260
1260
  let b = (e, t, n) => _(e) ? n >= t.c0 + 4 && n <= t.c1 - 4 : Math.abs(n - h(t)) < .5, x = [];
1261
1261
  if (l) {
1262
- let n = (c.a0 - s.a1) / 2, r = s.a1 + Math.min(Rt, n), i = c.a0 - Math.min(Rt, n);
1262
+ let n = (c.a0 - s.a1) / 2, r = s.a1 + Math.min(Vt, n), i = c.a0 - Math.min(Vt, n);
1263
1263
  for (let n of y) {
1264
1264
  b(e, s, n) && b(t, c, n) && x.push([{
1265
1265
  a: s.a1,
@@ -1398,14 +1398,14 @@ function Xt(e, t, n, r, i, a = []) {
1398
1398
  }
1399
1399
  let S, C = Infinity;
1400
1400
  for (let t of x) {
1401
- let n = Jt(t);
1401
+ let n = Zt(t);
1402
1402
  if (n.length < 2 || !v(n)) continue;
1403
- let r = e.shape === "diamond" && n[0].a === s.a1 ? Vt : 0, i = Yt(n) + Bt * (n.length - 2) + r;
1403
+ let r = e.shape === "diamond" && n[0].a === s.a1 ? Wt : 0, i = Qt(n) + Ut * (n.length - 2) + r;
1404
1404
  i < C && (S = n, C = i);
1405
1405
  }
1406
1406
  return S?.map(o.toPoint);
1407
1407
  }
1408
- function Zt(e) {
1408
+ function en(e) {
1409
1409
  let t = {
1410
1410
  x: e[0].x,
1411
1411
  y: e[0].y
@@ -1421,24 +1421,24 @@ function Zt(e) {
1421
1421
  }
1422
1422
  //#endregion
1423
1423
  //#region packages/svg-renderer/src/layout-engine/compound-flat.ts
1424
- var Qt = "__zm_spine__", $t = 8, en = 6, tn = 12, nn = 4, rn = 4, an = .25, on = .02, sn = 40, cn = (e) => e === "TD" || e === "TB" || e === "BT", ln = (e) => e.startsWith(Qt);
1425
- function un(e) {
1426
- return e.flatMap((e) => [e, ...un(e.children)]);
1424
+ var tn = "__zm_spine__", nn = 8, rn = 6, an = 12, on = 4, sn = 4, cn = .25, ln = .02, un = 40, dn = (e) => e === "TD" || e === "TB" || e === "BT", fn = (e) => e.startsWith(tn);
1425
+ function pn(e) {
1426
+ return e.flatMap((e) => [e, ...pn(e.children)]);
1427
1427
  }
1428
- function U(e) {
1428
+ function V(e) {
1429
1429
  let t = new Set(e.nodeIds);
1430
- for (let n of e.children) for (let e of U(n)) t.add(e);
1430
+ for (let n of e.children) for (let e of V(n)) t.add(e);
1431
1431
  return t;
1432
1432
  }
1433
- function dn(e) {
1434
- if (e.subgraphs.length === 0 || Re(e) || Je(e.subgraphs)) return !1;
1435
- for (let t of e.nodes.keys()) if (ln(t)) return !1;
1433
+ function mn(e) {
1434
+ if (e.subgraphs.length === 0 || Ve(e) || Ze(e.subgraphs)) return !1;
1435
+ for (let t of e.nodes.keys()) if (fn(t)) return !1;
1436
1436
  for (let t of e.edges) if (!e.nodes.has(t.source) || !e.nodes.has(t.target)) return !1;
1437
- let t = un(e.subgraphs);
1438
- return !t.some((t) => e.nodes.has(t.id)) && t.every((t) => [...U(t)].some((t) => e.nodes.has(t)));
1437
+ let t = pn(e.subgraphs);
1438
+ return !t.some((t) => e.nodes.has(t.id)) && t.every((t) => [...V(t)].some((t) => e.nodes.has(t)));
1439
1439
  }
1440
- function fn(e, t) {
1441
- let n = cn(t), r = (e) => n ? [e.y, e.y + e.height] : [e.x, e.x + e.width], i = [...e].sort((e, t) => {
1440
+ function hn(e, t) {
1441
+ let n = dn(t), r = (e) => n ? [e.y, e.y + e.height] : [e.x, e.x + e.width], i = [...e].sort((e, t) => {
1442
1442
  let [n, i] = r(e), [a, o] = r(t);
1443
1443
  return (n + i) / 2 - (a + o) / 2;
1444
1444
  }), a = [];
@@ -1453,20 +1453,20 @@ function fn(e, t) {
1453
1453
  let o = /* @__PURE__ */ new Map();
1454
1454
  return a.forEach((e, t) => e.ids.forEach((e) => o.set(e, t))), o;
1455
1455
  }
1456
- function pn(e, t, n) {
1456
+ function gn(e, t, n) {
1457
1457
  let r = {
1458
1458
  ghosts: [],
1459
1459
  edges: []
1460
1460
  };
1461
1461
  for (let i of e) {
1462
- let e = [...U(i)].filter((e) => t.has(e));
1462
+ let e = [...V(i)].filter((e) => t.has(e));
1463
1463
  if (e.length === 0) continue;
1464
1464
  let a = e.map((e) => t.get(e)), o = Math.min(...a), s = Math.max(...a), c = /* @__PURE__ */ new Map();
1465
1465
  for (let a = o; a <= s; a++) {
1466
1466
  let o = e.filter((e) => t.get(e) === a).sort((e, t) => n(e) - n(t));
1467
1467
  if (o.length > 0) c.set(a, o[0]);
1468
1468
  else {
1469
- let e = `${Qt}${i.id}__${a}`;
1469
+ let e = `${tn}${i.id}__${a}`;
1470
1470
  r.ghosts.push({
1471
1471
  id: e,
1472
1472
  subgraph: i.id
@@ -1475,7 +1475,7 @@ function pn(e, t, n) {
1475
1475
  }
1476
1476
  for (let e = o; e < s; e++) {
1477
1477
  let t = c.get(e), n = c.get(e + 1);
1478
- !ln(t) && !ln(n) || r.edges.push({
1478
+ !fn(t) && !fn(n) || r.edges.push({
1479
1479
  source: t,
1480
1480
  target: n,
1481
1481
  style: "invisible",
@@ -1486,12 +1486,12 @@ function pn(e, t, n) {
1486
1486
  }
1487
1487
  return r;
1488
1488
  }
1489
- function mn(e, t, n, r = () => !1) {
1489
+ function _n(e, t, n, r = () => !1) {
1490
1490
  let i = (e) => {
1491
- let n = [...U(e)].filter((e) => t.has(e)).map((e) => t.get(e));
1491
+ let n = [...V(e)].filter((e) => t.has(e)).map((e) => t.get(e));
1492
1492
  return n.length > 0 ? [Math.min(...n), Math.max(...n)] : void 0;
1493
1493
  }, a = (e) => {
1494
- let t = [...U(e)].filter((e) => n.has(e)).map((e) => n.get(e));
1494
+ let t = [...V(e)].filter((e) => n.has(e)).map((e) => n.get(e));
1495
1495
  return t.reduce((e, t) => e + t, 0) / t.length;
1496
1496
  }, o = e.map((e) => ({
1497
1497
  sg: e,
@@ -1505,21 +1505,21 @@ function mn(e, t, n, r = () => !1) {
1505
1505
  if (t.length < 2 || t.some((e, n) => t.slice(n + 1).some((t) => r(e, t)))) continue;
1506
1506
  let i = [...t].sort((t, n) => e.indexOf(n) - e.indexOf(t)), o = t.map(a).sort((e, t) => e - t), s = i.map((e, t) => o[t] - a(e));
1507
1507
  i.forEach((e, t) => {
1508
- for (let r of U(e)) n.has(r) && n.set(r, n.get(r) + s[t]);
1508
+ for (let r of V(e)) n.has(r) && n.set(r, n.get(r) + s[t]);
1509
1509
  });
1510
1510
  }
1511
- for (let i of e) mn(i.children, t, n, r);
1511
+ for (let i of e) _n(i.children, t, n, r);
1512
1512
  }
1513
- function hn(e, t, n, r, i) {
1513
+ function vn(e, t, n, r, i) {
1514
1514
  let a = new Map(t);
1515
1515
  for (let t of r) {
1516
- let r = U(t);
1516
+ let r = V(t);
1517
1517
  for (let e of i.get(t.id) ?? []) r.add(e);
1518
1518
  let o = [...r].filter((e) => a.has(e)), s = o.filter((e) => n.has(e));
1519
1519
  if (s.length === 0) continue;
1520
1520
  let c = Math.min(...s.map((e) => n.get(e))), l = Math.max(...s.map((e) => n.get(e))), u = o.map((e) => a.get(e)), d = Math.min(...u), f = Math.max(...u), p = (d + f) / 2, m = 0;
1521
1521
  for (let t of e) {
1522
- if (r.has(t) || ln(t)) continue;
1522
+ if (r.has(t) || fn(t)) continue;
1523
1523
  let e = n.get(t);
1524
1524
  if (e === void 0 || e < c || e > l) continue;
1525
1525
  m++;
@@ -1530,13 +1530,13 @@ function hn(e, t, n, r, i) {
1530
1530
  let o = new Map(e.map((e, t) => [e, t]));
1531
1531
  return [...e].sort((e, t) => a.get(e) - a.get(t) || o.get(e) - o.get(t));
1532
1532
  }
1533
- var gn = (e, t) => t >= Math.min(...e) && t <= Math.max(...e);
1534
- function _n(e, t, n) {
1533
+ var yn = (e, t) => t >= Math.min(...e) && t <= Math.max(...e);
1534
+ function bn(e, t, n) {
1535
1535
  let r = (e) => {
1536
- let i = e.children.map(r), a = [...[...U(e)].flatMap((e) => {
1536
+ let i = e.children.map(r), a = [...[...V(e)].flatMap((e) => {
1537
1537
  let n = t.get(e);
1538
1538
  return n ? [n] : [];
1539
- }), ...i], o = Math.min(...a.map((e) => e.x)) - ze.left, s = Math.min(...a.map((e) => e.y)) - ze.top, c = Math.max(...a.map((e) => e.x + e.width)) + ze.right, u = Math.max(...a.map((e) => e.y + e.height)) + ze.bottom, d = l(e.label, n.groupHeader, L.groupHeader).width + 24;
1539
+ }), ...i], o = Math.min(...a.map((e) => e.x)) - He.left, s = Math.min(...a.map((e) => e.y)) - He.top, c = Math.max(...a.map((e) => e.x + e.width)) + He.right, u = Math.max(...a.map((e) => e.y + e.height)) + He.bottom, d = l(e.label, n.groupHeader, L.groupHeader).width + 24;
1540
1540
  return {
1541
1541
  id: e.id,
1542
1542
  label: e.label,
@@ -1549,14 +1549,14 @@ function _n(e, t, n) {
1549
1549
  };
1550
1550
  return e.map(r);
1551
1551
  }
1552
- var vn = (e) => e.flatMap((e) => [e, ...vn(e.children)]);
1553
- function yn(e, t, n, r, i, a) {
1554
- let o = cn(r), s = new Map(un(t).map((e) => [e.id, U(e)])), c = /* @__PURE__ */ new Map(), l = !1, u = [], d = (e) => o ? [e.x, e.x + e.width] : [e.y, e.y + e.height], f = (e) => o ? [e.y, e.y + e.height] : [e.x, e.x + e.width], p = ([e, t], [n, r]) => Math.max(0, Math.min(t, r) - Math.max(e, n)), m = (e) => ({
1555
- x: e.x - sn,
1556
- y: e.y - sn,
1552
+ var xn = (e) => e.flatMap((e) => [e, ...xn(e.children)]);
1553
+ function Sn(e, t, n, r, i, a) {
1554
+ let o = dn(r), s = new Map(pn(t).map((e) => [e.id, V(e)])), c = /* @__PURE__ */ new Map(), l = !1, u = [], d = (e) => o ? [e.x, e.x + e.width] : [e.y, e.y + e.height], f = (e) => o ? [e.y, e.y + e.height] : [e.x, e.x + e.width], p = ([e, t], [n, r]) => Math.max(0, Math.min(t, r) - Math.max(e, n)), m = (e) => ({
1555
+ x: e.x - un,
1556
+ y: e.y - un,
1557
1557
  width: e.width + 80,
1558
1558
  height: e.height + 80
1559
- }), h = (e, t) => p(f(e), f(t)) > 0 ? p(d(e), d(t)) : 0, g = vn(e), _ = new Map(g.map((e) => [e, m(e)])), v = (e, t, n, r) => {
1559
+ }), h = (e, t) => p(f(e), f(t)) > 0 ? p(d(e), d(t)) : 0, g = xn(e), _ = new Map(g.map((e) => [e, m(e)])), v = (e, t, n, r) => {
1560
1560
  let i = p(d(e), d(t)), a = p(f(e), f(t));
1561
1561
  if (i <= 0 || a <= 0) return;
1562
1562
  let s = i <= a, c = s === o, l = (e) => c ? e.x : e.y, m = (e) => c ? e.x + e.width : e.y + e.height, h = (e) => (l(e) + m(e)) / 2, g = h(n) <= h(r) ? n : r;
@@ -1570,7 +1570,7 @@ function yn(e, t, n, r, i, a) {
1570
1570
  let t = s.get(e.id), r = [...t].filter((e) => a.has(e)).map((e) => a.get(e)), o = new Set(r);
1571
1571
  for (let [s, u] of n) {
1572
1572
  if (t.has(s)) continue;
1573
- if (o.has(a.get(s)) || !gn(r, a.get(s))) {
1573
+ if (o.has(a.get(s)) || !yn(r, a.get(s))) {
1574
1574
  v(_.get(e), u, e, u);
1575
1575
  continue;
1576
1576
  }
@@ -1578,7 +1578,7 @@ function yn(e, t, n, r, i, a) {
1578
1578
  n <= 0 || (i.has(e.id) ? c.set(e.id, Math.max(c.get(e.id) ?? 0, n)) : l = !0);
1579
1579
  }
1580
1580
  }
1581
- let y = (e, t) => vn(e.children).includes(t);
1581
+ let y = (e, t) => xn(e.children).includes(t);
1582
1582
  for (let e = 0; e < g.length; e++) for (let t = e + 1; t < g.length; t++) {
1583
1583
  let n = g[e], r = g[t];
1584
1584
  y(n, r) || y(r, n) || v(_.get(n), r, n, r);
@@ -1589,22 +1589,22 @@ function yn(e, t, n, r, i, a) {
1589
1589
  requests: u
1590
1590
  };
1591
1591
  }
1592
- function bn(e, t, n) {
1592
+ function Cn(e, t, n) {
1593
1593
  let r = [...e.nodes.keys()], i = {
1594
1594
  ...e,
1595
1595
  subgraphs: []
1596
- }, a = t(i), o = fn(a.nodes, e.direction), s = cn(e.direction), c = new Map(a.nodes.map((e) => [e.id, e])), l = (e) => {
1596
+ }, a = t(i), o = hn(a.nodes, e.direction), s = dn(e.direction), c = new Map(a.nodes.map((e) => [e.id, e])), l = (e) => {
1597
1597
  let t = c.get(e);
1598
1598
  return s ? t.x : t.y;
1599
- }, u = un(e.subgraphs), d = pn(u, o, l), f = /* @__PURE__ */ new Map();
1599
+ }, u = pn(e.subgraphs), d = gn(u, o, l), f = /* @__PURE__ */ new Map();
1600
1600
  for (let e of d.ghosts) f.set(e.subgraph, [...f.get(e.subgraph) ?? [], e.id]);
1601
1601
  let p = new Map(a.nodes.map((e) => [e.id, l(e.id)]));
1602
- mn(e.subgraphs, o, p, (t, n) => {
1603
- let r = U(t), i = U(n), a = (t, n) => e.edges.some((e) => t.has(e.source) && n.has(e.target));
1602
+ _n(e.subgraphs, o, p, (t, n) => {
1603
+ let r = V(t), i = V(n), a = (t, n) => e.edges.some((e) => t.has(e.source) && n.has(e.target));
1604
1604
  return a(r, i) && a(i, r);
1605
1605
  });
1606
1606
  for (let e of d.ghosts) {
1607
- let t = [...U(u.find((t) => t.id === e.subgraph))].filter((e) => p.has(e)).map((e) => p.get(e));
1607
+ let t = [...V(u.find((t) => t.id === e.subgraph))].filter((e) => p.has(e)).map((e) => p.get(e));
1608
1608
  p.set(e.id, t.reduce((e, t) => e + t, 0) / t.length);
1609
1609
  }
1610
1610
  let m = new Map(e.nodes);
@@ -1613,44 +1613,44 @@ function bn(e, t, n) {
1613
1613
  label: " ",
1614
1614
  shape: "rectangle"
1615
1615
  });
1616
- let h = hn([...m.keys()], p, o, u, f), g = {
1616
+ let h = vn([...m.keys()], p, o, u, f), g = {
1617
1617
  ...i,
1618
1618
  nodes: new Map(h.map((e) => [e, m.get(e)])),
1619
1619
  edges: [...e.edges, ...d.edges]
1620
1620
  }, _ = new Set(d.edges.map((t, n) => e.edges.length + n)), v = (i) => {
1621
1621
  let a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1622
1622
  for (let c = 0;; c++) {
1623
- let l = new Map(d.ghosts.map((e) => [e.id, $t + (a.get(e.subgraph) ?? 0)])), p = t(g, {
1623
+ let l = new Map(d.ghosts.map((e) => [e.id, nn + (a.get(e.subgraph) ?? 0)])), p = t(g, {
1624
1624
  fixedWidths: l,
1625
1625
  looseEdges: _,
1626
1626
  detachedEdges: i,
1627
1627
  walkOrder: r,
1628
1628
  forceNodeOrder: !0
1629
- }), m = new Map(p.nodes.filter((e) => !ln(e.id)).map((e) => [e.id, e])), h = _n(e.subgraphs, m, n), v = yn(h, e.subgraphs, m, e.direction, new Set(f.keys()), o), { penetration: y, stuck: b } = v;
1629
+ }), m = new Map(p.nodes.filter((e) => !fn(e.id)).map((e) => [e.id, e])), h = bn(e.subgraphs, m, n), v = Sn(h, e.subgraphs, m, e.direction, new Set(f.keys()), o), { penetration: y, stuck: b } = v;
1630
1630
  if (b) return;
1631
1631
  if (y.size === 0) {
1632
1632
  for (let t = 0; v.requests.length > 0; t++) {
1633
- if (t === tn) return;
1634
- Cn(v.requests.reduce((e, t) => t.amount > e.amount ? t : e), [...m.values()], p.edges), h = _n(e.subgraphs, m, n), v = yn(h, e.subgraphs, m, e.direction, new Set(f.keys()), o);
1633
+ if (t === an) return;
1634
+ En(v.requests.reduce((e, t) => t.amount > e.amount ? t : e), [...m.values()], p.edges), h = bn(e.subgraphs, m, n), v = Sn(h, e.subgraphs, m, e.direction, new Set(f.keys()), o);
1635
1635
  }
1636
- let t = Sn(e, i, m, h, u);
1637
- return t && wn(p, [...m.values()], h, t);
1636
+ let t = Tn(e, i, m, h, u);
1637
+ return t && Dn(p, [...m.values()], h, t);
1638
1638
  }
1639
- if (c === en) return;
1639
+ if (c === rn) return;
1640
1640
  for (let [e, t] of y) {
1641
- let n = a.get(e) ?? 0, r = s.get(e), i = r ? (r.overlap - t) / (n - r.width) : 0, o = i > on ? i : an;
1641
+ let n = a.get(e) ?? 0, r = s.get(e), i = r ? (r.overlap - t) / (n - r.width) : 0, o = i > ln ? i : cn;
1642
1642
  s.set(e, {
1643
1643
  width: n,
1644
1644
  overlap: t
1645
- }), a.set(e, n + t / o + rn);
1645
+ }), a.set(e, n + t / o + sn);
1646
1646
  }
1647
1647
  }
1648
- }, y = xn(e, d, o, u);
1648
+ }, y = wn(e, d, o, u);
1649
1649
  return (y.size > 0 ? v(y) : void 0) ?? v(/* @__PURE__ */ new Set());
1650
1650
  }
1651
- function xn(e, t, n, r) {
1651
+ function wn(e, t, n, r) {
1652
1652
  let i = r.map((e) => {
1653
- let t = U(e);
1653
+ let t = V(e);
1654
1654
  return {
1655
1655
  inside: t,
1656
1656
  layers: new Set([...t].filter((e) => n.has(e)).map((e) => n.get(e)))
@@ -1674,15 +1674,15 @@ function xn(e, t, n, r) {
1674
1674
  }
1675
1675
  return o;
1676
1676
  }
1677
- function Sn(e, t, n, r, i) {
1678
- let a = new Map(vn(r).map((e) => [e.id, e])), o = [];
1677
+ function Tn(e, t, n, r, i) {
1678
+ let a = new Map(xn(r).map((e) => [e.id, e])), o = [];
1679
1679
  for (let r of t) {
1680
1680
  let t = e.edges[r], s = n.get(t.source), c = n.get(t.target), l = i.filter((e) => {
1681
- let n = U(e);
1681
+ let n = V(e);
1682
1682
  return n.has(t.source) && n.has(t.target);
1683
- }).sort((e, t) => U(e).size - U(t).size)[0], u = l && a.get(l.id);
1683
+ }).sort((e, t) => V(e).size - V(t).size)[0], u = l && a.get(l.id);
1684
1684
  if (!s || !c || !u) return;
1685
- let d = Xt(s, c, [...n.values()].filter((e) => e !== s && e !== c), u, e.direction, o.map((e) => e.points));
1685
+ let d = $t(s, c, [...n.values()].filter((e) => e !== s && e !== c), u, e.direction, o.map((e) => e.points));
1686
1686
  if (!d) return;
1687
1687
  o.push({
1688
1688
  source: t.source,
@@ -1692,24 +1692,24 @@ function Sn(e, t, n, r, i) {
1692
1692
  hasArrowStart: t.hasArrowStart,
1693
1693
  hasArrowEnd: t.hasArrowEnd,
1694
1694
  points: d,
1695
- labelPosition: t.label ? Zt(d) : void 0,
1696
- inlineStyle: Ft(r, e),
1695
+ labelPosition: t.label ? en(d) : void 0,
1696
+ inlineStyle: Rt(r, e),
1697
1697
  id: t.id,
1698
1698
  animate: t.animate
1699
1699
  });
1700
1700
  }
1701
1701
  return o;
1702
1702
  }
1703
- function Cn(e, t, n) {
1704
- let { axis: r, amount: i, after: a } = e, o = i + nn, s = t.filter((e) => e[r] >= a), c = Math.min(...s.map((e) => e[r]));
1703
+ function En(e, t, n) {
1704
+ let { axis: r, amount: i, after: a } = e, o = i + on, s = t.filter((e) => e[r] >= a), c = Math.min(...s.map((e) => e[r]));
1705
1705
  for (let e of s) e[r] += o;
1706
1706
  let l = (e) => {
1707
1707
  e[r] >= c && (e[r] += o);
1708
1708
  };
1709
1709
  for (let e of n) e.points.forEach(l), e.labelPosition && l(e.labelPosition);
1710
1710
  }
1711
- function wn(e, t, n, r) {
1712
- let i = [...e.edges.filter((e) => !ln(e.source) && !ln(e.target)), ...r], a = vn(n), o = [
1711
+ function Dn(e, t, n, r) {
1712
+ let i = [...e.edges.filter((e) => !fn(e.source) && !fn(e.target)), ...r], a = xn(n), o = [
1713
1713
  ...t.map((e) => e.x),
1714
1714
  ...a.map((e) => e.x),
1715
1715
  ...i.flatMap((e) => e.points.map((e) => e.x))
@@ -1717,7 +1717,7 @@ function wn(e, t, n, r) {
1717
1717
  ...t.map((e) => e.y),
1718
1718
  ...a.map((e) => e.y),
1719
1719
  ...i.flatMap((e) => e.points.map((e) => e.y))
1720
- ], c = V.padding - Math.min(...o), l = V.padding - Math.min(...s);
1720
+ ], c = B.padding - Math.min(...o), l = B.padding - Math.min(...s);
1721
1721
  for (let e of t) e.x += c, e.y += l;
1722
1722
  for (let e of a) e.x += c, e.y += l;
1723
1723
  for (let e of i) {
@@ -1725,11 +1725,11 @@ function wn(e, t, n, r) {
1725
1725
  e.labelPosition && (e.labelPosition.x += c, e.labelPosition.y += l);
1726
1726
  }
1727
1727
  let u = 0, d = 0;
1728
- for (let e of t) u = Math.max(u, e.x + e.width + V.padding), d = Math.max(d, e.y + e.height + V.padding);
1729
- for (let e of a) u = Math.max(u, e.x + e.width + V.padding), d = Math.max(d, e.y + e.height + V.padding);
1728
+ for (let e of t) u = Math.max(u, e.x + e.width + B.padding), d = Math.max(d, e.y + e.height + B.padding);
1729
+ for (let e of a) u = Math.max(u, e.x + e.width + B.padding), d = Math.max(d, e.y + e.height + B.padding);
1730
1730
  for (let e of i) {
1731
- for (let t of e.points) u = Math.max(u, t.x + B.width + V.padding), d = Math.max(d, t.y + B.width + V.padding);
1732
- e.labelPosition && (u = Math.max(u, e.labelPosition.x + 60 + V.padding), d = Math.max(d, e.labelPosition.y + 20 + V.padding));
1731
+ for (let t of e.points) u = Math.max(u, t.x + Oe.width + B.padding), d = Math.max(d, t.y + Oe.width + B.padding);
1732
+ e.labelPosition && (u = Math.max(u, e.labelPosition.x + 60 + B.padding), d = Math.max(d, e.labelPosition.y + 20 + B.padding));
1733
1733
  }
1734
1734
  return {
1735
1735
  ...e,
@@ -1742,51 +1742,51 @@ function wn(e, t, n, r) {
1742
1742
  }
1743
1743
  //#endregion
1744
1744
  //#region packages/svg-renderer/src/layout-engine.ts
1745
- function Tn(e, t = {}) {
1746
- return En(e, t);
1745
+ function On(e, t = {}) {
1746
+ return kn(e, t);
1747
1747
  }
1748
- function En(e, t, n) {
1748
+ function kn(e, t, n) {
1749
1749
  let r = {
1750
- ...V,
1750
+ ...B,
1751
1751
  ...t,
1752
- fontSizes: I(t.fontSizes)
1752
+ fontSizes: Te(t.fontSizes)
1753
1753
  };
1754
- return Tt(ye($e(e, r, n), t.layoutCache), e, r.mergeEdges);
1754
+ return Ot(ye(nt(e, r, n), t.layoutCache), e, r.mergeEdges);
1755
1755
  }
1756
- function Dn(e, t = {}) {
1756
+ function An(e, t = {}) {
1757
1757
  let n = w(e);
1758
- if (dn(n)) {
1759
- let e = bn(n, (e, n) => En(e, t, n), I(t.fontSizes));
1758
+ if (mn(n)) {
1759
+ let e = Cn(n, (e, n) => kn(e, t, n), Te(t.fontSizes));
1760
1760
  if (e) return e;
1761
1761
  }
1762
- return Tn(n, t);
1762
+ return On(n, t);
1763
1763
  }
1764
- function On(e, t = {}) {
1765
- return $e(e, {
1766
- ...V,
1764
+ function jn(e, t = {}) {
1765
+ return nt(e, {
1766
+ ...B,
1767
1767
  ...t,
1768
- fontSizes: I(t.fontSizes)
1768
+ fontSizes: Te(t.fontSizes)
1769
1769
  });
1770
1770
  }
1771
1771
  //#endregion
1772
1772
  //#region packages/svg-renderer/src/title-gaps.ts
1773
- var kn = 12, An = 2;
1774
- function jn(e) {
1775
- return e.flatMap((e) => [e, ...jn(e.children)]);
1773
+ var Mn = 12, Nn = 2;
1774
+ function Pn(e) {
1775
+ return e.flatMap((e) => [e, ...Pn(e.children)]);
1776
1776
  }
1777
- function Mn(e, t) {
1777
+ function Fn(e, t) {
1778
1778
  let n = t.groupHeader + 16;
1779
- return jn(e).filter((e) => e.label !== "").map((e) => {
1779
+ return Pn(e).filter((e) => e.label !== "").map((e) => {
1780
1780
  let r = l(e.label, t.groupHeader, L.groupHeader);
1781
1781
  return {
1782
- x: e.x + kn - An,
1783
- y: e.y + n / 2 - r.height / 2 - An,
1782
+ x: e.x + Mn - Nn,
1783
+ y: e.y + n / 2 - r.height / 2 - Nn,
1784
1784
  width: r.width + 4,
1785
1785
  height: r.height + 4
1786
1786
  };
1787
1787
  });
1788
1788
  }
1789
- function Nn(e, t, n) {
1789
+ function In(e, t, n) {
1790
1790
  let r = t.x - e.x, i = t.y - e.y, a = [
1791
1791
  -r,
1792
1792
  r,
@@ -1809,26 +1809,26 @@ function Nn(e, t, n) {
1809
1809
  }
1810
1810
  return !0;
1811
1811
  }
1812
- function Pn(e) {
1812
+ function Ln(e) {
1813
1813
  return {
1814
- x: e.x + An,
1815
- y: e.y + An,
1814
+ x: e.x + Nn,
1815
+ y: e.y + Nn,
1816
1816
  width: e.width - 4,
1817
1817
  height: e.height - 4
1818
1818
  };
1819
1819
  }
1820
- function Fn(e, t) {
1821
- let n = e.points, r = t.map(Pn);
1822
- for (let e = 0; e + 1 < n.length; e++) if (r.some((t) => Nn(n[e], n[e + 1], t))) return !0;
1820
+ function Rn(e, t) {
1821
+ let n = e.points, r = t.map(Ln);
1822
+ for (let e = 0; e + 1 < n.length; e++) if (r.some((t) => In(n[e], n[e + 1], t))) return !0;
1823
1823
  return !1;
1824
1824
  }
1825
- function In(e) {
1825
+ function zn(e) {
1826
1826
  let t = 2166136261;
1827
1827
  for (let n of e.map((e) => `${e.x},${e.y},${e.width},${e.height}`).join(";")) t = Math.imul(t ^ n.charCodeAt(0), 16777619);
1828
1828
  return (t >>> 0).toString(36);
1829
1829
  }
1830
- function Ln(e, t, n) {
1831
- let r = `zm-title-gap-${In(e)}`;
1830
+ function Bn(e, t, n) {
1831
+ let r = `zm-title-gap-${zn(e)}`;
1832
1832
  return {
1833
1833
  id: r,
1834
1834
  markup: ` <mask id="${r}" maskUnits="userSpaceOnUse" x="0" y="0" width="${t}" height="${n}">\n <rect x="0" y="0" width="${t}" height="${n}" fill="#fff" />\n${e.map((e) => ` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000" />`).join("\n")}\n </mask>`
@@ -1836,25 +1836,25 @@ function Ln(e, t, n) {
1836
1836
  }
1837
1837
  //#endregion
1838
1838
  //#region packages/svg-renderer/src/renderer.ts
1839
- function Rn(e, n, r = "Inter", i = !1, a = F, o = "linear", s, c = !0, l = !0, u, d, f = {}) {
1839
+ function Vn(e, n, r = "Inter", i = !1, a = I, o = "linear", s, c = !0, l = !0, u, d, f = {}) {
1840
1840
  let p = [], m = l && e.nodes.some((e) => !!g(e.interaction?.href));
1841
- p.push(Pr(x(e.width, e.height, n, i, u, d, m, f.styleAttribute), s)), p.push(t(r, !1, f.nonce)), c && e.edges.some((e) => e.animate) && p.push(zn(f.nonce)), p.push("<defs>"), p.push(Bn());
1841
+ p.push(Lr(x(e.width, e.height, n, i, u, d, m, f.styleAttribute), s)), p.push(t(r, !1, f.nonce)), c && e.edges.some((e) => e.animate) && p.push(Hn(f.nonce)), p.push("<defs>"), p.push(Un());
1842
1842
  let h = /* @__PURE__ */ new Set();
1843
1843
  for (let t of e.edges) t.inlineStyle?.stroke && h.add(t.inlineStyle.stroke);
1844
- for (let e of h) p.push(Vn(e));
1845
- let _ = Mn(e.groups, a), v = new Set(e.edges.filter((e) => Fn(e, _))), y;
1844
+ for (let e of h) p.push(Wn(e));
1845
+ let _ = Fn(e.groups, a), v = new Set(e.edges.filter((e) => Rn(e, _))), y;
1846
1846
  if (v.size > 0) {
1847
- let t = Ln(_, e.width, e.height);
1847
+ let t = Bn(_, e.width, e.height);
1848
1848
  y = t.id, p.push(t.markup);
1849
1849
  }
1850
1850
  p.push("</defs>");
1851
- for (let t of e.groups) p.push(Wn(t, r, a));
1852
- for (let t of e.edges) p.push(Gn(t, o, c, v.has(t) ? y : void 0));
1853
- for (let t of e.edges) t.label && p.push(qn(t, r, a));
1854
- for (let t of e.nodes) p.push(Zn(t, r, a, l));
1851
+ for (let t of e.groups) p.push(qn(t, r, a));
1852
+ for (let t of e.edges) p.push(Jn(t, o, c, v.has(t) ? y : void 0));
1853
+ for (let t of e.edges) t.label && p.push(Xn(t, r, a));
1854
+ for (let t of e.nodes) p.push(er(t, r, a, l));
1855
1855
  return p.push("</svg>"), p.join("\n");
1856
1856
  }
1857
- function zn(e) {
1857
+ function Hn(e) {
1858
1858
  return [
1859
1859
  b(e),
1860
1860
  " @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }",
@@ -1865,28 +1865,28 @@ function zn(e) {
1865
1865
  "</style>"
1866
1866
  ].join("\n");
1867
1867
  }
1868
- function Bn() {
1869
- return Hn("var(--_arrow)", "");
1868
+ function Un() {
1869
+ return Gn("var(--_arrow)", "");
1870
1870
  }
1871
- function Vn(e) {
1872
- return Hn(r(e), a`-${Un(e)}`);
1871
+ function Wn(e) {
1872
+ return Gn(r(e), a`-${Kn(e)}`);
1873
1873
  }
1874
- function Hn(e, t) {
1875
- let n = B.width, r = B.height, i = n - 1, o = a`fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`, s = a`<polygon points="0 0, ${n} ${r / 2}, 0 ${r}" ${o} />`, c = (e, t) => a` <marker id="${e}" markerWidth="${n}" markerHeight="${r}" refX="${i}" refY="${r / 2}" orient="${t}">` + a`\n ${s}` + "\n </marker>";
1874
+ function Gn(e, t) {
1875
+ let n = Oe.width, r = Oe.height, i = n - 1, o = a`fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`, s = a`<polygon points="0 0, ${n} ${r / 2}, 0 ${r}" ${o} />`, c = (e, t) => a` <marker id="${e}" markerWidth="${n}" markerHeight="${r}" refX="${i}" refY="${r / 2}" orient="${t}">` + a`\n ${s}` + "\n </marker>";
1876
1876
  return c(a`arrowhead${t}`, "auto") + "\n" + c(a`arrowhead-start${t}`, "auto-start-reverse");
1877
1877
  }
1878
- function Un(e) {
1878
+ function Kn(e) {
1879
1879
  return e.replace(/[^a-zA-Z0-9]/g, (e) => e.charCodeAt(0).toString(16));
1880
1880
  }
1881
- function Wn(e, t, n) {
1881
+ function qn(e, t, n) {
1882
1882
  let i = n.groupHeader + 16, o = [];
1883
1883
  o.push(a`<g class="subgraph" data-id="${r(e.id)}" data-label="${r(e.label)}">`), o.push(a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + a`rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), o.push(a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${i}" ` + a`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), o.push(" " + p(e.label, e.x + 12, e.y + i / 2, n.groupHeader, a`font-size="${n.groupHeader}" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`));
1884
- for (let r of e.children) o.push(Wn(r, t, n));
1884
+ for (let r of e.children) o.push(qn(r, t, n));
1885
1885
  return o.push("</g>"), o.join("\n");
1886
1886
  }
1887
- function Gn(e, t, n = !0, i) {
1887
+ function Jn(e, t, n = !0, i) {
1888
1888
  if (e.points.length < 2) return "";
1889
- let o = n && (e.animate ?? !1), s = t !== "linear", c = e.style === "invisible", l = e.style === "dotted" ? " stroke-dasharray=\"4 4\"" : "", u = e.style === "thick" ? R.connector * 2 : R.connector, d = c ? "none" : r(e.inlineStyle?.stroke ?? "var(--_line)"), f = r(e.inlineStyle?.["stroke-width"] ?? String(u)), p = e.inlineStyle?.stroke ? a`-${Un(e.inlineStyle.stroke)}` : "", m = "";
1889
+ let o = n && (e.animate ?? !1), s = t !== "linear", c = e.style === "invisible", l = e.style === "dotted" ? " stroke-dasharray=\"4 4\"" : "", u = e.style === "thick" ? R.connector * 2 : R.connector, d = c ? "none" : r(e.inlineStyle?.stroke ?? "var(--_line)"), f = r(e.inlineStyle?.["stroke-width"] ?? String(u)), p = e.inlineStyle?.stroke ? a`-${Kn(e.inlineStyle.stroke)}` : "", m = "";
1890
1890
  c || (e.hasArrowEnd && (m += a` marker-end="url(#arrowhead${p})"`), e.hasArrowStart && (m += a` marker-start="url(#arrowhead-start${p})"`));
1891
1891
  let h = [
1892
1892
  a`class="edge${o ? " edge-animated" : ""}"`,
@@ -1897,35 +1897,35 @@ function Gn(e, t, n = !0, i) {
1897
1897
  a`data-arrow-end="${e.hasArrowEnd}"`
1898
1898
  ];
1899
1899
  e.label && h.push(a`data-label="${r(e.label)}"`), e.id && h.push(a`data-id="${r(e.id)}"`);
1900
- let g = o && !l ? " stroke-dasharray=\"8 6\"" : "", _ = s ? a`d="${fe(e.points, t)}"` : a`points="${Kn(e.points)}"`;
1900
+ let g = o && !l ? " stroke-dasharray=\"8 6\"" : "", _ = s ? a`d="${fe(e.points, t)}"` : a`points="${Yn(e.points)}"`;
1901
1901
  return a`<${s ? "path" : "polyline"} ${h.join(" ")} ${_} ` + a`fill="none" stroke="${d}" ` + a`stroke-width="${f}"${l}${g}${m}` + (i ? a` mask="url(#${i})"` : "") + " />";
1902
1902
  }
1903
- function Kn(e) {
1903
+ function Yn(e) {
1904
1904
  return e.map((e) => a`${e.x},${e.y}`).join(" ");
1905
1905
  }
1906
- function qn(e, t, n) {
1906
+ function Xn(e, t, n) {
1907
1907
  if (!e.label) return "";
1908
- let i = e.label, o = e.labelPosition ?? Yn(e.points), s = l(i, n.edgeLabel, L.edgeLabel), c = m(i, o.x, o.y, s.width, s.height, n.edgeLabel, 8, a`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${L.edgeLabel}" fill="var(--_text-sec)"`, "rx=\"2\" ry=\"2\" fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"1\"");
1908
+ let i = e.label, o = e.labelPosition ?? Qn(e.points), s = l(i, n.edgeLabel, L.edgeLabel), c = m(i, o.x, o.y, s.width, s.height, n.edgeLabel, 8, a`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${L.edgeLabel}" fill="var(--_text-sec)"`, "rx=\"2\" ry=\"2\" fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"1\"");
1909
1909
  return a`<g class="edge-label" data-from="${r(e.source)}" data-to="${r(e.target)}" data-label="${r(i)}">\n` + a` ${c.replace(/\n/g, "\n ")}\n` + "</g>";
1910
1910
  }
1911
- function Jn(e, t) {
1911
+ function Zn(e, t) {
1912
1912
  let n = e[t];
1913
1913
  if (!n)
1914
1914
  /* v8 ignore next */
1915
1915
  throw Error(a`edgeMidpoint: missing point at index ${t}`);
1916
1916
  return n;
1917
1917
  }
1918
- function Yn(e) {
1918
+ function Qn(e) {
1919
1919
  if (e.length === 0) return {
1920
1920
  x: 0,
1921
1921
  y: 0
1922
1922
  };
1923
1923
  if (e.length === 1) return e[0];
1924
1924
  let t = 0;
1925
- for (let n = 1; n < e.length; n++) t += Xn(Jn(e, n - 1), Jn(e, n));
1925
+ for (let n = 1; n < e.length; n++) t += $n(Zn(e, n - 1), Zn(e, n));
1926
1926
  let n = t / 2;
1927
1927
  for (let t = 1; t < e.length; t++) {
1928
- let r = Jn(e, t - 1), i = Jn(e, t), a = Xn(r, i);
1928
+ let r = Zn(e, t - 1), i = Zn(e, t), a = $n(r, i);
1929
1929
  if (n <= a) {
1930
1930
  let e = n / a;
1931
1931
  return {
@@ -1937,11 +1937,11 @@ function Yn(e) {
1937
1937
  }
1938
1938
  return e[e.length - 1];
1939
1939
  }
1940
- function Xn(e, t) {
1940
+ function $n(e, t) {
1941
1941
  return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2);
1942
1942
  }
1943
- function Zn(e, t, n, o = !0) {
1944
- let s = Qn(e), c = Mr(e, t, n), l = [], u = _(e.className), d = u ? a`node ${u}` : "node", f = e.interaction, p = [
1943
+ function er(e, t, n, o = !0) {
1944
+ let s = tr(e), c = Fr(e, t, n), l = [], u = _(e.className), d = u ? a`node ${u}` : "node", f = e.interaction, p = [
1945
1945
  a`class="${d}"`,
1946
1946
  a`data-id="${r(e.id)}"`,
1947
1947
  a`data-label="${r(e.label)}"`,
@@ -1955,65 +1955,65 @@ function Zn(e, t, n, o = !0) {
1955
1955
  }
1956
1956
  return o && f?.tooltip && l.push(a`${h}<title>${i(f.tooltip)}</title>`), l.push(a`${h}${s.replace(/\n/g, a`\n${h}`)}`), c && l.push(a`${h}${c.replace(/\n/g, a`\n${h}`)}`), m && l.push(" </a>"), l.push("</g>"), l.join("\n");
1957
1957
  }
1958
- function Qn(e) {
1958
+ function tr(e) {
1959
1959
  let { x: t, y: n, width: i, height: a, shape: o, inlineStyle: s } = e, c = r(s?.fill ?? "var(--_node-fill)"), l = r(s?.stroke ?? "var(--_node-stroke)"), u = r(s?.["stroke-width"] ?? String(R.innerBox));
1960
1960
  switch (o) {
1961
- case "diamond": return rr(t, n, i, a, c, l, u);
1962
- case "rounded": return er(t, n, i, a, c, l, u);
1963
- case "stadium": return tr(t, n, i, a, c, l, u);
1964
- case "circle": return nr(t, n, i, a, c, l, u);
1965
- case "subroutine": return ir(t, n, i, a, c, l, u);
1966
- case "doublecircle": return ar(t, n, i, a, c, l, u);
1967
- case "hexagon": return or(t, n, i, a, c, l, u);
1968
- case "cylinder": return sr(t, n, i, a, c, l, u);
1969
- case "asymmetric": return cr(t, n, i, a, c, l, u);
1970
- case "trapezoid": return lr(t, n, i, a, c, l, u);
1971
- case "trapezoid-alt": return ur(t, n, i, a, c, l, u);
1972
- case "parallelogram": return dr(t, n, i, a, c, l, u);
1973
- case "parallelogram-alt": return fr(t, n, i, a, c, l, u);
1974
- case "state-start": return Ar(t, n, i, a);
1975
- case "state-end": return jr(t, n, i, a);
1976
- case "document": return pr(t, n, i, a, c, l, u);
1977
- case "stacked-document": return mr(t, n, i, a, c, l, u, !0);
1978
- case "stacked-process": return mr(t, n, i, a, c, l, u, !1);
1979
- case "card": return hr(t, n, i, a, c, l, u);
1980
- case "lined-process": return gr(t, n, i, a, c, l, u);
1981
- case "divided-process": return _r(t, n, i, a, c, l, u);
1982
- case "window-pane": return vr(t, n, i, a, c, l, u);
1983
- case "triangle": return yr(t, n, i, a, c, l, u, !1);
1984
- case "flipped-triangle": return yr(t, n, i, a, c, l, u, !0);
1985
- case "filled-circle": return br(t, n, i, a, l);
1986
- case "crossed-circle": return xr(t, n, i, a, c, l, u);
1987
- case "fork-join": return Sr(t, n, i, a, l);
1988
- case "notched-pentagon": return Cr(t, n, i, a, c, l, u);
1989
- case "sloped-rectangle": return wr(t, n, i, a, c, l, u);
1990
- case "flag": return Tr(t, n, i, a, c, l, u);
1991
- case "bow-tie-rectangle": return Er(t, n, i, a, c, l, u);
1992
- case "half-rounded-rectangle": return Dr(t, n, i, a, c, l, u);
1993
- case "brace": return Or(t, n, i, a, c, l, u, "left");
1994
- case "brace-right": return Or(t, n, i, a, c, l, u, "right");
1995
- case "braces": return Or(t, n, i, a, c, l, u, "both");
1996
- case "bolt": return kr(t, n, i, a, c, l, u);
1961
+ case "diamond": return or(t, n, i, a, c, l, u);
1962
+ case "rounded": return rr(t, n, i, a, c, l, u);
1963
+ case "stadium": return ir(t, n, i, a, c, l, u);
1964
+ case "circle": return ar(t, n, i, a, c, l, u);
1965
+ case "subroutine": return sr(t, n, i, a, c, l, u);
1966
+ case "doublecircle": return cr(t, n, i, a, c, l, u);
1967
+ case "hexagon": return lr(t, n, i, a, c, l, u);
1968
+ case "cylinder": return ur(t, n, i, a, c, l, u);
1969
+ case "asymmetric": return dr(t, n, i, a, c, l, u);
1970
+ case "trapezoid": return fr(t, n, i, a, c, l, u);
1971
+ case "trapezoid-alt": return pr(t, n, i, a, c, l, u);
1972
+ case "parallelogram": return mr(t, n, i, a, c, l, u);
1973
+ case "parallelogram-alt": return hr(t, n, i, a, c, l, u);
1974
+ case "state-start": return Nr(t, n, i, a);
1975
+ case "state-end": return Pr(t, n, i, a);
1976
+ case "document": return gr(t, n, i, a, c, l, u);
1977
+ case "stacked-document": return _r(t, n, i, a, c, l, u, !0);
1978
+ case "stacked-process": return _r(t, n, i, a, c, l, u, !1);
1979
+ case "card": return vr(t, n, i, a, c, l, u);
1980
+ case "lined-process": return yr(t, n, i, a, c, l, u);
1981
+ case "divided-process": return br(t, n, i, a, c, l, u);
1982
+ case "window-pane": return xr(t, n, i, a, c, l, u);
1983
+ case "triangle": return Sr(t, n, i, a, c, l, u, !1);
1984
+ case "flipped-triangle": return Sr(t, n, i, a, c, l, u, !0);
1985
+ case "filled-circle": return Cr(t, n, i, a, l);
1986
+ case "crossed-circle": return wr(t, n, i, a, c, l, u);
1987
+ case "fork-join": return Tr(t, n, i, a, l);
1988
+ case "notched-pentagon": return Er(t, n, i, a, c, l, u);
1989
+ case "sloped-rectangle": return Dr(t, n, i, a, c, l, u);
1990
+ case "flag": return Or(t, n, i, a, c, l, u);
1991
+ case "bow-tie-rectangle": return kr(t, n, i, a, c, l, u);
1992
+ case "half-rounded-rectangle": return Ar(t, n, i, a, c, l, u);
1993
+ case "brace": return jr(t, n, i, a, c, l, u, "left");
1994
+ case "brace-right": return jr(t, n, i, a, c, l, u, "right");
1995
+ case "braces": return jr(t, n, i, a, c, l, u, "both");
1996
+ case "bolt": return Mr(t, n, i, a, c, l, u);
1997
1997
  case "text":
1998
1998
  case "anchor": return "";
1999
- default: return $n(t, n, i, a, c, l, u);
1999
+ default: return nr(t, n, i, a, c, l, u);
2000
2000
  }
2001
2001
  }
2002
- function $n(e, t, n, r, i, o, s) {
2002
+ function nr(e, t, n, r, i, o, s) {
2003
2003
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + a`rx="0" ry="0" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2004
2004
  }
2005
- function er(e, t, n, r, i, o, s) {
2005
+ function rr(e, t, n, r, i, o, s) {
2006
2006
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + a`rx="6" ry="6" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2007
2007
  }
2008
- function tr(e, t, n, r, i, o, s) {
2008
+ function ir(e, t, n, r, i, o, s) {
2009
2009
  let c = r / 2;
2010
2010
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + a`rx="${c}" ry="${c}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2011
2011
  }
2012
- function nr(e, t, n, r, i, o, s) {
2012
+ function ar(e, t, n, r, i, o, s) {
2013
2013
  let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2;
2014
2014
  return a`<circle cx="${c}" cy="${l}" r="${u}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2015
2015
  }
2016
- function rr(e, t, n, r, i, o, s) {
2016
+ function or(e, t, n, r, i, o, s) {
2017
2017
  let c = e + n / 2, l = t + r / 2, u = n / 2, d = r / 2, f = [
2018
2018
  a`${c},${l - d}`,
2019
2019
  a`${c + u},${l}`,
@@ -2022,14 +2022,14 @@ function rr(e, t, n, r, i, o, s) {
2022
2022
  ].join(" ");
2023
2023
  return a`<polygon points="${f}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2024
2024
  }
2025
- function ir(e, t, n, r, i, o, s) {
2025
+ function sr(e, t, n, r, i, o, s) {
2026
2026
  return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + a`rx="0" ry="0" fill="${i}" stroke="${o}" stroke-width="${s}" />` + a`\n<line x1="${e + 8}" y1="${t}" x2="${e + 8}" y2="${t + r}" ` + a`stroke="${o}" stroke-width="${s}" />` + a`\n<line x1="${e + n - 8}" y1="${t}" x2="${e + n - 8}" y2="${t + r}" ` + a`stroke="${o}" stroke-width="${s}" />`;
2027
2027
  }
2028
- function ar(e, t, n, r, i, o, s) {
2028
+ function cr(e, t, n, r, i, o, s) {
2029
2029
  let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2, d = u - 5;
2030
2030
  return a`<circle cx="${c}" cy="${l}" r="${u}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />` + a`\n<circle cx="${c}" cy="${l}" r="${d}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2031
2031
  }
2032
- function or(e, t, n, r, i, o, s) {
2032
+ function lr(e, t, n, r, i, o, s) {
2033
2033
  let c = r / 4, l = [
2034
2034
  a`${e + c},${t}`,
2035
2035
  a`${e + n - c},${t}`,
@@ -2040,11 +2040,11 @@ function or(e, t, n, r, i, o, s) {
2040
2040
  ].join(" ");
2041
2041
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2042
2042
  }
2043
- function sr(e, t, n, r, i, o, s) {
2043
+ function ur(e, t, n, r, i, o, s) {
2044
2044
  let c = e + n / 2, l = t + 7, u = r - 14;
2045
2045
  return a`<rect x="${e}" y="${l}" width="${n}" height="${u}" ` + a`fill="${i}" stroke="none" />` + a`\n<line x1="${e}" y1="${l}" x2="${e}" y2="${l + u}" stroke="${o}" stroke-width="${s}" />` + a`\n<line x1="${e + n}" y1="${l}" x2="${e + n}" y2="${l + u}" stroke="${o}" stroke-width="${s}" />` + a`\n<ellipse cx="${c}" cy="${t + r - 7}" rx="${n / 2}" ry="${7}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />` + a`\n<ellipse cx="${c}" cy="${l}" rx="${n / 2}" ry="${7}" ` + a`fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2046
2046
  }
2047
- function cr(e, t, n, r, i, o, s) {
2047
+ function dr(e, t, n, r, i, o, s) {
2048
2048
  let c = [
2049
2049
  a`${e + 12},${t}`,
2050
2050
  a`${e + n},${t}`,
@@ -2054,7 +2054,7 @@ function cr(e, t, n, r, i, o, s) {
2054
2054
  ].join(" ");
2055
2055
  return a`<polygon points="${c}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2056
2056
  }
2057
- function lr(e, t, n, r, i, o, s) {
2057
+ function fr(e, t, n, r, i, o, s) {
2058
2058
  let c = n * .15, l = [
2059
2059
  a`${e + c},${t}`,
2060
2060
  a`${e + n - c},${t}`,
@@ -2063,7 +2063,7 @@ function lr(e, t, n, r, i, o, s) {
2063
2063
  ].join(" ");
2064
2064
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2065
2065
  }
2066
- function ur(e, t, n, r, i, o, s) {
2066
+ function pr(e, t, n, r, i, o, s) {
2067
2067
  let c = n * .15, l = [
2068
2068
  a`${e},${t}`,
2069
2069
  a`${e + n},${t}`,
@@ -2072,7 +2072,7 @@ function ur(e, t, n, r, i, o, s) {
2072
2072
  ].join(" ");
2073
2073
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2074
2074
  }
2075
- function dr(e, t, n, r, i, o, s) {
2075
+ function mr(e, t, n, r, i, o, s) {
2076
2076
  let c = n * .15, l = [
2077
2077
  a`${e + c},${t}`,
2078
2078
  a`${e + n},${t}`,
@@ -2081,7 +2081,7 @@ function dr(e, t, n, r, i, o, s) {
2081
2081
  ].join(" ");
2082
2082
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2083
2083
  }
2084
- function fr(e, t, n, r, i, o, s) {
2084
+ function hr(e, t, n, r, i, o, s) {
2085
2085
  let c = n * .15, l = [
2086
2086
  a`${e},${t}`,
2087
2087
  a`${e + n - c},${t}`,
@@ -2090,19 +2090,19 @@ function fr(e, t, n, r, i, o, s) {
2090
2090
  ].join(" ");
2091
2091
  return a`<polygon points="${l}" fill="${i}" stroke="${o}" stroke-width="${s}" />`;
2092
2092
  }
2093
- function W(e, t, n) {
2093
+ function H(e, t, n) {
2094
2094
  return a`fill="${e}" stroke="${t}" stroke-width="${n}"`;
2095
2095
  }
2096
- function pr(e, t, n, r, i, o, s) {
2096
+ function gr(e, t, n, r, i, o, s) {
2097
2097
  let c = Math.min(10, r * .16), l = t + r - c, u = a`M ${e} ${t} L ${e + n} ${t} L ${e + n} ${l} ` + a`C ${e + n * .75} ${l + c * 1.8} ${e + n * .25} ${l - c * .8} ${e} ${l} Z`;
2098
- return a`<path d="${u}" ${W(i, o, s)} />`;
2098
+ return a`<path d="${u}" ${H(i, o, s)} />`;
2099
2099
  }
2100
- function mr(e, t, n, r, i, o, s, c) {
2100
+ function _r(e, t, n, r, i, o, s, c) {
2101
2101
  let l = n - 10, u = r - 10, d = [];
2102
- for (let n = 2; n >= 1; n--) d.push(a`<rect x="${e + 5 * n}" y="${t + 5 * (2 - n)}" width="${l}" height="${u}" ` + a`${W(i, o, s)} />`);
2103
- return d.push(c ? pr(e, t + 10, l, u, i, o, s) : a`<rect x="${e}" y="${t + 10}" width="${l}" height="${u}" ${W(i, o, s)} />`), d.join("\n");
2102
+ for (let n = 2; n >= 1; n--) d.push(a`<rect x="${e + 5 * n}" y="${t + 5 * (2 - n)}" width="${l}" height="${u}" ` + a`${H(i, o, s)} />`);
2103
+ return d.push(c ? gr(e, t + 10, l, u, i, o, s) : a`<rect x="${e}" y="${t + 10}" width="${l}" height="${u}" ${H(i, o, s)} />`), d.join("\n");
2104
2104
  }
2105
- function hr(e, t, n, r, i, o, s) {
2105
+ function vr(e, t, n, r, i, o, s) {
2106
2106
  let c = Math.min(14, n * .12, r * .3), l = [
2107
2107
  a`${e + c},${t}`,
2108
2108
  a`${e + n},${t}`,
@@ -2110,21 +2110,21 @@ function hr(e, t, n, r, i, o, s) {
2110
2110
  a`${e},${t + r}`,
2111
2111
  a`${e},${t + c}`
2112
2112
  ].join(" ");
2113
- return a`<polygon points="${l}" ${W(i, o, s)} />`;
2113
+ return a`<polygon points="${l}" ${H(i, o, s)} />`;
2114
2114
  }
2115
- function gr(e, t, n, r, i, o, s) {
2115
+ function yr(e, t, n, r, i, o, s) {
2116
2116
  let c = Math.min(12, n * .12);
2117
- return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${W(i, o, s)} />\n` + a`<line x1="${e + c}" y1="${t}" x2="${e + c}" y2="${t + r}" stroke="${o}" stroke-width="${s}" />`;
2117
+ return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, o, s)} />\n` + a`<line x1="${e + c}" y1="${t}" x2="${e + c}" y2="${t + r}" stroke="${o}" stroke-width="${s}" />`;
2118
2118
  }
2119
- function _r(e, t, n, r, i, o, s) {
2119
+ function br(e, t, n, r, i, o, s) {
2120
2120
  let c = t + Math.min(16, r * .3);
2121
- return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${W(i, o, s)} />\n` + a`<line x1="${e}" y1="${c}" x2="${e + n}" y2="${c}" stroke="${o}" stroke-width="${s}" />`;
2121
+ return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, o, s)} />\n` + a`<line x1="${e}" y1="${c}" x2="${e + n}" y2="${c}" stroke="${o}" stroke-width="${s}" />`;
2122
2122
  }
2123
- function vr(e, t, n, r, i, o, s) {
2123
+ function xr(e, t, n, r, i, o, s) {
2124
2124
  let c = e + Math.min(16, n * .16), l = t + Math.min(14, r * .28);
2125
- return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${W(i, o, s)} />\n` + a`<line x1="${c}" y1="${t}" x2="${c}" y2="${t + r}" stroke="${o}" stroke-width="${s}" />\n` + a`<line x1="${e}" y1="${l}" x2="${e + n}" y2="${l}" stroke="${o}" stroke-width="${s}" />`;
2125
+ return a`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, o, s)} />\n` + a`<line x1="${c}" y1="${t}" x2="${c}" y2="${t + r}" stroke="${o}" stroke-width="${s}" />\n` + a`<line x1="${e}" y1="${l}" x2="${e + n}" y2="${l}" stroke="${o}" stroke-width="${s}" />`;
2126
2126
  }
2127
- function yr(e, t, n, r, i, o, s, c) {
2127
+ function Sr(e, t, n, r, i, o, s, c) {
2128
2128
  let l = c ? [
2129
2129
  a`${e},${t}`,
2130
2130
  a`${e + n},${t}`,
@@ -2134,21 +2134,21 @@ function yr(e, t, n, r, i, o, s, c) {
2134
2134
  a`${e + n},${t + r}`,
2135
2135
  a`${e},${t + r}`
2136
2136
  ];
2137
- return a`<polygon points="${l.join(" ")}" ${W(i, o, s)} />`;
2137
+ return a`<polygon points="${l.join(" ")}" ${H(i, o, s)} />`;
2138
2138
  }
2139
- function br(e, t, n, r, i) {
2139
+ function Cr(e, t, n, r, i) {
2140
2140
  let o = Math.min(n, r) / 2 - 2;
2141
2141
  return a`<circle cx="${e + n / 2}" cy="${t + r / 2}" r="${o}" fill="${i}" stroke="${i}" />`;
2142
2142
  }
2143
- function xr(e, t, n, r, i, o, s) {
2143
+ function wr(e, t, n, r, i, o, s) {
2144
2144
  let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2 - 2, d = u / Math.SQRT2;
2145
- return a`<circle cx="${c}" cy="${l}" r="${u}" ${W(i, o, s)} />\n` + a`<line x1="${c - d}" y1="${l - d}" x2="${c + d}" y2="${l + d}" stroke="${o}" stroke-width="${s}" />\n` + a`<line x1="${c + d}" y1="${l - d}" x2="${c - d}" y2="${l + d}" stroke="${o}" stroke-width="${s}" />`;
2145
+ return a`<circle cx="${c}" cy="${l}" r="${u}" ${H(i, o, s)} />\n` + a`<line x1="${c - d}" y1="${l - d}" x2="${c + d}" y2="${l + d}" stroke="${o}" stroke-width="${s}" />\n` + a`<line x1="${c + d}" y1="${l - d}" x2="${c - d}" y2="${l + d}" stroke="${o}" stroke-width="${s}" />`;
2146
2146
  }
2147
- function Sr(e, t, n, r, i) {
2147
+ function Tr(e, t, n, r, i) {
2148
2148
  let o = Math.min(8, r);
2149
2149
  return a`<rect x="${e}" y="${t + (r - o) / 2}" width="${n}" height="${o}" fill="${i}" stroke="${i}" />`;
2150
2150
  }
2151
- function Cr(e, t, n, r, i, o, s) {
2151
+ function Er(e, t, n, r, i, o, s) {
2152
2152
  let c = Math.min(14, n * .12, r * .3), l = [
2153
2153
  a`${e + c},${t}`,
2154
2154
  a`${e + n - c},${t}`,
@@ -2157,34 +2157,34 @@ function Cr(e, t, n, r, i, o, s) {
2157
2157
  a`${e},${t + r}`,
2158
2158
  a`${e},${t + c}`
2159
2159
  ].join(" ");
2160
- return a`<polygon points="${l}" ${W(i, o, s)} />`;
2160
+ return a`<polygon points="${l}" ${H(i, o, s)} />`;
2161
2161
  }
2162
- function wr(e, t, n, r, i, o, s) {
2162
+ function Dr(e, t, n, r, i, o, s) {
2163
2163
  let c = Math.min(12, r * .3), l = [
2164
2164
  a`${e},${t + c}`,
2165
2165
  a`${e + n},${t}`,
2166
2166
  a`${e + n},${t + r}`,
2167
2167
  a`${e},${t + r}`
2168
2168
  ].join(" ");
2169
- return a`<polygon points="${l}" ${W(i, o, s)} />`;
2169
+ return a`<polygon points="${l}" ${H(i, o, s)} />`;
2170
2170
  }
2171
- function Tr(e, t, n, r, i, o, s) {
2171
+ function Or(e, t, n, r, i, o, s) {
2172
2172
  let c = Math.min(8, r * .14), l = a`M ${e} ${t + c} ` + a`C ${e + n * .25} ${t - c} ${e + n * .75} ${t + c * 2} ${e + n} ${t + c} ` + a`L ${e + n} ${t + r - c} ` + a`C ${e + n * .75} ${t + r + c} ${e + n * .25} ${t + r - c * 2} ${e} ${t + r - c} Z`;
2173
- return a`<path d="${l}" ${W(i, o, s)} />`;
2173
+ return a`<path d="${l}" ${H(i, o, s)} />`;
2174
2174
  }
2175
- function Er(e, t, n, r, i, o, s) {
2175
+ function kr(e, t, n, r, i, o, s) {
2176
2176
  let c = Math.min(14, n * .12), l = a`M ${e + c} ${t} L ${e + n} ${t} ` + a`Q ${e + n - c * 1.4} ${t + r / 2} ${e + n} ${t + r} ` + a`L ${e + c} ${t + r} ` + a`Q ${e + c * 1.4} ${t + r / 2} ${e + c} ${t} Z`;
2177
- return a`<path d="${l}" ${W(i, o, s)} />`;
2177
+ return a`<path d="${l}" ${H(i, o, s)} />`;
2178
2178
  }
2179
- function Dr(e, t, n, r, i, o, s) {
2179
+ function Ar(e, t, n, r, i, o, s) {
2180
2180
  let c = r / 2, l = Math.max(0, n - c), u = a`M ${e} ${t} L ${e + l} ${t} ` + a`A ${c} ${c} 0 0 1 ${e + l} ${t + r} ` + a`L ${e} ${t + r} Z`;
2181
- return a`<path d="${u}" ${W(i, o, s)} />`;
2181
+ return a`<path d="${u}" ${H(i, o, s)} />`;
2182
2182
  }
2183
- function Or(e, t, n, r, i, o, s, c) {
2183
+ function jr(e, t, n, r, i, o, s, c) {
2184
2184
  let l = Math.min(10, n * .12), u = [a`<rect x="${e}" y="${t}" width="${n}" height="${r}" fill="none" stroke="none" />`], d = a`M ${e + l} ${t} Q ${e} ${t} ${e} ${t + r * .25} ` + a`Q ${e} ${t + r / 2} ${e - l * .4} ${t + r / 2} ` + a`Q ${e} ${t + r / 2} ${e} ${t + r * .75} ` + a`Q ${e} ${t + r} ${e + l} ${t + r}`, f = a`M ${e + n - l} ${t} Q ${e + n} ${t} ${e + n} ${t + r * .25} ` + a`Q ${e + n} ${t + r / 2} ${e + n + l * .4} ${t + r / 2} ` + a`Q ${e + n} ${t + r / 2} ${e + n} ${t + r * .75} ` + a`Q ${e + n} ${t + r} ${e + n - l} ${t + r}`;
2185
2185
  return (c === "left" || c === "both") && u.push(a`<path d="${d}" fill="none" stroke="${o}" stroke-width="${s}" />`), (c === "right" || c === "both") && u.push(a`<path d="${f}" fill="none" stroke="${o}" stroke-width="${s}" />`), u.join("\n");
2186
2186
  }
2187
- function kr(e, t, n, r, i, o, s) {
2187
+ function Mr(e, t, n, r, i, o, s) {
2188
2188
  let c = [
2189
2189
  a`${e + n * .42},${t}`,
2190
2190
  a`${e + n},${t}`,
@@ -2194,30 +2194,30 @@ function kr(e, t, n, r, i, o, s) {
2194
2194
  a`${e + n * .5},${t + r * .55}`,
2195
2195
  a`${e},${t + r * .55}`
2196
2196
  ].join(" ");
2197
- return a`<polygon points="${c}" ${W(i, o, s)} />`;
2197
+ return a`<polygon points="${c}" ${H(i, o, s)} />`;
2198
2198
  }
2199
- function Ar(e, t, n, r) {
2199
+ function Nr(e, t, n, r) {
2200
2200
  let i = e + n / 2, o = t + r / 2, s = Math.min(n, r) / 2 - 2;
2201
2201
  return a`<circle cx="${i}" cy="${o}" r="${s}" fill="var(--_text)" stroke="none" />`;
2202
2202
  }
2203
- function jr(e, t, n, r) {
2203
+ function Pr(e, t, n, r) {
2204
2204
  let i = e + n / 2, o = t + r / 2, s = Math.min(n, r) / 2 - 2, c = s - 4;
2205
2205
  return a`<circle cx="${i}" cy="${o}" r="${s}" ` + a`fill="none" stroke="var(--_text)" stroke-width="${R.innerBox * 2}" />` + a`\n<circle cx="${i}" cy="${o}" r="${c}" fill="var(--_text)" stroke="none" />`;
2206
2206
  }
2207
- function Mr(e, t, n) {
2207
+ function Fr(e, t, n) {
2208
2208
  if ((e.shape === "state-start" || e.shape === "state-end") && !e.label) return "";
2209
2209
  let i = e.x + e.width / 2, o = e.y + e.height / 2, c = r(e.inlineStyle?.color ?? s(e.inlineStyle?.fill, "var(--_text)")), l = a`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${L.nodeLabel}" fill="${c}"`, u = e.inlineStyle?.["font-family"];
2210
2210
  return u && (l += a` style="font-family: ${r(u)};"`), p(e.label, i, o, n.nodeLabel, l);
2211
2211
  }
2212
- function Nr(e) {
2212
+ function Ir(e) {
2213
2213
  return r(e).replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\t/g, "&#9;");
2214
2214
  }
2215
- function Pr(e, t) {
2216
- return t === void 0 ? e : e.replace("<svg ", a`<svg data-src="${Nr(t)}" `);
2215
+ function Lr(e, t) {
2216
+ return t === void 0 ? e : e.replace("<svg ", a`<svg data-src="${Ir(t)}" `);
2217
2217
  }
2218
2218
  //#endregion
2219
2219
  //#region packages/svg-renderer/src/resolve-colors.ts
2220
- var Fr = class {
2220
+ var Rr = class {
2221
2221
  raw = /* @__PURE__ */ new Map();
2222
2222
  resolved = /* @__PURE__ */ new Map();
2223
2223
  inProgress = /* @__PURE__ */ new Set();
@@ -2229,13 +2229,13 @@ var Fr = class {
2229
2229
  let t = this.raw.get(e);
2230
2230
  if (t === void 0 || this.inProgress.has(e)) return;
2231
2231
  this.inProgress.add(e);
2232
- let n = Hr(t, this).trim();
2232
+ let n = Gr(t, this).trim();
2233
2233
  this.inProgress.delete(e);
2234
2234
  let r = !/\bvar\(|\bcolor-mix\(/.test(n);
2235
2235
  return this.resolved.set(e, r ? n : void 0), r ? n : void 0;
2236
2236
  }
2237
2237
  };
2238
- function Ir(e, t) {
2238
+ function zr(e, t) {
2239
2239
  let n = 0;
2240
2240
  for (let r = t; r < e.length; r++) {
2241
2241
  let t = e[r];
@@ -2244,7 +2244,7 @@ function Ir(e, t) {
2244
2244
  }
2245
2245
  return -1;
2246
2246
  }
2247
- function Lr(e) {
2247
+ function Br(e) {
2248
2248
  let t = [], n = 0, r = 0;
2249
2249
  for (let i = 0; i < e.length; i++) {
2250
2250
  let a = e[i];
@@ -2252,12 +2252,12 @@ function Lr(e) {
2252
2252
  }
2253
2253
  return t.push(e.slice(r)), t;
2254
2254
  }
2255
- var Rr = "(?<![\\w-])(var|color-mix)\\(";
2256
- function zr(e, t) {
2257
- let [n, ...r] = Lr(e), i = (n ?? "").trim(), a = t.lookup(i);
2255
+ var Vr = "(?<![\\w-])(var|color-mix)\\(";
2256
+ function Hr(e, t) {
2257
+ let [n, ...r] = Br(e), i = (n ?? "").trim(), a = t.lookup(i);
2258
2258
  return a === void 0 ? r.length > 0 ? r.join(",").trim() : null : a;
2259
2259
  }
2260
- function Br(e) {
2260
+ function Ur(e) {
2261
2261
  let t = e.trim().split(/\s+/), n, r;
2262
2262
  for (let e of t) if (/^[\d.]+%$/.test(e)) {
2263
2263
  if (r !== void 0) return null;
@@ -2271,61 +2271,61 @@ function Br(e) {
2271
2271
  pct: r
2272
2272
  };
2273
2273
  }
2274
- function Vr(e) {
2275
- let t = Lr(e);
2274
+ function Wr(e) {
2275
+ let t = Br(e);
2276
2276
  if (t.length !== 3) return null;
2277
2277
  let [n, r, i] = t;
2278
2278
  if (n === void 0 || r === void 0 || i === void 0 || !/^\s*in\s+srgb\s*$/i.test(n)) return null;
2279
- let a = Br(r), s = Br(i);
2279
+ let a = Ur(r), s = Ur(i);
2280
2280
  if (!a || !s) return null;
2281
2281
  let c = f(a.color), l = f(s.color);
2282
2282
  if (!c || !l) return null;
2283
2283
  let u = d(c, l, a.pct, s.pct);
2284
2284
  return u ? o(u) : null;
2285
2285
  }
2286
- function Hr(e, t) {
2287
- let n = "", r = 0, i = new RegExp(Rr, "g"), a;
2286
+ function Gr(e, t) {
2287
+ let n = "", r = 0, i = new RegExp(Vr, "g"), a;
2288
2288
  for (; (a = i.exec(e)) !== null;) {
2289
2289
  let o = a[1];
2290
2290
  if (o === void 0) continue;
2291
- let s = a.index, c = s + o.length, l = Ir(e, c);
2291
+ let s = a.index, c = s + o.length, l = zr(e, c);
2292
2292
  if (l === -1) break;
2293
- let u = Hr(e.slice(c + 1, l), t), d = o === "var" ? zr(u, t) : Vr(u);
2293
+ let u = Gr(e.slice(c + 1, l), t), d = o === "var" ? Hr(u, t) : Wr(u);
2294
2294
  n += e.slice(r, s), n += d ?? `${o}(${u})`, r = l + 1, i.lastIndex = r;
2295
2295
  }
2296
2296
  return n + e.slice(r);
2297
2297
  }
2298
- function Ur(e, t) {
2299
- let n = new Fr();
2298
+ function Kr(e, t) {
2299
+ let n = new Rr();
2300
2300
  for (let [e, r] of Object.entries(t)) n.declare(e, r);
2301
- return Hr(e, n);
2301
+ return Gr(e, n);
2302
2302
  }
2303
- var Wr = /(--[\w-]+)\s*:\s*([^;{}]+)/g, Gr = /(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g, Kr = /* @__PURE__ */ new Set(["data-src"]);
2304
- function qr(e, t) {
2305
- Wr.lastIndex = 0;
2303
+ var qr = /(--[\w-]+)\s*:\s*([^;{}]+)/g, Jr = /(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g, Yr = /* @__PURE__ */ new Set(["data-src"]);
2304
+ function Xr(e, t) {
2305
+ qr.lastIndex = 0;
2306
2306
  let n;
2307
- for (; (n = Wr.exec(e)) !== null;) {
2307
+ for (; (n = qr.exec(e)) !== null;) {
2308
2308
  let [, e, r] = n;
2309
2309
  e !== void 0 && r !== void 0 && t.declare(e, r.trim());
2310
2310
  }
2311
2311
  }
2312
- function Jr(e, t) {
2313
- return e.replace(Gr, (e, n, r, i, a) => {
2314
- if (Kr.has(r)) return e;
2312
+ function Zr(e, t) {
2313
+ return e.replace(Jr, (e, n, r, i, a) => {
2314
+ if (Yr.has(r)) return e;
2315
2315
  let o = a[0] ?? "\"";
2316
- return `${n}${r}${i}${o}${Hr(a.slice(1, -1), t)}${o}`;
2316
+ return `${n}${r}${i}${o}${Gr(a.slice(1, -1), t)}${o}`;
2317
2317
  });
2318
2318
  }
2319
- function Yr(e, t) {
2320
- let n = new Fr();
2319
+ function Qr(e, t) {
2320
+ let n = new Rr();
2321
2321
  n.declare("--bg", t.bg), n.declare("--fg", t.fg), t.line && n.declare("--line", t.line), t.accent && n.declare("--accent", t.accent), t.muted && n.declare("--muted", t.muted), t.surface && n.declare("--surface", t.surface), t.border && n.declare("--border", t.border);
2322
2322
  for (let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)) {
2323
2323
  let e = t[1];
2324
- e !== void 0 && qr(e, n);
2324
+ e !== void 0 && Xr(e, n);
2325
2325
  }
2326
2326
  for (let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)) {
2327
2327
  let e = t[1];
2328
- e !== void 0 && qr(e.slice(1, -1), n);
2328
+ e !== void 0 && Xr(e.slice(1, -1), n);
2329
2329
  }
2330
2330
  let r = "", i = 0;
2331
2331
  for (; i < e.length;) {
@@ -2334,7 +2334,7 @@ function Yr(e, t) {
2334
2334
  if (r += e.slice(i, t), e.startsWith("<style", t)) {
2335
2335
  let a = e.indexOf(">", t), o = e.indexOf("</style>", t);
2336
2336
  if (a === -1 || o === -1) break;
2337
- r += e.slice(t, a + 1), r += Hr(e.slice(a + 1, o), n), r += "</style>", i = o + 8;
2337
+ r += e.slice(t, a + 1), r += Gr(e.slice(a + 1, o), n), r += "</style>", i = o + 8;
2338
2338
  continue;
2339
2339
  }
2340
2340
  let a = -1, o = null;
@@ -2349,13 +2349,13 @@ function Yr(e, t) {
2349
2349
  }
2350
2350
  if (a === -1) break;
2351
2351
  let s = e.slice(t, a + 1);
2352
- r += s.startsWith("<!") || s.startsWith("<?") || s.startsWith("</") ? s : Jr(s, n), i = a + 1;
2352
+ r += s.startsWith("<!") || s.startsWith("<?") || s.startsWith("</") ? s : Zr(s, n), i = a + 1;
2353
2353
  }
2354
2354
  return r + e.slice(i);
2355
2355
  }
2356
2356
  //#endregion
2357
2357
  //#region packages/svg-renderer/src/class/layout.ts
2358
- var G = {
2358
+ var U = {
2359
2359
  padding: 40,
2360
2360
  boxPadX: 8,
2361
2361
  headerBaseHeight: 32,
@@ -2374,32 +2374,32 @@ var G = {
2374
2374
  namespacePad: 16,
2375
2375
  namespaceTitleFontSize: 12
2376
2376
  };
2377
- function Xr(e) {
2377
+ function $r(e) {
2378
2378
  return `note ${e}`;
2379
2379
  }
2380
- function Zr(e) {
2380
+ function ei(e) {
2381
2381
  return `${e} link`;
2382
2382
  }
2383
- function Qr(e) {
2383
+ function ti(e) {
2384
2384
  return `namespace ${e}`;
2385
2385
  }
2386
- function $r(e) {
2386
+ function ni(e) {
2387
2387
  let t = new Set(e.classes.map((e) => e.id)), n = /* @__PURE__ */ new Set(), r = [];
2388
2388
  for (let [i, a] of e.namespaces.entries()) {
2389
2389
  let e = [];
2390
2390
  for (let r of a.classIds) !t.has(r) || n.has(r) || (n.add(r), e.push(r));
2391
2391
  e.length > 0 && r.push({
2392
- id: Qr(i),
2392
+ id: ti(i),
2393
2393
  name: a.name,
2394
2394
  classIds: e
2395
2395
  });
2396
2396
  }
2397
2397
  return r;
2398
2398
  }
2399
- function ei(e, t) {
2400
- let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = I(t.fontSizes);
2399
+ function ri(e, t) {
2400
+ let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = Te(t.fontSizes);
2401
2401
  for (let t of e.classes) {
2402
- let e = t.annotation ? G.headerBaseHeight + G.annotationHeight : G.headerBaseHeight, r = t.attributes.length > 0 ? t.attributes.length * G.memberRowHeight + G.sectionPadY : G.emptySectionHeight, a = t.methods.length > 0 ? t.methods.length * G.memberRowHeight + G.sectionPadY : G.emptySectionHeight, o = P(t.label, i.nodeLabel, L.nodeLabel), s = ii(t.attributes), c = ii(t.methods), l = Math.max(G.minWidth, o + G.boxPadX * 2, s + G.boxPadX * 2, c + G.boxPadX * 2), u = e + r + a;
2402
+ let e = t.annotation ? U.headerBaseHeight + U.annotationHeight : U.headerBaseHeight, r = t.attributes.length > 0 ? t.attributes.length * U.memberRowHeight + U.sectionPadY : U.emptySectionHeight, a = t.methods.length > 0 ? t.methods.length * U.memberRowHeight + U.sectionPadY : U.emptySectionHeight, o = F(t.label, i.nodeLabel, L.nodeLabel), s = si(t.attributes), c = si(t.methods), l = Math.max(U.minWidth, o + U.boxPadX * 2, s + U.boxPadX * 2, c + U.boxPadX * 2), u = e + r + a;
2403
2403
  n.set(t.id, {
2404
2404
  width: l,
2405
2405
  height: u,
@@ -2408,19 +2408,19 @@ function ei(e, t) {
2408
2408
  methodHeight: a
2409
2409
  });
2410
2410
  }
2411
- let a = $r(e), o = /* @__PURE__ */ new Map();
2411
+ let a = ni(e), o = /* @__PURE__ */ new Map();
2412
2412
  for (let e of a) for (let t of e.classIds) o.set(t, e.id);
2413
2413
  let s = /* @__PURE__ */ new Map(), c = [];
2414
2414
  for (let e of a) {
2415
- let t = P(e.name, G.namespaceTitleFontSize, L.groupHeader) + G.namespacePad * 2, n = {
2415
+ let t = F(e.name, U.namespaceTitleFontSize, L.groupHeader) + U.namespacePad * 2, n = {
2416
2416
  id: e.id,
2417
2417
  children: [],
2418
2418
  layoutOptions: {
2419
- "elk.padding": je({
2420
- top: G.namespaceTitleHeight + G.namespacePad / 2,
2421
- left: G.namespacePad,
2422
- bottom: G.namespacePad,
2423
- right: G.namespacePad
2419
+ "elk.padding": Ne({
2420
+ top: U.namespaceTitleHeight + U.namespacePad / 2,
2421
+ left: U.namespacePad,
2422
+ bottom: U.namespacePad,
2423
+ right: U.namespacePad
2424
2424
  }),
2425
2425
  "elk.nodeSize.constraints": "MINIMUM_SIZE",
2426
2426
  "elk.nodeSize.minimum": `(${Math.ceil(t)}, 0)`
@@ -2429,11 +2429,11 @@ function ei(e, t) {
2429
2429
  s.set(e.id, n), c.push(n);
2430
2430
  }
2431
2431
  for (let [e, t] of n) {
2432
- let n = Ne(e, t), r = s.get(o.get(e) ?? "");
2432
+ let n = Fe(e, t), r = s.get(o.get(e) ?? "");
2433
2433
  r?.children ? r.children.push(n) : c.push(n);
2434
2434
  }
2435
2435
  let u = { fontSize: i.edgeLabel }, d = [];
2436
- for (let [t, n] of e.relationships.entries()) d.push(H({
2436
+ for (let [t, n] of e.relationships.entries()) d.push(Re({
2437
2437
  id: `e${t}`,
2438
2438
  source: n.from,
2439
2439
  target: n.to,
@@ -2442,12 +2442,12 @@ function ei(e, t) {
2442
2442
  }));
2443
2443
  let f = new Set(n.keys());
2444
2444
  for (let [t, n] of e.notes.entries()) {
2445
- let e = Xr(t), a = l(n.text, i.edgeLabel, L.edgeLabel), o = {
2446
- width: a.width + G.notePadX * 2,
2447
- height: a.height + G.notePadY * 2
2445
+ let e = $r(t), a = l(n.text, i.edgeLabel, L.edgeLabel), o = {
2446
+ width: a.width + U.notePadX * 2,
2447
+ height: a.height + U.notePadY * 2
2448
2448
  };
2449
- r.set(e, o), c.push(Ne(e, o)), n.forClass !== void 0 && f.has(n.forClass) && d.push(H({
2450
- id: Zr(e),
2449
+ r.set(e, o), c.push(Fe(e, o)), n.forClass !== void 0 && f.has(n.forClass) && d.push(Re({
2450
+ id: ei(e),
2451
2451
  source: e,
2452
2452
  target: n.forClass,
2453
2453
  labelStyle: u
@@ -2457,11 +2457,11 @@ function ei(e, t) {
2457
2457
  elkGraph: {
2458
2458
  id: "root",
2459
2459
  layoutOptions: {
2460
- ...Me({
2461
- direction: Ae(void 0, ke.class),
2462
- nodeSpacing: G.nodeSpacing,
2463
- layerSpacing: G.layerSpacing,
2464
- padding: G.padding
2460
+ ...Pe({
2461
+ direction: Me(void 0, je.class),
2462
+ nodeSpacing: U.nodeSpacing,
2463
+ layerSpacing: U.layerSpacing,
2464
+ padding: U.padding
2465
2465
  }),
2466
2466
  "elk.edgeLabels.placement": "CENTER",
2467
2467
  "elk.hierarchyHandling": "INCLUDE_CHILDREN",
@@ -2476,7 +2476,7 @@ function ei(e, t) {
2476
2476
  namespaces: a
2477
2477
  };
2478
2478
  }
2479
- function ti(e, t, n, r, i) {
2479
+ function ii(e, t, n, r, i) {
2480
2480
  let a = /* @__PURE__ */ new Map();
2481
2481
  for (let e of t.classes) a.set(e.id, e);
2482
2482
  let o = new Set(i.map((e) => e.id)), s = /* @__PURE__ */ new Map(), c = [];
@@ -2543,7 +2543,7 @@ function ti(e, t, n, r, i) {
2543
2543
  if (!t)
2544
2544
  /* v8 ignore next */
2545
2545
  throw Error(`Missing ELK edge for relationship ${e}`);
2546
- let r = l(t), i = ht(t, r.x, r.y), a = gt(t, r.x, r.y);
2546
+ let r = l(t), i = vt(t, r.x, r.y), a = yt(t, r.x, r.y);
2547
2547
  f.push({
2548
2548
  from: n.from,
2549
2549
  to: n.to,
@@ -2562,11 +2562,11 @@ function ti(e, t, n, r, i) {
2562
2562
  for (let e of c) g.set(e.id, e);
2563
2563
  let _ = [];
2564
2564
  for (let [e, n] of t.notes.entries()) {
2565
- let t = Xr(e), i = g.get(t), a = r.get(t);
2565
+ let t = $r(e), i = g.get(t), a = r.get(t);
2566
2566
  if (!i || !a)
2567
2567
  /* v8 ignore next */
2568
2568
  throw Error(`Missing layout for note ${e}`);
2569
- let o = m.get(Zr(t));
2569
+ let o = m.get(ei(t));
2570
2570
  _.push({
2571
2571
  id: t,
2572
2572
  text: n.text,
@@ -2575,7 +2575,7 @@ function ti(e, t, n, r, i) {
2575
2575
  y: i.y ?? 0,
2576
2576
  width: i.width ?? a.width,
2577
2577
  height: i.height ?? a.height,
2578
- ...o ? { linkPoints: ht(o, l(o).x, l(o).y) } : {}
2578
+ ...o ? { linkPoints: vt(o, l(o).x, l(o).y) } : {}
2579
2579
  });
2580
2580
  }
2581
2581
  return {
@@ -2587,7 +2587,7 @@ function ti(e, t, n, r, i) {
2587
2587
  namespaces: u
2588
2588
  };
2589
2589
  }
2590
- function ni(e, t = {}) {
2590
+ function ai(e, t = {}) {
2591
2591
  if (e.classes.length === 0 && e.notes.length === 0) return {
2592
2592
  width: 0,
2593
2593
  height: 0,
@@ -2596,54 +2596,54 @@ function ni(e, t = {}) {
2596
2596
  notes: [],
2597
2597
  namespaces: []
2598
2598
  };
2599
- let { elkGraph: n, classSizes: r, noteSizes: i, namespaces: a } = ei(e, t);
2600
- return ti(ye(n, t.layoutCache), e, r, i, a);
2599
+ let { elkGraph: n, classSizes: r, noteSizes: i, namespaces: a } = ri(e, t);
2600
+ return ii(ye(n, t.layoutCache), e, r, i, a);
2601
2601
  }
2602
- function ri(e) {
2603
- return e.length * Math.ceil(Se("M", G.memberFontSize));
2602
+ function oi(e) {
2603
+ return e.length * Math.ceil(Se("M", U.memberFontSize));
2604
2604
  }
2605
- function ii(e) {
2605
+ function si(e) {
2606
2606
  if (e.length === 0) return 0;
2607
2607
  let t = 0;
2608
2608
  for (let n of e) {
2609
- let e = ri(ee(n));
2609
+ let e = oi(j(n));
2610
2610
  e > t && (t = e);
2611
2611
  }
2612
2612
  return t;
2613
2613
  }
2614
2614
  //#endregion
2615
2615
  //#region packages/svg-renderer/src/class/renderer.ts
2616
- var ai = {
2616
+ var ci = {
2617
2617
  memberSize: 11,
2618
2618
  memberWeight: 400,
2619
2619
  annotationSize: 10,
2620
2620
  annotationWeight: 500
2621
2621
  };
2622
- function oi(e, t, n = "Inter", r = !1, i = F, a, o, s, c = !0, l = {}) {
2622
+ function li(e, t, n = "Inter", r = !1, i = I, a, o, s, c = !0, l = {}) {
2623
2623
  let u = [], d = c && e.classes.some((e) => !!g(e.interaction?.href));
2624
- u.push(Pr(x(e.width, e.height, t, r, o, s, d, l.styleAttribute), a)), u.push(De(n, !0, l.nonce)), u.push("<defs>"), u.push(ci()), u.push("</defs>");
2625
- for (let t of e.namespaces) u.push(si(t));
2626
- for (let t of e.relationships) u.push(hi(t));
2627
- for (let t of e.notes) u.push(mi(t));
2628
- for (let t of e.classes) u.push(li(t, i, c));
2629
- for (let t of e.notes) u.push(pi(t, i));
2630
- for (let t of e.relationships) u.push(vi(t, i));
2624
+ u.push(Lr(x(e.width, e.height, t, r, o, s, d, l.styleAttribute), a)), u.push(ke(n, !0, l.nonce)), u.push("<defs>"), u.push(di()), u.push("</defs>");
2625
+ for (let t of e.namespaces) u.push(ui(t));
2626
+ for (let t of e.relationships) u.push(vi(t));
2627
+ for (let t of e.notes) u.push(_i(t));
2628
+ for (let t of e.classes) u.push(fi(t, i, c));
2629
+ for (let t of e.notes) u.push(gi(t, i));
2630
+ for (let t of e.relationships) u.push(xi(t, i));
2631
2631
  return u.push("</svg>"), u.join("\n");
2632
2632
  }
2633
- function si(e) {
2634
- let { x: t, y: n, width: i, height: o } = e, s = G.namespaceTitleHeight, c = R.outerBox;
2633
+ function ui(e) {
2634
+ let { x: t, y: n, width: i, height: o } = e, s = U.namespaceTitleHeight, c = R.outerBox;
2635
2635
  return [
2636
2636
  a`<g class="class-namespace" data-id="${r(e.name)}" data-label="${r(e.name)}">`,
2637
2637
  a` <rect x="${t}" y="${n}" width="${i}" height="${o}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${c}" />`,
2638
2638
  a` <rect x="${t}" y="${n}" width="${i}" height="${s}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${c}" />`,
2639
- a` <text x="${t + G.namespacePad}" y="${n + s / 2}" dy="${z}" font-size="${G.namespaceTitleFontSize}" font-weight="${L.groupHeader}" fill="var(--_text-sec)">${xi(e.name)}</text>`,
2639
+ a` <text x="${t + U.namespacePad}" y="${n + s / 2}" dy="${z}" font-size="${U.namespaceTitleFontSize}" font-weight="${L.groupHeader}" fill="var(--_text-sec)">${wi(e.name)}</text>`,
2640
2640
  "</g>"
2641
2641
  ].join("\n");
2642
2642
  }
2643
- function ci() {
2643
+ function di() {
2644
2644
  return " <marker id=\"cls-inherit\" markerWidth=\"12\" markerHeight=\"10\" refX=\"12\" refY=\"5\" orient=\"auto-start-reverse\">\n <polygon points=\"0 0, 12 5, 0 10\" fill=\"var(--bg)\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>\n <marker id=\"cls-composition\" markerWidth=\"18\" markerHeight=\"14\" refX=\"16.5\" refY=\"7\" orient=\"auto-start-reverse\">\n <polygon points=\"9 1.5, 16.5 7, 9 12.5, 1.5 7\" fill=\"var(--_arrow)\" stroke=\"var(--_arrow)\" stroke-width=\"1\" />\n </marker>\n <marker id=\"cls-aggregation\" markerWidth=\"18\" markerHeight=\"14\" refX=\"16.5\" refY=\"7\" orient=\"auto-start-reverse\">\n <polygon points=\"9 1.5, 16.5 7, 9 12.5, 1.5 7\" fill=\"var(--bg)\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>\n <marker id=\"cls-arrow\" markerWidth=\"8\" markerHeight=\"6\" refX=\"8\" refY=\"3\" orient=\"auto-start-reverse\">\n <polyline points=\"0 0, 8 3, 0 6\" fill=\"none\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>";
2645
2645
  }
2646
- function li(e, t, n = !0) {
2646
+ function fi(e, t, n = !0) {
2647
2647
  let { x: i, y: o, width: c, height: l, headerHeight: u, attrHeight: d, inlineStyle: f } = e, m = [], h = e.interaction, v = r(f?.fill ?? "var(--_node-fill)"), y = r(f?.stroke ?? "var(--_node-stroke)"), b = r(f?.["stroke-width"] ?? String(R.outerBox)), x = f?.fill ? v : "var(--_group-hdr)", S = f?.color ? r(f.color) : f?.fill ? r(s(f.fill, "var(--_text)")) : void 0, C = e.annotation ? a` data-annotation="${r(e.annotation)}"` : "", w = _(e.className), T = [
2648
2648
  a`class="${w ? a`class-node ${w}` : "class-node"}"`,
2649
2649
  a`data-id="${r(e.id)}"`,
@@ -2655,53 +2655,53 @@ function li(e, t, n = !0) {
2655
2655
  let e = h?.target ? a` target="${r(h.target)}"` : "";
2656
2656
  m.push(a` <a href="${r(E)}"${e}>`);
2657
2657
  }
2658
- n && h?.tooltip && m.push(a` <title>${xi(h.tooltip)}</title>`), m.push(a` <rect x="${i}" y="${o}" width="${c}" height="${l}" ` + a`rx="0" ry="0" fill="${v}" stroke="${y}" stroke-width="${b}" />`), m.push(a` <rect x="${i}" y="${o}" width="${c}" height="${u}" ` + a`rx="0" ry="0" fill="${x}" stroke="${y}" stroke-width="${b}" />`);
2658
+ n && h?.tooltip && m.push(a` <title>${wi(h.tooltip)}</title>`), m.push(a` <rect x="${i}" y="${o}" width="${c}" height="${l}" ` + a`rx="0" ry="0" fill="${v}" stroke="${y}" stroke-width="${b}" />`), m.push(a` <rect x="${i}" y="${o}" width="${c}" height="${u}" ` + a`rx="0" ry="0" fill="${x}" stroke="${y}" stroke-width="${b}" />`);
2659
2659
  let D = o + u / 2;
2660
2660
  if (e.annotation) {
2661
2661
  let t = o + 12;
2662
- m.push(a` <text x="${i + c / 2}" y="${t}" text-anchor="middle" dy="${z}" ` + a`font-size="${ai.annotationSize}" font-weight="${ai.annotationWeight}" ` + a`font-style="italic" fill="${S ?? "var(--_text-muted)"}">&lt;&lt;${xi(e.annotation)}&gt;&gt;</text>`), D = o + u / 2 + 6;
2662
+ m.push(a` <text x="${i + c / 2}" y="${t}" text-anchor="middle" dy="${z}" ` + a`font-size="${ci.annotationSize}" font-weight="${ci.annotationWeight}" ` + a`font-style="italic" fill="${S ?? "var(--_text-muted)"}">&lt;&lt;${wi(e.annotation)}&gt;&gt;</text>`), D = o + u / 2 + 6;
2663
2663
  }
2664
2664
  m.push(" " + p(e.label, i + c / 2, D, t.nodeLabel, a`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="${S ?? "var(--_text)"}"`));
2665
2665
  let O = o + u;
2666
2666
  m.push(a` <line x1="${i}" y1="${O}" x2="${i + c}" y2="${O}" ` + a`stroke="${y}" stroke-width="${R.innerBox}" />`);
2667
2667
  for (let t = 0; t < e.attributes.length; t++) {
2668
2668
  let n = e.attributes[t], r = O + 4 + t * 20 + 10;
2669
- m.push(" " + di(n, i + G.boxPadX, r, S));
2669
+ m.push(" " + mi(n, i + U.boxPadX, r, S));
2670
2670
  }
2671
2671
  let k = O + d;
2672
2672
  m.push(a` <line x1="${i}" y1="${k}" x2="${i + c}" y2="${k}" ` + a`stroke="${y}" stroke-width="${R.innerBox}" />`);
2673
2673
  for (let t = 0; t < e.methods.length; t++) {
2674
2674
  let n = e.methods[t], r = k + 4 + t * 20 + 10;
2675
- m.push(" " + di(n, i + G.boxPadX, r, S));
2675
+ m.push(" " + mi(n, i + U.boxPadX, r, S));
2676
2676
  }
2677
2677
  return E && m.push(" </a>"), m.push("</g>"), m.join("\n");
2678
2678
  }
2679
- var ui = 700;
2680
- function di(e, t, n, r) {
2679
+ var pi = 700;
2680
+ function mi(e, t, n, r) {
2681
2681
  let i = e.isAbstract ? " font-style=\"italic\"" : "", o = e.isStatic ? " text-decoration=\"underline\"" : "", s = r ?? "var(--_text-faint)", c = r ?? "var(--_text-sec)", l = r ?? "var(--_text-muted)", u = [];
2682
- e.visibility && u.push(a`<tspan fill="${c}" font-weight="${ui}">${xi(e.visibility)}</tspan><tspan fill="${s}"> </tspan>`);
2682
+ e.visibility && u.push(a`<tspan fill="${c}" font-weight="${pi}">${wi(e.visibility)}</tspan><tspan fill="${s}"> </tspan>`);
2683
2683
  let d = e.isMethod ? a`${e.name}(${e.params || ""})` : e.name;
2684
- return u.push(a`<tspan fill="${c}">${xi(d)}</tspan>`), e.type && (u.push(a`<tspan fill="${s}">: </tspan>`), u.push(a`<tspan fill="${l}">${xi(e.type)}</tspan>`)), a`<text x="${t}" y="${n}" class="mono" dy="${z}" ` + a`font-size="${ai.memberSize}" font-weight="${ai.memberWeight}"${i}${o}>` + a`${u.join("")}</text>`;
2684
+ return u.push(a`<tspan fill="${c}">${wi(d)}</tspan>`), e.type && (u.push(a`<tspan fill="${s}">: </tspan>`), u.push(a`<tspan fill="${l}">${wi(e.type)}</tspan>`)), a`<text x="${t}" y="${n}" class="mono" dy="${z}" ` + a`font-size="${ci.memberSize}" font-weight="${ci.memberWeight}"${i}${o}>` + a`${u.join("")}</text>`;
2685
2685
  }
2686
- var fi = 6;
2687
- function pi(e, t) {
2686
+ var hi = 6;
2687
+ function gi(e, t) {
2688
2688
  let { x: n, y: i, width: o, height: s } = e, c = e.forClass === void 0 ? "" : a` data-for="${r(e.forClass)}"`, l = [
2689
2689
  a`${n},${i}`,
2690
- a`${n + o - fi},${i}`,
2691
- a`${n + o},${i + fi}`,
2690
+ a`${n + o - hi},${i}`,
2691
+ a`${n + o},${i + hi}`,
2692
2692
  a`${n + o},${i + s}`,
2693
2693
  a`${n},${i + s}`
2694
- ].join(" "), u = a`${n + o - fi},${i} ${n + o},${i + fi} ` + a`${n + o - fi},${i + fi}`;
2694
+ ].join(" "), u = a`${n + o - hi},${i} ${n + o},${i + hi} ` + a`${n + o - hi},${i + hi}`;
2695
2695
  return a`<g class="class-note"${c}>` + a`\n <polygon points="${l}" ` + a`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />` + a`\n <polygon points="${u}" ` + a`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />` + a`\n ${p(e.text, n + o / 2, i + s / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`)}` + "\n</g>";
2696
2696
  }
2697
- function mi(e) {
2697
+ function _i(e) {
2698
2698
  if (!e.linkPoints || e.linkPoints.length < 2) return "";
2699
2699
  let t = e.linkPoints.map((e) => a`${e.x},${e.y}`).join(" "), n = e.forClass === void 0 ? "" : a` data-for="${r(e.forClass)}"`;
2700
2700
  return a`<polyline class="class-note-link"${n} points="${t}" ` + a`fill="none" stroke="var(--_line)" stroke-width="${R.connector}" stroke-dasharray="2 3" />`;
2701
2701
  }
2702
- function hi(e) {
2702
+ function vi(e) {
2703
2703
  if (e.points.length < 2) return "";
2704
- let t = e.points.map((e) => a`${e.x},${e.y}`).join(" "), n = e.type === "dependency" || e.type === "realization" ? " stroke-dasharray=\"6 4\"" : "", i = gi(e.type, e.markerAt), o = [
2704
+ let t = e.points.map((e) => a`${e.x},${e.y}`).join(" "), n = e.type === "dependency" || e.type === "realization" ? " stroke-dasharray=\"6 4\"" : "", i = yi(e.type, e.markerAt), o = [
2705
2705
  "class=\"class-relationship\"",
2706
2706
  a`data-from="${r(e.from)}"`,
2707
2707
  a`data-to="${r(e.to)}"`,
@@ -2710,11 +2710,11 @@ function hi(e) {
2710
2710
  ];
2711
2711
  return e.label && o.push(a`data-label="${r(e.label)}"`), e.fromCardinality && o.push(a`data-from-cardinality="${r(e.fromCardinality)}"`), e.toCardinality && o.push(a`data-to-cardinality="${r(e.toCardinality)}"`), a`<polyline ${o.join(" ")} points="${t}" fill="none" stroke="var(--_line)" ` + a`stroke-width="${R.connector}"${n}${i} />`;
2712
2712
  }
2713
- function gi(e, t) {
2714
- let n = _i(e);
2713
+ function yi(e, t) {
2714
+ let n = bi(e);
2715
2715
  return n ? t === "from" ? a` marker-start="url(#${n})"` : a` marker-end="url(#${n})"` : "";
2716
2716
  }
2717
- function _i(e) {
2717
+ function bi(e) {
2718
2718
  switch (e) {
2719
2719
  case "inheritance":
2720
2720
  case "realization": return "cls-inherit";
@@ -2725,30 +2725,30 @@ function _i(e) {
2725
2725
  default: return null;
2726
2726
  }
2727
2727
  }
2728
- function vi(e, t) {
2728
+ function xi(e, t) {
2729
2729
  if (!e.label && !e.fromCardinality && !e.toCardinality || e.points.length < 2) return "";
2730
2730
  let n = [];
2731
2731
  if (e.label) {
2732
- let r = e.labelPosition ?? yi(e.points);
2732
+ let r = e.labelPosition ?? Si(e.points);
2733
2733
  n.push(p(e.label, r.x, r.y - 8, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
2734
2734
  }
2735
2735
  if (e.fromCardinality && e.points.length >= 2) {
2736
- let r = e.points[0], i = e.points[1], o = bi(r, i);
2736
+ let r = e.points[0], i = e.points[1], o = Ci(r, i);
2737
2737
  n.push(p(e.fromCardinality, r.x + o.x, r.y + o.y, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
2738
2738
  }
2739
2739
  if (e.toCardinality && e.points.length >= 2) {
2740
- let r = e.points[e.points.length - 1], i = e.points[e.points.length - 2], o = bi(r, i);
2740
+ let r = e.points[e.points.length - 1], i = e.points[e.points.length - 2], o = Ci(r, i);
2741
2741
  n.push(p(e.toCardinality, r.x + o.x, r.y + o.y, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
2742
2742
  }
2743
2743
  return n.join("\n");
2744
2744
  }
2745
- function yi(e) {
2745
+ function Si(e) {
2746
2746
  return e.length === 0 ? {
2747
2747
  x: 0,
2748
2748
  y: 0
2749
2749
  } : e[Math.floor(e.length / 2)];
2750
2750
  }
2751
- function bi(e, t) {
2751
+ function Ci(e, t) {
2752
2752
  let n = t.x - e.x, r = t.y - e.y;
2753
2753
  return Math.abs(n) > Math.abs(r) ? {
2754
2754
  x: n > 0 ? 14 : -14,
@@ -2758,7 +2758,7 @@ function bi(e, t) {
2758
2758
  y: r > 0 ? 14 : -14
2759
2759
  };
2760
2760
  }
2761
- var xi = i, K = {
2761
+ var wi = i, W = {
2762
2762
  padding: 40,
2763
2763
  boxPadX: 14,
2764
2764
  headerHeight: 34,
@@ -2769,27 +2769,27 @@ var xi = i, K = {
2769
2769
  nodeSpacing: 70,
2770
2770
  layerSpacing: 90
2771
2771
  };
2772
- function Si(e) {
2773
- return e.length * Math.ceil(Se("M", K.attrFontSize));
2772
+ function Ti(e) {
2773
+ return e.length * Math.ceil(Se("M", W.attrFontSize));
2774
2774
  }
2775
- function Ci(e, t) {
2776
- let n = /* @__PURE__ */ new Map(), r = I(t.fontSizes);
2775
+ function Ei(e, t) {
2776
+ let n = /* @__PURE__ */ new Map(), r = Te(t.fontSizes);
2777
2777
  for (let t of e.entities) {
2778
- let e = P(t.label, r.nodeLabel, L.nodeLabel), i = 0;
2778
+ let e = F(t.label, r.nodeLabel, L.nodeLabel), i = 0;
2779
2779
  for (let e of t.attributes) {
2780
- let t = Si(`${e.type} ${e.name}${e.keys.length > 0 ? " " + e.keys.join(",") : ""}`);
2780
+ let t = Ti(`${e.type} ${e.name}${e.keys.length > 0 ? " " + e.keys.join(",") : ""}`);
2781
2781
  t > i && (i = t);
2782
2782
  }
2783
- let a = Math.max(K.minWidth, e + K.boxPadX * 2, i + K.boxPadX * 2), o = K.headerHeight + Math.max(t.attributes.length, 1) * K.rowHeight;
2783
+ let a = Math.max(W.minWidth, e + W.boxPadX * 2, i + W.boxPadX * 2), o = W.headerHeight + Math.max(t.attributes.length, 1) * W.rowHeight;
2784
2784
  n.set(t.id, {
2785
2785
  width: a,
2786
2786
  height: o
2787
2787
  });
2788
2788
  }
2789
2789
  let i = [];
2790
- for (let [e, t] of n) i.push(Ne(e, t));
2790
+ for (let [e, t] of n) i.push(Fe(e, t));
2791
2791
  let a = { fontSize: r.edgeLabel }, o = [];
2792
- for (let [t, n] of e.relationships.entries()) o.push(H({
2792
+ for (let [t, n] of e.relationships.entries()) o.push(Re({
2793
2793
  id: `e${t}`,
2794
2794
  source: n.entity1,
2795
2795
  target: n.entity2,
@@ -2800,11 +2800,11 @@ function Ci(e, t) {
2800
2800
  elkGraph: {
2801
2801
  id: "root",
2802
2802
  layoutOptions: {
2803
- ...Me({
2804
- direction: Ae(e.direction, ke.er),
2805
- nodeSpacing: K.nodeSpacing,
2806
- layerSpacing: K.layerSpacing,
2807
- padding: K.padding
2803
+ ...Pe({
2804
+ direction: Me(e.direction, je.er),
2805
+ nodeSpacing: W.nodeSpacing,
2806
+ layerSpacing: W.layerSpacing,
2807
+ padding: W.padding
2808
2808
  }),
2809
2809
  "elk.edgeLabels.placement": "CENTER",
2810
2810
  "elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
@@ -2816,7 +2816,7 @@ function Ci(e, t) {
2816
2816
  entitySizes: n
2817
2817
  };
2818
2818
  }
2819
- function wi(e, t, n) {
2819
+ function Di(e, t, n) {
2820
2820
  let r = /* @__PURE__ */ new Map();
2821
2821
  for (let e of t.entities) r.set(e.id, e);
2822
2822
  let i = [];
@@ -2835,14 +2835,14 @@ function wi(e, t, n) {
2835
2835
  y: t.y ?? 0,
2836
2836
  width: t.width ?? r.width,
2837
2837
  height: t.height ?? r.height,
2838
- headerHeight: K.headerHeight,
2839
- rowHeight: K.rowHeight
2838
+ headerHeight: W.headerHeight,
2839
+ rowHeight: W.rowHeight
2840
2840
  });
2841
2841
  }
2842
2842
  }
2843
2843
  let a = [];
2844
2844
  for (let [n, r] of (e.edges ?? []).entries()) {
2845
- let e = t.relationships[n], i = ht(r);
2845
+ let e = t.relationships[n], i = vt(r);
2846
2846
  a.push({
2847
2847
  entity1: e.entity1,
2848
2848
  entity2: e.entity2,
@@ -2860,58 +2860,58 @@ function wi(e, t, n) {
2860
2860
  relationships: a
2861
2861
  };
2862
2862
  }
2863
- function Ti(e, t = {}) {
2863
+ function Oi(e, t = {}) {
2864
2864
  if (e.entities.length === 0) return {
2865
2865
  width: 0,
2866
2866
  height: 0,
2867
2867
  entities: [],
2868
2868
  relationships: []
2869
2869
  };
2870
- let { elkGraph: n, entitySizes: r } = Ci(e, t);
2871
- return wi(ye(n, t.layoutCache), e, r);
2870
+ let { elkGraph: n, entitySizes: r } = Ei(e, t);
2871
+ return Di(ye(n, t.layoutCache), e, r);
2872
2872
  }
2873
2873
  //#endregion
2874
2874
  //#region packages/svg-renderer/src/er/renderer.ts
2875
- var Ei = 70, q = {
2875
+ var ki = 70, Ai = {
2876
2876
  attrSize: 11,
2877
2877
  attrWeight: 400,
2878
2878
  keySize: 9,
2879
2879
  keyWeight: 600
2880
2880
  };
2881
- function Di(e, t, n = "Inter", r = !1, i = F, a, o, s, c = {}) {
2881
+ function ji(e, t, n = "Inter", r = !1, i = I, a, o, s, c = {}) {
2882
2882
  let l = [];
2883
- l.push(Pr(x(e.width, e.height, t, r, o, s, void 0, c.styleAttribute), a)), l.push(De(n, !0, c.nonce)), l.push("<defs>"), l.push("</defs>");
2884
- for (let t of e.relationships) l.push(Ai(t));
2885
- for (let t of e.entities) l.push(Oi(t, i));
2886
- for (let t of e.relationships) l.push(Mi(t));
2887
- for (let t of e.relationships) l.push(ji(t, i));
2883
+ l.push(Lr(x(e.width, e.height, t, r, o, s, void 0, c.styleAttribute), a)), l.push(ke(n, !0, c.nonce)), l.push("<defs>"), l.push("</defs>");
2884
+ for (let t of e.relationships) l.push(Pi(t));
2885
+ for (let t of e.entities) l.push(Mi(t, i));
2886
+ for (let t of e.relationships) l.push(Ii(t));
2887
+ for (let t of e.relationships) l.push(Fi(t, i));
2888
2888
  return l.push("</svg>"), l.join("\n");
2889
2889
  }
2890
- function Oi(e, t) {
2890
+ function Mi(e, t) {
2891
2891
  let { id: n, x: i, y: o, width: s, height: c, headerHeight: l, rowHeight: u, label: d, attributes: f } = e, m = [];
2892
2892
  m.push(a`<g class="entity" data-id="${r(n)}" data-label="${r(d)}">`), m.push(a` <rect x="${i}" y="${o}" width="${s}" height="${c}" ` + a`rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), m.push(a` <rect x="${i}" y="${o}" width="${s}" height="${l}" ` + a`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), m.push(" " + p(d, i + s / 2, o + l / 2, t.nodeLabel, a`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="var(--_text)"`));
2893
2893
  let h = o + l;
2894
2894
  m.push(a` <line x1="${i}" y1="${h}" x2="${i + s}" y2="${h}" ` + a`stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`);
2895
2895
  for (let e = 0; e < f.length; e++) {
2896
2896
  let t = f[e], n = h + e * u + u / 2;
2897
- m.push(" " + ki(t, i, n, s).replace(/\n/g, "\n "));
2897
+ m.push(" " + Ni(t, i, n, s).replace(/\n/g, "\n "));
2898
2898
  }
2899
- return f.length === 0 && m.push(a` <text x="${i + s / 2}" y="${h + u / 2}" text-anchor="middle" dy="${z}" ` + a`font-size="${q.attrSize}" fill="var(--_text-faint)" font-style="italic">(no attributes)</text>`), m.push("</g>"), m.join("\n");
2899
+ return f.length === 0 && m.push(a` <text x="${i + s / 2}" y="${h + u / 2}" text-anchor="middle" dy="${z}" ` + a`font-size="${Ai.attrSize}" fill="var(--_text-faint)" font-style="italic">(no attributes)</text>`), m.push("</g>"), m.join("\n");
2900
2900
  }
2901
- function ki(e, t, n, r) {
2901
+ function Ni(e, t, n, r) {
2902
2902
  let i = [], o = e.comment && e.comment.length > 0;
2903
2903
  if (e.comment && e.comment.length > 0) {
2904
2904
  let t = e.comment.replace(/<br\s*\/?>/gi, "\n");
2905
- i.push(a`<g><title>${Fi(t)}</title>`);
2905
+ i.push(a`<g><title>${zi(t)}</title>`);
2906
2906
  }
2907
2907
  let s = 0;
2908
- e.keys.length > 0 && (s = P(e.keys.join(","), q.keySize, q.keyWeight) + 8, i.push(a`<rect x="${t + 6}" y="${n - 7}" width="${s}" height="14" rx="2" ry="2" ` + "fill=\"var(--_key-badge)\" />"), i.push(a`<text x="${t + 6 + s / 2}" y="${n}" text-anchor="middle" dy="${z}" ` + a`font-size="${q.keySize}" font-weight="${q.keyWeight}" fill="var(--_text-sec)">${e.keys.join(",")}</text>`));
2908
+ e.keys.length > 0 && (s = F(e.keys.join(","), Ai.keySize, Ai.keyWeight) + 8, i.push(a`<rect x="${t + 6}" y="${n - 7}" width="${s}" height="14" rx="2" ry="2" ` + "fill=\"var(--_key-badge)\" />"), i.push(a`<text x="${t + 6 + s / 2}" y="${n}" text-anchor="middle" dy="${z}" ` + a`font-size="${Ai.keySize}" font-weight="${Ai.keyWeight}" fill="var(--_text-sec)">${e.keys.join(",")}</text>`));
2909
2909
  let c = t + 8 + (s > 0 ? s + 6 : 0);
2910
- i.push(a`<text x="${c}" y="${n}" class="mono" dy="${z}" ` + a`font-size="${q.attrSize}" font-weight="${q.attrWeight}">` + a`<tspan fill="var(--_text-muted)">${Fi(e.type)}</tspan></text>`);
2910
+ i.push(a`<text x="${c}" y="${n}" class="mono" dy="${z}" ` + a`font-size="${Ai.attrSize}" font-weight="${Ai.attrWeight}">` + a`<tspan fill="var(--_text-muted)">${zi(e.type)}</tspan></text>`);
2911
2911
  let l = t + r - 8;
2912
- return i.push(a`<text x="${l}" y="${n}" class="mono" text-anchor="end" dy="${z}" ` + a`font-size="${q.attrSize}" font-weight="${q.attrWeight}">` + a`<tspan fill="var(--_text-sec)">${Fi(e.name)}</tspan></text>`), o && i.push("</g>"), i.join("\n");
2912
+ return i.push(a`<text x="${l}" y="${n}" class="mono" text-anchor="end" dy="${z}" ` + a`font-size="${Ai.attrSize}" font-weight="${Ai.attrWeight}">` + a`<tspan fill="var(--_text-sec)">${zi(e.name)}</tspan></text>`), o && i.push("</g>"), i.join("\n");
2913
2913
  }
2914
- function Ai(e) {
2914
+ function Pi(e) {
2915
2915
  if (e.points.length < 2) return "";
2916
2916
  let t = e.points.map((e) => a`${e.x},${e.y}`).join(" "), n = e.identifying ? "" : " stroke-dasharray=\"6 4\"", i = e.label ? a` data-label="${r(e.label)}"` : "", o = [
2917
2917
  "class=\"er-relationship\"",
@@ -2923,19 +2923,19 @@ function Ai(e) {
2923
2923
  ];
2924
2924
  return a`<polyline ${o.join(" ")}${i} points="${t}" fill="none" stroke="var(--_line)" ` + a`stroke-width="${R.connector}"${n} />`;
2925
2925
  }
2926
- function ji(e, t) {
2926
+ function Fi(e, t) {
2927
2927
  if (!e.label || e.points.length < 2) return "";
2928
- let n = Pi(e.points), r = l(e.label, t.edgeLabel, L.edgeLabel), i = r.width + 8, o = r.height + 6;
2929
- return a`<rect x="${n.x - i / 2}" y="${n.y - o / 2}" width="${i}" height="${o}" rx="2" ry="2" ` + "fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"0.5\" />" + a`\n${p(e.label, n.x, n.y, t.edgeLabel, a`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${L.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${Ei}%, var(--bg))"`)}`;
2928
+ let n = Ri(e.points), r = l(e.label, t.edgeLabel, L.edgeLabel), i = r.width + 8, o = r.height + 6;
2929
+ return a`<rect x="${n.x - i / 2}" y="${n.y - o / 2}" width="${i}" height="${o}" rx="2" ry="2" ` + "fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"0.5\" />" + a`\n${p(e.label, n.x, n.y, t.edgeLabel, a`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${L.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${ki}%, var(--bg))"`)}`;
2930
2930
  }
2931
- function Mi(e) {
2931
+ function Ii(e) {
2932
2932
  if (e.points.length < 2) return "";
2933
2933
  let t = [], n = e.points[0], r = e.points[1];
2934
- t.push(Ni(n, r, e.cardinality1));
2934
+ t.push(Li(n, r, e.cardinality1));
2935
2935
  let i = e.points[e.points.length - 1], a = e.points[e.points.length - 2];
2936
- return t.push(Ni(i, a, e.cardinality2)), t.join("\n");
2936
+ return t.push(Li(i, a, e.cardinality2)), t.join("\n");
2937
2937
  }
2938
- function Ni(e, t, n) {
2938
+ function Li(e, t, n) {
2939
2939
  let r = [], i = R.connector + .25, o = e.x - t.x, s = e.y - t.y, c = Math.sqrt(o * o + s * s);
2940
2940
  if (c === 0) return "";
2941
2941
  let l = o / c, u = s / c, d = -u, f = l, p = e.x - l * 4, m = e.y - u * 4, h = e.x - l * 16, g = e.y - u * 16, _ = n === "one" || n === "zero-one", v = n === "many" || n === "zero-many", y = n === "zero-one" || n === "zero-many";
@@ -2958,7 +2958,7 @@ function Ni(e, t, n) {
2958
2958
  }
2959
2959
  return r.join("\n");
2960
2960
  }
2961
- function Pi(e) {
2961
+ function Ri(e) {
2962
2962
  if (e.length === 0) return {
2963
2963
  x: 0,
2964
2964
  y: 0
@@ -2984,7 +2984,7 @@ function Pi(e) {
2984
2984
  }
2985
2985
  return e[e.length - 1];
2986
2986
  }
2987
- var Fi = i, Ii = {
2987
+ var zi = i, Bi = {
2988
2988
  padding: 30,
2989
2989
  actorGap: 140,
2990
2990
  actorHeight: 40,
@@ -3006,24 +3006,24 @@ var Fi = i, Ii = {
3006
3006
  noteStackGap: 4,
3007
3007
  boxPad: 10
3008
3008
  };
3009
- function Li(e) {
3009
+ function Vi(e) {
3010
3010
  return e + 8;
3011
3011
  }
3012
- var Ri = 14, zi = 4;
3013
- function Bi(e, t, n) {
3012
+ var Hi = 14, Ui = 4;
3013
+ function Wi(e, t, n) {
3014
3014
  return 14 + l(e, t, n).height / 2;
3015
3015
  }
3016
- function Vi(e) {
3016
+ function Gi(e) {
3017
3017
  return {
3018
- ...Ii,
3019
- actorHeight: e?.actorHeight ?? Ii.actorHeight,
3020
- headerGap: e?.headerGap ?? Ii.headerGap,
3021
- messageRowHeight: e?.messageRowHeight ?? Ii.messageRowHeight,
3022
- noteOffsetAfterMessage: e?.noteOffsetAfterMessage ?? Ii.noteOffsetAfterMessage,
3023
- noteStackGap: e?.noteStackGap ?? Ii.noteStackGap
3018
+ ...Bi,
3019
+ actorHeight: e?.actorHeight ?? Bi.actorHeight,
3020
+ headerGap: e?.headerGap ?? Bi.headerGap,
3021
+ messageRowHeight: e?.messageRowHeight ?? Bi.messageRowHeight,
3022
+ noteOffsetAfterMessage: e?.noteOffsetAfterMessage ?? Bi.noteOffsetAfterMessage,
3023
+ noteStackGap: e?.noteStackGap ?? Bi.noteStackGap
3024
3024
  };
3025
3025
  }
3026
- function Hi(e, t = {}) {
3026
+ function Ki(e, t = {}) {
3027
3027
  if (e.actors.length === 0) return {
3028
3028
  width: 0,
3029
3029
  height: 0,
@@ -3035,8 +3035,8 @@ function Hi(e, t = {}) {
3035
3035
  notes: [],
3036
3036
  boxes: []
3037
3037
  };
3038
- let n = Vi(t.sequence), r = I(t.fontSizes), i = e.actors.map((e) => {
3039
- let t = P(e.label, r.nodeLabel, L.nodeLabel);
3038
+ let n = Gi(t.sequence), r = Te(t.fontSizes), i = e.actors.map((e) => {
3039
+ let t = F(e.label, r.nodeLabel, L.nodeLabel);
3040
3040
  return Math.max(t + n.actorPadX * 2, 80);
3041
3041
  }), a = [], o = n.padding + i[0] / 2;
3042
3042
  for (let t = 0; t < e.actors.length; t++) {
@@ -3048,7 +3048,7 @@ function Hi(e, t = {}) {
3048
3048
  }
3049
3049
  let s = /* @__PURE__ */ new Map();
3050
3050
  for (let t = 0; t < e.actors.length; t++) s.set(e.actors[t].id, t);
3051
- let c = e.boxes.filter((e) => e.actorIds.length > 0), l = c.some((e) => e.label !== ""), u = c.length === 0 ? 0 : n.boxPad + (l ? Li(r.edgeLabel) : 0), d = n.padding + u, f = e.actors.map((e, t) => ({
3051
+ let c = e.boxes.filter((e) => e.actorIds.length > 0), l = c.some((e) => e.label !== ""), u = c.length === 0 ? 0 : n.boxPad + (l ? Vi(r.edgeLabel) : 0), d = n.padding + u, f = e.actors.map((e, t) => ({
3052
3052
  id: e.id,
3053
3053
  label: e.label,
3054
3054
  type: e.type,
@@ -3065,7 +3065,7 @@ function Hi(e, t = {}) {
3065
3065
  height: 0
3066
3066
  };
3067
3067
  return e.color !== void 0 && (u.color = e.color), u;
3068
- }), m = e.actors.map((e) => e.type === "actor" ? Bi(e.label, r.nodeLabel, L.nodeLabel) : 0), h = Math.max(0, ...e.actors.map((e, t) => e.createdAt === void 0 ? m[t] : 0)), g = r.edgeLabel + 12, _ = d + n.actorHeight + Math.max(n.headerGap, h > 0 ? h + zi + g : 0), v = [], y = /* @__PURE__ */ new Map();
3068
+ }), m = e.actors.map((e) => e.type === "actor" ? Wi(e.label, r.nodeLabel, L.nodeLabel) : 0), h = Math.max(0, ...e.actors.map((e, t) => e.createdAt === void 0 ? m[t] : 0)), g = r.edgeLabel + 12, _ = d + n.actorHeight + Math.max(n.headerGap, h > 0 ? h + Ui + g : 0), v = [], y = /* @__PURE__ */ new Map();
3069
3069
  for (let t of e.blocks) {
3070
3070
  let e = y.get(t.startIndex) ?? 0;
3071
3071
  y.set(t.startIndex, Math.max(e, n.blockHeaderExtra));
@@ -3083,7 +3083,7 @@ function Hi(e, t = {}) {
3083
3083
  if (S && S.length > 0) {
3084
3084
  let e = _;
3085
3085
  for (let t of S) {
3086
- let o = Math.max(n.noteWidth, P(t.text, r.edgeLabel, L.edgeLabel) + n.notePadX * 2), c = r.edgeLabel + n.notePadY * 2, l = s.get(t.actorIds[0] ?? "") ?? 0, u;
3086
+ let o = Math.max(n.noteWidth, F(t.text, r.edgeLabel, L.edgeLabel) + n.notePadX * 2), c = r.edgeLabel + n.notePadY * 2, l = s.get(t.actorIds[0] ?? "") ?? 0, u;
3087
3087
  if (t.position === "left") u = a[l] - i[l] / 2 - o - n.noteGap;
3088
3088
  else if (t.position === "right") u = a[l] + i[l] / 2 + n.noteGap;
3089
3089
  else if (t.actorIds.length > 1) {
@@ -3159,7 +3159,7 @@ function Hi(e, t = {}) {
3159
3159
  if (h && h.length > 0) {
3160
3160
  let e = u ? n.selfMessageHeight : 0, o = v[t].y + e + n.noteOffsetAfterMessage;
3161
3161
  for (let e of h) {
3162
- let t = Math.max(n.noteWidth, P(e.text, r.edgeLabel, L.edgeLabel) + n.notePadX * 2), c = r.edgeLabel + n.notePadY * 2, l = s.get(e.actorIds[0] ?? "") ?? 0, u;
3162
+ let t = Math.max(n.noteWidth, F(e.text, r.edgeLabel, L.edgeLabel) + n.notePadX * 2), c = r.edgeLabel + n.notePadY * 2, l = s.get(e.actorIds[0] ?? "") ?? 0, u;
3163
3163
  if (e.position === "left") u = a[l] - i[l] / 2 - t - n.noteGap;
3164
3164
  else if (e.position === "right") u = a[l] + i[l] / 2 + n.noteGap;
3165
3165
  else if (e.actorIds.length > 1) {
@@ -3201,7 +3201,7 @@ function Hi(e, t = {}) {
3201
3201
  let f = Math.min(...d), p = Math.max(...d), m = a[f] - i[f] / 2 - n.blockPadX, h = a[p] + i[p] / 2 + n.blockPadX, g = t.dividers.map((e) => {
3202
3202
  let t = v[e.index], n = t?.y ?? _, i = 28;
3203
3203
  if (e.label && t?.label) {
3204
- let n = P(`[${e.label}]`, r.edgeLabel, L.edgeLabel), a = m + 8, o = a + n, s = P(t.label, r.edgeLabel, L.edgeLabel), c = t.isSelf ? t.x1 + 36 : (t.x1 + t.x2) / 2 - s / 2, l = c + s;
3204
+ let n = F(`[${e.label}]`, r.edgeLabel, L.edgeLabel), a = m + 8, o = a + n, s = F(t.label, r.edgeLabel, L.edgeLabel), c = t.isSelf ? t.x1 + 36 : (t.x1 + t.x2) / 2 - s / 2, l = c + s;
3205
3205
  o > c && a < l && (i = 36);
3206
3206
  }
3207
3207
  return {
@@ -3218,72 +3218,72 @@ function Hi(e, t = {}) {
3218
3218
  height: u - l,
3219
3219
  dividers: g
3220
3220
  };
3221
- }), ee = x, te = _ + n.padding, j = n.padding, M = 0;
3222
- for (let e of f) j = Math.min(j, e.x - e.width / 2), M = Math.max(M, e.x + e.width / 2);
3223
- for (let e of A) j = Math.min(j, e.x), M = Math.max(M, e.x + e.width);
3224
- for (let e of ee) j = Math.min(j, e.x), M = Math.max(M, e.x + e.width);
3225
- for (let e of p) j = Math.min(j, e.x), M = Math.max(M, e.x + e.width);
3221
+ }), j = x, ee = _ + n.padding, M = n.padding, N = 0;
3222
+ for (let e of f) M = Math.min(M, e.x - e.width / 2), N = Math.max(N, e.x + e.width / 2);
3223
+ for (let e of A) M = Math.min(M, e.x), N = Math.max(N, e.x + e.width);
3224
+ for (let e of j) M = Math.min(M, e.x), N = Math.max(N, e.x + e.width);
3225
+ for (let e of p) M = Math.min(M, e.x), N = Math.max(N, e.x + e.width);
3226
3226
  for (let e of v) if (e.isSelf && e.label) {
3227
- let t = e.x1 + 30 + 8, n = P(e.label, r.edgeLabel, L.edgeLabel);
3228
- M = Math.max(M, t + n + 8);
3229
- }
3230
- let N = j < n.padding ? n.padding - j : 0;
3231
- if (N > 0) {
3232
- for (let e of f) e.x += N;
3233
- for (let e of v) e.x1 += N, e.x2 += N;
3234
- for (let e of w) e.x += N;
3235
- for (let e of A) e.x += N;
3236
- for (let e of ee) e.x += N;
3237
- for (let e of p) e.x += N;
3238
- for (let e = 0; e < a.length; e++) a[e] += N;
3227
+ let t = e.x1 + 30 + 8, n = F(e.label, r.edgeLabel, L.edgeLabel);
3228
+ N = Math.max(N, t + n + 8);
3229
+ }
3230
+ let P = M < n.padding ? n.padding - M : 0;
3231
+ if (P > 0) {
3232
+ for (let e of f) e.x += P;
3233
+ for (let e of v) e.x1 += P, e.x2 += P;
3234
+ for (let e of w) e.x += P;
3235
+ for (let e of A) e.x += P;
3236
+ for (let e of j) e.x += P;
3237
+ for (let e of p) e.x += P;
3238
+ for (let e = 0; e < a.length; e++) a[e] += P;
3239
3239
  }
3240
3240
  for (let t = 0; t < e.actors.length; t++) {
3241
3241
  let r = e.actors[t].createdAt;
3242
3242
  r !== void 0 && (f[t].y = (v[r]?.y ?? _) - n.actorHeight / 2);
3243
3243
  }
3244
- let ne = e.actors.map((e, t) => {
3244
+ let te = e.actors.map((e, t) => {
3245
3245
  let r = e.destroyedAt, i = {
3246
3246
  actorId: e.id,
3247
3247
  x: a[t],
3248
- topY: f[t].y + n.actorHeight + (m[t] > 0 ? m[t] + zi : 0),
3249
- bottomY: r === void 0 ? te - n.padding : v[r]?.y ?? _
3248
+ topY: f[t].y + n.actorHeight + (m[t] > 0 ? m[t] + Ui : 0),
3249
+ bottomY: r === void 0 ? ee - n.padding : v[r]?.y ?? _
3250
3250
  };
3251
3251
  return r !== void 0 && (i.destroyed = !0), i;
3252
3252
  });
3253
- for (let e of p) e.height = te - n.padding + n.boxPad - e.y;
3254
- let re = M + N + n.padding;
3253
+ for (let e of p) e.height = ee - n.padding + n.boxPad - e.y;
3254
+ let ne = N + P + n.padding;
3255
3255
  return {
3256
- width: Math.max(re, 200),
3257
- height: Math.max(te, 100),
3256
+ width: Math.max(ne, 200),
3257
+ height: Math.max(ee, 100),
3258
3258
  actors: f,
3259
- lifelines: ne,
3259
+ lifelines: te,
3260
3260
  messages: v,
3261
3261
  activations: w,
3262
3262
  blocks: A,
3263
- notes: ee,
3263
+ notes: j,
3264
3264
  boxes: p
3265
3265
  };
3266
3266
  }
3267
3267
  //#endregion
3268
3268
  //#region packages/svg-renderer/src/sequence/renderer.ts
3269
- function Ui(e, n, r = "Inter", i = !1, a = F, o, s, c, l = {}) {
3269
+ function qi(e, n, r = "Inter", i = !1, a = I, o, s, c, l = {}) {
3270
3270
  let u = [];
3271
- u.push(Pr(x(e.width, e.height, n, i, s, c, void 0, l.styleAttribute), o)), u.push(t(r, !1, l.nonce)), u.push("<defs>"), u.push(Wi()), u.push("</defs>");
3272
- for (let t of e.boxes) u.push(ca(t, a));
3273
- for (let t of e.blocks) u.push(la(t, a));
3274
- let d = ea(e, a);
3275
- for (let t of e.lifelines) u.push(na(t, d));
3276
- for (let t of e.activations) u.push(ia(t));
3277
- for (let t of e.messages) u.push(aa(t, a));
3278
- for (let t of e.notes) u.push(ua(t, a));
3279
- for (let t of e.actors) u.push(Gi(t, a));
3271
+ u.push(Lr(x(e.width, e.height, n, i, s, c, void 0, l.styleAttribute), o)), u.push(t(r, !1, l.nonce)), u.push("<defs>"), u.push(Ji()), u.push("</defs>");
3272
+ for (let t of e.boxes) u.push(fa(t, a));
3273
+ for (let t of e.blocks) u.push(pa(t, a));
3274
+ let d = ia(e, a);
3275
+ for (let t of e.lifelines) u.push(oa(t, d));
3276
+ for (let t of e.activations) u.push(ca(t));
3277
+ for (let t of e.messages) u.push(la(t, a));
3278
+ for (let t of e.notes) u.push(ma(t, a));
3279
+ for (let t of e.actors) u.push(Yi(t, a));
3280
3280
  return u.push("</svg>"), u.join("\n");
3281
3281
  }
3282
- function Wi() {
3283
- let e = B.width, t = B.height;
3282
+ function Ji() {
3283
+ let e = Oe.width, t = Oe.height;
3284
3284
  return a` <marker id="seq-arrow" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse">` + a`\n <polygon points="0 0, ${e} ${t / 2}, 0 ${t}" fill="var(--_arrow)" />` + "\n </marker>" + a`\n <marker id="seq-arrow-open" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse">` + a`\n <polyline points="0 0, ${e} ${t / 2}, 0 ${t}" fill="none" stroke="var(--_arrow)" stroke-width="1" />` + "\n </marker>";
3285
3285
  }
3286
- function Gi(e, t) {
3286
+ function Yi(e, t) {
3287
3287
  let { id: n, x: i, y: o, width: s, height: c, label: l, type: u } = e, d = [];
3288
3288
  if (d.push(a`<g class="actor" data-id="${r(n)}" data-label="${r(l)}" data-type="${u}">`), u === "actor") {
3289
3289
  let e = c / 24 * .9, n = i - 12 * e, r = o + (c - 24 * e) / 2, s = R.outerBox / e, u = "var(--_line)";
@@ -3294,8 +3294,8 @@ function Gi(e, t) {
3294
3294
  }
3295
3295
  return d.push("</g>"), d.join("\n");
3296
3296
  }
3297
- var Ki = 30, qi = 20, Ji = 8, Yi = 10, Xi = 18, Zi = 3, Qi = 2, $i = 3;
3298
- function ea(e, t) {
3297
+ var Xi = 30, Zi = 20, Qi = 8, $i = 10, ea = 18, ta = 3, na = 2, ra = 3;
3298
+ function ia(e, t) {
3299
3299
  let n = [], r = (e) => l(e, t.edgeLabel, L.edgeLabel), i = (e, t, i) => {
3300
3300
  let a = r(e);
3301
3301
  n.push({
@@ -3313,64 +3313,64 @@ function ea(e, t) {
3313
3313
  y1: i + a.height / 2
3314
3314
  });
3315
3315
  };
3316
- for (let t of e.messages) t.label && (t.isSelf ? a(t.label, t.x1 + Ki + Ji, t.y + qi / 2) : i(t.label, (t.x1 + t.x2) / 2, t.y - Yi));
3316
+ for (let t of e.messages) t.label && (t.isSelf ? a(t.label, t.x1 + Xi + Qi, t.y + Zi / 2) : i(t.label, (t.x1 + t.x2) / 2, t.y - $i));
3317
3317
  for (let r of e.blocks) {
3318
- let e = P(`${r.type}${r.label ? ` [${r.label}]` : ""}`.split("\n")[0] ?? "", t.edgeLabel, L.groupHeader) + 16;
3318
+ let e = F(`${r.type}${r.label ? ` [${r.label}]` : ""}`.split("\n")[0] ?? "", t.edgeLabel, L.groupHeader) + 16;
3319
3319
  n.push({
3320
3320
  x0: r.x,
3321
3321
  x1: r.x + e,
3322
3322
  y0: r.y,
3323
- y1: r.y + Xi
3323
+ y1: r.y + ea
3324
3324
  });
3325
3325
  for (let e of r.dividers) e.label && a(`[${e.label}]`, r.x + 8, e.y + 14);
3326
3326
  }
3327
3327
  return n;
3328
3328
  }
3329
- function ta(e, t) {
3330
- let n = t.filter((t) => e.x > t.x0 - Zi && e.x < t.x1 + Zi && t.y1 + Qi > e.topY && t.y0 - Qi < e.bottomY).map((e) => [e.y0 - Qi, e.y1 + Qi]).sort((e, t) => e[0] - t[0]), r = [], i = e.topY;
3331
- for (let [e, t] of n) e - i >= $i && r.push([i, e]), i = Math.max(i, t);
3332
- return e.bottomY - i >= $i && r.push([i, e.bottomY]), r.length > 0 ? r : [[e.topY, e.bottomY]];
3329
+ function aa(e, t) {
3330
+ let n = t.filter((t) => e.x > t.x0 - ta && e.x < t.x1 + ta && t.y1 + na > e.topY && t.y0 - na < e.bottomY).map((e) => [e.y0 - na, e.y1 + na]).sort((e, t) => e[0] - t[0]), r = [], i = e.topY;
3331
+ for (let [e, t] of n) e - i >= ra && r.push([i, e]), i = Math.max(i, t);
3332
+ return e.bottomY - i >= ra && r.push([i, e.bottomY]), r.length > 0 ? r : [[e.topY, e.bottomY]];
3333
3333
  }
3334
- function na(e, t) {
3335
- let n = ta(e, t).map(([t, n]) => a`<line class="lifeline" data-actor="${r(e.actorId)}" ` + a`x1="${e.x}" y1="${t}" x2="${e.x}" y2="${n}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />").join("\n");
3334
+ function oa(e, t) {
3335
+ let n = aa(e, t).map(([t, n]) => a`<line class="lifeline" data-actor="${r(e.actorId)}" ` + a`x1="${e.x}" y1="${t}" x2="${e.x}" y2="${n}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />").join("\n");
3336
3336
  if (!e.destroyed) return n;
3337
- let { x: i, bottomY: o } = e, s = ra;
3337
+ let { x: i, bottomY: o } = e, s = sa;
3338
3338
  return n + a`\n<path class="destroy" data-actor="${r(e.actorId)}" ` + a`d="M${i - s} ${o - s} L${i + s} ${o + s} M${i + s} ${o - s} L${i - s} ${o + s}" ` + a`fill="none" stroke="var(--_line)" stroke-width="${R.outerBox}" stroke-linecap="round" />`;
3339
3339
  }
3340
- var ra = 8;
3341
- function ia(e) {
3340
+ var sa = 8;
3341
+ function ca(e) {
3342
3342
  return a`<rect class="activation" data-actor="${r(e.actorId)}" ` + a`x="${e.x}" y="${e.topY}" width="${e.width}" height="${e.bottomY - e.topY}" ` + a`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`;
3343
3343
  }
3344
- function aa(e, t) {
3344
+ function la(e, t) {
3345
3345
  let n = [], i = e.lineStyle === "dashed" ? " stroke-dasharray=\"6 4\"" : "", o = e.arrowHead === "filled" ? "seq-arrow" : "seq-arrow-open", s = e.bidirectional ? a` marker-start="url(#${o})"` : "";
3346
3346
  if (n.push(a`<g class="message" data-from="${r(e.from)}" data-to="${r(e.to)}" ` + a`data-label="${r(e.label)}" data-line-style="${e.lineStyle}" ` + a`data-arrow-head="${e.arrowHead}" data-self="${e.isSelf}" data-bidirectional="${e.bidirectional}">`), e.isSelf) {
3347
- let r = Ki, c = qi, l = Ji;
3347
+ let r = Xi, c = Zi, l = Qi;
3348
3348
  n.push(a` <polyline points="${e.x1},${e.y} ${e.x1 + r},${e.y} ${e.x1 + r},${e.y + c} ${e.x2},${e.y + c}" ` + a`fill="none" stroke="var(--_line)" stroke-width="${R.connector}"${i} marker-end="url(#${o})"${s} />`), n.push(" " + p(e.label, e.x1 + r + l, e.y + c / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3349
3349
  } else {
3350
3350
  n.push(a` <line x1="${e.x1}" y1="${e.y}" x2="${e.x2}" y2="${e.y}" ` + a`stroke="var(--_line)" stroke-width="${R.connector}"${i} marker-end="url(#${o})"${s} />`);
3351
3351
  let r = (e.x1 + e.x2) / 2;
3352
- n.push(" " + p(e.label, r, e.y - Yi, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3352
+ n.push(" " + p(e.label, r, e.y - $i, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3353
3353
  }
3354
- return e.seqNumber !== void 0 && n.push(" " + oa(e, t)), n.push("</g>"), n.join("\n");
3354
+ return e.seqNumber !== void 0 && n.push(" " + ua(e, t)), n.push("</g>"), n.join("\n");
3355
3355
  }
3356
- function oa(e, t) {
3357
- let n = Math.max(t.edgeLabel - 2, 8), r = e.bidirectional ? e.x1 + Math.sign(e.x2 - e.x1) * (8 + B.width) : e.x1;
3356
+ function ua(e, t) {
3357
+ let n = Math.max(t.edgeLabel - 2, 8), r = e.bidirectional ? e.x1 + Math.sign(e.x2 - e.x1) * (8 + Oe.width) : e.x1;
3358
3358
  return "<g class=\"seq-number\">" + a`<circle cx="${r}" cy="${e.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${R.innerBox}" />` + p(String(e.seqNumber), r, e.y, n, a`font-size="${n}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_arrow)"`) + "</g>";
3359
3359
  }
3360
- var sa = 35;
3361
- function ca(e, t) {
3362
- let n = e.label ? a` data-label="${r(e.label)}"` : "", i = e.color === void 0 ? "" : a` data-color="${r(e.color)}"`, o = e.color === void 0 ? "none" : a`color-mix(in srgb, ${r(e.color)} ${sa}%, var(--bg))`, s = [a`<g class="participant-box"${n}${i}>`, a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" ` + a`fill="${o}" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`];
3363
- return e.label && s.push(" " + p(e.label, e.x + e.width / 2, e.y + Li(t.edgeLabel) / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`)), s.push("</g>"), s.join("\n");
3360
+ var da = 35;
3361
+ function fa(e, t) {
3362
+ let n = e.label ? a` data-label="${r(e.label)}"` : "", i = e.color === void 0 ? "" : a` data-color="${r(e.color)}"`, o = e.color === void 0 ? "none" : a`color-mix(in srgb, ${r(e.color)} ${da}%, var(--bg))`, s = [a`<g class="participant-box"${n}${i}>`, a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" ` + a`fill="${o}" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`];
3363
+ return e.label && s.push(" " + p(e.label, e.x + e.width / 2, e.y + Vi(t.edgeLabel) / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`)), s.push("</g>"), s.join("\n");
3364
3364
  }
3365
- function la(e, t) {
3365
+ function pa(e, t) {
3366
3366
  let n = [], i = e.label ? a` data-label="${r(e.label)}"` : "";
3367
3367
  n.push(a`<g class="block" data-type="${r(e.type)}"${i}>`), n.push(a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + a`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`);
3368
- let o = a`${e.type}${e.label ? a` [${e.label}]` : ""}`, s = o.split("\n")[0], c = P(s, t.edgeLabel, L.groupHeader) + 16, l = Xi;
3368
+ let o = a`${e.type}${e.label ? a` [${e.label}]` : ""}`, s = o.split("\n")[0], c = F(s, t.edgeLabel, L.groupHeader) + 16, l = ea;
3369
3369
  n.push(a` <rect x="${e.x}" y="${e.y}" width="${c}" height="${l}" ` + a`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), n.push(" " + p(o, e.x + 6, e.y + l / 2, t.edgeLabel, a`font-size="${t.edgeLabel}" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`));
3370
3370
  for (let r of e.dividers) n.push(a` <line x1="${e.x}" y1="${r.y}" x2="${e.x + e.width}" y2="${r.y}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />"), r.label && n.push(" " + p(a`[${r.label}]`, e.x + 8, r.y + 14, t.edgeLabel, a`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3371
3371
  return n.push("</g>"), n.join("\n");
3372
3372
  }
3373
- function ua(e, t) {
3373
+ function ma(e, t) {
3374
3374
  let { x: n, y: i, width: o, height: s } = e, c = e.actors && e.actors.length > 0 ? a` data-actors="${e.actors.map(r).join(",")}"` : "", l = e.position ? a` data-position="${r(e.position)}"` : "", u = [
3375
3375
  a`${n},${i}`,
3376
3376
  a`${n + o - 6},${i}`,
@@ -3382,7 +3382,7 @@ function ua(e, t) {
3382
3382
  }
3383
3383
  //#endregion
3384
3384
  //#region packages/svg-renderer/src/xychart/layout.ts
3385
- var J = {
3385
+ var G = {
3386
3386
  plotWidth: 600,
3387
3387
  plotHeight: 340,
3388
3388
  padding: 22,
@@ -3409,29 +3409,29 @@ var J = {
3409
3409
  legendGap: 6,
3410
3410
  legendItemGap: 16
3411
3411
  };
3412
- function da(e, t = {}) {
3413
- return e.horizontal ? pa(e) : fa(e);
3412
+ function ha(e, t = {}) {
3413
+ return e.horizontal ? _a(e) : ga(e);
3414
3414
  }
3415
- function fa(e) {
3415
+ function ga(e) {
3416
3416
  let t = !!e.title, n = !!e.xAxis.title, r = !!e.yAxis.title, i = e.series.length > 1, a = e.yAxis.range;
3417
3417
  if (!a)
3418
3418
  /* v8 ignore next */
3419
3419
  throw Error("XY chart: y-axis range was not set by the parser");
3420
- let o = xa(a.min, a.max), s = Sa(o), c = Math.max(...s.map((e) => P(e, J.axisLabelFontSize, J.axisLabelFontWeight)), J.yLabelWidth), l = J.padding + (t ? J.titleHeight : 0) + (i ? J.legendHeight : 0), u = J.padding + J.xLabelHeight + (n ? J.axisTitlePad : 0), d = J.padding + c + J.yLabelGap + (r ? J.axisTitlePad : 0), f = J.padding, p = J.plotWidth, m = J.plotHeight, h = d + p + f, g = l + m + u, _ = {
3420
+ let o = Ta(a.min, a.max), s = Ea(o), c = Math.max(...s.map((e) => F(e, G.axisLabelFontSize, G.axisLabelFontWeight)), G.yLabelWidth), l = G.padding + (t ? G.titleHeight : 0) + (i ? G.legendHeight : 0), u = G.padding + G.xLabelHeight + (n ? G.axisTitlePad : 0), d = G.padding + c + G.yLabelGap + (r ? G.axisTitlePad : 0), f = G.padding, p = G.plotWidth, m = G.plotHeight, h = d + p + f, g = l + m + u, _ = {
3421
3421
  x: d,
3422
3422
  y: l,
3423
3423
  width: p,
3424
3424
  height: m
3425
- }, v = ma(e), y = (e) => d + (e + .5) * (p / v), b = p / v, x = (e) => {
3425
+ }, v = va(e), y = (e) => d + (e + .5) * (p / v), b = p / v, x = (e) => {
3426
3426
  let t = (e - a.min) / (a.max - a.min || 1);
3427
3427
  return l + m - t * m;
3428
- }, S = va(e, y, l + m, b), C = o.map((e, t) => ({
3428
+ }, S = Sa(e, y, l + m, b), C = o.map((e, t) => ({
3429
3429
  label: s[t],
3430
3430
  x: d,
3431
3431
  y: x(e),
3432
- tx: d - J.tickLength,
3432
+ tx: d - G.tickLength,
3433
3433
  ty: x(e),
3434
- labelX: d - J.yLabelGap,
3434
+ labelX: d - G.yLabelGap,
3435
3435
  labelY: x(e),
3436
3436
  textAnchor: "end"
3437
3437
  })), w = o.map((e) => ({
@@ -3439,30 +3439,30 @@ function fa(e) {
3439
3439
  y1: x(e),
3440
3440
  x2: d + p,
3441
3441
  y2: x(e)
3442
- })), T = ha(e, v), E = e.series.map((e, t) => t), D = ya(e, y, x, b, a.min, T, E), O = ba(e, y, x, T, E), k = J.padding + (t ? J.titleHeight : 0) + J.legendHeight / 2, A = i ? wa(e, h / 2, k, E) : [], ee = {
3442
+ })), T = ya(e, v), E = e.series.map((e, t) => t), D = Ca(e, y, x, b, a.min, T, E), O = wa(e, y, x, T, E), k = G.padding + (t ? G.titleHeight : 0) + G.legendHeight / 2, A = i ? Oa(e, h / 2, k, E) : [], j = {
3443
3443
  x1: d,
3444
3444
  y1: l + m,
3445
3445
  x2: d + p,
3446
3446
  y2: l + m
3447
- }, te = {
3447
+ }, ee = {
3448
3448
  x1: d,
3449
3449
  y1: l,
3450
3450
  x2: d,
3451
3451
  y2: l + m
3452
- }, j = {
3452
+ }, M = {
3453
3453
  ticks: S,
3454
- line: ee,
3454
+ line: j,
3455
3455
  ...e.xAxis.title ? { title: {
3456
3456
  text: e.xAxis.title,
3457
3457
  x: d + p / 2,
3458
- y: g - J.padding
3458
+ y: g - G.padding
3459
3459
  } } : {}
3460
- }, M = {
3460
+ }, N = {
3461
3461
  ticks: C,
3462
- line: te,
3462
+ line: ee,
3463
3463
  ...e.yAxis.title ? { title: {
3464
3464
  text: e.yAxis.title,
3465
- x: J.padding + 4,
3465
+ x: G.padding + 4,
3466
3466
  y: l + m / 2,
3467
3467
  rotate: -90
3468
3468
  } } : {}
@@ -3473,10 +3473,10 @@ function fa(e) {
3473
3473
  title: e.title ? {
3474
3474
  text: e.title,
3475
3475
  x: h / 2,
3476
- y: J.padding + J.titleFontSize
3476
+ y: G.padding + G.titleFontSize
3477
3477
  } : void 0,
3478
- xAxis: j,
3479
- yAxis: M,
3478
+ xAxis: M,
3479
+ yAxis: N,
3480
3480
  plotArea: _,
3481
3481
  bars: D,
3482
3482
  lines: O,
@@ -3484,12 +3484,12 @@ function fa(e) {
3484
3484
  legend: A
3485
3485
  };
3486
3486
  }
3487
- function pa(e) {
3487
+ function _a(e) {
3488
3488
  let t = !!e.title, n = !!e.xAxis.title, r = !!e.yAxis.title, i = e.series.length > 1, a = e.yAxis.range;
3489
3489
  if (!a)
3490
3490
  /* v8 ignore next */
3491
3491
  throw Error("XY chart: y-axis range was not set by the parser");
3492
- let o = xa(a.min, a.max), s = Sa(o), c = ma(e), l = ha(e, c), u = Math.max(...l.map((e) => P(e, J.axisLabelFontSize, J.axisLabelFontWeight)), 40), d = J.padding + (t ? J.titleHeight : 0) + (i ? J.legendHeight : 0), f = J.padding + J.xLabelHeight + (r ? J.axisTitlePad : 0), p = J.padding + u + J.yLabelGap + (n ? J.axisTitlePad : 0), m = J.padding, h = J.plotWidth, g = J.plotHeight, _ = p + h + m, v = d + g + f, y = {
3492
+ let o = Ta(a.min, a.max), s = Ea(o), c = va(e), l = ya(e, c), u = Math.max(...l.map((e) => F(e, G.axisLabelFontSize, G.axisLabelFontWeight)), 40), d = G.padding + (t ? G.titleHeight : 0) + (i ? G.legendHeight : 0), f = G.padding + G.xLabelHeight + (r ? G.axisTitlePad : 0), p = G.padding + u + G.yLabelGap + (n ? G.axisTitlePad : 0), m = G.padding, h = G.plotWidth, g = G.plotHeight, _ = p + h + m, v = d + g + f, y = {
3493
3493
  x: p,
3494
3494
  y: d,
3495
3495
  width: h,
@@ -3502,7 +3502,7 @@ function pa(e) {
3502
3502
  x: b(e),
3503
3503
  y: d + g,
3504
3504
  tx: b(e),
3505
- ty: d + g + J.tickLength,
3505
+ ty: d + g + G.tickLength,
3506
3506
  labelX: b(e),
3507
3507
  labelY: d + g + 18,
3508
3508
  textAnchor: "middle"
@@ -3510,9 +3510,9 @@ function pa(e) {
3510
3510
  label: e,
3511
3511
  x: p,
3512
3512
  y: S(t),
3513
- tx: p - J.tickLength,
3513
+ tx: p - G.tickLength,
3514
3514
  ty: S(t),
3515
- labelX: p - J.yLabelGap,
3515
+ labelX: p - G.yLabelGap,
3516
3516
  labelY: S(t),
3517
3517
  textAnchor: "end"
3518
3518
  })), T = o.map((e) => ({
@@ -3522,14 +3522,14 @@ function pa(e) {
3522
3522
  y2: d + g
3523
3523
  })), E = e.series.map((e, t) => t), D = e.series.filter((e) => e.type === "bar").length, O = [];
3524
3524
  if (D > 0) {
3525
- let t = x * (1 - J.barPadRatio), n = D > 1 ? (t - (D - 1) * J.barGroupGap) / D : t, r = Math.min(n, J.maxBarWidth), i = D > 1 ? r * D + J.barGroupGap * (D - 1) : r, o = 0, s = 0;
3525
+ let t = x * (1 - G.barPadRatio), n = D > 1 ? (t - (D - 1) * G.barGroupGap) / D : t, r = Math.min(n, G.maxBarWidth), i = D > 1 ? r * D + G.barGroupGap * (D - 1) : r, o = 0, s = 0;
3526
3526
  for (let t of e.series) {
3527
3527
  if (t.type !== "bar") {
3528
3528
  s++;
3529
3529
  continue;
3530
3530
  }
3531
3531
  for (let e = 0; e < t.data.length; e++) {
3532
- let n = S(e) - i / 2 + o * (r + J.barGroupGap), c = b(Math.max(t.data[e], a.min)), u = b(Math.max(0, a.min));
3532
+ let n = S(e) - i / 2 + o * (r + G.barGroupGap), c = b(Math.max(t.data[e], a.min)), u = b(Math.max(0, a.min));
3533
3533
  O.push({
3534
3534
  x: Math.min(u, c),
3535
3535
  y: n,
@@ -3544,10 +3544,10 @@ function pa(e) {
3544
3544
  o++, s++;
3545
3545
  }
3546
3546
  }
3547
- let k = [], A = 0, ee = 0;
3547
+ let k = [], A = 0, j = 0;
3548
3548
  for (let t of e.series) {
3549
3549
  if (t.type !== "line") {
3550
- ee++;
3550
+ j++;
3551
3551
  continue;
3552
3552
  }
3553
3553
  let e = t.data.map((e, t) => ({
@@ -3559,74 +3559,74 @@ function pa(e) {
3559
3559
  k.push({
3560
3560
  points: e,
3561
3561
  seriesIndex: A,
3562
- colorIndex: E[ee]
3563
- }), A++, ee++;
3562
+ colorIndex: E[j]
3563
+ }), A++, j++;
3564
3564
  }
3565
- let te = {
3565
+ let ee = {
3566
3566
  x1: p,
3567
3567
  y1: d + g,
3568
3568
  x2: p + h,
3569
3569
  y2: d + g
3570
- }, j = {
3570
+ }, M = {
3571
3571
  x1: p,
3572
3572
  y1: d,
3573
3573
  x2: p,
3574
3574
  y2: d + g
3575
- }, M = {
3575
+ }, N = {
3576
3576
  ticks: C,
3577
- line: te,
3577
+ line: ee,
3578
3578
  ...e.yAxis.title ? { title: {
3579
3579
  text: e.yAxis.title,
3580
3580
  x: p + h / 2,
3581
- y: v - J.padding
3581
+ y: v - G.padding
3582
3582
  } } : {}
3583
- }, N = {
3583
+ }, P = {
3584
3584
  ticks: w,
3585
- line: j,
3585
+ line: M,
3586
3586
  ...e.xAxis.title ? { title: {
3587
3587
  text: e.xAxis.title,
3588
- x: J.padding + 4,
3588
+ x: G.padding + 4,
3589
3589
  y: d + g / 2,
3590
3590
  rotate: -90
3591
3591
  } } : {}
3592
- }, ne = e.title ? {
3592
+ }, te = e.title ? {
3593
3593
  text: e.title,
3594
3594
  x: _ / 2,
3595
- y: J.padding + J.titleFontSize
3596
- } : void 0, re = J.padding + (t ? J.titleHeight : 0) + J.legendHeight / 2;
3595
+ y: G.padding + G.titleFontSize
3596
+ } : void 0, ne = G.padding + (t ? G.titleHeight : 0) + G.legendHeight / 2;
3597
3597
  return {
3598
3598
  width: _,
3599
3599
  height: v,
3600
3600
  horizontal: !0,
3601
- title: ne,
3602
- xAxis: M,
3603
- yAxis: N,
3601
+ title: te,
3602
+ xAxis: N,
3603
+ yAxis: P,
3604
3604
  plotArea: y,
3605
3605
  bars: O,
3606
3606
  lines: k,
3607
3607
  gridLines: T,
3608
- legend: i ? wa(e, _ / 2, re, E) : []
3608
+ legend: i ? Oa(e, _ / 2, ne, E) : []
3609
3609
  };
3610
3610
  }
3611
- function ma(e) {
3611
+ function va(e) {
3612
3612
  if (e.xAxis.categories) return e.xAxis.categories.length;
3613
3613
  for (let t of e.series) if (t.data.length > 0) return t.data.length;
3614
3614
  return 1;
3615
3615
  }
3616
- function ha(e, t) {
3616
+ function ya(e, t) {
3617
3617
  if (e.xAxis.categories) return e.xAxis.categories;
3618
3618
  if (e.xAxis.range) {
3619
3619
  let { min: n, max: r } = e.xAxis.range, i = t > 1 ? (r - n) / (t - 1) : 0;
3620
- return Array.from({ length: t }, (e, t) => Ca(n + i * t));
3620
+ return Array.from({ length: t }, (e, t) => Da(n + i * t));
3621
3621
  }
3622
3622
  return Array.from({ length: t }, (e, t) => String(t + 1));
3623
3623
  }
3624
- var ga = 8;
3625
- function _a(e, t) {
3626
- let n = e.map((e) => P(e, J.axisLabelFontSize, J.axisLabelFontWeight));
3624
+ var ba = 8;
3625
+ function xa(e, t) {
3626
+ let n = e.map((e) => F(e, G.axisLabelFontSize, G.axisLabelFontWeight));
3627
3627
  for (let r = 1; r < e.length; r++) {
3628
3628
  let i = !0;
3629
- for (let a = 0; a + r < e.length; a += r) if (r * t - (n[a] + n[a + r]) / 2 < ga) {
3629
+ for (let a = 0; a + r < e.length; a += r) if (r * t - (n[a] + n[a + r]) / 2 < ba) {
3630
3630
  i = !1;
3631
3631
  break;
3632
3632
  }
@@ -3634,30 +3634,30 @@ function _a(e, t) {
3634
3634
  }
3635
3635
  return Math.max(1, e.length);
3636
3636
  }
3637
- function va(e, t, n, r) {
3638
- let i = ha(e, ma(e)), a = _a(i, r);
3637
+ function Sa(e, t, n, r) {
3638
+ let i = ya(e, va(e)), a = xa(i, r);
3639
3639
  return i.map((e, r) => ({
3640
3640
  label: r % a === 0 ? e : "",
3641
3641
  x: t(r),
3642
3642
  y: n,
3643
3643
  tx: t(r),
3644
- ty: n + J.tickLength,
3644
+ ty: n + G.tickLength,
3645
3645
  labelX: t(r),
3646
3646
  labelY: n + 18,
3647
3647
  textAnchor: "middle"
3648
3648
  }));
3649
3649
  }
3650
- function ya(e, t, n, r, i, a, o) {
3650
+ function Ca(e, t, n, r, i, a, o) {
3651
3651
  let s = e.series.filter((e) => e.type === "bar").length;
3652
3652
  if (s === 0) return [];
3653
- let c = r * (1 - J.barPadRatio), l = s > 1 ? (c - (s - 1) * J.barGroupGap) / s : c, u = Math.min(l, J.maxBarWidth), d = s > 1 ? u * s + J.barGroupGap * (s - 1) : u, f = [], p = 0, m = 0;
3653
+ let c = r * (1 - G.barPadRatio), l = s > 1 ? (c - (s - 1) * G.barGroupGap) / s : c, u = Math.min(l, G.maxBarWidth), d = s > 1 ? u * s + G.barGroupGap * (s - 1) : u, f = [], p = 0, m = 0;
3654
3654
  for (let r of e.series) {
3655
3655
  if (r.type !== "bar") {
3656
3656
  m++;
3657
3657
  continue;
3658
3658
  }
3659
3659
  for (let e = 0; e < r.data.length; e++) {
3660
- let s = t(e) - d / 2 + p * (u + J.barGroupGap), c = n(r.data[e]), l = n(Math.max(0, i));
3660
+ let s = t(e) - d / 2 + p * (u + G.barGroupGap), c = n(r.data[e]), l = n(Math.max(0, i));
3661
3661
  f.push({
3662
3662
  x: s,
3663
3663
  y: Math.min(c, l),
@@ -3673,7 +3673,7 @@ function ya(e, t, n, r, i, a, o) {
3673
3673
  }
3674
3674
  return f;
3675
3675
  }
3676
- function ba(e, t, n, r, i) {
3676
+ function wa(e, t, n, r, i) {
3677
3677
  let a = [], o = 0, s = 0;
3678
3678
  for (let c of e.series) {
3679
3679
  if (c.type !== "line") {
@@ -3694,7 +3694,7 @@ function ba(e, t, n, r, i) {
3694
3694
  }
3695
3695
  return a;
3696
3696
  }
3697
- function xa(e, t) {
3697
+ function Ta(e, t) {
3698
3698
  let n = t - e;
3699
3699
  if (n <= 0) return [e];
3700
3700
  let r = n / 6, i = 10 ** Math.floor(Math.log10(r)), a = r / i, o;
@@ -3703,14 +3703,14 @@ function xa(e, t) {
3703
3703
  for (let e = s; e <= t + o * .001; e += o) c.push(Math.round(e * 1e10) / 1e10);
3704
3704
  return c;
3705
3705
  }
3706
- function Sa(e) {
3706
+ function Ea(e) {
3707
3707
  let t = e.length > 1 ? Math.abs(e[1] - e[0]) : 0, n = t > 0 && t < 1 ? Math.ceil(-Math.log10(t) - 1e-9) : 0;
3708
3708
  return e.map((e) => String(Number.isInteger(e) && n === 0 ? e : Number(e.toFixed(n))));
3709
3709
  }
3710
- function Ca(e) {
3710
+ function Da(e) {
3711
3711
  return Number.isInteger(e) ? String(e) : e.toFixed(+(Math.abs(e) < 10));
3712
3712
  }
3713
- function wa(e, t, n, r) {
3713
+ function Oa(e, t, n, r) {
3714
3714
  let i = [], a = 0, o = 0;
3715
3715
  for (let t = 0; t < e.series.length; t++) {
3716
3716
  let s = e.series[t], c = s.type === "bar" ? `Bar ${a + 1}` : `Line ${o + 1}`;
@@ -3724,15 +3724,15 @@ function wa(e, t, n, r) {
3724
3724
  }), s.type === "bar" ? a++ : o++;
3725
3725
  }
3726
3726
  let s = i.map((e) => {
3727
- let t = P(e.label, J.legendFontSize, J.legendFontWeight);
3728
- return J.legendSwatchW + J.legendGap + t;
3729
- }), c = t - (s.reduce((e, t) => e + t, 0) + (i.length - 1) * J.legendItemGap) / 2;
3730
- for (let e = 0; e < i.length; e++) i[e].x = c, c += s[e] + J.legendItemGap;
3727
+ let t = F(e.label, G.legendFontSize, G.legendFontWeight);
3728
+ return G.legendSwatchW + G.legendGap + t;
3729
+ }), c = t - (s.reduce((e, t) => e + t, 0) + (i.length - 1) * G.legendItemGap) / 2;
3730
+ for (let e = 0; e < i.length; e++) i[e].x = c, c += s[e] + G.legendItemGap;
3731
3731
  return i;
3732
3732
  }
3733
3733
  //#endregion
3734
3734
  //#region packages/svg-renderer/src/xychart/renderer.ts
3735
- var Y = {
3735
+ var K = {
3736
3736
  titleSize: 18,
3737
3737
  titleWeight: 600,
3738
3738
  axisTitleSize: 15,
@@ -3744,7 +3744,7 @@ var Y = {
3744
3744
  dotRadius: 5,
3745
3745
  lineWidth: 2.5,
3746
3746
  barRadius: 8
3747
- }, X = {
3747
+ }, q = {
3748
3748
  fontSize: 15,
3749
3749
  fontWeight: 500,
3750
3750
  height: 32,
@@ -3754,24 +3754,24 @@ var Y = {
3754
3754
  minY: 4,
3755
3755
  pointerSize: 6
3756
3756
  };
3757
- function Ta(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
3758
- let u = [], d = Math.max(0, ...e.bars.map((e) => e.colorIndex), ...e.lines.map((e) => e.colorIndex)), f = Pr(x(e.width, e.height, n, i, s, c, void 0, l.styleAttribute).replace("<svg ", `<svg data-xychart-colors="${d}" `), o);
3757
+ function ka(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
3758
+ let u = [], d = Math.max(0, ...e.bars.map((e) => e.colorIndex), ...e.lines.map((e) => e.colorIndex)), f = Lr(x(e.width, e.height, n, i, s, c, void 0, l.styleAttribute).replace("<svg ", `<svg data-xychart-colors="${d}" `), o);
3759
3759
  u.push(f), u.push(t(r, !1, l.nonce));
3760
- let p = Math.max(...e.lines.map((e) => e.points.length), 0), m = p > 0 && p <= 12, { style: h, defs: g } = Ea(e, a, m, n.accent, n.bg, l.nonce);
3760
+ let p = Math.max(...e.lines.map((e) => e.points.length), 0), m = p > 0 && p <= 12, { style: h, defs: g } = Aa(e, a, m, n.accent, n.bg, l.nonce);
3761
3761
  u.push(h), g && u.push(g);
3762
3762
  let { plotArea: _ } = e, v = e.xAxis.ticks.map((e) => e.x), y = e.horizontal ? e.yAxis.ticks.map((e) => e.y) : e.gridLines.map((e) => e.y1), b = v.length > 1 ? Math.abs(v[1] - v[0]) : _.width / 6, S = y.length > 1 ? Math.abs(y[1] - y[0]) : _.height / 6, C = b / Math.max(1, Math.round(b / 20)), w = S / Math.max(1, Math.round(S / 20)), T = v[0] ?? _.x, E = y[0] ?? _.y, D = T - Math.ceil((T - _.x) / C) * C, O = E - Math.ceil((E - _.y) / w) * w;
3763
- for (let e = O; e <= _.y + _.height + .5; e += w) for (let t = D; t <= _.x + _.width + .5; t += C) u.push(`<circle cx="${Z(t)}" cy="${Z(e)}" r="1.5" class="xychart-grid"/>`);
3763
+ for (let e = O; e <= _.y + _.height + .5; e += w) for (let t = D; t <= _.x + _.width + .5; t += C) u.push(`<circle cx="${J(t)}" cy="${J(e)}" r="1.5" class="xychart-grid"/>`);
3764
3764
  let k = [];
3765
3765
  for (let t of e.bars) {
3766
- let n = ` data-value="${t.value}"${t.label ? ` data-label="${Q(t.label)}"` : ""}`, r = e.horizontal ? Oa(t.x, t.y, t.width, t.height, Y.barRadius) : Da(t.x, t.y, t.width, t.height, Y.barRadius);
3766
+ let n = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`, r = e.horizontal ? Ma(t.x, t.y, t.width, t.height, K.barRadius) : ja(t.x, t.y, t.width, t.height, K.barRadius);
3767
3767
  if (u.push(`<path d="${r}" class="xychart-bar xychart-color-${t.colorIndex}"${n}/>`), a) {
3768
- let e = Ma(t.value), n = t.label ? `${t.label}: ${e}` : e, r = ja(t.x + t.width / 2, t.y, e);
3769
- k.push(`<g class="xychart-bar-group"><rect x="${Z(t.x)}" y="${Z(t.y)}" width="${Z(t.width)}" height="${Z(t.height)}" fill="transparent"/><title>${Q(n)}</title>` + r + "</g>");
3768
+ let e = Ia(t.value), n = t.label ? `${t.label}: ${e}` : e, r = Fa(t.x + t.width / 2, t.y, e);
3769
+ k.push(`<g class="xychart-bar-group"><rect x="${J(t.x)}" y="${J(t.y)}" width="${J(t.width)}" height="${J(t.height)}" fill="transparent"/><title>${Y(n)}</title>` + r + "</g>");
3770
3770
  }
3771
3771
  }
3772
3772
  for (let t of e.lines) {
3773
3773
  if (t.points.length === 0) continue;
3774
- let e = ka(t.points);
3774
+ let e = Na(t.points);
3775
3775
  u.push(`<path d="${e}" class="xychart-line-shadow xychart-color-${t.colorIndex}" transform="translate(0,2)"/>`), u.push(`<path d="${e}" class="xychart-line xychart-color-${t.colorIndex}"/>`);
3776
3776
  }
3777
3777
  let A = [];
@@ -3780,7 +3780,7 @@ function Ta(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
3780
3780
  for (let n of e.legend) n.type === "line" && t.set(n.seriesIndex, n.label);
3781
3781
  let n = /* @__PURE__ */ new Map();
3782
3782
  for (let t of e.lines) for (let e of t.points) {
3783
- let r = Z(e.x), i = n.get(r) ?? [];
3783
+ let r = J(e.x), i = n.get(r) ?? [];
3784
3784
  n.set(r, i), i.push({
3785
3785
  x: e.x,
3786
3786
  y: e.y,
@@ -3793,54 +3793,54 @@ function Ta(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
3793
3793
  for (let e of n.values()) {
3794
3794
  let n = e[0].x, r = e[0].label || "";
3795
3795
  if (a && e.length > 1) {
3796
- let i = Math.min(...e.map((e) => e.y)), a = Math.max(...e.map((e) => e.y)), o = Y.dotRadius * 3, s = `<rect x="${Z(n - o)}" y="${Z(i - o)}" width="${Z(o * 2)}" height="${Z(a - i + o * 2)}" fill="transparent" class="xychart-hit"/>`, c = e.map((e) => ({
3797
- text: Ma(e.value),
3796
+ let i = Math.min(...e.map((e) => e.y)), a = Math.max(...e.map((e) => e.y)), o = K.dotRadius * 3, s = `<rect x="${J(n - o)}" y="${J(i - o)}" width="${J(o * 2)}" height="${J(a - i + o * 2)}" fill="transparent" class="xychart-hit"/>`, c = e.map((e) => ({
3797
+ text: Ia(e.value),
3798
3798
  legendLabel: t.get(e.seriesIndex) || `Line ${e.seriesIndex + 1}`
3799
- })), l = Aa(n, i - Y.dotRadius, r, c), u = c.map((e) => e.text), d = r ? `${r}: ${u.join(" · ")}` : u.join(" · "), f = `<g class="xychart-dot-group">${s}`;
3799
+ })), l = Pa(n, i - K.dotRadius, r, c), u = c.map((e) => e.text), d = r ? `${r}: ${u.join(" · ")}` : u.join(" · "), f = `<g class="xychart-dot-group">${s}`;
3800
3800
  for (let t of e) {
3801
- let e = ` data-value="${t.value}"${t.label ? ` data-label="${Q(t.label)}"` : ""}`;
3802
- f += `<circle cx="${Z(t.x)}" cy="${Z(t.y)}" r="${Y.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`;
3801
+ let e = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`;
3802
+ f += `<circle cx="${J(t.x)}" cy="${J(t.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`;
3803
3803
  }
3804
- f += `<title>${Q(d)}</title>${l}</g>`, A.push(f);
3804
+ f += `<title>${Y(d)}</title>${l}</g>`, A.push(f);
3805
3805
  } else if (a) {
3806
- let t = e[0], r = ` data-value="${t.value}"${t.label ? ` data-label="${Q(t.label)}"` : ""}`, i = Ma(t.value), a = t.label ? `${t.label}: ${i}` : i, o = ja(n, t.y - Y.dotRadius, i), s = m ? `<circle cx="${Z(n)}" cy="${Z(t.y)}" r="${Y.dotRadius * 3}" fill="transparent" class="xychart-hit"/>` : "";
3807
- A.push(`<g class="xychart-dot-group">${s}<circle cx="${Z(t.x)}" cy="${Z(t.y)}" r="${Y.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${Q(a)}</title>${o}</g>`);
3806
+ let t = e[0], r = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`, i = Ia(t.value), a = t.label ? `${t.label}: ${i}` : i, o = Fa(n, t.y - K.dotRadius, i), s = m ? `<circle cx="${J(n)}" cy="${J(t.y)}" r="${K.dotRadius * 3}" fill="transparent" class="xychart-hit"/>` : "";
3807
+ A.push(`<g class="xychart-dot-group">${s}<circle cx="${J(t.x)}" cy="${J(t.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${Y(a)}</title>${o}</g>`);
3808
3808
  } else for (let t of e) {
3809
- let e = ` data-value="${t.value}"${t.label ? ` data-label="${Q(t.label)}"` : ""}`;
3810
- u.push(`<circle cx="${Z(t.x)}" cy="${Z(t.y)}" r="${Y.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`);
3809
+ let e = ` data-value="${t.value}"${t.label ? ` data-label="${Y(t.label)}"` : ""}`;
3810
+ u.push(`<circle cx="${J(t.x)}" cy="${J(t.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`);
3811
3811
  }
3812
3812
  }
3813
3813
  }
3814
- for (let t of e.xAxis.ticks) t.label !== "" && u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${Y.labelSize}" font-weight="${Y.labelWeight}" dy="${z}" class="xychart-label">${Q(t.label)}</text>`);
3815
- for (let t of e.yAxis.ticks) u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${Y.labelSize}" font-weight="${Y.labelWeight}" dy="${z}" class="xychart-label">${Q(t.label)}</text>`);
3814
+ for (let t of e.xAxis.ticks) t.label !== "" && u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${K.labelSize}" font-weight="${K.labelWeight}" dy="${z}" class="xychart-label">${Y(t.label)}</text>`);
3815
+ for (let t of e.yAxis.ticks) u.push(`<text x="${t.labelX}" y="${t.labelY}" text-anchor="${t.textAnchor}" font-size="${K.labelSize}" font-weight="${K.labelWeight}" dy="${z}" class="xychart-label">${Y(t.label)}</text>`);
3816
3816
  if (e.xAxis.title) {
3817
3817
  let t = e.xAxis.title, n = t.rotate ? ` transform="rotate(${t.rotate},${t.x},${t.y})"` : "";
3818
- u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${Y.axisTitleSize}" font-weight="${Y.axisTitleWeight}" dy="${z}" class="xychart-axis-title">${Q(t.text)}</text>`);
3818
+ u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${K.axisTitleSize}" font-weight="${K.axisTitleWeight}" dy="${z}" class="xychart-axis-title">${Y(t.text)}</text>`);
3819
3819
  }
3820
3820
  if (e.yAxis.title) {
3821
3821
  let t = e.yAxis.title, n = t.rotate ? ` transform="rotate(${t.rotate},${t.x},${t.y})"` : "";
3822
- u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${Y.axisTitleSize}" font-weight="${Y.axisTitleWeight}" dy="${z}" class="xychart-axis-title">${Q(t.text)}</text>`);
3822
+ u.push(`<text x="${t.x}" y="${t.y}" text-anchor="middle"${n} font-size="${K.axisTitleSize}" font-weight="${K.axisTitleWeight}" dy="${z}" class="xychart-axis-title">${Y(t.text)}</text>`);
3823
3823
  }
3824
- e.title && u.push(`<text x="${e.title.x}" y="${e.title.y}" text-anchor="middle" font-size="${Y.titleSize}" font-weight="${Y.titleWeight}" dy="${z}" class="xychart-title">${Q(e.title.text)}</text>`);
3824
+ e.title && u.push(`<text x="${e.title.x}" y="${e.title.y}" text-anchor="middle" font-size="${K.titleSize}" font-weight="${K.titleWeight}" dy="${z}" class="xychart-title">${Y(e.title.text)}</text>`);
3825
3825
  for (let t of e.legend) {
3826
3826
  if (t.type === "bar") u.push(`<rect x="${t.x}" y="${t.y - 7}" width="14" height="14" rx="3" class="xychart-bar xychart-color-${t.colorIndex}"/>`);
3827
3827
  else {
3828
3828
  let e = t.y;
3829
- u.push(`<line x1="${t.x}" y1="${e}" x2="${t.x + 14}" y2="${e}" stroke-width="${Y.lineWidth}" stroke-linecap="round" class="xychart-legend-line xychart-color-${t.colorIndex}"/>`);
3829
+ u.push(`<line x1="${t.x}" y1="${e}" x2="${t.x + 14}" y2="${e}" stroke-width="${K.lineWidth}" stroke-linecap="round" class="xychart-legend-line xychart-color-${t.colorIndex}"/>`);
3830
3830
  }
3831
- u.push(`<text x="${t.x + 14 + 6}" y="${t.y}" text-anchor="start" font-size="${Y.legendSize}" font-weight="${Y.legendWeight}" dy="${z}" class="xychart-label">${Q(t.label)}</text>`);
3831
+ u.push(`<text x="${t.x + 14 + 6}" y="${t.y}" text-anchor="start" font-size="${K.legendSize}" font-weight="${K.legendWeight}" dy="${z}" class="xychart-label">${Y(t.label)}</text>`);
3832
3832
  }
3833
3833
  for (let e of k) u.push(e);
3834
3834
  for (let e of A) u.push(e);
3835
3835
  return u.push("</svg>"), u.join("\n");
3836
3836
  }
3837
- function Ea(e, t, n, r, i, a) {
3837
+ function Aa(e, t, n, r, i, a) {
3838
3838
  let o = r ?? E, s = /* @__PURE__ */ new Set();
3839
3839
  for (let t of e.bars) s.add(t.colorIndex);
3840
3840
  for (let t of e.lines) s.add(t.colorIndex);
3841
3841
  let c = [];
3842
3842
  for (let e of [...s].sort((e, t) => e - t)) {
3843
- let t = e === 0 ? `var(--accent, ${E})` : te(e, o, i);
3843
+ let t = e === 0 ? `var(--accent, ${E})` : ee(e, o, i);
3844
3844
  c.push(` --xychart-color-${e}: ${t};`), c.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`);
3845
3845
  }
3846
3846
  let l = [];
@@ -3851,7 +3851,7 @@ function Ea(e, t, n, r, i, a) {
3851
3851
  let u = t ? `
3852
3852
  .xychart-tip { opacity: 0; pointer-events: none; }
3853
3853
  .xychart-tip-bg { fill: var(--_text); filter: drop-shadow(0 1px 3px color-mix(in srgb, var(--fg) 20%, transparent)); }
3854
- .xychart-tip-text { fill: var(--bg); font-size: ${X.fontSize}px; font-weight: ${X.fontWeight}; }
3854
+ .xychart-tip-text { fill: var(--bg); font-size: ${q.fontSize}px; font-weight: ${q.fontWeight}; }
3855
3855
  .xychart-tip-ptr { fill: var(--_text); }
3856
3856
  .xychart-bar-group:hover .xychart-tip,
3857
3857
  .xychart-dot-group:hover .xychart-tip { opacity: 1; }` : "", d = c.length > 0 ? `\n svg {\n${c.join("\n")}\n }` : "";
@@ -3859,7 +3859,7 @@ function Ea(e, t, n, r, i, a) {
3859
3859
  style: `${b(a)}
3860
3860
  .xychart-grid { fill: var(--_inner-stroke); stroke: none; opacity: 0.65; }
3861
3861
  .xychart-bar { stroke-width: 1.5; }
3862
- .xychart-line { fill: none; stroke-width: ${Y.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
3862
+ .xychart-line { fill: none; stroke-width: ${K.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
3863
3863
  .xychart-line-shadow { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.12; }
3864
3864
  .xychart-dot { stroke: var(--bg); stroke-width: 2; }
3865
3865
  .xychart-label { fill: var(--_text-muted); }
@@ -3870,39 +3870,39 @@ ${l.join("\n")}${u}
3870
3870
  defs: ""
3871
3871
  };
3872
3872
  }
3873
- function Da(e, t, n, r, i) {
3873
+ function ja(e, t, n, r, i) {
3874
3874
  let a = Math.min(i, n / 2, r / 2);
3875
- return a <= 0 ? `M${Z(e)},${Z(t)} h${Z(n)} v${Z(r)} h${Z(-n)} Z` : [
3876
- `M${Z(e)},${Z(t + a)}`,
3877
- `Q${Z(e)},${Z(t)} ${Z(e + a)},${Z(t)}`,
3878
- `L${Z(e + n - a)},${Z(t)}`,
3879
- `Q${Z(e + n)},${Z(t)} ${Z(e + n)},${Z(t + a)}`,
3880
- `L${Z(e + n)},${Z(t + r - a)}`,
3881
- `Q${Z(e + n)},${Z(t + r)} ${Z(e + n - a)},${Z(t + r)}`,
3882
- `L${Z(e + a)},${Z(t + r)}`,
3883
- `Q${Z(e)},${Z(t + r)} ${Z(e)},${Z(t + r - a)}`,
3875
+ return a <= 0 ? `M${J(e)},${J(t)} h${J(n)} v${J(r)} h${J(-n)} Z` : [
3876
+ `M${J(e)},${J(t + a)}`,
3877
+ `Q${J(e)},${J(t)} ${J(e + a)},${J(t)}`,
3878
+ `L${J(e + n - a)},${J(t)}`,
3879
+ `Q${J(e + n)},${J(t)} ${J(e + n)},${J(t + a)}`,
3880
+ `L${J(e + n)},${J(t + r - a)}`,
3881
+ `Q${J(e + n)},${J(t + r)} ${J(e + n - a)},${J(t + r)}`,
3882
+ `L${J(e + a)},${J(t + r)}`,
3883
+ `Q${J(e)},${J(t + r)} ${J(e)},${J(t + r - a)}`,
3884
3884
  "Z"
3885
3885
  ].join(" ");
3886
3886
  }
3887
- function Oa(e, t, n, r, i) {
3887
+ function Ma(e, t, n, r, i) {
3888
3888
  let a = Math.min(i, n / 2, r / 2);
3889
- return a <= 0 ? `M${Z(e)},${Z(t)} h${Z(n)} v${Z(r)} h${Z(-n)} Z` : [
3890
- `M${Z(e + a)},${Z(t)}`,
3891
- `L${Z(e + n - a)},${Z(t)}`,
3892
- `Q${Z(e + n)},${Z(t)} ${Z(e + n)},${Z(t + a)}`,
3893
- `L${Z(e + n)},${Z(t + r - a)}`,
3894
- `Q${Z(e + n)},${Z(t + r)} ${Z(e + n - a)},${Z(t + r)}`,
3895
- `L${Z(e + a)},${Z(t + r)}`,
3896
- `Q${Z(e)},${Z(t + r)} ${Z(e)},${Z(t + r - a)}`,
3897
- `L${Z(e)},${Z(t + a)}`,
3898
- `Q${Z(e)},${Z(t)} ${Z(e + a)},${Z(t)}`,
3889
+ return a <= 0 ? `M${J(e)},${J(t)} h${J(n)} v${J(r)} h${J(-n)} Z` : [
3890
+ `M${J(e + a)},${J(t)}`,
3891
+ `L${J(e + n - a)},${J(t)}`,
3892
+ `Q${J(e + n)},${J(t)} ${J(e + n)},${J(t + a)}`,
3893
+ `L${J(e + n)},${J(t + r - a)}`,
3894
+ `Q${J(e + n)},${J(t + r)} ${J(e + n - a)},${J(t + r)}`,
3895
+ `L${J(e + a)},${J(t + r)}`,
3896
+ `Q${J(e)},${J(t + r)} ${J(e)},${J(t + r - a)}`,
3897
+ `L${J(e)},${J(t + a)}`,
3898
+ `Q${J(e)},${J(t)} ${J(e + a)},${J(t)}`,
3899
3899
  "Z"
3900
3900
  ].join(" ");
3901
3901
  }
3902
- function ka(e) {
3902
+ function Na(e) {
3903
3903
  if (e.length === 0) return "";
3904
- if (e.length === 1) return `M${Z(e[0].x)},${Z(e[0].y)}`;
3905
- if (e.length === 2) return `M${Z(e[0].x)},${Z(e[0].y)} L${Z(e[1].x)},${Z(e[1].y)}`;
3904
+ if (e.length === 1) return `M${J(e[0].x)},${J(e[0].y)}`;
3905
+ if (e.length === 2) return `M${J(e[0].x)},${J(e[0].y)} L${J(e[1].x)},${J(e[1].y)}`;
3906
3906
  let t = e.length, n = [], r = [];
3907
3907
  for (let i = 0; i < t - 1; i++) n.push(e[i + 1].x - e[i].x), r.push(n[i] === 0 ? 0 : (e[i + 1].y - e[i].y) / n[i]);
3908
3908
  let i = Array(t).fill(0);
@@ -3917,41 +3917,156 @@ function ka(e) {
3917
3917
  return i * n <= 0 ? i = 0 : n * r <= 0 && Math.abs(i) > 3 * Math.abs(n) && (i = 3 * n), i;
3918
3918
  };
3919
3919
  i[0] = a(n[0], n[1], r[0], r[1]), i[t - 1] = a(n[t - 2], n[t - 3], r[t - 2], r[t - 3]);
3920
- let o = `M${Z(e[0].x)},${Z(e[0].y)}`;
3920
+ let o = `M${J(e[0].x)},${J(e[0].y)}`;
3921
3921
  for (let r = 0; r < t - 1; r++) {
3922
3922
  let t = n[r] / 3, a = e[r].x + t, s = e[r].y + i[r] * t, c = e[r + 1].x - t, l = e[r + 1].y - i[r + 1] * t;
3923
- o += ` C${Z(a)},${Z(s)} ${Z(c)},${Z(l)} ${Z(e[r + 1].x)},${Z(e[r + 1].y)}`;
3923
+ o += ` C${J(a)},${J(s)} ${J(c)},${J(l)} ${J(e[r + 1].x)},${J(e[r + 1].y)}`;
3924
3924
  }
3925
3925
  return o;
3926
3926
  }
3927
- function Aa(e, t, n, r) {
3928
- let i = P(n, X.fontSize, 600), a = Math.max(...r.map((e) => {
3929
- let t = P(e.legendLabel, X.fontSize, X.fontWeight), n = P(e.text, X.fontSize, X.fontWeight);
3927
+ function Pa(e, t, n, r) {
3928
+ let i = F(n, q.fontSize, 600), a = Math.max(...r.map((e) => {
3929
+ let t = F(e.legendLabel, q.fontSize, q.fontWeight), n = F(e.text, q.fontSize, q.fontWeight);
3930
3930
  return t + 10 + n;
3931
- })), o = Math.max(i, a) + X.padX * 2, s = 26 + r.length * 20 + 6, c = Math.max(X.minY, t - X.offsetY - s - X.pointerSize), l = e - o / 2, u = e, d = c + s, f = X.pointerSize, p = `<polygon points="${Z(u - f)},${Z(d)} ${Z(u + f)},${Z(d)} ${Z(u)},${Z(d + f)}" class="xychart-tip xychart-tip-ptr"/>`, m = `<rect x="${Z(l)}" y="${Z(c)}" width="${Z(o)}" height="${s}" rx="${X.rx}" class="xychart-tip xychart-tip-bg"/>`;
3931
+ })), o = Math.max(i, a) + q.padX * 2, s = 26 + r.length * 20 + 6, c = Math.max(q.minY, t - q.offsetY - s - q.pointerSize), l = e - o / 2, u = e, d = c + s, f = q.pointerSize, p = `<polygon points="${J(u - f)},${J(d)} ${J(u + f)},${J(d)} ${J(u)},${J(d + f)}" class="xychart-tip xychart-tip-ptr"/>`, m = `<rect x="${J(l)}" y="${J(c)}" width="${J(o)}" height="${s}" rx="${q.rx}" class="xychart-tip xychart-tip-bg"/>`;
3932
3932
  m += p;
3933
3933
  let h = c + 6 + 10;
3934
- m += `<text x="${Z(e)}" y="${Z(h)}" text-anchor="middle" font-weight="600" font-size="${X.fontSize}" dy="${z}" class="xychart-tip xychart-tip-text">${Q(n)}</text>`;
3935
- let g = l + X.padX, _ = l + o - X.padX;
3936
- for (let e of r) h += 20, m += `<text x="${Z(g)}" y="${Z(h)}" text-anchor="start" font-size="${X.fontSize}" font-weight="${X.fontWeight}" dy="${z}" class="xychart-tip xychart-tip-text">${Q(e.legendLabel)}</text>`, m += `<text x="${Z(_)}" y="${Z(h)}" text-anchor="end" font-size="${X.fontSize}" font-weight="${X.fontWeight}" dy="${z}" class="xychart-tip xychart-tip-text">${Q(e.text)}</text>`;
3934
+ m += `<text x="${J(e)}" y="${J(h)}" text-anchor="middle" font-weight="600" font-size="${q.fontSize}" dy="${z}" class="xychart-tip xychart-tip-text">${Y(n)}</text>`;
3935
+ let g = l + q.padX, _ = l + o - q.padX;
3936
+ for (let e of r) h += 20, m += `<text x="${J(g)}" y="${J(h)}" text-anchor="start" font-size="${q.fontSize}" font-weight="${q.fontWeight}" dy="${z}" class="xychart-tip xychart-tip-text">${Y(e.legendLabel)}</text>`, m += `<text x="${J(_)}" y="${J(h)}" text-anchor="end" font-size="${q.fontSize}" font-weight="${q.fontWeight}" dy="${z}" class="xychart-tip xychart-tip-text">${Y(e.text)}</text>`;
3937
3937
  return m;
3938
3938
  }
3939
- function ja(e, t, n) {
3940
- let r = P(n, X.fontSize, X.fontWeight) + X.padX * 2, i = X.height, a = Math.max(X.minY, t - X.offsetY - i - X.pointerSize), o = e - r / 2, s = e, c = a + i / 2, l = e, u = a + i, d = X.pointerSize, f = `<polygon points="${Z(l - d)},${Z(u)} ${Z(l + d)},${Z(u)} ${Z(l)},${Z(u + d)}" class="xychart-tip xychart-tip-ptr"/>`;
3941
- return `<rect x="${Z(o)}" y="${Z(a)}" width="${Z(r)}" height="${i}" rx="${X.rx}" class="xychart-tip xychart-tip-bg"/>` + f + `<text x="${Z(s)}" y="${Z(c)}" text-anchor="middle" dy="${z}" class="xychart-tip xychart-tip-text">${Q(n)}</text>`;
3939
+ function Fa(e, t, n) {
3940
+ let r = F(n, q.fontSize, q.fontWeight) + q.padX * 2, i = q.height, a = Math.max(q.minY, t - q.offsetY - i - q.pointerSize), o = e - r / 2, s = e, c = a + i / 2, l = e, u = a + i, d = q.pointerSize, f = `<polygon points="${J(l - d)},${J(u)} ${J(l + d)},${J(u)} ${J(l)},${J(u + d)}" class="xychart-tip xychart-tip-ptr"/>`;
3941
+ return `<rect x="${J(o)}" y="${J(a)}" width="${J(r)}" height="${i}" rx="${q.rx}" class="xychart-tip xychart-tip-bg"/>` + f + `<text x="${J(s)}" y="${J(c)}" text-anchor="middle" dy="${z}" class="xychart-tip xychart-tip-text">${Y(n)}</text>`;
3942
3942
  }
3943
- function Ma(e) {
3943
+ function Ia(e) {
3944
3944
  return Number.isInteger(e) ? e.toLocaleString("en-US") : e.toFixed(+(Math.abs(e) < 10));
3945
3945
  }
3946
- function Z(e) {
3946
+ function J(e) {
3947
3947
  return String(Math.round(e * 10) / 10);
3948
3948
  }
3949
- function Q(e) {
3949
+ function Y(e) {
3950
3950
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3951
3951
  }
3952
3952
  //#endregion
3953
+ //#region packages/svg-renderer/src/pie/layout.ts
3954
+ var X = {
3955
+ height: 450,
3956
+ margin: 40,
3957
+ legendRectSize: 18,
3958
+ legendSpacing: 4,
3959
+ textPosition: .75,
3960
+ outerStrokeWidth: 2,
3961
+ titleFontSize: 25,
3962
+ sectionFontSize: 17,
3963
+ legendFontSize: 17,
3964
+ fontWeight: 400,
3965
+ paletteSize: 12,
3966
+ minPercent: 1
3967
+ }, La = Math.PI * 2;
3968
+ function Z(e) {
3969
+ return String(Math.round(e * 100) / 100);
3970
+ }
3971
+ function Ra(e, t, n, r) {
3972
+ return {
3973
+ x: e + n * Math.sin(r),
3974
+ y: t - n * Math.cos(r)
3975
+ };
3976
+ }
3977
+ function za(e, t, n, r, i) {
3978
+ if (i - r >= La - 1e-9) return `M${Z(e)},${Z(t - n)}A${Z(n)},${Z(n)},0,1,1,${Z(e)},${Z(t + n)}A${Z(n)},${Z(n)},0,1,1,${Z(e)},${Z(t - n)}Z`;
3979
+ let a = Ra(e, t, n, r), o = Ra(e, t, n, i), s = +(i - r > Math.PI);
3980
+ return `M${Z(a.x)},${Z(a.y)}A${Z(n)},${Z(n)},0,${s},1,${Z(o.x)},${Z(o.y)}L${Z(e)},${Z(t)}Z`;
3981
+ }
3982
+ function Ba(e, t, n) {
3983
+ return n ? `${e} [${String(t)}]` : e;
3984
+ }
3985
+ function Va(e, t = {}) {
3986
+ let n = X.height, r = n, i = Math.min(r, n) / 2 - X.margin, a = r / 2, o = n / 2, s = e.slices.reduce((e, t) => e + t.value, 0), c = e.slices.map((e, t) => ({
3987
+ slice: e,
3988
+ colorIndex: t % X.paletteSize
3989
+ })).filter(({ slice: e }) => e.value / s * 100 >= X.minPercent), l = c.reduce((e, t) => e + t.slice.value, 0), u = X.legendRectSize + X.legendSpacing, d = e.slices.length, f = u * d / 2, p = a + 12 * X.legendRectSize, m = e.slices.map((t) => Ba(t.label, t.value, e.showData)), h = Math.max(0, ...m.map((e) => F(e, X.legendFontSize, X.fontWeight))), g = d > 0 ? r + X.margin + X.legendRectSize + X.legendSpacing + h : r + X.margin, _ = e.title ?? "", v = _.length > 0 ? F(_, X.titleFontSize, X.fontWeight) : 0, y = a - v / 2, b = a + v / 2, x = Math.min(0, y), S = Math.max(g, b), C = o - f, w = o + (d - 1) * u - f + X.legendRectSize, T = d > 0 ? Math.min(0, C) : 0, E = d > 0 ? Math.max(n, w) : n, D = -x, O = -T, k = a + D, A = o + O, j = [], ee = 0, M = i * X.textPosition;
3990
+ for (let { slice: e, colorIndex: t } of c) {
3991
+ let n = ee, r = ee + e.value / l * La;
3992
+ ee = r;
3993
+ let a = Ra(k, A, M, (n + r) / 2);
3994
+ j.push({
3995
+ label: e.label,
3996
+ value: e.value,
3997
+ colorIndex: t,
3998
+ startAngle: n,
3999
+ endAngle: r,
4000
+ path: za(k, A, i, n, r),
4001
+ percentText: `${(e.value / s * 100).toFixed(0)}%`,
4002
+ labelX: a.x,
4003
+ labelY: a.y
4004
+ });
4005
+ }
4006
+ let N = m.map((e, t) => {
4007
+ let n = p + D, r = o + t * u - f + O;
4008
+ return {
4009
+ text: e,
4010
+ colorIndex: t % X.paletteSize,
4011
+ x: n,
4012
+ y: r,
4013
+ size: X.legendRectSize,
4014
+ textX: n + X.legendRectSize + X.legendSpacing,
4015
+ textY: r + X.legendRectSize - X.legendSpacing
4016
+ };
4017
+ });
4018
+ return {
4019
+ width: Math.ceil(S - x),
4020
+ height: Math.ceil(E - T),
4021
+ cx: k,
4022
+ cy: A,
4023
+ radius: i,
4024
+ outerRadius: i + X.outerStrokeWidth / 2,
4025
+ title: _.length > 0 ? {
4026
+ text: _,
4027
+ x: k,
4028
+ y: A - (n - 50) / 2
4029
+ } : void 0,
4030
+ slices: j,
4031
+ legend: N,
4032
+ accTitle: e.accTitle,
4033
+ accDescr: e.accDescr
4034
+ };
4035
+ }
4036
+ //#endregion
4037
+ //#region packages/svg-renderer/src/pie/renderer.ts
4038
+ function Q(e) {
4039
+ return String(Math.round(e * 100) / 100);
4040
+ }
4041
+ function Ha(e, t, n) {
4042
+ return e === 0 ? `var(--accent, ${E})` : ee(e, t ?? E, n);
4043
+ }
4044
+ function Ua(e, t, n) {
4045
+ let r = /* @__PURE__ */ new Set();
4046
+ for (let t of e.slices) r.add(t.colorIndex);
4047
+ for (let t of e.legend) r.add(t.colorIndex);
4048
+ let i = [...r].sort((e, t) => e - t), a = i.map((e) => ` --pie-color-${e}: ${Ha(e, t.accent, t.bg)};`), o = i.map((e) => ` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`), s = a.length > 0 ? `\n svg {\n${a.join("\n")}\n }` : "";
4049
+ return `${b(n)}
4050
+ .pie-outer { fill: none; stroke: var(--fg); stroke-width: ${X.outerStrokeWidth}px; }
4051
+ .pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }
4052
+ .pie-slice-label { fill: var(--_text); font-size: ${X.sectionFontSize}px; font-weight: ${X.fontWeight}; }
4053
+ .pie-title { fill: var(--_text); font-size: ${X.titleFontSize}px; font-weight: ${X.fontWeight}; }
4054
+ .pie-legend-text { fill: var(--_text); font-size: ${X.legendFontSize}px; font-weight: ${X.fontWeight}; }${s}
4055
+ ${o.join("\n")}
4056
+ </style>`;
4057
+ }
4058
+ function Wa(e, n, a = "Inter", o = !1, s, c, l, u = {}) {
4059
+ let d = [];
4060
+ d.push(Lr(x(e.width, e.height, n, o, c ?? e.accTitle, l, void 0, u.styleAttribute, e.accDescr), s)), d.push(t(a, !1, u.nonce)), d.push(Ua(e, n, u.nonce)), d.push(`<circle cx="${Q(e.cx)}" cy="${Q(e.cy)}" r="${Q(e.outerRadius)}" class="pie-outer"/>`);
4061
+ for (let t of e.slices) d.push(`<path d="${t.path}" class="pie-slice pie-color-${t.colorIndex}" data-label="${r(t.label)}" data-value="${t.value}"/>`);
4062
+ for (let t of e.slices) d.push(`<text x="${Q(t.labelX)}" y="${Q(t.labelY)}" text-anchor="middle" class="pie-slice-label">${i(t.percentText)}</text>`);
4063
+ e.title && d.push(`<text x="${Q(e.title.x)}" y="${Q(e.title.y)}" text-anchor="middle" class="pie-title">${i(e.title.text)}</text>`);
4064
+ for (let t of e.legend) d.push(`<g class="pie-legend"><rect x="${Q(t.x)}" y="${Q(t.y)}" width="${t.size}" height="${t.size}" class="pie-legend-swatch pie-color-${t.colorIndex}"/><text x="${Q(t.textX)}" y="${Q(t.textY)}" class="pie-legend-text">${i(t.text)}</text></g>`);
4065
+ return d.push("</svg>"), d.join("\n");
4066
+ }
4067
+ //#endregion
3953
4068
  //#region packages/svg-renderer/src/c4/arial-widths.ts
3954
- var Na = 2048, Pa = [
4069
+ var Ga = 2048, Ka = [
3955
4070
  569,
3956
4071
  569,
3957
4072
  727,
@@ -4047,7 +4162,7 @@ var Na = 2048, Pa = [
4047
4162
  532,
4048
4163
  684,
4049
4164
  1196
4050
- ], Fa = [
4165
+ ], qa = [
4051
4166
  569,
4052
4167
  682,
4053
4168
  971,
@@ -4144,9 +4259,9 @@ var Na = 2048, Pa = [
4144
4259
  801,
4145
4260
  1196
4146
4261
  ];
4147
- function Ia(e, t) {
4262
+ function Ja(e, t) {
4148
4263
  let n = e.codePointAt(0);
4149
- if (!(n < 32 || n > 126)) return (t ? Fa : Pa)[n - 32] / Na;
4264
+ if (!(n < 32 || n > 126)) return (t ? qa : Ka)[n - 32] / Ga;
4150
4265
  }
4151
4266
  //#endregion
4152
4267
  //#region packages/svg-renderer/src/c4/metrics.ts
@@ -4185,20 +4300,20 @@ var $ = {
4185
4300
  personHeadOverlap: .27,
4186
4301
  dbTrim: 3.91,
4187
4302
  queueExtra: 10
4188
- }, La = $.width - 2 * $.shapePadding;
4189
- function Ra(e, t, n) {
4303
+ }, Ya = $.width - 2 * $.shapePadding;
4304
+ function Xa(e, t, n) {
4190
4305
  let r = [];
4191
4306
  for (let i of e.split("\n")) {
4192
4307
  let e = "";
4193
4308
  for (let a of i.split(/\s+/).filter(Boolean)) {
4194
4309
  let i = e ? `${e} ${a}` : a;
4195
- e && Wa(i, n, 400) > t ? (r.push(e), e = a) : e = i;
4310
+ e && no(i, n, 400) > t ? (r.push(e), e = a) : e = i;
4196
4311
  }
4197
4312
  r.push(e);
4198
4313
  }
4199
4314
  return r;
4200
4315
  }
4201
- function za(e, t) {
4316
+ function Za(e, t) {
4202
4317
  let n = Math.min(Math.max(e * $.personHeadRatio, $.personHeadMin), $.personHeadMax), r = n * (2 - $.personHeadOverlap), i = t === void 0 ? Infinity : t - r;
4203
4318
  return {
4204
4319
  rx: Math.min(e * $.personRx, i * $.personRxMaxOfHeight),
@@ -4206,43 +4321,43 @@ function za(e, t) {
4206
4321
  pillTop: r
4207
4322
  };
4208
4323
  }
4209
- function Ba(e, t) {
4210
- return e * $.nameLine + $.typeLine + Va(t);
4324
+ function Qa(e, t) {
4325
+ return e * $.nameLine + $.typeLine + $a(t);
4211
4326
  }
4212
- function Va(e) {
4327
+ function $a(e) {
4213
4328
  return e === 0 ? 0 : $.descrLine + (e - 1) * $.descrExtraLine;
4214
4329
  }
4215
- function Ha(e) {
4330
+ function eo(e) {
4216
4331
  let t = e / 2;
4217
4332
  return {
4218
4333
  rx: t,
4219
4334
  ry: t / (2.5 + e / 50)
4220
4335
  };
4221
4336
  }
4222
- function Ua(e) {
4337
+ function to(e) {
4223
4338
  let t = e / 2;
4224
4339
  return {
4225
4340
  rx: t / (2.5 + e / 50),
4226
4341
  ry: t
4227
4342
  };
4228
4343
  }
4229
- function Wa(e, t, n) {
4344
+ function no(e, t, n) {
4230
4345
  let r = 0;
4231
4346
  for (let i of e) {
4232
- let e = Ia(i, n >= 600);
4233
- r += e === void 0 ? P(i, t, n) * $.textScale : e * t;
4347
+ let e = Ja(i, n >= 600);
4348
+ r += e === void 0 ? F(i, t, n) * $.textScale : e * t;
4234
4349
  }
4235
4350
  return r;
4236
4351
  }
4237
- function Ga(e, t, n, r) {
4238
- let i = Ba(t, n), a = i + 2 * $.shapePadding, o = Math.max($.width, r + 2 * $.shapePadding);
4352
+ function ro(e, t, n, r) {
4353
+ let i = Qa(t, n), a = i + 2 * $.shapePadding, o = Math.max($.width, r + 2 * $.shapePadding);
4239
4354
  if (e.kind === "person") return {
4240
4355
  width: o,
4241
- height: za(o).pillTop + a,
4356
+ height: Za(o).pillTop + a,
4242
4357
  textHeight: i
4243
4358
  };
4244
4359
  if (e.shape === "db") {
4245
- let { ry: e } = Ha(o);
4360
+ let { ry: e } = eo(o);
4246
4361
  return {
4247
4362
  width: o,
4248
4363
  height: a + 2 * e - $.dbTrim,
@@ -4250,7 +4365,7 @@ function Ga(e, t, n, r) {
4250
4365
  };
4251
4366
  }
4252
4367
  if (e.shape === "queue") {
4253
- let e = i + $.queueExtra, { rx: t } = Ua(e);
4368
+ let e = i + $.queueExtra, { rx: t } = to(e);
4254
4369
  return {
4255
4370
  width: o + 3 * t,
4256
4371
  height: e,
@@ -4263,7 +4378,7 @@ function Ga(e, t, n, r) {
4263
4378
  textHeight: i
4264
4379
  };
4265
4380
  }
4266
- function Ka(e) {
4381
+ function io(e) {
4267
4382
  let t = "#ffffff";
4268
4383
  if (e.external) switch (e.kind) {
4269
4384
  case "person": return {
@@ -4312,33 +4427,33 @@ function Ka(e) {
4312
4427
  }
4313
4428
  //#endregion
4314
4429
  //#region packages/svg-renderer/src/c4/layout.ts
4315
- function qa() {
4430
+ function ao() {
4316
4431
  return { next: { cnt: 0 } };
4317
4432
  }
4318
- function Ja(e, t, n, r, i) {
4433
+ function oo(e, t, n, r, i) {
4319
4434
  e.next.startx = e.startx = t, e.next.stopx = e.stopx = n, e.next.starty = e.starty = r, e.next.stopy = e.stopy = i;
4320
4435
  }
4321
- function Ya(e, t, n, r) {
4436
+ function so(e, t, n, r) {
4322
4437
  let i = e[t];
4323
4438
  e[t] = i === void 0 ? n : r(n, i);
4324
4439
  }
4325
- function Xa(e, t) {
4440
+ function co(e, t) {
4326
4441
  e.next.cnt += 1;
4327
4442
  let n = $.shapeMargin, r = e.next.startx === e.next.stopx ? e.next.stopx + n : e.next.stopx + n * 2, i = r + t.width, a = e.next.starty + n * 2, o = a + t.height;
4328
- (r >= e.widthLimit || i >= e.widthLimit || e.next.cnt > $.shapeInRow) && (r = e.next.startx + n + $.nextLinePaddingX, a = e.next.stopy + n * 2, e.next.stopx = i = r + t.width, e.next.starty = e.next.stopy, e.next.stopy = o = a + t.height, e.next.cnt = 1), t.x = r, t.y = a, Ya(e, "startx", r, Math.min), Ya(e, "starty", a, Math.min), Ya(e, "stopx", i, Math.max), Ya(e, "stopy", o, Math.max), Ya(e.next, "startx", r, Math.min), Ya(e.next, "starty", a, Math.min), Ya(e.next, "stopx", i, Math.max), Ya(e.next, "stopy", o, Math.max);
4443
+ (r >= e.widthLimit || i >= e.widthLimit || e.next.cnt > $.shapeInRow) && (r = e.next.startx + n + $.nextLinePaddingX, a = e.next.stopy + n * 2, e.next.stopx = i = r + t.width, e.next.starty = e.next.stopy, e.next.stopy = o = a + t.height, e.next.cnt = 1), t.x = r, t.y = a, so(e, "startx", r, Math.min), so(e, "starty", a, Math.min), so(e, "stopx", i, Math.max), so(e, "stopy", o, Math.max), so(e.next, "startx", r, Math.min), so(e.next, "starty", a, Math.min), so(e.next, "stopx", i, Math.max), so(e.next, "stopy", o, Math.max);
4329
4444
  }
4330
- function Za(e) {
4331
- let t = Ra(e.label, La, $.nameSize), n = e.description ? Ra(e.description, La, $.descrSize) : [], r = Math.max(...t.map((e) => Wa(e, $.nameSize, 700)), Wa(A(e), $.typeSize, 400), ...n.map((e) => Wa(e, $.descrSize, 400)));
4445
+ function lo(e) {
4446
+ let t = Xa(e.label, Ya, $.nameSize), n = e.description ? Xa(e.description, Ya, $.descrSize) : [], r = Math.max(...t.map((e) => no(e, $.nameSize, 700)), no(A(e), $.typeSize, 400), ...n.map((e) => no(e, $.descrSize, 400)));
4332
4447
  return {
4333
4448
  el: e,
4334
4449
  nameLines: t,
4335
4450
  descriptionLines: n,
4336
4451
  x: 0,
4337
4452
  y: 0,
4338
- ...Ga(e, t.length, n.length, r)
4453
+ ...ro(e, t.length, n.length, r)
4339
4454
  };
4340
4455
  }
4341
- function Qa(e) {
4456
+ function uo(e) {
4342
4457
  let t = /* @__PURE__ */ new Set(), n = new Map(e.elements.map((e) => [e.alias, e])), r = (e) => {
4343
4458
  let i = e.elementAliases.flatMap((e) => {
4344
4459
  t.add(e);
@@ -4358,15 +4473,15 @@ function Qa(e) {
4358
4473
  children: i
4359
4474
  };
4360
4475
  }
4361
- function $a(e) {
4476
+ function fo(e) {
4362
4477
  let t = /* @__PURE__ */ new Map(), n = [], r = $.diagramMarginX, i = $.diagramMarginY, a = (e, n) => {
4363
4478
  for (let r of n) {
4364
- let n = Za(r);
4365
- t.set(r.alias, n), Xa(e, n);
4479
+ let n = lo(r);
4480
+ t.set(r.alias, n), co(e, n);
4366
4481
  }
4367
4482
  e.stopx += $.shapeMargin, e.stopy += $.shapeMargin;
4368
4483
  }, o = (e, t, s) => {
4369
- let c = qa();
4484
+ let c = ao();
4370
4485
  c.widthLimit = e.widthLimit / Math.min($.boundaryInRow, t.length);
4371
4486
  for (let [l, u] of t.entries()) {
4372
4487
  let t = u.boundary, d = 0, f = d + 8;
@@ -4376,10 +4491,10 @@ function $a(e) {
4376
4491
  let m;
4377
4492
  if (t?.description && (m = d + 20, d = m + $.boundaryDescrHeight), t || (d = $.rootHeadingHeight), l === 0 || l % $.boundaryInRow === 0) {
4378
4493
  let t = e.startx + $.diagramMarginX, n = e.stopy + $.diagramMarginY + d;
4379
- Ja(c, t, t, n, n);
4494
+ oo(c, t, t, n, n);
4380
4495
  } else {
4381
4496
  let e = c.stopx === c.startx ? c.startx : c.stopx + $.diagramMarginX;
4382
- Ja(c, e, e, c.starty, c.starty);
4497
+ oo(c, e, e, c.starty, c.starty);
4383
4498
  }
4384
4499
  if (u.elements.length > 0 && a(c, u.elements), u.children.length > 0 && o(c, u.children, s + 1), t) {
4385
4500
  let e = c.stopx - c.startx, r = c.stopy - c.starty;
@@ -4400,15 +4515,15 @@ function $a(e) {
4400
4515
  }
4401
4516
  e.stopy = Math.max(c.stopy + $.shapeMargin, e.stopy), e.stopx = Math.max(c.stopx + $.shapeMargin, e.stopx), r = Math.max(r, e.stopx), i = Math.max(i, e.stopy);
4402
4517
  }
4403
- }, s = qa();
4404
- return Ja(s, $.diagramMarginX, $.diagramMarginX, $.diagramMarginY, $.diagramMarginY), s.widthLimit = $.screenWidth, o(s, [e], -1), {
4518
+ }, s = ao();
4519
+ return oo(s, $.diagramMarginX, $.diagramMarginX, $.diagramMarginY, $.diagramMarginY), s.widthLimit = $.screenWidth, o(s, [e], -1), {
4405
4520
  elements: t,
4406
4521
  boundaries: n,
4407
4522
  maxX: r,
4408
4523
  maxY: i
4409
4524
  };
4410
4525
  }
4411
- function eo(e, t) {
4526
+ function po(e, t) {
4412
4527
  let n = e.x + e.width / 2, r = e.y + e.height / 2, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2;
4413
4528
  if (i === 0 && a === 0) return {
4414
4529
  x: n,
@@ -4427,8 +4542,8 @@ function eo(e, t) {
4427
4542
  y: r + l
4428
4543
  };
4429
4544
  }
4430
- function to(e, t) {
4431
- let n = za(e.width, e.height), r = e.x + e.width / 2, i = e.y + e.height / 2, a = e.width, o = e.height, s = -o / 2 + n.headRadius, c = -o / 2 + n.pillTop, l = n.rx, u = (e, t, n, r, i, a) => Array.from({ length: r }, (o, s) => {
4545
+ function mo(e, t) {
4546
+ let n = Za(e.width, e.height), r = e.x + e.width / 2, i = e.y + e.height / 2, a = e.width, o = e.height, s = -o / 2 + n.headRadius, c = -o / 2 + n.pillTop, l = n.rx, u = (e, t, n, r, i, a) => Array.from({ length: r }, (o, s) => {
4432
4547
  let c = (i + s * (a - i) / (r - 1)) * Math.PI / 180;
4433
4548
  return {
4434
4549
  x: e - n * Math.cos(c),
@@ -4441,7 +4556,7 @@ function to(e, t) {
4441
4556
  ...u(a / 2 - l, o / 2 - l, l, 12, 270, 180),
4442
4557
  ...u(a / 2 - l, c + l, l, 12, 180, 90)
4443
4558
  ];
4444
- return ro({
4559
+ return go({
4445
4560
  x: r,
4446
4561
  y: i
4447
4562
  }, t, f.map((e) => ({
@@ -4449,7 +4564,7 @@ function to(e, t) {
4449
4564
  y: i + e.y
4450
4565
  })));
4451
4566
  }
4452
- function no(e, t, n, r) {
4567
+ function ho(e, t, n, r) {
4453
4568
  let i = t.y - e.y, a = e.x - t.x, o = t.x * e.y - e.x * t.y, s = i * n.x + a * n.y + o, c = i * r.x + a * r.y + o;
4454
4569
  if (s !== 0 && c !== 0 && s * c > 0) return;
4455
4570
  let l = r.y - n.y, u = n.x - r.x, d = r.x * n.y - n.x * r.y, f = l * e.x + u * e.y + d, p = l * t.x + u * t.y + d;
@@ -4462,18 +4577,18 @@ function no(e, t, n, r) {
4462
4577
  y: g < 0 ? (g - h) / m : (g + h) / m
4463
4578
  };
4464
4579
  }
4465
- function ro(e, t, n) {
4580
+ function go(e, t, n) {
4466
4581
  let r, i = Infinity;
4467
4582
  return n.forEach((a, o) => {
4468
- let s = no(e, t, a, n[(o + 1) % n.length]);
4583
+ let s = ho(e, t, a, n[(o + 1) % n.length]);
4469
4584
  if (!s) return;
4470
4585
  let c = Math.hypot(s.x - t.x, s.y - t.y);
4471
4586
  c < i && (r = s, i = c);
4472
4587
  }), r ?? e;
4473
4588
  }
4474
- var io = 1e-6;
4475
- function ao(e, t) {
4476
- let n = eo(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = Ha(e.width), s = n.x - r, c = Math.abs(s) < e.width / 2 - io || Math.abs(Math.abs(s) - e.width / 2) <= io && Math.abs(n.y - i) > e.height / 2 - o;
4589
+ var _o = 1e-6;
4590
+ function vo(e, t) {
4591
+ let n = po(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = eo(e.width), s = n.x - r, c = Math.abs(s) < e.width / 2 - _o || Math.abs(Math.abs(s) - e.width / 2) <= _o && Math.abs(n.y - i) > e.height / 2 - o;
4477
4592
  if (a === 0 || !c) return n;
4478
4593
  let l = o * o * (1 - s * s / (a * a)), u = o - (l > 0 ? Math.sqrt(l) : l);
4479
4594
  return t.y - i > 0 && (u = -u), {
@@ -4481,8 +4596,8 @@ function ao(e, t) {
4481
4596
  y: n.y + u
4482
4597
  };
4483
4598
  }
4484
- function oo(e, t) {
4485
- let n = eo(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = Ua(e.height), s = n.y - i, c = Math.abs(s) < e.height / 2 - io || Math.abs(Math.abs(s) - e.height / 2) <= io && Math.abs(n.x - r) > e.width / 2 - a;
4599
+ function yo(e, t) {
4600
+ let n = po(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = to(e.height), s = n.y - i, c = Math.abs(s) < e.height / 2 - _o || Math.abs(Math.abs(s) - e.height / 2) <= _o && Math.abs(n.x - r) > e.width / 2 - a;
4486
4601
  if (o === 0 || !c) return n;
4487
4602
  let l = a * a * (1 - s * s / (o * o)), u = a - Math.sqrt(Math.abs(l));
4488
4603
  return t.x - r > 0 && (u = -u), {
@@ -4490,16 +4605,16 @@ function oo(e, t) {
4490
4605
  y: n.y
4491
4606
  };
4492
4607
  }
4493
- function so(e, t) {
4608
+ function bo(e, t) {
4494
4609
  let n = e.el;
4495
- return n?.kind === "person" ? to(e, t) : n?.shape === "db" ? ao(e, t) : n?.shape === "queue" ? oo(e, t) : eo(e, t);
4610
+ return n?.kind === "person" ? mo(e, t) : n?.shape === "db" ? vo(e, t) : n?.shape === "queue" ? yo(e, t) : po(e, t);
4496
4611
  }
4497
- var co = (e) => ({
4612
+ var xo = (e) => ({
4498
4613
  x: e.x + e.width / 2,
4499
4614
  y: e.y + e.height / 2
4500
4615
  });
4501
- function lo(e, t, n, r) {
4502
- let i = n.get(e.from), a = n.get(e.to), o = so(i, co(a)), s = so(a, co(i)), c = s.x - o.x, l = s.y - o.y, u = (e) => ({
4616
+ function So(e, t, n, r) {
4617
+ let i = n.get(e.from), a = n.get(e.to), o = bo(i, xo(a)), s = bo(a, xo(i)), c = s.x - o.x, l = s.y - o.y, u = (e) => ({
4503
4618
  x: e.x,
4504
4619
  y: e.y + r
4505
4620
  }), d = {
@@ -4513,41 +4628,41 @@ function lo(e, t, n, r) {
4513
4628
  let t = {
4514
4629
  x: Math.min(o.x, s.x) + Math.abs(c) / 2,
4515
4630
  y: Math.min(o.y, s.y) + Math.abs(l) / 2
4516
- }, n = k(e)[0], r = e.label !== "" || e.index !== void 0 ? Wa(n ?? "", $.messageSize, 400) : 0;
4631
+ }, n = k(e)[0], r = e.label !== "" || e.index !== void 0 ? no(n ?? "", $.messageSize, 400) : 0;
4517
4632
  if (d.labelPosition = u({
4518
4633
  x: t.x + r / 2,
4519
4634
  y: t.y
4520
4635
  }), e.technology) {
4521
- let n = Wa(`[${e.technology}]`, $.messageSize, 400);
4636
+ let n = no(`[${e.technology}]`, $.messageSize, 400);
4522
4637
  d.technologyX = t.x + Math.max(r, n) / 2;
4523
4638
  }
4524
4639
  }
4525
4640
  return d;
4526
4641
  }
4527
- var uo = 2, fo = 2;
4528
- function po(e, t) {
4642
+ var Co = 2, wo = 2;
4643
+ function To(e, t) {
4529
4644
  let n = e.labelPosition;
4530
4645
  return n ? k(e).map((r, i, a) => ({
4531
4646
  cx: (e.technology !== void 0 && i === a.length - 1 && e.technologyX !== void 0 ? e.technologyX : n.x) + t,
4532
4647
  cy: n.y + (i === 0 ? 0 : $.messageSize + 5),
4533
- w: Wa(r, $.messageSize, 400),
4648
+ w: no(r, $.messageSize, 400),
4534
4649
  h: $.messageSize
4535
4650
  })) : [];
4536
4651
  }
4537
- var mo = (e, t) => Math.abs(e.cx - t.cx) < (e.w + t.w) / 2 + uo && Math.abs(e.cy - t.cy) < (e.h + t.h) / 2 + uo;
4538
- function ho(e, t, n) {
4652
+ var Eo = (e, t) => Math.abs(e.cx - t.cx) < (e.w + t.w) / 2 + Co && Math.abs(e.cy - t.cy) < (e.h + t.h) / 2 + Co;
4653
+ function Do(e, t, n) {
4539
4654
  let r = e.points[0], i = e.points[e.points.length - 1];
4540
4655
  if (!e.labelPosition || !r || !i) return;
4541
4656
  let a = i.x - r.x, o = i.y - r.y, s = Math.hypot(a, o);
4542
4657
  if (s === 0) return;
4543
4658
  let c = a / s, l = o / s, u = (r) => {
4544
- let i = po(e, r * c).map((e) => ({
4659
+ let i = To(e, r * c).map((e) => ({
4545
4660
  ...e,
4546
4661
  cy: e.cy + r * l
4547
4662
  }));
4548
- return i.some((e) => [...t, ...n].some((t) => mo(e, t))) ? void 0 : i;
4663
+ return i.some((e) => [...t, ...n].some((t) => Eo(e, t))) ? void 0 : i;
4549
4664
  };
4550
- for (let t = 0; t <= s / 2; t += fo) for (let r of t === 0 ? [1] : [1, -1]) {
4665
+ for (let t = 0; t <= s / 2; t += wo) for (let r of t === 0 ? [1] : [1, -1]) {
4551
4666
  let i = u(r * t);
4552
4667
  if (i) {
4553
4668
  t !== 0 && (e.labelPosition = {
@@ -4557,9 +4672,9 @@ function ho(e, t, n) {
4557
4672
  return;
4558
4673
  }
4559
4674
  }
4560
- n.push(...po(e, 0));
4675
+ n.push(...To(e, 0));
4561
4676
  }
4562
- function go(e, t = {}) {
4677
+ function Oo(e, t = {}) {
4563
4678
  if (e.elements.length === 0 && e.boundaries.length === 0) {
4564
4679
  let t = {
4565
4680
  variant: e.variant,
@@ -4571,7 +4686,7 @@ function go(e, t = {}) {
4571
4686
  };
4572
4687
  return e.title && (t.title = e.title), t;
4573
4688
  }
4574
- let n = $a(Qa(e)), r = e.title ? $.titleExtra : 0, i = $.diagramMarginY + r, a = e.elements.flatMap((e) => {
4689
+ let n = fo(uo(e)), r = e.title ? $.titleExtra : 0, i = $.diagramMarginY + r, a = e.elements.flatMap((e) => {
4575
4690
  let t = n.elements.get(e.alias);
4576
4691
  return t ? [{
4577
4692
  ...e,
@@ -4588,13 +4703,13 @@ function go(e, t = {}) {
4588
4703
  })), s = /* @__PURE__ */ new Map();
4589
4704
  for (let e of n.elements.values()) s.set(e.el.alias, e);
4590
4705
  for (let e of n.boundaries) s.set(e.alias, e);
4591
- let c = e.relationships.map((e, t) => lo(e, t, s, i)), l = a.map((e) => ({
4706
+ let c = e.relationships.map((e, t) => So(e, t, s, i)), l = a.map((e) => ({
4592
4707
  cx: e.x + e.width / 2,
4593
4708
  cy: e.y + e.height / 2,
4594
4709
  w: e.width + 12,
4595
4710
  h: e.height + 12
4596
4711
  })), u = [];
4597
- for (let e of c) ho(e, l, u);
4712
+ for (let e of c) Do(e, l, u);
4598
4713
  let d = n.maxX + $.diagramMarginX, f = n.maxY + $.diagramMarginY + r, p = {
4599
4714
  variant: e.variant,
4600
4715
  width: d,
@@ -4610,22 +4725,22 @@ function go(e, t = {}) {
4610
4725
  }
4611
4726
  //#endregion
4612
4727
  //#region packages/svg-renderer/src/c4/renderer.ts
4613
- function _o(e, n, r = "Inter", o = !1, s = F, c, l, u, d = {}) {
4728
+ function ko(e, n, r = "Inter", o = !1, s = I, c, l, u, d = {}) {
4614
4729
  let f = [];
4615
- f.push(Pr(x(e.width, e.height, n, o, l ?? e.title, u, void 0, d.styleAttribute), c)), f.push(t(r, !1, d.nonce)), e.title && e.titlePosition && f.push(a`<text class="c4-title" x="${e.titlePosition.x}" y="${e.titlePosition.y}" dy="${z}" ` + a`font-size="16" fill="var(--_text)">${i(e.title)}</text>`);
4616
- for (let t of e.boundaries) f.push(yo(t));
4617
- for (let t of e.elements) f.push(bo(t));
4618
- for (let t of e.relationships) f.push(To(t)), f.push(Eo(t));
4730
+ f.push(Lr(x(e.width, e.height, n, o, l ?? e.title, u, void 0, d.styleAttribute), c)), f.push(t(r, !1, d.nonce)), e.title && e.titlePosition && f.push(a`<text class="c4-title" x="${e.titlePosition.x}" y="${e.titlePosition.y}" dy="${z}" ` + a`font-size="16" fill="var(--_text)">${i(e.title)}</text>`);
4731
+ for (let t of e.boundaries) f.push(jo(t));
4732
+ for (let t of e.elements) f.push(Mo(t));
4733
+ for (let t of e.relationships) f.push(Lo(t)), f.push(Ro(t));
4619
4734
  return f.push("</svg>"), f.filter(Boolean).join("\n");
4620
4735
  }
4621
- function vo(e, t, n, r, o) {
4736
+ function Ao(e, t, n, r, o) {
4622
4737
  return a` <text x="${t}" y="${n}" text-anchor="middle" dy="${z}" font-size="${r}" ` + a`${o}>${i(e)}</text>`;
4623
4738
  }
4624
- function yo(e) {
4739
+ function jo(e) {
4625
4740
  let t = [];
4626
4741
  t.push(a`<g class="c4-boundary" data-id="${r(e.alias)}" data-label="${r(e.label)}" data-depth="${e.depth}">`), t.push(a` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="2.5" ry="2.5" ` + "fill=\"none\" stroke=\"var(--_text)\" stroke-width=\"1\" stroke-dasharray=\"7,7\" />");
4627
4742
  let n = e.x + e.width / 2;
4628
- t.push(vo(e.label, n, e.y + (e.labelY ?? 8), $.boundarySize + 2, "font-weight=\"700\" fill=\"var(--_text)\""));
4743
+ t.push(Ao(e.label, n, e.y + (e.labelY ?? 8), $.boundarySize + 2, "font-weight=\"700\" fill=\"var(--_text)\""));
4629
4744
  let i = O({
4630
4745
  alias: e.alias,
4631
4746
  label: e.label,
@@ -4633,47 +4748,47 @@ function yo(e) {
4633
4748
  elementAliases: [],
4634
4749
  children: []
4635
4750
  });
4636
- return i && e.typeY !== void 0 && t.push(vo(i, n, e.y + e.typeY, $.boundarySize, "fill=\"var(--_text)\"")), e.description && e.descrY !== void 0 && t.push(vo(e.description, n, e.y + e.descrY, $.boundarySize - 2, "fill=\"var(--_text)\"")), t.push("</g>"), t.join("\n");
4751
+ return i && e.typeY !== void 0 && t.push(Ao(i, n, e.y + e.typeY, $.boundarySize, "fill=\"var(--_text)\"")), e.description && e.descrY !== void 0 && t.push(Ao(e.description, n, e.y + e.descrY, $.boundarySize - 2, "fill=\"var(--_text)\"")), t.push("</g>"), t.join("\n");
4637
4752
  }
4638
- function bo(e) {
4639
- let t = Ka(e), { x: n, y: i, width: o, height: s } = e, c = n + o / 2, l = Ba(e.nameLines.length, e.descriptionLines.length), u = [];
4753
+ function Mo(e) {
4754
+ let t = io(e), { x: n, y: i, width: o, height: s } = e, c = n + o / 2, l = Qa(e.nameLines.length, e.descriptionLines.length), u = [];
4640
4755
  u.push(a`<g class="c4-element" data-id="${r(e.alias)}" data-kind="${e.kind}" data-shape="${e.shape}" ` + a`data-external="${e.external}" data-label="${r(e.label)}">`);
4641
4756
  let d, f = c;
4642
- if (e.kind === "person") u.push(...xo(e, t)), d = i + za(o).pillTop + $.shapePadding;
4757
+ if (e.kind === "person") u.push(...No(e, t)), d = i + Za(o).pillTop + $.shapePadding;
4643
4758
  else if (e.shape === "db") {
4644
- u.push(...So(e, t));
4645
- let { ry: n } = Ha(o);
4759
+ u.push(...Po(e, t));
4760
+ let { ry: n } = eo(o);
4646
4761
  d = i + (2 * n + s) / 2 - l / 2;
4647
4762
  } else if (e.shape === "queue") {
4648
- u.push(...Co(e, t));
4649
- let { rx: n } = Ua(s);
4763
+ u.push(...Fo(e, t));
4764
+ let { rx: n } = to(s);
4650
4765
  f = c - n, d = i + s / 2 - l / 2;
4651
4766
  } else u.push(a` <rect x="${n}" y="${i}" width="${o}" height="${s}" rx="${$.cornerRadius}" ry="${$.cornerRadius}" ` + a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}" />`), d = i + $.shapePadding;
4652
4767
  let p = d;
4653
- for (let n of e.nameLines) u.push(vo(n, f, p + $.nameLine / 2, $.nameSize, a`font-weight="700" fill="${t.text}"`)), p += $.nameLine;
4654
- return u.push(vo(A(e), f, p + $.typeLine / 2, $.typeSize, a`fill="${t.text}"`)), p += $.typeLine, e.descriptionLines.forEach((e, n) => {
4655
- u.push(vo(e, f, p + $.descrLine / 2 + n * $.descrExtraLine, $.descrSize, a`fill="${t.text}"`));
4656
- }), p += Va(e.descriptionLines.length), u.push("</g>"), u.join("\n");
4768
+ for (let n of e.nameLines) u.push(Ao(n, f, p + $.nameLine / 2, $.nameSize, a`font-weight="700" fill="${t.text}"`)), p += $.nameLine;
4769
+ return u.push(Ao(A(e), f, p + $.typeLine / 2, $.typeSize, a`fill="${t.text}"`)), p += $.typeLine, e.descriptionLines.forEach((e, n) => {
4770
+ u.push(Ao(e, f, p + $.descrLine / 2 + n * $.descrExtraLine, $.descrSize, a`fill="${t.text}"`));
4771
+ }), p += $a(e.descriptionLines.length), u.push("</g>"), u.join("\n");
4657
4772
  }
4658
- function xo(e, t) {
4659
- let { x: n, width: r } = e, { rx: i, headRadius: o, pillTop: s } = za(r, e.height), c = e.y, l = n + r / 2, u = c + s, d = e.y + e.height - u, f = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4773
+ function No(e, t) {
4774
+ let { x: n, width: r } = e, { rx: i, headRadius: o, pillTop: s } = Za(r, e.height), c = e.y, l = n + r / 2, u = c + s, d = e.y + e.height - u, f = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4660
4775
  return [a` <rect x="${n}" y="${u}" width="${r}" height="${d}" rx="${i}" ry="${i}" ${f} />`, a` <circle cx="${l}" cy="${c + o}" r="${o}" ${f} />`];
4661
4776
  }
4662
- function So(e, t) {
4663
- let { x: n, y: r, width: i, height: o } = e, { rx: s, ry: c } = Ha(i), l = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4777
+ function Po(e, t) {
4778
+ let { x: n, y: r, width: i, height: o } = e, { rx: s, ry: c } = eo(i), l = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4664
4779
  return [a` <path d="M ${n} ${r + c} L ${n} ${r + o - c} A ${s} ${c} 0 0 0 ${n + i} ${r + o - c} L ${n + i} ${r + c} Z" ${l} />`, a` <ellipse cx="${n + s}" cy="${r + c}" rx="${s}" ry="${c}" ${l} />`];
4665
4780
  }
4666
- function Co(e, t) {
4667
- let { x: n, y: r, width: i, height: o } = e, { rx: s, ry: c } = Ua(o), l = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4781
+ function Fo(e, t) {
4782
+ let { x: n, y: r, width: i, height: o } = e, { rx: s, ry: c } = to(o), l = a`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
4668
4783
  return [a` <path d="M ${n + i - s} ${r} H ${n + s} A ${s} ${c} 0 0 0 ${n + s} ${r + o} H ${n + i - s} Z" ${l} />`, a` <ellipse cx="${n + i - s}" cy="${r + c}" rx="${s}" ry="${c}" ${l} />`];
4669
4784
  }
4670
- function wo(e, t) {
4785
+ function Io(e, t) {
4671
4786
  let n = e.x - t.x, r = e.y - t.y, i = Math.hypot(n, r);
4672
4787
  if (i === 0) return "";
4673
4788
  let o = n / i, s = r / i, c = e.x - o * 10, l = e.y - s * 10;
4674
4789
  return a`<polygon class="c4-arrowhead" points="${e.x},${e.y} ${c - s * 5},${l + o * 5} ${c + s * 5},${l - o * 5}" ` + "fill=\"var(--_text)\" />";
4675
4790
  }
4676
- function To(e) {
4791
+ function Lo(e) {
4677
4792
  let [t, n] = [e.points[0], e.points[e.points.length - 1]];
4678
4793
  if (!t || !n || t === n) return "";
4679
4794
  let i = [
@@ -4682,101 +4797,109 @@ function To(e) {
4682
4797
  a`data-to="${r(e.to)}"`
4683
4798
  ];
4684
4799
  e.label && i.push(a`data-label="${r(e.label)}"`), e.technology && i.push(a`data-technology="${r(e.technology)}"`);
4685
- let o = e.curve ? a`M ${t.x},${t.y} Q ${e.curve.x},${e.curve.y} ${n.x},${n.y}` : a`M ${t.x},${t.y} L ${n.x},${n.y}`, s = a`<path ${i.join(" ")} d="${o}" fill="none" stroke="var(--_text)" stroke-width="1" />`, c = e.curve ?? t, l = e.curve ?? n, u = wo(n, c), d = wo(t, l);
4800
+ let o = e.curve ? a`M ${t.x},${t.y} Q ${e.curve.x},${e.curve.y} ${n.x},${n.y}` : a`M ${t.x},${t.y} L ${n.x},${n.y}`, s = a`<path ${i.join(" ")} d="${o}" fill="none" stroke="var(--_text)" stroke-width="1" />`, c = e.curve ?? t, l = e.curve ?? n, u = Io(n, c), d = Io(t, l);
4686
4801
  return [s, ...e.bidirectional ? [u, d] : [e.reversed ? d : u]].filter(Boolean).join("\n");
4687
4802
  }
4688
- function Eo(e) {
4803
+ function Ro(e) {
4689
4804
  let t = k(e);
4690
4805
  if (t.length === 0 || !e.labelPosition) return "";
4691
4806
  let { x: n, y: i } = e.labelPosition, o = [a`<g class="c4-relationship-label" data-from="${r(e.from)}" data-to="${r(e.to)}">`];
4692
4807
  return t.forEach((r, a) => {
4693
4808
  let s = e.technology !== void 0 && a === t.length - 1, c = i + (a === 0 ? 0 : $.messageSize + 5);
4694
- o.push(vo(r, s && e.technologyX !== void 0 ? e.technologyX : n, c, $.messageSize, s ? "font-style=\"italic\" fill=\"var(--_text)\"" : "fill=\"var(--_text)\""));
4809
+ o.push(Ao(r, s && e.technologyX !== void 0 ? e.technologyX : n, c, $.messageSize, s ? "font-style=\"italic\" fill=\"var(--_text)\"" : "fill=\"var(--_text)\""));
4695
4810
  }), o.push("</g>"), o.join("\n");
4696
4811
  }
4697
4812
  //#endregion
4698
4813
  //#region packages/svg-renderer/src/registry.ts
4699
- var Do = {
4814
+ var zo = {
4700
4815
  type: "xychart",
4701
4816
  parse: ae,
4702
- layoutForSvg: da,
4817
+ layoutForSvg: ha,
4703
4818
  renderSvg(e, t, n) {
4704
4819
  let r = n.interactivity === void 0 ? n.interactive ?? !1 : n.interactivity === "full";
4705
- return Ta(e, t.colors, t.font, t.transparent, r, t.embedSource, t.title, t.decorative, t.emit);
4820
+ return ka(e, t.colors, t.font, t.transparent, r, t.embedSource, t.title, t.decorative, t.emit);
4706
4821
  }
4707
- }, Oo = {
4822
+ }, Bo = {
4708
4823
  type: "sequence",
4709
4824
  parse: ie,
4710
- layoutForSvg: Hi,
4825
+ layoutForSvg: Ki,
4711
4826
  renderSvg(e, t) {
4712
- return Ui(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4827
+ return qi(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4713
4828
  }
4714
4829
  };
4715
- function ko(e) {
4830
+ function Vo(e) {
4716
4831
  return (e.interactivity ?? "static") !== "none";
4717
4832
  }
4718
- function Ao(e) {
4833
+ function Ho(e) {
4719
4834
  return (e.interactivity ?? "static") === "full";
4720
4835
  }
4721
- var jo = {
4836
+ var Uo = {
4722
4837
  type: "class",
4723
- parse: N,
4724
- layoutForSvg: ni,
4838
+ parse: P,
4839
+ layoutForSvg: ai,
4725
4840
  renderSvg(e, t, n) {
4726
- return oi(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, ko(n), t.emit);
4841
+ return li(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, Vo(n), t.emit);
4727
4842
  }
4728
- }, Mo = {
4843
+ }, Wo = {
4729
4844
  type: "er",
4730
- parse: ne,
4845
+ parse: te,
4731
4846
  layoutForSvg(e, t) {
4732
- return Ti(C(e, t.direction), t);
4847
+ return Oi(C(e, t.direction), t);
4733
4848
  },
4734
4849
  renderSvg(e, t) {
4735
- return Di(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4850
+ return ji(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4736
4851
  }
4737
- }, No = {
4852
+ }, Go = {
4738
4853
  type: "flowchart",
4739
- parse: (e, t) => re(t),
4854
+ parse: (e, t) => ne(t),
4740
4855
  layoutForSvg(e, t) {
4741
4856
  return {
4742
- graph: Dn(C(e, t.direction), t),
4857
+ graph: An(C(e, t.direction), t),
4743
4858
  curve: t.curve ?? e.initConfig?.curve ?? "linear"
4744
4859
  };
4745
4860
  },
4746
4861
  renderSvg(e, t, n) {
4747
- return Rn(e.graph, t.colors, t.font, t.transparent, t.fontSizes, e.curve, t.embedSource, Ao(n), ko(n), t.title, t.decorative, t.emit);
4862
+ return Vn(e.graph, t.colors, t.font, t.transparent, t.fontSizes, e.curve, t.embedSource, Ho(n), Vo(n), t.title, t.decorative, t.emit);
4748
4863
  }
4749
- }, Po = {
4864
+ }, Ko = {
4750
4865
  type: "c4",
4751
- parse: M,
4866
+ parse: N,
4752
4867
  layoutForSvg(e, t) {
4753
- return go(e, t);
4868
+ return Oo(e, t);
4754
4869
  },
4755
4870
  renderSvg(e, t) {
4756
- return _o(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4757
- }
4758
- }, Fo = {
4759
- xychart: Do,
4760
- er: Mo,
4761
- sequence: Oo,
4762
- class: jo,
4763
- flowchart: No,
4871
+ return ko(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
4872
+ }
4873
+ }, qo = {
4874
+ xychart: zo,
4875
+ er: Wo,
4876
+ sequence: Bo,
4877
+ class: Uo,
4878
+ flowchart: Go,
4764
4879
  architecture: {
4765
4880
  type: "architecture",
4766
- parse: j,
4881
+ parse: M,
4767
4882
  layoutForSvg(e, t) {
4768
4883
  return {
4769
- graph: Tn(C(D(e), t.direction), t),
4884
+ graph: On(C(D(e), t.direction), t),
4770
4885
  curve: t.curve ?? "linear"
4771
4886
  };
4772
4887
  },
4773
- renderSvg: No.renderSvg
4888
+ renderSvg: Go.renderSvg
4774
4889
  },
4775
- c4: Po
4890
+ c4: Ko,
4891
+ pie: {
4892
+ type: "pie",
4893
+ parse: (e, t) => re(t),
4894
+ layoutForSvg: Va,
4895
+ renderSvg(e, t) {
4896
+ return Wa(e, t.colors, t.font, t.transparent, t.embedSource, t.title, t.decorative, t.emit);
4897
+ }
4898
+ }
4776
4899
  };
4777
4900
  //#endregion
4778
4901
  //#region packages/svg-renderer/src/index.ts
4779
- function Io(t) {
4902
+ function Jo(t) {
4780
4903
  return {
4781
4904
  bg: t.bg ?? e.bg,
4782
4905
  fg: t.fg ?? e.fg,
@@ -4787,23 +4910,23 @@ function Io(t) {
4787
4910
  border: t.border
4788
4911
  };
4789
4912
  }
4790
- function Lo(e = {}) {
4791
- return S(Io(e), e.transparent);
4913
+ function Yo(e = {}) {
4914
+ return S(Jo(e), e.transparent);
4792
4915
  }
4793
- function Ro(e) {
4916
+ function Xo(e) {
4794
4917
  return {
4795
4918
  nonce: e.nonce,
4796
4919
  styleAttribute: e.styleAttribute
4797
4920
  };
4798
4921
  }
4799
- function zo(e, t = {}) {
4800
- let n = Bo(e, t);
4801
- return t.resolveColors ? Yr(n, Io(t)) : n;
4922
+ function Zo(e, t = {}) {
4923
+ let n = Qo(e, t);
4924
+ return t.resolveColors ? Qr(n, Jo(t)) : n;
4802
4925
  }
4803
- function Bo(e, t) {
4804
- let r = oe(e), i = Io(t), a = t.font ?? "Inter";
4926
+ function Qo(e, t) {
4927
+ let r = oe(e), i = Jo(t), a = t.font ?? "Inter";
4805
4928
  v(c(a));
4806
- let o = t.transparent ?? !1, s = I(t.fontSizes), l = n(r), u = t.embedSource ? e : void 0, d = t.title, f = t.decorative, p = Ro(t), m = y(r), h = Fo[l], g = h.parse(m, r), _ = h.layoutForSvg(g, t), b = {
4929
+ let o = t.transparent ?? !1, s = Te(t.fontSizes), l = n(r), u = t.embedSource ? e : void 0, d = t.title, f = t.decorative, p = Xo(t), m = y(r), h = qo[l], g = h.parse(m, r), _ = h.layoutForSvg(g, t), b = {
4807
4930
  colors: i,
4808
4931
  font: a,
4809
4932
  transparent: o,
@@ -4815,11 +4938,11 @@ function Bo(e, t) {
4815
4938
  };
4816
4939
  return h.renderSvg(_, b, t);
4817
4940
  }
4818
- async function Vo(e, t = {}) {
4819
- return zo(e, t);
4941
+ async function $o(e, t = {}) {
4942
+ return Zo(e, t);
4820
4943
  }
4821
- var Ho = zo, Uo = Vo;
4944
+ var es = Zo, ts = $o;
4822
4945
  //#endregion
4823
- export { Ri as ACTOR_LABEL_OFFSET, B as ARROW_HEAD, G as CLS, ke as ELK_DIRECTION_FALLBACK, F as FONT_SIZES, L as FONT_WEIGHTS, Te as GROUP_HEADER_CONTENT_PAD, Pe as INLINE_CENTERED_EDGE_LABEL, Ce as MONO_FONT, we as MONO_FONT_STACK, Ee as NODE_PADDING, R as STROKE_WIDTHS, z as TEXT_BASELINE_SHIFT, Me as baseElkLayoutOptions, Li as boxLabelHeight, H as buildElkEdge, Fe as buildElkEdgeLabel, Ne as buildElkLeafNode, De as buildSvgStyleBlock, Xr as classNoteId, rt as clipEdgeToShape, On as convertToElkFormat, ge as createLayoutCache, Ae as directionToElk, ye as elkLayoutSync, je as elkPadding, Se as estimateMonoTextWidth, P as estimateTextWidth, Ur as evaluateCssColorValue, gt as extractEdgeLabelPosition, ht as extractEdgePoints, Sa as formatTickLabels, ni as layoutClassDiagramSync, Ti as layoutErDiagramSync, Dn as layoutFlowchartSync, Tn as layoutGraphSync, Hi as layoutSequenceDiagram, da as layoutXYChart, xa as niceTickValues, fe as pointsToPath, oi as renderClassSvg, Di as renderErSvg, Uo as renderMermaid, zo as renderMermaidSVG, Vo as renderMermaidSVGAsync, Ho as renderMermaidSync, Ui as renderSequenceSvg, Rn as renderSvg, Ta as renderXYChartSvg, Yr as resolveCssColors, I as resolveFontSizes, ka as smoothCurvePath, Lo as themeCssVariables, Pr as withDataSrc, _a as xLabelStep };
4946
+ export { Hi as ACTOR_LABEL_OFFSET, Oe as ARROW_HEAD, U as CLS, je as ELK_DIRECTION_FALLBACK, I as FONT_SIZES, L as FONT_WEIGHTS, Ee as GROUP_HEADER_CONTENT_PAD, Ie as INLINE_CENTERED_EDGE_LABEL, Ce as MONO_FONT, we as MONO_FONT_STACK, De as NODE_PADDING, X as PIE, R as STROKE_WIDTHS, z as TEXT_BASELINE_SHIFT, Pe as baseElkLayoutOptions, Vi as boxLabelHeight, Re as buildElkEdge, Le as buildElkEdgeLabel, Fe as buildElkLeafNode, ke as buildSvgStyleBlock, $r as classNoteId, ot as clipEdgeToShape, jn as convertToElkFormat, ge as createLayoutCache, Me as directionToElk, ye as elkLayoutSync, Ne as elkPadding, Se as estimateMonoTextWidth, F as estimateTextWidth, Kr as evaluateCssColorValue, yt as extractEdgeLabelPosition, vt as extractEdgePoints, Ea as formatTickLabels, ai as layoutClassDiagramSync, Oi as layoutErDiagramSync, An as layoutFlowchartSync, On as layoutGraphSync, Va as layoutPieChart, Ki as layoutSequenceDiagram, ha as layoutXYChart, Ta as niceTickValues, Ha as pieColorValue, fe as pointsToPath, li as renderClassSvg, ji as renderErSvg, ts as renderMermaid, Zo as renderMermaidSVG, $o as renderMermaidSVGAsync, es as renderMermaidSync, Wa as renderPieSvg, qi as renderSequenceSvg, Vn as renderSvg, ka as renderXYChartSvg, Qr as resolveCssColors, Te as resolveFontSizes, Na as smoothCurvePath, Yo as themeCssVariables, Lr as withDataSrc, xa as xLabelStep };
4824
4947
 
4825
4948
  //# sourceMappingURL=index.js.map