mind-elixir 4.5.2 → 5.0.0-beta.10

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 (33) hide show
  1. package/LICENSE +21 -21
  2. package/dist/MindElixir.iife.js +9 -14
  3. package/dist/MindElixir.js +1253 -1177
  4. package/dist/MindElixirLite.iife.js +7 -12
  5. package/dist/MindElixirLite.js +778 -1208
  6. package/dist/example.iife.js +1 -1
  7. package/dist/example.js +14 -13
  8. package/dist/types/arrow.d.ts +1 -0
  9. package/dist/types/index.d.ts +17 -24
  10. package/dist/types/interact.d.ts +10 -13
  11. package/dist/types/methods.d.ts +16 -14
  12. package/dist/types/nodeOperation.d.ts +1 -2
  13. package/dist/types/summary.d.ts +2 -2
  14. package/dist/types/types/dom.d.ts +4 -1
  15. package/dist/types/types/index.d.ts +8 -6
  16. package/dist/types/utils/dragMoveHelper.d.ts +4 -3
  17. package/dist/types/utils/index.d.ts +5 -1
  18. package/dist/types/utils/pubsub.d.ts +12 -16
  19. package/dist/types/utils/svg.d.ts +3 -1
  20. package/dist/types/vanilla/src/EventEmitter.d.ts +13 -0
  21. package/dist/types/vanilla/src/index.d.ts +112 -0
  22. package/dist/types/vanilla/src/types.d.ts +84 -0
  23. package/dist/types/vanilla/src/utils/arrayify.d.ts +1 -0
  24. package/dist/types/vanilla/src/utils/browser.d.ts +2 -0
  25. package/dist/types/vanilla/src/utils/css.d.ts +10 -0
  26. package/dist/types/vanilla/src/utils/domRect.d.ts +1 -0
  27. package/dist/types/vanilla/src/utils/events.d.ts +29 -0
  28. package/dist/types/vanilla/src/utils/frames.d.ts +7 -0
  29. package/dist/types/vanilla/src/utils/intersects.d.ts +9 -0
  30. package/dist/types/vanilla/src/utils/matchesTrigger.d.ts +16 -0
  31. package/dist/types/vanilla/src/utils/selectAll.d.ts +8 -0
  32. package/package.json +3 -3
  33. package/readme.md +12 -1
