cc-viewer 1.6.244 → 1.6.246

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 (82) hide show
  1. package/dist/assets/App-BiQkZtui.js +1 -0
  2. package/dist/assets/{MdxEditorPanel-BfSRgDJp.js → MdxEditorPanel-IIVzOold.js} +1 -1
  3. package/dist/assets/Mobile-B7qYYu8v.js +1 -0
  4. package/dist/assets/SkillsManagerModal-C4ofB0oa.css +41 -0
  5. package/dist/assets/SkillsManagerModal-dzR7wO2v.js +2 -0
  6. package/dist/assets/{_baseUniq-D4LBG4Ot.js → _baseUniq-BhNv8Xvc.js} +1 -1
  7. package/dist/assets/{arc-B4smmOzy.js → arc-Bt4H5eKY.js} +1 -1
  8. package/dist/assets/{architectureDiagram-Q4EWVU46-coB7d-ek.js → architectureDiagram-Q4EWVU46-BgmUjRNd.js} +1 -1
  9. package/dist/assets/{blockDiagram-DXYQGD6D-B8tWPC-D.js → blockDiagram-DXYQGD6D-C9wK_ks5.js} +1 -1
  10. package/dist/assets/{c4Diagram-AHTNJAMY-bvrr52MZ.js → c4Diagram-AHTNJAMY-DhchjDPN.js} +1 -1
  11. package/dist/assets/{channel-D7PAXfYO.js → channel-Btktgvdp.js} +1 -1
  12. package/dist/assets/{chunk-4BX2VUAB-Cs80mvkB.js → chunk-4BX2VUAB-wZwjuujj.js} +1 -1
  13. package/dist/assets/{chunk-4TB4RGXK-BnlvMfXA.js → chunk-4TB4RGXK-D6T-DnKQ.js} +1 -1
  14. package/dist/assets/{chunk-55IACEB6-D0alajG6.js → chunk-55IACEB6-9BqfRmoj.js} +1 -1
  15. package/dist/assets/{chunk-EDXVE4YY-bDzoLfvk.js → chunk-EDXVE4YY-B2war4-Q.js} +1 -1
  16. package/dist/assets/{chunk-FMBD7UC4-Bx7EBH49.js → chunk-FMBD7UC4-DHSqPi47.js} +1 -1
  17. package/dist/assets/{chunk-OYMX7WX6-Diipa-PH.js → chunk-OYMX7WX6-CqDjPVtV.js} +1 -1
  18. package/dist/assets/{chunk-QZHKN3VN-CBqvdn5C.js → chunk-QZHKN3VN-oDMfsT4r.js} +1 -1
  19. package/dist/assets/{chunk-YZCP3GAM-C5LVWqAL.js → chunk-YZCP3GAM-DzHgASQw.js} +1 -1
  20. package/dist/assets/classDiagram-6PBFFD2Q-DhUw-2qG.js +1 -0
  21. package/dist/assets/classDiagram-v2-HSJHXN6E-DhUw-2qG.js +1 -0
  22. package/dist/assets/clone-CAwv3NR1.js +1 -0
  23. package/dist/assets/{cose-bilkent-S5V4N54A-C371M5M1.js → cose-bilkent-S5V4N54A-Dklu1Lxo.js} +1 -1
  24. package/dist/assets/{dagre-KV5264BT-DqCL1eq-.js → dagre-KV5264BT-CvOmAdjY.js} +1 -1
  25. package/dist/assets/{diagram-5BDNPKRD-BWX-xtyk.js → diagram-5BDNPKRD-D6vf00xD.js} +1 -1
  26. package/dist/assets/{diagram-G4DWMVQ6-C2I9Ixh-.js → diagram-G4DWMVQ6-DE_W63gG.js} +1 -1
  27. package/dist/assets/{diagram-MMDJMWI5-BEzEkpNP.js → diagram-MMDJMWI5-CXlvpIHZ.js} +1 -1
  28. package/dist/assets/{diagram-TYMM5635-CIUM82ik.js → diagram-TYMM5635-BBGcvHl1.js} +1 -1
  29. package/dist/assets/{erDiagram-SMLLAGMA-BFIPF0zg.js → erDiagram-SMLLAGMA-BzOXo3fd.js} +1 -1
  30. package/dist/assets/{flowDiagram-DWJPFMVM-CkctdZw8.js → flowDiagram-DWJPFMVM-KZA-Rfi_.js} +1 -1
  31. package/dist/assets/{ganttDiagram-T4ZO3ILL-BlOTX6sq.js → ganttDiagram-T4ZO3ILL-zjU5qjHl.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-UUTBAWPF-D9gkJWQD.js → gitGraphDiagram-UUTBAWPF-g9CMzE95.js} +1 -1
  33. package/dist/assets/{graph-BrtsApPK.js → graph-CjZv0z2E.js} +1 -1
  34. package/dist/assets/{index-Cn_0_EQB.js → index-BlFsJkmk.js} +1 -1
  35. package/dist/assets/{index-BPZGB1oT.js → index-D6pPmkFc.js} +1 -1
  36. package/dist/assets/{index-B4evr5Td.js → index-DOMQnNl-.js} +1 -1
  37. package/dist/assets/{index-DO212Z6K.js → index-KMvfg-yA.js} +1 -1
  38. package/dist/assets/{index-sB4w7_-e.js → index-PGOaus9G.js} +1 -1
  39. package/dist/assets/index-kza-3Pji.js +2 -0
  40. package/dist/assets/{index-4Akiapt_.js → index-l-XATlBm.js} +1 -1
  41. package/dist/assets/{index-CbrA2tuz.js → index-lNyLi-vX.js} +1 -1
  42. package/dist/assets/{infoDiagram-42DDH7IO-BSXMmyAR.js → infoDiagram-42DDH7IO-DJXw9J58.js} +1 -1
  43. package/dist/assets/{ishikawaDiagram-UXIWVN3A-CKjqeHaZ.js → ishikawaDiagram-UXIWVN3A-C1o4HLh9.js} +1 -1
  44. package/dist/assets/{journeyDiagram-VCZTEJTY-DlwSedrW.js → journeyDiagram-VCZTEJTY-BSwplIhk.js} +1 -1
  45. package/dist/assets/{jszip.min-BqnP2zHT.js → jszip.min-Dl4IqyRd.js} +1 -1
  46. package/dist/assets/{kanban-definition-6JOO6SKY-BOY9DCXg.js → kanban-definition-6JOO6SKY-WP2m7MrC.js} +1 -1
  47. package/dist/assets/{layout-CUi1OL3E.js → layout-BlkPouba.js} +1 -1
  48. package/dist/assets/{linear-DhvRMIYs.js → linear-DHkt6wuU.js} +1 -1
  49. package/dist/assets/{mermaid.core-uz8EInB1.js → mermaid.core-ChPdLHKc.js} +2 -2
  50. package/dist/assets/{min-yOqsnRgl.js → min-Cyf5226k.js} +1 -1
  51. package/dist/assets/{mindmap-definition-QFDTVHPH-_TkfRpxu.js → mindmap-definition-QFDTVHPH-DrtYHkPk.js} +1 -1
  52. package/dist/assets/orbiting-BCD4Vuij.svg +7 -0
  53. package/dist/assets/{pieDiagram-DEJITSTG-D6AdtJRl.js → pieDiagram-DEJITSTG-DH-70Dwc.js} +1 -1
  54. package/dist/assets/{quadrantDiagram-34T5L4WZ-Dgs4wGLz.js → quadrantDiagram-34T5L4WZ-eEhZyTA8.js} +1 -1
  55. package/dist/assets/{requirementDiagram-MS252O5E-Brc20J5D.js → requirementDiagram-MS252O5E-BNwebD-X.js} +1 -1
  56. package/dist/assets/{sankeyDiagram-XADWPNL6-BLKmIvdY.js → sankeyDiagram-XADWPNL6-DoA2qU3N.js} +1 -1
  57. package/dist/assets/{sequenceDiagram-FGHM5R23-h90tprxX.js → sequenceDiagram-FGHM5R23-DN-boZj7.js} +1 -1
  58. package/dist/assets/shimmer-BBDejmDf.svg +7 -0
  59. package/dist/assets/{stateDiagram-FHFEXIEX-BNT_KVmE.js → stateDiagram-FHFEXIEX-Dv-Qif4R.js} +1 -1
  60. package/dist/assets/{stateDiagram-v2-QKLJ7IA2-CGLwDp_L.js → stateDiagram-v2-QKLJ7IA2-DI5tUYFH.js} +1 -1
  61. package/dist/assets/{timeline-definition-GMOUNBTQ-B_J6EaT_.js → timeline-definition-GMOUNBTQ-DYG8kyQd.js} +1 -1
  62. package/dist/assets/{vendor-antd-CAAyMICZ.js → vendor-antd-BS2aqEyQ.js} +1 -1
  63. package/dist/assets/{vendor-codemirror-zGsatVJf.js → vendor-codemirror-DpOKy7e3.js} +1 -1
  64. package/dist/assets/{vendor-mdxeditor-2ethWb9I.js → vendor-mdxeditor-Dp19LkWF.js} +2 -2
  65. package/dist/assets/{vendor-qrcode-BwKRsfVu.js → vendor-qrcode-DWflB-OX.js} +1 -1
  66. package/dist/assets/{vendor-virtuoso-DxYsxL4p.js → vendor-virtuoso-Bs61ExJ8.js} +1 -1
  67. package/dist/assets/{vennDiagram-DHZGUBPP-D7H5ETD6.js → vennDiagram-DHZGUBPP-Eityxt48.js} +1 -1
  68. package/dist/assets/{wardley-RL74JXVD-BVJwveo0.js → wardley-RL74JXVD-DthedtT3.js} +1 -1
  69. package/dist/assets/{wardleyDiagram-NUSXRM2D-C9-CQr8V.js → wardleyDiagram-NUSXRM2D-CzQewpkK.js} +1 -1
  70. package/dist/assets/{xychartDiagram-5P7HB3ND-C8QiqEYG.js → xychartDiagram-5P7HB3ND-Dw72vagM.js} +1 -1
  71. package/dist/index.html +4 -4
  72. package/lib/file-access-policy.js +4 -1
  73. package/package.json +1 -1
  74. package/server.js +2 -1
  75. package/dist/assets/App-DaAHhOq9.js +0 -1
  76. package/dist/assets/Mobile-C4gPEuip.js +0 -1
  77. package/dist/assets/SkillsManagerModal-FXPFUoi6.css +0 -41
  78. package/dist/assets/SkillsManagerModal-XIGGaMO_.js +0 -2
  79. package/dist/assets/classDiagram-6PBFFD2Q-nxv2j4RR.js +0 -1
  80. package/dist/assets/classDiagram-v2-HSJHXN6E-nxv2j4RR.js +0 -1
  81. package/dist/assets/clone-8v6kfvDw.js +0 -1
  82. package/dist/assets/index-BW4xIgb5.js +0 -2
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet" fill="#D97757">
3
+ <svg width="100" height="100" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet" overflow="hidden">
4
+ <animate attributeName="viewBox" calcMode="discrete" values="0 0 100 100;0 100 100 100;0 200 100 100;0 300 100 100;0 400 100 100;0 500 100 100;0 600 100 100;0 700 100 100;0 800 100 100;0 900 100 100;0 1000 100 100;0 1100 100 100;0 1200 100 100;0 1300 100 100;0 1400 100 100" dur="1.500s" repeatCount="indefinite" />
5
+ <path d="m19.622 66.5 19.675-11.034.325-.966-.325-.538h-.973l-3.297-.2-11.243-.302-9.73-.4-9.46-.502-2.378-.502L0 49.097l.216-1.454 2-1.354 2.865.25 6.324.452 9.514.652 6.865.401L38 49.097h1.622l.216-.652-.54-.4-.433-.402-9.838-6.67-10.649-7.021-5.567-4.062-2.973-2.056-1.514-1.906-.648-4.213 2.702-3.009 3.676.25.919.252 3.73 2.858 7.946 6.169 10.378 7.623 1.514 1.253.609-.411.093-.29-.703-1.154-5.621-10.18-6-10.382-2.703-4.313-.703-2.558c-.272-1.073-.432-1.96-.432-3.059L26.162.552 27.892 0l4.162.552 1.73 1.504 2.594 5.918 4.163 9.278 6.486 12.638 1.892 3.761 1.027 3.46.378 1.053h.649v-.601l.54-7.122.974-8.726.972-11.234.325-3.159 1.567-3.811 3.136-2.057 2.432 1.154 2 2.858-.27 1.856-1.19 7.723-2.324 12.086-1.513 8.125h.864l1.028-1.053 4.108-5.417 6.865-8.626 3.026-3.41 3.568-3.761 2.27-1.805h4.325l3.135 4.714-1.406 4.864-4.432 5.617-3.676 4.764-5.27 7.061-3.27 5.678.293.468.788-.067 11.892-2.558 6.432-1.153 7.676-1.304 3.46 1.605.378 1.655-1.352 3.36-8.216 2.006-9.621 1.956-14.328 3.372-.159.128.187.278 6.462.585 2.756.15h6.757l12.595.953 3.297 2.156L100 60.13l-.324 2.057-5.081 2.557-6.811-1.605-15.946-3.811-5.46-1.354h-.756v.451l4.54 4.464 8.379 7.522 10.432 9.73.54 2.407-1.35 1.905-1.406-.2-9.19-6.921L74 74.222l-8-6.77h-.54v.703l1.837 2.708 9.784 14.694.487 4.513-.703 1.455-2.54.902-2.757-.501-5.784-8.074-5.892-9.028-4.757-8.124-.574.363-2.831 30.229-1.298 1.555L47.405 100l-2.54-1.906-1.352-3.109 1.352-6.168 1.621-8.025 1.298-6.369 1.189-7.924.726-2.647-.064-.177-.58.098-5.974 8.193L34 84.253l-7.19 7.673-1.729.702-2.973-1.555.27-2.758 1.676-2.457L34 73.22l6-7.874 3.95-4.646-.1-.45-.234-.096-26.427 17.228-4.703.602-2.054-1.906.27-3.11.974-1.002zM35 158.81h-2.38L14.5 170.5l-2.737 2.512-.682 2.455 3.032 2.433L19 176l14.5-10.5L37 162c0-1.507-1.012-2.688-2-3.19m6.02 4.746-15.316 19.87-2.47 3.517-.695 3.665 3.432.055 1.709-.706 4.447-5.024 13.34-18.362v-2.512c-1.977-1.021-2.47-1.626-4.447-.503m7.905 5.464-2.47 9.383-1.616 10.365-.855 4.706.494 3.517L47.444 199l2.403-1.159 1.282-1.562.94-6.941 2.462-20.318c-1.158-.896-2.246-1.398-3.135-1.398-1.407 0-1.775.162-2.47 1.398m12.574 3.992-.62 2.199L65.5 184l4.738 6.663 2.897 1.806 1.365-1.005 1.295-1.507-.908-3.962L72 181l-7-9.5c-3.218.696-2 .5-3.5 1.512M67 165.5l.5 2.5 2.738 2.746 16.17 13.437 1.39.201 1.335-1.915-.535-2.418-7.878-8.179L71.5 165l-2.5-1.5c-1.5.292-1.5 1-2 2m9.287-4.924 7.092 1.505 3.484.846 6.637.865 4.74-1.711.587-2.041-.892-3.061-3.259-1.162L88 155.5l-11.778-.502c-.366 2.464-1.645 4.117.065 5.578m-3.139-10.307 18.762-3.014 6.476-2.01.614-2.986-1.162-2.038-2.964-1.507-6.917 1.005-16.291 4.628c-.857 1.005-.94 3.41 1.482 5.922M69 135l5-4.5 11-11 1.782-3.998-2.766-4.316h-4.273L77.5 113l-3.525 3.779L64 129v2.5c1.002 2.01.253 2.998 5 3.5m-11.181-6.47 2.47-14.468 1.482-6.029v-3.516l-1.028-3.015-2.925-.502-2.47 1.507-1.976 3.517-.535 3.498-.947 17.435c0 2.009 4.446 3.583 5.929 1.573M47.5 135v-3l-10.342-21.472L34 104.957l-1.71-2.517-3.124-.554-2.844.621-1.403 2.45c0 1.103.864 3.576 1.133 4.654l1.2 2.723 2.397 3.712 2.642 4.454L41.5 135c.98 1.598 4.896 2.135 6 0m-16-1-14.864-12.168-3.685-2.872-.908-.252-3.632-.252-2.671 3.023.641 4.233 1.496 1.915 2.937 2.065L27 139.5l3.5-1c1.324-2.872 1.427-3.039 1-4.5m-6.29 20.288 3.768-.502c.494-1.005.988-1.244.988-2.512 0-.693-.494-1.005-1.976-2.01l-8.215-1.004-12.98-1.256H4l-2.506.753L1 150.772l1.415 2.066 2.35.503zm.076 111.131-3.216-1.31-7.153 4.97-.875.91.383 3.678 2.78 2.175 4.245-.563 4.165-2.743 1.494-3.513c-.007-1.355-.918-3.157-1.823-3.604m6.821 10.354-4.042 4.986-1.503 2.226-.882 3.655 2.691 1.392 1.56-.641 3.565-3.948 3.59-4.983-.913-2.254c-1.81-.909-2.265-1.45-4.066-.433m14.726 1.948-1.26 7.308-.761 4.233.466 3.159 2.266 1.795 2.191-1.051 1.166-1.41 1.526-6.057.615-7.86c-1.061-.801-2.057-1.248-2.87-1.244-1.286.006-2.709.012-3.339 1.127m16.886-1.189-.559 1.979 1.284 1.948 5.192 6.432 2.714.89 1.972-.912 1.178-1.36-.846-3.557-3.103-4.614-2.874-2.787c-2.939.639-2.253 1.065-4.958 1.981m6.985-5.743 1.12.94 3.235 2.793 6.063 4.683 2.934 1.164 1.813-1.186-.025-2.752-9.935-8.163-1.678-1.493a29.5 29.5 0 0 1-3.527 4.014m7.146-10.619 3.189.746 3.188.747 6.069.749 4.325-1.558.625-2.077-.869-3.182-2.982-1.03-6.103-.258-7.467.174c-.325 2.216-1.544 4.383.026 5.689m3.799-12.264 6.771-.386 5.91-1.834.55-2.687-1.07-1.826-2.716-1.342-6.317.932-4.507 1.827c-.779.906-.844 3.069 1.379 5.316m-7.763-18.834L77.825 227l4.079-3.598 1.249-4.398-2.851-4.245-3.905.018-2.043 1.64-3.206 3.411-2.72 3.093.01 2.112c.924 1.802 1.11 3.608 5.45 4.039m-16.277-4.381 2.229-6.392 1.33-5.424-.015-3.161-.952-2.705-2.675-.439-2.251 1.365-1.792 3.169-.474 3.146-.825 9.052c.009 1.806 4.079 3.202 5.425 1.389m-16.715-1.789.476-2.485-2.894-8.365-3.266-4.426-1.573-2.255-2.858-.485-3.366.513-1.472 3.573c.004.991.204 2.19.454 3.159l.915 2.705 1.748 3.328 3.083 3.728L36 224.857c5.224-1.361 3.896-.032 4.896-1.955m-15.253 5.83-4.363-3.875-3.38-2.566-.83-.222-3.321-.212-2.429 2.729.604 3.802 1.374 1.714 2.694 1.845 5.044 3.645 2.364-.87c1.199-2.587 2.64-4.678 2.243-5.99m-7.847 24.131 1.753-.964c.448-.906.898-1.123.893-2.262-.003-.623-.456-.901-1.814-1.798l-1.834-.712-5.714-.382-2.588-.214-2.254.913-.439 2.711 1.302 1.851 2.15.443zm-2.078 99.821c.742-.732.742-2.143.742-3.114 0-.752 0-1.29-.789-2.239L12.5 346.5l-3.594.309-1.72 1.164L7 349.224 8.906 352 11 353.231zM20.5 331.5c1.744-1.29 1.64-1.49 2.5-4.5l-.776-1.883-2.347-1.598-.79-.216-3.162-.215-2.324 2.587.558 3.623 1.301 1.639 2.557 1.768zm14.427-13.496-2.964-.161-3.16-2.243-.605-2.199c-.234-.923-.372-1.687-.372-2.631l1.674-2.519 1.488-.475 3.512.475 1.488 1.294 2.297 4.313-.325 2.339c-2.8 2.541-.387 0-3.033 1.807m18.943-3.264c1.63 1.26 2.55 1.76 5.13 1.76l2.5-3 .232-1.596-1.232-2.661-3-1.743-3.63 1.743L53 313zm17.63 7.74c1.29 2.15 1.79 2.735 5.16 3.87l3.789-1.494 1.208-4.184-2.696-4.054h-3.719l-1.952 1.553zM84 341.5c-.381 1.919.181 4.348.5 5l1.86 1.93L92 347l.721-3.426-.325-1.423-3.258-2.031-4.16.63zm1 13c-1.401.427-2.07 2.922-2.5 4.212L84 362.5l4.381.64 4.34-2.659.279-1.769L91.5 356l-2.84-1.658zm-7.91 15.71c-.86.86-2.15 1.29-2.15 3.87l6.67 5.378 1.21.172 1.162-1.639.3-2.491L80 371.298zm-5.139 7.213c-1.03 0-2.258.06-4.451 1.077l-2 3 2.638 4.666 3.177.61L73.5 386l.604-1.251L74 380.5zm-19.873 6.939c-.788-.392-.578-.402-2.078-.862-1.62-.497-3.448-.435-5 .5l-1.017 4.642 1.162 2.674L47.77 393l2.603-.992 1.706-3.366zm-19.045-4.57c-1.729-.857-1.755-1.054-2.976-1.484l-2.79 2.119L26.246 383v2.445L29 387l3.698-1.782 1.392-3.058zM25 371.5l-2.994 2.251-4.044.518-1.99-1.841-.254-2.928.795-1.754 3.76-2.089 3.227.843c1.092 1.919.924 3.482 1.5 5m27.434 113.032c-.732-.742-2.143-.742-3.114-.742-.752 0-1.29 0-2.239.789l-.831 3.171.309 3.594 1.164 1.72 1.25.186 2.777-1.906 1.231-2.094zM31.25 479.75c-1.29-1.743-1.49-1.64-4.5-2.5l-1.883.776-1.598 2.347-.216.791-.216 3.161 2.588 2.324 3.623-.558 1.639-1.302 1.768-2.556zm-13.496-14.427-.161 2.964-2.243 3.161-2.2.604c-.923.234-1.686.372-2.63.372L8 470.75l-.474-1.488.475-3.512 1.293-1.488 4.314-2.297 2.34.325c2.54 2.8-.001.387 1.806 3.033M14.49 446.38c1.26-1.63 1.76-2.55 1.76-5.13l-3-2.5-1.596-.232-2.661 1.232-1.743 3 1.743 3.63 3.757.87zm7.74-17.63c2.15-1.29 2.735-1.79 3.87-5.16l-1.494-3.789-4.184-1.208-4.054 2.696v3.719l1.553 1.952zm19.02-12.5c1.918.381 4.348-.181 5-.5l1.93-1.86-1.43-5.64-3.426-.721-1.423.325-2.031 3.258.63 4.16zm13-1c.427 1.401 2.922 2.07 4.212 2.5l3.788-1.5.64-4.381-2.66-4.34-1.768-.279-2.712 1.5-1.658 2.839zm15.71 7.91c.86.86 1.29 2.15 3.87 2.15l5.377-6.671.173-1.208-1.639-1.163-2.491-.3-4.202 4.282zm7.213 5.139c0 1.031.06 2.258 1.077 4.451l3 2 4.666-2.638.61-3.177-.776-2.185-1.251-.604-4.25.104zm6.939 19.873c-.392.788-.403.578-.862 2.078-.497 1.62-.435 3.448.5 5l4.642 1.017 2.674-1.162 1.684-2.624-.992-2.603-3.366-1.706zm-4.57 19.045c-.857 1.729-1.055 1.755-1.485 2.976l2.12 2.789 2.573 1.023h2.445l1.555-2.755-1.782-3.698-3.058-1.392zm-8.292 8.033 2.25 2.994.518 4.044-1.84 1.99-2.928.254-1.754-.795-2.09-3.761.844-3.226c1.919-1.092 3.482-.924 5-1.5m13.032 72.566c-.742.732-.742 2.143-.742 3.114 0 .752 0 1.29.789 2.239L87.5 554l3.594-.309 1.72-1.164.186-1.251-1.906-2.776L89 547.269zM79.5 569c-1.743 1.29-1.64 1.49-2.5 4.5l.776 1.883 2.347 1.598.79.216 3.162.215 2.324-2.587-.558-3.623-1.301-1.639-2.557-1.768zm-14.427 13.496 2.964.161 3.16 2.243.605 2.199c.234.923.372 1.687.372 2.631l-1.674 2.519-1.488.475-3.512-.475-1.488-1.294-2.297-4.313.325-2.339c2.8-2.541.387 0 3.033-1.807M46.13 585.76C44.5 584.5 43.58 584 41 584l-2.5 3-.232 1.596 1.232 2.661 3 1.743 3.63-1.743.87-3.757zm-17.63-7.74c-1.29-2.15-1.79-2.735-5.16-3.87l-3.789 1.494-1.208 4.184 2.696 4.054h3.719l1.952-1.553zM16 559c.381-1.919-.181-4.348-.5-5l-1.86-1.93L8 553.5l-.721 3.426.325 1.423 3.258 2.031 4.16-.63zm-1-13c1.401-.427 2.07-2.922 2.5-4.212L16 538l-4.381-.64-4.34 2.659L7 541.788l1.5 2.712 2.84 1.658zm7.91-15.71c.86-.86 2.15-1.29 2.15-3.87l-6.67-5.378-1.21-.172-1.162 1.639-.3 2.491L20 529.202zm5.139-7.213c1.03 0 2.258-.06 4.451-1.077l2-3-2.638-4.666-3.177-.61-2.185.776-.604 1.251L26 520zm19.873-6.939c.788.392.578.402 2.078.862 1.62.497 3.448.435 5-.5l1.017-4.642-1.162-2.674-2.624-1.684-2.603.992-1.706 3.366zm19.045 4.57c1.729.857 1.755 1.054 2.976 1.484l2.79-2.119 1.022-2.573v-2.445L71 513.5l-3.698 1.782-1.393 3.058zM75 529l2.994-2.251 4.044-.518 1.99 1.841.254 2.928-.795 1.754-3.76 2.089L76.5 534c-1.091-1.919-.924-3.482-1.5-5m-27.434 86.968c.732.742 2.143.742 3.114.742.752 0 1.29 0 2.239-.789l.831-3.171-.309-3.594-1.164-1.72-1.25-.186-2.777 1.906-1.231 2.094zm21.184 4.782c1.29 1.743 1.49 1.64 4.5 2.5l1.883-.776 1.598-2.347.216-.791.216-3.161-2.588-2.324-3.623.558-1.639 1.302-1.768 2.556zm13.496 14.427.161-2.964 2.243-3.161 2.2-.604c.923-.234 1.686-.372 2.63-.372L92 629.75l.474 1.488-.475 3.512-1.293 1.488-4.314 2.297-2.34-.325c-2.54-2.8.001-.387-1.806-3.033m3.264 18.943c-1.26 1.63-1.76 2.55-1.76 5.13l3 2.5 1.596.232 2.661-1.232 1.743-3-1.743-3.63-3.757-.87zm-7.74 17.63c-2.15 1.29-2.735 1.79-3.87 5.16l1.494 3.789 4.184 1.208 4.054-2.696v-3.719l-1.553-1.952zm-19.02 12.5c-1.918-.381-4.348.181-5 .5l-1.93 1.86 1.43 5.64 3.426.721 1.423-.325 2.031-3.258-.63-4.16zm-13 1c-.427-1.401-2.922-2.07-4.212-2.5l-3.788 1.5-.64 4.381 2.66 4.34 1.768.279 2.712-1.5 1.658-2.839zm-15.71-7.91c-.86-.86-1.29-2.15-3.87-2.15l-5.378 6.671-.172 1.208 1.639 1.163 2.491.3 4.202-4.282zm-7.213-5.139c0-1.031-.06-2.258-1.077-4.451l-3-2-4.666 2.638-.61 3.177.776 2.185 1.251.604 4.25-.104zm-6.939-19.873c.392-.788.403-.578.862-2.078.497-1.62.435-3.448-.5-5l-4.642-1.017-2.674 1.162-1.684 2.624.992 2.603 3.366 1.706zm4.57-19.045c.857-1.729 1.055-1.755 1.485-2.976l-2.12-2.789-2.573-1.023h-2.445l-1.555 2.755 1.782 3.698 3.058 1.392zm8.292-8.033-2.25-2.994-.518-4.044 1.84-1.99 2.928-.254 1.754.795 2.09 3.761-.844 3.226c-1.919 1.092-3.482.924-5 1.5M15.718 752.684c.742-.732.742-2.143.742-3.114 0-.752 0-1.29-.789-2.239L12.5 746.5l-3.594.309-1.72 1.164L7 749.224 8.906 752 11 753.231zM20.5 731.5c1.744-1.29 1.64-1.49 2.5-4.5l-.776-1.883-2.347-1.598-.79-.216-3.162-.215-2.324 2.587.558 3.623 1.301 1.639 2.557 1.768zm14.427-13.496-2.964-.161-3.16-2.243-.605-2.199c-.234-.923-.372-1.687-.372-2.631l1.674-2.519 1.488-.475 3.512.475 1.488 1.294 2.297 4.313-.325 2.339c-2.8 2.541-.387 0-3.033 1.807m18.943-3.264c1.63 1.26 2.55 1.76 5.13 1.76l2.5-3 .232-1.596-1.232-2.661-3-1.743-3.63 1.743L53 713zm17.63 7.74c1.29 2.15 1.79 2.735 5.16 3.87l3.789-1.494 1.208-4.184-2.696-4.054h-3.719l-1.952 1.553zM84 741.5c-.381 1.919.181 4.348.5 5l1.86 1.93L92 747l.721-3.426-.325-1.423-3.258-2.031-4.16.63zm1 13c-1.401.427-2.07 2.922-2.5 4.212L84 762.5l4.381.64 4.34-2.659.279-1.769L91.5 756l-2.84-1.658zm-7.91 15.71c-.86.86-2.15 1.29-2.15 3.87l6.67 5.378 1.21.172 1.162-1.639.3-2.491L80 771.298zm-5.139 7.213c-1.03 0-2.258.06-4.451 1.077l-2 3 2.638 4.666 3.177.61L73.5 786l.604-1.251L74 780.5zm-19.873 6.939c-.788-.392-.578-.402-2.078-.862-1.62-.497-3.448-.435-5 .5l-1.017 4.642 1.162 2.674L47.77 793l2.603-.992 1.706-3.366zm-19.045-4.57c-1.729-.857-1.755-1.054-2.976-1.484l-2.79 2.119L26.246 783v2.445L29 787l3.698-1.782 1.392-3.058zM25 771.5l-2.994 2.251-4.044.518-1.99-1.841-.254-2.928.795-1.754 3.76-2.089 3.227.843c1.092 1.919.924 3.482 1.5 5m27.434 113.032c-.732-.742-2.143-.742-3.114-.742-.752 0-1.29 0-2.239.789l-.831 3.171.309 3.594 1.164 1.72 1.25.186 2.777-1.906 1.231-2.094zM31.25 879.75c-1.29-1.743-1.49-1.64-4.5-2.5l-1.883.776-1.598 2.347-.216.791-.216 3.161 2.588 2.324 3.623-.558 1.639-1.302 1.768-2.556zm-13.496-14.427-.161 2.964-2.243 3.161-2.2.604c-.923.234-1.686.372-2.63.372L8 870.75l-.474-1.488.475-3.512 1.293-1.488 4.314-2.297 2.34.325c2.54 2.8-.001.387 1.806 3.033M14.49 846.38c1.26-1.63 1.76-2.55 1.76-5.13l-3-2.5-1.596-.232-2.661 1.232-1.743 3 1.743 3.63 3.757.87zm7.74-17.63c2.15-1.29 2.735-1.79 3.87-5.16l-1.494-3.789-4.184-1.208-4.054 2.696v3.719l1.553 1.952zm19.02-12.5c1.918.381 4.348-.181 5-.5l1.93-1.86-1.43-5.64-3.426-.721-1.423.325-2.031 3.258.63 4.16zm13-1c.427 1.401 2.922 2.07 4.212 2.5l3.788-1.5.64-4.381-2.66-4.34-1.768-.279-2.712 1.5-1.658 2.839zm15.71 7.91c.86.86 1.29 2.15 3.87 2.15l5.377-6.671.173-1.208-1.639-1.163-2.491-.3-4.202 4.282zm7.213 5.139c0 1.031.06 2.258 1.077 4.451l3 2 4.666-2.638.61-3.177-.776-2.185-1.251-.604-4.25.104zm6.939 19.873c-.392.788-.403.578-.862 2.078-.497 1.62-.435 3.448.5 5l4.642 1.017 2.674-1.162 1.684-2.624-.992-2.603-3.366-1.706zm-4.57 19.045c-.857 1.729-1.055 1.755-1.485 2.976l2.12 2.789 2.573 1.023h2.445l1.555-2.755-1.782-3.698-3.058-1.392zm-8.292 8.033 2.25 2.994.518 4.044-1.84 1.99-2.928.254-1.754-.795-2.09-3.761.844-3.226c1.919-1.092 3.482-.924 5-1.5m13.032 72.566c-.742.732-.742 2.143-.742 3.114 0 .752 0 1.29.789 2.239L87.5 954l3.594-.309 1.72-1.164.186-1.251-1.906-2.776L89 947.269zM79.5 969c-1.743 1.29-1.64 1.49-2.5 4.5l.776 1.883 2.347 1.598.79.216 3.162.215 2.324-2.587-.558-3.623-1.301-1.639-2.557-1.768zm-14.427 13.496 2.964.161 3.16 2.243.605 2.199c.234.923.372 1.687.372 2.631l-1.674 2.519-1.488.475-3.512-.475-1.488-1.294-2.297-4.313.325-2.339c2.8-2.541.387 0 3.033-1.807M46.13 985.76C44.5 984.5 43.58 984 41 984l-2.5 3-.232 1.596 1.232 2.661 3 1.743 3.63-1.743.87-3.757zm-17.63-7.74c-1.29-2.15-1.79-2.735-5.16-3.87l-3.789 1.494-1.208 4.184 2.696 4.054h3.719l1.952-1.553zM16 959c.381-1.919-.181-4.348-.5-5l-1.86-1.93L8 953.5l-.721 3.426.325 1.423 3.258 2.031 4.16-.63zm-1-13c1.401-.427 2.07-2.922 2.5-4.212L16 938l-4.381-.64-4.34 2.659L7 941.788l1.5 2.712 2.84 1.658zm7.91-15.71c.86-.86 2.15-1.29 2.15-3.87l-6.67-5.378-1.21-.172-1.162 1.639-.3 2.491L20 929.202zm5.139-7.213c1.03 0 2.258-.06 4.451-1.077l2-3-2.638-4.666-3.177-.61-2.185.776-.604 1.251L26 920zm19.873-6.939c.788.392.578.402 2.078.862 1.62.497 3.448.435 5-.5l1.017-4.642-1.162-2.674-2.624-1.684-2.603.992-1.706 3.366zm19.045 4.57c1.729.857 1.755 1.054 2.976 1.484l2.79-2.119 1.022-2.573v-2.445L71 913.5l-3.698 1.782-1.393 3.058zM75 929l2.994-2.251 4.044-.518 1.99 1.841.254 2.928-.795 1.754-3.76 2.089L76.5 934c-1.091-1.919-.924-3.482-1.5-5m-27.434 86.97c.732.74 2.143.74 3.114.74.752 0 1.29 0 2.239-.79l.831-3.17-.309-3.59-1.164-1.72-1.25-.19-2.777 1.91-1.231 2.09zm21.184 4.78c1.29 1.74 1.49 1.64 4.5 2.5l1.883-.78 1.598-2.34.216-.79.216-3.16-2.588-2.33-3.623.56-1.639 1.3-1.768 2.56zm13.496 14.43.161-2.97 2.243-3.16 2.2-.6c.923-.24 1.686-.37 2.63-.37l2.52 1.67.474 1.49-.475 3.51-1.293 1.49-4.314 2.3-2.34-.33c-2.54-2.8.001-.39-1.806-3.03m3.264 18.94c-1.26 1.63-1.76 2.55-1.76 5.13l3 2.5 1.596.23 2.661-1.23 1.743-3-1.743-3.63-3.757-.87zm-7.74 17.63c-2.15 1.29-2.735 1.79-3.87 5.16l1.494 3.79 4.184 1.21 4.054-2.7v-3.72l-1.553-1.95zm-19.02 12.5c-1.918-.38-4.348.18-5 .5l-1.93 1.86 1.43 5.64 3.426.72 1.423-.32 2.031-3.26-.63-4.16zm-13 1c-.427-1.4-2.922-2.07-4.212-2.5l-3.788 1.5-.64 4.38 2.66 4.34 1.768.28 2.712-1.5 1.658-2.84zm-15.71-7.91c-.86-.86-1.29-2.15-3.87-2.15l-5.378 6.67-.172 1.21 1.639 1.16 2.491.3 4.202-4.28zm-7.213-5.14c0-1.03-.06-2.26-1.077-4.45l-3-2-4.666 2.64-.61 3.18.776 2.18 1.251.6 4.25-.1zm-6.939-19.87c.392-.79.403-.58.862-2.08.497-1.62.435-3.45-.5-5l-4.642-1.02-2.674 1.17-1.684 2.62.992 2.6 3.366 1.71zm4.57-19.05c.857-1.73 1.055-1.75 1.485-2.97l-2.12-2.79-2.573-1.02h-2.445l-1.555 2.75 1.782 3.7 3.058 1.39zm8.292-8.03-2.25-2.99-.518-4.05 1.84-1.99 2.928-.25 1.754.79 2.09 3.76-.844 3.23c-1.919 1.09-3.482.92-5 1.5m-13.032 127.43c.742-.73.742-2.14.742-3.11 0-.75 0-1.29-.789-2.24l-3.171-.83-3.594.31-1.72 1.16-.186 1.25 1.906 2.78 2.094 1.23zm4.782-21.18c1.744-1.29 1.64-1.49 2.5-4.5l-.776-1.88-2.347-1.6-.79-.22-3.162-.21-2.324 2.59.558 3.62 1.301 1.64 2.557 1.77zm14.427-13.5-2.964-.16-3.16-2.24-.605-2.2c-.234-.92-.372-1.69-.372-2.63l1.674-2.52 1.488-.47 3.512.47 1.488 1.29 2.297 4.32-.325 2.34c-2.8 2.54-.387 0-3.033 1.8m18.943-3.26c1.63 1.26 2.55 1.76 5.13 1.76l2.5-3 .232-1.6-1.232-2.66-3-1.74-3.63 1.74L53 1113zm17.63 7.74c1.29 2.15 1.79 2.73 5.16 3.87l3.789-1.49 1.208-4.19-2.696-4.05h-3.719l-1.952 1.55zM84 1141.5c-.381 1.92.181 4.35.5 5l1.86 1.93L92 1147l.721-3.43-.325-1.42-3.258-2.03-4.16.63zm1 13c-1.401.43-2.07 2.92-2.5 4.21l1.5 3.79 4.381.64 4.34-2.66.279-1.77-1.5-2.71-2.84-1.66zm-7.91 15.71c-.86.86-2.15 1.29-2.15 3.87l6.67 5.38 1.21.17 1.162-1.64.3-2.49-4.282-4.2zm-5.139 7.21c-1.03 0-2.258.06-4.451 1.08l-2 3 2.638 4.67 3.177.61 2.185-.78.604-1.25-.104-4.25zm-19.873 6.94c-.788-.39-.578-.4-2.078-.86-1.62-.5-3.448-.43-5 .5l-1.017 4.64 1.162 2.68 2.624 1.68 2.603-.99 1.706-3.37zm-19.045-4.57c-1.729-.85-1.755-1.05-2.976-1.48l-2.79 2.12-1.022 2.57v2.44L29 1187l3.698-1.78 1.392-3.06zM25 1171.5l-2.994 2.25-4.044.52-1.99-1.84-.254-2.93.795-1.75 3.76-2.09 3.227.84c1.092 1.92.924 3.48 1.5 5m.286 93.92-3.216-1.31-7.153 4.97-.875.91.383 3.68 2.78 2.17 4.245-.56 4.165-2.74 1.494-3.52c-.007-1.35-.918-3.15-1.823-3.6m6.821 10.35-4.042 4.99-1.503 2.23-.882 3.65 2.691 1.39 1.56-.64 3.565-3.95 3.59-4.98-.913-2.25c-1.81-.91-2.265-1.45-4.066-.44m14.726 1.95-1.26 7.31-.761 4.23.466 3.16 2.266 1.8 2.191-1.06 1.166-1.4 1.526-6.06.615-7.86c-1.061-.8-2.057-1.25-2.87-1.25-1.286.01-2.709.02-3.339 1.13m16.886-1.19-.559 1.98 1.284 1.95 5.192 6.43 2.714.89 1.972-.91 1.178-1.36-.846-3.56-3.103-4.61-2.874-2.79c-2.939.64-2.253 1.07-4.958 1.98m6.985-5.74 1.12.94 3.235 2.79 6.063 4.68 2.934 1.17 1.813-1.19-.025-2.75-9.935-8.16-1.678-1.5a29.3 29.3 0 0 1-3.527 4.02m7.146-10.62 3.189.75 3.188.74 6.069.75 4.325-1.56.625-2.07-.869-3.18-2.982-1.04-6.103-.25-7.467.17c-.325 2.22-1.544 4.38.026 5.69m3.799-12.26 6.771-.39 5.91-1.83.55-2.69-1.07-1.83-2.716-1.34-6.317.93-4.507 1.83c-.779.91-.844 3.07 1.379 5.32m-7.763-18.84 3.938-2.07 4.079-3.6 1.249-4.4-2.851-4.24-3.905.02-2.043 1.64-3.206 3.41-2.72 3.09.01 2.11c.924 1.81 1.11 3.61 5.45 4.04m-16.277-4.38 2.229-6.39 1.33-5.43-.015-3.16-.952-2.7-2.675-.44-2.251 1.36-1.792 3.17-.474 3.15-.825 9.05c.009 1.81 4.079 3.2 5.425 1.39m-16.715-1.79.476-2.48-2.894-8.37-3.266-4.42-1.573-2.26-2.858-.48-3.366.51-1.472 3.57c.004.99.204 2.19.454 3.16l.915 2.71 1.748 3.32 3.083 3.73 3.857 2.97c5.224-1.36 3.896-.03 4.896-1.96m-15.253 5.83-4.363-3.87-3.38-2.57-.83-.22-3.321-.21-2.429 2.73.604 3.8 1.374 1.71 2.694 1.85 5.044 3.64 2.364-.87c1.199-2.58 2.64-4.68 2.243-5.99m-7.847 24.13 1.753-.96c.448-.91.898-1.12.893-2.26-.003-.63-.456-.9-1.814-1.8l-1.834-.71-5.714-.38-2.588-.22-2.254.91-.439 2.72 1.302 1.85 2.15.44zM35 1358.81h-2.38L14.5 1370.5l-2.737 2.51-.682 2.46 3.032 2.43L19 1376l14.5-10.5 3.5-3.5c0-1.51-1.012-2.69-2-3.19m6.02 4.75-15.316 19.87-2.47 3.51-.695 3.67 3.432.05 1.709-.7 4.447-5.03 13.34-18.36v-2.51c-1.977-1.02-2.47-1.63-4.447-.5m7.905 5.46-2.47 9.38-1.616 10.37-.855 4.7.494 3.52 2.965 2.01 2.403-1.16 1.282-1.56.94-6.94 2.462-20.32c-1.158-.9-2.246-1.4-3.135-1.4-1.407 0-1.775.16-2.47 1.4m12.575 3.99-.62 2.2 4.62 8.79 4.738 6.66 2.897 1.81 1.365-1.01 1.295-1.5-.908-3.96-2.887-5-7-9.5c-3.218.7-2 .5-3.5 1.51m5.5-7.51.5 2.5 2.738 2.75 16.17 13.43 1.39.2 1.335-1.91-.535-2.42-7.878-8.18-9.22-6.87-2.5-1.5c-1.5.29-1.5 1-2 2m9.287-4.92 7.092 1.5 3.484.85 6.637.86 4.74-1.71.587-2.04-.892-3.06-3.259-1.16-6.676-.32-11.778-.5c-.366 2.46-1.645 4.12.065 5.58m-3.139-10.31 18.762-3.02 6.476-2 .614-2.99-1.162-2.04-2.964-1.51-6.917 1.01-16.291 4.63c-.857 1-.94 3.41 1.482 5.92M69 1335l5-4.5 11-11 1.782-4-2.766-4.31h-4.273L77.5 1313l-3.525 3.78L64 1329v2.5c1.002 2.01.253 3 5 3.5m-11.181-6.47 2.47-14.47 1.482-6.03v-3.51l-1.028-3.02-2.925-.5-2.47 1.51-1.976 3.51-.535 3.5-.947 17.44c0 2.01 4.446 3.58 5.929 1.57M47.5 1335v-3l-10.342-21.47-3.158-5.57-1.71-2.52-3.124-.55-2.844.62-1.403 2.45c0 1.1.864 3.57 1.133 4.65l1.2 2.72 2.397 3.72 2.642 4.45L41.5 1335c.98 1.6 4.896 2.14 6 0m-16-1-14.864-12.17-3.685-2.87-.908-.25-3.632-.25-2.671 3.02.641 4.23 1.496 1.92 2.937 2.06L27 1339.5l3.5-1c1.324-2.87 1.427-3.04 1-4.5m-6.29 20.29 3.768-.5c.494-1.01.988-1.25.988-2.52 0-.69-.494-1-1.976-2.01l-8.215-1-12.98-1.26H4l-2.506.76-.494 3.01 1.415 2.07 2.35.5zm-5.588 112.21 19.675-11.03.325-.97-.325-.54h-.973l-3.297-.2-11.243-.3-9.73-.4-9.46-.5-2.378-.5L0 1449.1l.216-1.46 2-1.35 2.865.25 6.324.45 9.514.65 6.865.4L38 1449.1h1.622l.216-.65-.54-.41-.433-.4-9.838-6.67-10.649-7.02-5.567-4.06-2.973-2.06-1.514-1.9-.648-4.21 2.702-3.01 3.676.25.919.25 3.73 2.86 7.946 6.16 10.378 7.63 1.514 1.25.609-.41.093-.29-.703-1.15-5.621-10.18-6-10.39-2.703-4.31-.703-2.56c-.272-1.07-.432-1.96-.432-3.06l3.081-4.21 1.73-.55 4.162.55 1.73 1.51 2.594 5.91 4.163 9.28 6.486 12.64 1.892 3.76 1.027 3.46.378 1.05h.649v-.6l.54-7.12.974-8.72.972-11.24.325-3.16 1.567-3.81 3.136-2.06 2.432 1.16 2 2.86-.27 1.85-1.19 7.73-2.324 12.08-1.513 8.13h.864l1.028-1.06 4.108-5.41 6.865-8.63 3.026-3.41 3.568-3.76 2.27-1.81h4.325l3.135 4.72-1.406 4.86-4.432 5.62-3.676 4.76-5.27 7.06-3.27 5.68.293.47.788-.07 11.892-2.55 6.432-1.16 7.676-1.3 3.46 1.6.378 1.66-1.352 3.36-8.216 2-9.621 1.96-14.328 3.37-.159.13.187.28 6.462.58 2.756.15h6.757l12.595.96 3.297 2.15 1.946 2.66-.324 2.06-5.081 2.55-6.811-1.6-15.946-3.81-5.46-1.36h-.756v.46l4.54 4.46 8.379 7.52 10.432 9.73.54 2.41-1.35 1.9-1.406-.2-9.19-6.92-3.567-3.11-8-6.77h-.54v.7l1.837 2.71 9.784 14.7.487 4.51-.703 1.45-2.54.91-2.757-.5-5.784-8.08-5.892-9.03-4.757-8.12-.574.36-2.831 30.23-1.298 1.56-3.027 1.15-2.54-1.91-1.352-3.11 1.352-6.16 1.621-8.03 1.298-6.37 1.189-7.92.726-2.65-.064-.17-.58.09-5.974 8.2L34 1484.25l-7.19 7.68-1.729.7-2.973-1.56.27-2.76 1.676-2.45L34 1473.22l6-7.87 3.95-4.65-.1-.45-.234-.1-26.427 17.23-4.703.6-2.054-1.9.27-3.11.974-1z"/>
6
+ </svg>
7
+ </svg>
@@ -1 +1 @@
1
- import{s as styles_default,a as stateDiagram_default,S as StateDB}from"./chunk-OYMX7WX6-Diipa-PH.js";import{_ as __name,c as getConfig2,d as select,l as log,e as configureSvgSize,k as common_default,Q as line,R as curveBasis,N as getUrl,u as utils_default}from"./mermaid.core-uz8EInB1.js";import{G as Graph}from"./graph-BrtsApPK.js";import{l as layout}from"./layout-CUi1OL3E.js";import"./chunk-55IACEB6-D0alajG6.js";import"./chunk-EDXVE4YY-bDzoLfvk.js";import"./vendor-mdxeditor-2ethWb9I.js";import"./vendor-antd-CAAyMICZ.js";import"./vendor-codemirror-zGsatVJf.js";import"./vendor-markdown-Bpu4AByL.js";import"./_baseUniq-D4LBG4Ot.js";import"./min-yOqsnRgl.js";var conf,drawStartState=__name(g=>g.append("circle").attr("class","start-state").attr("r",getConfig2().state.sizeUnit).attr("cx",getConfig2().state.padding+getConfig2().state.sizeUnit).attr("cy",getConfig2().state.padding+getConfig2().state.sizeUnit),"drawStartState"),drawDivider=__name(g=>g.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",getConfig2().state.textHeight).attr("class","divider").attr("x2",2*getConfig2().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),drawSimpleState=__name((g,stateDef)=>{const state=g.append("text").attr("x",2*getConfig2().state.padding).attr("y",getConfig2().state.textHeight+2*getConfig2().state.padding).attr("font-size",getConfig2().state.fontSize).attr("class","state-title").text(stateDef.id),classBox=state.node().getBBox();return g.insert("rect",":first-child").attr("x",getConfig2().state.padding).attr("y",getConfig2().state.padding).attr("width",classBox.width+2*getConfig2().state.padding).attr("height",classBox.height+2*getConfig2().state.padding).attr("rx",getConfig2().state.radius),state},"drawSimpleState"),drawDescrState=__name((g,stateDef)=>{const addTspan=__name(function(textEl,txt,isFirst2){const tSpan=textEl.append("tspan").attr("x",2*getConfig2().state.padding).text(txt);isFirst2||tSpan.attr("dy",getConfig2().state.textHeight)},"addTspan"),titleBox=g.append("text").attr("x",2*getConfig2().state.padding).attr("y",getConfig2().state.textHeight+1.3*getConfig2().state.padding).attr("font-size",getConfig2().state.fontSize).attr("class","state-title").text(stateDef.descriptions[0]).node().getBBox(),titleHeight=titleBox.height,description=g.append("text").attr("x",getConfig2().state.padding).attr("y",titleHeight+.4*getConfig2().state.padding+getConfig2().state.dividerMargin+getConfig2().state.textHeight).attr("class","state-description");let isFirst=!0,isSecond=!0;stateDef.descriptions.forEach(function(descr){isFirst||(addTspan(description,descr,isSecond),isSecond=!1),isFirst=!1});const descrLine=g.append("line").attr("x1",getConfig2().state.padding).attr("y1",getConfig2().state.padding+titleHeight+getConfig2().state.dividerMargin/2).attr("y2",getConfig2().state.padding+titleHeight+getConfig2().state.dividerMargin/2).attr("class","descr-divider"),descrBox=description.node().getBBox(),width=Math.max(descrBox.width,titleBox.width);return descrLine.attr("x2",width+3*getConfig2().state.padding),g.insert("rect",":first-child").attr("x",getConfig2().state.padding).attr("y",getConfig2().state.padding).attr("width",width+2*getConfig2().state.padding).attr("height",descrBox.height+titleHeight+2*getConfig2().state.padding).attr("rx",getConfig2().state.radius),g},"drawDescrState"),addTitleAndBox=__name((g,stateDef,altBkg)=>{const pad=getConfig2().state.padding,dblPad=2*getConfig2().state.padding,orgBox=g.node().getBBox(),orgWidth=orgBox.width,orgX=orgBox.x,title=g.append("text").attr("x",0).attr("y",getConfig2().state.titleShift).attr("font-size",getConfig2().state.fontSize).attr("class","state-title").text(stateDef.id),titleWidth=title.node().getBBox().width+dblPad;let startX,width=Math.max(titleWidth,orgWidth);width===orgWidth&&(width+=dblPad);const graphBox=g.node().getBBox();stateDef.doc,startX=orgX-pad,titleWidth>orgWidth&&(startX=(orgWidth-width)/2+pad),Math.abs(orgX-graphBox.x)<pad&&titleWidth>orgWidth&&(startX=orgX-(titleWidth-orgWidth)/2);const lineY=1-getConfig2().state.textHeight;return g.insert("rect",":first-child").attr("x",startX).attr("y",lineY).attr("class",altBkg?"alt-composit":"composit").attr("width",width).attr("height",graphBox.height+getConfig2().state.textHeight+getConfig2().state.titleShift+1).attr("rx","0"),title.attr("x",startX+pad),titleWidth<=orgWidth&&title.attr("x",orgX+(width-dblPad)/2-titleWidth/2+pad),g.insert("rect",":first-child").attr("x",startX).attr("y",getConfig2().state.titleShift-getConfig2().state.textHeight-getConfig2().state.padding).attr("width",width).attr("height",3*getConfig2().state.textHeight).attr("rx",getConfig2().state.radius),g.insert("rect",":first-child").attr("x",startX).attr("y",getConfig2().state.titleShift-getConfig2().state.textHeight-getConfig2().state.padding).attr("width",width).attr("height",graphBox.height+3+2*getConfig2().state.textHeight).attr("rx",getConfig2().state.radius),g},"addTitleAndBox"),drawEndState=__name(g=>(g.append("circle").attr("class","end-state-outer").attr("r",getConfig2().state.sizeUnit+getConfig2().state.miniPadding).attr("cx",getConfig2().state.padding+getConfig2().state.sizeUnit+getConfig2().state.miniPadding).attr("cy",getConfig2().state.padding+getConfig2().state.sizeUnit+getConfig2().state.miniPadding),g.append("circle").attr("class","end-state-inner").attr("r",getConfig2().state.sizeUnit).attr("cx",getConfig2().state.padding+getConfig2().state.sizeUnit+2).attr("cy",getConfig2().state.padding+getConfig2().state.sizeUnit+2)),"drawEndState"),drawForkJoinState=__name((g,stateDef)=>{let width=getConfig2().state.forkWidth,height=getConfig2().state.forkHeight;if(stateDef.parentId){let tmp=width;width=height,height=tmp}return g.append("rect").style("stroke","black").style("fill","black").attr("width",width).attr("height",height).attr("x",getConfig2().state.padding).attr("y",getConfig2().state.padding)},"drawForkJoinState"),_drawLongText=__name((_text,x,y,g)=>{let textHeight=0;const textElem=g.append("text");textElem.style("text-anchor","start"),textElem.attr("class","noteText");let text=_text.replace(/\r\n/g,"<br/>");text=text.replace(/\n/g,"<br/>");const lines=text.split(common_default.lineBreakRegex);let tHeight=1.25*getConfig2().state.noteMargin;for(const line2 of lines){const txt=line2.trim();if(txt.length>0){const span=textElem.append("tspan");if(span.text(txt),0===tHeight){tHeight+=span.node().getBBox().height}textHeight+=tHeight,span.attr("x",x+getConfig2().state.noteMargin),span.attr("y",y+textHeight+1.25*getConfig2().state.noteMargin)}}return{textWidth:textElem.node().getBBox().width,textHeight:textHeight}},"_drawLongText"),drawNote=__name((text,g)=>{g.attr("class","state-note");const note=g.append("rect").attr("x",0).attr("y",getConfig2().state.padding),rectElem=g.append("g"),{textWidth:textWidth,textHeight:textHeight}=_drawLongText(text,0,0,rectElem);return note.attr("height",textHeight+2*getConfig2().state.noteMargin),note.attr("width",textWidth+2*getConfig2().state.noteMargin),note},"drawNote"),drawState=__name(function(elem,stateDef){const id=stateDef.id,stateInfo={id:id,label:stateDef.id,width:0,height:0},g=elem.append("g").attr("id",id).attr("class","stateGroup");"start"===stateDef.type&&drawStartState(g),"end"===stateDef.type&&drawEndState(g),"fork"!==stateDef.type&&"join"!==stateDef.type||drawForkJoinState(g,stateDef),"note"===stateDef.type&&drawNote(stateDef.note.text,g),"divider"===stateDef.type&&drawDivider(g),"default"===stateDef.type&&0===stateDef.descriptions.length&&drawSimpleState(g,stateDef),"default"===stateDef.type&&stateDef.descriptions.length>0&&drawDescrState(g,stateDef);const stateBox=g.node().getBBox();return stateInfo.width=stateBox.width+2*getConfig2().state.padding,stateInfo.height=stateBox.height+2*getConfig2().state.padding,stateInfo},"drawState"),edgeCount=0,drawEdge=__name(function(elem,path,relation){const getRelationType=__name(function(type){switch(type){case StateDB.relationType.AGGREGATION:return"aggregation";case StateDB.relationType.EXTENSION:return"extension";case StateDB.relationType.COMPOSITION:return"composition";case StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");path.points=path.points.filter(p=>!Number.isNaN(p.y));const lineData=path.points,lineFunction=line().x(function(d){return d.x}).y(function(d){return d.y}).curve(curveBasis),svgPath=elem.append("path").attr("d",lineFunction(lineData)).attr("id","edge"+edgeCount).attr("class","transition");let url="";if(getConfig2().state.arrowMarkerAbsolute&&(url=getUrl(!0)),svgPath.attr("marker-end","url("+url+"#"+getRelationType(StateDB.relationType.DEPENDENCY)+"End)"),void 0!==relation.title){const label=elem.append("g").attr("class","stateLabel"),{x:x,y:y}=utils_default.calcLabelPosition(path.points),rows=common_default.getRows(relation.title);let titleHeight=0;const titleRows=[];let maxWidth=0,minX=0;for(let i=0;i<=rows.length;i++){const title=label.append("text").attr("text-anchor","middle").text(rows[i]).attr("x",x).attr("y",y+titleHeight),boundsTmp=title.node().getBBox();if(maxWidth=Math.max(maxWidth,boundsTmp.width),minX=Math.min(minX,boundsTmp.x),log.info(boundsTmp.x,x,y+titleHeight),0===titleHeight){const titleBox=title.node().getBBox();titleHeight=titleBox.height,log.info("Title height",titleHeight,y)}titleRows.push(title)}let boxHeight=titleHeight*rows.length;if(rows.length>1){const heightAdj=(rows.length-1)*titleHeight*.5;titleRows.forEach((title,i)=>title.attr("y",y+i*titleHeight-heightAdj)),boxHeight=titleHeight*rows.length}const bounds=label.node().getBBox();label.insert("rect",":first-child").attr("class","box").attr("x",x-maxWidth/2-getConfig2().state.padding/2).attr("y",y-boxHeight/2-getConfig2().state.padding/2-3.5).attr("width",maxWidth+getConfig2().state.padding).attr("height",boxHeight+getConfig2().state.padding),log.info(bounds)}edgeCount++},"drawEdge"),transformationLog={},setConf=__name(function(){},"setConf"),insertMarkers=__name(function(elem){elem.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),draw=__name(function(text,id,_version,diagObj){conf=getConfig2().state;const securityLevel=getConfig2().securityLevel;let sandboxElement;"sandbox"===securityLevel&&(sandboxElement=select("#i"+id));const root=select("sandbox"===securityLevel?sandboxElement.nodes()[0].contentDocument.body:"body"),doc="sandbox"===securityLevel?sandboxElement.nodes()[0].contentDocument:document;log.debug("Rendering diagram "+text);const diagram2=root.select(`[id='${id}']`);insertMarkers(diagram2);const rootDoc=diagObj.db.getRootDoc(),rootG=diagram2.append("g").attr("id",id+"-root");renderDoc(rootDoc,rootG,void 0,!1,root,doc,diagObj);const padding=conf.padding,bounds=diagram2.node().getBBox(),width=bounds.width+2*padding,height=bounds.height+2*padding;configureSvgSize(diagram2,height,1.75*width,conf.useMaxWidth),diagram2.attr("viewBox",`${bounds.x-conf.padding} ${bounds.y-conf.padding} `+width+" "+height)},"draw"),getLabelWidth=__name(text=>text?text.length*conf.fontSizeFactor:1,"getLabelWidth"),renderDoc=__name((doc,diagram2,parentId,altBkg,root,domDocument,diagObj)=>{const graph=new Graph({compound:!0,multigraph:!0});let i,edgeFreeDoc=!0;for(i=0;i<doc.length;i++)if("relation"===doc[i].stmt){edgeFreeDoc=!1;break}parentId?graph.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:edgeFreeDoc?1:conf.edgeLengthFactor,nodeSep:edgeFreeDoc?1:50,isMultiGraph:!0}):graph.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:edgeFreeDoc?1:conf.edgeLengthFactor,nodeSep:edgeFreeDoc?1:50,ranker:"tight-tree",isMultiGraph:!0}),graph.setDefaultEdgeLabel(function(){return{}});const states=diagObj.db.getStates(),relations=diagObj.db.getRelations(),keys=Object.keys(states);for(const key of keys){const stateDef=states[key];let node;if(parentId&&(stateDef.parentId=parentId),stateDef.doc){let sub=diagram2.append("g").attr("id",stateDef.id).attr("class","stateGroup");node=renderDoc(stateDef.doc,sub,stateDef.id,!altBkg,root,domDocument,diagObj);{sub=addTitleAndBox(sub,stateDef,altBkg);let boxBounds=sub.node().getBBox();node.width=boxBounds.width,node.height=boxBounds.height+conf.padding/2,transformationLog[stateDef.id]={y:conf.compositTitleSize}}}else node=drawState(diagram2,stateDef,graph);if(stateDef.note){const noteDef={descriptions:[],id:stateDef.id+"-note",note:stateDef.note,type:"note"},note=drawState(diagram2,noteDef,graph);"left of"===stateDef.note.position?(graph.setNode(node.id+"-note",note),graph.setNode(node.id,node)):(graph.setNode(node.id,node),graph.setNode(node.id+"-note",note)),graph.setParent(node.id,node.id+"-group"),graph.setParent(node.id+"-note",node.id+"-group")}else graph.setNode(node.id,node)}log.debug("Count=",graph.nodeCount(),graph);let cnt=0;relations.forEach(function(relation){cnt++,log.debug("Setting edge",relation),graph.setEdge(relation.id1,relation.id2,{relation:relation,width:getLabelWidth(relation.title),height:conf.labelHeight*common_default.getRows(relation.title).length,labelpos:"c"},"id"+cnt)}),layout(graph),log.debug("Graph after layout",graph.nodes());const svgElem=diagram2.node();graph.nodes().forEach(function(v){if(void 0!==v&&void 0!==graph.node(v)){log.warn("Node "+v+": "+JSON.stringify(graph.node(v))),root.select("#"+svgElem.id+" #"+v).attr("transform","translate("+(graph.node(v).x-graph.node(v).width/2)+","+(graph.node(v).y+(transformationLog[v]?transformationLog[v].y:0)-graph.node(v).height/2)+" )"),root.select("#"+svgElem.id+" #"+v).attr("data-x-shift",graph.node(v).x-graph.node(v).width/2);domDocument.querySelectorAll("#"+svgElem.id+" #"+v+" .divider").forEach(divider=>{const parent=divider.parentElement;let pWidth=0,pShift=0;parent&&(parent.parentElement&&(pWidth=parent.parentElement.getBBox().width),pShift=parseInt(parent.getAttribute("data-x-shift"),10),Number.isNaN(pShift)&&(pShift=0)),divider.setAttribute("x1",0-pShift+8),divider.setAttribute("x2",pWidth-pShift-8)})}else log.debug("No Node "+v+": "+JSON.stringify(graph.node(v)))});let stateBox=svgElem.getBBox();graph.edges().forEach(function(e){void 0!==e&&void 0!==graph.edge(e)&&(log.debug("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(graph.edge(e))),drawEdge(diagram2,graph.edge(e),graph.edge(e).relation))}),stateBox=svgElem.getBBox();const stateInfo={id:parentId||"root",label:parentId||"root",width:0,height:0};return stateInfo.width=stateBox.width+2*conf.padding,stateInfo.height=stateBox.height+2*conf.padding,log.debug("Doc rendered",stateInfo,graph),stateInfo},"renderDoc"),stateRenderer_default={setConf:setConf,draw:draw},diagram={parser:stateDiagram_default,get db(){return new StateDB(1)},renderer:stateRenderer_default,styles:styles_default,init:__name(cnf=>{cnf.state||(cnf.state={}),cnf.state.arrowMarkerAbsolute=cnf.arrowMarkerAbsolute},"init")};export{diagram};
1
+ import{s as styles_default,a as stateDiagram_default,S as StateDB}from"./chunk-OYMX7WX6-CqDjPVtV.js";import{_ as __name,c as getConfig2,d as select,l as log,e as configureSvgSize,k as common_default,Q as line,R as curveBasis,N as getUrl,u as utils_default}from"./mermaid.core-ChPdLHKc.js";import{G as Graph}from"./graph-CjZv0z2E.js";import{l as layout}from"./layout-BlkPouba.js";import"./chunk-55IACEB6-9BqfRmoj.js";import"./chunk-EDXVE4YY-B2war4-Q.js";import"./vendor-mdxeditor-Dp19LkWF.js";import"./vendor-antd-BS2aqEyQ.js";import"./vendor-codemirror-DpOKy7e3.js";import"./vendor-markdown-Bpu4AByL.js";import"./_baseUniq-BhNv8Xvc.js";import"./min-Cyf5226k.js";var conf,drawStartState=__name(g=>g.append("circle").attr("class","start-state").attr("r",getConfig2().state.sizeUnit).attr("cx",getConfig2().state.padding+getConfig2().state.sizeUnit).attr("cy",getConfig2().state.padding+getConfig2().state.sizeUnit),"drawStartState"),drawDivider=__name(g=>g.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",getConfig2().state.textHeight).attr("class","divider").attr("x2",2*getConfig2().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),drawSimpleState=__name((g,stateDef)=>{const state=g.append("text").attr("x",2*getConfig2().state.padding).attr("y",getConfig2().state.textHeight+2*getConfig2().state.padding).attr("font-size",getConfig2().state.fontSize).attr("class","state-title").text(stateDef.id),classBox=state.node().getBBox();return g.insert("rect",":first-child").attr("x",getConfig2().state.padding).attr("y",getConfig2().state.padding).attr("width",classBox.width+2*getConfig2().state.padding).attr("height",classBox.height+2*getConfig2().state.padding).attr("rx",getConfig2().state.radius),state},"drawSimpleState"),drawDescrState=__name((g,stateDef)=>{const addTspan=__name(function(textEl,txt,isFirst2){const tSpan=textEl.append("tspan").attr("x",2*getConfig2().state.padding).text(txt);isFirst2||tSpan.attr("dy",getConfig2().state.textHeight)},"addTspan"),titleBox=g.append("text").attr("x",2*getConfig2().state.padding).attr("y",getConfig2().state.textHeight+1.3*getConfig2().state.padding).attr("font-size",getConfig2().state.fontSize).attr("class","state-title").text(stateDef.descriptions[0]).node().getBBox(),titleHeight=titleBox.height,description=g.append("text").attr("x",getConfig2().state.padding).attr("y",titleHeight+.4*getConfig2().state.padding+getConfig2().state.dividerMargin+getConfig2().state.textHeight).attr("class","state-description");let isFirst=!0,isSecond=!0;stateDef.descriptions.forEach(function(descr){isFirst||(addTspan(description,descr,isSecond),isSecond=!1),isFirst=!1});const descrLine=g.append("line").attr("x1",getConfig2().state.padding).attr("y1",getConfig2().state.padding+titleHeight+getConfig2().state.dividerMargin/2).attr("y2",getConfig2().state.padding+titleHeight+getConfig2().state.dividerMargin/2).attr("class","descr-divider"),descrBox=description.node().getBBox(),width=Math.max(descrBox.width,titleBox.width);return descrLine.attr("x2",width+3*getConfig2().state.padding),g.insert("rect",":first-child").attr("x",getConfig2().state.padding).attr("y",getConfig2().state.padding).attr("width",width+2*getConfig2().state.padding).attr("height",descrBox.height+titleHeight+2*getConfig2().state.padding).attr("rx",getConfig2().state.radius),g},"drawDescrState"),addTitleAndBox=__name((g,stateDef,altBkg)=>{const pad=getConfig2().state.padding,dblPad=2*getConfig2().state.padding,orgBox=g.node().getBBox(),orgWidth=orgBox.width,orgX=orgBox.x,title=g.append("text").attr("x",0).attr("y",getConfig2().state.titleShift).attr("font-size",getConfig2().state.fontSize).attr("class","state-title").text(stateDef.id),titleWidth=title.node().getBBox().width+dblPad;let startX,width=Math.max(titleWidth,orgWidth);width===orgWidth&&(width+=dblPad);const graphBox=g.node().getBBox();stateDef.doc,startX=orgX-pad,titleWidth>orgWidth&&(startX=(orgWidth-width)/2+pad),Math.abs(orgX-graphBox.x)<pad&&titleWidth>orgWidth&&(startX=orgX-(titleWidth-orgWidth)/2);const lineY=1-getConfig2().state.textHeight;return g.insert("rect",":first-child").attr("x",startX).attr("y",lineY).attr("class",altBkg?"alt-composit":"composit").attr("width",width).attr("height",graphBox.height+getConfig2().state.textHeight+getConfig2().state.titleShift+1).attr("rx","0"),title.attr("x",startX+pad),titleWidth<=orgWidth&&title.attr("x",orgX+(width-dblPad)/2-titleWidth/2+pad),g.insert("rect",":first-child").attr("x",startX).attr("y",getConfig2().state.titleShift-getConfig2().state.textHeight-getConfig2().state.padding).attr("width",width).attr("height",3*getConfig2().state.textHeight).attr("rx",getConfig2().state.radius),g.insert("rect",":first-child").attr("x",startX).attr("y",getConfig2().state.titleShift-getConfig2().state.textHeight-getConfig2().state.padding).attr("width",width).attr("height",graphBox.height+3+2*getConfig2().state.textHeight).attr("rx",getConfig2().state.radius),g},"addTitleAndBox"),drawEndState=__name(g=>(g.append("circle").attr("class","end-state-outer").attr("r",getConfig2().state.sizeUnit+getConfig2().state.miniPadding).attr("cx",getConfig2().state.padding+getConfig2().state.sizeUnit+getConfig2().state.miniPadding).attr("cy",getConfig2().state.padding+getConfig2().state.sizeUnit+getConfig2().state.miniPadding),g.append("circle").attr("class","end-state-inner").attr("r",getConfig2().state.sizeUnit).attr("cx",getConfig2().state.padding+getConfig2().state.sizeUnit+2).attr("cy",getConfig2().state.padding+getConfig2().state.sizeUnit+2)),"drawEndState"),drawForkJoinState=__name((g,stateDef)=>{let width=getConfig2().state.forkWidth,height=getConfig2().state.forkHeight;if(stateDef.parentId){let tmp=width;width=height,height=tmp}return g.append("rect").style("stroke","black").style("fill","black").attr("width",width).attr("height",height).attr("x",getConfig2().state.padding).attr("y",getConfig2().state.padding)},"drawForkJoinState"),_drawLongText=__name((_text,x,y,g)=>{let textHeight=0;const textElem=g.append("text");textElem.style("text-anchor","start"),textElem.attr("class","noteText");let text=_text.replace(/\r\n/g,"<br/>");text=text.replace(/\n/g,"<br/>");const lines=text.split(common_default.lineBreakRegex);let tHeight=1.25*getConfig2().state.noteMargin;for(const line2 of lines){const txt=line2.trim();if(txt.length>0){const span=textElem.append("tspan");if(span.text(txt),0===tHeight){tHeight+=span.node().getBBox().height}textHeight+=tHeight,span.attr("x",x+getConfig2().state.noteMargin),span.attr("y",y+textHeight+1.25*getConfig2().state.noteMargin)}}return{textWidth:textElem.node().getBBox().width,textHeight:textHeight}},"_drawLongText"),drawNote=__name((text,g)=>{g.attr("class","state-note");const note=g.append("rect").attr("x",0).attr("y",getConfig2().state.padding),rectElem=g.append("g"),{textWidth:textWidth,textHeight:textHeight}=_drawLongText(text,0,0,rectElem);return note.attr("height",textHeight+2*getConfig2().state.noteMargin),note.attr("width",textWidth+2*getConfig2().state.noteMargin),note},"drawNote"),drawState=__name(function(elem,stateDef){const id=stateDef.id,stateInfo={id:id,label:stateDef.id,width:0,height:0},g=elem.append("g").attr("id",id).attr("class","stateGroup");"start"===stateDef.type&&drawStartState(g),"end"===stateDef.type&&drawEndState(g),"fork"!==stateDef.type&&"join"!==stateDef.type||drawForkJoinState(g,stateDef),"note"===stateDef.type&&drawNote(stateDef.note.text,g),"divider"===stateDef.type&&drawDivider(g),"default"===stateDef.type&&0===stateDef.descriptions.length&&drawSimpleState(g,stateDef),"default"===stateDef.type&&stateDef.descriptions.length>0&&drawDescrState(g,stateDef);const stateBox=g.node().getBBox();return stateInfo.width=stateBox.width+2*getConfig2().state.padding,stateInfo.height=stateBox.height+2*getConfig2().state.padding,stateInfo},"drawState"),edgeCount=0,drawEdge=__name(function(elem,path,relation){const getRelationType=__name(function(type){switch(type){case StateDB.relationType.AGGREGATION:return"aggregation";case StateDB.relationType.EXTENSION:return"extension";case StateDB.relationType.COMPOSITION:return"composition";case StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");path.points=path.points.filter(p=>!Number.isNaN(p.y));const lineData=path.points,lineFunction=line().x(function(d){return d.x}).y(function(d){return d.y}).curve(curveBasis),svgPath=elem.append("path").attr("d",lineFunction(lineData)).attr("id","edge"+edgeCount).attr("class","transition");let url="";if(getConfig2().state.arrowMarkerAbsolute&&(url=getUrl(!0)),svgPath.attr("marker-end","url("+url+"#"+getRelationType(StateDB.relationType.DEPENDENCY)+"End)"),void 0!==relation.title){const label=elem.append("g").attr("class","stateLabel"),{x:x,y:y}=utils_default.calcLabelPosition(path.points),rows=common_default.getRows(relation.title);let titleHeight=0;const titleRows=[];let maxWidth=0,minX=0;for(let i=0;i<=rows.length;i++){const title=label.append("text").attr("text-anchor","middle").text(rows[i]).attr("x",x).attr("y",y+titleHeight),boundsTmp=title.node().getBBox();if(maxWidth=Math.max(maxWidth,boundsTmp.width),minX=Math.min(minX,boundsTmp.x),log.info(boundsTmp.x,x,y+titleHeight),0===titleHeight){const titleBox=title.node().getBBox();titleHeight=titleBox.height,log.info("Title height",titleHeight,y)}titleRows.push(title)}let boxHeight=titleHeight*rows.length;if(rows.length>1){const heightAdj=(rows.length-1)*titleHeight*.5;titleRows.forEach((title,i)=>title.attr("y",y+i*titleHeight-heightAdj)),boxHeight=titleHeight*rows.length}const bounds=label.node().getBBox();label.insert("rect",":first-child").attr("class","box").attr("x",x-maxWidth/2-getConfig2().state.padding/2).attr("y",y-boxHeight/2-getConfig2().state.padding/2-3.5).attr("width",maxWidth+getConfig2().state.padding).attr("height",boxHeight+getConfig2().state.padding),log.info(bounds)}edgeCount++},"drawEdge"),transformationLog={},setConf=__name(function(){},"setConf"),insertMarkers=__name(function(elem){elem.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),draw=__name(function(text,id,_version,diagObj){conf=getConfig2().state;const securityLevel=getConfig2().securityLevel;let sandboxElement;"sandbox"===securityLevel&&(sandboxElement=select("#i"+id));const root=select("sandbox"===securityLevel?sandboxElement.nodes()[0].contentDocument.body:"body"),doc="sandbox"===securityLevel?sandboxElement.nodes()[0].contentDocument:document;log.debug("Rendering diagram "+text);const diagram2=root.select(`[id='${id}']`);insertMarkers(diagram2);const rootDoc=diagObj.db.getRootDoc(),rootG=diagram2.append("g").attr("id",id+"-root");renderDoc(rootDoc,rootG,void 0,!1,root,doc,diagObj);const padding=conf.padding,bounds=diagram2.node().getBBox(),width=bounds.width+2*padding,height=bounds.height+2*padding;configureSvgSize(diagram2,height,1.75*width,conf.useMaxWidth),diagram2.attr("viewBox",`${bounds.x-conf.padding} ${bounds.y-conf.padding} `+width+" "+height)},"draw"),getLabelWidth=__name(text=>text?text.length*conf.fontSizeFactor:1,"getLabelWidth"),renderDoc=__name((doc,diagram2,parentId,altBkg,root,domDocument,diagObj)=>{const graph=new Graph({compound:!0,multigraph:!0});let i,edgeFreeDoc=!0;for(i=0;i<doc.length;i++)if("relation"===doc[i].stmt){edgeFreeDoc=!1;break}parentId?graph.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:edgeFreeDoc?1:conf.edgeLengthFactor,nodeSep:edgeFreeDoc?1:50,isMultiGraph:!0}):graph.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:edgeFreeDoc?1:conf.edgeLengthFactor,nodeSep:edgeFreeDoc?1:50,ranker:"tight-tree",isMultiGraph:!0}),graph.setDefaultEdgeLabel(function(){return{}});const states=diagObj.db.getStates(),relations=diagObj.db.getRelations(),keys=Object.keys(states);for(const key of keys){const stateDef=states[key];let node;if(parentId&&(stateDef.parentId=parentId),stateDef.doc){let sub=diagram2.append("g").attr("id",stateDef.id).attr("class","stateGroup");node=renderDoc(stateDef.doc,sub,stateDef.id,!altBkg,root,domDocument,diagObj);{sub=addTitleAndBox(sub,stateDef,altBkg);let boxBounds=sub.node().getBBox();node.width=boxBounds.width,node.height=boxBounds.height+conf.padding/2,transformationLog[stateDef.id]={y:conf.compositTitleSize}}}else node=drawState(diagram2,stateDef,graph);if(stateDef.note){const noteDef={descriptions:[],id:stateDef.id+"-note",note:stateDef.note,type:"note"},note=drawState(diagram2,noteDef,graph);"left of"===stateDef.note.position?(graph.setNode(node.id+"-note",note),graph.setNode(node.id,node)):(graph.setNode(node.id,node),graph.setNode(node.id+"-note",note)),graph.setParent(node.id,node.id+"-group"),graph.setParent(node.id+"-note",node.id+"-group")}else graph.setNode(node.id,node)}log.debug("Count=",graph.nodeCount(),graph);let cnt=0;relations.forEach(function(relation){cnt++,log.debug("Setting edge",relation),graph.setEdge(relation.id1,relation.id2,{relation:relation,width:getLabelWidth(relation.title),height:conf.labelHeight*common_default.getRows(relation.title).length,labelpos:"c"},"id"+cnt)}),layout(graph),log.debug("Graph after layout",graph.nodes());const svgElem=diagram2.node();graph.nodes().forEach(function(v){if(void 0!==v&&void 0!==graph.node(v)){log.warn("Node "+v+": "+JSON.stringify(graph.node(v))),root.select("#"+svgElem.id+" #"+v).attr("transform","translate("+(graph.node(v).x-graph.node(v).width/2)+","+(graph.node(v).y+(transformationLog[v]?transformationLog[v].y:0)-graph.node(v).height/2)+" )"),root.select("#"+svgElem.id+" #"+v).attr("data-x-shift",graph.node(v).x-graph.node(v).width/2);domDocument.querySelectorAll("#"+svgElem.id+" #"+v+" .divider").forEach(divider=>{const parent=divider.parentElement;let pWidth=0,pShift=0;parent&&(parent.parentElement&&(pWidth=parent.parentElement.getBBox().width),pShift=parseInt(parent.getAttribute("data-x-shift"),10),Number.isNaN(pShift)&&(pShift=0)),divider.setAttribute("x1",0-pShift+8),divider.setAttribute("x2",pWidth-pShift-8)})}else log.debug("No Node "+v+": "+JSON.stringify(graph.node(v)))});let stateBox=svgElem.getBBox();graph.edges().forEach(function(e){void 0!==e&&void 0!==graph.edge(e)&&(log.debug("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(graph.edge(e))),drawEdge(diagram2,graph.edge(e),graph.edge(e).relation))}),stateBox=svgElem.getBBox();const stateInfo={id:parentId||"root",label:parentId||"root",width:0,height:0};return stateInfo.width=stateBox.width+2*conf.padding,stateInfo.height=stateBox.height+2*conf.padding,log.debug("Doc rendered",stateInfo,graph),stateInfo},"renderDoc"),stateRenderer_default={setConf:setConf,draw:draw},diagram={parser:stateDiagram_default,get db(){return new StateDB(1)},renderer:stateRenderer_default,styles:styles_default,init:__name(cnf=>{cnf.state||(cnf.state={}),cnf.state.arrowMarkerAbsolute=cnf.arrowMarkerAbsolute},"init")};export{diagram};
@@ -1 +1 @@
1
- import{s as styles_default,b as stateRenderer_v3_unified_default,a as stateDiagram_default,S as StateDB}from"./chunk-OYMX7WX6-Diipa-PH.js";import{_ as __name}from"./mermaid.core-uz8EInB1.js";import"./chunk-55IACEB6-D0alajG6.js";import"./chunk-EDXVE4YY-bDzoLfvk.js";import"./vendor-mdxeditor-2ethWb9I.js";import"./vendor-antd-CAAyMICZ.js";import"./vendor-codemirror-zGsatVJf.js";import"./vendor-markdown-Bpu4AByL.js";var diagram={parser:stateDiagram_default,get db(){return new StateDB(2)},renderer:stateRenderer_v3_unified_default,styles:styles_default,init:__name(cnf=>{cnf.state||(cnf.state={}),cnf.state.arrowMarkerAbsolute=cnf.arrowMarkerAbsolute},"init")};export{diagram};
1
+ import{s as styles_default,b as stateRenderer_v3_unified_default,a as stateDiagram_default,S as StateDB}from"./chunk-OYMX7WX6-CqDjPVtV.js";import{_ as __name}from"./mermaid.core-ChPdLHKc.js";import"./chunk-55IACEB6-9BqfRmoj.js";import"./chunk-EDXVE4YY-B2war4-Q.js";import"./vendor-mdxeditor-Dp19LkWF.js";import"./vendor-antd-BS2aqEyQ.js";import"./vendor-codemirror-DpOKy7e3.js";import"./vendor-markdown-Bpu4AByL.js";var diagram={parser:stateDiagram_default,get db(){return new StateDB(2)},renderer:stateRenderer_v3_unified_default,styles:styles_default,init:__name(cnf=>{cnf.state||(cnf.state={}),cnf.state.arrowMarkerAbsolute=cnf.arrowMarkerAbsolute},"init")};export{diagram};
@@ -1 +1 @@
1
- import{_ as __name,C as getConfig,U as isDark,V as lighten,W as darken,c as getConfig2,l as log,H as selectSvgElement,M as parseFontSize,X as setupGraphViewbox,d as select,B as __export,Y as commonDb_exports,y as clear}from"./mermaid.core-uz8EInB1.js";import{d as d3arc}from"./arc-B4smmOzy.js";import"./vendor-mdxeditor-2ethWb9I.js";import"./vendor-antd-CAAyMICZ.js";import"./vendor-codemirror-zGsatVJf.js";import"./vendor-markdown-Bpu4AByL.js";var parser=function(){var o=__name(function(k,v,o2,l){for(o2=o2||{},l=k.length;l--;o2[k[l]]=v);return o2},"o"),$V0=[6,11,13,14,15,17,19,20,23,24],$V1=[1,12],$V2=[1,13],$V3=[1,14],$V4=[1,15],$V5=[1,16],$V6=[1,19],$V7=[1,20],parser2={trace:__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:__name(function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return $$[$0-1];case 3:yy.setDirection("LR");break;case 4:yy.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:$$[$0-1].push($$[$0]),this.$=$$[$0-1];break;case 7:case 8:this.$=$$[$0];break;case 11:yy.getCommonDb().setDiagramTitle($$[$0].substr(6)),this.$=$$[$0].substr(6);break;case 12:this.$=$$[$0].trim(),yy.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=$$[$0].trim(),yy.getCommonDb().setAccDescription(this.$);break;case 15:yy.addSection($$[$0].substr(8)),this.$=$$[$0].substr(8);break;case 18:yy.addTask($$[$0],0,""),this.$=$$[$0];break;case 19:yy.addEvent($$[$0].substr(2)),this.$=$$[$0]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},o($V0,[2,5],{5:6}),o($V0,[2,2]),o($V0,[2,3]),o($V0,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:$V1,15:$V2,17:$V3,19:$V4,20:$V5,21:17,22:18,23:$V6,24:$V7},o($V0,[2,10],{1:[2,1]}),o($V0,[2,6]),{12:21,14:$V1,15:$V2,17:$V3,19:$V4,20:$V5,21:17,22:18,23:$V6,24:$V7},o($V0,[2,8]),o($V0,[2,9]),o($V0,[2,11]),{16:[1,22]},{18:[1,23]},o($V0,[2,14]),o($V0,[2,15]),o($V0,[2,16]),o($V0,[2,17]),o($V0,[2,18]),o($V0,[2,19]),o($V0,[2,7]),o($V0,[2,12]),o($V0,[2,13])],defaultActions:{},parseError:__name(function(str,hash){if(!hash.recoverable){var error=new Error(str);throw error.hash=hash,error}this.trace(str)},"parseError"),parse:__name(function(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,args=lstack.slice.call(arguments,1),lexer2=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer2.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer2,sharedState.yy.parser=this,void 0===lexer2.yylloc&&(lexer2.yylloc={});var yyloc=lexer2.yylloc;lstack.push(yyloc);var ranges=lexer2.options&&lexer2.options.ranges;function lex(){var token;return"number"!=typeof(token=tstack.pop()||lexer2.lex()||1)&&(token instanceof Array&&(token=(tstack=token).pop()),token=self.symbols_[token]||token),token}"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,__name(function(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n},"popStack"),__name(lex,"lex");for(var symbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer2.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer2.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer2.match,token:this.terminals_[symbol]||symbol,line:lexer2.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer2.yytext),lstack.push(lexer2.yylloc),stack.push(action[1]),symbol=null,yyleng=lexer2.yyleng,yytext=lexer2.yytext,yylineno=lexer2.yylineno,yyloc=lexer2.yylloc;break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args))))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0},"parse")},lexer=function(){return{EOF:1,parseError:__name(function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},"parseError"),setInput:__name(function(input,yy){return this.yy=yy||this.yy||{},this._input=input,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:__name(function(){var ch=this._input[0];return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.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),ch},"input"),unput:__name(function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=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),lines.length-1&&(this.yylineno-=lines.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},"unput"),more:__name(function(){return this._more=!0,this},"more"),reject:__name(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:__name(function(n){this.unput(this.match.slice(n))},"less"),pastInput:__name(function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:__name(function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:__name(function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},"showPosition"),test_match:__name(function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={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&&(backup.yylloc.range=this.yylloc.range.slice(0))),(lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,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(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},"test_match"),next:__name(function(){if(this.done)return this.EOF;var token,match,tempMatch,index;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length;i++)if((tempMatch=this._input.match(this.rules[rules[i]]))&&(!match||tempMatch[0].length>match[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(!1!==(token=this.test_match(tempMatch,rules[i])))return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?!1!==(token=this.test_match(match,rules[index]))&&token:""===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:__name(function(){var r=this.next();return r||this.lex()},"lex"),begin:__name(function(condition){this.conditionStack.push(condition)},"begin"),popState:__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:__name(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:__name(function(n){return(n=this.conditionStack.length-1-Math.abs(n||0))>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:__name(function(condition){this.begin(condition)},"pushState"),stateStackSize:__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:__name(function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}}();function Parser(){this.yy={}}return parser2.lexer=lexer,__name(Parser,"Parser"),Parser.prototype=parser2,parser2.Parser=Parser,new Parser}();parser.parser=parser;var timeline_default=parser,timelineDb_exports={};__export(timelineDb_exports,{addEvent:()=>addEvent,addSection:()=>addSection,addTask:()=>addTask,addTaskOrg:()=>addTaskOrg,clear:()=>clear2,default:()=>timelineDb_default,getCommonDb:()=>getCommonDb,getDirection:()=>getDirection,getSections:()=>getSections,getTasks:()=>getTasks,setDirection:()=>setDirection});var currentSection="",currentTaskId=0,direction="LR",sections=[],tasks=[],rawTasks=[],getCommonDb=__name(()=>commonDb_exports,"getCommonDb"),clear2=__name(function(){sections.length=0,tasks.length=0,currentSection="",rawTasks.length=0,direction="LR",clear()},"clear"),setDirection=__name(function(dir){direction=dir},"setDirection"),getDirection=__name(function(){return direction},"getDirection"),addSection=__name(function(txt){currentSection=txt,sections.push(txt)},"addSection"),getSections=__name(function(){return sections},"getSections"),getTasks=__name(function(){let allItemsProcessed=compileTasks();let iterationCount=0;for(;!allItemsProcessed&&iterationCount<100;)allItemsProcessed=compileTasks(),iterationCount++;return tasks.push(...rawTasks),tasks},"getTasks"),addTask=__name(function(period,length,event){const rawTask={id:currentTaskId++,section:currentSection,type:currentSection,task:period,score:length||0,events:event?[event]:[]};rawTasks.push(rawTask)},"addTask"),addEvent=__name(function(event){rawTasks.find(task=>task.id===currentTaskId-1).events.push(event)},"addEvent"),addTaskOrg=__name(function(descr){const newTask={section:currentSection,type:currentSection,description:descr,task:descr,classes:[]};tasks.push(newTask)},"addTaskOrg"),compileTasks=__name(function(){const compileTask=__name(function(pos){return rawTasks[pos].processed},"compileTask");let allProcessed=!0;for(const[i,rawTask]of rawTasks.entries())compileTask(i),allProcessed=allProcessed&&rawTask.processed;return allProcessed},"compileTasks"),timelineDb_default={clear:clear2,getCommonDb:getCommonDb,getDirection:getDirection,setDirection:setDirection,addSection:addSection,getSections:getSections,getTasks:getTasks,addTask:addTask,addTaskOrg:addTaskOrg,addEvent:addEvent},nodeCount=0,drawRect=__name(function(elem,rectData){const rectElem=elem.append("rect");return rectElem.attr("x",rectData.x),rectElem.attr("y",rectData.y),rectElem.attr("fill",rectData.fill),rectElem.attr("stroke",rectData.stroke),rectElem.attr("width",rectData.width),rectElem.attr("height",rectData.height),rectElem.attr("rx",rectData.rx),rectElem.attr("ry",rectData.ry),void 0!==rectData.class&&rectElem.attr("class",rectData.class),rectElem},"drawRect"),drawFace=__name(function(element,faceData){const circleElement=element.append("circle").attr("cx",faceData.cx).attr("cy",faceData.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),face=element.append("g");function smile(face2){const arc=d3arc().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);face2.append("path").attr("class","mouth").attr("d",arc).attr("transform","translate("+faceData.cx+","+(faceData.cy+2)+")")}function sad(face2){const arc=d3arc().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);face2.append("path").attr("class","mouth").attr("d",arc).attr("transform","translate("+faceData.cx+","+(faceData.cy+7)+")")}function ambivalent(face2){face2.append("line").attr("class","mouth").attr("stroke",2).attr("x1",faceData.cx-5).attr("y1",faceData.cy+7).attr("x2",faceData.cx+5).attr("y2",faceData.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return face.append("circle").attr("cx",faceData.cx-5).attr("cy",faceData.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),face.append("circle").attr("cx",faceData.cx+5).attr("cy",faceData.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),__name(smile,"smile"),__name(sad,"sad"),__name(ambivalent,"ambivalent"),faceData.score>3?smile(face):faceData.score<3?sad(face):ambivalent(face),circleElement},"drawFace"),drawCircle=__name(function(element,circleData){const circleElement=element.append("circle");return circleElement.attr("cx",circleData.cx),circleElement.attr("cy",circleData.cy),circleElement.attr("class","actor-"+circleData.pos),circleElement.attr("fill",circleData.fill),circleElement.attr("stroke",circleData.stroke),circleElement.attr("r",circleData.r),void 0!==circleElement.class&&circleElement.attr("class",circleElement.class),void 0!==circleData.title&&circleElement.append("title").text(circleData.title),circleElement},"drawCircle"),drawText=__name(function(elem,textData){const nText=textData.text.replace(/<br\s*\/?>/gi," "),textElem=elem.append("text");textElem.attr("x",textData.x),textElem.attr("y",textData.y),textElem.attr("class","legend"),textElem.style("text-anchor",textData.anchor),void 0!==textData.class&&textElem.attr("class",textData.class);const span=textElem.append("tspan");return span.attr("x",textData.x+2*textData.textMargin),span.text(nText),textElem},"drawText"),drawLabel=__name(function(elem,txtObject){function genPoints(x,y,width,height,cut){return x+","+y+" "+(x+width)+","+y+" "+(x+width)+","+(y+height-cut)+" "+(x+width-1.2*cut)+","+(y+height)+" "+x+","+(y+height)}__name(genPoints,"genPoints");const polygon=elem.append("polygon");polygon.attr("points",genPoints(txtObject.x,txtObject.y,50,20,7)),polygon.attr("class","labelBox"),txtObject.y=txtObject.y+txtObject.labelMargin,txtObject.x=txtObject.x+.5*txtObject.labelMargin,drawText(elem,txtObject)},"drawLabel"),drawSection=__name(function(elem,section,conf){const g=elem.append("g"),rect=getNoteRect();rect.x=section.x,rect.y=section.y,rect.fill=section.fill,rect.width=conf.width,rect.height=conf.height,rect.class="journey-section section-type-"+section.num,rect.rx=3,rect.ry=3,drawRect(g,rect),_drawTextCandidateFunc(conf)(section.text,g,rect.x,rect.y,rect.width,rect.height,{class:"journey-section section-type-"+section.num},conf,section.colour)},"drawSection"),taskCount=-1,drawTask=__name(function(elem,task,conf,diagramId){const center=task.x+conf.width/2,g=elem.append("g");taskCount++;g.append("line").attr("id",diagramId+"-task"+taskCount).attr("x1",center).attr("y1",task.y).attr("x2",center).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),drawFace(g,{cx:center,cy:300+30*(5-task.score),score:task.score});const rect=getNoteRect();rect.x=task.x,rect.y=task.y,rect.fill=task.fill,rect.width=conf.width,rect.height=conf.height,rect.class="task task-type-"+task.num,rect.rx=3,rect.ry=3,drawRect(g,rect),_drawTextCandidateFunc(conf)(task.task,g,rect.x,rect.y,rect.width,rect.height,{class:"task"},conf,task.colour)},"drawTask"),drawBackgroundRect=__name(function(elem,bounds){drawRect(elem,{x:bounds.startx,y:bounds.starty,width:bounds.stopx-bounds.startx,height:bounds.stopy-bounds.starty,fill:bounds.fill,class:"rect"}).lower()},"drawBackgroundRect"),getTextObj=__name(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),getNoteRect=__name(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),_drawTextCandidateFunc=function(){function byText(content,g,x,y,width,height,textAttrs,colour){_setTextAttrs(g.append("text").attr("x",x+width/2).attr("y",y+height/2+5).style("font-color",colour).style("text-anchor","middle").text(content),textAttrs)}function byTspan(content,g,x,y,width,height,textAttrs,conf,colour){const{taskFontSize:taskFontSize,taskFontFamily:taskFontFamily}=conf,lines=content.split(/<br\s*\/?>/gi);for(let i=0;i<lines.length;i++){const dy=i*taskFontSize-taskFontSize*(lines.length-1)/2,text=g.append("text").attr("x",x+width/2).attr("y",y).attr("fill",colour).style("text-anchor","middle").style("font-size",taskFontSize).style("font-family",taskFontFamily);text.append("tspan").attr("x",x+width/2).attr("dy",dy).text(lines[i]),text.attr("y",y+height/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),_setTextAttrs(text,textAttrs)}}function byFo(content,g,x,y,width,height,textAttrs,conf){const body=g.append("switch"),text=body.append("foreignObject").attr("x",x).attr("y",y).attr("width",width).attr("height",height).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");text.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(content),byTspan(content,body,x,y,width,height,textAttrs,conf),_setTextAttrs(text,textAttrs)}function _setTextAttrs(toText,fromTextAttrsDict){for(const key in fromTextAttrsDict)key in fromTextAttrsDict&&toText.attr(key,fromTextAttrsDict[key])}return __name(byText,"byText"),__name(byTspan,"byTspan"),__name(byFo,"byFo"),__name(_setTextAttrs,"_setTextAttrs"),function(conf){return"fo"===conf.textPlacement?byFo:"old"===conf.textPlacement?byText:byTspan}}(),initGraphics=__name(function(graphics,id){nodeCount=0,taskCount=-1,graphics.append("defs").append("marker").attr("id",id+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function wrap(text,width){text.each(function(){var word,text2=select(this),words=text2.text().split(/(\s+|<br>)/).reverse(),line=[],y=text2.attr("y"),dy=parseFloat(text2.attr("dy")),tspan=text2.text(null).append("tspan").attr("x",0).attr("y",y).attr("dy",dy+"em");for(let j=0;j<words.length;j++)word=words[words.length-1-j],line.push(word),tspan.text(line.join(" ").trim()),(tspan.node().getComputedTextLength()>width||"<br>"===word)&&(line.pop(),tspan.text(line.join(" ").trim()),line="<br>"===word?[""]:[word],tspan=text2.append("tspan").attr("x",0).attr("y",y).attr("dy","1.1em").text(word))})}__name(wrap,"wrap");var drawNode=__name(function(elem,node,fullSection,conf,diagramId,isEvent=!1){var _a,_b,_c;const{theme:theme,look:look}=conf,isReduxTheme=null==theme?void 0:theme.includes("redux"),section=fullSection%((null==(_a=null==conf?void 0:conf.themeVariables)?void 0:_a.THEME_COLOR_LIMIT)??12)-1,nodeElem=elem.append("g");node.section=section,nodeElem.attr("class",(node.class?node.class+" ":"")+"timeline-node section-"+section);const bkgElem=nodeElem.append("g"),textElem=nodeElem.append("g"),bbox=textElem.append("text").text(node.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(wrap,node.width).node().getBBox(),fontSize=(null==(_b=conf.fontSize)?void 0:_b.replace)?conf.fontSize.replace("px",""):conf.fontSize;if(node.height=bbox.height+1.1*fontSize*.5+node.padding,node.height=Math.max(node.height,node.maxHeight),node.width=node.width+2*node.padding,textElem.attr("transform","translate("+node.width/2+", "+node.padding/2+")"),isReduxTheme&&textElem.attr("transform",`translate(${node.width/2}, ${isEvent?node.padding/2+3:node.padding})`),defaultBkg(bkgElem,node,section,diagramId,conf),"neo"===look&&(nodeElem.attr("data-look","neo"),isReduxTheme)){const isDark2=theme.includes("dark"),rootSvgNode=(null==(_c=elem.node())?void 0:_c.ownerSVGElement)??elem.node(),rootSvg=select(rootSvgNode),svgId=rootSvg.attr("id")??"",dropShadowId=svgId?`${svgId}-drop-shadow`:"drop-shadow";if(rootSvg.select(`#${dropShadowId}`).empty()){const existingDefs=rootSvg.select("defs");(existingDefs.empty()?rootSvg.append("defs"):existingDefs).append("filter").attr("id",dropShadowId).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",isDark2?"0.2":"0.06").attr("flood-color",isDark2?"#FFFFFF":"#000000")}}return node},"drawNode"),getVirtualNodeHeight=__name(function(elem,node,conf){var _a;const textElem=elem.append("g"),bbox=textElem.append("text").text(node.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(wrap,node.width).node().getBBox(),fontSize=(null==(_a=conf.fontSize)?void 0:_a.replace)?conf.fontSize.replace("px",""):conf.fontSize;return textElem.remove(),bbox.height+1.1*fontSize*.5+node.padding},"getVirtualNodeHeight"),defaultBkg=__name(function(elem,node,section,diagramId,config){const{theme:theme}=config,r=(null==theme?void 0:theme.includes("redux"))?0:5,d=r>0?`M0 ${node.height-5} v${10-node.height} q0,-${r},${r},-${r} h${node.width-10} q${r},0,${r},${r} v${node.height-5} H0 Z`:`M0 ${node.height-5} v${-(node.height-5)} h${node.width} v${node.height} H0 Z`;elem.append("path").attr("id",diagramId+"-node-"+nodeCount++).attr("class","node-bkg node-"+node.type).attr("d",d),(null==theme?void 0:theme.includes("redux"))||elem.append("line").attr("class","node-line-"+section).attr("x1",0).attr("y1",node.height).attr("x2",node.width).attr("y2",node.height)},"defaultBkg"),svgDraw_default={drawRect:drawRect,drawCircle:drawCircle,drawSection:drawSection,drawText:drawText,drawLabel:drawLabel,drawTask:drawTask,drawBackgroundRect:drawBackgroundRect,getTextObj:getTextObj,getNoteRect:getNoteRect,initGraphics:initGraphics,drawNode:drawNode,getVirtualNodeHeight:getVirtualNodeHeight},draw=__name(function(text,id,version,diagObj){var _a,_b,_c;const conf=getConfig2(),{look:look,theme:theme,themeVariables:themeVariables}=conf,{useGradient:useGradient,gradientStart:gradientStart,gradientStop:gradientStop}=themeVariables,LEFT_MARGIN=(null==(_a=conf.timeline)?void 0:_a.leftMargin)??50;log.debug("timeline",diagObj.db);const securityLevel=conf.securityLevel;let sandboxElement;"sandbox"===securityLevel&&(sandboxElement=select("#i"+id));const svg=select("sandbox"===securityLevel?sandboxElement.nodes()[0].contentDocument.body:"body").select("#"+id);svg.append("g");const tasks2=diagObj.db.getTasks(),title=diagObj.db.getCommonDb().getDiagramTitle();log.debug("task",tasks2),svgDraw_default.initGraphics(svg,id);const sections2=diagObj.db.getSections();log.debug("sections",sections2);let maxSectionHeight=0,maxTaskHeight=0,depthY=0,sectionBeginY=0,masterX=50+LEFT_MARGIN,masterY=50;sectionBeginY=50;let sectionNumber=0,hasSections=!0;sections2.forEach(function(section){const sectionNode={number:sectionNumber,descr:section,section:sectionNumber,width:150,padding:20,maxHeight:maxSectionHeight},sectionHeight=svgDraw_default.getVirtualNodeHeight(svg,sectionNode,conf);log.debug("sectionHeight before draw",sectionHeight),maxSectionHeight=Math.max(maxSectionHeight,sectionHeight+20)});let maxEventCount=0,maxEventLineLength=0;log.debug("tasks.length",tasks2.length);for(const[i,task]of tasks2.entries()){const taskNode={number:i,descr:task,section:task.section,width:150,padding:20,maxHeight:maxTaskHeight},taskHeight=svgDraw_default.getVirtualNodeHeight(svg,taskNode,conf);log.debug("taskHeight before draw",taskHeight),maxTaskHeight=Math.max(maxTaskHeight,taskHeight+20),maxEventCount=Math.max(maxEventCount,task.events.length);let maxEventLineLengthTemp=0;for(const event of task.events){const eventNode={descr:event,section:task.section,number:task.section,width:150,padding:20,maxHeight:50};maxEventLineLengthTemp+=svgDraw_default.getVirtualNodeHeight(svg,eventNode,conf)}task.events.length>0&&(maxEventLineLengthTemp+=10*(task.events.length-1)),maxEventLineLength=Math.max(maxEventLineLength,maxEventLineLengthTemp)}log.debug("maxSectionHeight before draw",maxSectionHeight),log.debug("maxTaskHeight before draw",maxTaskHeight),sections2&&sections2.length>0?sections2.forEach(section=>{const tasksForSection=tasks2.filter(task=>task.section===section),sectionNode={number:sectionNumber,descr:section,section:sectionNumber,width:200*Math.max(tasksForSection.length,1)-50,padding:20,maxHeight:maxSectionHeight};log.debug("sectionNode",sectionNode);const sectionNodeWrapper=svg.append("g"),node=svgDraw_default.drawNode(sectionNodeWrapper,sectionNode,sectionNumber,conf,id);log.debug("sectionNode output",node),sectionNodeWrapper.attr("transform",`translate(${masterX}, 50)`),masterY+=maxSectionHeight+50,tasksForSection.length>0&&drawTasks(svg,tasksForSection,sectionNumber,masterX,masterY,maxTaskHeight,conf,maxEventCount,maxEventLineLength,maxSectionHeight,!1,id),masterX+=200*Math.max(tasksForSection.length,1),masterY=50,sectionNumber++}):(hasSections=!1,drawTasks(svg,tasks2,sectionNumber,masterX,masterY,maxTaskHeight,conf,maxEventCount,maxEventLineLength,maxSectionHeight,!0,id));const box=svg.node().getBBox();log.debug("bounds",box),title&&svg.append("text").text(title).attr("x","neo"===look?2*box.x+LEFT_MARGIN:box.width/2-LEFT_MARGIN).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),depthY=hasSections?maxSectionHeight+maxTaskHeight+150:maxTaskHeight+100;if(svg.append("g").attr("class","lineWrapper").append("line").attr("x1",LEFT_MARGIN).attr("y1",depthY).attr("x2",box.width+3*LEFT_MARGIN).attr("y2",depthY).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${id}-arrowhead)`),"neo"===look&&useGradient&&"neutral"!==theme){const existingDefs=svg.select("defs"),gradient=(existingDefs.empty()?svg.append("defs"):existingDefs).append("linearGradient").attr("id",svg.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");gradient.append("stop").attr("offset","0%").attr("stop-color",gradientStart).attr("stop-opacity",1),gradient.append("stop").attr("offset","100%").attr("stop-color",gradientStop).attr("stop-opacity",1)}setupGraphViewbox(void 0,svg,(null==(_b=conf.timeline)?void 0:_b.padding)??50,(null==(_c=conf.timeline)?void 0:_c.useMaxWidth)??!1)},"draw"),drawTasks=__name(function(diagram2,tasks2,sectionColor,masterX,masterY,maxTaskHeight,conf,maxEventCount,maxEventLineLength,maxSectionHeight,isWithoutSections,diagramId){var _a;for(const task of tasks2){const taskNode={descr:task.task,section:sectionColor,number:sectionColor,width:150,padding:20,maxHeight:maxTaskHeight};log.debug("taskNode",taskNode);const taskWrapper=diagram2.append("g").attr("class","taskWrapper"),taskHeight=svgDraw_default.drawNode(taskWrapper,taskNode,sectionColor,conf,diagramId).height;if(log.debug("taskHeight after draw",taskHeight),taskWrapper.attr("transform",`translate(${masterX}, ${masterY})`),maxTaskHeight=Math.max(maxTaskHeight,taskHeight),task.events){const lineWrapper=diagram2.append("g").attr("class","lineWrapper");let lineLength=maxTaskHeight;masterY+=100,lineLength+=drawEvents(diagram2,task.events,sectionColor,masterX,masterY,conf,diagramId),masterY-=100,lineWrapper.append("line").attr("x1",masterX+95).attr("y1",masterY+maxTaskHeight).attr("x2",masterX+95).attr("y2",masterY+maxTaskHeight+100+maxEventLineLength+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${diagramId}-arrowhead)`).attr("stroke-dasharray","5,5")}masterX+=200,isWithoutSections&&!(null==(_a=conf.timeline)?void 0:_a.disableMulticolor)&&sectionColor++}masterY-=10},"drawTasks"),drawEvents=__name(function(diagram2,events,sectionColor,masterX,masterY,conf,diagramId){let maxEventHeight=0;const eventBeginY=masterY;masterY+=100;for(const event of events){const eventNode={descr:event,section:sectionColor,number:sectionColor,width:150,padding:20,maxHeight:50};log.debug("eventNode",eventNode);const eventWrapper=diagram2.append("g").attr("class","eventWrapper"),eventHeight=svgDraw_default.drawNode(eventWrapper,eventNode,sectionColor,conf,diagramId,!0).height;maxEventHeight+=eventHeight,eventWrapper.attr("transform",`translate(${masterX}, ${masterY})`),masterY=masterY+10+eventHeight}return masterY=eventBeginY,maxEventHeight},"drawEvents"),timelineRenderer_default={setConf:__name(()=>{},"setConf"),draw:draw},draw2=__name(function(text,id,version,diagObj){var _a,_b,_c,_d,_e;const conf=getConfig2(),LEFT_MARGIN=(null==(_a=conf.timeline)?void 0:_a.leftMargin)??50;log.debug("timeline",diagObj.db);const svg=selectSvgElement(id);svg.append("g");const tasks2=diagObj.db.getTasks(),title=diagObj.db.getCommonDb().getDiagramTitle();log.debug("task",tasks2),svgDraw_default.initGraphics(svg);const sections2=diagObj.db.getSections();log.debug("sections",sections2);let maxSectionHeight=0,maxTaskHeight=0;const masterX=50+LEFT_MARGIN;let masterY=50;const contentTopY=masterY,axisX=masterX+230;let sectionNumber=0;const hasSections=sections2&&sections2.length>0,timelineX=hasSections?axisX:masterX+230,sectionWidth=Math.max(50,580);sections2.forEach(function(section){const sectionNode={number:sectionNumber,descr:section,section:sectionNumber,width:sectionWidth,padding:5,maxHeight:maxSectionHeight},sectionHeight=svgDraw_default.getVirtualNodeHeight(svg,sectionNode,conf);log.debug("sectionHeight before draw",sectionHeight),maxSectionHeight=Math.max(maxSectionHeight,sectionHeight)});let maxEventStackHeight=0;log.debug("tasks.length",tasks2.length);for(const[i,task]of tasks2.entries()){const taskNode={number:i,descr:task,section:task.section,width:200,padding:5,maxHeight:maxTaskHeight},taskHeight=svgDraw_default.getVirtualNodeHeight(svg,taskNode,conf);log.debug("taskHeight before draw",taskHeight),maxTaskHeight=Math.max(maxTaskHeight,taskHeight);let maxEventStackHeightTemp=0;for(const event of task.events){const eventNode={descr:event,section:task.section,number:task.section,width:300,padding:5,maxHeight:50};maxEventStackHeightTemp+=svgDraw_default.getVirtualNodeHeight(svg,eventNode,conf)}task.events.length>0&&(maxEventStackHeightTemp+=10*(task.events.length-1)),maxEventStackHeight=Math.max(maxEventStackHeight,maxEventStackHeightTemp)+0}log.debug("maxSectionHeight before draw",maxSectionHeight),log.debug("maxTaskHeight before draw",maxTaskHeight);const taskSpacing=Math.max(maxTaskHeight,maxEventStackHeight)+30;hasSections?sections2.forEach(section=>{const tasksForSection=tasks2.filter(task=>task.section===section),sectionNode={number:sectionNumber,descr:section,section:sectionNumber,width:sectionWidth,padding:5,maxHeight:maxSectionHeight};log.debug("sectionNode",sectionNode);const sectionNodeWrapper=svg.append("g"),node=svgDraw_default.drawNode(sectionNodeWrapper,sectionNode,sectionNumber,conf);log.debug("sectionNode output",node);const sectionX=timelineX-230;sectionNodeWrapper.attr("transform",`translate(${sectionX}, ${masterY})`);const taskStartY=masterY+node.height+20;tasksForSection.length>0&&drawTasks2(svg,tasksForSection,sectionNumber,timelineX,taskStartY,maxTaskHeight,conf,taskSpacing,!1);const taskCount2=tasksForSection.length,sectionHeight=node.height+20+taskSpacing*Math.max(taskCount2,1)-(taskCount2>0?60:0);masterY+=sectionHeight,sectionNumber++}):drawTasks2(svg,tasks2,sectionNumber,timelineX,masterY,maxTaskHeight,conf,taskSpacing,!0);let box=null==(_b=svg.node())?void 0:_b.getBBox();if(!box)throw new Error("bbox not found");if(log.debug("bounds",box),title){if(svg.append("text").text(title).attr("x",box.width/2-LEFT_MARGIN).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),box=null==(_c=svg.node())?void 0:_c.getBBox(),!box)throw new Error("bbox not found");log.debug("bounds after title",box)}const[fontSize]=parseFontSize(conf.fontSize),arrowTopOffset=2*(fontSize??16),arrowBottomPadding=.5*(fontSize??16)+20,lineWrapper=svg.append("g").attr("class","lineWrapper");lineWrapper.append("line").attr("x1",timelineX).attr("y1",contentTopY-arrowTopOffset).attr("x2",timelineX).attr("y2",box.y+box.height+arrowBottomPadding).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),lineWrapper.lower(),setupGraphViewbox(void 0,svg,(null==(_d=conf.timeline)?void 0:_d.padding)??50,(null==(_e=conf.timeline)?void 0:_e.useMaxWidth)??!1)},"draw"),drawTasks2=__name(function(diagram2,tasks2,sectionColor,timelineX,masterY,maxTaskHeight,conf,taskSpacing,isWithoutSections){var _a;for(const task of tasks2){const taskNode={descr:task.task,section:sectionColor,number:sectionColor,width:200,padding:5,maxHeight:maxTaskHeight};log.debug("taskNode",taskNode);const taskWrapper=diagram2.append("g").attr("class","taskWrapper"),node=svgDraw_default.drawNode(taskWrapper,taskNode,sectionColor,conf),taskHeight=node.height;log.debug("taskHeight after draw",taskHeight);const taskX=timelineX-20-node.width;if(taskWrapper.attr("transform",`translate(${taskX}, ${masterY})`),maxTaskHeight=Math.max(maxTaskHeight,taskHeight),task.events&&task.events.length>0){const eventsStartY=masterY,eventsX=timelineX+50;drawEvents2(diagram2,task.events,sectionColor,timelineX,eventsX,eventsStartY,conf)}masterY+=taskSpacing,isWithoutSections&&!(null==(_a=conf.timeline)?void 0:_a.disableMulticolor)&&sectionColor++}},"drawTasks"),drawEvents2=__name(function(diagram2,events,sectionColor,axisX,eventsX,startY,conf){let currentY=startY;for(const event of events){const eventNode={descr:event,section:sectionColor,number:sectionColor,width:300,padding:5,maxHeight:0};log.debug("eventNode",eventNode);const eventWrapper=diagram2.append("g").attr("class","eventWrapper"),eventHeight=svgDraw_default.drawNode(eventWrapper,eventNode,sectionColor,conf).height;eventWrapper.attr("transform",`translate(${eventsX}, ${currentY})`);const lineY=currentY+eventHeight/2;diagram2.append("g").attr("class","lineWrapper").append("line").attr("x1",axisX).attr("y1",lineY).attr("x2",eventsX).attr("y2",lineY).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),currentY=currentY+eventHeight+10}return currentY-startY},"drawEvents"),timelineRendererVertical_default={setConf:__name(()=>{},"setConf"),draw:draw2},genReduxSections=__name(options=>{var _a;const{theme:theme}=getConfig(),isDarkTheme=null==theme?void 0:theme.includes("dark"),isColorTheme=null==theme?void 0:theme.includes("color"),rawSvgId=(null==(_a=options.svgId)?void 0:_a.replace(/^#/,""))??"",scopedDropShadow=rawSvgId?`url(#${rawSvgId}-drop-shadow)`:options.dropShadow??"none";let sections2="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++){const sw=""+(17-3*i),color=isColorTheme?options.borderColorArray[i]:options.mainBkg,stroke=isColorTheme?options.borderColorArray[i]:options.nodeBorder;sections2+=`\n .section-${i-1} rect,\n .section-${i-1} path,\n .section-${i-1} circle {\n fill: ${isDarkTheme&&isColorTheme?options.mainBkg:color};\n stroke: ${stroke};\n stroke-width: ${options.strokeWidth};\n filter: ${scopedDropShadow};\n }\n\n .section-${i-1} text {\n fill: ${options.nodeBorder};\n font-weight: ${options.fontWeight}\n }\n\n .node-icon-${i-1} {\n font-size: 40px;\n color: ${options["cScaleLabel"+i]};\n }\n\n .section-edge-${i-1} {\n stroke: ${options["cScale"+i]};\n }\n\n .edge-depth-${i-1} {\n stroke-width: ${sw};\n }\n\n .section-${i-1} line {\n stroke: ${options["cScaleInv"+i]};\n stroke-width: 3;\n }\n\n .lineWrapper line {\n stroke: ${options.nodeBorder};\n stroke-width:${options.strokeWidth}\n }\n\n .disabled,\n .disabled circle,\n .disabled text {\n fill: ${options.tertiaryColor??"lightgray"};\n }\n\n .disabled text {\n fill: ${options.clusterBorder??"#efefef"};\n }\n `}return sections2},"genReduxSections"),genSections=__name(options=>{let sections2="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)options["lineColor"+i]=options["lineColor"+i]||options["cScaleInv"+i],isDark(options["lineColor"+i])?options["lineColor"+i]=lighten(options["lineColor"+i],20):options["lineColor"+i]=darken(options["lineColor"+i],20);for(let i=0;i<options.THEME_COLOR_LIMIT;i++){const sw=""+(17-3*i);sections2+=`\n .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} path {\n fill: ${options["cScale"+i]};\n }\n .section-${i-1} text {\n fill: ${options["cScaleLabel"+i]};\n }\n .node-icon-${i-1} {\n font-size: 40px;\n color: ${options["cScaleLabel"+i]};\n }\n .section-edge-${i-1}{\n stroke: ${options["cScale"+i]};\n }\n .edge-depth-${i-1}{\n stroke-width: ${sw};\n }\n .section-${i-1} line {\n stroke: ${options["cScaleInv"+i]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${options["cScaleLabel"+i]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: ${options.tertiaryColor??"lightgray"};\n }\n .disabled text {\n fill: ${options.clusterBorder??"#efefef"};\n }\n `}return sections2},"genSections"),styles_default=__name(options=>{var _a;const{theme:theme}=getConfig(),isReduxTheme=null==theme?void 0:theme.includes("redux"),isNeutralTheme="neutral"===theme,rawSvgId=(null==(_a=options.svgId)?void 0:_a.replace(/^#/,""))??"";let gradientSections="";if(options.useGradient&&rawSvgId&&options.THEME_COLOR_LIMIT&&!isNeutralTheme)for(let i=0;i<options.THEME_COLOR_LIMIT;i++)gradientSections+=`\n .section-${i-1}[data-look="neo"] rect,\n .section-${i-1}[data-look="neo"] path,\n .section-${i-1}[data-look="neo"] circle {\n fill: ${options.mainBkg};\n stroke: url(#${rawSvgId}-gradient);\n stroke-width: 2;\n }\n .section-${i-1}[data-look="neo"] line {\n stroke: url(#${rawSvgId}-gradient);\n stroke-width: 2;\n }`;return`\n .edge {\n stroke-width: 3;\n }\n ${isReduxTheme?genReduxSections(options):genSections(options)}\n ${gradientSections}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${options.git0};\n }\n .section-root text {\n fill: ${options.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`},"getStyles"),diagram={db:timelineDb_exports,renderer:{setConf:__name(()=>{},"setConf"),draw:__name((text,id,version,diagObj)=>{var _a,_b;return"TD"===((null==(_b=null==(_a=null==diagObj?void 0:diagObj.db)?void 0:_a.getDirection)?void 0:_b.call(_a))??"LR")?timelineRendererVertical_default.draw(text,id,version,diagObj):timelineRenderer_default.draw(text,id,version,diagObj)},"draw")},parser:timeline_default,styles:styles_default};export{diagram};
1
+ import{_ as __name,C as getConfig,U as isDark,V as lighten,W as darken,c as getConfig2,l as log,H as selectSvgElement,M as parseFontSize,X as setupGraphViewbox,d as select,B as __export,Y as commonDb_exports,y as clear}from"./mermaid.core-ChPdLHKc.js";import{d as d3arc}from"./arc-Bt4H5eKY.js";import"./vendor-mdxeditor-Dp19LkWF.js";import"./vendor-antd-BS2aqEyQ.js";import"./vendor-codemirror-DpOKy7e3.js";import"./vendor-markdown-Bpu4AByL.js";var parser=function(){var o=__name(function(k,v,o2,l){for(o2=o2||{},l=k.length;l--;o2[k[l]]=v);return o2},"o"),$V0=[6,11,13,14,15,17,19,20,23,24],$V1=[1,12],$V2=[1,13],$V3=[1,14],$V4=[1,15],$V5=[1,16],$V6=[1,19],$V7=[1,20],parser2={trace:__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:__name(function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return $$[$0-1];case 3:yy.setDirection("LR");break;case 4:yy.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:$$[$0-1].push($$[$0]),this.$=$$[$0-1];break;case 7:case 8:this.$=$$[$0];break;case 11:yy.getCommonDb().setDiagramTitle($$[$0].substr(6)),this.$=$$[$0].substr(6);break;case 12:this.$=$$[$0].trim(),yy.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=$$[$0].trim(),yy.getCommonDb().setAccDescription(this.$);break;case 15:yy.addSection($$[$0].substr(8)),this.$=$$[$0].substr(8);break;case 18:yy.addTask($$[$0],0,""),this.$=$$[$0];break;case 19:yy.addEvent($$[$0].substr(2)),this.$=$$[$0]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},o($V0,[2,5],{5:6}),o($V0,[2,2]),o($V0,[2,3]),o($V0,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:$V1,15:$V2,17:$V3,19:$V4,20:$V5,21:17,22:18,23:$V6,24:$V7},o($V0,[2,10],{1:[2,1]}),o($V0,[2,6]),{12:21,14:$V1,15:$V2,17:$V3,19:$V4,20:$V5,21:17,22:18,23:$V6,24:$V7},o($V0,[2,8]),o($V0,[2,9]),o($V0,[2,11]),{16:[1,22]},{18:[1,23]},o($V0,[2,14]),o($V0,[2,15]),o($V0,[2,16]),o($V0,[2,17]),o($V0,[2,18]),o($V0,[2,19]),o($V0,[2,7]),o($V0,[2,12]),o($V0,[2,13])],defaultActions:{},parseError:__name(function(str,hash){if(!hash.recoverable){var error=new Error(str);throw error.hash=hash,error}this.trace(str)},"parseError"),parse:__name(function(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,args=lstack.slice.call(arguments,1),lexer2=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer2.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer2,sharedState.yy.parser=this,void 0===lexer2.yylloc&&(lexer2.yylloc={});var yyloc=lexer2.yylloc;lstack.push(yyloc);var ranges=lexer2.options&&lexer2.options.ranges;function lex(){var token;return"number"!=typeof(token=tstack.pop()||lexer2.lex()||1)&&(token instanceof Array&&(token=(tstack=token).pop()),token=self.symbols_[token]||token),token}"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,__name(function(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n},"popStack"),__name(lex,"lex");for(var symbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer2.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer2.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer2.match,token:this.terminals_[symbol]||symbol,line:lexer2.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer2.yytext),lstack.push(lexer2.yylloc),stack.push(action[1]),symbol=null,yyleng=lexer2.yyleng,yytext=lexer2.yytext,yylineno=lexer2.yylineno,yyloc=lexer2.yylloc;break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args))))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0},"parse")},lexer=function(){return{EOF:1,parseError:__name(function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},"parseError"),setInput:__name(function(input,yy){return this.yy=yy||this.yy||{},this._input=input,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:__name(function(){var ch=this._input[0];return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.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),ch},"input"),unput:__name(function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=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),lines.length-1&&(this.yylineno-=lines.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},"unput"),more:__name(function(){return this._more=!0,this},"more"),reject:__name(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:__name(function(n){this.unput(this.match.slice(n))},"less"),pastInput:__name(function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:__name(function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:__name(function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},"showPosition"),test_match:__name(function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={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&&(backup.yylloc.range=this.yylloc.range.slice(0))),(lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,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(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},"test_match"),next:__name(function(){if(this.done)return this.EOF;var token,match,tempMatch,index;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length;i++)if((tempMatch=this._input.match(this.rules[rules[i]]))&&(!match||tempMatch[0].length>match[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(!1!==(token=this.test_match(tempMatch,rules[i])))return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?!1!==(token=this.test_match(match,rules[index]))&&token:""===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:__name(function(){var r=this.next();return r||this.lex()},"lex"),begin:__name(function(condition){this.conditionStack.push(condition)},"begin"),popState:__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:__name(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:__name(function(n){return(n=this.conditionStack.length-1-Math.abs(n||0))>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:__name(function(condition){this.begin(condition)},"pushState"),stateStackSize:__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:__name(function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}}();function Parser(){this.yy={}}return parser2.lexer=lexer,__name(Parser,"Parser"),Parser.prototype=parser2,parser2.Parser=Parser,new Parser}();parser.parser=parser;var timeline_default=parser,timelineDb_exports={};__export(timelineDb_exports,{addEvent:()=>addEvent,addSection:()=>addSection,addTask:()=>addTask,addTaskOrg:()=>addTaskOrg,clear:()=>clear2,default:()=>timelineDb_default,getCommonDb:()=>getCommonDb,getDirection:()=>getDirection,getSections:()=>getSections,getTasks:()=>getTasks,setDirection:()=>setDirection});var currentSection="",currentTaskId=0,direction="LR",sections=[],tasks=[],rawTasks=[],getCommonDb=__name(()=>commonDb_exports,"getCommonDb"),clear2=__name(function(){sections.length=0,tasks.length=0,currentSection="",rawTasks.length=0,direction="LR",clear()},"clear"),setDirection=__name(function(dir){direction=dir},"setDirection"),getDirection=__name(function(){return direction},"getDirection"),addSection=__name(function(txt){currentSection=txt,sections.push(txt)},"addSection"),getSections=__name(function(){return sections},"getSections"),getTasks=__name(function(){let allItemsProcessed=compileTasks();let iterationCount=0;for(;!allItemsProcessed&&iterationCount<100;)allItemsProcessed=compileTasks(),iterationCount++;return tasks.push(...rawTasks),tasks},"getTasks"),addTask=__name(function(period,length,event){const rawTask={id:currentTaskId++,section:currentSection,type:currentSection,task:period,score:length||0,events:event?[event]:[]};rawTasks.push(rawTask)},"addTask"),addEvent=__name(function(event){rawTasks.find(task=>task.id===currentTaskId-1).events.push(event)},"addEvent"),addTaskOrg=__name(function(descr){const newTask={section:currentSection,type:currentSection,description:descr,task:descr,classes:[]};tasks.push(newTask)},"addTaskOrg"),compileTasks=__name(function(){const compileTask=__name(function(pos){return rawTasks[pos].processed},"compileTask");let allProcessed=!0;for(const[i,rawTask]of rawTasks.entries())compileTask(i),allProcessed=allProcessed&&rawTask.processed;return allProcessed},"compileTasks"),timelineDb_default={clear:clear2,getCommonDb:getCommonDb,getDirection:getDirection,setDirection:setDirection,addSection:addSection,getSections:getSections,getTasks:getTasks,addTask:addTask,addTaskOrg:addTaskOrg,addEvent:addEvent},nodeCount=0,drawRect=__name(function(elem,rectData){const rectElem=elem.append("rect");return rectElem.attr("x",rectData.x),rectElem.attr("y",rectData.y),rectElem.attr("fill",rectData.fill),rectElem.attr("stroke",rectData.stroke),rectElem.attr("width",rectData.width),rectElem.attr("height",rectData.height),rectElem.attr("rx",rectData.rx),rectElem.attr("ry",rectData.ry),void 0!==rectData.class&&rectElem.attr("class",rectData.class),rectElem},"drawRect"),drawFace=__name(function(element,faceData){const circleElement=element.append("circle").attr("cx",faceData.cx).attr("cy",faceData.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),face=element.append("g");function smile(face2){const arc=d3arc().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);face2.append("path").attr("class","mouth").attr("d",arc).attr("transform","translate("+faceData.cx+","+(faceData.cy+2)+")")}function sad(face2){const arc=d3arc().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);face2.append("path").attr("class","mouth").attr("d",arc).attr("transform","translate("+faceData.cx+","+(faceData.cy+7)+")")}function ambivalent(face2){face2.append("line").attr("class","mouth").attr("stroke",2).attr("x1",faceData.cx-5).attr("y1",faceData.cy+7).attr("x2",faceData.cx+5).attr("y2",faceData.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return face.append("circle").attr("cx",faceData.cx-5).attr("cy",faceData.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),face.append("circle").attr("cx",faceData.cx+5).attr("cy",faceData.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),__name(smile,"smile"),__name(sad,"sad"),__name(ambivalent,"ambivalent"),faceData.score>3?smile(face):faceData.score<3?sad(face):ambivalent(face),circleElement},"drawFace"),drawCircle=__name(function(element,circleData){const circleElement=element.append("circle");return circleElement.attr("cx",circleData.cx),circleElement.attr("cy",circleData.cy),circleElement.attr("class","actor-"+circleData.pos),circleElement.attr("fill",circleData.fill),circleElement.attr("stroke",circleData.stroke),circleElement.attr("r",circleData.r),void 0!==circleElement.class&&circleElement.attr("class",circleElement.class),void 0!==circleData.title&&circleElement.append("title").text(circleData.title),circleElement},"drawCircle"),drawText=__name(function(elem,textData){const nText=textData.text.replace(/<br\s*\/?>/gi," "),textElem=elem.append("text");textElem.attr("x",textData.x),textElem.attr("y",textData.y),textElem.attr("class","legend"),textElem.style("text-anchor",textData.anchor),void 0!==textData.class&&textElem.attr("class",textData.class);const span=textElem.append("tspan");return span.attr("x",textData.x+2*textData.textMargin),span.text(nText),textElem},"drawText"),drawLabel=__name(function(elem,txtObject){function genPoints(x,y,width,height,cut){return x+","+y+" "+(x+width)+","+y+" "+(x+width)+","+(y+height-cut)+" "+(x+width-1.2*cut)+","+(y+height)+" "+x+","+(y+height)}__name(genPoints,"genPoints");const polygon=elem.append("polygon");polygon.attr("points",genPoints(txtObject.x,txtObject.y,50,20,7)),polygon.attr("class","labelBox"),txtObject.y=txtObject.y+txtObject.labelMargin,txtObject.x=txtObject.x+.5*txtObject.labelMargin,drawText(elem,txtObject)},"drawLabel"),drawSection=__name(function(elem,section,conf){const g=elem.append("g"),rect=getNoteRect();rect.x=section.x,rect.y=section.y,rect.fill=section.fill,rect.width=conf.width,rect.height=conf.height,rect.class="journey-section section-type-"+section.num,rect.rx=3,rect.ry=3,drawRect(g,rect),_drawTextCandidateFunc(conf)(section.text,g,rect.x,rect.y,rect.width,rect.height,{class:"journey-section section-type-"+section.num},conf,section.colour)},"drawSection"),taskCount=-1,drawTask=__name(function(elem,task,conf,diagramId){const center=task.x+conf.width/2,g=elem.append("g");taskCount++;g.append("line").attr("id",diagramId+"-task"+taskCount).attr("x1",center).attr("y1",task.y).attr("x2",center).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),drawFace(g,{cx:center,cy:300+30*(5-task.score),score:task.score});const rect=getNoteRect();rect.x=task.x,rect.y=task.y,rect.fill=task.fill,rect.width=conf.width,rect.height=conf.height,rect.class="task task-type-"+task.num,rect.rx=3,rect.ry=3,drawRect(g,rect),_drawTextCandidateFunc(conf)(task.task,g,rect.x,rect.y,rect.width,rect.height,{class:"task"},conf,task.colour)},"drawTask"),drawBackgroundRect=__name(function(elem,bounds){drawRect(elem,{x:bounds.startx,y:bounds.starty,width:bounds.stopx-bounds.startx,height:bounds.stopy-bounds.starty,fill:bounds.fill,class:"rect"}).lower()},"drawBackgroundRect"),getTextObj=__name(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),getNoteRect=__name(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),_drawTextCandidateFunc=function(){function byText(content,g,x,y,width,height,textAttrs,colour){_setTextAttrs(g.append("text").attr("x",x+width/2).attr("y",y+height/2+5).style("font-color",colour).style("text-anchor","middle").text(content),textAttrs)}function byTspan(content,g,x,y,width,height,textAttrs,conf,colour){const{taskFontSize:taskFontSize,taskFontFamily:taskFontFamily}=conf,lines=content.split(/<br\s*\/?>/gi);for(let i=0;i<lines.length;i++){const dy=i*taskFontSize-taskFontSize*(lines.length-1)/2,text=g.append("text").attr("x",x+width/2).attr("y",y).attr("fill",colour).style("text-anchor","middle").style("font-size",taskFontSize).style("font-family",taskFontFamily);text.append("tspan").attr("x",x+width/2).attr("dy",dy).text(lines[i]),text.attr("y",y+height/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),_setTextAttrs(text,textAttrs)}}function byFo(content,g,x,y,width,height,textAttrs,conf){const body=g.append("switch"),text=body.append("foreignObject").attr("x",x).attr("y",y).attr("width",width).attr("height",height).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");text.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(content),byTspan(content,body,x,y,width,height,textAttrs,conf),_setTextAttrs(text,textAttrs)}function _setTextAttrs(toText,fromTextAttrsDict){for(const key in fromTextAttrsDict)key in fromTextAttrsDict&&toText.attr(key,fromTextAttrsDict[key])}return __name(byText,"byText"),__name(byTspan,"byTspan"),__name(byFo,"byFo"),__name(_setTextAttrs,"_setTextAttrs"),function(conf){return"fo"===conf.textPlacement?byFo:"old"===conf.textPlacement?byText:byTspan}}(),initGraphics=__name(function(graphics,id){nodeCount=0,taskCount=-1,graphics.append("defs").append("marker").attr("id",id+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function wrap(text,width){text.each(function(){var word,text2=select(this),words=text2.text().split(/(\s+|<br>)/).reverse(),line=[],y=text2.attr("y"),dy=parseFloat(text2.attr("dy")),tspan=text2.text(null).append("tspan").attr("x",0).attr("y",y).attr("dy",dy+"em");for(let j=0;j<words.length;j++)word=words[words.length-1-j],line.push(word),tspan.text(line.join(" ").trim()),(tspan.node().getComputedTextLength()>width||"<br>"===word)&&(line.pop(),tspan.text(line.join(" ").trim()),line="<br>"===word?[""]:[word],tspan=text2.append("tspan").attr("x",0).attr("y",y).attr("dy","1.1em").text(word))})}__name(wrap,"wrap");var drawNode=__name(function(elem,node,fullSection,conf,diagramId,isEvent=!1){var _a,_b,_c;const{theme:theme,look:look}=conf,isReduxTheme=null==theme?void 0:theme.includes("redux"),section=fullSection%((null==(_a=null==conf?void 0:conf.themeVariables)?void 0:_a.THEME_COLOR_LIMIT)??12)-1,nodeElem=elem.append("g");node.section=section,nodeElem.attr("class",(node.class?node.class+" ":"")+"timeline-node section-"+section);const bkgElem=nodeElem.append("g"),textElem=nodeElem.append("g"),bbox=textElem.append("text").text(node.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(wrap,node.width).node().getBBox(),fontSize=(null==(_b=conf.fontSize)?void 0:_b.replace)?conf.fontSize.replace("px",""):conf.fontSize;if(node.height=bbox.height+1.1*fontSize*.5+node.padding,node.height=Math.max(node.height,node.maxHeight),node.width=node.width+2*node.padding,textElem.attr("transform","translate("+node.width/2+", "+node.padding/2+")"),isReduxTheme&&textElem.attr("transform",`translate(${node.width/2}, ${isEvent?node.padding/2+3:node.padding})`),defaultBkg(bkgElem,node,section,diagramId,conf),"neo"===look&&(nodeElem.attr("data-look","neo"),isReduxTheme)){const isDark2=theme.includes("dark"),rootSvgNode=(null==(_c=elem.node())?void 0:_c.ownerSVGElement)??elem.node(),rootSvg=select(rootSvgNode),svgId=rootSvg.attr("id")??"",dropShadowId=svgId?`${svgId}-drop-shadow`:"drop-shadow";if(rootSvg.select(`#${dropShadowId}`).empty()){const existingDefs=rootSvg.select("defs");(existingDefs.empty()?rootSvg.append("defs"):existingDefs).append("filter").attr("id",dropShadowId).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",isDark2?"0.2":"0.06").attr("flood-color",isDark2?"#FFFFFF":"#000000")}}return node},"drawNode"),getVirtualNodeHeight=__name(function(elem,node,conf){var _a;const textElem=elem.append("g"),bbox=textElem.append("text").text(node.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(wrap,node.width).node().getBBox(),fontSize=(null==(_a=conf.fontSize)?void 0:_a.replace)?conf.fontSize.replace("px",""):conf.fontSize;return textElem.remove(),bbox.height+1.1*fontSize*.5+node.padding},"getVirtualNodeHeight"),defaultBkg=__name(function(elem,node,section,diagramId,config){const{theme:theme}=config,r=(null==theme?void 0:theme.includes("redux"))?0:5,d=r>0?`M0 ${node.height-5} v${10-node.height} q0,-${r},${r},-${r} h${node.width-10} q${r},0,${r},${r} v${node.height-5} H0 Z`:`M0 ${node.height-5} v${-(node.height-5)} h${node.width} v${node.height} H0 Z`;elem.append("path").attr("id",diagramId+"-node-"+nodeCount++).attr("class","node-bkg node-"+node.type).attr("d",d),(null==theme?void 0:theme.includes("redux"))||elem.append("line").attr("class","node-line-"+section).attr("x1",0).attr("y1",node.height).attr("x2",node.width).attr("y2",node.height)},"defaultBkg"),svgDraw_default={drawRect:drawRect,drawCircle:drawCircle,drawSection:drawSection,drawText:drawText,drawLabel:drawLabel,drawTask:drawTask,drawBackgroundRect:drawBackgroundRect,getTextObj:getTextObj,getNoteRect:getNoteRect,initGraphics:initGraphics,drawNode:drawNode,getVirtualNodeHeight:getVirtualNodeHeight},draw=__name(function(text,id,version,diagObj){var _a,_b,_c;const conf=getConfig2(),{look:look,theme:theme,themeVariables:themeVariables}=conf,{useGradient:useGradient,gradientStart:gradientStart,gradientStop:gradientStop}=themeVariables,LEFT_MARGIN=(null==(_a=conf.timeline)?void 0:_a.leftMargin)??50;log.debug("timeline",diagObj.db);const securityLevel=conf.securityLevel;let sandboxElement;"sandbox"===securityLevel&&(sandboxElement=select("#i"+id));const svg=select("sandbox"===securityLevel?sandboxElement.nodes()[0].contentDocument.body:"body").select("#"+id);svg.append("g");const tasks2=diagObj.db.getTasks(),title=diagObj.db.getCommonDb().getDiagramTitle();log.debug("task",tasks2),svgDraw_default.initGraphics(svg,id);const sections2=diagObj.db.getSections();log.debug("sections",sections2);let maxSectionHeight=0,maxTaskHeight=0,depthY=0,sectionBeginY=0,masterX=50+LEFT_MARGIN,masterY=50;sectionBeginY=50;let sectionNumber=0,hasSections=!0;sections2.forEach(function(section){const sectionNode={number:sectionNumber,descr:section,section:sectionNumber,width:150,padding:20,maxHeight:maxSectionHeight},sectionHeight=svgDraw_default.getVirtualNodeHeight(svg,sectionNode,conf);log.debug("sectionHeight before draw",sectionHeight),maxSectionHeight=Math.max(maxSectionHeight,sectionHeight+20)});let maxEventCount=0,maxEventLineLength=0;log.debug("tasks.length",tasks2.length);for(const[i,task]of tasks2.entries()){const taskNode={number:i,descr:task,section:task.section,width:150,padding:20,maxHeight:maxTaskHeight},taskHeight=svgDraw_default.getVirtualNodeHeight(svg,taskNode,conf);log.debug("taskHeight before draw",taskHeight),maxTaskHeight=Math.max(maxTaskHeight,taskHeight+20),maxEventCount=Math.max(maxEventCount,task.events.length);let maxEventLineLengthTemp=0;for(const event of task.events){const eventNode={descr:event,section:task.section,number:task.section,width:150,padding:20,maxHeight:50};maxEventLineLengthTemp+=svgDraw_default.getVirtualNodeHeight(svg,eventNode,conf)}task.events.length>0&&(maxEventLineLengthTemp+=10*(task.events.length-1)),maxEventLineLength=Math.max(maxEventLineLength,maxEventLineLengthTemp)}log.debug("maxSectionHeight before draw",maxSectionHeight),log.debug("maxTaskHeight before draw",maxTaskHeight),sections2&&sections2.length>0?sections2.forEach(section=>{const tasksForSection=tasks2.filter(task=>task.section===section),sectionNode={number:sectionNumber,descr:section,section:sectionNumber,width:200*Math.max(tasksForSection.length,1)-50,padding:20,maxHeight:maxSectionHeight};log.debug("sectionNode",sectionNode);const sectionNodeWrapper=svg.append("g"),node=svgDraw_default.drawNode(sectionNodeWrapper,sectionNode,sectionNumber,conf,id);log.debug("sectionNode output",node),sectionNodeWrapper.attr("transform",`translate(${masterX}, 50)`),masterY+=maxSectionHeight+50,tasksForSection.length>0&&drawTasks(svg,tasksForSection,sectionNumber,masterX,masterY,maxTaskHeight,conf,maxEventCount,maxEventLineLength,maxSectionHeight,!1,id),masterX+=200*Math.max(tasksForSection.length,1),masterY=50,sectionNumber++}):(hasSections=!1,drawTasks(svg,tasks2,sectionNumber,masterX,masterY,maxTaskHeight,conf,maxEventCount,maxEventLineLength,maxSectionHeight,!0,id));const box=svg.node().getBBox();log.debug("bounds",box),title&&svg.append("text").text(title).attr("x","neo"===look?2*box.x+LEFT_MARGIN:box.width/2-LEFT_MARGIN).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),depthY=hasSections?maxSectionHeight+maxTaskHeight+150:maxTaskHeight+100;if(svg.append("g").attr("class","lineWrapper").append("line").attr("x1",LEFT_MARGIN).attr("y1",depthY).attr("x2",box.width+3*LEFT_MARGIN).attr("y2",depthY).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${id}-arrowhead)`),"neo"===look&&useGradient&&"neutral"!==theme){const existingDefs=svg.select("defs"),gradient=(existingDefs.empty()?svg.append("defs"):existingDefs).append("linearGradient").attr("id",svg.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");gradient.append("stop").attr("offset","0%").attr("stop-color",gradientStart).attr("stop-opacity",1),gradient.append("stop").attr("offset","100%").attr("stop-color",gradientStop).attr("stop-opacity",1)}setupGraphViewbox(void 0,svg,(null==(_b=conf.timeline)?void 0:_b.padding)??50,(null==(_c=conf.timeline)?void 0:_c.useMaxWidth)??!1)},"draw"),drawTasks=__name(function(diagram2,tasks2,sectionColor,masterX,masterY,maxTaskHeight,conf,maxEventCount,maxEventLineLength,maxSectionHeight,isWithoutSections,diagramId){var _a;for(const task of tasks2){const taskNode={descr:task.task,section:sectionColor,number:sectionColor,width:150,padding:20,maxHeight:maxTaskHeight};log.debug("taskNode",taskNode);const taskWrapper=diagram2.append("g").attr("class","taskWrapper"),taskHeight=svgDraw_default.drawNode(taskWrapper,taskNode,sectionColor,conf,diagramId).height;if(log.debug("taskHeight after draw",taskHeight),taskWrapper.attr("transform",`translate(${masterX}, ${masterY})`),maxTaskHeight=Math.max(maxTaskHeight,taskHeight),task.events){const lineWrapper=diagram2.append("g").attr("class","lineWrapper");let lineLength=maxTaskHeight;masterY+=100,lineLength+=drawEvents(diagram2,task.events,sectionColor,masterX,masterY,conf,diagramId),masterY-=100,lineWrapper.append("line").attr("x1",masterX+95).attr("y1",masterY+maxTaskHeight).attr("x2",masterX+95).attr("y2",masterY+maxTaskHeight+100+maxEventLineLength+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${diagramId}-arrowhead)`).attr("stroke-dasharray","5,5")}masterX+=200,isWithoutSections&&!(null==(_a=conf.timeline)?void 0:_a.disableMulticolor)&&sectionColor++}masterY-=10},"drawTasks"),drawEvents=__name(function(diagram2,events,sectionColor,masterX,masterY,conf,diagramId){let maxEventHeight=0;const eventBeginY=masterY;masterY+=100;for(const event of events){const eventNode={descr:event,section:sectionColor,number:sectionColor,width:150,padding:20,maxHeight:50};log.debug("eventNode",eventNode);const eventWrapper=diagram2.append("g").attr("class","eventWrapper"),eventHeight=svgDraw_default.drawNode(eventWrapper,eventNode,sectionColor,conf,diagramId,!0).height;maxEventHeight+=eventHeight,eventWrapper.attr("transform",`translate(${masterX}, ${masterY})`),masterY=masterY+10+eventHeight}return masterY=eventBeginY,maxEventHeight},"drawEvents"),timelineRenderer_default={setConf:__name(()=>{},"setConf"),draw:draw},draw2=__name(function(text,id,version,diagObj){var _a,_b,_c,_d,_e;const conf=getConfig2(),LEFT_MARGIN=(null==(_a=conf.timeline)?void 0:_a.leftMargin)??50;log.debug("timeline",diagObj.db);const svg=selectSvgElement(id);svg.append("g");const tasks2=diagObj.db.getTasks(),title=diagObj.db.getCommonDb().getDiagramTitle();log.debug("task",tasks2),svgDraw_default.initGraphics(svg);const sections2=diagObj.db.getSections();log.debug("sections",sections2);let maxSectionHeight=0,maxTaskHeight=0;const masterX=50+LEFT_MARGIN;let masterY=50;const contentTopY=masterY,axisX=masterX+230;let sectionNumber=0;const hasSections=sections2&&sections2.length>0,timelineX=hasSections?axisX:masterX+230,sectionWidth=Math.max(50,580);sections2.forEach(function(section){const sectionNode={number:sectionNumber,descr:section,section:sectionNumber,width:sectionWidth,padding:5,maxHeight:maxSectionHeight},sectionHeight=svgDraw_default.getVirtualNodeHeight(svg,sectionNode,conf);log.debug("sectionHeight before draw",sectionHeight),maxSectionHeight=Math.max(maxSectionHeight,sectionHeight)});let maxEventStackHeight=0;log.debug("tasks.length",tasks2.length);for(const[i,task]of tasks2.entries()){const taskNode={number:i,descr:task,section:task.section,width:200,padding:5,maxHeight:maxTaskHeight},taskHeight=svgDraw_default.getVirtualNodeHeight(svg,taskNode,conf);log.debug("taskHeight before draw",taskHeight),maxTaskHeight=Math.max(maxTaskHeight,taskHeight);let maxEventStackHeightTemp=0;for(const event of task.events){const eventNode={descr:event,section:task.section,number:task.section,width:300,padding:5,maxHeight:50};maxEventStackHeightTemp+=svgDraw_default.getVirtualNodeHeight(svg,eventNode,conf)}task.events.length>0&&(maxEventStackHeightTemp+=10*(task.events.length-1)),maxEventStackHeight=Math.max(maxEventStackHeight,maxEventStackHeightTemp)+0}log.debug("maxSectionHeight before draw",maxSectionHeight),log.debug("maxTaskHeight before draw",maxTaskHeight);const taskSpacing=Math.max(maxTaskHeight,maxEventStackHeight)+30;hasSections?sections2.forEach(section=>{const tasksForSection=tasks2.filter(task=>task.section===section),sectionNode={number:sectionNumber,descr:section,section:sectionNumber,width:sectionWidth,padding:5,maxHeight:maxSectionHeight};log.debug("sectionNode",sectionNode);const sectionNodeWrapper=svg.append("g"),node=svgDraw_default.drawNode(sectionNodeWrapper,sectionNode,sectionNumber,conf);log.debug("sectionNode output",node);const sectionX=timelineX-230;sectionNodeWrapper.attr("transform",`translate(${sectionX}, ${masterY})`);const taskStartY=masterY+node.height+20;tasksForSection.length>0&&drawTasks2(svg,tasksForSection,sectionNumber,timelineX,taskStartY,maxTaskHeight,conf,taskSpacing,!1);const taskCount2=tasksForSection.length,sectionHeight=node.height+20+taskSpacing*Math.max(taskCount2,1)-(taskCount2>0?60:0);masterY+=sectionHeight,sectionNumber++}):drawTasks2(svg,tasks2,sectionNumber,timelineX,masterY,maxTaskHeight,conf,taskSpacing,!0);let box=null==(_b=svg.node())?void 0:_b.getBBox();if(!box)throw new Error("bbox not found");if(log.debug("bounds",box),title){if(svg.append("text").text(title).attr("x",box.width/2-LEFT_MARGIN).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),box=null==(_c=svg.node())?void 0:_c.getBBox(),!box)throw new Error("bbox not found");log.debug("bounds after title",box)}const[fontSize]=parseFontSize(conf.fontSize),arrowTopOffset=2*(fontSize??16),arrowBottomPadding=.5*(fontSize??16)+20,lineWrapper=svg.append("g").attr("class","lineWrapper");lineWrapper.append("line").attr("x1",timelineX).attr("y1",contentTopY-arrowTopOffset).attr("x2",timelineX).attr("y2",box.y+box.height+arrowBottomPadding).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),lineWrapper.lower(),setupGraphViewbox(void 0,svg,(null==(_d=conf.timeline)?void 0:_d.padding)??50,(null==(_e=conf.timeline)?void 0:_e.useMaxWidth)??!1)},"draw"),drawTasks2=__name(function(diagram2,tasks2,sectionColor,timelineX,masterY,maxTaskHeight,conf,taskSpacing,isWithoutSections){var _a;for(const task of tasks2){const taskNode={descr:task.task,section:sectionColor,number:sectionColor,width:200,padding:5,maxHeight:maxTaskHeight};log.debug("taskNode",taskNode);const taskWrapper=diagram2.append("g").attr("class","taskWrapper"),node=svgDraw_default.drawNode(taskWrapper,taskNode,sectionColor,conf),taskHeight=node.height;log.debug("taskHeight after draw",taskHeight);const taskX=timelineX-20-node.width;if(taskWrapper.attr("transform",`translate(${taskX}, ${masterY})`),maxTaskHeight=Math.max(maxTaskHeight,taskHeight),task.events&&task.events.length>0){const eventsStartY=masterY,eventsX=timelineX+50;drawEvents2(diagram2,task.events,sectionColor,timelineX,eventsX,eventsStartY,conf)}masterY+=taskSpacing,isWithoutSections&&!(null==(_a=conf.timeline)?void 0:_a.disableMulticolor)&&sectionColor++}},"drawTasks"),drawEvents2=__name(function(diagram2,events,sectionColor,axisX,eventsX,startY,conf){let currentY=startY;for(const event of events){const eventNode={descr:event,section:sectionColor,number:sectionColor,width:300,padding:5,maxHeight:0};log.debug("eventNode",eventNode);const eventWrapper=diagram2.append("g").attr("class","eventWrapper"),eventHeight=svgDraw_default.drawNode(eventWrapper,eventNode,sectionColor,conf).height;eventWrapper.attr("transform",`translate(${eventsX}, ${currentY})`);const lineY=currentY+eventHeight/2;diagram2.append("g").attr("class","lineWrapper").append("line").attr("x1",axisX).attr("y1",lineY).attr("x2",eventsX).attr("y2",lineY).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),currentY=currentY+eventHeight+10}return currentY-startY},"drawEvents"),timelineRendererVertical_default={setConf:__name(()=>{},"setConf"),draw:draw2},genReduxSections=__name(options=>{var _a;const{theme:theme}=getConfig(),isDarkTheme=null==theme?void 0:theme.includes("dark"),isColorTheme=null==theme?void 0:theme.includes("color"),rawSvgId=(null==(_a=options.svgId)?void 0:_a.replace(/^#/,""))??"",scopedDropShadow=rawSvgId?`url(#${rawSvgId}-drop-shadow)`:options.dropShadow??"none";let sections2="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++){const sw=""+(17-3*i),color=isColorTheme?options.borderColorArray[i]:options.mainBkg,stroke=isColorTheme?options.borderColorArray[i]:options.nodeBorder;sections2+=`\n .section-${i-1} rect,\n .section-${i-1} path,\n .section-${i-1} circle {\n fill: ${isDarkTheme&&isColorTheme?options.mainBkg:color};\n stroke: ${stroke};\n stroke-width: ${options.strokeWidth};\n filter: ${scopedDropShadow};\n }\n\n .section-${i-1} text {\n fill: ${options.nodeBorder};\n font-weight: ${options.fontWeight}\n }\n\n .node-icon-${i-1} {\n font-size: 40px;\n color: ${options["cScaleLabel"+i]};\n }\n\n .section-edge-${i-1} {\n stroke: ${options["cScale"+i]};\n }\n\n .edge-depth-${i-1} {\n stroke-width: ${sw};\n }\n\n .section-${i-1} line {\n stroke: ${options["cScaleInv"+i]};\n stroke-width: 3;\n }\n\n .lineWrapper line {\n stroke: ${options.nodeBorder};\n stroke-width:${options.strokeWidth}\n }\n\n .disabled,\n .disabled circle,\n .disabled text {\n fill: ${options.tertiaryColor??"lightgray"};\n }\n\n .disabled text {\n fill: ${options.clusterBorder??"#efefef"};\n }\n `}return sections2},"genReduxSections"),genSections=__name(options=>{let sections2="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)options["lineColor"+i]=options["lineColor"+i]||options["cScaleInv"+i],isDark(options["lineColor"+i])?options["lineColor"+i]=lighten(options["lineColor"+i],20):options["lineColor"+i]=darken(options["lineColor"+i],20);for(let i=0;i<options.THEME_COLOR_LIMIT;i++){const sw=""+(17-3*i);sections2+=`\n .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} path {\n fill: ${options["cScale"+i]};\n }\n .section-${i-1} text {\n fill: ${options["cScaleLabel"+i]};\n }\n .node-icon-${i-1} {\n font-size: 40px;\n color: ${options["cScaleLabel"+i]};\n }\n .section-edge-${i-1}{\n stroke: ${options["cScale"+i]};\n }\n .edge-depth-${i-1}{\n stroke-width: ${sw};\n }\n .section-${i-1} line {\n stroke: ${options["cScaleInv"+i]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${options["cScaleLabel"+i]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: ${options.tertiaryColor??"lightgray"};\n }\n .disabled text {\n fill: ${options.clusterBorder??"#efefef"};\n }\n `}return sections2},"genSections"),styles_default=__name(options=>{var _a;const{theme:theme}=getConfig(),isReduxTheme=null==theme?void 0:theme.includes("redux"),isNeutralTheme="neutral"===theme,rawSvgId=(null==(_a=options.svgId)?void 0:_a.replace(/^#/,""))??"";let gradientSections="";if(options.useGradient&&rawSvgId&&options.THEME_COLOR_LIMIT&&!isNeutralTheme)for(let i=0;i<options.THEME_COLOR_LIMIT;i++)gradientSections+=`\n .section-${i-1}[data-look="neo"] rect,\n .section-${i-1}[data-look="neo"] path,\n .section-${i-1}[data-look="neo"] circle {\n fill: ${options.mainBkg};\n stroke: url(#${rawSvgId}-gradient);\n stroke-width: 2;\n }\n .section-${i-1}[data-look="neo"] line {\n stroke: url(#${rawSvgId}-gradient);\n stroke-width: 2;\n }`;return`\n .edge {\n stroke-width: 3;\n }\n ${isReduxTheme?genReduxSections(options):genSections(options)}\n ${gradientSections}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${options.git0};\n }\n .section-root text {\n fill: ${options.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`},"getStyles"),diagram={db:timelineDb_exports,renderer:{setConf:__name(()=>{},"setConf"),draw:__name((text,id,version,diagObj)=>{var _a,_b;return"TD"===((null==(_b=null==(_a=null==diagObj?void 0:diagObj.db)?void 0:_a.getDirection)?void 0:_b.call(_a))??"LR")?timelineRendererVertical_default.draw(text,id,version,diagObj):timelineRenderer_default.draw(text,id,version,diagObj)},"draw")},parser:timeline_default,styles:styles_default};export{diagram};