@juki-team/base-ui 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/esm/ArrowForwardIcon-D6Jfdilm.js +1 -0
  2. package/dist/esm/{BarChart-ilBguU5i.js → BarChart-D6H2EH3B.js} +1 -1
  3. package/dist/esm/{CartesianChart-B4Big96I.js → CartesianChart-_EyixekW.js} +1 -1
  4. package/dist/esm/{ChangePasswordModal-B1Ahfv-S.js → ChangePasswordModal-DP68K_jG.js} +1 -1
  5. package/dist/esm/{CodeEditor-Co_-jMMN.js → CodeEditor-CPsmXl7i.js} +1 -1
  6. package/dist/esm/{CodeViewer-j4tlytYb.js → CodeViewer-DIncRhD1.js} +1 -1
  7. package/dist/esm/{Collapse-B_Oe1-5C.js → Collapse-Bn9-0z3I.js} +1 -1
  8. package/dist/esm/{DataGrid-B0Av-VN8.js → DataGrid-CzZsh4gG.js} +1 -1
  9. package/dist/esm/{DataViewer-jViuraZ_.js → DataViewer-CSIcp1dE.js} +1 -1
  10. package/dist/esm/{DrawerView-BoMapmAb.js → DrawerView-D-MEVHS0.js} +1 -1
  11. package/dist/esm/{ExcalidrawButton-DRR-2JvH.js → ExcalidrawButton-CL_vPewV.js} +1 -1
  12. package/dist/esm/{GraphvizViewer-DEJDUNWF.js → GraphvizViewer-BfJg604I.js} +1 -1
  13. package/dist/esm/{ImageLoaderCropper-CeYhv904.js → ImageLoaderCropper-BjHykYfo.js} +1 -1
  14. package/dist/esm/{InputCellPhoneNumber-C7hpcqFZ.js → InputCellPhoneNumber-CAi0AXMP.js} +1 -1
  15. package/dist/esm/{InputColor-BhVac99k.js → InputColor-Ch5Do1U-.js} +1 -1
  16. package/dist/esm/{LineChart-_gtzHQbx.js → LineChart-BL9HlHkG.js} +1 -1
  17. package/dist/esm/{LoaderLayer-D9O7WqFD.js → LoaderLayer-CXFK-kAz.js} +1 -1
  18. package/dist/esm/{MdMath-BtS290JE.js → MdMath-DwyNLKE_.js} +1 -1
  19. package/dist/esm/{MdMathEditor-B41-_-_8.js → MdMathEditor-D0f1McYj.js} +1 -1
  20. package/dist/esm/{Popover-BGWBnVdT.js → Popover-DPn39FUa.js} +1 -1
  21. package/dist/esm/ReplyIcon-Dd5U6wGZ.js +1 -0
  22. package/dist/esm/{SettingsIcon-Dk27Vz1G.js → SettingsIcon-BCDZw0HR.js} +1 -1
  23. package/dist/esm/{SlideDeck-NtKwXHq5.js → SlideDeck-et5M4lE-.js} +1 -1
  24. package/dist/esm/{TableEyeIcon-D74isCSR.js → TableEyeIcon-CDLbQapU.js} +1 -1
  25. package/dist/esm/{TableOfContents-DBBkdhlJ.js → TableOfContents-CLrH5fjb.js} +1 -1
  26. package/dist/esm/{Tooltip-DaBTZZ8j.js → Tooltip-CEgmNtFX.js} +1 -1
  27. package/dist/esm/{UserCodeEditor-DdyfLlQs.js → UserCodeEditor-DlHeWLUu.js} +2 -2
  28. package/dist/esm/{VirtualizedRowsFixed-BAjhFO3R.js → VirtualizedRowsFixed-8Wk8DRYc.js} +1 -1
  29. package/dist/esm/{WorksheetAsSlides-B5FB6vVz.js → WorksheetAsSlides-X5Ljvk2t.js} +1 -1
  30. package/dist/esm/{WorksheetBodies-2hrTre13.js → WorksheetBodies-pHyqSVPy.js} +1 -1
  31. package/dist/esm/{WorksheetContents-CdM17xrm.js → WorksheetContents-ByjM-HNk.js} +1 -1
  32. package/dist/esm/{WorksheetEditor-HdlEcmnN.js → WorksheetEditor-Dq3apeLg.js} +1 -1
  33. package/dist/esm/{WorksheetNode-C-TrJMCB.js → WorksheetNode-Chf37TwI.js} +1 -1
  34. package/dist/esm/{WorksheetViewer-D0Co4NMK.js → WorksheetViewer-B-slMCYv.js} +1 -1
  35. package/dist/esm/{architecture-YZFGNWBL-Pv0ede3r.js → architecture-YZFGNWBL-B4qRp-MK.js} +1 -1
  36. package/dist/esm/{architectureDiagram-Q4EWVU46-Qs_XxOCt.js → architectureDiagram-Q4EWVU46-MfdUMKWh.js} +1 -1
  37. package/dist/esm/{blockDiagram-DXYQGD6D-CG7oWqi7.js → blockDiagram-DXYQGD6D-B53ncWj8.js} +1 -1
  38. package/dist/esm/{c4Diagram-AHTNJAMY-DyGWi7Su.js → c4Diagram-AHTNJAMY-FdREycKs.js} +1 -1
  39. package/dist/esm/channel-D_ARZf1V.js +1 -0
  40. package/dist/esm/{chunk-4BX2VUAB-7TA7AVyu.js → chunk-4BX2VUAB-Dc1mlsfk.js} +1 -1
  41. package/dist/esm/{chunk-4TB4RGXK-ChheKyYi.js → chunk-4TB4RGXK-DpY00B8-.js} +1 -1
  42. package/dist/esm/{chunk-55IACEB6-BpHVIT0b.js → chunk-55IACEB6-Csh8qgjO.js} +1 -1
  43. package/dist/esm/{chunk-EDXVE4YY-DQ25JIov.js → chunk-EDXVE4YY-DCPe-NtF.js} +1 -1
  44. package/dist/esm/{chunk-FMBD7UC4-DVZBlcm4.js → chunk-FMBD7UC4-DAo4g5fP.js} +1 -1
  45. package/dist/esm/{chunk-OYMX7WX6-BgiA8Wjh.js → chunk-OYMX7WX6-C7RHHgRc.js} +1 -1
  46. package/dist/esm/{chunk-QZHKN3VN-Cq1a-aN-.js → chunk-QZHKN3VN-CUifo-Cb.js} +1 -1
  47. package/dist/esm/{chunk-YZCP3GAM-BDqtM1Ka.js → chunk-YZCP3GAM-DELqvesl.js} +1 -1
  48. package/dist/esm/classDiagram-6PBFFD2Q-B7_Zpqtq.js +1 -0
  49. package/dist/esm/classDiagram-v2-HSJHXN6E-B7_Zpqtq.js +1 -0
  50. package/dist/esm/clone-DZNciEx8.js +1 -0
  51. package/dist/esm/{commons-B_OozOv-.js → commons-D9Mh1s5L.js} +1 -1
  52. package/dist/esm/constants.js +1 -1
  53. package/dist/esm/{cose-bilkent-S5V4N54A-uYVAtvEb.js → cose-bilkent-S5V4N54A-BOV94ldj.js} +1 -1
  54. package/dist/esm/{dagre-KV5264BT-CmDBeo-P.js → dagre-KV5264BT-BfFz9a4k.js} +1 -1
  55. package/dist/esm/{diagram-5BDNPKRD-DVvj2_2u.js → diagram-5BDNPKRD-I9IS2ANw.js} +1 -1
  56. package/dist/esm/{diagram-G4DWMVQ6-DYpFO01Z.js → diagram-G4DWMVQ6-BXU7Dvs-.js} +1 -1
  57. package/dist/esm/{diagram-MMDJMWI5-CDbT7cky.js → diagram-MMDJMWI5-Csk96FFg.js} +1 -1
  58. package/dist/esm/{diagram-TYMM5635-QWJ6iFCJ.js → diagram-TYMM5635-DPvqrKRl.js} +1 -1
  59. package/dist/esm/{erDiagram-SMLLAGMA-BaIhydf3.js → erDiagram-SMLLAGMA-Dc1SOwcN.js} +1 -1
  60. package/dist/esm/{flowDiagram-DWJPFMVM--s6o35x5.js → flowDiagram-DWJPFMVM-Ck8eEuPh.js} +1 -1
  61. package/dist/esm/{ganttDiagram-T4ZO3ILL-CE7k2fwu.js → ganttDiagram-T4ZO3ILL-D5DV1RYK.js} +1 -1
  62. package/dist/esm/gitGraph-7Q5UKJZL-AWq1Wmi2.js +1 -0
  63. package/dist/esm/{gitGraphDiagram-UUTBAWPF-VFFCKAr8.js → gitGraphDiagram-UUTBAWPF-BWpwlfSt.js} +1 -1
  64. package/dist/esm/{graph-C49NoLzy.js → graph-DcE5swO6.js} +1 -1
  65. package/dist/esm/helpers.js +1 -1
  66. package/dist/esm/{index-DmCvSgoi.js → index-33u6FCUW.js} +1 -1
  67. package/dist/esm/{index-DVFv6Eth.js → index-BVw40LAx.js} +1 -1
  68. package/dist/esm/index-TeLD_8PN.js +1 -0
  69. package/dist/esm/{index-CODLgwqm.js → index-o2jBRnrQ.js} +1 -1
  70. package/dist/esm/{index-Cj5SSv5l.js → index-tAJiDyYy.js} +1 -1
  71. package/dist/esm/info-OMHHGYJF-CDJfFYlp.js +1 -0
  72. package/dist/esm/{infoDiagram-42DDH7IO-DfB27x0W.js → infoDiagram-42DDH7IO-aiwYT7Xb.js} +1 -1
  73. package/dist/esm/{ishikawaDiagram-UXIWVN3A-hkiElo3Y.js → ishikawaDiagram-UXIWVN3A-adhn2Hxg.js} +1 -1
  74. package/dist/esm/{journeyDiagram-VCZTEJTY-svJ9aZB7.js → journeyDiagram-VCZTEJTY-w8F4Ngn_.js} +1 -1
  75. package/dist/esm/{kanban-definition-6JOO6SKY-aCGgjGQa.js → kanban-definition-6JOO6SKY-BUy-pXA5.js} +1 -1
  76. package/dist/esm/{layout-Dn6BZDTj.js → layout-LXPx6gJv.js} +1 -1
  77. package/dist/esm/main.js +1 -1
  78. package/dist/esm/{mermaid-parser.core-KtTYbDqg.js → mermaid-parser.core-_V3e3eig.js} +1 -1
  79. package/dist/esm/{mermaid.core-Crnpnced.js → mermaid.core-C89m9NSM.js} +1 -1
  80. package/dist/esm/{mindmap-definition-QFDTVHPH-D0c-OxXp.js → mindmap-definition-QFDTVHPH-DQor9UlS.js} +1 -1
  81. package/dist/esm/packet-4T2RLAQJ-DGgnF4xi.js +1 -0
  82. package/dist/esm/pie-ZZUOXDRM-jgrNXYlk.js +1 -0
  83. package/dist/esm/{pieDiagram-DEJITSTG-Ago1dmgK.js → pieDiagram-DEJITSTG-CFXV-DSu.js} +1 -1
  84. package/dist/esm/{quadrantDiagram-34T5L4WZ-f7CWEYhG.js → quadrantDiagram-34T5L4WZ-C5PWeOxe.js} +1 -1
  85. package/dist/esm/radar-PYXPWWZC-ZVxMZ3XM.js +1 -0
  86. package/dist/esm/{requirementDiagram-MS252O5E-B_KOoVtP.js → requirementDiagram-MS252O5E-CAFUQ1SL.js} +1 -1
  87. package/dist/esm/{sankeyDiagram-XADWPNL6-BpENeDG-.js → sankeyDiagram-XADWPNL6-D63_orrT.js} +1 -1
  88. package/dist/esm/{sequenceDiagram-FGHM5R23-DjCr8k36.js → sequenceDiagram-FGHM5R23-DjI8jxRK.js} +1 -1
  89. package/dist/esm/server.js +1 -1
  90. package/dist/esm/{settings-BIQ7IqJl.js → settings-BONQQsPx.js} +1 -1
  91. package/dist/esm/settings.js +1 -1
  92. package/dist/esm/{stateDiagram-FHFEXIEX-B0Hp6EQN.js → stateDiagram-FHFEXIEX-BeDx2Idm.js} +1 -1
  93. package/dist/esm/stateDiagram-v2-QKLJ7IA2-BSzNVn1D.js +1 -0
  94. package/dist/esm/{timeline-definition-GMOUNBTQ-nYM0ar6p.js → timeline-definition-GMOUNBTQ-BRHpffn4.js} +1 -1
  95. package/dist/esm/treeView-SZITEDCU-CMK4b3Hd.js +1 -0
  96. package/dist/esm/treemap-W4RFUUIX-DjdwA0Jd.js +1 -0
  97. package/dist/esm/{types-JRcv-6PR.js → types-CsXckO56.js} +1 -1
  98. package/dist/esm/{vennDiagram-DHZGUBPP-CQ4yw6a2.js → vennDiagram-DHZGUBPP-Cauja-PK.js} +1 -1
  99. package/dist/esm/wardley-RL74JXVD-DiOshmTl.js +1 -0
  100. package/dist/esm/{wardleyDiagram-NUSXRM2D-ChuA4cDu.js → wardleyDiagram-NUSXRM2D-CSY5_Vpk.js} +1 -1
  101. package/dist/esm/{websocket-C4PinjUD.js → websocket-C4G3j9Rm.js} +1 -1
  102. package/dist/esm/{xychartDiagram-5P7HB3ND-C_GW0EwI.js → xychartDiagram-5P7HB3ND-Bkd1VEMW.js} +1 -1
  103. package/dist/module-types/src/components/templates/UserViewLayout/ProfileSubmissions.d.ts +1 -1
  104. package/dist/module-types/src/components/templates/UserViewLayout/types.d.ts +1 -0
  105. package/package.json +2 -2
  106. package/src/styles/components/atoms/_tabs-inline.scss +10 -5
  107. package/dist/esm/ArrowForwardIcon-B6qJaqxW.js +0 -1
  108. package/dist/esm/ReplyIcon-CPGYEALJ.js +0 -1
  109. package/dist/esm/channel-DjjqTXV9.js +0 -1
  110. package/dist/esm/classDiagram-6PBFFD2Q-D-xRfeAV.js +0 -1
  111. package/dist/esm/classDiagram-v2-HSJHXN6E-D-xRfeAV.js +0 -1
  112. package/dist/esm/clone-DCVnqO4M.js +0 -1
  113. package/dist/esm/gitGraph-7Q5UKJZL-Dw9SBp3L.js +0 -1
  114. package/dist/esm/index-CP5vpK1A.js +0 -1
  115. package/dist/esm/info-OMHHGYJF-uLTg2g1k.js +0 -1
  116. package/dist/esm/packet-4T2RLAQJ-FrKYDPbn.js +0 -1
  117. package/dist/esm/pie-ZZUOXDRM-obOGHjHy.js +0 -1
  118. package/dist/esm/radar-PYXPWWZC-BEcFMluC.js +0 -1
  119. package/dist/esm/stateDiagram-v2-QKLJ7IA2-DDbvXv_Y.js +0 -1
  120. package/dist/esm/treeView-SZITEDCU-BNkk4mhj.js +0 -1
  121. package/dist/esm/treemap-W4RFUUIX-DWvE4iLu.js +0 -1
  122. package/dist/esm/wardley-RL74JXVD-BYbSDrTb.js +0 -1