@@ -1,8 +1,8 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".map-container{--gap: 30px;--root-radius: 30px;--main-radius: 20px;--root-color: #ffffff;--root-bgcolor: #4c4f69;--root-border-color: rgba(0, 0, 0, 0);--main-color: #444446;--main-bgcolor: #ffffff;--topic-padding: 3px;--color: #777777;--bgcolor: #f6f6f6;--selected: #4dc4ff;--panel-color: #444446;--panel-bgcolor: #ffffff;--panel-border-color: #eaeaea;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;-webkit-user-select:none;user-select:none;height:100%;width:100%;overflow:scroll;font-size:15px}.map-container *{box-sizing:border-box}.map-container::-webkit-scrollbar{width:0px;height:0px}.map-container .selected{outline:2px solid var(--selected);outline-offset:1px}.map-container .hyper-link{text-decoration:none;margin-left:.3em}.map-container .lhs{direction:rtl}.map-container .lhs me-tpc{direction:ltr}.map-container .map-canvas{height:20000px;width:20000px;position:relative;-webkit-user-select:none;user-select:none;transition:transform .3s;transform:scale(1);background-color:var(--bgcolor)}.map-container .map-canvas me-nodes{position:absolute;display:flex;justify-content:center;align-items:center;height:fit-content;width:fit-content}.map-container .map-canvas me-root{position:relative}.map-container .map-canvas me-root me-tpc{display:block;font-size:25px;color:var(--root-color);padding:10px var(--gap);border-radius:var(--root-radius);border:var(--root-border-color) 2px solid;white-space:pre-wrap;background-color:var(--root-bgcolor)}.map-container me-main>me-wrapper{position:relative;margin:45px 65px}.map-container me-main>me-wrapper>me-parent{margin:10px;padding:0}.map-container me-main>me-wrapper>me-parent>me-tpc{border-radius:var(--main-radius);background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);padding:8px 25px}.map-container me-wrapper{display:block;pointer-events:none;width:fit-content}.map-container me-children,.map-container me-parent{display:inline-block;vertical-align:middle}.map-container me-parent{position:relative;cursor:pointer;padding:6px var(--gap);margin-top:10px}.map-container me-parent me-tpc{position:relative;display:block;border-radius:3px;color:var(--color);pointer-events:all;max-width:35em;white-space:pre-wrap;padding:var(--topic-padding)}.map-container me-parent me-tpc .insert-preview{position:absolute;width:100%;left:0;z-index:9}.map-container me-parent me-tpc .show{background:#7ad5ff;pointer-events:none;opacity:.7}.map-container me-parent me-tpc .before{height:14px;top:-14px}.map-container me-parent me-tpc .in{height:100%;top:0}.map-container me-parent me-tpc .after{height:14px;bottom:-14px}.map-container me-parent me-epd{position:absolute;height:18px;width:18px;opacity:.8;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NDcxNzI0MiIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNDgwaC0xMzguNjY2NjY3VjM0MS4zMzMzMzNjMC0xNy4wNjY2NjctMTQuOTMzMzMzLTMyLTMyLTMycy0zMiAxNC45MzMzMzMtMzIgMzJ2MTM4LjY2NjY2N0gzNDEuMzMzMzMzYy0xNy4wNjY2NjcgMC0zMiAxNC45MzMzMzMtMzIgMzJzMTQuOTMzMzMzIDMyIDMyIDMyaDEzOC42NjY2NjdWNjgyLjY2NjY2N2MwIDE3LjA2NjY2NyAxNC45MzMzMzMgMzIgMzIgMzJzMzItMTQuOTMzMzMzIDMyLTMydi0xMzguNjY2NjY3SDY4Mi42NjY2NjdjMTcuMDY2NjY3IDAgMzItMTQuOTMzMzMzIDMyLTMycy0xNC45MzMzMzMtMzItMzItMzJ6Ij48L3BhdGg+Cjwvc3ZnPg==);background-repeat:no-repeat;background-size:contain;background-position:center;pointer-events:all;z-index:9}.map-container me-parent me-epd.minus{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NTU2NDk4NSIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNTQ0SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyLTE0LjkzMzMzMy0zMi0zMnMxNC45MzMzMzMtMzIgMzItMzJoMzQxLjMzMzMzNGMxNy4wNjY2NjcgMCAzMiAxNC45MzMzMzMgMzIgMzJzLTE0LjkzMzMzMyAzMi0zMiAzMnoiPjwvcGF0aD4KPC9zdmc+)!important;transition:opacity .3s;opacity:0}.map-container me-parent me-epd.minus:hover{opacity:.8}.map-container .icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.map-container .lines,.map-container .summary,.map-container .subLines,.map-container .topiclinks,.map-container .linkcontroller{position:absolute;height:102%;width:100%;top:0;left:0}.map-container .topiclinks,.map-container .linkcontroller,.map-container .summary{pointer-events:none}.map-container .topiclinks text,.map-container .linkcontroller text,.map-container .summary text{pointer-events:all}.map-container .topiclinks .selected,.map-container .linkcontroller .selected,.map-container .summary .selected{pointer-events:none}.map-container .lines,.map-container .subLines{pointer-events:none;z-index:-1}.map-container .topiclinks *,.map-container .linkcontroller *{z-index:100}.map-container .topiclinks g{cursor:pointer}.map-container #input-box{position:absolute;top:0;left:0;width:max-content;max-width:35em;z-index:11;direction:ltr;-webkit-user-select:auto;user-select:auto;pointer-events:auto;background-color:var(--bgcolor)}.map-container me-tpc>*{pointer-events:none}.map-container me-tpc>a,.map-container me-tpc>iframe{pointer-events:auto}.map-container me-tpc>img{display:block;margin-bottom:8px;object-fit:cover}.map-container me-tpc>.text{display:inline-block}.map-container .circle{position:absolute;height:10px;width:10px;margin-top:-5px;margin-left:-5px;border-radius:100%;background:#757575;border:2px solid #ffffff;cursor:pointer}.map-container .tags{direction:ltr}.map-container .tags span{display:inline-block;border-radius:3px;padding:2px 4px;background:#d6f0f8;color:#276f86;margin:2px 4px 0 0;font-size:12px;line-height:1.3em}.map-container .icons{display:inline-block;direction:ltr;margin-left:5px}.map-container .icons span{display:inline-block;line-height:1.3em}.map-container .mind-elixir-ghost{position:fixed;top:-100%;left:-100%;box-sizing:content-box;opacity:.5;background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);max-width:200px;width:fit-content;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:8px 16px;border-radius:6px}.map-container .selection-area{background:#4f90f22d;border:1px solid #4f90f2}.map-container .context-menu{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99}.map-container .context-menu .menu-list{position:fixed;list-style:none;margin:0;padding:0;color:var(--panel-color);box-shadow:0 12px 15px #0003;border-radius:5px;overflow:hidden}.map-container .context-menu .menu-list li{min-width:200px;overflow:hidden;white-space:nowrap;padding:6px 10px;background:var(--panel-bgcolor);border-bottom:1px solid var(--panel-border-color);cursor:pointer}.map-container .context-menu .menu-list li span{line-height:20px}.map-container .context-menu .menu-list li a{color:#333;text-decoration:none}.map-container .context-menu .menu-list li.disabled{display:none}.map-container .context-menu .menu-list li:hover{filter:brightness(.95)}.map-container .context-menu .menu-list li:last-child{border-bottom:0}.map-container .context-menu .menu-list li span:last-child{float:right}.map-container .context-menu .key{font-size:10px;background-color:#f1f1f1;color:#333;padding:2px 5px;border-radius:3px}.map-container .tips{position:absolute;bottom:20px;left:50%;transform:translate(-50%);color:var(--panel-color);font-weight:bolder}.mind-elixir-toolbar{font-family:iconfont;position:absolute;color:var(--panel-color);background:var(--panel-bgcolor);padding:10px;border-radius:5px;box-shadow:0 1px 2px #0003}.mind-elixir-toolbar svg{display:inline-block}.mind-elixir-toolbar span:active{opacity:.5}.mind-elixir-toolbar.rb{right:20px;bottom:20px}.mind-elixir-toolbar.rb span+span{margin-left:10px}.mind-elixir-toolbar.lt{font-size:20px;left:20px;top:20px}.mind-elixir-toolbar.lt span{display:block}.mind-elixir-toolbar.lt span+span{margin-top:10px}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- (function(e) {
3
- var t, n, o, s, i, r, l = '<svg><symbol id="icon-edit" viewBox="0 0 1024 1024"><path d="M423.765333 128a42.666667 42.666667 0 0 1 3.2 85.205333L423.765333 213.333333H234.666667a64 64 0 0 0-63.872 60.245334L170.666667 277.333333v512a64 64 0 0 0 60.245333 63.872L234.666667 853.333333h512a64 64 0 0 0 63.872-60.245333L810.666667 789.333333v-189.098666a42.666667 42.666667 0 0 1 85.205333-3.2l0.128 3.2V789.333333a149.333333 149.333333 0 0 1-144.213333 149.248L746.666667 938.666667h-512a149.333333 149.333333 0 0 1-149.248-144.213334L85.333333 789.333333v-512a149.333333 149.333333 0 0 1 144.213334-149.248L234.666667 128h189.098666z m324.949334-53.248a42.666667 42.666667 0 0 1 60.330666 0l150.869334 150.869333a42.666667 42.666667 0 0 1 0 60.330667l-329.386667 329.386667a42.666667 42.666667 0 0 1-29.44 12.458666l-153.386667 2.517334a42.666667 42.666667 0 0 1-43.349333-43.349334l2.56-153.386666a42.666667 42.666667 0 0 1 12.458667-29.44z m30.165333 90.496L491.946667 452.266667l-1.493334 91.989333 92.032-1.493333 286.976-286.976-90.538666-90.538667z" ></path></symbol><symbol id="icon-rising" viewBox="0 0 1024 1024"><path d="M553.173333 803.84h-64l0.021334-474.581333-224.021334 224-45.269333-45.226667L521.6 206.293333l301.717333 301.696-45.269333 45.269334-224.853333-224.896v475.477333z" ></path></symbol><symbol id="icon-falling" viewBox="0 0 1024 1024"><path d="M553.173333 238.314667h-64l0.021334 474.602666-224.021334-224-45.269333 45.226667L521.6 835.861333l301.717333-301.717333-45.269333-45.226667-224.853333 224.853334V238.336z" ></path></symbol><symbol id="icon-shanchu2" viewBox="0 0 1024 1024"><path d="M516.60601807 107.93026734c-82.64382935 0-149.71865844 65.51751709-152.5729065 147.77160644H171.37136841c-21.40603638 0-38.92044068 17.38504028-38.92044068 38.92126465 0 21.40686036 17.38504028 38.92208862 38.92126466 38.92208862h42.94308471v435.40136719c0 81.73498536 55.39828492 148.55026245 123.90106201 148.55026245h348.99444581c68.37341309 0 123.90106201-66.42553711 123.901062-148.55026245V333.80477906h38.92126465c21.40686036 0 38.92126464-17.38586426 38.92126465-38.92208863 0-21.40686036-17.38504028-38.92126464-38.92126465-38.92126465H668.91854859C666.45321656 173.44860839 599.24902344 107.93109131 516.60601807 107.93109131z m-79.65939331 147.77160644c2.85424805-42.16442872 37.2354126-74.85809326 79.78875732-74.85809326s76.93450927 32.82302857 79.39984131 74.85809326H436.94662476z m-98.86047364 589.01165771c-24.2611084 0-50.98754883-31.13717651-50.98754883-75.76693725V333.80477906h450.97036744V769.33551026c0 44.50039673-26.72644043 75.76776123-50.98754884 75.76776122H338.08615112v-0.38973999z m0 0" ></path><path d="M390.37063599 751.17263794c17.77313232 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.77478027 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.27124023 40.08883667 32.43493653 40.08883667z m117.41308594 0c17.7739563 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.7739563 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.66098023 40.08883667 32.43493653 40.08883667z m123.51049804 0c17.7739563 0 32.43493653-17.7739563 32.43493652-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43493652-40.08966065-17.7739563 0-32.43411255 17.77478027-32.43411255 40.08966065v228.72875976c0 22.18469239 14.14105224 40.08883667 32.43411255 40.08883667z m0 0" ></path></symbol><symbol id="icon-zijiedian" viewBox="0 0 1024 1024"><path d="M312.208 472c19.568-157.856 153.432-280 315.656-280 175.68 0 318.112 143.272 318.112 320S803.552 832 627.864 832c-162.224 0-296.08-122.144-315.656-280H120a40 40 0 0 1 0-80h192.208zM632 752c132.552 0 240-107.448 240-240 0-132.552-107.448-240-240-240-132.552 0-240 107.448-240 240 0 132.552 107.448 240 240 240z m-40-280v-80a40 40 0 0 1 80 0v80h80a40 40 0 0 1 0 80h-80v80a40 40 0 0 1-80 0v-80h-80a40 40 0 0 1 0-80h80z" ></path></symbol><symbol id="icon-tongjijiedian-" viewBox="0 0 1024 1024"><path d="M803.84 131.626667H410.24A59.733333 59.733333 0 0 0 350.506667 192v45.226667H199.68a51.626667 51.626667 0 0 0-51.626667 51.626666v465.92a51.626667 51.626667 0 0 0 51.626667 51.626667h187.52v-55.466667h-162.133333a21.333333 21.333333 0 0 1-21.333334-21.333333V313.386667a21.333333 21.333333 0 0 1 21.333334-21.333334h125.653333v64a59.733333 59.733333 0 0 0 59.733333 59.733334h393.386667a59.733333 59.733333 0 0 0 59.733333-59.733334V192a59.733333 59.733333 0 0 0-59.733333-60.373333z m4.266667 224.64a4.266667 4.266667 0 0 1-4.266667 4.266666H410.24a4.266667 4.266667 0 0 1-4.266667-4.266666V192a4.266667 4.266667 0 0 1 4.266667-4.266667h393.6a4.266667 4.266667 0 0 1 4.266667 4.266667zM716.16 749.44h-81.28v-81.493333a27.733333 27.733333 0 0 0-55.466667 0v81.28h-81.493333a27.733333 27.733333 0 1 0 0 55.466666h81.28v81.28a27.733333 27.733333 0 1 0 55.466667 0v-81.066666h81.28a27.733333 27.733333 0 0 0 0-55.466667z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128L512.128 467.904l-263.04-263.84c-12.448-12.48-32.704-12.544-45.248-0.064-12.512 12.48-12.544 32.736-0.064 45.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248a31.937 31.937 0 0 0 22.688 9.44c8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408a31.94 31.94 0 0 0 22.592-9.344c12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z" fill="" ></path></symbol><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M109.714 292.571h804.572c21.943 0 36.571-21.942 36.571-43.885 0-14.629-14.628-29.257-36.571-29.257H109.714c-21.943 0-36.571 14.628-36.571 36.571 0 14.629 14.628 36.571 36.571 36.571zM914.286 512H109.714c-21.943 0-36.571 14.629-36.571 36.571 0 14.629 14.628 36.572 36.571 36.572h804.572c21.943 0 36.571-21.943 36.571-43.886 0-14.628-14.628-29.257-36.571-29.257z m0 292.571H109.714c-21.943 0-36.571 14.629-36.571 36.572s14.628 36.571 36.571 36.571h804.572c21.943 0 36.571-21.943 36.571-36.571 0-21.943-14.628-36.572-36.571-36.572z" ></path></symbol><symbol id="icon-right" viewBox="0 0 1024 1024"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="" ></path></symbol><symbol id="icon-left" viewBox="0 0 1024 1024"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="" ></path></symbol><symbol id="icon-side" viewBox="0 0 1024 1024"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" ></path></symbol><symbol id="icon-B" viewBox="0 0 1024 1024"><path d="M98.067692 65.457231H481.28c75.854769 0 132.411077 3.150769 169.668923 9.452307 37.336615 6.301538 70.656 19.534769 100.036923 39.620924 29.459692 20.007385 53.956923 46.710154 73.570462 80.029538 19.692308 33.398154 29.459692 70.734769 29.459692 112.167385 0 44.898462-12.130462 86.094769-36.233846 123.588923a224.886154 224.886154 0 0 1-98.461539 84.283077c58.368 17.092923 103.266462 46.08 134.695385 87.04 31.350154 40.96 47.025231 89.088 47.025231 144.462769 0 43.638154-10.082462 86.016-30.404923 127.212308-20.243692 41.196308-47.891692 74.043077-83.02277 98.697846-35.052308 24.654769-78.296615 39.778462-129.732923 45.449846-32.295385 3.465846-110.119385 5.671385-233.472 6.537846H98.067692V65.457231z m193.536 159.507692V446.621538h126.818462c75.460923 0 122.328615-1.024 140.603077-3.229538 33.083077-3.938462 59.155692-15.36 78.139077-34.343385 18.904615-18.904615 28.435692-43.874462 28.435692-74.830769 0-29.696-8.192-53.720615-24.497231-72.310154-16.384-18.510769-40.644923-29.696-72.940307-33.634461-19.140923-2.205538-74.279385-3.308308-165.415385-3.308308h-111.064615z m0 381.243077v256.315077h179.2c69.710769 0 113.979077-1.969231 132.726154-5.907692 28.750769-5.198769 52.145231-17.959385 70.262154-38.281847 18.116923-20.243692 27.096615-47.340308 27.096615-81.368615 0-28.750769-6.931692-53.169231-20.873846-73.255385a118.232615 118.232615 0 0 0-60.494769-43.795692c-26.387692-9.137231-83.574154-13.705846-171.638154-13.705846H291.603692z" ></path></symbol><symbol id="icon-a" viewBox="0 0 1024 1024"><path d="M757.76 665.6q0 20.48 1.536 34.304t7.68 22.016 18.944 12.288 34.304 4.096q-3.072 25.6-15.36 44.032-11.264 16.384-33.28 29.696t-62.976 13.312q-11.264 0-20.48-0.512t-17.408-2.56l-6.144-2.048-1.024 0q-4.096-1.024-10.24-4.096-2.048-2.048-4.096-2.048-1.024-1.024-2.048-1.024-14.336-8.192-23.552-17.408t-14.336-17.408q-6.144-10.24-9.216-20.48-63.488 75.776-178.176 75.776-48.128 0-88.064-15.36t-69.12-44.032-45.056-68.096-15.872-88.576 16.896-89.088 47.616-67.584 74.24-42.496 96.768-14.848q48.128 0 88.576 17.408t66.048 49.152q0-8.192 0.512-16.384t0.512-15.36q0-71.68-39.936-104.448t-128-32.768q-43.008 0-84.992 6.656t-84.992 17.92q14.336-28.672 25.088-47.616t24.064-29.184q30.72-24.576 158.72-24.576 79.872 0 135.168 13.824t90.624 43.52 51.2 75.264 15.872 108.032l0 200.704zM487.424 743.424q50.176 0 79.872-33.28t29.696-95.744q0-61.44-28.672-93.696t-76.8-32.256q-52.224 0-82.944 33.28t-30.72 94.72q0 58.368 31.744 92.672t77.824 34.304z" ></path></symbol><symbol id="icon-full" viewBox="0 0 1024 1024"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" ></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" ></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" ></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" ></path></symbol><symbol id="icon-add" viewBox="0 0 1024 1024"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" ></path></symbol><symbol id="icon-move" viewBox="0 0 1024 1024"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" ></path></symbol><symbol id="icon-living" viewBox="0 0 1024 1024"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="" ></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="" ></path></symbol></svg>', c = (c = document.getElementsByTagName("script"))[c.length - 1].getAttribute("data-injectcss");
4
- if (c && !e.__iconfont__svg__cssinject__) {
5
- e.__iconfont__svg__cssinject__ = !0;
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".map-container{--gap: 30px;--root-radius: 30px;--main-radius: 20px;--root-color: #ffffff;--root-bgcolor: #4c4f69;--root-border-color: rgba(0, 0, 0, 0);--main-color: #444446;--main-bgcolor: #ffffff;--topic-padding: 3px;--color: #777777;--bgcolor: #f6f6f6;--selected: #4dc4ff;--panel-color: #444446;--panel-bgcolor: #ffffff;--panel-border-color: #eaeaea;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;-webkit-user-select:none;user-select:none;height:100%;width:100%;overflow:hidden;font-size:15px}.map-container *{box-sizing:border-box}.map-container::-webkit-scrollbar{width:0px;height:0px}.map-container .selected{outline:2px solid var(--selected);outline-offset:1px}.map-container .hyper-link{text-decoration:none;margin-left:.3em}.map-container .lhs{direction:rtl}.map-container .lhs me-tpc{direction:ltr}.map-container .map-canvas{height:20000px;width:20000px;position:relative;-webkit-user-select:none;user-select:none;transform:scale(1);background-color:var(--bgcolor)}.map-container .map-canvas me-nodes{position:absolute;display:flex;justify-content:center;align-items:center;height:fit-content;width:fit-content}.map-container .map-canvas me-root{position:relative}.map-container .map-canvas me-root me-tpc{display:block;font-size:25px;color:var(--root-color);padding:10px var(--gap);border-radius:var(--root-radius);border:var(--root-border-color) 2px solid;white-space:pre-wrap;background-color:var(--root-bgcolor)}.map-container me-main>me-wrapper{position:relative;margin:45px 65px}.map-container me-main>me-wrapper>me-parent{margin:10px;padding:0}.map-container me-main>me-wrapper>me-parent>me-tpc{border-radius:var(--main-radius);background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);padding:8px 25px}.map-container me-wrapper{display:block;pointer-events:none;width:fit-content}.map-container me-children,.map-container me-parent{display:inline-block;vertical-align:middle}.map-container me-parent{position:relative;cursor:pointer;padding:6px var(--gap);margin-top:10px}.map-container me-parent me-tpc{position:relative;display:block;border-radius:3px;color:var(--color);pointer-events:all;max-width:35em;white-space:pre-wrap;padding:var(--topic-padding)}.map-container me-parent me-tpc .insert-preview{position:absolute;width:100%;left:0;z-index:9}.map-container me-parent me-tpc .show{background:#7ad5ff;pointer-events:none;opacity:.7;border-radius:3px}.map-container me-parent me-tpc .before{height:14px;top:-14px}.map-container me-parent me-tpc .in{height:100%;top:0}.map-container me-parent me-tpc .after{height:14px;bottom:-14px}.map-container me-parent me-epd{position:absolute;height:18px;width:18px;opacity:.8;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NDcxNzI0MiIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNDgwaC0xMzguNjY2NjY3VjM0MS4zMzMzMzNjMC0xNy4wNjY2NjctMTQuOTMzMzMzLTMyLTMyLTMycy0zMiAxNC45MzMzMzMtMzIgMzJ2MTM4LjY2NjY2N0gzNDEuMzMzMzMzYy0xNy4wNjY2NjcgMC0zMiAxNC45MzMzMzMtMzIgMzJzMTQuOTMzMzMzIDMyIDMyIDMyaDEzOC42NjY2NjdWNjgyLjY2NjY2N2MwIDE3LjA2NjY2NyAxNC45MzMzMzMgMzIgMzIgMzJzMzItMTQuOTMzMzMzIDMyLTMydi0xMzguNjY2NjY3SDY4Mi42NjY2NjdjMTcuMDY2NjY3IDAgMzItMTQuOTMzMzMzIDMyLTMycy0xNC45MzMzMzMtMzItMzItMzJ6Ij48L3BhdGg+Cjwvc3ZnPg==);background-repeat:no-repeat;background-size:contain;background-position:center;pointer-events:all;z-index:9}.map-container me-parent me-epd.minus{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NTU2NDk4NSIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNTQ0SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyLTE0LjkzMzMzMy0zMi0zMnMxNC45MzMzMzMtMzIgMzItMzJoMzQxLjMzMzMzNGMxNy4wNjY2NjcgMCAzMiAxNC45MzMzMzMgMzIgMzJzLTE0LjkzMzMzMyAzMi0zMiAzMnoiPjwvcGF0aD4KPC9zdmc+)!important;transition:opacity .3s;opacity:0}.map-container me-parent me-epd.minus:hover{opacity:.8}.map-container .icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.map-container .lines,.map-container .summary,.map-container .subLines,.map-container .topiclinks,.map-container .linkcontroller{position:absolute;height:102%;width:100%;top:0;left:0}.map-container .topiclinks,.map-container .linkcontroller,.map-container .summary,.map-container .topiclinks .selected,.map-container .linkcontroller .selected,.map-container .summary .selected{pointer-events:none}.map-container .summary>g,.map-container .topiclinks>g{cursor:pointer;pointer-events:stroke}.map-container .lines,.map-container .subLines{pointer-events:none;z-index:-1}.map-container .topiclinks *,.map-container .linkcontroller *{z-index:100}.map-container #input-box{position:absolute;top:0;left:0;width:max-content;max-width:35em;z-index:11;direction:ltr;-webkit-user-select:auto;user-select:auto;pointer-events:auto;background-color:var(--bgcolor)}.map-container me-tpc>*{pointer-events:none}.map-container me-tpc>a,.map-container me-tpc>iframe{pointer-events:auto}.map-container me-tpc>img{display:block;margin-bottom:8px;object-fit:cover}.map-container me-tpc>.text{display:inline-block}.map-container .circle{position:absolute;height:10px;width:10px;margin-top:-5px;margin-left:-5px;border-radius:100%;background:#757575;border:2px solid #ffffff;cursor:pointer}.map-container .tags{direction:ltr}.map-container .tags span{display:inline-block;border-radius:3px;padding:2px 4px;background:#d6f0f8;color:#276f86;margin:2px 4px 0 0;font-size:12px;line-height:1.3em}.map-container .icons{display:inline-block;direction:ltr;margin-left:5px}.map-container .icons span{display:inline-block;line-height:1.3em}.map-container .mind-elixir-ghost{position:fixed;top:-100%;left:-100%;box-sizing:content-box;opacity:.5;background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);max-width:200px;width:fit-content;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:8px 16px;border-radius:6px}.map-container .selection-area{background:#4f90f22d;border:1px solid #4f90f2}.map-container .context-menu{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99}.map-container .context-menu .menu-list{position:fixed;list-style:none;margin:0;padding:0;color:var(--panel-color);box-shadow:0 12px 15px #0003;border-radius:5px;overflow:hidden}.map-container .context-menu .menu-list li{min-width:200px;overflow:hidden;white-space:nowrap;padding:6px 10px;background:var(--panel-bgcolor);border-bottom:1px solid var(--panel-border-color);cursor:pointer}.map-container .context-menu .menu-list li span{line-height:20px}.map-container .context-menu .menu-list li a{color:#333;text-decoration:none}.map-container .context-menu .menu-list li.disabled{display:none}.map-container .context-menu .menu-list li:hover{filter:brightness(.95)}.map-container .context-menu .menu-list li:last-child{border-bottom:0}.map-container .context-menu .menu-list li span:last-child{float:right}.map-container .context-menu .key{font-size:10px;background-color:#f1f1f1;color:#333;padding:2px 5px;border-radius:3px}.map-container .tips{position:absolute;bottom:20px;left:50%;transform:translate(-50%);color:var(--panel-color);font-weight:bolder}.mind-elixir-toolbar{font-family:iconfont;position:absolute;color:var(--panel-color);background:var(--panel-bgcolor);padding:10px;border-radius:5px;box-shadow:0 1px 2px #0003}.mind-elixir-toolbar svg{display:inline-block}.mind-elixir-toolbar span:active{opacity:.5}.mind-elixir-toolbar.rb{right:20px;bottom:20px}.mind-elixir-toolbar.rb span+span{margin-left:10px}.mind-elixir-toolbar.lt{font-size:20px;left:20px;top:20px}.mind-elixir-toolbar.lt span{display:block}.mind-elixir-toolbar.lt span+span{margin-top:10px}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ (function(t) {
3
+ var e, n, o, s, i, r, c = '<svg><symbol id="icon-edit" viewBox="0 0 1024 1024"><path d="M423.765333 128a42.666667 42.666667 0 0 1 3.2 85.205333L423.765333 213.333333H234.666667a64 64 0 0 0-63.872 60.245334L170.666667 277.333333v512a64 64 0 0 0 60.245333 63.872L234.666667 853.333333h512a64 64 0 0 0 63.872-60.245333L810.666667 789.333333v-189.098666a42.666667 42.666667 0 0 1 85.205333-3.2l0.128 3.2V789.333333a149.333333 149.333333 0 0 1-144.213333 149.248L746.666667 938.666667h-512a149.333333 149.333333 0 0 1-149.248-144.213334L85.333333 789.333333v-512a149.333333 149.333333 0 0 1 144.213334-149.248L234.666667 128h189.098666z m324.949334-53.248a42.666667 42.666667 0 0 1 60.330666 0l150.869334 150.869333a42.666667 42.666667 0 0 1 0 60.330667l-329.386667 329.386667a42.666667 42.666667 0 0 1-29.44 12.458666l-153.386667 2.517334a42.666667 42.666667 0 0 1-43.349333-43.349334l2.56-153.386666a42.666667 42.666667 0 0 1 12.458667-29.44z m30.165333 90.496L491.946667 452.266667l-1.493334 91.989333 92.032-1.493333 286.976-286.976-90.538666-90.538667z" ></path></symbol><symbol id="icon-rising" viewBox="0 0 1024 1024"><path d="M553.173333 803.84h-64l0.021334-474.581333-224.021334 224-45.269333-45.226667L521.6 206.293333l301.717333 301.696-45.269333 45.269334-224.853333-224.896v475.477333z" ></path></symbol><symbol id="icon-falling" viewBox="0 0 1024 1024"><path d="M553.173333 238.314667h-64l0.021334 474.602666-224.021334-224-45.269333 45.226667L521.6 835.861333l301.717333-301.717333-45.269333-45.226667-224.853333 224.853334V238.336z" ></path></symbol><symbol id="icon-shanchu2" viewBox="0 0 1024 1024"><path d="M516.60601807 107.93026734c-82.64382935 0-149.71865844 65.51751709-152.5729065 147.77160644H171.37136841c-21.40603638 0-38.92044068 17.38504028-38.92044068 38.92126465 0 21.40686036 17.38504028 38.92208862 38.92126466 38.92208862h42.94308471v435.40136719c0 81.73498536 55.39828492 148.55026245 123.90106201 148.55026245h348.99444581c68.37341309 0 123.90106201-66.42553711 123.901062-148.55026245V333.80477906h38.92126465c21.40686036 0 38.92126464-17.38586426 38.92126465-38.92208863 0-21.40686036-17.38504028-38.92126464-38.92126465-38.92126465H668.91854859C666.45321656 173.44860839 599.24902344 107.93109131 516.60601807 107.93109131z m-79.65939331 147.77160644c2.85424805-42.16442872 37.2354126-74.85809326 79.78875732-74.85809326s76.93450927 32.82302857 79.39984131 74.85809326H436.94662476z m-98.86047364 589.01165771c-24.2611084 0-50.98754883-31.13717651-50.98754883-75.76693725V333.80477906h450.97036744V769.33551026c0 44.50039673-26.72644043 75.76776123-50.98754884 75.76776122H338.08615112v-0.38973999z m0 0" ></path><path d="M390.37063599 751.17263794c17.77313232 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.77478027 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.27124023 40.08883667 32.43493653 40.08883667z m117.41308594 0c17.7739563 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.7739563 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.66098023 40.08883667 32.43493653 40.08883667z m123.51049804 0c17.7739563 0 32.43493653-17.7739563 32.43493652-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43493652-40.08966065-17.7739563 0-32.43411255 17.77478027-32.43411255 40.08966065v228.72875976c0 22.18469239 14.14105224 40.08883667 32.43411255 40.08883667z m0 0" ></path></symbol><symbol id="icon-zijiedian" viewBox="0 0 1024 1024"><path d="M312.208 472c19.568-157.856 153.432-280 315.656-280 175.68 0 318.112 143.272 318.112 320S803.552 832 627.864 832c-162.224 0-296.08-122.144-315.656-280H120a40 40 0 0 1 0-80h192.208zM632 752c132.552 0 240-107.448 240-240 0-132.552-107.448-240-240-240-132.552 0-240 107.448-240 240 0 132.552 107.448 240 240 240z m-40-280v-80a40 40 0 0 1 80 0v80h80a40 40 0 0 1 0 80h-80v80a40 40 0 0 1-80 0v-80h-80a40 40 0 0 1 0-80h80z" ></path></symbol><symbol id="icon-tongjijiedian-" viewBox="0 0 1024 1024"><path d="M803.84 131.626667H410.24A59.733333 59.733333 0 0 0 350.506667 192v45.226667H199.68a51.626667 51.626667 0 0 0-51.626667 51.626666v465.92a51.626667 51.626667 0 0 0 51.626667 51.626667h187.52v-55.466667h-162.133333a21.333333 21.333333 0 0 1-21.333334-21.333333V313.386667a21.333333 21.333333 0 0 1 21.333334-21.333334h125.653333v64a59.733333 59.733333 0 0 0 59.733333 59.733334h393.386667a59.733333 59.733333 0 0 0 59.733333-59.733334V192a59.733333 59.733333 0 0 0-59.733333-60.373333z m4.266667 224.64a4.266667 4.266667 0 0 1-4.266667 4.266666H410.24a4.266667 4.266667 0 0 1-4.266667-4.266666V192a4.266667 4.266667 0 0 1 4.266667-4.266667h393.6a4.266667 4.266667 0 0 1 4.266667 4.266667zM716.16 749.44h-81.28v-81.493333a27.733333 27.733333 0 0 0-55.466667 0v81.28h-81.493333a27.733333 27.733333 0 1 0 0 55.466666h81.28v81.28a27.733333 27.733333 0 1 0 55.466667 0v-81.066666h81.28a27.733333 27.733333 0 0 0 0-55.466667z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128L512.128 467.904l-263.04-263.84c-12.448-12.48-32.704-12.544-45.248-0.064-12.512 12.48-12.544 32.736-0.064 45.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248a31.937 31.937 0 0 0 22.688 9.44c8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408a31.94 31.94 0 0 0 22.592-9.344c12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z" fill="" ></path></symbol><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M109.714 292.571h804.572c21.943 0 36.571-21.942 36.571-43.885 0-14.629-14.628-29.257-36.571-29.257H109.714c-21.943 0-36.571 14.628-36.571 36.571 0 14.629 14.628 36.571 36.571 36.571zM914.286 512H109.714c-21.943 0-36.571 14.629-36.571 36.571 0 14.629 14.628 36.572 36.571 36.572h804.572c21.943 0 36.571-21.943 36.571-43.886 0-14.628-14.628-29.257-36.571-29.257z m0 292.571H109.714c-21.943 0-36.571 14.629-36.571 36.572s14.628 36.571 36.571 36.571h804.572c21.943 0 36.571-21.943 36.571-36.571 0-21.943-14.628-36.572-36.571-36.572z" ></path></symbol><symbol id="icon-right" viewBox="0 0 1024 1024"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="" ></path></symbol><symbol id="icon-left" viewBox="0 0 1024 1024"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="" ></path></symbol><symbol id="icon-side" viewBox="0 0 1024 1024"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" ></path></symbol><symbol id="icon-B" viewBox="0 0 1024 1024"><path d="M98.067692 65.457231H481.28c75.854769 0 132.411077 3.150769 169.668923 9.452307 37.336615 6.301538 70.656 19.534769 100.036923 39.620924 29.459692 20.007385 53.956923 46.710154 73.570462 80.029538 19.692308 33.398154 29.459692 70.734769 29.459692 112.167385 0 44.898462-12.130462 86.094769-36.233846 123.588923a224.886154 224.886154 0 0 1-98.461539 84.283077c58.368 17.092923 103.266462 46.08 134.695385 87.04 31.350154 40.96 47.025231 89.088 47.025231 144.462769 0 43.638154-10.082462 86.016-30.404923 127.212308-20.243692 41.196308-47.891692 74.043077-83.02277 98.697846-35.052308 24.654769-78.296615 39.778462-129.732923 45.449846-32.295385 3.465846-110.119385 5.671385-233.472 6.537846H98.067692V65.457231z m193.536 159.507692V446.621538h126.818462c75.460923 0 122.328615-1.024 140.603077-3.229538 33.083077-3.938462 59.155692-15.36 78.139077-34.343385 18.904615-18.904615 28.435692-43.874462 28.435692-74.830769 0-29.696-8.192-53.720615-24.497231-72.310154-16.384-18.510769-40.644923-29.696-72.940307-33.634461-19.140923-2.205538-74.279385-3.308308-165.415385-3.308308h-111.064615z m0 381.243077v256.315077h179.2c69.710769 0 113.979077-1.969231 132.726154-5.907692 28.750769-5.198769 52.145231-17.959385 70.262154-38.281847 18.116923-20.243692 27.096615-47.340308 27.096615-81.368615 0-28.750769-6.931692-53.169231-20.873846-73.255385a118.232615 118.232615 0 0 0-60.494769-43.795692c-26.387692-9.137231-83.574154-13.705846-171.638154-13.705846H291.603692z" ></path></symbol><symbol id="icon-a" viewBox="0 0 1024 1024"><path d="M757.76 665.6q0 20.48 1.536 34.304t7.68 22.016 18.944 12.288 34.304 4.096q-3.072 25.6-15.36 44.032-11.264 16.384-33.28 29.696t-62.976 13.312q-11.264 0-20.48-0.512t-17.408-2.56l-6.144-2.048-1.024 0q-4.096-1.024-10.24-4.096-2.048-2.048-4.096-2.048-1.024-1.024-2.048-1.024-14.336-8.192-23.552-17.408t-14.336-17.408q-6.144-10.24-9.216-20.48-63.488 75.776-178.176 75.776-48.128 0-88.064-15.36t-69.12-44.032-45.056-68.096-15.872-88.576 16.896-89.088 47.616-67.584 74.24-42.496 96.768-14.848q48.128 0 88.576 17.408t66.048 49.152q0-8.192 0.512-16.384t0.512-15.36q0-71.68-39.936-104.448t-128-32.768q-43.008 0-84.992 6.656t-84.992 17.92q14.336-28.672 25.088-47.616t24.064-29.184q30.72-24.576 158.72-24.576 79.872 0 135.168 13.824t90.624 43.52 51.2 75.264 15.872 108.032l0 200.704zM487.424 743.424q50.176 0 79.872-33.28t29.696-95.744q0-61.44-28.672-93.696t-76.8-32.256q-52.224 0-82.944 33.28t-30.72 94.72q0 58.368 31.744 92.672t77.824 34.304z" ></path></symbol><symbol id="icon-full" viewBox="0 0 1024 1024"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" ></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" ></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" ></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" ></path></symbol><symbol id="icon-add" viewBox="0 0 1024 1024"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" ></path></symbol><symbol id="icon-move" viewBox="0 0 1024 1024"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" ></path></symbol><symbol id="icon-living" viewBox="0 0 1024 1024"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="" ></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="" ></path></symbol></svg>', a = (a = document.getElementsByTagName("script"))[a.length - 1].getAttribute("data-injectcss");
4
+ if (a && !t.__iconfont__svg__cssinject__) {
5
+ t.__iconfont__svg__cssinject__ = !0;
6
6
  try {
7
7
  document.write(
8
8
  "<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>"
@@ -10,26 +10,26 @@
10
10
  } catch {
11
11
  }
12
12
  }
13
- function d() {
13
+ function f() {
14
14
  i || (i = !0, o());
15
15
  }
16
- t = function() {
17
- var a, u, h, f;
18
- (f = document.createElement("div")).innerHTML = l, l = null, (h = f.getElementsByTagName("svg")[0]) && (h.setAttribute("aria-hidden", "true"), h.style.position = "absolute", h.style.width = 0, h.style.height = 0, h.style.overflow = "hidden", a = h, (u = document.body).firstChild ? (f = a, (h = u.firstChild).parentNode.insertBefore(f, h)) : u.appendChild(a));
19
- }, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(t, 0) : (n = function() {
20
- document.removeEventListener("DOMContentLoaded", n, !1), t();
21
- }, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (o = t, s = e.document, i = !1, (r = function() {
16
+ e = function() {
17
+ var l, h, d, p;
18
+ (p = document.createElement("div")).innerHTML = c, c = null, (d = p.getElementsByTagName("svg")[0]) && (d.setAttribute("aria-hidden", "true"), d.style.position = "absolute", d.style.width = 0, d.style.height = 0, d.style.overflow = "hidden", l = d, (h = document.body).firstChild ? (p = l, (d = h.firstChild).parentNode.insertBefore(p, d)) : h.appendChild(l));
19
+ }, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(e, 0) : (n = function() {
20
+ document.removeEventListener("DOMContentLoaded", n, !1), e();
21
+ }, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (o = e, s = t.document, i = !1, (r = function() {
22
22
  try {
23
23
  s.documentElement.doScroll("left");
24
24
  } catch {
25
25
  return void setTimeout(r, 50);
26
26
  }
27
- d();
27
+ f();
28
28
  })(), s.onreadystatechange = function() {
29
- s.readyState == "complete" && (s.onreadystatechange = null, d());
29
+ s.readyState == "complete" && (s.onreadystatechange = null, f());
30
30
  });
31
31
  })(window);
32
- const j = 0, te = 1, ne = 2, xe = {
32
+ const B = 0, X = 1, G = 2, ct = {
33
33
  name: "Latte",
34
34
  type: "light",
35
35
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -43,7 +43,7 @@ const j = 0, te = 1, ne = 2, xe = {
43
43
  "--panel-bgcolor": "#ffffff",
44
44
  "--panel-border-color": "#eaeaea"
45
45
  }
46
- }, we = {
46
+ }, lt = {
47
47
  name: "Dark",
48
48
  type: "dark",
49
49
  palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
@@ -57,319 +57,319 @@ const j = 0, te = 1, ne = 2, xe = {
57
57
  "--panel-border-color": "#696969"
58
58
  }
59
59
  };
60
- function ae(e) {
61
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
60
+ function nt(t) {
61
+ return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
62
62
  }
63
- const J = function(e, t) {
64
- if (t.id === e)
65
- return t;
66
- if (t.children && t.children.length) {
67
- for (let n = 0; n < t.children.length; n++) {
68
- const o = J(e, t.children[n]);
63
+ const R = function(t, e) {
64
+ if (e.id === t)
65
+ return e;
66
+ if (e.children && e.children.length) {
67
+ for (let n = 0; n < e.children.length; n++) {
68
+ const o = R(t, e.children[n]);
69
69
  if (o)
70
70
  return o;
71
71
  }
72
72
  return null;
73
73
  } else
74
74
  return null;
75
- }, oe = (e, t) => {
76
- if (e.parent = t, e.children)
77
- for (let n = 0; n < e.children.length; n++)
78
- oe(e.children[n], e);
75
+ }, J = (t, e) => {
76
+ if (t.parent = e, t.children)
77
+ for (let n = 0; n < t.children.length; n++)
78
+ J(t.children[n], t);
79
79
  };
80
- function U(e, t, n, o) {
81
- const s = o - t, i = e - n;
80
+ function W(t, e, n, o) {
81
+ const s = o - e, i = t - n;
82
82
  let r = Math.atan(Math.abs(s) / Math.abs(i)) / 3.14 * 180;
83
+ if (isNaN(r))
84
+ return;
83
85
  i < 0 && s > 0 && (r = 180 - r), i < 0 && s < 0 && (r = 180 + r), i > 0 && s < 0 && (r = 360 - r);
84
- const l = 12, c = 30, d = r + c, a = r - c;
86
+ const c = 12, a = 30, f = r + a, l = r - a;
85
87
  return {
86
- x1: n + Math.cos(Math.PI * d / 180) * l,
87
- y1: o - Math.sin(Math.PI * d / 180) * l,
88
- x2: n + Math.cos(Math.PI * a / 180) * l,
89
- y2: o - Math.sin(Math.PI * a / 180) * l
88
+ x1: n + Math.cos(Math.PI * f / 180) * c,
89
+ y1: o - Math.sin(Math.PI * f / 180) * c,
90
+ x2: n + Math.cos(Math.PI * l / 180) * c,
91
+ y2: o - Math.sin(Math.PI * l / 180) * c
90
92
  };
91
93
  }
92
- function ee() {
94
+ function V() {
93
95
  return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
94
96
  }
95
- const Ne = function() {
96
- const e = ee();
97
+ const gt = function() {
98
+ const t = V();
97
99
  return {
98
100
  topic: this.newTopicName,
99
- id: e
101
+ id: t
100
102
  };
101
- }, H = (e, t) => {
103
+ }, N = (t, e) => {
102
104
  let n = 0, o = 0;
103
- for (; t && t !== e; )
104
- n += t.offsetLeft, o += t.offsetTop, t = t.offsetParent;
105
+ for (; e && e !== t; )
106
+ n += e.offsetLeft, o += e.offsetTop, e = e.offsetParent;
105
107
  return { offsetLeft: n, offsetTop: o };
106
- }, x = (e, t) => {
107
- for (const n in t)
108
- e.setAttribute(n, t[n]);
109
- }, he = (e) => e ? e.tagName === "ME-TPC" : !1, k = {
110
- moved: !1,
111
- // diffrentiate click and move
112
- mousedown: !1,
113
- onMove(e, t) {
114
- if (this.mousedown) {
115
- this.moved = !0;
116
- const n = e.movementX, o = e.movementY, { container: s, map: i, scaleVal: r } = t;
117
- let l = s.scrollLeft - n, c = s.scrollTop - o;
118
- if (r < 1) {
119
- const d = (s.scrollWidth - i.clientWidth * r) / 2, a = (s.scrollHeight - i.clientHeight * r) / 2;
120
- l = Math.max(d, Math.min(s.scrollWidth - d - s.clientWidth, l)), c = Math.max(a, Math.min(s.scrollHeight - a - s.clientHeight, c));
121
- }
122
- s.scrollTo(l, c);
123
- }
124
- },
125
- clear() {
126
- setTimeout(() => {
127
- this.moved = !1, this.mousedown = !1;
128
- }, 0);
129
- }
108
+ }, x = (t, e) => {
109
+ for (const n in e)
110
+ t.setAttribute(n, e[n]);
111
+ }, yt = (t) => t ? t.tagName === "ME-TPC" : !1, at = (t) => {
112
+ const e = /translate\(([^,]+),\s*([^)]+)\)/, n = t.match(e);
113
+ return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
130
114
  };
131
- function ke(e) {
132
- e.map.addEventListener("click", (t) => {
133
- var o, s;
134
- if (t.button !== 0)
115
+ function xt(t) {
116
+ const { dragMoveHelper: e } = t;
117
+ t.map.addEventListener("click", (n) => {
118
+ var i, r, c;
119
+ if (n.button !== 0)
135
120
  return;
136
- if ((o = e.helper1) != null && o.moved) {
137
- e.helper1.clear();
121
+ if ((i = t.helper1) != null && i.moved) {
122
+ t.helper1.clear();
138
123
  return;
139
124
  }
140
- if ((s = e.helper2) != null && s.moved) {
141
- e.helper2.clear();
125
+ if ((r = t.helper2) != null && r.moved) {
126
+ t.helper2.clear();
142
127
  return;
143
128
  }
144
- if (k.moved) {
145
- k.clear();
129
+ if (e.moved) {
130
+ e.clear();
146
131
  return;
147
132
  }
148
- e.clearSelection();
149
- const n = t.target;
150
- if (n.tagName === "ME-EPD")
151
- e.expandNode(n.previousSibling);
152
- else if (he(n))
153
- e.selectNode(n, !1, t);
154
- else if (e.editable)
155
- n.tagName === "text" ? n.dataset.type === "custom-link" ? e.selectArrow(n.parentElement) : e.selectSummary(n.parentElement) : n.className;
156
- else
133
+ const o = n.target;
134
+ if (o.tagName === "ME-EPD")
135
+ t.expandNode(o.previousSibling);
136
+ else if (!t.editable)
157
137
  return;
158
- }), e.map.addEventListener("dblclick", (t) => {
159
- if (!e.editable)
138
+ const s = (c = o.parentElement) == null ? void 0 : c.parentElement;
139
+ s.getAttribute("class") === "topiclinks" ? t.selectArrow(o.parentElement) : s.getAttribute("class") === "summary" && t.selectSummary(o.parentElement);
140
+ }), t.map.addEventListener("dblclick", (n) => {
141
+ var i;
142
+ if (!t.editable)
160
143
  return;
161
- const n = t.target;
162
- he(n) ? e.beginEdit(n) : n.tagName === "text" && (n.dataset.type === "custom-link" ? e.editArrowLabel(n.parentElement) : e.editSummary(n.parentElement));
163
- }), e.map.addEventListener("mousemove", (t) => {
164
- t.target.contentEditable === "inherit" && k.onMove(t, e);
165
- }), e.map.addEventListener("mousedown", (t) => {
166
- const n = e.mouseSelectionButton === 0 ? 2 : 0;
167
- t.button === n && t.target.contentEditable === "inherit" && (k.moved = !1, k.mousedown = !0);
168
- }), e.map.addEventListener("mouseleave", (t) => {
169
- const n = e.mouseSelectionButton === 0 ? 2 : 0;
170
- t.button === n && k.clear();
171
- }), e.map.addEventListener("mouseup", (t) => {
172
- const n = e.mouseSelectionButton === 0 ? 2 : 0;
173
- t.button === n && k.clear();
144
+ const o = n.target;
145
+ yt(o) && t.beginEdit(o);
146
+ const s = (i = o.parentElement) == null ? void 0 : i.parentElement;
147
+ s.getAttribute("class") === "topiclinks" ? t.editArrowLabel(o.parentElement) : s.getAttribute("class") === "summary" && t.editSummary(o.parentElement);
148
+ }), t.map.addEventListener("mousedown", (n) => {
149
+ const o = t.mouseSelectionButton === 0 ? 2 : 0;
150
+ n.button === o && n.target.contentEditable === "inherit" && (e.moved = !1, e.mousedown = !0, t.map.style.transition = "none");
151
+ }), document.addEventListener("mousemove", (n) => {
152
+ n.target.contentEditable === "inherit" && e.onMove(n), e.x = n.clientX, e.y = n.clientY;
153
+ }), document.addEventListener("mouseup", (n) => {
154
+ const o = t.mouseSelectionButton === 0 ? 2 : 0;
155
+ n.button === o && e.clear();
156
+ }), document.addEventListener("contextmenu", (n) => {
157
+ e.moved && n.preventDefault();
174
158
  });
175
159
  }
176
- const He = {
177
- create() {
178
- return {
179
- handlers: {},
180
- showHandler: function() {
181
- },
182
- addListener: function(e, t) {
183
- this.handlers[e] === void 0 && (this.handlers[e] = []), this.handlers[e].push(t);
184
- },
185
- fire: function(e, ...t) {
186
- if (this.handlers[e] instanceof Array) {
187
- const n = this.handlers[e];
188
- for (let o = 0; o < n.length; o++)
189
- n[o](...t);
190
- }
191
- },
192
- removeListener: function(e, t) {
193
- if (!this.handlers[e])
194
- return;
195
- const n = this.handlers[e];
196
- if (!t)
197
- n.length = 0;
198
- else if (n.length)
199
- for (let o = 0; o < n.length; o++)
200
- n[o] === t && this.handlers[e].splice(o, 1);
160
+ function vt() {
161
+ return {
162
+ handlers: {},
163
+ showHandler: function() {
164
+ },
165
+ addListener: function(t, e) {
166
+ this.handlers[t] === void 0 && (this.handlers[t] = []), this.handlers[t].push(e);
167
+ },
168
+ fire: function(t, ...e) {
169
+ if (this.handlers[t] instanceof Array) {
170
+ const n = this.handlers[t];
171
+ for (let o = 0; o < n.length; o++)
172
+ n[o](...e);
201
173
  }
202
- };
203
- }
204
- };
205
- var T = /* @__PURE__ */ ((e) => (e.LHS = "lhs", e.RHS = "rhs", e))(T || {});
206
- const Q = document, De = function() {
174
+ },
175
+ removeListener: function(t, e) {
176
+ if (!this.handlers[t])
177
+ return;
178
+ const n = this.handlers[t];
179
+ if (!e)
180
+ n.length = 0;
181
+ else if (n.length)
182
+ for (let o = 0; o < n.length; o++)
183
+ n[o] === e && this.handlers[t].splice(o, 1);
184
+ }
185
+ };
186
+ }
187
+ var $ = /* @__PURE__ */ ((t) => (t.LHS = "lhs", t.RHS = "rhs", t))($ || {});
188
+ const I = document, bt = function() {
207
189
  this.nodes.innerHTML = "";
208
- const e = this.createTopic(this.nodeData);
209
- _e(e, this.nodeData), e.draggable = !1;
210
- const t = Q.createElement("me-root");
211
- t.appendChild(e);
190
+ const t = this.createTopic(this.nodeData);
191
+ ht(t, this.nodeData), t.draggable = !1;
192
+ const e = I.createElement("me-root");
193
+ e.appendChild(t);
212
194
  const n = this.nodeData.children || [];
213
- if (this.direction === ne) {
195
+ if (this.direction === G) {
214
196
  let o = 0, s = 0;
215
197
  n.map((i) => {
216
- i.direction === j ? o += 1 : i.direction === te ? s += 1 : o <= s ? (i.direction = j, o += 1) : (i.direction = te, s += 1);
198
+ i.direction === B ? o += 1 : i.direction === X ? s += 1 : o <= s ? (i.direction = B, o += 1) : (i.direction = X, s += 1);
217
199
  });
218
200
  }
219
- Be(this, n, t);
220
- }, Be = function(e, t, n) {
221
- const o = Q.createElement("me-main");
222
- o.className = T.LHS;
223
- const s = Q.createElement("me-main");
224
- s.className = T.RHS;
225
- for (let i = 0; i < t.length; i++) {
226
- const r = t[i], { grp: l } = e.createWrapper(r);
227
- e.direction === ne ? r.direction === j ? o.appendChild(l) : s.appendChild(l) : e.direction === j ? o.appendChild(l) : s.appendChild(l);
201
+ wt(this, n, e);
202
+ }, wt = function(t, e, n) {
203
+ const o = I.createElement("me-main");
204
+ o.className = $.LHS;
205
+ const s = I.createElement("me-main");
206
+ s.className = $.RHS;
207
+ for (let i = 0; i < e.length; i++) {
208
+ const r = e[i], { grp: c } = t.createWrapper(r);
209
+ t.direction === G ? r.direction === B ? o.appendChild(c) : s.appendChild(c) : t.direction === B ? o.appendChild(c) : s.appendChild(c);
228
210
  }
229
- e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(s), e.nodes.appendChild(e.lines);
230
- }, Pe = function(e, t) {
231
- const n = Q.createElement("me-children");
232
- for (let o = 0; o < t.length; o++) {
233
- const s = t[o], { grp: i } = e.createWrapper(s);
211
+ t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(s), t.nodes.appendChild(t.lines);
212
+ }, Ct = function(t, e) {
213
+ const n = I.createElement("me-children");
214
+ for (let o = 0; o < e.length; o++) {
215
+ const s = e[o], { grp: i } = t.createWrapper(s);
234
216
  n.appendChild(i);
235
217
  }
236
218
  return n;
237
- }, C = document, M = (e, t) => {
238
- const o = (t ? t.mindElixirBox : C).querySelector(`[data-nodeid=me${e}]`);
219
+ }, S = document, M = (t, e) => {
220
+ const o = (e ? e.mindElixirBox : S).querySelector(`[data-nodeid=me${t}]`);
239
221
  if (!o)
240
- throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
222
+ throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);
241
223
  return o;
242
- }, _e = function(e, t) {
243
- if (e.innerHTML = "", t.style && (e.style.color = t.style.color || "", e.style.background = t.style.background || "", e.style.fontSize = t.style.fontSize + "px", e.style.fontWeight = t.style.fontWeight || "normal"), t.dangerouslySetInnerHTML) {
244
- e.innerHTML = t.dangerouslySetInnerHTML;
224
+ }, ht = function(t, e) {
225
+ if (t.innerHTML = "", e.style && (t.style.color = e.style.color || "", t.style.background = e.style.background || "", t.style.fontSize = e.style.fontSize + "px", t.style.fontWeight = e.style.fontWeight || "normal"), e.dangerouslySetInnerHTML) {
226
+ t.innerHTML = e.dangerouslySetInnerHTML;
245
227
  return;
246
228
  }
247
- if (t.image) {
248
- const n = t.image;
229
+ if (e.image) {
230
+ const n = e.image;
249
231
  if (n.url && n.width && n.height) {
250
- const o = C.createElement("img");
251
- o.src = n.url, o.style.width = n.width + "px", o.style.height = n.height + "px", n.fit && (o.style.objectFit = n.fit), e.appendChild(o), e.image = o;
232
+ const o = S.createElement("img");
233
+ o.src = n.url, o.style.width = n.width + "px", o.style.height = n.height + "px", n.fit && (o.style.objectFit = n.fit), t.appendChild(o), t.image = o;
252
234
  }
253
235
  } else
254
- e.image && (e.image = void 0);
236
+ t.image && (t.image = void 0);
255
237
  {
256
- const n = C.createElement("span");
257
- n.className = "text", n.textContent = t.topic, e.appendChild(n), e.text = n;
238
+ const n = S.createElement("span");
239
+ n.className = "text", n.textContent = e.topic, t.appendChild(n), t.text = n;
258
240
  }
259
- if (t.hyperLink) {
260
- const n = C.createElement("a");
261
- n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = t.hyperLink, e.appendChild(n), e.link = n;
241
+ if (e.hyperLink) {
242
+ const n = S.createElement("a");
243
+ n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = e.hyperLink, t.appendChild(n), t.link = n;
262
244
  } else
263
- e.link && (e.link = void 0);
264
- if (t.icons && t.icons.length) {
265
- const n = C.createElement("span");
266
- n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${ae(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
245
+ t.link && (t.link = void 0);
246
+ if (e.icons && e.icons.length) {
247
+ const n = S.createElement("span");
248
+ n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${nt(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
267
249
  } else
268
- e.icons && (e.icons = void 0);
269
- if (t.tags && t.tags.length) {
270
- const n = C.createElement("div");
271
- n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${ae(o)}</span>`).join(""), e.appendChild(n), e.tags = n;
250
+ t.icons && (t.icons = void 0);
251
+ if (e.tags && e.tags.length) {
252
+ const n = S.createElement("div");
253
+ n.className = "tags", n.innerHTML = e.tags.map((o) => `<span>${nt(o)}</span>`).join(""), t.appendChild(n), t.tags = n;
272
254
  } else
273
- e.tags && (e.tags = void 0);
274
- }, ze = function(e, t) {
275
- const n = C.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(e);
276
- if (n.appendChild(o), !t && e.children && e.children.length > 0) {
277
- const i = Ve(e.expanded);
278
- if (o.appendChild(i), e.expanded !== !1) {
279
- const r = Pe(this, e.children);
255
+ t.tags && (t.tags = void 0);
256
+ }, Et = function(t, e) {
257
+ const n = S.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(t);
258
+ if (n.appendChild(o), !e && t.children && t.children.length > 0) {
259
+ const i = Tt(t.expanded);
260
+ if (o.appendChild(i), t.expanded !== !1) {
261
+ const r = Ct(this, t.children);
280
262
  n.appendChild(r);
281
263
  }
282
264
  }
283
265
  return { grp: n, top: o, tpc: s };
284
- }, Oe = function(e) {
285
- const t = C.createElement("me-parent"), n = this.createTopic(e);
286
- return _e(n, e), t.appendChild(n), { p: t, tpc: n };
287
- }, je = function(e) {
288
- const t = C.createElement("me-children");
289
- return t.append(...e), t;
290
- }, Re = function(e) {
291
- const t = C.createElement("me-tpc");
292
- return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t.draggable = this.draggable, t;
266
+ }, St = function(t) {
267
+ const e = S.createElement("me-parent"), n = this.createTopic(t);
268
+ return ht(n, t), e.appendChild(n), { p: e, tpc: n };
269
+ }, Lt = function(t) {
270
+ const e = S.createElement("me-children");
271
+ return e.append(...t), e;
272
+ }, Mt = function(t) {
273
+ const e = S.createElement("me-tpc");
274
+ return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e.draggable = this.draggable, e;
293
275
  };
294
- function Ee(e) {
295
- const t = C.createRange();
296
- t.selectNodeContents(e);
276
+ function dt(t) {
277
+ const e = S.createRange();
278
+ e.selectNodeContents(t);
297
279
  const n = window.getSelection();
298
- n && (n.removeAllRanges(), n.addRange(t));
280
+ n && (n.removeAllRanges(), n.addRange(e));
299
281
  }
300
- const qe = function(e) {
301
- if (!e)
282
+ const $t = function(t) {
283
+ if (!t)
302
284
  return;
303
- const t = C.createElement("div"), n = e.text.textContent;
304
- e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "plaintext-only", t.spellcheck = !1;
305
- const o = getComputedStyle(e);
306
- t.style.cssText = `min-width:${e.offsetWidth - 8}px;
285
+ const e = S.createElement("div"), n = t.text.textContent;
286
+ t.appendChild(e), e.id = "input-box", e.textContent = n, e.contentEditable = "plaintext-only", e.spellcheck = !1;
287
+ const o = getComputedStyle(t);
288
+ e.style.cssText = `min-width:${t.offsetWidth - 8}px;
307
289
  color:${o.color};
308
290
  padding:${o.padding};
309
291
  margin:${o.margin};
310
292
  font:${o.font};
311
293
  background-color:${o.backgroundColor !== "rgba(0, 0, 0, 0)" && o.backgroundColor};
312
- border-radius:${o.borderRadius};`, this.direction === j && (t.style.right = "0"), t.focus(), Ee(t), this.bus.fire("operation", {
294
+ border-radius:${o.borderRadius};`, this.direction === B && (e.style.right = "0"), e.focus(), dt(e), this.bus.fire("operation", {
313
295
  name: "beginEdit",
314
- obj: e.nodeObj
315
- }), t.addEventListener("keydown", (s) => {
296
+ obj: t.nodeObj
297
+ }), e.addEventListener("keydown", (s) => {
316
298
  s.stopPropagation();
317
299
  const i = s.key;
318
300
  if (i === "Enter" || i === "Tab") {
319
301
  if (s.shiftKey)
320
302
  return;
321
- s.preventDefault(), t.blur(), this.map.focus();
303
+ s.preventDefault(), e.blur(), this.map.focus();
322
304
  }
323
- }), t.addEventListener("blur", () => {
305
+ }), e.addEventListener("blur", () => {
324
306
  var r;
325
- if (!t)
307
+ if (!e)
326
308
  return;
327
- const s = e.nodeObj, i = ((r = t.textContent) == null ? void 0 : r.trim()) || "";
328
- i === "" ? s.topic = n : s.topic = i, t.remove(), i !== n && (e.text.textContent = s.topic, this.linkDiv(), this.bus.fire("operation", {
309
+ const s = t.nodeObj, i = ((r = e.textContent) == null ? void 0 : r.trim()) || "";
310
+ i === "" ? s.topic = n : s.topic = i, e.remove(), i !== n && (t.text.textContent = s.topic, this.linkDiv(), this.bus.fire("operation", {
329
311
  name: "finishEdit",
330
312
  obj: s,
331
313
  origin: n
332
314
  }));
333
315
  });
334
- }, Ve = function(e) {
335
- const t = C.createElement("me-epd");
336
- return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
337
- }, R = document, F = "http://www.w3.org/2000/svg", Se = function(e, t, n) {
338
- const o = R.createElementNS(F, "path");
316
+ }, Tt = function(t) {
317
+ const e = S.createElement("me-epd");
318
+ return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
319
+ }, H = document, D = "http://www.w3.org/2000/svg", ft = function(t, e, n) {
320
+ const o = H.createElementNS(D, "path");
339
321
  return x(o, {
340
- d: e,
341
- stroke: t || "#666",
322
+ d: t,
323
+ stroke: e || "#666",
342
324
  fill: "none",
343
325
  "stroke-width": n
344
326
  }), o;
345
- }, W = function(e) {
346
- const t = R.createElementNS(F, "svg");
347
- return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
348
- }, de = function() {
349
- const e = R.createElementNS(F, "line");
350
- return e.setAttribute("stroke", "#bbb"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e;
351
- }, We = function(e, t, n) {
352
- const o = {
353
- stroke: "rgb(235, 95, 82)",
354
- fill: "none",
355
- "stroke-linecap": "cap",
356
- "stroke-width": "2"
357
- }, s = R.createElementNS(F, "g");
358
- return [e, t, n].forEach((i, r) => {
359
- const l = R.createElementNS(F, "path"), c = {
360
- d: i,
361
- ...o
362
- };
363
- x(l, c), r === 0 && l.setAttribute("stroke-dasharray", "8,2"), s.appendChild(l);
364
- }), s;
365
- }, Ce = function(e, t, n) {
366
- if (!t)
327
+ }, O = function(t) {
328
+ const e = H.createElementNS(D, "svg");
329
+ return e.setAttribute("class", t), e.setAttribute("overflow", "visible"), e;
330
+ }, ot = function() {
331
+ const t = H.createElementNS(D, "line");
332
+ return t.setAttribute("stroke", "#bbb"), t.setAttribute("fill", "none"), t.setAttribute("stroke-width", "2"), t;
333
+ }, Nt = function(t, e, n) {
334
+ const o = H.createElementNS(D, "g");
335
+ return [
336
+ {
337
+ name: "line",
338
+ d: t
339
+ },
340
+ {
341
+ name: "arrow1",
342
+ d: e
343
+ },
344
+ {
345
+ name: "arrow2",
346
+ d: n
347
+ }
348
+ ].forEach((i, r) => {
349
+ const c = i.d, a = H.createElementNS(D, "path");
350
+ x(a, {
351
+ d: c,
352
+ stroke: "rgb(235, 95, 82)",
353
+ fill: "none",
354
+ "stroke-linecap": "cap",
355
+ "stroke-width": "2"
356
+ }), r === 0 && a.setAttribute("stroke-dasharray", "8,2");
357
+ const l = H.createElementNS(D, "path");
358
+ x(l, {
359
+ d: c,
360
+ stroke: "transparent",
361
+ fill: "none",
362
+ "stroke-width": "15"
363
+ }), o.appendChild(l), o.appendChild(a), o[i.name] = a;
364
+ }), o;
365
+ }, ut = function(t, e, n) {
366
+ if (!e)
367
367
  return;
368
- const o = R.createElement("div");
369
- e.nodes.appendChild(o);
370
- const s = t.innerHTML;
368
+ const o = H.createElement("div");
369
+ t.nodes.appendChild(o);
370
+ const s = e.innerHTML;
371
371
  o.id = "input-box", o.textContent = s, o.contentEditable = "plaintext-only", o.spellcheck = !1;
372
- const i = t.getBBox();
372
+ const i = e.getBBox();
373
373
  o.style.cssText = `
374
374
  min-width:${Math.max(88, i.width)}px;
375
375
  position:absolute;
@@ -377,1048 +377,589 @@ const qe = function(e) {
377
377
  top:${i.y}px;
378
378
  padding: 2px 4px;
379
379
  margin: -2px -4px;
380
- `, o.focus(), Ee(o), o.addEventListener("keydown", (r) => {
380
+ `, o.focus(), dt(o), o.addEventListener("keydown", (r) => {
381
381
  r.stopPropagation();
382
- const l = r.key;
383
- if (l === "Enter" || l === "Tab") {
382
+ const c = r.key;
383
+ if (c === "Enter" || c === "Tab") {
384
384
  if (r.shiftKey)
385
385
  return;
386
- r.preventDefault(), o.blur(), e.map.focus();
386
+ r.preventDefault(), o.blur(), t.map.focus();
387
387
  }
388
388
  }), o.addEventListener("blur", () => {
389
- o && n(o);
389
+ var c;
390
+ if (!o)
391
+ return;
392
+ const r = ((c = o.textContent) == null ? void 0 : c.trim()) || "";
393
+ r === "" ? n.label = s : n.label = r, o.remove(), r !== s && (e.innerHTML = n.label, t.linkDiv(), "parent" in n ? t.bus.fire("operation", {
394
+ name: "finishEditSummary",
395
+ obj: n
396
+ }) : t.bus.fire("operation", {
397
+ name: "finishEditArrowLabel",
398
+ obj: n
399
+ }));
390
400
  });
391
- }, Fe = function(e) {
392
- const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight, l = this.map.querySelector("me-nodes").offsetWidth;
393
- this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.alignment === "root" ? this.nodes.style.left = `${1e4 - o - s / 2}px` : this.nodes.style.left = `${1e4 - l / 2}px`;
394
- const c = this.map.querySelectorAll("me-main > me-wrapper");
401
+ }, kt = function(t) {
402
+ const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, s = e.offsetWidth, i = e.offsetHeight, c = this.map.querySelector("me-nodes").offsetWidth;
403
+ this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.alignment === "root" ? this.nodes.style.left = `${1e4 - o - s / 2}px` : this.nodes.style.left = `${1e4 - c / 2}px`;
404
+ const a = this.map.querySelectorAll("me-main > me-wrapper");
395
405
  this.lines.innerHTML = "";
396
- for (let d = 0; d < c.length; d++) {
397
- const a = c[d], u = a.querySelector("me-tpc"), { offsetLeft: h, offsetTop: f } = H(this.nodes, u), m = u.offsetWidth, g = u.offsetHeight, p = a.parentNode.className, v = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: f, cL: h, cW: m, cH: g, direction: p, containerHeight: this.nodes.offsetHeight }), E = this.theme.palette, y = u.nodeObj.branchColor || E[d % E.length];
398
- u.style.borderColor = y, this.lines.appendChild(Se(v, y, "3"));
399
- const _ = a.children[0].children[1];
400
- if (_ && (_.style.top = (_.parentNode.offsetHeight - _.offsetHeight) / 2 + "px", p === T.LHS ? _.style.left = "-10px" : _.style.right = "-10px"), e && e !== a)
406
+ for (let f = 0; f < a.length; f++) {
407
+ const l = a[f], h = l.querySelector("me-tpc"), { offsetLeft: d, offsetTop: p } = N(this.nodes, h), u = h.offsetWidth, m = h.offsetHeight, g = l.parentNode.className, y = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: p, cL: d, cW: u, cH: m, direction: g, containerHeight: this.nodes.offsetHeight }), C = this.theme.palette, v = h.nodeObj.branchColor || C[f % C.length];
408
+ h.style.borderColor = v, this.lines.appendChild(ft(y, v, "3"));
409
+ const w = l.children[0].children[1];
410
+ if (w && (w.style.top = (w.parentNode.offsetHeight - w.offsetHeight) / 2 + "px", g === $.LHS ? w.style.left = "-10px" : w.style.right = "-10px"), t && t !== l)
401
411
  continue;
402
- const w = W("subLines"), S = a.lastChild;
403
- S.tagName === "svg" && S.remove(), a.appendChild(w), Le(this, w, y, a, p, !0);
412
+ const b = O("subLines"), E = l.lastChild;
413
+ E.tagName === "svg" && E.remove(), l.appendChild(b), pt(this, b, v, l, g, !0);
404
414
  }
405
415
  this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
406
- }, Le = function(e, t, n, o, s, i) {
407
- const r = o.firstChild, l = o.children[1].children;
408
- if (l.length === 0)
416
+ }, pt = function(t, e, n, o, s, i) {
417
+ const r = o.firstChild, c = o.children[1].children;
418
+ if (c.length === 0)
409
419
  return;
410
- const c = r.offsetTop, d = r.offsetLeft, a = r.offsetWidth, u = r.offsetHeight;
411
- for (let h = 0; h < l.length; h++) {
412
- const f = l[h], m = f.firstChild, g = m.offsetTop, p = m.offsetLeft, v = m.offsetWidth, E = m.offsetHeight, y = m.firstChild.nodeObj.branchColor || n, _ = e.generateSubBranch({ pT: c, pL: d, pW: a, pH: u, cT: g, cL: p, cW: v, cH: E, direction: s, isFirst: i });
413
- t.appendChild(Se(_, y, "2"));
414
- const w = m.children[1];
415
- if (w) {
416
- if (w.style.bottom = -(w.offsetHeight / 2) + "px", s === T.LHS ? w.style.left = "10px" : s === T.RHS && (w.style.right = "10px"), !w.expanded)
420
+ const a = r.offsetTop, f = r.offsetLeft, l = r.offsetWidth, h = r.offsetHeight;
421
+ for (let d = 0; d < c.length; d++) {
422
+ const p = c[d], u = p.firstChild, m = u.offsetTop, g = u.offsetLeft, y = u.offsetWidth, C = u.offsetHeight, v = u.firstChild.nodeObj.branchColor || n, w = t.generateSubBranch({ pT: a, pL: f, pW: l, pH: h, cT: m, cL: g, cW: y, cH: C, direction: s, isFirst: i });
423
+ e.appendChild(ft(w, v, "2"));
424
+ const b = u.children[1];
425
+ if (b) {
426
+ if (b.style.bottom = -(b.offsetHeight / 2) + "px", s === $.LHS ? b.style.left = "10px" : s === $.RHS && (b.style.right = "10px"), !b.expanded)
417
427
  continue;
418
428
  } else
419
429
  continue;
420
- Le(e, t, y, f, s);
430
+ pt(t, e, v, p, s);
421
431
  }
422
432
  };
423
- const B = (e, t) => {
433
+ const k = (t, e) => {
424
434
  const n = document.createElement("span");
425
- return n.id = e, n.innerHTML = `<svg class="icon" aria-hidden="true">
426
- <use xlink:href="#icon-${t}"></use>
435
+ return n.id = t, n.innerHTML = `<svg class="icon" aria-hidden="true">
436
+ <use xlink:href="#icon-${e}"></use>
427
437
  </svg>`, n;
428
438
  };
429
- function Ie(e) {
430
- const t = document.createElement("div"), n = B("fullscreen", "full"), o = B("toCenter", "living"), s = B("zoomout", "move"), i = B("zoomin", "add"), r = document.createElement("span");
431
- return r.innerText = "100%", t.appendChild(n), t.appendChild(o), t.appendChild(s), t.appendChild(i), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
432
- e.mindElixirBox.requestFullscreen();
439
+ function Ht(t) {
440
+ const e = document.createElement("div"), n = k("fullscreen", "full"), o = k("toCenter", "living"), s = k("zoomout", "move"), i = k("zoomin", "add"), r = document.createElement("span");
441
+ return r.innerText = "100%", e.appendChild(n), e.appendChild(o), e.appendChild(s), e.appendChild(i), e.className = "mind-elixir-toolbar rb", n.onclick = () => {
442
+ t.mindElixirBox.requestFullscreen();
433
443
  }, o.onclick = () => {
434
- e.toCenter();
444
+ t.toCenter();
435
445
  }, s.onclick = () => {
436
- e.scaleVal < 0.6 || e.scale(e.scaleVal - 0.2);
446
+ t.scaleVal < 0.6 || t.scale(t.scaleVal - 0.2);
437
447
  }, i.onclick = () => {
438
- e.scaleVal > 1.6 || e.scale(e.scaleVal + 0.2);
439
- }, t;
448
+ t.scaleVal > 1.6 || t.scale(t.scaleVal + 0.2);
449
+ }, e;
440
450
  }
441
- function Xe(e) {
442
- const t = document.createElement("div"), n = B("tbltl", "left"), o = B("tbltr", "right"), s = B("tblts", "side");
443
- return t.appendChild(n), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
444
- e.initLeft();
451
+ function At(t) {
452
+ const e = document.createElement("div"), n = k("tbltl", "left"), o = k("tbltr", "right"), s = k("tblts", "side");
453
+ return e.appendChild(n), e.appendChild(o), e.appendChild(s), e.className = "mind-elixir-toolbar lt", n.onclick = () => {
454
+ t.initLeft();
445
455
  }, o.onclick = () => {
446
- e.initRight();
456
+ t.initRight();
447
457
  }, s.onclick = () => {
448
- e.initSide();
449
- }, t;
450
- }
451
- function Ye(e) {
452
- e.container.append(Ie(e)), e.container.append(Xe(e));
453
- }
454
- /*! @viselect/vanilla v3.5.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
455
- var Ge = Object.defineProperty, Ke = (e, t, n) => t in e ? Ge(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, b = (e, t, n) => (Ke(e, typeof t != "symbol" ? t + "" : t, n), n);
456
- class Je {
457
- constructor() {
458
- b(this, "_listeners", /* @__PURE__ */ new Map()), b(this, "on", this.addEventListener), b(this, "off", this.removeEventListener), b(this, "emit", this.dispatchEvent);
459
- }
460
- addEventListener(t, n) {
461
- const o = this._listeners.get(t) ?? /* @__PURE__ */ new Set();
462
- return this._listeners.set(t, o), o.add(n), this;
463
- }
464
- removeEventListener(t, n) {
465
- var o;
466
- return (o = this._listeners.get(t)) == null || o.delete(n), this;
467
- }
468
- dispatchEvent(t, ...n) {
469
- let o = !0;
470
- for (const s of this._listeners.get(t) ?? [])
471
- o = s(...n) !== !1 && o;
472
- return o;
473
- }
474
- unbindAllListeners() {
475
- this._listeners.clear();
476
- }
458
+ t.initSide();
459
+ }, e;
477
460
  }
478
- const ue = (e, t = "px") => typeof e == "number" ? e + t : e;
479
- function A({ style: e }, t, n) {
480
- if (typeof t == "object")
481
- for (const [o, s] of Object.entries(t))
482
- s !== void 0 && (e[o] = ue(s));
483
- else
484
- n !== void 0 && (e[t] = ue(n));
485
- }
486
- const Me = (e) => (t, n, o, s = {}) => {
487
- t instanceof HTMLCollection || t instanceof NodeList ? t = Array.from(t) : Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
488
- for (const i of t)
489
- if (i)
490
- for (const r of n)
491
- i[e](r, o, { capture: !1, ...s });
492
- return [t, n, o, s];
493
- }, P = Me("addEventListener"), N = Me("removeEventListener"), Y = (e) => {
494
- var t;
495
- const { clientX: n, clientY: o, target: s } = ((t = e.touches) == null ? void 0 : t[0]) ?? e;
496
- return { x: n, y: o, target: s };
497
- };
498
- function fe(e, t, n = "touch") {
499
- switch (n) {
500
- case "center": {
501
- const o = t.left + t.width / 2, s = t.top + t.height / 2;
502
- return o >= e.left && o <= e.right && s >= e.top && s <= e.bottom;
503
- }
504
- case "cover":
505
- return t.left >= e.left && t.top >= e.top && t.right <= e.right && t.bottom <= e.bottom;
506
- case "touch":
507
- return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
508
- }
509
- }
510
- function z(e, t = document) {
511
- const n = Array.isArray(e) ? e : [e];
512
- let o = [];
513
- for (let s = 0, i = n.length; s < i; s++) {
514
- const r = n[s];
515
- typeof r == "string" ? o = o.concat(Array.from(t.querySelectorAll(r))) : r instanceof Element && o.push(r);
516
- }
517
- return o;
518
- }
519
- const Ue = () => matchMedia("(hover: none), (pointer: coarse)").matches, Qe = () => "safari" in window, Ze = (e) => {
520
- let t, n = -1, o = !1;
521
- return {
522
- next(...s) {
523
- t = s, o || (o = !0, n = requestAnimationFrame(() => {
524
- e(...t), o = !1;
525
- }));
526
- },
527
- cancel() {
528
- cancelAnimationFrame(n), o = !1;
529
- }
530
- };
531
- };
532
- function et(e, t) {
533
- for (const n of t) {
534
- if (typeof n == "number")
535
- return e.button === n;
536
- if (typeof n == "object") {
537
- const o = n.button === e.button, s = n.modifiers.every((i) => {
538
- switch (i) {
539
- case "alt":
540
- return e.altKey;
541
- case "ctrl":
542
- return e.ctrlKey || e.metaKey;
543
- case "shift":
544
- return e.shiftKey;
545
- }
546
- });
547
- return o && s;
548
- }
549
- }
550
- return !1;
461
+ function Dt(t) {
462
+ t.container.append(Ht(t)), t.container.append(At(t));
551
463
  }
552
- const { abs: D, max: pe, min: me, ceil: ge } = Math;
553
- class tt extends Je {
554
- constructor(t) {
555
- var n, o, s, i, r;
556
- super(), b(this, "_options"), b(this, "_selection", {
557
- stored: [],
558
- selected: [],
559
- touched: [],
560
- changed: {
561
- added: [],
562
- // Added elements since last selection
563
- removed: []
564
- // Removed elements since last selection
565
- }
566
- }), b(this, "_area"), b(this, "_clippingElement"), b(this, "_targetElement"), b(this, "_targetRect"), b(this, "_selectables", []), b(this, "_latestElement"), b(this, "_areaRect", new DOMRect()), b(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 }), b(this, "_singleClick", !0), b(this, "_frame"), b(this, "_scrollAvailable", !0), b(this, "_scrollingActive", !1), b(this, "_scrollSpeed", { x: 0, y: 0 }), b(this, "_scrollDelta", { x: 0, y: 0 }), b(this, "disable", this._bindStartEvents.bind(this, !1)), b(this, "enable", this._bindStartEvents), this._options = {
567
- selectionAreaClass: "selection-area",
568
- selectionContainerClass: void 0,
569
- selectables: [],
570
- document: window.document,
571
- startAreas: ["html"],
572
- boundaries: ["html"],
573
- container: "body",
574
- ...t,
575
- behaviour: {
576
- overlap: "invert",
577
- intersect: "touch",
578
- triggers: [0],
579
- ...t.behaviour,
580
- startThreshold: (n = t.behaviour) != null && n.startThreshold ? typeof t.behaviour.startThreshold == "number" ? t.behaviour.startThreshold : { x: 10, y: 10, ...t.behaviour.startThreshold } : { x: 10, y: 10 },
581
- scrolling: {
582
- speedDivider: 10,
583
- manualSpeed: 750,
584
- ...(o = t.behaviour) == null ? void 0 : o.scrolling,
585
- startScrollMargins: {
586
- x: 0,
587
- y: 0,
588
- ...(i = (s = t.behaviour) == null ? void 0 : s.scrolling) == null ? void 0 : i.startScrollMargins
589
- }
590
- }
591
- },
592
- features: {
593
- range: !0,
594
- touch: !0,
595
- ...t.features,
596
- singleTap: {
597
- allow: !0,
598
- intersect: "native",
599
- ...(r = t.features) == null ? void 0 : r.singleTap
600
- }
601
- }
602
- };
603
- for (const a of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
604
- typeof this[a] == "function" && (this[a] = this[a].bind(this));
605
- const { document: l, selectionAreaClass: c, selectionContainerClass: d } = this._options;
606
- this._area = l.createElement("div"), this._clippingElement = l.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(c), d && this._clippingElement.classList.add(d), A(this._area, {
607
- willChange: "top, left, bottom, right, width, height",
608
- top: 0,
609
- left: 0,
610
- position: "fixed"
611
- }), A(this._clippingElement, {
612
- overflow: "hidden",
613
- position: "fixed",
614
- transform: "translate3d(0, 0, 0)",
615
- // https://stackoverflow.com/a/38268846
616
- pointerEvents: "none",
617
- zIndex: "1"
618
- }), this._frame = Ze((a) => {
619
- this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", a), this._redrawSelectionArea();
620
- }), this.enable();
621
- }
622
- _bindStartEvents(t = !0) {
623
- const { document: n, features: o } = this._options, s = t ? P : N;
624
- s(n, "mousedown", this._onTapStart), o.touch && s(n, "touchstart", this._onTapStart, {
625
- passive: !1
626
- });
627
- }
628
- _onTapStart(t, n = !1) {
629
- const { x: o, y: s, target: i } = Y(t), { _options: r } = this, { document: l } = this._options, c = i.getBoundingClientRect();
630
- if (t instanceof MouseEvent && !et(t, r.behaviour.triggers))
631
- return;
632
- const d = z(r.startAreas, r.document), a = z(r.boundaries, r.document);
633
- this._targetElement = a.find(
634
- (f) => fe(f.getBoundingClientRect(), c)
635
- );
636
- const u = t.composedPath();
637
- if (!this._targetElement || !d.find((f) => u.includes(f)) || !a.find((f) => u.includes(f)) || !n && this._emitEvent("beforestart", t) === !1)
638
- return;
639
- this._areaLocation = { x1: o, y1: s, x2: 0, y2: 0 };
640
- const h = l.scrollingElement ?? l.body;
641
- this._scrollDelta = { x: h.scrollLeft, y: h.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), P(l, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), P(l, ["mouseup", "touchcancel", "touchend"], this._onTapStop), P(l, "scroll", this._onScroll);
642
- }
643
- _onSingleTap(t) {
644
- const { singleTap: { intersect: n }, range: o } = this._options.features, s = Y(t);
645
- let i;
646
- if (n === "native")
647
- i = s.target;
648
- else if (n === "touch") {
649
- this.resolveSelectables();
650
- const { x: l, y: c } = s;
651
- i = this._selectables.find((d) => {
652
- const { right: a, left: u, top: h, bottom: f } = d.getBoundingClientRect();
653
- return l < a && l > u && c < f && c > h;
654
- });
655
- }
656
- if (!i)
657
- return;
658
- for (this.resolveSelectables(); !this._selectables.includes(i); ) {
659
- if (!i.parentElement)
660
- return;
661
- i = i.parentElement;
662
- }
663
- const { stored: r } = this._selection;
664
- if (this._emitEvent("start", t), t.shiftKey && o && this._latestElement) {
665
- const l = this._latestElement, [c, d] = l.compareDocumentPosition(i) & 4 ? [i, l] : [l, i], a = [...this._selectables.filter(
666
- (u) => u.compareDocumentPosition(c) & 4 && u.compareDocumentPosition(d) & 2
667
- ), c, d];
668
- this.select(a), this._latestElement = l;
669
- } else
670
- r.includes(i) && (r.length === 1 || t.ctrlKey || r.every((l) => this._selection.stored.includes(l))) ? this.deselect(i) : (this.select(i), this._latestElement = i);
671
- }
672
- _delayedTapMove(t) {
673
- const { container: n, document: o, behaviour: { startThreshold: s } } = this._options, { x1: i, y1: r } = this._areaLocation, { x: l, y: c } = Y(t);
674
- if (
675
- // Single number for both coordinates
676
- typeof s == "number" && D(l + c - (i + r)) >= s || // Different x and y threshold
677
- typeof s == "object" && D(l - i) >= s.x || D(c - r) >= s.y
678
- ) {
679
- if (N(o, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
680
- N(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
681
- return;
682
- }
683
- P(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), A(this._area, "display", "block"), z(n, o)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && (P(this._targetElement, "wheel", this._manualScroll, { passive: !1 }), this._selectables = this._selectables.filter((d) => this._targetElement.contains(d))), this._setupSelectionArea(), this._emitEvent("start", t), this._onTapMove(t);
684
- }
685
- this._handleMoveEvent(t);
686
- }
687
- _setupSelectionArea() {
688
- const { _clippingElement: t, _targetElement: n, _area: o } = this, s = this._targetRect = n.getBoundingClientRect();
689
- this._scrollAvailable ? (A(t, {
690
- top: s.top,
691
- left: s.left,
692
- width: s.width,
693
- height: s.height
694
- }), A(o, {
695
- marginTop: -s.top,
696
- marginLeft: -s.left
697
- })) : (A(t, {
698
- top: 0,
699
- left: 0,
700
- width: "100%",
701
- height: "100%"
702
- }), A(o, {
703
- marginTop: 0,
704
- marginLeft: 0
705
- }));
706
- }
707
- _onTapMove(t) {
708
- const { x: n, y: o } = Y(t), { _scrollSpeed: s, _areaLocation: i, _options: r, _frame: l } = this, { speedDivider: c } = r.behaviour.scrolling, d = this._targetElement;
709
- if (i.x2 = n, i.y2 = o, this._scrollAvailable && !this._scrollingActive && (s.y || s.x)) {
710
- this._scrollingActive = !0;
711
- const a = () => {
712
- if (!s.x && !s.y) {
713
- this._scrollingActive = !1;
714
- return;
715
- }
716
- const { scrollTop: u, scrollLeft: h } = d;
717
- s.y && (d.scrollTop += ge(s.y / c), i.y1 -= d.scrollTop - u), s.x && (d.scrollLeft += ge(s.x / c), i.x1 -= d.scrollLeft - h), l.next(t), requestAnimationFrame(a);
718
- };
719
- requestAnimationFrame(a);
720
- } else
721
- l.next(t);
722
- this._handleMoveEvent(t);
723
- }
724
- _handleMoveEvent(t) {
725
- const { features: n } = this._options;
726
- (n.touch && Ue() || this._scrollAvailable && Qe()) && t.preventDefault();
727
- }
728
- _onScroll() {
729
- const { _scrollDelta: t, _options: { document: n } } = this, { scrollTop: o, scrollLeft: s } = n.scrollingElement ?? n.body;
730
- this._areaLocation.x1 += t.x - s, this._areaLocation.y1 += t.y - o, t.x = s, t.y = o, this._setupSelectionArea(), this._frame.next(null);
731
- }
732
- _manualScroll(t) {
733
- const { manualSpeed: n } = this._options.behaviour.scrolling, o = t.deltaY ? t.deltaY > 0 ? 1 : -1 : 0, s = t.deltaX ? t.deltaX > 0 ? 1 : -1 : 0;
734
- this._scrollSpeed.y += o * n, this._scrollSpeed.x += s * n, this._onTapMove(t), t.preventDefault();
735
- }
736
- _recalculateSelectionAreaRect() {
737
- const { _scrollSpeed: t, _areaLocation: n, _areaRect: o, _targetElement: s, _options: i } = this, { scrollTop: r, scrollHeight: l, clientHeight: c, scrollLeft: d, scrollWidth: a, clientWidth: u } = s, h = this._targetRect, { x1: f, y1: m } = n;
738
- let { x2: g, y2: p } = n;
739
- const { behaviour: { scrolling: { startScrollMargins: v } } } = i;
740
- g < h.left + v.x ? (t.x = d ? -D(h.left - g + v.x) : 0, g = g < h.left ? h.left : g) : g > h.right - v.x ? (t.x = a - d - u ? D(h.left + h.width - g - v.x) : 0, g = g > h.right ? h.right : g) : t.x = 0, p < h.top + v.y ? (t.y = r ? -D(h.top - p + v.y) : 0, p = p < h.top ? h.top : p) : p > h.bottom - v.y ? (t.y = l - r - c ? D(h.top + h.height - p - v.y) : 0, p = p > h.bottom ? h.bottom : p) : t.y = 0;
741
- const E = me(f, g), y = me(m, p), _ = pe(f, g), w = pe(m, p);
742
- o.x = E, o.y = y, o.width = _ - E, o.height = w - y;
743
- }
744
- _redrawSelectionArea() {
745
- const { x: t, y: n, width: o, height: s } = this._areaRect, { style: i } = this._area;
746
- i.left = `${t}px`, i.top = `${n}px`, i.width = `${o}px`, i.height = `${s}px`;
747
- }
748
- _onTapStop(t, n) {
749
- var o;
750
- const { document: s, features: i } = this._options, { _singleClick: r } = this;
751
- N(s, ["mousemove", "touchmove"], this._delayedTapMove), N(s, ["touchmove", "mousemove"], this._onTapMove), N(s, ["mouseup", "touchcancel", "touchend"], this._onTapStop), N(s, "scroll", this._onScroll), this._keepSelection(), t && r && i.singleTap.allow ? this._onSingleTap(t) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, N(this._targetElement, "wheel", this._manualScroll, { passive: !0 }), this._clippingElement.remove(), (o = this._frame) == null || o.cancel(), A(this._area, "display", "none");
752
- }
753
- _updateElementSelection() {
754
- const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: r, touched: l } = o, { intersect: c, overlap: d } = n.behaviour, a = d === "invert", u = [], h = [], f = [];
755
- for (let g = 0; g < t.length; g++) {
756
- const p = t[g];
757
- if (fe(s, p.getBoundingClientRect(), c)) {
758
- if (r.includes(p))
759
- i.includes(p) && !l.includes(p) && l.push(p);
760
- else if (a && i.includes(p)) {
761
- f.push(p);
762
- continue;
763
- } else
764
- h.push(p);
765
- u.push(p);
766
- }
767
- }
768
- a && h.push(...i.filter((g) => !r.includes(g)));
769
- const m = d === "keep";
770
- for (let g = 0; g < r.length; g++) {
771
- const p = r[g];
772
- !u.includes(p) && !// Check if user wants to keep previously selected elements, e.g.
773
- // not make them part of the current selection as soon as they're touched.
774
- (m && i.includes(p)) && f.push(p);
775
- }
776
- o.selected = u, o.changed = { added: h, removed: f }, this._latestElement = void 0;
777
- }
778
- _emitEvent(t, n) {
779
- return this.emit(t, {
780
- event: n,
781
- store: this._selection,
782
- selection: this
783
- });
784
- }
785
- _keepSelection() {
786
- const { _options: t, _selection: n } = this, { selected: o, changed: s, touched: i, stored: r } = n, l = o.filter((c) => !r.includes(c));
787
- switch (t.behaviour.overlap) {
788
- case "drop": {
789
- n.stored = [
790
- ...l,
791
- ...r.filter((c) => !i.includes(c))
792
- // Elements not touched
793
- ];
794
- break;
795
- }
796
- case "invert": {
797
- n.stored = [
798
- ...l,
799
- ...r.filter((c) => !s.removed.includes(c))
800
- // Elements not removed from selection
801
- ];
802
- break;
803
- }
804
- case "keep": {
805
- n.stored = [
806
- ...r,
807
- ...o.filter((c) => !r.includes(c))
808
- // Newly added
809
- ];
810
- break;
811
- }
812
- }
813
- }
814
- /**
815
- * Manually triggers the start of a selection
816
- * @param evt A MouseEvent / TouchEvent -like object
817
- * @param silent If beforestart should be fired,
818
- */
819
- trigger(t, n = !0) {
820
- this._onTapStart(t, n);
821
- }
822
- /**
823
- * Can be used if during a selection elements have been added.
824
- * Will update everything which can be selected.
825
- */
826
- resolveSelectables() {
827
- this._selectables = z(this._options.selectables, this._options.document);
828
- }
829
- /**
830
- * Same as deselect, but for all elements currently selected.
831
- * @param includeStored If the store should also get cleared
832
- * @param quiet If move / stop events should be fired
833
- */
834
- clearSelection(t = !0, n = !1) {
835
- const { selected: o, stored: s, changed: i } = this._selection;
836
- i.added = [], i.removed.push(
837
- ...o,
838
- ...t ? s : []
839
- ), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = {
840
- stored: t ? [] : s,
841
- selected: [],
842
- touched: [],
843
- changed: { added: [], removed: [] }
844
- };
845
- }
846
- /**
847
- * @returns {Array} Selected elements
848
- */
849
- getSelection() {
850
- return this._selection.stored;
851
- }
852
- /**
853
- * @returns {HTMLElement} The selection area element
854
- */
855
- getSelectionArea() {
856
- return this._area;
857
- }
858
- /**
859
- * Cancel the current selection process.
860
- * @param keepEvent {boolean} true to fire a stop event after cancel.
861
- */
862
- cancel(t = !1) {
863
- this._onTapStop(null, !t);
864
- }
865
- /**
866
- * Unbinds all events and removes the area-element.
867
- */
868
- destroy() {
869
- this.cancel(), this.disable(), this._clippingElement.remove(), super.unbindAllListeners();
870
- }
871
- /**
872
- * Adds elements to the selection
873
- * @param query - CSS Query, can be an array of queries
874
- * @param quiet - If this should not trigger the move event
875
- */
876
- select(t, n = !1) {
877
- const { changed: o, selected: s, stored: i } = this._selection, r = z(t, this._options.document).filter(
878
- (l) => !s.includes(l) && !i.includes(l)
879
- );
880
- return i.push(...r), s.push(...r), o.added.push(...r), o.removed = [], this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)), r;
881
- }
882
- /**
883
- * Removes a particular element from the selection.
884
- * @param query - CSS Query, can be an array of queries
885
- * @param quiet - If this should not trigger the move event
886
- */
887
- deselect(t, n = !1) {
888
- const { selected: o, stored: s, changed: i } = this._selection, r = z(t, this._options.document).filter(
889
- (l) => o.includes(l) || s.includes(l)
890
- );
891
- r.length && (this._selection.stored = s.filter((l) => !r.includes(l)), this._selection.selected = o.filter((l) => !r.includes(l)), this._selection.changed.added = [], this._selection.changed.removed.push(
892
- ...r.filter((l) => !i.removed.includes(l))
893
- ), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)));
894
- }
895
- }
896
- b(tt, "version", "3.5.1");
897
- const nt = function(e, t = !0) {
898
- this.theme = e;
464
+ const Bt = function(t, e = !0) {
465
+ this.theme = t;
899
466
  const n = this.theme.cssVar, o = Object.keys(n);
900
467
  this.container.style.cssText = "";
901
468
  for (let s = 0; s < o.length; s++) {
902
469
  const i = o[s];
903
470
  this.container.style.setProperty(i, n[i]);
904
471
  }
905
- e.cssVar["--gap"] || this.container.style.setProperty("--gap", "30px"), t && this.refresh();
906
- }, ot = function(e) {
907
- const n = e.parentElement.parentElement.lastElementChild;
472
+ t.cssVar["--gap"] || this.container.style.setProperty("--gap", "30px"), e && this.refresh();
473
+ }, Pt = function(t) {
474
+ const n = t.parentElement.parentElement.lastElementChild;
908
475
  (n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
909
476
  };
910
- function Te(e) {
477
+ function zt(t) {
911
478
  return {
912
- nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
913
- arrows: e.arrows,
914
- summaries: e.summaries,
915
- direction: e.direction,
916
- theme: e.theme
479
+ nodeData: t.isFocusMode ? t.nodeDataBackup : t.nodeData,
480
+ arrows: t.arrows,
481
+ summaries: t.summaries,
482
+ direction: t.direction,
483
+ theme: t.theme
917
484
  };
918
485
  }
919
- const st = function(e, t, n) {
920
- if (e) {
921
- if (this.clearSelection(), typeof e == "string") {
922
- const o = M(e);
923
- return o ? this.selectNode(o) : void 0;
924
- }
925
- e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n);
926
- }
927
- }, it = function() {
928
- this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode");
929
- }, rt = function(e) {
930
- this.clearSelection();
931
- for (const t of e)
932
- t.className = "selected";
933
- this.currentNodes = e, this.bus.fire(
934
- "selectNodes",
935
- e.map((t) => t.nodeObj)
936
- );
937
- }, lt = function() {
938
- if (this.currentNodes)
939
- for (const e of this.currentNodes)
940
- e.classList.remove("selected");
941
- this.currentNodes = null, this.bus.fire("unselectNodes");
942
- }, ct = function() {
943
- this.unselectNode(), this.unselectNodes(), this.unselectSummary(), this.unselectArrow();
944
- }, at = function() {
945
- const e = Te(this);
946
- return JSON.stringify(e, (t, n) => {
947
- if (!(t === "parent" && typeof n != "string"))
486
+ const Ot = function(t, e, n) {
487
+ this.clearSelection(), t.scrollIntoView({ block: "nearest", inline: "nearest" }), this.selection.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
488
+ }, Vt = function(t) {
489
+ this.selection.select(t);
490
+ }, jt = function(t) {
491
+ this.selection.deselect(t);
492
+ }, qt = function() {
493
+ this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
494
+ }, _t = function() {
495
+ const t = zt(this);
496
+ return JSON.stringify(t, (e, n) => {
497
+ if (!(e === "parent" && typeof n != "string"))
948
498
  return n;
949
499
  });
950
- }, ht = function() {
500
+ }, Ft = function() {
951
501
  return JSON.parse(this.getDataString());
952
- }, dt = function() {
953
- const e = Te(this).nodeData;
954
- let t = "# " + e.topic + `
955
-
956
- `;
957
- function n(o, s) {
958
- for (let i = 0; i < o.length; i++)
959
- s <= 6 ? t += "".padStart(s, "#") + " " + o[i].topic + `
960
-
961
- ` : t += "".padStart(s - 7, " ") + "- " + o[i].topic + `
962
- `, o[i].children && n(o[i].children || [], s + 1);
963
- }
964
- return n(e.children || [], 2), t;
965
- }, ut = function() {
502
+ }, Rt = function() {
966
503
  this.editable = !0;
967
- }, ft = function() {
504
+ }, Wt = function() {
968
505
  this.editable = !1;
969
- }, pt = function(e) {
970
- this.scaleVal = e, this.map.style.transform = "scale(" + e + ")", this.bus.fire("scale", e);
971
- }, mt = function() {
972
- const e = this.nodes.offsetHeight / this.container.offsetHeight, t = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(e, t));
506
+ }, It = function(t, e = { x: 0, y: 0 }) {
507
+ const n = this.container.getBoundingClientRect(), o = n.width / 2 - 1e4, s = n.height / 2 - 1e4, i = this.scaleVal, r = this.map.style.transform, { x: c, y: a } = at(r), f = c - (e.x - n.left - n.width / 2), l = a - (e.y - n.top - n.height / 2), h = (o - f) * (1 - t / i), d = (s - l) * (1 - t / i);
508
+ this.map.style.transform = `translate(${c + h}px, ${a + d}px) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
509
+ }, Yt = function() {
510
+ const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
973
511
  this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
974
- }, gt = function() {
975
- this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
976
- }, vt = function(e) {
977
- e(this);
978
- }, yt = function(e) {
979
- e.nodeObj.parent && (this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = e.nodeObj, this.initRight(), this.toCenter());
980
- }, bt = function() {
512
+ }, Xt = function(t, e) {
513
+ const { map: n, scaleVal: o, container: s, bus: i } = this, r = n.style.transform, { x: c, y: a } = at(r), f = c + t, l = a + e, h = (1 - o) * 1e4, d = 0 - h, p = -2e4 + s.offsetWidth + h, u = -2e4 + s.offsetHeight + h, m = Math.min(d, Math.max(p, f)), g = Math.min(d, Math.max(u, l));
514
+ n.style.transform = `translate(${m}px, ${g}px) scale(${o})`, i.fire("move", { dx: t, dy: e });
515
+ }, Gt = function() {
516
+ const t = this.container.getBoundingClientRect(), e = t.width / 2 - 1e4, n = t.height / 2 - 1e4;
517
+ this.map.style.transform = `translate(${e}px, ${n}px) scale(${this.scaleVal})`;
518
+ }, Jt = function(t) {
519
+ t(this);
520
+ }, Ut = function(t) {
521
+ t.nodeObj.parent && (this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = t.nodeObj, this.initRight(), this.toCenter());
522
+ }, Kt = function() {
981
523
  this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
982
- }, xt = function() {
524
+ }, Qt = function() {
983
525
  this.direction = 0, this.refresh();
984
- }, wt = function() {
526
+ }, Zt = function() {
985
527
  this.direction = 1, this.refresh();
986
- }, _t = function() {
528
+ }, te = function() {
987
529
  this.direction = 2, this.refresh();
988
- }, Et = function(e) {
989
- this.locale = e, this.refresh();
990
- }, St = function(e, t) {
991
- const n = e.nodeObj;
992
- typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
993
- const o = e.parentNode, s = o.children[1];
994
- if (s.expanded = n.expanded, s.className = n.expanded ? "minus" : "", ot(e), n.expanded) {
995
- const c = this.createChildren(
996
- n.children.map((d) => this.createWrapper(d).grp)
530
+ }, ee = function(t) {
531
+ this.locale = t, this.refresh();
532
+ }, ne = function(t, e) {
533
+ const n = t.nodeObj;
534
+ typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
535
+ const o = t.parentNode, s = o.children[1];
536
+ if (s.expanded = n.expanded, s.className = n.expanded ? "minus" : "", Pt(t), n.expanded) {
537
+ const a = this.createChildren(
538
+ n.children.map((f) => this.createWrapper(f).grp)
997
539
  );
998
- o.parentNode.appendChild(c);
540
+ o.parentNode.appendChild(a);
999
541
  } else
1000
542
  o.parentNode.children[1].remove();
1001
- this.linkDiv(e.closest("me-main > me-wrapper"));
1002
- const i = e.getBoundingClientRect(), r = this.container.getBoundingClientRect();
1003
- (i.bottom > r.bottom || i.top < r.top || i.right > r.right || i.left < r.left) && e.scrollIntoView({ block: "center", inline: "center" }), this.bus.fire("expandNode", n);
1004
- }, Ct = function(e) {
1005
- e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || []), oe(this.nodeData), this.layout(), this.linkDiv();
1006
- }, Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
543
+ this.linkDiv(t.closest("me-main > me-wrapper"));
544
+ const i = t.getBoundingClientRect(), r = this.container.getBoundingClientRect();
545
+ (i.bottom > r.bottom || i.top < r.top || i.right > r.right || i.left < r.left) && t.scrollIntoView({ block: "center", inline: "center" }), this.bus.fire("expandNode", n);
546
+ }, oe = function(t) {
547
+ t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || []), J(this.nodeData), this.layout(), this.linkDiv();
548
+ }, se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1007
549
  __proto__: null,
1008
- cancelFocus: bt,
1009
- clearSelection: ct,
1010
- disableEdit: ft,
1011
- enableEdit: ut,
1012
- expandNode: St,
1013
- focusNode: yt,
1014
- getData: ht,
1015
- getDataMd: dt,
1016
- getDataString: at,
1017
- initLeft: xt,
1018
- initRight: wt,
1019
- initSide: _t,
1020
- install: vt,
1021
- refresh: Ct,
1022
- scale: pt,
1023
- scaleFit: mt,
1024
- selectNode: st,
1025
- selectNodes: rt,
1026
- setLocale: Et,
1027
- toCenter: gt,
1028
- unselectNode: it,
1029
- unselectNodes: lt
1030
- }, Symbol.toStringTag, { value: "Module" })), Mt = function(e) {
550
+ cancelFocus: Kt,
551
+ clearSelection: qt,
552
+ disableEdit: Wt,
553
+ enableEdit: Rt,
554
+ expandNode: ne,
555
+ focusNode: Ut,
556
+ getData: Ft,
557
+ getDataString: _t,
558
+ initLeft: Qt,
559
+ initRight: Zt,
560
+ initSide: te,
561
+ install: Jt,
562
+ move: Xt,
563
+ refresh: oe,
564
+ scale: It,
565
+ scaleFit: Yt,
566
+ selectNode: Ot,
567
+ selectNodes: Vt,
568
+ setLocale: ee,
569
+ toCenter: Gt,
570
+ unselectNodes: jt
571
+ }, Symbol.toStringTag, { value: "Module" })), ie = function(t) {
1031
572
  return {
1032
- dom: e,
573
+ dom: t,
1033
574
  moved: !1,
1034
575
  // diffrentiate click and move
1035
576
  mousedown: !1,
1036
- handleMouseMove(t) {
1037
- this.mousedown && (this.moved = !0, this.cb && this.cb(t.movementX, t.movementY));
577
+ handleMouseMove(e) {
578
+ this.mousedown && (this.moved = !0, this.cb && this.cb(e.movementX, e.movementY));
1038
579
  },
1039
- handleMouseDown(t) {
1040
- t.button === 0 && (this.mousedown = !0);
580
+ handleMouseDown(e) {
581
+ e.button === 0 && (this.mousedown = !0);
1041
582
  },
1042
- handleClear(t) {
583
+ handleClear(e) {
1043
584
  this.mousedown = !1;
1044
585
  },
1045
586
  cb: null,
1046
- init(t, n) {
1047
- this.cb = n, this.handleClear = this.handleClear.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this), t.addEventListener("mousemove", this.handleMouseMove), t.addEventListener("mouseleave", this.handleClear), t.addEventListener("mouseup", this.handleClear), this.dom.addEventListener("mousedown", this.handleMouseDown);
587
+ init(e, n) {
588
+ this.cb = n, this.handleClear = this.handleClear.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this), e.addEventListener("mousemove", this.handleMouseMove), e.addEventListener("mouseleave", this.handleClear), e.addEventListener("mouseup", this.handleClear), this.dom.addEventListener("mousedown", this.handleMouseDown);
1048
589
  },
1049
- destory(t) {
1050
- t.removeEventListener("mousemove", this.handleMouseMove), t.removeEventListener("mouseleave", this.handleClear), t.removeEventListener("mouseup", this.handleClear), this.dom.removeEventListener("mousedown", this.handleMouseDown);
590
+ destory(e) {
591
+ e.removeEventListener("mousemove", this.handleMouseMove), e.removeEventListener("mouseleave", this.handleClear), e.removeEventListener("mouseup", this.handleClear), this.dom.removeEventListener("mousedown", this.handleMouseDown);
1051
592
  },
1052
593
  clear() {
1053
594
  this.moved = !1, this.mousedown = !1;
1054
595
  }
1055
596
  };
1056
- }, ve = {
1057
- create: Mt
597
+ }, st = {
598
+ create: ie
1058
599
  };
1059
- function Z(e, t, n) {
1060
- const { offsetLeft: o, offsetTop: s } = H(e.nodes, t), i = t.offsetWidth, r = t.offsetHeight, l = o + i / 2, c = s + r / 2, d = l + n.x, a = c + n.y;
600
+ function Y(t, e, n) {
601
+ const { offsetLeft: o, offsetTop: s } = N(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, c = o + i / 2, a = s + r / 2, f = c + n.x, l = a + n.y;
1061
602
  return {
1062
603
  w: i,
1063
604
  h: r,
1064
- cx: l,
1065
- cy: c,
1066
- ctrlX: d,
1067
- ctrlY: a
605
+ cx: c,
606
+ cy: a,
607
+ ctrlX: f,
608
+ ctrlY: l
1068
609
  };
1069
610
  }
1070
- function O(e) {
1071
- let t, n;
1072
- const o = (e.cy - e.ctrlY) / (e.ctrlX - e.cx);
1073
- return o > e.h / e.w || o < -e.h / e.w ? e.cy - e.ctrlY < 0 ? (t = e.cx - e.h / 2 / o, n = e.cy + e.h / 2) : (t = e.cx + e.h / 2 / o, n = e.cy - e.h / 2) : e.cx - e.ctrlX < 0 ? (t = e.cx + e.w / 2, n = e.cy - e.w * o / 2) : (t = e.cx - e.w / 2, n = e.cy + e.w * o / 2), {
1074
- x: t,
611
+ function A(t) {
612
+ let e, n;
613
+ const o = (t.cy - t.ctrlY) / (t.ctrlX - t.cx);
614
+ return o > t.h / t.w || o < -t.h / t.w ? t.cy - t.ctrlY < 0 ? (e = t.cx - t.h / 2 / o, n = t.cy + t.h / 2) : (e = t.cx + t.h / 2 / o, n = t.cy - t.h / 2) : t.cx - t.ctrlX < 0 ? (e = t.cx + t.w / 2, n = t.cy - t.w * o / 2) : (e = t.cx - t.w / 2, n = t.cy + t.w * o / 2), {
615
+ x: e,
1075
616
  y: n
1076
617
  };
1077
618
  }
1078
- const Tt = function(e, t, n, o) {
619
+ const re = function(t, e, n, o) {
1079
620
  const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
1080
621
  return x(s, {
1081
622
  "text-anchor": "middle",
1082
- x: t + "",
623
+ x: e + "",
1083
624
  y: n + "",
1084
625
  fill: o || "#666"
1085
- }), s.dataset.type = "custom-link", s.innerHTML = e, s;
1086
- }, $e = function(e, t, n, o, s) {
1087
- if (!t || !n)
626
+ }), s.dataset.type = "custom-link", s.innerHTML = t, s;
627
+ }, U = function(t, e, n, o, s) {
628
+ if (!e || !n)
1088
629
  return;
1089
630
  performance.now();
1090
- const i = Z(e, t, o.delta1), r = Z(e, n, o.delta2), { x: l, y: c } = O(i), { ctrlX: d, ctrlY: a } = i, { ctrlX: u, ctrlY: h } = r, { x: f, y: m } = O(r), g = U(u, h, f, m), p = `M ${g.x1} ${g.y1} L ${f} ${m} L ${g.x2} ${g.y2}`;
1091
- let v = "";
631
+ const i = Y(t, e, o.delta1), r = Y(t, n, o.delta2), { x: c, y: a } = A(i), { ctrlX: f, ctrlY: l } = i, { ctrlX: h, ctrlY: d } = r, { x: p, y: u } = A(r), m = W(h, d, p, u);
632
+ if (!m)
633
+ return;
634
+ const g = `M ${m.x1} ${m.y1} L ${p} ${u} L ${m.x2} ${m.y2}`;
635
+ let y = "";
1092
636
  if (o.bidirectional) {
1093
- const S = U(d, a, l, c);
1094
- v = `M ${S.x1} ${S.y1} L ${l} ${c} L ${S.x2} ${S.y2}`;
637
+ const E = W(f, l, c, a);
638
+ if (!E)
639
+ return;
640
+ y = `M ${E.x1} ${E.y1} L ${c} ${a} L ${E.x2} ${E.y2}`;
1095
641
  }
1096
- const E = We(`M ${l} ${c} C ${d} ${a} ${u} ${h} ${f} ${m}`, p, v), y = l / 8 + d * 3 / 8 + u * 3 / 8 + f / 8, _ = c / 8 + a * 3 / 8 + h * 3 / 8 + m / 8, w = Tt(o.label, y, _, e.theme.cssVar["--color"]);
1097
- E.appendChild(w), E.arrowObj = o, E.dataset.linkid = o.id, e.linkSvgGroup.appendChild(E), s || (e.arrows.push(o), e.currentArrow = E, Ae(e, o, i, r)), performance.now();
1098
- }, $t = function(e, t, n = {}) {
642
+ const C = Nt(`M ${c} ${a} C ${f} ${l} ${h} ${d} ${p} ${u}`, g, y), v = c / 8 + f * 3 / 8 + h * 3 / 8 + p / 8, w = a / 8 + l * 3 / 8 + d * 3 / 8 + u / 8, b = re(o.label, v, w, t.theme.cssVar["--color"]);
643
+ C.appendChild(b), C.label = b, C.arrowObj = o, C.dataset.linkid = o.id, t.linkSvgGroup.appendChild(C), s || (t.arrows.push(o), t.currentArrow = C, mt(t, o, i, r)), performance.now();
644
+ }, ce = function(t, e, n = {}) {
1099
645
  const o = {
1100
- id: ee(),
646
+ id: V(),
1101
647
  label: "Custom Link",
1102
- from: e.nodeObj.id,
1103
- to: t.nodeObj.id,
648
+ from: t.nodeObj.id,
649
+ to: e.nodeObj.id,
1104
650
  delta1: {
1105
- x: 0,
1106
- y: -200
651
+ x: t.offsetWidth / 2 + 100,
652
+ y: 0
1107
653
  },
1108
654
  delta2: {
1109
- x: 0,
1110
- y: -200
655
+ x: e.offsetWidth / 2 + 100,
656
+ y: 0
1111
657
  },
1112
658
  ...n
1113
659
  };
1114
- $e(this, e, t, o), this.bus.fire("operation", {
660
+ U(this, t, e, o), this.bus.fire("operation", {
1115
661
  name: "createArrow",
1116
662
  obj: o
1117
663
  });
1118
- }, At = function(e) {
1119
- let t;
1120
- if (e ? t = e : t = this.currentArrow, !t)
664
+ }, le = function(t) {
665
+ const e = { ...t, id: V() };
666
+ U(this, M(e.from), M(e.to), e), this.bus.fire("operation", {
667
+ name: "createArrow",
668
+ obj: e
669
+ });
670
+ }, ae = function(t) {
671
+ let e;
672
+ if (t ? e = t : e = this.currentArrow, !e)
1121
673
  return;
1122
- se(this);
1123
- const n = t.arrowObj.id;
1124
- this.arrows = this.arrows.filter((o) => o.id !== n), t.remove(), this.bus.fire("operation", {
674
+ K(this);
675
+ const n = e.arrowObj.id;
676
+ this.arrows = this.arrows.filter((o) => o.id !== n), e.remove(), this.bus.fire("operation", {
1125
677
  name: "removeArrow",
1126
678
  obj: {
1127
679
  id: n
1128
680
  }
1129
681
  });
1130
- }, Nt = function(e) {
1131
- this.currentArrow = e;
1132
- const t = e.arrowObj, n = M(t.from), o = M(t.to), s = Z(this, n, t.delta1), i = Z(this, o, t.delta2);
1133
- Ae(this, t, s, i);
1134
- }, kt = function() {
1135
- this.currentArrow = null, se(this);
1136
- }, se = function(e) {
1137
- var t, n;
1138
- (t = e.helper1) == null || t.destory(e.map), (n = e.helper2) == null || n.destory(e.map), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none";
1139
- }, Ae = function(e, t, n, o) {
1140
- e.linkController.style.display = "initial", e.P2.style.display = "initial", e.P3.style.display = "initial", e.nodes.appendChild(e.linkController), e.nodes.appendChild(e.P2), e.nodes.appendChild(e.P3);
1141
- let { x: s, y: i } = O(n), { ctrlX: r, ctrlY: l } = n, { ctrlX: c, ctrlY: d } = o, { x: a, y: u } = O(o);
1142
- e.P2.style.cssText = `top:${l}px;left:${r}px;`, e.P3.style.cssText = `top:${d}px;left:${c}px;`, x(e.line1, {
682
+ }, he = function(t) {
683
+ this.currentArrow = t;
684
+ const e = t.arrowObj, n = M(e.from), o = M(e.to), s = Y(this, n, e.delta1), i = Y(this, o, e.delta2);
685
+ mt(this, e, s, i);
686
+ }, de = function() {
687
+ this.currentArrow = null, K(this);
688
+ }, K = function(t) {
689
+ var e, n;
690
+ (e = t.helper1) == null || e.destory(t.map), (n = t.helper2) == null || n.destory(t.map), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none";
691
+ }, mt = function(t, e, n, o) {
692
+ t.linkController.style.display = "initial", t.P2.style.display = "initial", t.P3.style.display = "initial", t.nodes.appendChild(t.linkController), t.nodes.appendChild(t.P2), t.nodes.appendChild(t.P3);
693
+ let { x: s, y: i } = A(n), { ctrlX: r, ctrlY: c } = n, { ctrlX: a, ctrlY: f } = o, { x: l, y: h } = A(o);
694
+ t.P2.style.cssText = `top:${c}px;left:${r}px;`, t.P3.style.cssText = `top:${f}px;left:${a}px;`, x(t.line1, {
1143
695
  x1: s + "",
1144
696
  y1: i + "",
1145
697
  x2: r + "",
1146
- y2: l + ""
1147
- }), x(e.line2, {
1148
- x1: c + "",
1149
- y1: d + "",
1150
- x2: a + "",
1151
- y2: u + ""
1152
- }), e.helper1 = ve.create(e.P2), e.helper2 = ve.create(e.P3), e.helper1.init(e.map, (h, f) => {
1153
- if (!e.currentArrow)
698
+ y2: c + ""
699
+ }), x(t.line2, {
700
+ x1: a + "",
701
+ y1: f + "",
702
+ x2: l + "",
703
+ y2: h + ""
704
+ }), t.helper1 = st.create(t.P2), t.helper2 = st.create(t.P3), t.helper1.init(t.map, (d, p) => {
705
+ if (!t.currentArrow)
1154
706
  return;
1155
- r = r + h / e.scaleVal, l = l + f / e.scaleVal;
1156
- const m = O({ ...n, ctrlX: r, ctrlY: l });
1157
- s = m.x, i = m.y;
1158
- const g = s / 8 + r * 3 / 8 + c * 3 / 8 + a / 8, p = i / 8 + l * 3 / 8 + d * 3 / 8 + u / 8;
1159
- if (e.P2.style.top = l + "px", e.P2.style.left = r + "px", e.currentArrow.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${d} ${a} ${u}`), t.bidirectional) {
1160
- const v = U(r, l, s, i);
1161
- e.currentArrow.children[2].setAttribute("d", `M ${v.x1} ${v.y1} L ${s} ${i} L ${v.x2} ${v.y2}`);
707
+ r = r + d / t.scaleVal, c = c + p / t.scaleVal;
708
+ const u = A({ ...n, ctrlX: r, ctrlY: c });
709
+ s = u.x, i = u.y;
710
+ const m = s / 8 + r * 3 / 8 + a * 3 / 8 + l / 8, g = i / 8 + c * 3 / 8 + f * 3 / 8 + h / 8;
711
+ if (t.P2.style.top = c + "px", t.P2.style.left = r + "px", t.currentArrow.line.setAttribute("d", `M ${s} ${i} C ${r} ${c} ${a} ${f} ${l} ${h}`), e.bidirectional) {
712
+ const y = W(r, c, s, i);
713
+ if (!y)
714
+ return;
715
+ t.currentArrow.arrow2.setAttribute("d", `M ${y.x1} ${y.y1} L ${s} ${i} L ${y.x2} ${y.y2}`);
1162
716
  }
1163
- x(e.currentArrow.children[3], {
1164
- x: g + "",
1165
- y: p + ""
1166
- }), x(e.line1, {
717
+ x(t.currentArrow.label, {
718
+ x: m + "",
719
+ y: g + ""
720
+ }), x(t.line1, {
1167
721
  x1: s + "",
1168
722
  y1: i + "",
1169
723
  x2: r + "",
1170
- y2: l + ""
1171
- }), t.delta1.x = r - n.cx, t.delta1.y = l - n.cy, e.bus.fire("updateArrowDelta", t);
1172
- }), e.helper2.init(e.map, (h, f) => {
1173
- if (!e.currentArrow)
724
+ y2: c + ""
725
+ }), e.delta1.x = r - n.cx, e.delta1.y = c - n.cy, t.bus.fire("updateArrowDelta", e);
726
+ }), t.helper2.init(t.map, (d, p) => {
727
+ if (!t.currentArrow)
1174
728
  return;
1175
- c = c + h / e.scaleVal, d = d + f / e.scaleVal;
1176
- const m = O({ ...o, ctrlX: c, ctrlY: d });
1177
- a = m.x, u = m.y;
1178
- const g = s / 8 + r * 3 / 8 + c * 3 / 8 + a / 8, p = i / 8 + l * 3 / 8 + d * 3 / 8 + u / 8, v = U(c, d, a, u);
1179
- e.P3.style.top = d + "px", e.P3.style.left = c + "px", e.currentArrow.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${d} ${a} ${u}`), e.currentArrow.children[1].setAttribute("d", `M ${v.x1} ${v.y1} L ${a} ${u} L ${v.x2} ${v.y2}`), x(e.currentArrow.children[3], {
1180
- x: g + "",
1181
- y: p + ""
1182
- }), x(e.line2, {
1183
- x1: c + "",
1184
- y1: d + "",
1185
- x2: a + "",
1186
- y2: u + ""
1187
- }), t.delta2.x = c - o.cx, t.delta2.y = d - o.cy, e.bus.fire("updateArrowDelta", t);
729
+ a = a + d / t.scaleVal, f = f + p / t.scaleVal;
730
+ const u = A({ ...o, ctrlX: a, ctrlY: f });
731
+ l = u.x, h = u.y;
732
+ const m = s / 8 + r * 3 / 8 + a * 3 / 8 + l / 8, g = i / 8 + c * 3 / 8 + f * 3 / 8 + h / 8, y = W(a, f, l, h);
733
+ y && (t.P3.style.top = f + "px", t.P3.style.left = a + "px", t.currentArrow.line.setAttribute("d", `M ${s} ${i} C ${r} ${c} ${a} ${f} ${l} ${h}`), t.currentArrow.arrow1.setAttribute("d", `M ${y.x1} ${y.y1} L ${l} ${h} L ${y.x2} ${y.y2}`), x(t.currentArrow.label, {
734
+ x: m + "",
735
+ y: g + ""
736
+ }), x(t.line2, {
737
+ x1: a + "",
738
+ y1: f + "",
739
+ x2: l + "",
740
+ y2: h + ""
741
+ }), e.delta2.x = a - o.cx, e.delta2.y = f - o.cy, t.bus.fire("updateArrowDelta", e));
1188
742
  });
1189
743
  };
1190
- function Ht() {
744
+ function fe() {
1191
745
  this.linkSvgGroup.innerHTML = "";
1192
- for (let e = 0; e < this.arrows.length; e++) {
1193
- const t = this.arrows[e];
746
+ for (let t = 0; t < this.arrows.length; t++) {
747
+ const e = this.arrows[t];
1194
748
  try {
1195
- $e(this, M(t.from), M(t.to), t, !0);
749
+ U(this, M(e.from), M(e.to), e, !0);
1196
750
  } catch {
1197
751
  }
1198
752
  }
1199
753
  this.nodes.appendChild(this.linkSvgGroup);
1200
754
  }
1201
- function Dt(e) {
1202
- if (se(this), !e)
755
+ function ue(t) {
756
+ if (K(this), !t)
1203
757
  return;
1204
- const t = e.children[3];
1205
- Ce(this, t, (n) => {
1206
- var i;
1207
- const o = e.arrowObj, s = ((i = n.textContent) == null ? void 0 : i.trim()) || "";
1208
- s === "" ? o.label = origin : o.label = s, n.remove(), s !== origin && (t.innerHTML = o.label, this.linkDiv(), this.bus.fire("operation", {
1209
- name: "finishEditArrowLabel",
1210
- obj: o
1211
- }));
1212
- });
758
+ const e = t.label;
759
+ ut(this, e, t.arrowObj);
1213
760
  }
1214
- function Bt() {
1215
- this.arrows = this.arrows.filter((e) => J(e.from, this.nodeData) && J(e.to, this.nodeData));
761
+ function pe() {
762
+ this.arrows = this.arrows.filter((t) => R(t.from, this.nodeData) && R(t.to, this.nodeData));
1216
763
  }
1217
- const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
764
+ const me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1218
765
  __proto__: null,
1219
- createArrow: $t,
1220
- editArrowLabel: Dt,
1221
- removeArrow: At,
1222
- renderArrow: Ht,
1223
- selectArrow: Nt,
1224
- tidyArrow: Bt,
1225
- unselectArrow: kt
1226
- }, Symbol.toStringTag, { value: "Module" })), zt = function(e) {
1227
- var c, d;
1228
- if (e.length === 0)
766
+ createArrow: ce,
767
+ createArrowFrom: le,
768
+ editArrowLabel: ue,
769
+ removeArrow: ae,
770
+ renderArrow: fe,
771
+ selectArrow: he,
772
+ tidyArrow: pe,
773
+ unselectArrow: de
774
+ }, Symbol.toStringTag, { value: "Module" })), ge = function(t) {
775
+ var a, f;
776
+ if (t.length === 0)
1229
777
  throw new Error("No selected node.");
1230
- if (e.length === 1) {
1231
- const a = e[0].nodeObj, u = e[0].nodeObj.parent;
1232
- if (!u)
778
+ if (t.length === 1) {
779
+ const l = t[0].nodeObj, h = t[0].nodeObj.parent;
780
+ if (!h)
1233
781
  throw new Error("Can not select root node.");
1234
- const h = u.children.findIndex((f) => a === f);
782
+ const d = h.children.findIndex((p) => l === p);
1235
783
  return {
1236
- parent: u.id,
1237
- start: h,
1238
- end: h
784
+ parent: h.id,
785
+ start: d,
786
+ end: d
1239
787
  };
1240
788
  }
1241
- let t = 0;
1242
- const n = e.map((a) => {
1243
- let u = a.nodeObj;
1244
- const h = [];
1245
- for (; u.parent; ) {
1246
- const f = u.parent, m = f.children, g = m == null ? void 0 : m.indexOf(u);
1247
- u = f, h.unshift({ node: u, index: g });
789
+ let e = 0;
790
+ const n = t.map((l) => {
791
+ let h = l.nodeObj;
792
+ const d = [];
793
+ for (; h.parent; ) {
794
+ const p = h.parent, u = p.children, m = u == null ? void 0 : u.indexOf(h);
795
+ h = p, d.unshift({ node: h, index: m });
1248
796
  }
1249
- return h.length > t && (t = h.length), h;
797
+ return d.length > e && (e = d.length), d;
1250
798
  });
1251
799
  let o = 0;
1252
- e:
1253
- for (; o < t; o++) {
1254
- const a = (c = n[0][o]) == null ? void 0 : c.node;
1255
- for (let u = 1; u < n.length; u++)
1256
- if (((d = n[u][o]) == null ? void 0 : d.node) !== a)
1257
- break e;
800
+ t:
801
+ for (; o < e; o++) {
802
+ const l = (a = n[0][o]) == null ? void 0 : a.node;
803
+ for (let h = 1; h < n.length; h++)
804
+ if (((f = n[h][o]) == null ? void 0 : f.node) !== l)
805
+ break t;
1258
806
  }
1259
807
  if (!o)
1260
808
  throw new Error("Can not select root node.");
1261
- const s = n.map((a) => a[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, l = n[0][o - 1].node;
1262
- if (!l.parent)
809
+ const s = n.map((l) => l[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, c = n[0][o - 1].node;
810
+ if (!c.parent)
1263
811
  throw new Error("Please select nodes in the same main topic.");
1264
812
  return {
1265
- parent: l.id,
813
+ parent: c.id,
1266
814
  start: i,
1267
815
  end: r
1268
816
  };
1269
- }, Ot = function(e) {
1270
- const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
1271
- return t.setAttribute("id", e), t;
1272
- }, ye = function(e, t) {
817
+ }, ye = function(t) {
818
+ const e = document.createElementNS("http://www.w3.org/2000/svg", "g");
819
+ return e.setAttribute("id", t), e;
820
+ }, it = function(t, e) {
1273
821
  const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
1274
822
  return x(n, {
1275
- d: e,
1276
- stroke: t || "#666",
823
+ d: t,
824
+ stroke: e || "#666",
1277
825
  fill: "none",
1278
826
  "stroke-linecap": "round",
1279
827
  "stroke-width": "2"
1280
828
  }), n;
1281
- }, be = function(e, t, n, o, s) {
829
+ }, rt = function(t, e, n, o, s) {
1282
830
  const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
1283
831
  return x(i, {
1284
832
  "text-anchor": o,
1285
- x: t + "",
833
+ x: e + "",
1286
834
  y: n + "",
1287
835
  fill: s || "#666"
1288
- }), i.innerHTML = e, i;
1289
- }, jt = (e) => M(e).parentElement.parentElement, Rt = function({ parent: e, start: t }) {
1290
- const n = M(e), o = n.nodeObj;
836
+ }), i.innerHTML = t, i;
837
+ }, xe = (t) => M(t).parentElement.parentElement, ve = function({ parent: t, start: e }) {
838
+ const n = M(t), o = n.nodeObj;
1291
839
  let s;
1292
- return o.parent ? s = n.closest("me-main").className : s = M(o.children[t].id).closest("me-main").className, s;
1293
- }, ie = function(e, t) {
1294
- var S;
1295
- const { id: n, text: o, parent: s, start: i, end: r } = t, l = e.nodes, d = M(s).nodeObj, a = Rt(t);
1296
- let u = 1 / 0, h = 0, f = 0, m = 0;
1297
- for (let q = i; q <= r; q++) {
1298
- const re = (S = d.children) == null ? void 0 : S[q];
1299
- if (!re)
1300
- return e.removeSummary(n), null;
1301
- const I = jt(re.id), { offsetLeft: X, offsetTop: le } = H(l, I), ce = i === r ? 10 : 20;
1302
- q === i && (f = le + ce), q === r && (m = le + I.offsetHeight - ce), X < u && (u = X), I.offsetWidth + X > h && (h = I.offsetWidth + X);
840
+ return o.parent ? s = n.closest("me-main").className : s = M(o.children[e].id).closest("me-main").className, s;
841
+ }, Q = function(t, e) {
842
+ var E;
843
+ const { id: n, label: o, parent: s, start: i, end: r } = e, c = t.nodes, f = M(s).nodeObj, l = ve(e);
844
+ let h = 1 / 0, d = 0, p = 0, u = 0;
845
+ for (let P = i; P <= r; P++) {
846
+ const Z = (E = f.children) == null ? void 0 : E[P];
847
+ if (!Z)
848
+ return t.removeSummary(n), null;
849
+ const j = xe(Z.id), { offsetLeft: q, offsetTop: tt } = N(c, j), et = i === r ? 10 : 20;
850
+ P === i && (p = tt + et), P === r && (u = tt + j.offsetHeight - et), q < h && (h = q), j.offsetWidth + q > d && (d = j.offsetWidth + q);
1303
851
  }
1304
- let g, p;
1305
- const v = f + 10, E = m + 10, y = (v + E) / 2, _ = e.theme.cssVar["--color"];
1306
- a === T.LHS ? (g = ye(`M ${u + 10} ${v} c -5 0 -10 5 -10 10 L ${u} ${E - 10} c 0 5 5 10 10 10 M ${u} ${y} h -10`, _), p = be(o, u - 20, y + 6, "end", _)) : (g = ye(`M ${h - 10} ${v} c 5 0 10 5 10 10 L ${h} ${E - 10} c 0 5 -5 10 -10 10 M ${h} ${y} h 10`, _), p = be(o, h + 20, y + 6, "start", _));
1307
- const w = Ot("s-" + n);
1308
- return w.appendChild(g), w.appendChild(p), w.summaryObj = t, e.summarySvg.appendChild(w), w;
1309
- }, qt = function() {
1310
- let e = [];
1311
- this.currentNode ? e = [this.currentNode] : this.currentNodes && (e = this.currentNodes);
1312
- const { parent: t, start: n, end: o } = zt(e), s = { id: ee(), parent: t, start: n, end: o, text: "summary" }, i = ie(this, s);
852
+ let m, g;
853
+ const y = p + 10, C = u + 10, v = (y + C) / 2, w = t.theme.cssVar["--color"];
854
+ l === $.LHS ? (m = it(`M ${h + 10} ${y} c -5 0 -10 5 -10 10 L ${h} ${C - 10} c 0 5 5 10 10 10 M ${h} ${v} h -10`, w), g = rt(o, h - 20, v + 6, "end", w)) : (m = it(`M ${d - 10} ${y} c 5 0 10 5 10 10 L ${d} ${C - 10} c 0 5 -5 10 -10 10 M ${d} ${v} h 10`, w), g = rt(o, d + 20, v + 6, "start", w));
855
+ const b = ye("s-" + n);
856
+ return b.appendChild(m), b.appendChild(g), b.summaryObj = e, t.summarySvg.appendChild(b), b;
857
+ }, be = function() {
858
+ if (!this.currentNodes)
859
+ return;
860
+ const t = this.currentNodes, { parent: e, start: n, end: o } = ge(t), s = { id: V(), parent: e, start: n, end: o, label: "summary" }, i = Q(this, s);
1313
861
  this.summaries.push(s), this.editSummary(i), this.bus.fire("operation", {
1314
862
  name: "createSummary",
1315
863
  obj: s
1316
864
  });
1317
- }, Vt = function(e) {
1318
- const t = ee(), n = { ...e, id: t };
1319
- ie(this, n), this.summaries.push(n), this.bus.fire("operation", {
865
+ }, we = function(t) {
866
+ const e = V(), n = { ...t, id: e };
867
+ Q(this, n), this.summaries.push(n), this.bus.fire("operation", {
1320
868
  name: "createSummary",
1321
869
  obj: n
1322
870
  });
1323
- }, Wt = function(e) {
871
+ }, Ce = function(t) {
1324
872
  var n;
1325
- const t = this.summaries.findIndex((o) => o.id === e);
1326
- t > -1 && (this.summaries.splice(t, 1), (n = document.querySelector("#s-" + e)) == null || n.remove()), this.bus.fire("operation", {
873
+ const e = this.summaries.findIndex((o) => o.id === t);
874
+ e > -1 && (this.summaries.splice(e, 1), (n = document.querySelector("#s-" + t)) == null || n.remove()), this.bus.fire("operation", {
1327
875
  name: "removeSummary",
1328
- obj: { id: e }
876
+ obj: { id: t }
1329
877
  });
1330
- }, Ft = function(e) {
1331
- const t = e.children[1].getBBox(), n = 6, o = 3, s = document.createElementNS("http://www.w3.org/2000/svg", "rect");
878
+ }, Ee = function(t) {
879
+ const e = t.children[1].getBBox(), n = 6, o = 3, s = document.createElementNS("http://www.w3.org/2000/svg", "rect");
1332
880
  x(s, {
1333
- x: t.x - n + "",
1334
- y: t.y - n + "",
1335
- width: t.width + n * 2 + "",
1336
- height: t.height + n * 2 + "",
881
+ x: e.x - n + "",
882
+ y: e.y - n + "",
883
+ width: e.width + n * 2 + "",
884
+ height: e.height + n * 2 + "",
1337
885
  rx: o + "",
1338
886
  stroke: this.theme.cssVar["--selected"] || "#4dc4ff",
1339
887
  "stroke-width": "2",
1340
888
  fill: "none"
1341
- }), e.appendChild(s), this.currentSummary = e;
1342
- }, It = function() {
1343
- var e, t;
1344
- (t = (e = this.currentSummary) == null ? void 0 : e.querySelector("rect")) == null || t.remove(), this.currentSummary = null;
1345
- }, Xt = function() {
1346
- this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
889
+ }), t.appendChild(s), this.currentSummary = t;
890
+ }, Se = function() {
891
+ var t, e;
892
+ (e = (t = this.currentSummary) == null ? void 0 : t.querySelector("rect")) == null || e.remove(), this.currentSummary = null;
893
+ }, Le = function() {
894
+ this.summarySvg.innerHTML = "", this.summaries.forEach((t) => {
1347
895
  try {
1348
- ie(this, e);
896
+ Q(this, t);
1349
897
  } catch {
1350
898
  }
1351
899
  }), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
1352
- }, Yt = function(e) {
1353
- if (!e)
900
+ }, Me = function(t) {
901
+ if (!t)
1354
902
  return;
1355
- const t = e.childNodes[1];
1356
- Ce(this, t, (n) => {
1357
- var i;
1358
- const o = e.summaryObj, s = ((i = n.textContent) == null ? void 0 : i.trim()) || "";
1359
- s === "" ? o.text = origin : o.text = s, n.remove(), s !== origin && (t.innerHTML = o.text, this.linkDiv(), this.bus.fire("operation", {
1360
- name: "finishEditSummary",
1361
- obj: o
1362
- }));
1363
- });
1364
- }, Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
903
+ const e = t.childNodes[1];
904
+ ut(this, e, t.summaryObj);
905
+ }, $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1365
906
  __proto__: null,
1366
- createSummary: qt,
1367
- createSummaryFrom: Vt,
1368
- editSummary: Yt,
1369
- removeSummary: Wt,
1370
- renderSummary: Xt,
1371
- selectSummary: Ft,
1372
- unselectSummary: It
907
+ createSummary: be,
908
+ createSummaryFrom: we,
909
+ editSummary: Me,
910
+ removeSummary: Ce,
911
+ renderSummary: Le,
912
+ selectSummary: Ee,
913
+ unselectSummary: Se
1373
914
  }, Symbol.toStringTag, { value: "Module" })), L = "http://www.w3.org/2000/svg";
1374
- function Kt(e, t) {
915
+ function Te(t, e) {
1375
916
  const n = document.createElementNS(L, "svg");
1376
917
  return x(n, {
1377
918
  version: "1.1",
1378
919
  xmlns: L,
1379
- height: e,
1380
- width: t
920
+ height: t,
921
+ width: e
1381
922
  }), n;
1382
923
  }
1383
- function Jt(e, t) {
1384
- return (parseInt(e) - parseInt(t)) / 2;
924
+ function Ne(t, e) {
925
+ return (parseInt(t) - parseInt(e)) / 2;
1385
926
  }
1386
- function Ut(e, t, n, o) {
927
+ function ke(t, e, n, o) {
1387
928
  const s = document.createElementNS(L, "g");
1388
929
  let i = "";
1389
- return e.text ? i = e.text.textContent : i = e.childNodes[0].textContent, i.split(`
1390
- `).forEach((l, c) => {
1391
- const d = document.createElementNS(L, "text");
1392
- x(d, {
1393
- x: n + parseInt(t.paddingLeft) + "",
1394
- y: o + parseInt(t.paddingTop) + Jt(t.lineHeight, t.fontSize) * (c + 1) + parseFloat(t.fontSize) * (c + 1) + "",
930
+ return t.text ? i = t.text.textContent : i = t.childNodes[0].textContent, i.split(`
931
+ `).forEach((c, a) => {
932
+ const f = document.createElementNS(L, "text");
933
+ x(f, {
934
+ x: n + parseInt(e.paddingLeft) + "",
935
+ y: o + parseInt(e.paddingTop) + Ne(e.lineHeight, e.fontSize) * (a + 1) + parseFloat(e.fontSize) * (a + 1) + "",
1395
936
  "text-anchor": "start",
1396
- "font-family": t.fontFamily,
1397
- "font-size": `${t.fontSize}`,
1398
- "font-weight": `${t.fontWeight}`,
1399
- fill: `${t.color}`
1400
- }), d.innerHTML = l, s.appendChild(d);
937
+ "font-family": e.fontFamily,
938
+ "font-size": `${e.fontSize}`,
939
+ "font-weight": `${e.fontWeight}`,
940
+ fill: `${e.color}`
941
+ }), f.innerHTML = c, s.appendChild(f);
1401
942
  }), s;
1402
943
  }
1403
- function Qt(e, t, n, o) {
1404
- var l;
944
+ function He(t, e, n, o) {
945
+ var c;
1405
946
  let s = "";
1406
- (l = e.nodeObj) != null && l.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
947
+ (c = t.nodeObj) != null && c.dangerouslySetInnerHTML ? s = t.nodeObj.dangerouslySetInnerHTML : t.text ? s = t.text.textContent : s = t.childNodes[0].textContent;
1407
948
  const i = document.createElementNS(L, "foreignObject");
1408
949
  x(i, {
1409
- x: n + parseInt(t.paddingLeft) + "",
1410
- y: o + parseInt(t.paddingTop) + "",
1411
- width: t.width,
1412
- height: t.height
950
+ x: n + parseInt(e.paddingLeft) + "",
951
+ y: o + parseInt(e.paddingTop) + "",
952
+ width: e.width,
953
+ height: e.height
1413
954
  });
1414
955
  const r = document.createElement("div");
1415
956
  return x(r, {
1416
957
  xmlns: "http://www.w3.org/1999/xhtml",
1417
- style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
958
+ style: `font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`
1418
959
  }), r.innerHTML = s, i.appendChild(r), i;
1419
960
  }
1420
- function Zt(e, t) {
1421
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = H(e.nodes, t), i = document.createElementNS(L, "rect");
961
+ function Ae(t, e) {
962
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = N(t.nodes, e), i = document.createElementNS(L, "rect");
1422
963
  return x(i, {
1423
964
  x: o + "",
1424
965
  y: s + "",
@@ -1431,8 +972,8 @@ function Zt(e, t) {
1431
972
  "stroke-width": n.borderWidth
1432
973
  }), i;
1433
974
  }
1434
- function G(e, t, n = !1) {
1435
- const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = H(e.nodes, t), r = document.createElementNS(L, "rect");
975
+ function _(t, e, n = !1) {
976
+ const o = getComputedStyle(e), { offsetLeft: s, offsetTop: i } = N(t.nodes, e), r = document.createElementNS(L, "rect");
1436
977
  x(r, {
1437
978
  x: s + "",
1438
979
  y: i + "",
@@ -1444,13 +985,13 @@ function G(e, t, n = !1) {
1444
985
  stroke: o.borderColor,
1445
986
  "stroke-width": o.borderWidth
1446
987
  });
1447
- const l = document.createElementNS(L, "g");
1448
- l.appendChild(r);
1449
- let c;
1450
- return n ? c = Qt(t, o, s, i) : c = Ut(t, o, s, i), l.appendChild(c), l;
988
+ const c = document.createElementNS(L, "g");
989
+ c.appendChild(r);
990
+ let a;
991
+ return n ? a = He(e, o, s, i) : a = ke(e, o, s, i), c.appendChild(a), c;
1451
992
  }
1452
- function en(e, t) {
1453
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = H(e.nodes, t), i = document.createElementNS(L, "a"), r = document.createElementNS(L, "text");
993
+ function De(t, e) {
994
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = N(t.nodes, e), i = document.createElementNS(L, "a"), r = document.createElementNS(L, "text");
1454
995
  return x(r, {
1455
996
  x: o + "",
1456
997
  y: s + parseInt(n.fontSize) + "",
@@ -1459,163 +1000,192 @@ function en(e, t) {
1459
1000
  "font-size": `${n.fontSize}`,
1460
1001
  "font-weight": `${n.fontWeight}`,
1461
1002
  fill: `${n.color}`
1462
- }), r.innerHTML = t.textContent, i.appendChild(r), i.setAttribute("href", t.href), i;
1003
+ }), r.innerHTML = e.textContent, i.appendChild(r), i.setAttribute("href", e.href), i;
1463
1004
  }
1464
- function tn(e, t) {
1465
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = H(e.nodes, t), i = document.createElementNS(L, "image");
1005
+ function Be(t, e) {
1006
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = N(t.nodes, e), i = document.createElementNS(L, "image");
1466
1007
  return x(i, {
1467
1008
  x: o + "",
1468
1009
  y: s + "",
1469
1010
  width: n.width + "",
1470
1011
  height: n.height + "",
1471
- href: t.src
1012
+ href: e.src
1472
1013
  }), i;
1473
1014
  }
1474
- const K = 100, nn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', on = (e, t = !1) => {
1475
- var u, h, f;
1476
- const n = e.nodes, o = n.offsetHeight + K * 2, s = n.offsetWidth + K * 2, i = Kt(o + "px", s + "px"), r = document.createElementNS(L, "svg"), l = document.createElementNS(L, "rect");
1477
- x(l, {
1015
+ const F = 100, Pe = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', ze = (t, e = !1) => {
1016
+ var h, d, p;
1017
+ const n = t.nodes, o = n.offsetHeight + F * 2, s = n.offsetWidth + F * 2, i = Te(o + "px", s + "px"), r = document.createElementNS(L, "svg"), c = document.createElementNS(L, "rect");
1018
+ x(c, {
1478
1019
  x: "0",
1479
1020
  y: "0",
1480
1021
  width: `${s}`,
1481
1022
  height: `${o}`,
1482
- fill: e.theme.cssVar["--bgcolor"]
1483
- }), i.appendChild(l), n.querySelectorAll(".subLines").forEach((m) => {
1484
- const g = m.cloneNode(!0), { offsetLeft: p, offsetTop: v } = H(n, m.parentElement);
1485
- g.setAttribute("x", `${p}`), g.setAttribute("y", `${v}`), r.appendChild(g);
1023
+ fill: t.theme.cssVar["--bgcolor"]
1024
+ }), i.appendChild(c), n.querySelectorAll(".subLines").forEach((u) => {
1025
+ const m = u.cloneNode(!0), { offsetLeft: g, offsetTop: y } = N(n, u.parentElement);
1026
+ m.setAttribute("x", `${g}`), m.setAttribute("y", `${y}`), r.appendChild(m);
1486
1027
  });
1487
- const c = (u = n.querySelector(".lines")) == null ? void 0 : u.cloneNode(!0);
1488
- c && r.appendChild(c);
1489
- const d = (h = n.querySelector(".topiclinks")) == null ? void 0 : h.cloneNode(!0);
1490
- d && r.appendChild(d);
1491
- const a = (f = n.querySelector(".summary")) == null ? void 0 : f.cloneNode(!0);
1492
- return a && r.appendChild(a), n.querySelectorAll("me-tpc").forEach((m) => {
1493
- m.nodeObj.dangerouslySetInnerHTML ? r.appendChild(G(e, m, !t)) : (r.appendChild(Zt(e, m)), r.appendChild(G(e, m.text, !t)));
1494
- }), n.querySelectorAll(".tags > span").forEach((m) => {
1495
- r.appendChild(G(e, m));
1496
- }), n.querySelectorAll(".icons > span").forEach((m) => {
1497
- r.appendChild(G(e, m));
1498
- }), n.querySelectorAll(".hyper-link").forEach((m) => {
1499
- r.appendChild(en(e, m));
1500
- }), n.querySelectorAll("img").forEach((m) => {
1501
- r.appendChild(tn(e, m));
1028
+ const a = (h = n.querySelector(".lines")) == null ? void 0 : h.cloneNode(!0);
1029
+ a && r.appendChild(a);
1030
+ const f = (d = n.querySelector(".topiclinks")) == null ? void 0 : d.cloneNode(!0);
1031
+ f && r.appendChild(f);
1032
+ const l = (p = n.querySelector(".summary")) == null ? void 0 : p.cloneNode(!0);
1033
+ return l && r.appendChild(l), n.querySelectorAll("me-tpc").forEach((u) => {
1034
+ u.nodeObj.dangerouslySetInnerHTML ? r.appendChild(_(t, u, !e)) : (r.appendChild(Ae(t, u)), r.appendChild(_(t, u.text, !e)));
1035
+ }), n.querySelectorAll(".tags > span").forEach((u) => {
1036
+ r.appendChild(_(t, u));
1037
+ }), n.querySelectorAll(".icons > span").forEach((u) => {
1038
+ r.appendChild(_(t, u));
1039
+ }), n.querySelectorAll(".hyper-link").forEach((u) => {
1040
+ r.appendChild(De(t, u));
1041
+ }), n.querySelectorAll("img").forEach((u) => {
1042
+ r.appendChild(Be(t, u));
1502
1043
  }), x(r, {
1503
- x: K + "",
1504
- y: K + "",
1044
+ x: F + "",
1045
+ y: F + "",
1505
1046
  overflow: "visible"
1506
1047
  }), i.appendChild(r), i;
1507
- }, sn = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), nn + e.outerHTML);
1508
- function rn(e) {
1509
- return new Promise((t, n) => {
1048
+ }, Oe = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), Pe + t.outerHTML);
1049
+ function Ve(t) {
1050
+ return new Promise((e, n) => {
1510
1051
  const o = new FileReader();
1511
1052
  o.onload = (s) => {
1512
- t(s.target.result);
1053
+ e(s.target.result);
1513
1054
  }, o.onerror = (s) => {
1514
1055
  n(s);
1515
- }, o.readAsDataURL(e);
1056
+ }, o.readAsDataURL(t);
1516
1057
  });
1517
1058
  }
1518
- const ln = function(e = !1, t) {
1519
- const n = on(this, e), o = sn(n, t);
1059
+ const je = function(t = !1, e) {
1060
+ const n = ze(this, t), o = Oe(n, e);
1520
1061
  return new Blob([o], { type: "image/svg+xml" });
1521
- }, cn = async function(e = !1, t) {
1522
- const n = this.exportSvg(e, t), o = await rn(n);
1062
+ }, qe = async function(t = !1, e) {
1063
+ const n = this.exportSvg(t, e), o = await Ve(n);
1523
1064
  return new Promise((s, i) => {
1524
1065
  const r = new Image();
1525
1066
  r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
1526
- const l = document.createElement("canvas");
1527
- l.width = r.width, l.height = r.height, l.getContext("2d").drawImage(r, 0, 0), l.toBlob(s, "image/png", 1);
1067
+ const c = document.createElement("canvas");
1068
+ c.width = r.width, c.height = r.height, c.getContext("2d").drawImage(r, 0, 0), c.toBlob(s, "image/png", 1);
1528
1069
  }, r.src = o, r.onerror = i;
1529
1070
  });
1530
- }, an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1071
+ }, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1531
1072
  __proto__: null,
1532
- exportPng: cn,
1533
- exportSvg: ln
1534
- }, Symbol.toStringTag, { value: "Module" })), hn = {}, dn = {
1535
- getObjById: J,
1536
- generateNewObj: Ne,
1537
- layout: De,
1538
- linkDiv: Fe,
1539
- editTopic: qe,
1540
- createWrapper: ze,
1541
- createParent: Oe,
1542
- createChildren: je,
1543
- createTopic: Re,
1073
+ exportPng: qe,
1074
+ exportSvg: je
1075
+ }, Symbol.toStringTag, { value: "Module" })), Fe = {}, Re = {
1076
+ getObjById: R,
1077
+ generateNewObj: gt,
1078
+ layout: bt,
1079
+ linkDiv: kt,
1080
+ editTopic: $t,
1081
+ createWrapper: Et,
1082
+ createParent: St,
1083
+ createChildren: Lt,
1084
+ createTopic: Mt,
1544
1085
  findEle: M,
1545
- changeTheme: nt,
1546
- ...Lt,
1547
- ...hn,
1548
- ...Pt,
1549
- ...Gt,
1550
- ...an,
1551
- init(e) {
1552
- if (e = JSON.parse(JSON.stringify(e)), !e || !e.nodeData)
1086
+ changeTheme: Bt,
1087
+ ...se,
1088
+ ...Fe,
1089
+ ...me,
1090
+ ...$e,
1091
+ ..._e,
1092
+ init(t) {
1093
+ if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData)
1553
1094
  return new Error("MindElixir: `data` is required");
1554
- e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, oe(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Ye(this), this.toCenter(), this.layout(), this.linkDiv();
1095
+ t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, J(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && Dt(this), this.toCenter(), this.layout(), this.linkDiv();
1555
1096
  },
1556
1097
  destroy() {
1557
- var e;
1558
- this.disposable.forEach((t) => t()), this.mindElixirBox && (this.mindElixirBox.innerHTML = ""), this.mindElixirBox = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNode = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.waitCopy = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, (e = this.selection) == null || e.destroy(), this.selection = void 0;
1098
+ var t;
1099
+ this.disposable.forEach((e) => e()), this.mindElixirBox && (this.mindElixirBox.innerHTML = ""), this.mindElixirBox = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.waitCopy = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, (t = this.selection) == null || t.destroy(), this.selection = void 0;
1559
1100
  }
1560
1101
  };
1561
- function un({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: c, containerHeight: d }) {
1562
- let a = t + n / 2;
1563
- const u = e + o / 2;
1564
- let h;
1565
- c === T.LHS ? h = i + r : h = i;
1566
- const f = s + l / 2, g = (1 - Math.abs(f - u) / d) * 0.25 * (n / 2);
1567
- return c === T.LHS ? a = a - n / 10 - g : a = a + n / 10 + g, `M ${a} ${u} Q ${a} ${f} ${h} ${f}`;
1102
+ function We({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: a, containerHeight: f }) {
1103
+ let l = e + n / 2;
1104
+ const h = t + o / 2;
1105
+ let d;
1106
+ a === $.LHS ? d = i + r : d = i;
1107
+ const p = s + c / 2, m = (1 - Math.abs(p - h) / f) * 0.25 * (n / 2);
1108
+ return a === $.LHS ? l = l - n / 10 - m : l = l + n / 10 + m, `M ${l} ${h} Q ${l} ${p} ${d} ${p}`;
1568
1109
  }
1569
- function fn({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: c, isFirst: d }) {
1570
- const a = parseInt(this.container.style.getPropertyValue("--gap"));
1571
- let u = 0, h = 0;
1572
- d ? u = e + o / 2 : u = e + o;
1573
- const f = s + l;
1574
- let m = 0, g = 0, p = 0;
1575
- const v = Math.abs(u - f) / 300 * a;
1576
- return c === T.LHS ? (p = t, m = p + a, g = p - a, h = i + a, `M ${m} ${u} C ${p} ${u} ${p + v} ${f} ${g} ${f} H ${h}`) : (p = t + n, m = p - a, g = p + a, h = i + r - a, `M ${m} ${u} C ${p} ${u} ${p - v} ${f} ${g} ${f} H ${h}`);
1110
+ function Ie({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: a, isFirst: f }) {
1111
+ const l = parseInt(this.container.style.getPropertyValue("--gap"));
1112
+ let h = 0, d = 0;
1113
+ f ? h = t + o / 2 : h = t + o;
1114
+ const p = s + c;
1115
+ let u = 0, m = 0, g = 0;
1116
+ const y = Math.abs(h - p) / 300 * l;
1117
+ return a === $.LHS ? (g = e, u = g + l, m = g - l, d = i + l, `M ${u} ${h} C ${g} ${h} ${g + y} ${p} ${m} ${p} H ${d}`) : (g = e + n, u = g - l, m = g + l, d = i + r - l, `M ${u} ${h} C ${g} ${h} ${g - y} ${p} ${m} ${p} H ${d}`);
1118
+ }
1119
+ const Ye = "5.0.0-beta.10";
1120
+ function Xe(t) {
1121
+ return {
1122
+ x: 0,
1123
+ y: 0,
1124
+ moved: !1,
1125
+ // diffrentiate click and move
1126
+ mousedown: !1,
1127
+ onMove(e) {
1128
+ if (this.mousedown) {
1129
+ this.moved = !0;
1130
+ const n = e.movementX, o = e.movementY;
1131
+ t.move(n, o);
1132
+ }
1133
+ },
1134
+ clear() {
1135
+ setTimeout(() => {
1136
+ this.moved = !1, this.mousedown = !1, t.map.style.transition = "transform 0.3s";
1137
+ }, 0);
1138
+ }
1139
+ };
1577
1140
  }
1578
- const pn = "4.5.2", V = document;
1579
- function $({
1580
- el: e,
1581
- direction: t,
1141
+ const z = document;
1142
+ function T({
1143
+ el: t,
1144
+ direction: e,
1582
1145
  locale: n,
1583
1146
  draggable: o,
1584
1147
  editable: s,
1585
1148
  contextMenu: i,
1586
1149
  contextMenuOption: r,
1587
- toolBar: l,
1588
- keypress: c,
1589
- mouseSelectionButton: d,
1590
- selectionContainer: a,
1591
- before: u,
1592
- newTopicName: h,
1593
- allowUndo: f,
1594
- generateMainBranch: m,
1595
- generateSubBranch: g,
1596
- overflowHidden: p,
1597
- theme: v,
1598
- alignment: E
1150
+ toolBar: c,
1151
+ keypress: a,
1152
+ mouseSelectionButton: f,
1153
+ selectionContainer: l,
1154
+ before: h,
1155
+ newTopicName: d,
1156
+ allowUndo: p,
1157
+ generateMainBranch: u,
1158
+ generateSubBranch: m,
1159
+ overflowHidden: g,
1160
+ theme: y,
1161
+ alignment: C
1599
1162
  }) {
1600
- let y = null;
1601
- const _ = Object.prototype.toString.call(e);
1602
- if (_ === "[object HTMLDivElement]" ? y = e : _ === "[object String]" && (y = document.querySelector(e)), !y)
1163
+ let v = null;
1164
+ const w = Object.prototype.toString.call(t);
1165
+ if (w === "[object HTMLDivElement]" ? v = t : w === "[object String]" && (v = document.querySelector(t)), !v)
1603
1166
  throw new Error("MindElixir: el is not a valid element");
1604
- y.style.position = "relative", y.innerHTML = "", this.mindElixirBox = y, this.disposable = [], this.before = u || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = i === void 0 ? !0 : i, this.toolBar = l === void 0 ? !0 : l, this.keypress = c === void 0 ? !0 : c, this.mouseSelectionButton = d || 0, this.direction = typeof t == "number" ? t : 1, this.draggable = o === void 0 ? !0 : o, this.newTopicName = h || "new node", this.editable = s === void 0 ? !0 : s, this.allowUndo = f === void 0 ? !1 : f, this.currentNode = null, this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = m || un, this.generateSubBranch = g || fn, this.overflowHidden = p || !1, this.bus = He.create(), this.container = V.createElement("div"), this.selectionContainer = a || this.container, this.container.className = "map-container";
1605
- const w = window.matchMedia("(prefers-color-scheme: dark)");
1606
- this.theme = v || (w.matches ? we : xe);
1607
- const S = V.createElement("div");
1608
- S.className = "map-canvas", this.map = S, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = V.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = W("lines"), this.summarySvg = W("summary"), this.linkController = W("linkcontroller"), this.P2 = V.createElement("div"), this.P3 = V.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = de(), this.line2 = de(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = W("topiclinks"), this.alignment = E ?? "root", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : ke(this);
1167
+ v.style.position = "relative", v.innerHTML = "", this.mindElixirBox = v, this.disposable = [], this.before = h || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = i === void 0 ? !0 : i, this.toolBar = c === void 0 ? !0 : c, this.keypress = a === void 0 ? !0 : a, this.mouseSelectionButton = f || 0, this.direction = typeof e == "number" ? e : 1, this.draggable = o === void 0 ? !0 : o, this.newTopicName = d || "new node", this.editable = s === void 0 ? !0 : s, this.allowUndo = p === void 0 ? !1 : p, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = u || We, this.generateSubBranch = m || Ie, this.overflowHidden = g || !1, this.dragMoveHelper = Xe(this), this.bus = vt(), this.container = z.createElement("div"), this.selectionContainer = l || this.container, this.container.className = "map-container";
1168
+ const b = window.matchMedia("(prefers-color-scheme: dark)");
1169
+ this.theme = y || (b.matches ? lt : ct);
1170
+ const E = z.createElement("div");
1171
+ E.className = "map-canvas", setTimeout(() => {
1172
+ E.style.transition = "all 0.3s";
1173
+ }, 300), this.map = E, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = z.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = O("lines"), this.summarySvg = O("summary"), this.linkController = O("linkcontroller"), this.P2 = z.createElement("div"), this.P3 = z.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = ot(), this.line2 = ot(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = O("topiclinks"), this.alignment = C ?? "root", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : xt(this);
1609
1174
  }
1610
- $.prototype = dn;
1611
- $.LEFT = j;
1612
- $.RIGHT = te;
1613
- $.SIDE = ne;
1614
- $.THEME = xe;
1615
- $.DARK_THEME = we;
1616
- $.version = pn;
1617
- $.E = M;
1618
- $.dragMoveHelper = k;
1175
+ T.prototype = Re;
1176
+ Object.defineProperty(T.prototype, "currentNode", {
1177
+ get() {
1178
+ return this.currentNodes.at(-1);
1179
+ },
1180
+ enumerable: !0
1181
+ });
1182
+ T.LEFT = B;
1183
+ T.RIGHT = X;
1184
+ T.SIDE = G;
1185
+ T.THEME = ct;
1186
+ T.DARK_THEME = lt;
1187
+ T.version = Ye;
1188
+ T.E = M;
1619
1189
  export {
1620
- $ as default
1190
+ T as default
1621
1191
  };