@@ -1 +1 @@
1
- import{q as t,t as n,s as e,g as i,b as s,a as r,_ as o,c as a,A as c,d as l,Y as h,z as u,k as f}from"./mermaid.core-Crnpnced.js";import{o as y}from"./ordinal-zwWoQKz9.js";import"./index-CP5vpK1A.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-B_OozOv-.js";import"./settings-BIQ7IqJl.js";import"./constants.js";import"./LoaderLayer-D9O7WqFD.js";import"./websocket-C4PinjUD.js";import"./index-CODLgwqm.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./purify.es-DBOWJxv3.js";import"./string-LeDn2fkG.js";import"./memoize-CPUrcYQl.js";import"./init-DLRA0X12.js";var p=function(t){for(var n=t.length/6|0,e=new Array(n),i=0;i<n;)e[i]="#"+t.slice(6*i,6*++i);return e}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function d(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e<s||void 0===e&&s>=s)&&(e=s)}return e}function g(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e>s||void 0===e&&s>=s)&&(e=s)}return e}function _(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let s of t)(s=+n(s,++i,t))&&(e+=s)}return e}function m(t){return t.target.depth}function x(t,n){return t.sourceLinks.length?t.depth:n-1}function k(t){return function(){return t}}function v(t,n){return w(t.source,n.source)||t.index-n.index}function b(t,n){return w(t.target,n.target)||t.index-n.index}function w(t,n){return t.y0-n.y0}function S(t){return t.value}function L(t){return t.index}function E(t){return t.nodes}function A(t){return t.links}function M(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function j({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function I(){let t,n,e,i=0,s=0,r=1,o=1,a=24,c=8,l=L,h=x,u=E,f=A,y=6;function p(){const p={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map((n,e)=>[l(n,e,t),n]));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:s}=e;"object"!=typeof n&&(n=e.source=M(i,n)),"object"!=typeof s&&(s=e.target=M(i,s)),n.sourceLinks.push(e),s.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(p),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(_(n.sourceLinks,S),_(n.targetLinks,S)):n.fixedValue}(p),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.depth=s;for(const{target:n}of t.sourceLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(p),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.height=s;for(const{source:n}of t.targetLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(p),function(e){const l=function({nodes:t}){const e=d(t,t=>t.depth)+1,s=(r-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*s,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(c,(o-s)/(d(l,t=>t.length)-1)),function(n){const e=g(n,n=>(o-s-(n.length-1)*t)/_(n,S));for(const i of n){let n=s;for(const s of i){s.y0=n,s.y1=n+s.value*e,n=s.y1+t;for(const t of s.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}C(i)}}(l);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);I(l,n,e),m(l,n,e)}}(p),j(p),p}function m(t,e,i){for(let s=1,r=t.length;s<r;++s){const r=t[s];for(const t of r){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=D(e,t)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,O(t)}void 0===n&&r.sort(w),T(r,i)}}function I(t,e,i){for(let s=t.length-2;s>=0;--s){const r=t[s];for(const t of r){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,O(t)}void 0===n&&r.sort(w),T(r,i)}}function T(n,e){const i=n.length>>1,r=n[i];P(n,r.y0-t,i-1,e),N(n,r.y1+t,i+1,e),P(n,o,n.length-1,e),N(n,s,0,e)}function N(n,e,i,s){for(;i<n.length;++i){const r=n[i],o=(e-r.y0)*s;o>1e-6&&(r.y0+=o,r.y1+=o),e=r.y1+t}}function P(n,e,i,s){for(;i>=0;--i){const r=n[i],o=(r.y1-e)*s;o>1e-6&&(r.y0-=o,r.y1-=o),e=r.y0-t}}function O({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(b);for(const{target:{targetLinks:n}}of t)n.sort(v)}}function C(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(b),e.sort(v)}function D(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:s,width:r}of n.sourceLinks){if(s===e)break;i+=r+t}for(const{source:t,width:s}of e.targetLinks){if(t===n)break;i-=s}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:s,width:r}of e.targetLinks){if(s===n)break;i+=r+t}for(const{target:t,width:s}of n.sourceLinks){if(t===e)break;i-=s}return i}return p.update=function(t){return j(t),t},p.nodeId=function(t){return arguments.length?(l="function"==typeof t?t:k(t),p):l},p.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:k(t),p):h},p.nodeSort=function(t){return arguments.length?(n=t,p):n},p.nodeWidth=function(t){return arguments.length?(a=+t,p):a},p.nodePadding=function(n){return arguments.length?(c=t=+n,p):c},p.nodes=function(t){return arguments.length?(u="function"==typeof t?t:k(t),p):u},p.links=function(t){return arguments.length?(f="function"==typeof t?t:k(t),p):f},p.linkSort=function(t){return arguments.length?(e=t,p):e},p.size=function(t){return arguments.length?(i=s=0,r=+t[0],o=+t[1],p):[r-i,o-s]},p.extent=function(t){return arguments.length?(i=+t[0][0],r=+t[1][0],s=+t[0][1],o=+t[1][1],p):[[i,s],[r,o]]},p.iterations=function(t){return arguments.length?(y=+t,p):y},p}var T=Math.PI,N=2*T,P=1e-6,O=N-P;function C(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function D(){return new C}function $(t){return function(){return t}}function z(t){return t[0]}function F(t){return t[1]}C.prototype=D.prototype={constructor:C,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,s,r){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+s)+","+(this._y1=+r)},arcTo:function(t,n,e,i,s){t=+t,n=+n,e=+e,i=+i,s=+s;var r=this._x1,o=this._y1,a=e-t,c=i-n,l=r-t,h=o-n,u=l*l+h*h;if(s<0)throw new Error("negative radius: "+s);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>P)if(Math.abs(h*a-c*l)>P&&s){var f=e-r,y=i-o,p=a*a+c*c,d=f*f+y*y,g=Math.sqrt(p),_=Math.sqrt(u),m=s*Math.tan((T-Math.acos((p+u-d)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>P&&(this._+="L"+(t+x*l)+","+(n+x*h)),this._+="A"+s+","+s+",0,0,"+ +(h*f>l*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,s,r){t=+t,n=+n,r=!!r;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),c=t+o,l=n+a,h=1^r,u=r?i-s:s-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>P||Math.abs(this._y1-l)>P)&&(this._+="L"+c+","+l),e&&(u<0&&(u=u%N+N),u>O?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=c)+","+(this._y1=l):u>P&&(this._+="A"+e+","+e+",0,"+ +(u>=T)+","+h+","+(this._x1=t+e*Math.cos(s))+","+(this._y1=n+e*Math.sin(s))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var U=Array.prototype.slice;function W(t){return t.source}function G(t){return t.target}function q(t,n,e,i,s){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,s,i,s)}function V(){return function(t){var n=W,e=G,i=z,s=F,r=null;function o(){var o,a=U.call(arguments),c=n.apply(this,a),l=e.apply(this,a);if(r||(r=o=D()),t(r,+i.apply(this,(a[0]=c,a)),+s.apply(this,a),+i.apply(this,(a[0]=l,a)),+s.apply(this,a)),o)return r=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:$(+t),o):i},o.y=function(t){return arguments.length?(s="function"==typeof t?t:$(+t),o):s},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o}(q)}function X(t){return[t.source.x1,t.y0]}function Y(t){return[t.target.x0,t.y1]}var Q=function(){var t=o(function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},"o"),n=[1,9],e=[1,10],i=[1,5,10,12],s={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:o(function(t,n,e,i,s,r,o){var a=r.length-1;switch(s){case 7:const t=i.findOrCreateNode(r[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(r[a-2].trim().replaceAll('""','"')),e=parseFloat(r[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=r[a];break;case 10:this.$=r[a-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o(function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},"parseError"),parse:o(function(t){var n=this,e=[0],i=[],s=[null],r=[],a=this.table,c="",l=0,h=0,u=r.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y.yy[p]=this.yy[p]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var d=f.yylloc;r.push(d);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=i.pop()||f.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,s.length=s.length-t,r.length=r.length-t},"popStack"),o(_,"lex");for(var m,x,k,v,b,w,S,L,E={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in L=[],a[x])this.terminals_[b]&&b>2&&L.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(l+1)+":\n"+f.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:d,expected:L})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),r.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,c=f.yytext,l=f.yylineno,d=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],E.$=s[s.length-w],E._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[c,h,l,y.yy,k[1],s,r].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),r=r.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(E.$),r.push(E._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0},"parse")},r=function(){return{EOF:1,parseError:o(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:o(function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:o(function(t,n){var e,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((e=this._input.match(this.rules[s[r]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,s[r])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=r,o(a,"Parser"),a.prototype=s,s.Parser=a,new a}();Q.parser=Q;var R=Q,B=[],K=[],Z=new Map,J=o(()=>{B=[],K=[],Z=new Map,u()},"clear"),H=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{o(this,"SankeyLink")}},tt=o((t,n,e)=>{B.push(new H(t,n,e))},"addLink"),nt=class{constructor(t){this.ID=t}static{o(this,"SankeyNode")}},et=o(t=>{t=f.sanitizeText(t,a());let n=Z.get(t);return void 0===n&&(n=new nt(t),Z.set(t,n),K.push(n)),n},"findOrCreateNode"),it=o(()=>K,"getNodes"),st=o(()=>B,"getLinks"),rt=o(()=>({nodes:K.map(t=>({id:t.ID})),links:B.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ot={nodesMap:Z,getConfig:o(()=>a().sankey,"getConfig"),getNodes:it,getLinks:st,getGraph:rt,addLink:tt,findOrCreateNode:et,getAccTitle:r,setAccTitle:s,getAccDescription:i,setAccDescription:e,getDiagramTitle:n,setDiagramTitle:t,clear:J},at=class t{static{o(this,"Uid")}static{this.count=0}static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},ct={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?g(t.sourceLinks,m)-1:0},justify:x},lt=o(function(t,n,e,i){const{securityLevel:s,sankey:r}=a(),u=c.sankey;let f;"sandbox"===s&&(f=l("#i"+n));const d=l("sandbox"===s?f.nodes()[0].contentDocument.body:"body"),g="sandbox"===s?d.select(`[id="${n}"]`):l(`[id="${n}"]`),_=r?.width??u.width,m=r?.height??u.width,x=r?.useMaxWidth??u.useMaxWidth,k=r?.nodeAlignment??u.nodeAlignment,v=r?.prefix??u.prefix,b=r?.suffix??u.suffix,w=r?.showValues??u.showValues,S=i.db.getGraph(),L=ct[k];I().nodeId(t=>t.id).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(L).extent([[0,0],[_,m]])(S);const E=y(p);g.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=at.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>E(t.id));const A=o(({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t,"getText");g.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",t=>t.x0<_/2?t.x1+6:t.x0-6).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",t=>t.x0<_/2?"start":"end").text(A);const M=g.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),j=r?.linkColor??"gradient";if("gradient"===j){const t=M.append("linearGradient").attr("id",t=>(t.uid=at.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>E(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>E(t.target.id))}let T;switch(j){case"gradient":T=o(t=>t.uid,"coloring");break;case"source":T=o(t=>E(t.source.id),"coloring");break;case"target":T=o(t=>E(t.target.id),"coloring");break;default:T=j}M.append("path").attr("d",V().source(X).target(Y)).attr("stroke",T).attr("stroke-width",t=>Math.max(1,t.width)),h(void 0,g,0,x)},"draw"),ht={draw:lt},ut=o(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),ft=o(t=>`.label {\n font-family: ${t.fontFamily};\n }`,"getStyles"),yt=R.parse.bind(R);R.parse=t=>yt(ut(t));var pt={styles:ft,parser:R,db:ot,renderer:ht};export{pt as diagram};
1
+ import{q as t,t as n,s as e,g as i,b as s,a as r,_ as o,c as a,A as c,d as l,Y as h,z as u,k as f}from"./mermaid.core-C89m9NSM.js";import{o as y}from"./ordinal-zwWoQKz9.js";import"./index-TeLD_8PN.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-D9Mh1s5L.js";import"./settings-BONQQsPx.js";import"./constants.js";import"./LoaderLayer-CXFK-kAz.js";import"./websocket-C4G3j9Rm.js";import"./index-o2jBRnrQ.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./purify.es-DBOWJxv3.js";import"./string-LeDn2fkG.js";import"./memoize-CPUrcYQl.js";import"./init-DLRA0X12.js";var p=function(t){for(var n=t.length/6|0,e=new Array(n),i=0;i<n;)e[i]="#"+t.slice(6*i,6*++i);return e}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function d(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e<s||void 0===e&&s>=s)&&(e=s)}return e}function g(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e>s||void 0===e&&s>=s)&&(e=s)}return e}function _(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let s of t)(s=+n(s,++i,t))&&(e+=s)}return e}function m(t){return t.target.depth}function x(t,n){return t.sourceLinks.length?t.depth:n-1}function k(t){return function(){return t}}function v(t,n){return w(t.source,n.source)||t.index-n.index}function b(t,n){return w(t.target,n.target)||t.index-n.index}function w(t,n){return t.y0-n.y0}function S(t){return t.value}function L(t){return t.index}function E(t){return t.nodes}function A(t){return t.links}function M(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function j({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function I(){let t,n,e,i=0,s=0,r=1,o=1,a=24,c=8,l=L,h=x,u=E,f=A,y=6;function p(){const p={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map((n,e)=>[l(n,e,t),n]));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:s}=e;"object"!=typeof n&&(n=e.source=M(i,n)),"object"!=typeof s&&(s=e.target=M(i,s)),n.sourceLinks.push(e),s.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(p),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(_(n.sourceLinks,S),_(n.targetLinks,S)):n.fixedValue}(p),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.depth=s;for(const{target:n}of t.sourceLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(p),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.height=s;for(const{source:n}of t.targetLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(p),function(e){const l=function({nodes:t}){const e=d(t,t=>t.depth)+1,s=(r-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*s,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(c,(o-s)/(d(l,t=>t.length)-1)),function(n){const e=g(n,n=>(o-s-(n.length-1)*t)/_(n,S));for(const i of n){let n=s;for(const s of i){s.y0=n,s.y1=n+s.value*e,n=s.y1+t;for(const t of s.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}C(i)}}(l);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);I(l,n,e),m(l,n,e)}}(p),j(p),p}function m(t,e,i){for(let s=1,r=t.length;s<r;++s){const r=t[s];for(const t of r){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=D(e,t)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,O(t)}void 0===n&&r.sort(w),T(r,i)}}function I(t,e,i){for(let s=t.length-2;s>=0;--s){const r=t[s];for(const t of r){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,O(t)}void 0===n&&r.sort(w),T(r,i)}}function T(n,e){const i=n.length>>1,r=n[i];P(n,r.y0-t,i-1,e),N(n,r.y1+t,i+1,e),P(n,o,n.length-1,e),N(n,s,0,e)}function N(n,e,i,s){for(;i<n.length;++i){const r=n[i],o=(e-r.y0)*s;o>1e-6&&(r.y0+=o,r.y1+=o),e=r.y1+t}}function P(n,e,i,s){for(;i>=0;--i){const r=n[i],o=(r.y1-e)*s;o>1e-6&&(r.y0-=o,r.y1-=o),e=r.y0-t}}function O({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(b);for(const{target:{targetLinks:n}}of t)n.sort(v)}}function C(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(b),e.sort(v)}function D(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:s,width:r}of n.sourceLinks){if(s===e)break;i+=r+t}for(const{source:t,width:s}of e.targetLinks){if(t===n)break;i-=s}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:s,width:r}of e.targetLinks){if(s===n)break;i+=r+t}for(const{target:t,width:s}of n.sourceLinks){if(t===e)break;i-=s}return i}return p.update=function(t){return j(t),t},p.nodeId=function(t){return arguments.length?(l="function"==typeof t?t:k(t),p):l},p.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:k(t),p):h},p.nodeSort=function(t){return arguments.length?(n=t,p):n},p.nodeWidth=function(t){return arguments.length?(a=+t,p):a},p.nodePadding=function(n){return arguments.length?(c=t=+n,p):c},p.nodes=function(t){return arguments.length?(u="function"==typeof t?t:k(t),p):u},p.links=function(t){return arguments.length?(f="function"==typeof t?t:k(t),p):f},p.linkSort=function(t){return arguments.length?(e=t,p):e},p.size=function(t){return arguments.length?(i=s=0,r=+t[0],o=+t[1],p):[r-i,o-s]},p.extent=function(t){return arguments.length?(i=+t[0][0],r=+t[1][0],s=+t[0][1],o=+t[1][1],p):[[i,s],[r,o]]},p.iterations=function(t){return arguments.length?(y=+t,p):y},p}var T=Math.PI,N=2*T,P=1e-6,O=N-P;function C(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function D(){return new C}function $(t){return function(){return t}}function z(t){return t[0]}function F(t){return t[1]}C.prototype=D.prototype={constructor:C,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,s,r){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+s)+","+(this._y1=+r)},arcTo:function(t,n,e,i,s){t=+t,n=+n,e=+e,i=+i,s=+s;var r=this._x1,o=this._y1,a=e-t,c=i-n,l=r-t,h=o-n,u=l*l+h*h;if(s<0)throw new Error("negative radius: "+s);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>P)if(Math.abs(h*a-c*l)>P&&s){var f=e-r,y=i-o,p=a*a+c*c,d=f*f+y*y,g=Math.sqrt(p),_=Math.sqrt(u),m=s*Math.tan((T-Math.acos((p+u-d)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>P&&(this._+="L"+(t+x*l)+","+(n+x*h)),this._+="A"+s+","+s+",0,0,"+ +(h*f>l*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,s,r){t=+t,n=+n,r=!!r;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),c=t+o,l=n+a,h=1^r,u=r?i-s:s-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>P||Math.abs(this._y1-l)>P)&&(this._+="L"+c+","+l),e&&(u<0&&(u=u%N+N),u>O?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=c)+","+(this._y1=l):u>P&&(this._+="A"+e+","+e+",0,"+ +(u>=T)+","+h+","+(this._x1=t+e*Math.cos(s))+","+(this._y1=n+e*Math.sin(s))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var U=Array.prototype.slice;function W(t){return t.source}function G(t){return t.target}function q(t,n,e,i,s){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,s,i,s)}function V(){return function(t){var n=W,e=G,i=z,s=F,r=null;function o(){var o,a=U.call(arguments),c=n.apply(this,a),l=e.apply(this,a);if(r||(r=o=D()),t(r,+i.apply(this,(a[0]=c,a)),+s.apply(this,a),+i.apply(this,(a[0]=l,a)),+s.apply(this,a)),o)return r=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:$(+t),o):i},o.y=function(t){return arguments.length?(s="function"==typeof t?t:$(+t),o):s},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o}(q)}function X(t){return[t.source.x1,t.y0]}function Y(t){return[t.target.x0,t.y1]}var Q=function(){var t=o(function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},"o"),n=[1,9],e=[1,10],i=[1,5,10,12],s={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:o(function(t,n,e,i,s,r,o){var a=r.length-1;switch(s){case 7:const t=i.findOrCreateNode(r[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(r[a-2].trim().replaceAll('""','"')),e=parseFloat(r[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=r[a];break;case 10:this.$=r[a-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o(function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},"parseError"),parse:o(function(t){var n=this,e=[0],i=[],s=[null],r=[],a=this.table,c="",l=0,h=0,u=r.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y.yy[p]=this.yy[p]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var d=f.yylloc;r.push(d);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=i.pop()||f.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,s.length=s.length-t,r.length=r.length-t},"popStack"),o(_,"lex");for(var m,x,k,v,b,w,S,L,E={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in L=[],a[x])this.terminals_[b]&&b>2&&L.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(l+1)+":\n"+f.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:d,expected:L})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),r.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,c=f.yytext,l=f.yylineno,d=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],E.$=s[s.length-w],E._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[c,h,l,y.yy,k[1],s,r].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),r=r.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(E.$),r.push(E._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0},"parse")},r=function(){return{EOF:1,parseError:o(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:o(function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:o(function(t,n){var e,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((e=this._input.match(this.rules[s[r]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,s[r])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=r,o(a,"Parser"),a.prototype=s,s.Parser=a,new a}();Q.parser=Q;var R=Q,B=[],K=[],Z=new Map,J=o(()=>{B=[],K=[],Z=new Map,u()},"clear"),H=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{o(this,"SankeyLink")}},tt=o((t,n,e)=>{B.push(new H(t,n,e))},"addLink"),nt=class{constructor(t){this.ID=t}static{o(this,"SankeyNode")}},et=o(t=>{t=f.sanitizeText(t,a());let n=Z.get(t);return void 0===n&&(n=new nt(t),Z.set(t,n),K.push(n)),n},"findOrCreateNode"),it=o(()=>K,"getNodes"),st=o(()=>B,"getLinks"),rt=o(()=>({nodes:K.map(t=>({id:t.ID})),links:B.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ot={nodesMap:Z,getConfig:o(()=>a().sankey,"getConfig"),getNodes:it,getLinks:st,getGraph:rt,addLink:tt,findOrCreateNode:et,getAccTitle:r,setAccTitle:s,getAccDescription:i,setAccDescription:e,getDiagramTitle:n,setDiagramTitle:t,clear:J},at=class t{static{o(this,"Uid")}static{this.count=0}static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},ct={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?g(t.sourceLinks,m)-1:0},justify:x},lt=o(function(t,n,e,i){const{securityLevel:s,sankey:r}=a(),u=c.sankey;let f;"sandbox"===s&&(f=l("#i"+n));const d=l("sandbox"===s?f.nodes()[0].contentDocument.body:"body"),g="sandbox"===s?d.select(`[id="${n}"]`):l(`[id="${n}"]`),_=r?.width??u.width,m=r?.height??u.width,x=r?.useMaxWidth??u.useMaxWidth,k=r?.nodeAlignment??u.nodeAlignment,v=r?.prefix??u.prefix,b=r?.suffix??u.suffix,w=r?.showValues??u.showValues,S=i.db.getGraph(),L=ct[k];I().nodeId(t=>t.id).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(L).extent([[0,0],[_,m]])(S);const E=y(p);g.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=at.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>E(t.id));const A=o(({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t,"getText");g.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",t=>t.x0<_/2?t.x1+6:t.x0-6).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",t=>t.x0<_/2?"start":"end").text(A);const M=g.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),j=r?.linkColor??"gradient";if("gradient"===j){const t=M.append("linearGradient").attr("id",t=>(t.uid=at.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>E(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>E(t.target.id))}let T;switch(j){case"gradient":T=o(t=>t.uid,"coloring");break;case"source":T=o(t=>E(t.source.id),"coloring");break;case"target":T=o(t=>E(t.target.id),"coloring");break;default:T=j}M.append("path").attr("d",V().source(X).target(Y)).attr("stroke",T).attr("stroke-width",t=>Math.max(1,t.width)),h(void 0,g,0,x)},"draw"),ht={draw:lt},ut=o(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),ft=o(t=>`.label {\n font-family: ${t.fontFamily};\n }`,"getStyles"),yt=R.parse.bind(R);R.parse=t=>yt(ut(t));var pt={styles:ft,parser:R,db:ot,renderer:ht};export{pt as diagram};