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,7 +1,10 @@
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)}})();
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
+ var ot = Object.defineProperty;
3
+ var st = (e, t, n) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var E = (e, t, n) => (st(e, typeof t != "symbol" ? t + "" : t, n), n);
2
5
  (function(e) {
3
- var t, n, o, i, s, 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>', l = (l = document.getElementsByTagName("script"))[l.length - 1].getAttribute("data-injectcss");
4
- if (l && !e.__iconfont__svg__cssinject__) {
6
+ 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");
7
+ if (c && !e.__iconfont__svg__cssinject__) {
5
8
  e.__iconfont__svg__cssinject__ = !0;
6
9
  try {
7
10
  document.write(
@@ -11,25 +14,25 @@
11
14
  }
12
15
  }
13
16
  function d() {
14
- s || (s = !0, o());
17
+ i || (i = !0, o());
15
18
  }
16
19
  t = function() {
17
- var a, u, h, p;
18
- (p = document.createElement("div")).innerHTML = c, c = null, (h = p.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 ? (p = a, (h = u.firstChild).parentNode.insertBefore(p, h)) : u.appendChild(a));
20
+ var a, u, h, m;
21
+ (m = document.createElement("div")).innerHTML = l, l = null, (h = m.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 ? (m = a, (h = u.firstChild).parentNode.insertBefore(m, h)) : u.appendChild(a));
19
22
  }, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(t, 0) : (n = function() {
20
23
  document.removeEventListener("DOMContentLoaded", n, !1), t();
21
- }, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (o = t, i = e.document, s = !1, (r = function() {
24
+ }, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (o = t, s = e.document, i = !1, (r = function() {
22
25
  try {
23
- i.documentElement.doScroll("left");
26
+ s.documentElement.doScroll("left");
24
27
  } catch {
25
28
  return void setTimeout(r, 50);
26
29
  }
27
30
  d();
28
- })(), i.onreadystatechange = function() {
29
- i.readyState == "complete" && (i.onreadystatechange = null, d());
31
+ })(), s.onreadystatechange = function() {
32
+ s.readyState == "complete" && (s.onreadystatechange = null, d());
30
33
  });
31
34
  })(window);
32
- const $ = 0, P = 1, ae = 2, Be = {
35
+ const A = 0, P = 1, ce = 2, Re = {
33
36
  name: "Latte",
34
37
  type: "light",
35
38
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -43,7 +46,7 @@ const $ = 0, P = 1, ae = 2, Be = {
43
46
  "--panel-bgcolor": "#ffffff",
44
47
  "--panel-border-color": "#eaeaea"
45
48
  }
46
- }, Re = {
49
+ }, ze = {
47
50
  name: "Dark",
48
51
  type: "dark",
49
52
  palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
@@ -57,7 +60,7 @@ const $ = 0, P = 1, ae = 2, Be = {
57
60
  "--panel-border-color": "#696969"
58
61
  }
59
62
  };
60
- function ie(e) {
63
+ function oe(e) {
61
64
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
62
65
  }
63
66
  const se = function(e, t) {
@@ -77,34 +80,36 @@ const se = function(e, t) {
77
80
  for (let n = 0; n < e.children.length; n++)
78
81
  B(e.children[n], e);
79
82
  };
80
- function pe(e) {
81
- if (e.id = U(), e.children)
83
+ function fe(e) {
84
+ if (e.id = I(), e.children)
82
85
  for (let t = 0; t < e.children.length; t++)
83
- pe(e.children[t]);
86
+ fe(e.children[t]);
84
87
  }
85
- function re(e, t, n, o) {
86
- const i = o - t, s = e - n;
87
- let r = Math.atan(Math.abs(i) / Math.abs(s)) / 3.14 * 180;
88
- s < 0 && i > 0 && (r = 180 - r), s < 0 && i < 0 && (r = 180 + r), s > 0 && i < 0 && (r = 360 - r);
89
- const c = 12, l = 30, d = r + l, a = r - l;
88
+ function ie(e, t, n, o) {
89
+ const s = o - t, i = e - n;
90
+ let r = Math.atan(Math.abs(s) / Math.abs(i)) / 3.14 * 180;
91
+ if (isNaN(r))
92
+ return;
93
+ i < 0 && s > 0 && (r = 180 - r), i < 0 && s < 0 && (r = 180 + r), i > 0 && s < 0 && (r = 360 - r);
94
+ const l = 12, c = 30, d = r + c, a = r - c;
90
95
  return {
91
- x1: n + Math.cos(Math.PI * d / 180) * c,
92
- y1: o - Math.sin(Math.PI * d / 180) * c,
93
- x2: n + Math.cos(Math.PI * a / 180) * c,
94
- y2: o - Math.sin(Math.PI * a / 180) * c
96
+ x1: n + Math.cos(Math.PI * d / 180) * l,
97
+ y1: o - Math.sin(Math.PI * d / 180) * l,
98
+ x2: n + Math.cos(Math.PI * a / 180) * l,
99
+ y2: o - Math.sin(Math.PI * a / 180) * l
95
100
  };
96
101
  }
97
- function U() {
102
+ function I() {
98
103
  return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
99
104
  }
100
- const nt = function() {
101
- const e = U();
105
+ const it = function() {
106
+ const e = I();
102
107
  return {
103
108
  topic: this.newTopicName,
104
109
  id: e
105
110
  };
106
111
  };
107
- function me(e) {
112
+ function pe(e) {
108
113
  return JSON.parse(
109
114
  JSON.stringify(e, (n, o) => {
110
115
  if (n !== "parent")
@@ -120,148 +125,129 @@ const R = (e, t) => {
120
125
  }, C = (e, t) => {
121
126
  for (const n in t)
122
127
  e.setAttribute(n, t[n]);
123
- }, he = (e) => e ? e.tagName === "ME-TPC" : !1, de = (e) => e.filter((t) => {
124
- for (let n = 0; n < e.length; n++) {
125
- if (t === e[n])
128
+ }, Fe = (e) => e ? e.tagName === "ME-TPC" : !1, ae = (e) => e.filter((t) => t.nodeObj.parent).filter((t, n, o) => {
129
+ for (let s = 0; s < o.length; s++) {
130
+ if (t === o[s])
126
131
  continue;
127
- if (e[n].parentElement.parentElement.contains(t))
132
+ const { parent: i } = t.nodeObj;
133
+ if (i === o[s].nodeObj)
128
134
  return !1;
129
135
  }
130
136
  return !0;
131
- }), k = {
132
- moved: !1,
133
- // diffrentiate click and move
134
- mousedown: !1,
135
- onMove(e, t) {
136
- if (this.mousedown) {
137
- this.moved = !0;
138
- const n = e.movementX, o = e.movementY, { container: i, map: s, scaleVal: r } = t;
139
- let c = i.scrollLeft - n, l = i.scrollTop - o;
140
- if (r < 1) {
141
- const d = (i.scrollWidth - s.clientWidth * r) / 2, a = (i.scrollHeight - s.clientHeight * r) / 2;
142
- c = Math.max(d, Math.min(i.scrollWidth - d - i.clientWidth, c)), l = Math.max(a, Math.min(i.scrollHeight - a - i.clientHeight, l));
143
- }
144
- i.scrollTo(c, l);
145
- }
146
- },
147
- clear() {
148
- setTimeout(() => {
149
- this.moved = !1, this.mousedown = !1;
150
- }, 0);
151
- }
137
+ }), qe = (e) => {
138
+ const t = /translate\(([^,]+),\s*([^)]+)\)/, n = e.match(t);
139
+ return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
152
140
  };
153
- function ot(e) {
154
- e.map.addEventListener("click", (t) => {
155
- var o, i;
156
- if (t.button !== 0)
141
+ function rt(e) {
142
+ const { dragMoveHelper: t } = e;
143
+ e.map.addEventListener("click", (n) => {
144
+ var i, r, l;
145
+ if (n.button !== 0)
157
146
  return;
158
- if ((o = e.helper1) != null && o.moved) {
147
+ if ((i = e.helper1) != null && i.moved) {
159
148
  e.helper1.clear();
160
149
  return;
161
150
  }
162
- if ((i = e.helper2) != null && i.moved) {
151
+ if ((r = e.helper2) != null && r.moved) {
163
152
  e.helper2.clear();
164
153
  return;
165
154
  }
166
- if (k.moved) {
167
- k.clear();
155
+ if (t.moved) {
156
+ t.clear();
168
157
  return;
169
158
  }
170
- e.clearSelection();
171
- const n = t.target;
172
- if (n.tagName === "ME-EPD")
173
- e.expandNode(n.previousSibling);
174
- else if (he(n))
175
- e.selectNode(n, !1, t);
176
- else if (e.editable)
177
- n.tagName === "text" ? n.dataset.type === "custom-link" ? e.selectArrow(n.parentElement) : e.selectSummary(n.parentElement) : n.className;
178
- else
159
+ const o = n.target;
160
+ if (o.tagName === "ME-EPD")
161
+ e.expandNode(o.previousSibling);
162
+ else if (!e.editable)
179
163
  return;
180
- }), e.map.addEventListener("dblclick", (t) => {
164
+ const s = (l = o.parentElement) == null ? void 0 : l.parentElement;
165
+ s.getAttribute("class") === "topiclinks" ? e.selectArrow(o.parentElement) : s.getAttribute("class") === "summary" && e.selectSummary(o.parentElement);
166
+ }), e.map.addEventListener("dblclick", (n) => {
167
+ var i;
181
168
  if (!e.editable)
182
169
  return;
183
- const n = t.target;
184
- he(n) ? e.beginEdit(n) : n.tagName === "text" && (n.dataset.type === "custom-link" ? e.editArrowLabel(n.parentElement) : e.editSummary(n.parentElement));
185
- }), e.map.addEventListener("mousemove", (t) => {
186
- t.target.contentEditable === "inherit" && k.onMove(t, e);
187
- }), e.map.addEventListener("mousedown", (t) => {
188
- const n = e.mouseSelectionButton === 0 ? 2 : 0;
189
- t.button === n && t.target.contentEditable === "inherit" && (k.moved = !1, k.mousedown = !0);
190
- }), e.map.addEventListener("mouseleave", (t) => {
191
- const n = e.mouseSelectionButton === 0 ? 2 : 0;
192
- t.button === n && k.clear();
193
- }), e.map.addEventListener("mouseup", (t) => {
194
- const n = e.mouseSelectionButton === 0 ? 2 : 0;
195
- t.button === n && k.clear();
170
+ const o = n.target;
171
+ Fe(o) && e.beginEdit(o);
172
+ const s = (i = o.parentElement) == null ? void 0 : i.parentElement;
173
+ s.getAttribute("class") === "topiclinks" ? e.editArrowLabel(o.parentElement) : s.getAttribute("class") === "summary" && e.editSummary(o.parentElement);
174
+ }), e.map.addEventListener("mousedown", (n) => {
175
+ const o = e.mouseSelectionButton === 0 ? 2 : 0;
176
+ n.button === o && n.target.contentEditable === "inherit" && (t.moved = !1, t.mousedown = !0, e.map.style.transition = "none");
177
+ }), document.addEventListener("mousemove", (n) => {
178
+ n.target.contentEditable === "inherit" && t.onMove(n), t.x = n.clientX, t.y = n.clientY;
179
+ }), document.addEventListener("mouseup", (n) => {
180
+ const o = e.mouseSelectionButton === 0 ? 2 : 0;
181
+ n.button === o && t.clear();
182
+ }), document.addEventListener("contextmenu", (n) => {
183
+ t.moved && n.preventDefault();
196
184
  });
197
185
  }
198
- const it = {
199
- create() {
200
- return {
201
- handlers: {},
202
- showHandler: function() {
203
- },
204
- addListener: function(e, t) {
205
- this.handlers[e] === void 0 && (this.handlers[e] = []), this.handlers[e].push(t);
206
- },
207
- fire: function(e, ...t) {
208
- if (this.handlers[e] instanceof Array) {
209
- const n = this.handlers[e];
210
- for (let o = 0; o < n.length; o++)
211
- n[o](...t);
212
- }
213
- },
214
- removeListener: function(e, t) {
215
- if (!this.handlers[e])
216
- return;
186
+ function lt() {
187
+ return {
188
+ handlers: {},
189
+ showHandler: function() {
190
+ },
191
+ addListener: function(e, t) {
192
+ this.handlers[e] === void 0 && (this.handlers[e] = []), this.handlers[e].push(t);
193
+ },
194
+ fire: function(e, ...t) {
195
+ if (this.handlers[e] instanceof Array) {
217
196
  const n = this.handlers[e];
218
- if (!t)
219
- n.length = 0;
220
- else if (n.length)
221
- for (let o = 0; o < n.length; o++)
222
- n[o] === t && this.handlers[e].splice(o, 1);
197
+ for (let o = 0; o < n.length; o++)
198
+ n[o](...t);
223
199
  }
224
- };
225
- }
226
- };
227
- var L = /* @__PURE__ */ ((e) => (e.LHS = "lhs", e.RHS = "rhs", e))(L || {});
228
- const ce = document, st = function() {
200
+ },
201
+ removeListener: function(e, t) {
202
+ if (!this.handlers[e])
203
+ return;
204
+ const n = this.handlers[e];
205
+ if (!t)
206
+ n.length = 0;
207
+ else if (n.length)
208
+ for (let o = 0; o < n.length; o++)
209
+ n[o] === t && this.handlers[e].splice(o, 1);
210
+ }
211
+ };
212
+ }
213
+ var M = /* @__PURE__ */ ((e) => (e.LHS = "lhs", e.RHS = "rhs", e))(M || {});
214
+ const re = document, ct = function() {
229
215
  this.nodes.innerHTML = "";
230
216
  const e = this.createTopic(this.nodeData);
231
- ge(e, this.nodeData), e.draggable = !1;
232
- const t = ce.createElement("me-root");
217
+ me(e, this.nodeData), e.draggable = !1;
218
+ const t = re.createElement("me-root");
233
219
  t.appendChild(e);
234
220
  const n = this.nodeData.children || [];
235
- if (this.direction === ae) {
236
- let o = 0, i = 0;
237
- n.map((s) => {
238
- s.direction === $ ? o += 1 : s.direction === P ? i += 1 : o <= i ? (s.direction = $, o += 1) : (s.direction = P, i += 1);
221
+ if (this.direction === ce) {
222
+ let o = 0, s = 0;
223
+ n.map((i) => {
224
+ i.direction === A ? o += 1 : i.direction === P ? s += 1 : o <= s ? (i.direction = A, o += 1) : (i.direction = P, s += 1);
239
225
  });
240
226
  }
241
- rt(this, n, t);
242
- }, rt = function(e, t, n) {
243
- const o = ce.createElement("me-main");
244
- o.className = L.LHS;
245
- const i = ce.createElement("me-main");
246
- i.className = L.RHS;
247
- for (let s = 0; s < t.length; s++) {
248
- const r = t[s], { grp: c } = e.createWrapper(r);
249
- e.direction === ae ? r.direction === $ ? o.appendChild(c) : i.appendChild(c) : e.direction === $ ? o.appendChild(c) : i.appendChild(c);
250
- }
251
- e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(i), e.nodes.appendChild(e.lines);
252
- }, ct = function(e, t) {
253
- const n = ce.createElement("me-children");
227
+ at(this, n, t);
228
+ }, at = function(e, t, n) {
229
+ const o = re.createElement("me-main");
230
+ o.className = M.LHS;
231
+ const s = re.createElement("me-main");
232
+ s.className = M.RHS;
233
+ for (let i = 0; i < t.length; i++) {
234
+ const r = t[i], { grp: l } = e.createWrapper(r);
235
+ e.direction === ce ? r.direction === A ? o.appendChild(l) : s.appendChild(l) : e.direction === A ? o.appendChild(l) : s.appendChild(l);
236
+ }
237
+ e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(s), e.nodes.appendChild(e.lines);
238
+ }, dt = function(e, t) {
239
+ const n = re.createElement("me-children");
254
240
  for (let o = 0; o < t.length; o++) {
255
- const i = t[o], { grp: s } = e.createWrapper(i);
256
- n.appendChild(s);
241
+ const s = t[o], { grp: i } = e.createWrapper(s);
242
+ n.appendChild(i);
257
243
  }
258
244
  return n;
259
- }, T = document, S = (e, t) => {
260
- const o = (t ? t.mindElixirBox : T).querySelector(`[data-nodeid=me${e}]`);
245
+ }, L = document, N = (e, t) => {
246
+ const o = (t ? t.mindElixirBox : L).querySelector(`[data-nodeid=me${e}]`);
261
247
  if (!o)
262
248
  throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
263
249
  return o;
264
- }, ge = function(e, t) {
250
+ }, me = function(e, t) {
265
251
  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) {
266
252
  e.innerHTML = t.dangerouslySetInnerHTML;
267
253
  return;
@@ -269,60 +255,60 @@ const ce = document, st = function() {
269
255
  if (t.image) {
270
256
  const n = t.image;
271
257
  if (n.url && n.width && n.height) {
272
- const o = T.createElement("img");
258
+ const o = L.createElement("img");
273
259
  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;
274
260
  }
275
261
  } else
276
262
  e.image && (e.image = void 0);
277
263
  {
278
- const n = T.createElement("span");
264
+ const n = L.createElement("span");
279
265
  n.className = "text", n.textContent = t.topic, e.appendChild(n), e.text = n;
280
266
  }
281
267
  if (t.hyperLink) {
282
- const n = T.createElement("a");
268
+ const n = L.createElement("a");
283
269
  n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = t.hyperLink, e.appendChild(n), e.link = n;
284
270
  } else
285
271
  e.link && (e.link = void 0);
286
272
  if (t.icons && t.icons.length) {
287
- const n = T.createElement("span");
288
- n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${ie(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
273
+ const n = L.createElement("span");
274
+ n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${oe(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
289
275
  } else
290
276
  e.icons && (e.icons = void 0);
291
277
  if (t.tags && t.tags.length) {
292
- const n = T.createElement("div");
293
- n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${ie(o)}</span>`).join(""), e.appendChild(n), e.tags = n;
278
+ const n = L.createElement("div");
279
+ n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${oe(o)}</span>`).join(""), e.appendChild(n), e.tags = n;
294
280
  } else
295
281
  e.tags && (e.tags = void 0);
296
- }, lt = function(e, t) {
297
- const n = T.createElement("me-wrapper"), { p: o, tpc: i } = this.createParent(e);
282
+ }, ht = function(e, t) {
283
+ const n = L.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(e);
298
284
  if (n.appendChild(o), !t && e.children && e.children.length > 0) {
299
- const s = ve(e.expanded);
300
- if (o.appendChild(s), e.expanded !== !1) {
301
- const r = ct(this, e.children);
285
+ const i = ge(e.expanded);
286
+ if (o.appendChild(i), e.expanded !== !1) {
287
+ const r = dt(this, e.children);
302
288
  n.appendChild(r);
303
289
  }
304
290
  }
305
- return { grp: n, top: o, tpc: i };
306
- }, at = function(e) {
307
- const t = T.createElement("me-parent"), n = this.createTopic(e);
308
- return ge(n, e), t.appendChild(n), { p: t, tpc: n };
309
- }, dt = function(e) {
310
- const t = T.createElement("me-children");
291
+ return { grp: n, top: o, tpc: s };
292
+ }, ut = function(e) {
293
+ const t = L.createElement("me-parent"), n = this.createTopic(e);
294
+ return me(n, e), t.appendChild(n), { p: t, tpc: n };
295
+ }, ft = function(e) {
296
+ const t = L.createElement("me-children");
311
297
  return t.append(...e), t;
312
- }, ht = function(e) {
313
- const t = T.createElement("me-tpc");
298
+ }, pt = function(e) {
299
+ const t = L.createElement("me-tpc");
314
300
  return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t.draggable = this.draggable, t;
315
301
  };
316
- function ze(e) {
317
- const t = T.createRange();
302
+ function Ve(e) {
303
+ const t = L.createRange();
318
304
  t.selectNodeContents(e);
319
305
  const n = window.getSelection();
320
306
  n && (n.removeAllRanges(), n.addRange(t));
321
307
  }
322
- const ut = function(e) {
308
+ const mt = function(e) {
323
309
  if (!e)
324
310
  return;
325
- const t = T.createElement("div"), n = e.text.textContent;
311
+ const t = L.createElement("div"), n = e.text.textContent;
326
312
  e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "plaintext-only", t.spellcheck = !1;
327
313
  const o = getComputedStyle(e);
328
314
  t.style.cssText = `min-width:${e.offsetWidth - 8}px;
@@ -331,33 +317,33 @@ const ut = function(e) {
331
317
  margin:${o.margin};
332
318
  font:${o.font};
333
319
  background-color:${o.backgroundColor !== "rgba(0, 0, 0, 0)" && o.backgroundColor};
334
- border-radius:${o.borderRadius};`, this.direction === $ && (t.style.right = "0"), t.focus(), ze(t), this.bus.fire("operation", {
320
+ border-radius:${o.borderRadius};`, this.direction === A && (t.style.right = "0"), t.focus(), Ve(t), this.bus.fire("operation", {
335
321
  name: "beginEdit",
336
322
  obj: e.nodeObj
337
- }), t.addEventListener("keydown", (i) => {
338
- i.stopPropagation();
339
- const s = i.key;
340
- if (s === "Enter" || s === "Tab") {
341
- if (i.shiftKey)
323
+ }), t.addEventListener("keydown", (s) => {
324
+ s.stopPropagation();
325
+ const i = s.key;
326
+ if (i === "Enter" || i === "Tab") {
327
+ if (s.shiftKey)
342
328
  return;
343
- i.preventDefault(), t.blur(), this.map.focus();
329
+ s.preventDefault(), t.blur(), this.map.focus();
344
330
  }
345
331
  }), t.addEventListener("blur", () => {
346
332
  var r;
347
333
  if (!t)
348
334
  return;
349
- const i = e.nodeObj, s = ((r = t.textContent) == null ? void 0 : r.trim()) || "";
350
- s === "" ? i.topic = n : i.topic = s, t.remove(), s !== n && (e.text.textContent = i.topic, this.linkDiv(), this.bus.fire("operation", {
335
+ const s = e.nodeObj, i = ((r = t.textContent) == null ? void 0 : r.trim()) || "";
336
+ i === "" ? s.topic = n : s.topic = i, t.remove(), i !== n && (e.text.textContent = s.topic, this.linkDiv(), this.bus.fire("operation", {
351
337
  name: "finishEdit",
352
- obj: i,
338
+ obj: s,
353
339
  origin: n
354
340
  }));
355
341
  });
356
- }, ve = function(e) {
357
- const t = T.createElement("me-epd");
342
+ }, ge = function(e) {
343
+ const t = L.createElement("me-epd");
358
344
  return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
359
- }, K = document, Z = "http://www.w3.org/2000/svg", Fe = function(e, t, n) {
360
- const o = K.createElementNS(Z, "path");
345
+ }, V = document, Y = "http://www.w3.org/2000/svg", Ie = function(e, t, n) {
346
+ const o = V.createElementNS(Y, "path");
361
347
  return C(o, {
362
348
  d: e,
363
349
  stroke: t || "#666",
@@ -365,83 +351,111 @@ const ut = function(e) {
365
351
  "stroke-width": n
366
352
  }), o;
367
353
  }, J = function(e) {
368
- const t = K.createElementNS(Z, "svg");
354
+ const t = V.createElementNS(Y, "svg");
369
355
  return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
370
- }, Ne = function() {
371
- const e = K.createElementNS(Z, "line");
356
+ }, Ee = function() {
357
+ const e = V.createElementNS(Y, "line");
372
358
  return e.setAttribute("stroke", "#bbb"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e;
373
- }, ft = function(e, t, n) {
374
- const o = {
375
- stroke: "rgb(235, 95, 82)",
376
- fill: "none",
377
- "stroke-linecap": "cap",
378
- "stroke-width": "2"
379
- }, i = K.createElementNS(Z, "g");
380
- return [e, t, n].forEach((s, r) => {
381
- const c = K.createElementNS(Z, "path"), l = {
382
- d: s,
383
- ...o
384
- };
385
- C(c, l), r === 0 && c.setAttribute("stroke-dasharray", "8,2"), i.appendChild(c);
386
- }), i;
387
- }, qe = function(e, t, n) {
359
+ }, gt = function(e, t, n) {
360
+ const o = V.createElementNS(Y, "g");
361
+ return [
362
+ {
363
+ name: "line",
364
+ d: e
365
+ },
366
+ {
367
+ name: "arrow1",
368
+ d: t
369
+ },
370
+ {
371
+ name: "arrow2",
372
+ d: n
373
+ }
374
+ ].forEach((i, r) => {
375
+ const l = i.d, c = V.createElementNS(Y, "path");
376
+ C(c, {
377
+ d: l,
378
+ stroke: "rgb(235, 95, 82)",
379
+ fill: "none",
380
+ "stroke-linecap": "cap",
381
+ "stroke-width": "2"
382
+ }), r === 0 && c.setAttribute("stroke-dasharray", "8,2");
383
+ const a = V.createElementNS(Y, "path");
384
+ C(a, {
385
+ d: l,
386
+ stroke: "transparent",
387
+ fill: "none",
388
+ "stroke-width": "15"
389
+ }), o.appendChild(a), o.appendChild(c), o[i.name] = c;
390
+ }), o;
391
+ }, Ke = function(e, t, n) {
388
392
  if (!t)
389
393
  return;
390
- const o = K.createElement("div");
394
+ const o = V.createElement("div");
391
395
  e.nodes.appendChild(o);
392
- const i = t.innerHTML;
393
- o.id = "input-box", o.textContent = i, o.contentEditable = "plaintext-only", o.spellcheck = !1;
394
- const s = t.getBBox();
396
+ const s = t.innerHTML;
397
+ o.id = "input-box", o.textContent = s, o.contentEditable = "plaintext-only", o.spellcheck = !1;
398
+ const i = t.getBBox();
395
399
  o.style.cssText = `
396
- min-width:${Math.max(88, s.width)}px;
400
+ min-width:${Math.max(88, i.width)}px;
397
401
  position:absolute;
398
- left:${s.x}px;
399
- top:${s.y}px;
402
+ left:${i.x}px;
403
+ top:${i.y}px;
400
404
  padding: 2px 4px;
401
405
  margin: -2px -4px;
402
- `, o.focus(), ze(o), o.addEventListener("keydown", (r) => {
406
+ `, o.focus(), Ve(o), o.addEventListener("keydown", (r) => {
403
407
  r.stopPropagation();
404
- const c = r.key;
405
- if (c === "Enter" || c === "Tab") {
408
+ const l = r.key;
409
+ if (l === "Enter" || l === "Tab") {
406
410
  if (r.shiftKey)
407
411
  return;
408
412
  r.preventDefault(), o.blur(), e.map.focus();
409
413
  }
410
414
  }), o.addEventListener("blur", () => {
411
- o && n(o);
415
+ var l;
416
+ if (!o)
417
+ return;
418
+ const r = ((l = o.textContent) == null ? void 0 : l.trim()) || "";
419
+ r === "" ? n.label = s : n.label = r, o.remove(), r !== s && (t.innerHTML = n.label, e.linkDiv(), "parent" in n ? e.bus.fire("operation", {
420
+ name: "finishEditSummary",
421
+ obj: n
422
+ }) : e.bus.fire("operation", {
423
+ name: "finishEditArrowLabel",
424
+ obj: n
425
+ }));
412
426
  });
413
- }, pt = function(e) {
414
- const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, i = t.offsetWidth, s = t.offsetHeight, c = this.map.querySelector("me-nodes").offsetWidth;
415
- this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.alignment === "root" ? this.nodes.style.left = `${1e4 - o - i / 2}px` : this.nodes.style.left = `${1e4 - c / 2}px`;
416
- const l = this.map.querySelectorAll("me-main > me-wrapper");
427
+ }, yt = function(e) {
428
+ 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;
429
+ 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`;
430
+ const c = this.map.querySelectorAll("me-main > me-wrapper");
417
431
  this.lines.innerHTML = "";
418
- for (let d = 0; d < l.length; d++) {
419
- const a = l[d], u = a.querySelector("me-tpc"), { offsetLeft: h, offsetTop: p } = R(this.nodes, u), g = u.offsetWidth, v = u.offsetHeight, m = a.parentNode.className, f = this.generateMainBranch({ pT: n, pL: o, pW: i, pH: s, cT: p, cL: h, cW: g, cH: v, direction: m, containerHeight: this.nodes.offsetHeight }), b = this.theme.palette, x = u.nodeObj.branchColor || b[d % b.length];
420
- u.style.borderColor = x, this.lines.appendChild(Fe(f, x, "3"));
421
- const E = a.children[0].children[1];
422
- if (E && (E.style.top = (E.parentNode.offsetHeight - E.offsetHeight) / 2 + "px", m === L.LHS ? E.style.left = "-10px" : E.style.right = "-10px"), e && e !== a)
432
+ for (let d = 0; d < c.length; d++) {
433
+ const a = c[d], u = a.querySelector("me-tpc"), { offsetLeft: h, offsetTop: m } = R(this.nodes, u), p = u.offsetWidth, y = u.offsetHeight, g = a.parentNode.className, f = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: m, cL: h, cW: p, cH: y, direction: g, containerHeight: this.nodes.offsetHeight }), v = this.theme.palette, x = u.nodeObj.branchColor || v[d % v.length];
434
+ u.style.borderColor = x, this.lines.appendChild(Ie(f, x, "3"));
435
+ const S = a.children[0].children[1];
436
+ if (S && (S.style.top = (S.parentNode.offsetHeight - S.offsetHeight) / 2 + "px", g === M.LHS ? S.style.left = "-10px" : S.style.right = "-10px"), e && e !== a)
423
437
  continue;
424
- const y = J("subLines"), w = a.lastChild;
425
- w.tagName === "svg" && w.remove(), a.appendChild(y), Ve(this, y, x, a, m, !0);
438
+ const b = J("subLines"), w = a.lastChild;
439
+ w.tagName === "svg" && w.remove(), a.appendChild(b), We(this, b, x, a, g, !0);
426
440
  }
427
441
  this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
428
- }, Ve = function(e, t, n, o, i, s) {
429
- const r = o.firstChild, c = o.children[1].children;
430
- if (c.length === 0)
442
+ }, We = function(e, t, n, o, s, i) {
443
+ const r = o.firstChild, l = o.children[1].children;
444
+ if (l.length === 0)
431
445
  return;
432
- const l = r.offsetTop, d = r.offsetLeft, a = r.offsetWidth, u = r.offsetHeight;
433
- for (let h = 0; h < c.length; h++) {
434
- const p = c[h], g = p.firstChild, v = g.offsetTop, m = g.offsetLeft, f = g.offsetWidth, b = g.offsetHeight, x = g.firstChild.nodeObj.branchColor || n, E = e.generateSubBranch({ pT: l, pL: d, pW: a, pH: u, cT: v, cL: m, cW: f, cH: b, direction: i, isFirst: s });
435
- t.appendChild(Fe(E, x, "2"));
436
- const y = g.children[1];
437
- if (y) {
438
- if (y.style.bottom = -(y.offsetHeight / 2) + "px", i === L.LHS ? y.style.left = "10px" : i === L.RHS && (y.style.right = "10px"), !y.expanded)
446
+ const c = r.offsetTop, d = r.offsetLeft, a = r.offsetWidth, u = r.offsetHeight;
447
+ for (let h = 0; h < l.length; h++) {
448
+ const m = l[h], p = m.firstChild, y = p.offsetTop, g = p.offsetLeft, f = p.offsetWidth, v = p.offsetHeight, x = p.firstChild.nodeObj.branchColor || n, S = e.generateSubBranch({ pT: c, pL: d, pW: a, pH: u, cT: y, cL: g, cW: f, cH: v, direction: s, isFirst: i });
449
+ t.appendChild(Ie(S, x, "2"));
450
+ const b = p.children[1];
451
+ if (b) {
452
+ if (b.style.bottom = -(b.offsetHeight / 2) + "px", s === M.LHS ? b.style.left = "10px" : s === M.RHS && (b.style.right = "10px"), !b.expanded)
439
453
  continue;
440
454
  } else
441
455
  continue;
442
- Ve(e, t, x, p, i);
456
+ We(e, t, x, m, s);
443
457
  }
444
- }, Ce = {
458
+ }, Se = {
445
459
  addChild: "插入子节点",
446
460
  addParent: "插入父节点",
447
461
  addSibling: "插入同级节点",
@@ -453,9 +467,9 @@ const ut = function(e) {
453
467
  link: "连接",
454
468
  clickTips: "请点击目标节点",
455
469
  summary: "摘要"
456
- }, Se = {
457
- cn: Ce,
458
- zh_CN: Ce,
470
+ }, Ce = {
471
+ cn: Se,
472
+ zh_CN: Se,
459
473
  zh_TW: {
460
474
  addChild: "插入子節點",
461
475
  addParent: "插入父節點",
@@ -574,123 +588,122 @@ const ut = function(e) {
574
588
  summary: "요약"
575
589
  }
576
590
  };
577
- function mt(e, t) {
578
- const n = (y) => {
591
+ function vt(e, t) {
592
+ const n = (b) => {
579
593
  const w = document.createElement("div");
580
- return w.innerText = y, w.className = "tips", w;
581
- }, o = (y, w, _) => {
582
- const M = document.createElement("li");
583
- return M.id = y, M.innerHTML = `<span>${ie(w)}</span><span ${_ ? 'class="key"' : ""}>${ie(_)}</span>`, M;
584
- }, i = Se[e.locale] ? e.locale : "en", s = Se[i], r = o("cm-add_child", s.addChild, "Tab"), c = o("cm-add_parent", s.addParent, "Ctrl + Enter"), l = o("cm-add_sibling", s.addSibling, "Enter"), d = o("cm-remove_child", s.removeNode, "Delete"), a = o("cm-fucus", s.focus, ""), u = o("cm-unfucus", s.cancelFocus, ""), h = o("cm-up", s.moveUp, "PgUp"), p = o("cm-down", s.moveDown, "Pgdn"), g = o("cm-link", s.link, ""), v = o("cm-link-bidirectional", "Bidreactional Link", ""), m = o("cm-summary", s.summary, ""), f = document.createElement("ul");
585
- if (f.className = "menu-list", f.appendChild(r), f.appendChild(c), f.appendChild(l), f.appendChild(d), (!t || t.focus) && (f.appendChild(a), f.appendChild(u)), f.appendChild(h), f.appendChild(p), f.appendChild(m), (!t || t.link) && (f.appendChild(g), f.appendChild(v)), t && t.extend)
586
- for (let y = 0; y < t.extend.length; y++) {
587
- const w = t.extend[y], _ = o(w.name, w.name, w.key || "");
588
- f.appendChild(_), _.onclick = (M) => {
589
- w.onclick(M);
594
+ return w.innerText = b, w.className = "tips", w;
595
+ }, o = (b, w, _) => {
596
+ const k = document.createElement("li");
597
+ return k.id = b, k.innerHTML = `<span>${oe(w)}</span><span ${_ ? 'class="key"' : ""}>${oe(_)}</span>`, k;
598
+ }, s = Ce[e.locale] ? e.locale : "en", i = Ce[s], r = o("cm-add_child", i.addChild, "Tab"), l = o("cm-add_parent", i.addParent, "Ctrl + Enter"), c = o("cm-add_sibling", i.addSibling, "Enter"), d = o("cm-remove_child", i.removeNode, "Delete"), a = o("cm-fucus", i.focus, ""), u = o("cm-unfucus", i.cancelFocus, ""), h = o("cm-up", i.moveUp, "PgUp"), m = o("cm-down", i.moveDown, "Pgdn"), p = o("cm-link", i.link, ""), y = o("cm-link-bidirectional", "Bidreactional Link", ""), g = o("cm-summary", i.summary, ""), f = document.createElement("ul");
599
+ if (f.className = "menu-list", f.appendChild(r), f.appendChild(l), f.appendChild(c), f.appendChild(d), (!t || t.focus) && (f.appendChild(a), f.appendChild(u)), f.appendChild(h), f.appendChild(m), f.appendChild(g), (!t || t.link) && (f.appendChild(p), f.appendChild(y)), t && t.extend)
600
+ for (let b = 0; b < t.extend.length; b++) {
601
+ const w = t.extend[b], _ = o(w.name, w.name, w.key || "");
602
+ f.appendChild(_), _.onclick = (k) => {
603
+ w.onclick(k);
590
604
  };
591
605
  }
592
- const b = document.createElement("div");
593
- b.className = "context-menu", b.appendChild(f), b.hidden = !0, e.container.append(b);
606
+ const v = document.createElement("div");
607
+ v.className = "context-menu", v.appendChild(f), v.hidden = !0, e.container.append(v);
594
608
  let x = !0;
595
- e.container.oncontextmenu = function(y) {
596
- if (y.preventDefault(), !e.editable || k.moved)
609
+ e.container.oncontextmenu = function(b) {
610
+ if (b.preventDefault(), !e.editable || e.dragMoveHelper.moved)
597
611
  return;
598
- const w = y.target;
599
- if (he(w)) {
600
- w.parentElement.tagName === "ME-ROOT" ? x = !0 : x = !1, x ? (a.className = "disabled", h.className = "disabled", p.className = "disabled", c.className = "disabled", l.className = "disabled", d.className = "disabled") : (a.className = "", h.className = "", p.className = "", c.className = "", l.className = "", d.className = ""), e.currentNodes || e.selectNode(w), b.hidden = !1, k.mousedown && (k.mousedown = !1), f.style.top = "", f.style.bottom = "", f.style.left = "", f.style.right = "";
601
- const _ = f.getBoundingClientRect(), M = f.offsetHeight, j = f.offsetWidth, z = y.clientY - _.top, X = y.clientX - _.left;
602
- M + z > window.innerHeight ? (f.style.top = "", f.style.bottom = "0px") : (f.style.bottom = "", f.style.top = z + 15 + "px"), j + X > window.innerWidth ? (f.style.left = "", f.style.right = "0px") : (f.style.right = "", f.style.left = X + 10 + "px");
612
+ const w = b.target;
613
+ if (Fe(w)) {
614
+ w.parentElement.tagName === "ME-ROOT" ? x = !0 : x = !1, x ? (a.className = "disabled", h.className = "disabled", m.className = "disabled", l.className = "disabled", c.className = "disabled", d.className = "disabled") : (a.className = "", h.className = "", m.className = "", l.className = "", c.className = "", d.className = ""), e.currentNodes || e.selectNode(w), v.hidden = !1, f.style.top = "", f.style.bottom = "", f.style.left = "", f.style.right = "";
615
+ const _ = f.getBoundingClientRect(), k = f.offsetHeight, j = f.offsetWidth, z = b.clientY - _.top, X = b.clientX - _.left;
616
+ k + z > window.innerHeight ? (f.style.top = "", f.style.bottom = "0px") : (f.style.bottom = "", f.style.top = z + 15 + "px"), j + X > window.innerWidth ? (f.style.left = "", f.style.right = "0px") : (f.style.right = "", f.style.left = X + 10 + "px");
603
617
  }
604
- }, b.onclick = (y) => {
605
- y.target === b && (b.hidden = !0);
618
+ }, v.onclick = (b) => {
619
+ b.target === v && (v.hidden = !0);
606
620
  }, r.onclick = () => {
607
- e.addChild(), b.hidden = !0;
608
- }, c.onclick = () => {
609
- e.insertParent(), b.hidden = !0;
621
+ e.addChild(), v.hidden = !0;
610
622
  }, l.onclick = () => {
611
- x || (e.insertSibling("after"), b.hidden = !0);
623
+ e.insertParent(), v.hidden = !0;
624
+ }, c.onclick = () => {
625
+ x || (e.insertSibling("after"), v.hidden = !0);
612
626
  }, d.onclick = () => {
613
- x || (e.removeNode(), b.hidden = !0);
627
+ x || (e.removeNodes(e.currentNodes || []), v.hidden = !0);
614
628
  }, a.onclick = () => {
615
- x || (e.focusNode(e.currentNode), b.hidden = !0);
629
+ x || (e.focusNode(e.currentNode), v.hidden = !0);
616
630
  }, u.onclick = () => {
617
- e.cancelFocus(), b.hidden = !0;
631
+ e.cancelFocus(), v.hidden = !0;
618
632
  }, h.onclick = () => {
619
- x || (e.moveUpNode(), b.hidden = !0);
620
- }, p.onclick = () => {
621
- x || (e.moveDownNode(), b.hidden = !0);
633
+ x || (e.moveUpNode(), v.hidden = !0);
634
+ }, m.onclick = () => {
635
+ x || (e.moveDownNode(), v.hidden = !0);
622
636
  };
623
- const E = (y) => {
624
- b.hidden = !0;
625
- const w = e.currentNode, _ = n(s.clickTips);
637
+ const S = (b) => {
638
+ v.hidden = !0;
639
+ const w = e.currentNode, _ = n(i.clickTips);
626
640
  e.container.appendChild(_), e.map.addEventListener(
627
641
  "click",
628
- (M) => {
629
- M.preventDefault(), _.remove();
630
- const j = M.target;
631
- (j.parentElement.tagName === "ME-PARENT" || j.parentElement.tagName === "ME-ROOT") && e.createArrow(w, j, y);
642
+ (k) => {
643
+ k.preventDefault(), _.remove();
644
+ const j = k.target;
645
+ (j.parentElement.tagName === "ME-PARENT" || j.parentElement.tagName === "ME-ROOT") && e.createArrow(w, j, b);
632
646
  },
633
647
  {
634
648
  once: !0
635
649
  }
636
650
  );
637
651
  };
638
- return g.onclick = () => E(), v.onclick = () => E({ bidirectional: !0 }), m.onclick = () => {
639
- b.hidden = !0, e.createSummary(), e.unselectNodes();
652
+ return p.onclick = () => S(), y.onclick = () => S({ bidirectional: !0 }), g.onclick = () => {
653
+ v.hidden = !0, e.createSummary(), e.unselectNodes(e.currentNodes);
640
654
  }, () => {
641
- r.onclick = null, c.onclick = null, l.onclick = null, d.onclick = null, a.onclick = null, u.onclick = null, h.onclick = null, p.onclick = null, g.onclick = null, m.onclick = null, b.onclick = null, e.container.oncontextmenu = null;
655
+ r.onclick = null, l.onclick = null, c.onclick = null, d.onclick = null, a.onclick = null, u.onclick = null, h.onclick = null, m.onclick = null, p.onclick = null, g.onclick = null, v.onclick = null, e.container.oncontextmenu = null;
642
656
  };
643
657
  }
644
- const gt = (e) => {
658
+ const bt = (e) => {
645
659
  const t = e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");
646
660
  e.selectNode(t[Math.ceil(t.length / 2) - 1]);
647
- }, vt = (e) => {
661
+ }, xt = (e) => {
648
662
  const t = e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
649
663
  e.selectNode(t[Math.ceil(t.length / 2) - 1]);
650
- }, bt = (e) => {
664
+ }, wt = (e) => {
651
665
  e.selectNode(e.map.querySelector("me-root>me-tpc"));
652
- }, yt = function(e, t) {
666
+ }, Et = function(e, t) {
653
667
  const n = t.parentElement.parentElement.parentElement.previousSibling;
654
668
  if (n) {
655
669
  const o = n.firstChild;
656
670
  e.selectNode(o);
657
671
  }
658
- }, xt = function(e, t) {
672
+ }, St = function(e, t) {
659
673
  const n = t.parentElement.nextSibling;
660
674
  if (n && n.firstChild) {
661
675
  const o = n.firstChild.firstChild.firstChild;
662
676
  e.selectNode(o);
663
677
  }
664
- }, _e = function(e, t) {
665
- var s, r;
666
- const n = e.currentNode || ((s = e.currentNodes) == null ? void 0 : s[0]);
678
+ }, Ne = function(e, t) {
679
+ var i, r;
680
+ const n = e.currentNode || ((i = e.currentNodes) == null ? void 0 : i[0]);
667
681
  if (!n)
668
682
  return;
669
- const o = n.nodeObj, i = n.offsetParent.offsetParent.parentElement;
670
- o.parent ? i.className === t ? xt(e, n) : (r = o.parent) != null && r.parent ? yt(e, n) : bt(e) : t === L.LHS ? gt(e) : vt(e);
671
- }, Le = function(e, t) {
672
- var r;
673
- const n = e.currentNode || ((r = e.currentNodes) == null ? void 0 : r[0]);
683
+ const o = n.nodeObj, s = n.offsetParent.offsetParent.parentElement;
684
+ o.parent ? s.className === t ? St(e, n) : (r = o.parent) != null && r.parent ? Et(e, n) : wt(e) : t === M.LHS ? bt(e) : xt(e);
685
+ }, _e = function(e, t) {
686
+ const n = e.currentNode;
674
687
  if (!n || !n.nodeObj.parent)
675
688
  return;
676
- const i = t + "Sibling", s = n.parentElement.parentElement[i];
677
- s && e.selectNode(s.firstChild.firstChild);
678
- }, ee = function(e, t) {
689
+ const s = t + "Sibling", i = n.parentElement.parentElement[s];
690
+ i ? e.selectNode(i.firstChild.firstChild) : e.selectNode(n);
691
+ }, Q = function(e, t, n) {
679
692
  switch (t) {
680
693
  case "in":
681
694
  if (e.scaleVal > 1.6)
682
695
  return;
683
- e.scale(e.scaleVal += 0.2);
696
+ e.scale(e.scaleVal + 0.2, n);
684
697
  break;
685
698
  case "out":
686
699
  if (e.scaleVal < 0.6)
687
700
  return;
688
- e.scale(e.scaleVal -= 0.2);
701
+ e.scale(e.scaleVal - 0.2, n);
689
702
  }
690
703
  };
691
- function wt(e) {
704
+ function Ct(e) {
692
705
  const t = () => {
693
- e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNode ? e.removeNode() : e.currentNodes && e.removeNodes(e.currentNodes);
706
+ e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNodes && e.removeNodes(e.currentNodes);
694
707
  }, n = {
695
708
  Enter: (o) => {
696
709
  o.shiftKey ? e.insertSibling("before") : o.ctrlKey ? e.insertParent() : e.insertSibling("after");
@@ -710,40 +723,40 @@ function wt(e) {
710
723
  else {
711
724
  if (o.metaKey || o.ctrlKey)
712
725
  return e.initSide();
713
- Le(e, "previous");
726
+ _e(e, "previous");
714
727
  }
715
728
  },
716
729
  ArrowDown: (o) => {
717
- o.altKey ? e.moveDownNode() : Le(e, "next");
730
+ o.altKey ? e.moveDownNode() : _e(e, "next");
718
731
  },
719
732
  ArrowLeft: (o) => {
720
733
  if (o.metaKey || o.ctrlKey)
721
734
  return e.initLeft();
722
- _e(e, L.LHS);
735
+ Ne(e, M.LHS);
723
736
  },
724
737
  ArrowRight: (o) => {
725
738
  if (o.metaKey || o.ctrlKey)
726
739
  return e.initRight();
727
- _e(e, L.RHS);
740
+ Ne(e, M.RHS);
728
741
  },
729
742
  PageUp: () => e.moveUpNode(),
730
743
  PageDown: () => {
731
744
  e.moveDownNode();
732
745
  },
733
746
  c: (o) => {
734
- (o.metaKey || o.ctrlKey) && (e.currentNode ? e.waitCopy = [e.currentNode] : e.currentNodes && (e.waitCopy = e.currentNodes));
747
+ (o.metaKey || o.ctrlKey) && (e.waitCopy = e.currentNodes);
735
748
  },
736
749
  x: (o) => {
737
- (o.metaKey || o.ctrlKey) && (e.currentNode ? e.waitCopy = [e.currentNode] : e.currentNodes && (e.waitCopy = e.currentNodes), t());
750
+ (o.metaKey || o.ctrlKey) && (e.waitCopy = e.currentNodes, t());
738
751
  },
739
752
  v: (o) => {
740
753
  !e.waitCopy || !e.currentNode || (o.metaKey || o.ctrlKey) && (e.waitCopy.length === 1 ? e.copyNode(e.waitCopy[0], e.currentNode) : e.copyNodes(e.waitCopy, e.currentNode));
741
754
  },
742
- "+": (o) => {
743
- (o.metaKey || o.ctrlKey) && ee(e, "in");
755
+ "=": (o) => {
756
+ (o.metaKey || o.ctrlKey) && Q(e, "in");
744
757
  },
745
758
  "-": (o) => {
746
- (o.metaKey || o.ctrlKey) && ee(e, "out");
759
+ (o.metaKey || o.ctrlKey) && Q(e, "out");
747
760
  },
748
761
  0: (o) => {
749
762
  (o.metaKey || o.ctrlKey) && e.scale(1);
@@ -754,19 +767,19 @@ function wt(e) {
754
767
  e.map.onkeydown = (o) => {
755
768
  if (o.preventDefault(), !e.editable || o.target !== o.currentTarget)
756
769
  return;
757
- const i = n[o.key];
758
- i && i(o);
770
+ const s = n[o.key];
771
+ s && s(o);
759
772
  }, e.map.onwheel = (o) => {
760
- (o.ctrlKey || o.metaKey) && (o.preventDefault(), o.deltaY < 0 ? ee(e, "in") : e.scaleVal - 0.2 > 0 && ee(e, "out"), o.stopPropagation());
773
+ o.stopPropagation(), o.preventDefault(), o.ctrlKey || o.metaKey ? o.deltaY < 0 ? Q(e, "in", e.dragMoveHelper) : e.scaleVal - 0.2 > 0 && Q(e, "out", e.dragMoveHelper) : o.shiftKey ? e.move(-o.deltaY, 0) : e.move(0, -o.deltaY);
761
774
  };
762
775
  }
763
- const ue = document, Et = function(e, t) {
776
+ const de = document, Nt = function(e, t) {
764
777
  if (!t)
765
- return fe(e), e;
778
+ return he(e), e;
766
779
  let n = e.querySelector(".insert-preview");
767
780
  const o = `insert-preview ${t} show`;
768
- return n || (n = ue.createElement("div"), e.appendChild(n)), n.className = o, e;
769
- }, fe = function(e) {
781
+ return n || (n = de.createElement("div"), e.appendChild(n)), n.className = o, e;
782
+ }, he = function(e) {
770
783
  if (!e)
771
784
  return;
772
785
  const t = e.querySelectorAll(".insert-preview");
@@ -779,53 +792,75 @@ const ue = document, Et = function(e, t) {
779
792
  return !1;
780
793
  }
781
794
  return !0;
782
- }, Nt = function(e) {
795
+ }, _t = function(e) {
783
796
  const t = document.createElement("div");
784
797
  return t.className = "mind-elixir-ghost", e.map.appendChild(t), t;
785
798
  };
786
- function Ct(e) {
787
- let t = null, n = null, o = null;
788
- const i = Nt(e), s = 12;
789
- e.map.addEventListener("dragstart", (r) => {
790
- var l;
791
- const c = r.target;
792
- if ((c == null ? void 0 : c.tagName) !== "ME-TPC") {
793
- r.preventDefault();
799
+ class Mt {
800
+ constructor(t) {
801
+ E(this, "mind");
802
+ E(this, "isMoving", !1);
803
+ E(this, "interval", null);
804
+ E(this, "speed", 20);
805
+ this.mind = t;
806
+ }
807
+ move(t, n) {
808
+ this.isMoving || (this.isMoving = !0, this.interval = setInterval(() => {
809
+ this.mind.move(t * this.speed * this.mind.scaleVal, n * this.speed * this.mind.scaleVal);
810
+ }, 100));
811
+ }
812
+ stop() {
813
+ this.isMoving = !1, clearInterval(this.interval);
814
+ }
815
+ }
816
+ function kt(e) {
817
+ let t = null, n = null;
818
+ const o = _t(e), s = new Mt(e);
819
+ e.map.addEventListener("dragstart", (i) => {
820
+ const r = i.target;
821
+ if ((r == null ? void 0 : r.tagName) !== "ME-TPC") {
822
+ i.preventDefault();
794
823
  return;
795
824
  }
796
- (l = e.currentNodes) != null && l.includes(c) || (e.unselectNodes(), e.selectNode(c)), e.currentNodes ? (t = e.currentNodes, i.innerHTML = e.currentNodes.length + "") : (t = [c], i.innerHTML = c.innerHTML);
797
- for (const d of t)
798
- d.parentElement.parentElement.style.opacity = "0.5";
799
- r.dataTransfer.setDragImage(i, 0, 0), r.dataTransfer.dropEffect = "move", k.clear();
800
- }), e.map.addEventListener("dragend", async (r) => {
801
- if (!t)
825
+ let l = e.currentNodes;
826
+ l != null && l.includes(r) || (e.unselectNodes(e.currentNodes), e.selectNode(r), l = e.currentNodes), e.dragged = l, l.length > 1 ? o.innerHTML = l.length + "" : o.innerHTML = r.innerHTML;
827
+ for (const c of l)
828
+ c.parentElement.parentElement.style.opacity = "0.5";
829
+ i.dataTransfer.setDragImage(o, 0, 0), i.dataTransfer.dropEffect = "move", e.dragMoveHelper.clear();
830
+ }), e.map.addEventListener("dragend", async (i) => {
831
+ const { dragged: r } = e;
832
+ if (!r)
802
833
  return;
803
- for (const l of t)
804
- l.parentElement.parentElement.style.opacity = "1";
805
- const c = r.target;
806
- c.style.opacity = "", o && (fe(o), n === "before" ? e.moveNodeBefore(t, o) : n === "after" ? e.moveNodeAfter(t, o) : n === "in" && e.moveNodeIn(t, o), t = null);
807
- }), e.map.addEventListener("dragover", function(r) {
808
- if (r.preventDefault(), !t)
834
+ s.stop();
835
+ for (const c of r)
836
+ c.parentElement.parentElement.style.opacity = "1";
837
+ const l = i.target;
838
+ l.style.opacity = "", n && (he(n), t === "before" ? e.moveNodeBefore(r, n) : t === "after" ? e.moveNodeAfter(r, n) : t === "in" && e.moveNodeIn(r, n), e.dragged = null);
839
+ }), e.map.addEventListener("dragover", function(i) {
840
+ i.preventDefault();
841
+ const r = 12 * e.scaleVal, { dragged: l } = e;
842
+ if (!l)
809
843
  return;
810
- fe(o);
811
- const c = ue.elementFromPoint(r.clientX, r.clientY - s);
812
- if (Me(c, t)) {
813
- o = c;
814
- const l = c.getBoundingClientRect().y;
815
- r.clientY > l + c.clientHeight ? n = "after" : n = "in";
844
+ const c = e.container.getBoundingClientRect();
845
+ i.clientX < c.x + 50 ? s.move(1, 0) : i.clientX > c.x + c.width - 50 ? s.move(-1, 0) : i.clientY < c.y + 50 ? s.move(0, 1) : i.clientY > c.y + c.height - 50 ? s.move(0, -1) : s.stop(), he(n);
846
+ const d = de.elementFromPoint(i.clientX, i.clientY - r);
847
+ if (Me(d, l)) {
848
+ n = d;
849
+ const a = d.getBoundingClientRect(), u = a.y;
850
+ i.clientY > u + a.height ? t = "after" : t = "in";
816
851
  } else {
817
- const l = ue.elementFromPoint(r.clientX, r.clientY + s);
818
- if (Me(l, t)) {
819
- o = l;
820
- const d = l.getBoundingClientRect().y;
821
- r.clientY < d ? n = "before" : n = "in";
852
+ const a = de.elementFromPoint(i.clientX, i.clientY + r), u = a.getBoundingClientRect();
853
+ if (Me(a, l)) {
854
+ n = a;
855
+ const h = u.y;
856
+ i.clientY < h ? t = "before" : t = "in";
822
857
  } else
823
- n = o = null;
858
+ t = n = null;
824
859
  }
825
- o && Et(o, n);
860
+ n && Nt(n, t);
826
861
  });
827
862
  }
828
- const St = function(e) {
863
+ const Lt = function(e) {
829
864
  return ["createSummary", "removeSummary", "finishEditSummary"].includes(e.name) ? {
830
865
  type: "summary",
831
866
  value: e.obj.id
@@ -840,20 +875,20 @@ const St = function(e) {
840
875
  value: e.obj.id
841
876
  };
842
877
  };
843
- function _t(e) {
878
+ function Tt(e) {
844
879
  let t = [], n = -1, o = e.getData();
845
- e.bus.addListener("operation", (i) => {
846
- if (i.name === "beginEdit")
880
+ e.bus.addListener("operation", (s) => {
881
+ if (s.name === "beginEdit")
847
882
  return;
848
883
  t = t.slice(0, n + 1);
849
- const s = e.getData();
850
- t.push({ prev: o, currentObject: St(i), next: s }), o = s, n = t.length - 1;
884
+ const i = e.getData();
885
+ t.push({ prev: o, currentObject: Lt(s), next: i }), o = i, n = t.length - 1;
851
886
  }), e.undo = function() {
852
887
  if (n > -1) {
853
- const i = t[n];
854
- o = i.prev, e.refresh(i.prev);
888
+ const s = t[n];
889
+ o = s.prev, e.refresh(s.prev);
855
890
  try {
856
- i.currentObject.type === "node" ? e.selectNode(S(i.currentObject.value)) : i.currentObject.type === "nodes" && e.selectNodes(i.currentObject.value.map((s) => S(s)));
891
+ s.currentObject.type === "node" ? e.selectNode(N(s.currentObject.value)) : s.currentObject.type === "nodes" && e.selectNodes(s.currentObject.value.map((i) => N(i)));
857
892
  } catch {
858
893
  } finally {
859
894
  n--;
@@ -862,11 +897,11 @@ function _t(e) {
862
897
  }, e.redo = function() {
863
898
  if (n < t.length - 1) {
864
899
  n++;
865
- const i = t[n];
866
- o = i.next, e.refresh(i.next), i.currentObject.type === "node" ? e.selectNode(S(i.currentObject.value)) : i.currentObject.type === "nodes" && e.selectNodes(i.currentObject.value.map((s) => S(s)));
900
+ const s = t[n];
901
+ o = s.next, e.refresh(s.next), s.currentObject.type === "node" ? e.selectNode(N(s.currentObject.value)) : s.currentObject.type === "nodes" && (e.unselectNodes(this.currentNodes), e.selectNodes(s.currentObject.value.map((i) => N(i))));
867
902
  }
868
- }, e.map.addEventListener("keydown", (i) => {
869
- (i.metaKey || i.ctrlKey) && (i.shiftKey && i.key === "Z" || i.key === "y") ? e.redo() : (i.metaKey || i.ctrlKey) && i.key === "z" && e.undo();
903
+ }, e.map.addEventListener("keydown", (s) => {
904
+ (s.metaKey || s.ctrlKey) && (s.shiftKey && s.key === "Z" || s.key === "y") ? e.redo() : (s.metaKey || s.ctrlKey) && s.key === "z" && e.undo();
870
905
  });
871
906
  }
872
907
  const q = (e, t) => {
@@ -875,36 +910,38 @@ const q = (e, t) => {
875
910
  <use xlink:href="#icon-${t}"></use>
876
911
  </svg>`, n;
877
912
  };
878
- function Lt(e) {
879
- const t = document.createElement("div"), n = q("fullscreen", "full"), o = q("toCenter", "living"), i = q("zoomout", "move"), s = q("zoomin", "add"), r = document.createElement("span");
880
- return r.innerText = "100%", t.appendChild(n), t.appendChild(o), t.appendChild(i), t.appendChild(s), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
913
+ function At(e) {
914
+ const t = document.createElement("div"), n = q("fullscreen", "full"), o = q("toCenter", "living"), s = q("zoomout", "move"), i = q("zoomin", "add"), r = document.createElement("span");
915
+ return r.innerText = "100%", t.appendChild(n), t.appendChild(o), t.appendChild(s), t.appendChild(i), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
881
916
  e.mindElixirBox.requestFullscreen();
882
917
  }, o.onclick = () => {
883
918
  e.toCenter();
884
- }, i.onclick = () => {
885
- e.scaleVal < 0.6 || e.scale(e.scaleVal - 0.2);
886
919
  }, s.onclick = () => {
920
+ e.scaleVal < 0.6 || e.scale(e.scaleVal - 0.2);
921
+ }, i.onclick = () => {
887
922
  e.scaleVal > 1.6 || e.scale(e.scaleVal + 0.2);
888
923
  }, t;
889
924
  }
890
- function Mt(e) {
891
- const t = document.createElement("div"), n = q("tbltl", "left"), o = q("tbltr", "right"), i = q("tblts", "side");
892
- return t.appendChild(n), t.appendChild(o), t.appendChild(i), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
925
+ function $t(e) {
926
+ const t = document.createElement("div"), n = q("tbltl", "left"), o = q("tbltr", "right"), s = q("tblts", "side");
927
+ return t.appendChild(n), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
893
928
  e.initLeft();
894
929
  }, o.onclick = () => {
895
930
  e.initRight();
896
- }, i.onclick = () => {
931
+ }, s.onclick = () => {
897
932
  e.initSide();
898
933
  }, t;
899
934
  }
900
- function kt(e) {
901
- e.container.append(Lt(e)), e.container.append(Mt(e));
935
+ function jt(e) {
936
+ e.container.append(At(e)), e.container.append($t(e));
902
937
  }
903
- /*! @viselect/vanilla v3.5.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
904
- var Tt = Object.defineProperty, At = (e, t, n) => t in e ? Tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, N = (e, t, n) => (At(e, typeof t != "symbol" ? t + "" : t, n), n);
905
- class $t {
938
+ class Ot {
906
939
  constructor() {
907
- N(this, "_listeners", /* @__PURE__ */ new Map()), N(this, "on", this.addEventListener), N(this, "off", this.removeEventListener), N(this, "emit", this.dispatchEvent);
940
+ E(this, "_listeners", /* @__PURE__ */ new Map());
941
+ // Let's also support on, off and emit like node
942
+ E(this, "on", this.addEventListener);
943
+ E(this, "off", this.removeEventListener);
944
+ E(this, "emit", this.dispatchEvent);
908
945
  }
909
946
  addEventListener(t, n) {
910
947
  const o = this._listeners.get(t) ?? /* @__PURE__ */ new Set();
@@ -916,103 +953,111 @@ class $t {
916
953
  }
917
954
  dispatchEvent(t, ...n) {
918
955
  let o = !0;
919
- for (const i of this._listeners.get(t) ?? [])
920
- o = i(...n) !== !1 && o;
956
+ for (const s of this._listeners.get(t) ?? [])
957
+ o = s(...n) !== !1 && o;
921
958
  return o;
922
959
  }
923
960
  unbindAllListeners() {
924
961
  this._listeners.clear();
925
962
  }
926
963
  }
927
- const ke = (e, t = "px") => typeof e == "number" ? e + t : e;
928
- function O({ style: e }, t, n) {
964
+ const ke = (e, t = "px") => typeof e == "number" ? e + t : e, D = ({ style: e }, t, n) => {
929
965
  if (typeof t == "object")
930
- for (const [o, i] of Object.entries(t))
931
- i !== void 0 && (e[o] = ke(i));
966
+ for (const [o, s] of Object.entries(t))
967
+ s !== void 0 && (e[o] = ke(s));
932
968
  else
933
969
  n !== void 0 && (e[t] = ke(n));
934
- }
935
- const We = (e) => (t, n, o, i = {}) => {
936
- t instanceof HTMLCollection || t instanceof NodeList ? t = Array.from(t) : Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
937
- for (const s of t)
938
- if (s)
939
- for (const r of n)
940
- s[e](r, o, { capture: !1, ...i });
941
- return [t, n, o, i];
942
- }, V = We("addEventListener"), H = We("removeEventListener"), te = (e) => {
943
- var t;
944
- const { clientX: n, clientY: o, target: i } = ((t = e.touches) == null ? void 0 : t[0]) ?? e;
945
- return { x: n, y: o, target: i };
946
- };
947
- function Te(e, t, n = "touch") {
948
- switch (n) {
949
- case "center": {
950
- const o = t.left + t.width / 2, i = t.top + t.height / 2;
951
- return o >= e.left && o <= e.right && i >= e.top && i <= e.bottom;
952
- }
953
- case "cover":
954
- return t.left >= e.left && t.top >= e.top && t.right <= e.right && t.bottom <= e.bottom;
955
- case "touch":
956
- return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
957
- }
958
- }
959
- function W(e, t = document) {
960
- const n = Array.isArray(e) ? e : [e];
961
- let o = [];
962
- for (let i = 0, s = n.length; i < s; i++) {
963
- const r = n[i];
964
- typeof r == "string" ? o = o.concat(Array.from(t.querySelectorAll(r))) : r instanceof Element && o.push(r);
965
- }
966
- return o;
967
- }
968
- const jt = () => matchMedia("(hover: none), (pointer: coarse)").matches, Dt = () => "safari" in window, Ot = (e) => {
970
+ }, Le = (e = 0, t = 0, n = 0, o = 0) => {
971
+ const s = { x: e, y: t, width: n, height: o, top: t, left: e, right: e + n, bottom: t + o };
972
+ return { ...s, toJSON: () => JSON.stringify(s) };
973
+ }, Dt = (e) => {
969
974
  let t, n = -1, o = !1;
970
975
  return {
971
- next(...i) {
972
- t = i, o || (o = !0, n = requestAnimationFrame(() => {
976
+ next: (...s) => {
977
+ t = s, o || (o = !0, n = requestAnimationFrame(() => {
973
978
  e(...t), o = !1;
974
979
  }));
975
980
  },
976
- cancel() {
981
+ cancel: () => {
977
982
  cancelAnimationFrame(n), o = !1;
978
983
  }
979
984
  };
980
- };
981
- function Ht(e, t) {
982
- for (const n of t) {
983
- if (typeof n == "number")
984
- return e.button === n;
985
- if (typeof n == "object") {
986
- const o = n.button === e.button, i = n.modifiers.every((s) => {
987
- switch (s) {
988
- case "alt":
989
- return e.altKey;
990
- case "ctrl":
991
- return e.ctrlKey || e.metaKey;
992
- case "shift":
993
- return e.shiftKey;
994
- }
995
- });
996
- return o && i;
985
+ }, Te = (e, t, n = "touch") => {
986
+ switch (n) {
987
+ case "center": {
988
+ const o = t.left + t.width / 2, s = t.top + t.height / 2;
989
+ return o >= e.left && o <= e.right && s >= e.top && s <= e.bottom;
997
990
  }
991
+ case "cover":
992
+ return t.left >= e.left && t.top >= e.top && t.right <= e.right && t.bottom <= e.bottom;
993
+ case "touch":
994
+ return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
998
995
  }
999
- return !1;
1000
- }
1001
- const { abs: F, max: Ae, min: $e, ceil: je } = Math;
1002
- class Ie extends $t {
1003
- constructor(t) {
1004
- var n, o, i, s, r;
1005
- super(), N(this, "_options"), N(this, "_selection", {
1006
- stored: [],
1007
- selected: [],
1008
- touched: [],
1009
- changed: {
1010
- added: [],
1011
- // Added elements since last selection
1012
- removed: []
1013
- // Removed elements since last selection
1014
- }
1015
- }), N(this, "_area"), N(this, "_clippingElement"), N(this, "_targetElement"), N(this, "_targetRect"), N(this, "_selectables", []), N(this, "_latestElement"), N(this, "_areaRect", new DOMRect()), N(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 }), N(this, "_singleClick", !0), N(this, "_frame"), N(this, "_scrollAvailable", !0), N(this, "_scrollingActive", !1), N(this, "_scrollSpeed", { x: 0, y: 0 }), N(this, "_scrollDelta", { x: 0, y: 0 }), N(this, "disable", this._bindStartEvents.bind(this, !1)), N(this, "enable", this._bindStartEvents), this._options = {
996
+ }, Ht = () => matchMedia("(hover: none), (pointer: coarse)").matches, Pt = () => "safari" in window, ue = (e) => Array.isArray(e) ? e : [e], Ye = (e) => (t, n, o, s = {}) => {
997
+ (t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n = ue(n), t = ue(t);
998
+ for (const i of t)
999
+ if (i)
1000
+ for (const r of n)
1001
+ i[e](r, o, { capture: !1, ...s });
1002
+ }, H = Ye("addEventListener"), $ = Ye("removeEventListener"), ee = (e) => {
1003
+ var s;
1004
+ const { clientX: t, clientY: n, target: o } = ((s = e.touches) == null ? void 0 : s[0]) ?? e;
1005
+ return { x: t, y: n, target: o };
1006
+ }, K = (e, t = document) => ue(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean), Bt = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
1007
+ switch (o) {
1008
+ case "alt":
1009
+ return e.altKey;
1010
+ case "ctrl":
1011
+ return e.ctrlKey || e.metaKey;
1012
+ case "shift":
1013
+ return e.shiftKey;
1014
+ }
1015
+ }) : !1), { abs: F, max: Ae, min: $e, ceil: je } = Math, Oe = (e = []) => ({
1016
+ stored: e,
1017
+ selected: [],
1018
+ touched: [],
1019
+ changed: { added: [], removed: [] }
1020
+ });
1021
+ class Ue extends Ot {
1022
+ constructor(n) {
1023
+ var r, l, c, d, a;
1024
+ super();
1025
+ // Options
1026
+ E(this, "_options");
1027
+ // Selection store
1028
+ E(this, "_selection", Oe());
1029
+ // Area element and clipping element
1030
+ E(this, "_area");
1031
+ E(this, "_clippingElement");
1032
+ // Target container (element) and boundary (cached)
1033
+ E(this, "_targetElement");
1034
+ E(this, "_targetBoundary");
1035
+ E(this, "_targetBoundaryScrolled", !0);
1036
+ E(this, "_targetRect");
1037
+ E(this, "_selectables", []);
1038
+ E(this, "_latestElement");
1039
+ // Dynamically constructed area rect
1040
+ E(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 });
1041
+ E(this, "_areaRect", Le());
1042
+ // If a single click is being performed, it's a single-click until the user dragged the mouse
1043
+ E(this, "_singleClick", !0);
1044
+ E(this, "_frame");
1045
+ // Required data for scrolling
1046
+ E(this, "_scrollAvailable", !0);
1047
+ E(this, "_scrollingActive", !1);
1048
+ E(this, "_scrollSpeed", { x: 0, y: 0 });
1049
+ E(this, "_scrollDelta", { x: 0, y: 0 });
1050
+ // Required for keydown scrolling
1051
+ E(this, "_lastMousePosition", { x: 0, y: 0 });
1052
+ /**
1053
+ * Enable selecting elements
1054
+ */
1055
+ E(this, "enable", this._toggleStartEvents);
1056
+ /**
1057
+ * Disable selecting elements
1058
+ */
1059
+ E(this, "disable", this._toggleStartEvents.bind(this, !1));
1060
+ this._options = {
1016
1061
  selectionAreaClass: "selection-area",
1017
1062
  selectionContainerClass: void 0,
1018
1063
  selectables: [],
@@ -1020,240 +1065,267 @@ class Ie extends $t {
1020
1065
  startAreas: ["html"],
1021
1066
  boundaries: ["html"],
1022
1067
  container: "body",
1023
- ...t,
1068
+ ...n,
1024
1069
  behaviour: {
1025
1070
  overlap: "invert",
1026
1071
  intersect: "touch",
1027
1072
  triggers: [0],
1028
- ...t.behaviour,
1029
- 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 },
1073
+ ...n.behaviour,
1074
+ startThreshold: (r = n.behaviour) != null && r.startThreshold ? typeof n.behaviour.startThreshold == "number" ? n.behaviour.startThreshold : { x: 10, y: 10, ...n.behaviour.startThreshold } : { x: 10, y: 10 },
1030
1075
  scrolling: {
1031
1076
  speedDivider: 10,
1032
1077
  manualSpeed: 750,
1033
- ...(o = t.behaviour) == null ? void 0 : o.scrolling,
1078
+ ...(l = n.behaviour) == null ? void 0 : l.scrolling,
1034
1079
  startScrollMargins: {
1035
1080
  x: 0,
1036
1081
  y: 0,
1037
- ...(s = (i = t.behaviour) == null ? void 0 : i.scrolling) == null ? void 0 : s.startScrollMargins
1082
+ ...(d = (c = n.behaviour) == null ? void 0 : c.scrolling) == null ? void 0 : d.startScrollMargins
1038
1083
  }
1039
1084
  }
1040
1085
  },
1041
1086
  features: {
1042
1087
  range: !0,
1043
1088
  touch: !0,
1044
- ...t.features,
1089
+ deselectOnBlur: !1,
1090
+ ...n.features,
1045
1091
  singleTap: {
1046
1092
  allow: !0,
1047
1093
  intersect: "native",
1048
- ...(r = t.features) == null ? void 0 : r.singleTap
1094
+ ...(a = n.features) == null ? void 0 : a.singleTap
1049
1095
  }
1050
1096
  }
1051
1097
  };
1052
- for (const a of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
1053
- typeof this[a] == "function" && (this[a] = this[a].bind(this));
1054
- const { document: c, selectionAreaClass: l, selectionContainerClass: d } = this._options;
1055
- this._area = c.createElement("div"), this._clippingElement = c.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(l), d && this._clippingElement.classList.add(d), O(this._area, {
1098
+ for (const u of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
1099
+ typeof this[u] == "function" && (this[u] = this[u].bind(this));
1100
+ const { document: o, selectionAreaClass: s, selectionContainerClass: i } = this._options;
1101
+ this._area = o.createElement("div"), this._clippingElement = o.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(s), i && this._clippingElement.classList.add(i), D(this._area, {
1056
1102
  willChange: "top, left, bottom, right, width, height",
1057
1103
  top: 0,
1058
1104
  left: 0,
1059
1105
  position: "fixed"
1060
- }), O(this._clippingElement, {
1106
+ }), D(this._clippingElement, {
1061
1107
  overflow: "hidden",
1062
1108
  position: "fixed",
1063
1109
  transform: "translate3d(0, 0, 0)",
1064
1110
  // https://stackoverflow.com/a/38268846
1065
1111
  pointerEvents: "none",
1066
1112
  zIndex: "1"
1067
- }), this._frame = Ot((a) => {
1068
- this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", a), this._redrawSelectionArea();
1113
+ }), this._frame = Dt((u) => {
1114
+ this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", u), this._redrawSelectionArea();
1069
1115
  }), this.enable();
1070
1116
  }
1071
- _bindStartEvents(t = !0) {
1072
- const { document: n, features: o } = this._options, i = t ? V : H;
1073
- i(n, "mousedown", this._onTapStart), o.touch && i(n, "touchstart", this._onTapStart, {
1074
- passive: !1
1075
- });
1117
+ _toggleStartEvents(n = !0) {
1118
+ const { document: o, features: s } = this._options, i = n ? H : $;
1119
+ i(o, "mousedown", this._onTapStart), s.touch && i(o, "touchstart", this._onTapStart, { passive: !1 });
1076
1120
  }
1077
- _onTapStart(t, n = !1) {
1078
- const { x: o, y: i, target: s } = te(t), { _options: r } = this, { document: c } = this._options, l = s.getBoundingClientRect();
1079
- if (t instanceof MouseEvent && !Ht(t, r.behaviour.triggers))
1121
+ _onTapStart(n, o = !1) {
1122
+ const { x: s, y: i, target: r } = ee(n), { document: l, startAreas: c, boundaries: d, features: a, behaviour: u } = this._options, h = r.getBoundingClientRect();
1123
+ if (n instanceof MouseEvent && !Bt(n, u.triggers))
1080
1124
  return;
1081
- const d = W(r.startAreas, r.document), a = W(r.boundaries, r.document);
1082
- this._targetElement = a.find(
1083
- (p) => Te(p.getBoundingClientRect(), l)
1084
- );
1085
- const u = t.composedPath();
1086
- if (!this._targetElement || !d.find((p) => u.includes(p)) || !a.find((p) => u.includes(p)) || !n && this._emitEvent("beforestart", t) === !1)
1125
+ const m = K(c, l), p = K(d, l);
1126
+ this._targetElement = p.find((v) => Te(v.getBoundingClientRect(), h));
1127
+ const y = n.composedPath(), g = m.find((v) => y.includes(v));
1128
+ if (this._targetBoundary = p.find((v) => y.includes(v)), !this._targetElement || !g || !this._targetBoundary || !o && this._emitEvent("beforestart", n) === !1)
1087
1129
  return;
1088
- this._areaLocation = { x1: o, y1: i, x2: 0, y2: 0 };
1089
- const h = c.scrollingElement ?? c.body;
1090
- this._scrollDelta = { x: h.scrollLeft, y: h.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), V(c, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), V(c, ["mouseup", "touchcancel", "touchend"], this._onTapStop), V(c, "scroll", this._onScroll);
1091
- }
1092
- _onSingleTap(t) {
1093
- const { singleTap: { intersect: n }, range: o } = this._options.features, i = te(t);
1094
- let s;
1095
- if (n === "native")
1096
- s = i.target;
1097
- else if (n === "touch") {
1130
+ this._areaLocation = { x1: s, y1: i, x2: 0, y2: 0 };
1131
+ const f = l.scrollingElement ?? l.body;
1132
+ this._scrollDelta = { x: f.scrollLeft, y: f.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), r.draggable || H(l, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), H(l, ["mouseup", "touchcancel", "touchend"], this._onTapStop), H(l, "scroll", this._onScroll), a.deselectOnBlur && (this._targetBoundaryScrolled = !1, H(this._targetBoundary, "scroll", this._onStartAreaScroll));
1133
+ }
1134
+ _onSingleTap(n) {
1135
+ const {
1136
+ singleTap: { intersect: o },
1137
+ range: s
1138
+ } = this._options.features, i = ee(n);
1139
+ let r;
1140
+ if (o === "native")
1141
+ r = i.target;
1142
+ else if (o === "touch") {
1098
1143
  this.resolveSelectables();
1099
- const { x: c, y: l } = i;
1100
- s = this._selectables.find((d) => {
1101
- const { right: a, left: u, top: h, bottom: p } = d.getBoundingClientRect();
1102
- return c < a && c > u && l < p && l > h;
1144
+ const { x: c, y: d } = i;
1145
+ r = this._selectables.find((a) => {
1146
+ const { right: u, left: h, top: m, bottom: p } = a.getBoundingClientRect();
1147
+ return c < u && c > h && d < p && d > m;
1103
1148
  });
1104
1149
  }
1105
- if (!s)
1150
+ if (!r)
1106
1151
  return;
1107
- for (this.resolveSelectables(); !this._selectables.includes(s); ) {
1108
- if (!s.parentElement)
1152
+ for (this.resolveSelectables(); !this._selectables.includes(r); )
1153
+ if (r.parentElement)
1154
+ r = r.parentElement;
1155
+ else {
1156
+ this._targetBoundaryScrolled || this.clearSelection();
1109
1157
  return;
1110
- s = s.parentElement;
1111
- }
1112
- const { stored: r } = this._selection;
1113
- if (this._emitEvent("start", t), t.shiftKey && o && this._latestElement) {
1114
- const c = this._latestElement, [l, d] = c.compareDocumentPosition(s) & 4 ? [s, c] : [c, s], a = [...this._selectables.filter(
1115
- (u) => u.compareDocumentPosition(l) & 4 && u.compareDocumentPosition(d) & 2
1116
- ), l, d];
1117
- this.select(a), this._latestElement = c;
1158
+ }
1159
+ const { stored: l } = this._selection;
1160
+ if (this._emitEvent("start", n), n.shiftKey && s && this._latestElement) {
1161
+ const c = this._latestElement, [d, a] = c.compareDocumentPosition(r) & 4 ? [r, c] : [c, r], u = [
1162
+ ...this._selectables.filter((h) => h.compareDocumentPosition(d) & 4 && h.compareDocumentPosition(a) & 2),
1163
+ d,
1164
+ a
1165
+ ];
1166
+ this.select(u), this._latestElement = c;
1118
1167
  } else
1119
- r.includes(s) && (r.length === 1 || t.ctrlKey || r.every((c) => this._selection.stored.includes(c))) ? this.deselect(s) : (this.select(s), this._latestElement = s);
1120
- }
1121
- _delayedTapMove(t) {
1122
- const { container: n, document: o, behaviour: { startThreshold: i } } = this._options, { x1: s, y1: r } = this._areaLocation, { x: c, y: l } = te(t);
1168
+ l.includes(r) && (l.length === 1 || n.ctrlKey || l.every((c) => this._selection.stored.includes(c))) ? this.deselect(r) : (this.select(r), this._latestElement = r);
1169
+ }
1170
+ _delayedTapMove(n) {
1171
+ const {
1172
+ container: o,
1173
+ document: s,
1174
+ behaviour: { startThreshold: i }
1175
+ } = this._options, { x1: r, y1: l } = this._areaLocation, { x: c, y: d } = ee(n);
1123
1176
  if (
1124
1177
  // Single number for both coordinates
1125
- typeof i == "number" && F(c + l - (s + r)) >= i || // Different x and y threshold
1126
- typeof i == "object" && F(c - s) >= i.x || F(l - r) >= i.y
1178
+ typeof i == "number" && F(c + d - (r + l)) >= i || // Different x and y threshold
1179
+ typeof i == "object" && F(c - r) >= i.x || F(d - l) >= i.y
1127
1180
  ) {
1128
- if (H(o, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
1129
- H(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
1181
+ if ($(s, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", n) === !1) {
1182
+ $(s, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
1130
1183
  return;
1131
1184
  }
1132
- V(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), O(this._area, "display", "block"), W(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 && (V(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);
1185
+ H(s, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), D(this._area, "display", "block"), K(o, s)[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 && (H(this._targetElement, "wheel", this._wheelScroll, { passive: !1 }), H(this._options.document, "keydown", this._keyboardScroll, { passive: !1 }), this._selectables = this._selectables.filter((a) => this._targetElement.contains(a))), this._setupSelectionArea(), this._emitEvent("start", n), this._onTapMove(n);
1133
1186
  }
1134
- this._handleMoveEvent(t);
1187
+ this._handleMoveEvent(n);
1135
1188
  }
1136
1189
  _setupSelectionArea() {
1137
- const { _clippingElement: t, _targetElement: n, _area: o } = this, i = this._targetRect = n.getBoundingClientRect();
1138
- this._scrollAvailable ? (O(t, {
1190
+ const { _clippingElement: n, _targetElement: o, _area: s } = this, i = this._targetRect = o.getBoundingClientRect();
1191
+ this._scrollAvailable ? (D(n, {
1139
1192
  top: i.top,
1140
1193
  left: i.left,
1141
1194
  width: i.width,
1142
1195
  height: i.height
1143
- }), O(o, {
1196
+ }), D(s, {
1144
1197
  marginTop: -i.top,
1145
1198
  marginLeft: -i.left
1146
- })) : (O(t, {
1199
+ })) : (D(n, {
1147
1200
  top: 0,
1148
1201
  left: 0,
1149
1202
  width: "100%",
1150
1203
  height: "100%"
1151
- }), O(o, {
1204
+ }), D(s, {
1152
1205
  marginTop: 0,
1153
1206
  marginLeft: 0
1154
1207
  }));
1155
1208
  }
1156
- _onTapMove(t) {
1157
- const { x: n, y: o } = te(t), { _scrollSpeed: i, _areaLocation: s, _options: r, _frame: c } = this, { speedDivider: l } = r.behaviour.scrolling, d = this._targetElement;
1158
- if (s.x2 = n, s.y2 = o, this._scrollAvailable && !this._scrollingActive && (i.y || i.x)) {
1209
+ _onTapMove(n) {
1210
+ const { _scrollSpeed: o, _areaLocation: s, _options: i, _frame: r } = this, { speedDivider: l } = i.behaviour.scrolling, c = this._targetElement, { x: d, y: a } = ee(n);
1211
+ if (s.x2 = d, s.y2 = a, this._lastMousePosition.x = d, this._lastMousePosition.y = a, this._scrollAvailable && !this._scrollingActive && (o.y || o.x)) {
1159
1212
  this._scrollingActive = !0;
1160
- const a = () => {
1161
- if (!i.x && !i.y) {
1213
+ const u = () => {
1214
+ if (!o.x && !o.y) {
1162
1215
  this._scrollingActive = !1;
1163
1216
  return;
1164
1217
  }
1165
- const { scrollTop: u, scrollLeft: h } = d;
1166
- i.y && (d.scrollTop += je(i.y / l), s.y1 -= d.scrollTop - u), i.x && (d.scrollLeft += je(i.x / l), s.x1 -= d.scrollLeft - h), c.next(t), requestAnimationFrame(a);
1218
+ const { scrollTop: h, scrollLeft: m } = c;
1219
+ o.y && (c.scrollTop += je(o.y / l), s.y1 -= c.scrollTop - h), o.x && (c.scrollLeft += je(o.x / l), s.x1 -= c.scrollLeft - m), r.next(n), requestAnimationFrame(u);
1167
1220
  };
1168
- requestAnimationFrame(a);
1221
+ requestAnimationFrame(u);
1169
1222
  } else
1170
- c.next(t);
1171
- this._handleMoveEvent(t);
1223
+ r.next(n);
1224
+ this._handleMoveEvent(n);
1172
1225
  }
1173
- _handleMoveEvent(t) {
1174
- const { features: n } = this._options;
1175
- (n.touch && jt() || this._scrollAvailable && Dt()) && t.preventDefault();
1226
+ _handleMoveEvent(n) {
1227
+ const { features: o } = this._options;
1228
+ (o.touch && Ht() || this._scrollAvailable && Pt()) && n.preventDefault();
1176
1229
  }
1177
1230
  _onScroll() {
1178
- const { _scrollDelta: t, _options: { document: n } } = this, { scrollTop: o, scrollLeft: i } = n.scrollingElement ?? n.body;
1179
- this._areaLocation.x1 += t.x - i, this._areaLocation.y1 += t.y - o, t.x = i, t.y = o, this._setupSelectionArea(), this._frame.next(null);
1180
- }
1181
- _manualScroll(t) {
1182
- const { manualSpeed: n } = this._options.behaviour.scrolling, o = t.deltaY ? t.deltaY > 0 ? 1 : -1 : 0, i = t.deltaX ? t.deltaX > 0 ? 1 : -1 : 0;
1183
- this._scrollSpeed.y += o * n, this._scrollSpeed.x += i * n, this._onTapMove(t), t.preventDefault();
1231
+ const {
1232
+ _scrollDelta: n,
1233
+ _options: { document: o }
1234
+ } = this, { scrollTop: s, scrollLeft: i } = o.scrollingElement ?? o.body;
1235
+ this._areaLocation.x1 += n.x - i, this._areaLocation.y1 += n.y - s, n.x = i, n.y = s, this._setupSelectionArea(), this._frame.next(null);
1236
+ }
1237
+ _onStartAreaScroll() {
1238
+ this._targetBoundaryScrolled = !0, $(this._targetElement, "scroll", this._onStartAreaScroll);
1239
+ }
1240
+ _wheelScroll(n) {
1241
+ const { manualSpeed: o } = this._options.behaviour.scrolling, s = n.deltaY ? n.deltaY > 0 ? 1 : -1 : 0, i = n.deltaX ? n.deltaX > 0 ? 1 : -1 : 0;
1242
+ this._scrollSpeed.y += s * o, this._scrollSpeed.x += i * o, this._onTapMove(n), n.preventDefault();
1243
+ }
1244
+ _keyboardScroll(n) {
1245
+ const { manualSpeed: o } = this._options.behaviour.scrolling, s = n.key === "ArrowLeft" ? -1 : n.key === "ArrowRight" ? 1 : 0, i = n.key === "ArrowUp" ? -1 : n.key === "ArrowDown" ? 1 : 0;
1246
+ this._scrollSpeed.x += Math.sign(s) * o, this._scrollSpeed.y += Math.sign(i) * o, n.preventDefault(), this._onTapMove({
1247
+ clientX: this._lastMousePosition.x,
1248
+ clientY: this._lastMousePosition.y,
1249
+ preventDefault: () => {
1250
+ }
1251
+ });
1184
1252
  }
1185
1253
  _recalculateSelectionAreaRect() {
1186
- const { _scrollSpeed: t, _areaLocation: n, _areaRect: o, _targetElement: i, _options: s } = this, { scrollTop: r, scrollHeight: c, clientHeight: l, scrollLeft: d, scrollWidth: a, clientWidth: u } = i, h = this._targetRect, { x1: p, y1: g } = n;
1187
- let { x2: v, y2: m } = n;
1188
- const { behaviour: { scrolling: { startScrollMargins: f } } } = s;
1189
- v < h.left + f.x ? (t.x = d ? -F(h.left - v + f.x) : 0, v = v < h.left ? h.left : v) : v > h.right - f.x ? (t.x = a - d - u ? F(h.left + h.width - v - f.x) : 0, v = v > h.right ? h.right : v) : t.x = 0, m < h.top + f.y ? (t.y = r ? -F(h.top - m + f.y) : 0, m = m < h.top ? h.top : m) : m > h.bottom - f.y ? (t.y = c - r - l ? F(h.top + h.height - m - f.y) : 0, m = m > h.bottom ? h.bottom : m) : t.y = 0;
1190
- const b = $e(p, v), x = $e(g, m), E = Ae(p, v), y = Ae(g, m);
1191
- o.x = b, o.y = x, o.width = E - b, o.height = y - x;
1254
+ const { _scrollSpeed: n, _areaLocation: o, _targetElement: s, _options: i } = this, { scrollTop: r, scrollHeight: l, clientHeight: c, scrollLeft: d, scrollWidth: a, clientWidth: u } = s, h = this._targetRect, { x1: m, y1: p } = o;
1255
+ let { x2: y, y2: g } = o;
1256
+ const {
1257
+ behaviour: {
1258
+ scrolling: { startScrollMargins: f }
1259
+ }
1260
+ } = i;
1261
+ y < h.left + f.x ? (n.x = d ? -F(h.left - y + f.x) : 0, y = y < h.left ? h.left : y) : y > h.right - f.x ? (n.x = a - d - u ? F(h.left + h.width - y - f.x) : 0, y = y > h.right ? h.right : y) : n.x = 0, g < h.top + f.y ? (n.y = r ? -F(h.top - g + f.y) : 0, g = g < h.top ? h.top : g) : g > h.bottom - f.y ? (n.y = l - r - c ? F(h.top + h.height - g - f.y) : 0, g = g > h.bottom ? h.bottom : g) : n.y = 0;
1262
+ const v = $e(m, y), x = $e(p, g), S = Ae(m, y), b = Ae(p, g);
1263
+ this._areaRect = Le(v, x, S - v, b - x);
1192
1264
  }
1193
1265
  _redrawSelectionArea() {
1194
- const { x: t, y: n, width: o, height: i } = this._areaRect, { style: s } = this._area;
1195
- s.left = `${t}px`, s.top = `${n}px`, s.width = `${o}px`, s.height = `${i}px`;
1266
+ const { x: n, y: o, width: s, height: i } = this._areaRect, { style: r } = this._area;
1267
+ r.left = `${n}px`, r.top = `${o}px`, r.width = `${s}px`, r.height = `${i}px`;
1196
1268
  }
1197
- _onTapStop(t, n) {
1198
- var o;
1199
- const { document: i, features: s } = this._options, { _singleClick: r } = this;
1200
- H(i, ["mousemove", "touchmove"], this._delayedTapMove), H(i, ["touchmove", "mousemove"], this._onTapMove), H(i, ["mouseup", "touchcancel", "touchend"], this._onTapStop), H(i, "scroll", this._onScroll), this._keepSelection(), t && r && s.singleTap.allow ? this._onSingleTap(t) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, H(this._targetElement, "wheel", this._manualScroll, { passive: !0 }), this._clippingElement.remove(), (o = this._frame) == null || o.cancel(), O(this._area, "display", "none");
1269
+ _onTapStop(n, o) {
1270
+ var l;
1271
+ const { document: s, features: i } = this._options, { _singleClick: r } = this;
1272
+ $(this._targetElement, "scroll", this._onStartAreaScroll), $(s, ["mousemove", "touchmove"], this._delayedTapMove), $(s, ["touchmove", "mousemove"], this._onTapMove), $(s, ["mouseup", "touchcancel", "touchend"], this._onTapStop), $(s, "scroll", this._onScroll), this._keepSelection(), n && r && i.singleTap.allow ? this._onSingleTap(n) : !r && !o && (this._updateElementSelection(), this._emitEvent("stop", n)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, $(this._targetElement, "wheel", this._wheelScroll, { passive: !0 }), $(this._options.document, "keydown", this._keyboardScroll, { passive: !0 }), this._clippingElement.remove(), (l = this._frame) == null || l.cancel(), D(this._area, "display", "none");
1201
1273
  }
1202
1274
  _updateElementSelection() {
1203
- const { _selectables: t, _options: n, _selection: o, _areaRect: i } = this, { stored: s, selected: r, touched: c } = o, { intersect: l, overlap: d } = n.behaviour, a = d === "invert", u = [], h = [], p = [];
1204
- for (let v = 0; v < t.length; v++) {
1205
- const m = t[v];
1206
- if (Te(i, m.getBoundingClientRect(), l)) {
1207
- if (r.includes(m))
1208
- s.includes(m) && !c.includes(m) && c.push(m);
1209
- else if (a && s.includes(m)) {
1210
- p.push(m);
1275
+ const { _selectables: n, _options: o, _selection: s, _areaRect: i } = this, { stored: r, selected: l, touched: c } = s, { intersect: d, overlap: a } = o.behaviour, u = a === "invert", h = [], m = [], p = [];
1276
+ for (let g = 0; g < n.length; g++) {
1277
+ const f = n[g];
1278
+ if (Te(i, f.getBoundingClientRect(), d)) {
1279
+ if (l.includes(f))
1280
+ r.includes(f) && !c.includes(f) && c.push(f);
1281
+ else if (u && r.includes(f)) {
1282
+ p.push(f);
1211
1283
  continue;
1212
1284
  } else
1213
- h.push(m);
1214
- u.push(m);
1285
+ m.push(f);
1286
+ h.push(f);
1215
1287
  }
1216
1288
  }
1217
- a && h.push(...s.filter((v) => !r.includes(v)));
1218
- const g = d === "keep";
1219
- for (let v = 0; v < r.length; v++) {
1220
- const m = r[v];
1221
- !u.includes(m) && !// Check if user wants to keep previously selected elements, e.g.
1289
+ u && m.push(...r.filter((g) => !l.includes(g)));
1290
+ const y = a === "keep";
1291
+ for (let g = 0; g < l.length; g++) {
1292
+ const f = l[g];
1293
+ !h.includes(f) && !// Check if the user wants to keep previously selected elements, e.g.,
1222
1294
  // not make them part of the current selection as soon as they're touched.
1223
- (g && s.includes(m)) && p.push(m);
1295
+ (y && r.includes(f)) && p.push(f);
1224
1296
  }
1225
- o.selected = u, o.changed = { added: h, removed: p }, this._latestElement = void 0;
1297
+ s.selected = h, s.changed = { added: m, removed: p }, this._latestElement = void 0;
1226
1298
  }
1227
- _emitEvent(t, n) {
1228
- return this.emit(t, {
1229
- event: n,
1299
+ _emitEvent(n, o) {
1300
+ return this.emit(n, {
1301
+ event: o,
1230
1302
  store: this._selection,
1231
1303
  selection: this
1232
1304
  });
1233
1305
  }
1234
1306
  _keepSelection() {
1235
- const { _options: t, _selection: n } = this, { selected: o, changed: i, touched: s, stored: r } = n, c = o.filter((l) => !r.includes(l));
1236
- switch (t.behaviour.overlap) {
1307
+ const { _options: n, _selection: o } = this, { selected: s, changed: i, touched: r, stored: l } = o, c = s.filter((d) => !l.includes(d));
1308
+ switch (n.behaviour.overlap) {
1237
1309
  case "drop": {
1238
- n.stored = [
1310
+ o.stored = [
1239
1311
  ...c,
1240
- ...r.filter((l) => !s.includes(l))
1312
+ ...l.filter((d) => !r.includes(d))
1241
1313
  // Elements not touched
1242
1314
  ];
1243
1315
  break;
1244
1316
  }
1245
1317
  case "invert": {
1246
- n.stored = [
1318
+ o.stored = [
1247
1319
  ...c,
1248
- ...r.filter((l) => !i.removed.includes(l))
1320
+ ...l.filter((d) => !i.removed.includes(d))
1249
1321
  // Elements not removed from selection
1250
1322
  ];
1251
1323
  break;
1252
1324
  }
1253
1325
  case "keep": {
1254
- n.stored = [
1255
- ...r,
1256
- ...o.filter((l) => !r.includes(l))
1326
+ o.stored = [
1327
+ ...l,
1328
+ ...s.filter((d) => !l.includes(d))
1257
1329
  // Newly added
1258
1330
  ];
1259
1331
  break;
@@ -1262,35 +1334,27 @@ class Ie extends $t {
1262
1334
  }
1263
1335
  /**
1264
1336
  * Manually triggers the start of a selection
1265
- * @param evt A MouseEvent / TouchEvent -like object
1266
- * @param silent If beforestart should be fired,
1337
+ * @param evt A MouseEvent / TouchEvent-like object
1338
+ * @param silent If beforestart should be fired
1267
1339
  */
1268
- trigger(t, n = !0) {
1269
- this._onTapStart(t, n);
1340
+ trigger(n, o = !0) {
1341
+ this._onTapStart(n, o);
1270
1342
  }
1271
1343
  /**
1272
- * Can be used if during a selection elements have been added.
1273
- * Will update everything which can be selected.
1344
+ * Can be used if during a selection elements have been added
1345
+ * Will update everything that can be selected
1274
1346
  */
1275
1347
  resolveSelectables() {
1276
- this._selectables = W(this._options.selectables, this._options.document);
1348
+ this._selectables = K(this._options.selectables, this._options.document);
1277
1349
  }
1278
1350
  /**
1279
- * Same as deselect, but for all elements currently selected.
1351
+ * Same as deselecting, but for all elements currently selected
1280
1352
  * @param includeStored If the store should also get cleared
1281
1353
  * @param quiet If move / stop events should be fired
1282
1354
  */
1283
- clearSelection(t = !0, n = !1) {
1284
- const { selected: o, stored: i, changed: s } = this._selection;
1285
- s.added = [], s.removed.push(
1286
- ...o,
1287
- ...t ? i : []
1288
- ), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = {
1289
- stored: t ? [] : i,
1290
- selected: [],
1291
- touched: [],
1292
- changed: { added: [], removed: [] }
1293
- };
1355
+ clearSelection(n = !0, o = !1) {
1356
+ const { selected: s, stored: i, changed: r } = this._selection;
1357
+ r.added = [], r.removed.push(...s, ...n ? i : []), o || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = Oe(n ? [] : i);
1294
1358
  }
1295
1359
  /**
1296
1360
  * @returns {Array} Selected elements
@@ -1305,11 +1369,30 @@ class Ie extends $t {
1305
1369
  return this._area;
1306
1370
  }
1307
1371
  /**
1308
- * Cancel the current selection process.
1309
- * @param keepEvent {boolean} true to fire a stop event after cancel.
1372
+ * @returns {Element[]} Available selectable elements for current selection
1373
+ */
1374
+ getSelectables() {
1375
+ return this._selectables;
1376
+ }
1377
+ /**
1378
+ * Set the location of the selection area
1379
+ * @param location A partial AreaLocation object
1380
+ */
1381
+ setAreaLocation(n) {
1382
+ Object.assign(this._areaLocation, n), this._redrawSelectionArea();
1383
+ }
1384
+ /**
1385
+ * @returns {AreaLocation} The current location of the selection area
1386
+ */
1387
+ getAreaLocation() {
1388
+ return this._areaLocation;
1389
+ }
1390
+ /**
1391
+ * Cancel the current selection process, pass true to fire a stop event after cancel
1392
+ * @param keepEvent If a stop event should be fired
1310
1393
  */
1311
- cancel(t = !1) {
1312
- this._onTapStop(null, !t);
1394
+ cancel(n = !1) {
1395
+ this._onTapStop(null, !n);
1313
1396
  }
1314
1397
  /**
1315
1398
  * Unbinds all events and removes the area-element.
@@ -1319,35 +1402,33 @@ class Ie extends $t {
1319
1402
  }
1320
1403
  /**
1321
1404
  * Adds elements to the selection
1322
- * @param query - CSS Query, can be an array of queries
1323
- * @param quiet - If this should not trigger the move event
1405
+ * @param query CSS Query, can be an array of queries
1406
+ * @param quiet If this should not trigger the move event
1324
1407
  */
1325
- select(t, n = !1) {
1326
- const { changed: o, selected: i, stored: s } = this._selection, r = W(t, this._options.document).filter(
1327
- (c) => !i.includes(c) && !s.includes(c)
1328
- );
1329
- return s.push(...r), i.push(...r), o.added.push(...r), o.removed = [], this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)), r;
1408
+ select(n, o = !1) {
1409
+ const { changed: s, selected: i, stored: r } = this._selection, l = K(n, this._options.document).filter((c) => !i.includes(c) && !r.includes(c));
1410
+ return r.push(...l), i.push(...l), s.added.push(...l), s.removed = [], this._latestElement = void 0, o || (this._emitEvent("move", null), this._emitEvent("stop", null)), l;
1330
1411
  }
1331
1412
  /**
1332
- * Removes a particular element from the selection.
1333
- * @param query - CSS Query, can be an array of queries
1334
- * @param quiet - If this should not trigger the move event
1413
+ * Removes a particular element from the selection
1414
+ * @param query CSS Query, can be an array of queries
1415
+ * @param quiet If this should not trigger the move event
1335
1416
  */
1336
- deselect(t, n = !1) {
1337
- const { selected: o, stored: i, changed: s } = this._selection, r = W(t, this._options.document).filter(
1338
- (c) => o.includes(c) || i.includes(c)
1339
- );
1340
- r.length && (this._selection.stored = i.filter((c) => !r.includes(c)), this._selection.selected = o.filter((c) => !r.includes(c)), this._selection.changed.added = [], this._selection.changed.removed.push(
1341
- ...r.filter((c) => !s.removed.includes(c))
1342
- ), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)));
1417
+ deselect(n, o = !1) {
1418
+ const { selected: s, stored: i, changed: r } = this._selection, l = K(n, this._options.document).filter((c) => s.includes(c) || i.includes(c));
1419
+ this._selection.stored = i.filter((c) => !l.includes(c)), this._selection.selected = s.filter((c) => !l.includes(c)), this._selection.changed.added = [], this._selection.changed.removed.push(...l.filter((c) => !r.removed.includes(c))), this._latestElement = void 0, o || (this._emitEvent("move", null), this._emitEvent("stop", null));
1343
1420
  }
1344
1421
  }
1345
- N(Ie, "version", "3.5.1");
1346
- function Pt(e) {
1347
- const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new Ie({
1422
+ E(Ue, "version", "ssshooter");
1423
+ function Rt(e) {
1424
+ const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new Ue({
1348
1425
  selectables: [".map-container me-tpc"],
1349
1426
  boundaries: [e.container],
1350
1427
  container: e.selectionContainer,
1428
+ features: {
1429
+ // deselectOnBlur: true,
1430
+ touch: !1
1431
+ },
1351
1432
  behaviour: {
1352
1433
  triggers: t,
1353
1434
  // Scroll configuration.
@@ -1365,334 +1446,326 @@ function Pt(e) {
1365
1446
  }
1366
1447
  }
1367
1448
  }).on("beforestart", ({ event: o }) => {
1368
- if (o.target.tagName === "ME-TPC" || o.target.id === "input-box" || o.target.className === "circle")
1449
+ const s = o.target;
1450
+ if (!o.ctrlKey && !o.metaKey) {
1451
+ if (s.tagName === "ME-TPC" && s.classList.contains("selected"))
1452
+ return !1;
1453
+ e.clearSelection();
1454
+ }
1455
+ if (s.id === "input-box" || s.className === "circle")
1369
1456
  return !1;
1370
1457
  const i = n.getSelectionArea();
1371
1458
  return i.style.background = "#4f90f22d", i.style.border = "1px solid #4f90f2", i.parentElement && (i.parentElement.style.zIndex = "9999"), !0;
1372
- }).on("start", ({ event: o }) => {
1373
- !o.ctrlKey && !o.metaKey && (e.clearSelection(), n.clearSelection(!0, !0));
1374
1459
  }).on(
1375
1460
  "move",
1376
1461
  ({
1377
1462
  store: {
1378
- changed: { added: o, removed: i }
1463
+ changed: { added: o, removed: s }
1379
1464
  }
1380
1465
  }) => {
1381
- k.moved = !0;
1382
- for (const s of o)
1383
- s.classList.add("selected");
1384
- for (const s of i)
1385
- s.classList.remove("selected");
1466
+ if (o.length > 0 || s.length > 0, e.dragMoveHelper.moved = !0, o.length > 0) {
1467
+ for (const i of o)
1468
+ i.className = "selected";
1469
+ e.currentNodes = [...e.currentNodes, ...o], e.bus.fire(
1470
+ "selectNodes",
1471
+ o.map((i) => i.nodeObj)
1472
+ );
1473
+ }
1474
+ if (s.length > 0) {
1475
+ for (const i of s)
1476
+ i.classList.remove("selected");
1477
+ e.currentNodes = e.currentNodes.filter((i) => !(s != null && s.includes(i))), e.bus.fire(
1478
+ "unselectNodes",
1479
+ s.map((i) => i.nodeObj)
1480
+ );
1481
+ }
1386
1482
  }
1387
- ).on("stop", ({ store: { stored: o } }) => {
1388
- e.selectNodes(o);
1389
- });
1483
+ );
1390
1484
  e.selection = n;
1391
1485
  }
1392
- const Bt = function(e, t = !0) {
1486
+ const zt = function(e, t = !0) {
1393
1487
  this.theme = e;
1394
1488
  const n = this.theme.cssVar, o = Object.keys(n);
1395
1489
  this.container.style.cssText = "";
1396
- for (let i = 0; i < o.length; i++) {
1397
- const s = o[i];
1398
- this.container.style.setProperty(s, n[s]);
1490
+ for (let s = 0; s < o.length; s++) {
1491
+ const i = o[s];
1492
+ this.container.style.setProperty(i, n[i]);
1399
1493
  }
1400
1494
  e.cssVar["--gap"] || this.container.style.setProperty("--gap", "30px"), t && this.refresh();
1401
- }, Y = (e) => {
1495
+ }, U = (e) => {
1402
1496
  var o;
1403
1497
  const t = (o = e.parent) == null ? void 0 : o.children, n = (t == null ? void 0 : t.indexOf(e)) ?? 0;
1404
1498
  return { siblings: t, index: n };
1405
1499
  };
1406
- function Rt(e) {
1407
- const { siblings: t, index: n } = Y(e);
1500
+ function Ft(e) {
1501
+ const { siblings: t, index: n } = U(e);
1408
1502
  if (t === void 0)
1409
1503
  return;
1410
1504
  const o = t[n];
1411
1505
  n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = o) : (t[n] = t[n - 1], t[n - 1] = o);
1412
1506
  }
1413
- function zt(e) {
1414
- const { siblings: t, index: n } = Y(e);
1507
+ function qt(e) {
1508
+ const { siblings: t, index: n } = U(e);
1415
1509
  if (t === void 0)
1416
1510
  return;
1417
1511
  const o = t[n];
1418
1512
  n === t.length - 1 ? (t[n] = t[0], t[0] = o) : (t[n] = t[n + 1], t[n + 1] = o);
1419
1513
  }
1420
- function be(e) {
1421
- const { siblings: t, index: n } = Y(e);
1514
+ function Xe(e) {
1515
+ const { siblings: t, index: n } = U(e);
1422
1516
  return t === void 0 ? 0 : (t.splice(n, 1), t.length);
1423
1517
  }
1424
- function Ft(e, t, n) {
1425
- const { siblings: o, index: i } = Y(n);
1426
- o !== void 0 && (t === "before" ? o.splice(i, 0, e) : o.splice(i + 1, 0, e));
1518
+ function Vt(e, t, n) {
1519
+ const { siblings: o, index: s } = U(n);
1520
+ o !== void 0 && (t === "before" ? o.splice(s, 0, e) : o.splice(s + 1, 0, e));
1427
1521
  }
1428
- function qt(e, t) {
1429
- const { siblings: n, index: o } = Y(e);
1522
+ function It(e, t) {
1523
+ const { siblings: n, index: o } = U(e);
1430
1524
  n !== void 0 && (n[o] = t, t.children = [e]);
1431
1525
  }
1432
- function Ke(e, t, n) {
1526
+ function Ge(e, t, n) {
1433
1527
  var o;
1434
- if (be(t), (o = n.parent) != null && o.parent || (t.direction = n.direction), e === "in")
1528
+ if (Xe(t), (o = n.parent) != null && o.parent || (t.direction = n.direction), e === "in")
1435
1529
  n.children ? n.children.push(t) : n.children = [t];
1436
1530
  else {
1437
1531
  t.direction !== void 0 && (t.direction = n.direction);
1438
- const { siblings: i, index: s } = Y(n);
1439
- if (i === void 0)
1532
+ const { siblings: s, index: i } = U(n);
1533
+ if (s === void 0)
1440
1534
  return;
1441
- e === "before" ? i.splice(s, 0, t) : i.splice(s + 1, 0, t);
1535
+ e === "before" ? s.splice(i, 0, t) : s.splice(i + 1, 0, t);
1442
1536
  }
1443
1537
  }
1444
- const Vt = function({ map: e, direction: t }, n) {
1445
- var o, i;
1446
- if (t === $)
1447
- return $;
1538
+ const Kt = function({ map: e, direction: t }, n) {
1539
+ var o, s;
1540
+ if (t === A)
1541
+ return A;
1448
1542
  if (t === P)
1449
1543
  return P;
1450
- if (t === ae) {
1451
- const s = ((o = e.querySelector(".lhs")) == null ? void 0 : o.childElementCount) || 0, r = ((i = e.querySelector(".rhs")) == null ? void 0 : i.childElementCount) || 0;
1452
- return s <= r ? (n.direction = $, $) : (n.direction = P, P);
1453
- }
1454
- }, Ue = function(e, t, n) {
1455
- var s, r;
1456
- const o = n.children[0].children[0], i = t.parentElement;
1457
- if (i.tagName === "ME-PARENT") {
1458
- if (Q(o), i.children[1])
1459
- i.nextSibling.appendChild(n);
1544
+ if (t === ce) {
1545
+ const i = ((o = e.querySelector(".lhs")) == null ? void 0 : o.childElementCount) || 0, r = ((s = e.querySelector(".rhs")) == null ? void 0 : s.childElementCount) || 0;
1546
+ return i <= r ? (n.direction = A, A) : (n.direction = P, P);
1547
+ }
1548
+ }, Je = function(e, t, n) {
1549
+ var i, r;
1550
+ const o = n.children[0].children[0], s = t.parentElement;
1551
+ if (s.tagName === "ME-PARENT") {
1552
+ if (Z(o), s.children[1])
1553
+ s.nextSibling.appendChild(n);
1460
1554
  else {
1461
- const c = e.createChildren([n]);
1462
- i.appendChild(ve(!0)), i.insertAdjacentElement("afterend", c);
1555
+ const l = e.createChildren([n]);
1556
+ s.appendChild(ge(!0)), s.insertAdjacentElement("afterend", l);
1463
1557
  }
1464
1558
  e.linkDiv(n.offsetParent);
1465
1559
  } else
1466
- i.tagName === "ME-ROOT" && (Vt(e, o.nodeObj) === $ ? (s = e.container.querySelector(".lhs")) == null || s.appendChild(n) : (r = e.container.querySelector(".rhs")) == null || r.appendChild(n), e.linkDiv());
1467
- }, Ye = function(e, t) {
1560
+ s.tagName === "ME-ROOT" && (Kt(e, o.nodeObj) === A ? (i = e.container.querySelector(".lhs")) == null || i.appendChild(n) : (r = e.container.querySelector(".rhs")) == null || r.appendChild(n), e.linkDiv());
1561
+ }, Wt = function(e, t) {
1468
1562
  const n = e.parentNode;
1469
1563
  if (t === 0) {
1470
1564
  const o = n.parentNode.parentNode;
1471
1565
  o.tagName !== "ME-MAIN" && (o.previousSibling.children[1].remove(), o.remove());
1472
1566
  }
1473
1567
  n.parentNode.remove();
1474
- }, Xe = {
1568
+ }, Ze = {
1475
1569
  before: "beforebegin",
1476
1570
  after: "afterend"
1477
- }, Q = function(e) {
1571
+ }, Z = function(e) {
1478
1572
  const n = e.parentElement.parentElement.lastElementChild;
1479
1573
  (n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
1480
- }, Wt = function(e, t) {
1481
- const n = e.nodeObj, o = me(n);
1574
+ }, Yt = function(e, t) {
1575
+ const n = e.nodeObj, o = pe(n);
1482
1576
  o.style && t.style && (t.style = Object.assign(o.style, t.style));
1483
- const i = Object.assign(n, t);
1484
- ge(e, i), this.linkDiv(), this.bus.fire("operation", {
1577
+ const s = Object.assign(n, t);
1578
+ me(e, s), this.linkDiv(), this.bus.fire("operation", {
1485
1579
  name: "reshapeNode",
1486
- obj: i,
1580
+ obj: s,
1487
1581
  origin: o
1488
1582
  });
1489
1583
  }, ye = function(e, t, n) {
1490
1584
  if (!t)
1491
1585
  return null;
1492
1586
  const o = t.nodeObj;
1493
- o.expanded === !1 && (e.expandNode(t, !0), t = S(o.id));
1494
- const i = n || e.generateNewObj();
1495
- o.children ? o.children.push(i) : o.children = [i], B(e.nodeData);
1496
- const { grp: s, top: r } = e.createWrapper(i);
1497
- return Ue(e, t, s), { newTop: r, newNodeObj: i };
1498
- }, It = function(e, t, n) {
1587
+ o.expanded === !1 && (e.expandNode(t, !0), t = N(o.id));
1588
+ const s = n || e.generateNewObj();
1589
+ o.children ? o.children.push(s) : o.children = [s], B(e.nodeData);
1590
+ const { grp: i, top: r } = e.createWrapper(s);
1591
+ return Je(e, t, i), { newTop: r, newNodeObj: s };
1592
+ }, Ut = function(e, t, n) {
1499
1593
  var d, a, u, h;
1500
1594
  const o = t || this.currentNode;
1501
1595
  if (!o)
1502
1596
  return;
1503
- const i = o.nodeObj;
1504
- if (i.parent) {
1505
- if (!((d = i.parent) != null && d.parent) && ((u = (a = i.parent) == null ? void 0 : a.children) == null ? void 0 : u.length) === 1) {
1506
- this.addChild(S(i.parent.id), n);
1597
+ const s = o.nodeObj;
1598
+ if (s.parent) {
1599
+ if (!((d = s.parent) != null && d.parent) && ((u = (a = s.parent) == null ? void 0 : a.children) == null ? void 0 : u.length) === 1) {
1600
+ this.addChild(N(s.parent.id), n);
1507
1601
  return;
1508
1602
  }
1509
1603
  } else {
1510
1604
  this.addChild();
1511
1605
  return;
1512
1606
  }
1513
- const s = n || this.generateNewObj();
1514
- if (!((h = i.parent) != null && h.parent)) {
1515
- const p = o.closest("me-main").className === L.LHS ? $ : P;
1516
- s.direction = p;
1607
+ const i = n || this.generateNewObj();
1608
+ if (!((h = s.parent) != null && h.parent)) {
1609
+ const m = o.closest("me-main").className === M.LHS ? A : P;
1610
+ i.direction = m;
1517
1611
  }
1518
- Ft(s, e, i), B(this.nodeData);
1519
- const r = o.parentElement, { grp: c, top: l } = this.createWrapper(s);
1520
- r.parentElement.insertAdjacentElement(Xe[e], c), this.linkDiv(c.offsetParent), n || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), this.bus.fire("operation", {
1612
+ Vt(i, e, s), B(this.nodeData);
1613
+ const r = o.parentElement, { grp: l, top: c } = this.createWrapper(i);
1614
+ r.parentElement.insertAdjacentElement(Ze[e], l), this.linkDiv(l.offsetParent), n || this.editTopic(c.firstChild), this.selectNode(c.firstChild, !0), this.bus.fire("operation", {
1521
1615
  name: "insertSibling",
1522
1616
  type: e,
1523
- obj: s
1617
+ obj: i
1524
1618
  });
1525
- }, Kt = function(e, t) {
1619
+ }, Xt = function(e, t) {
1526
1620
  const n = e || this.currentNode;
1527
1621
  if (!n)
1528
1622
  return;
1529
- Q(n);
1623
+ Z(n);
1530
1624
  const o = n.nodeObj;
1531
1625
  if (!o.parent)
1532
1626
  return;
1533
- const i = t || this.generateNewObj();
1534
- qt(o, i), B(this.nodeData);
1535
- const s = n.parentElement.parentElement, { grp: r, top: c } = this.createWrapper(i, !0);
1536
- c.appendChild(ve(!0)), s.insertAdjacentElement("afterend", r);
1537
- const l = this.createChildren([s]);
1538
- c.insertAdjacentElement("afterend", l), this.linkDiv(), t || this.editTopic(c.firstChild), this.selectNode(c.firstChild, !0), this.bus.fire("operation", {
1627
+ const s = t || this.generateNewObj();
1628
+ It(o, s), B(this.nodeData);
1629
+ const i = n.parentElement.parentElement, { grp: r, top: l } = this.createWrapper(s, !0);
1630
+ l.appendChild(ge(!0)), i.insertAdjacentElement("afterend", r);
1631
+ const c = this.createChildren([i]);
1632
+ l.insertAdjacentElement("afterend", c), this.linkDiv(), t || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), this.bus.fire("operation", {
1539
1633
  name: "insertParent",
1540
- obj: i
1634
+ obj: s
1541
1635
  });
1542
- }, Ut = function(e, t) {
1636
+ }, Gt = function(e, t) {
1543
1637
  const n = e || this.currentNode;
1544
1638
  if (!n)
1545
1639
  return;
1546
1640
  const o = ye(this, n, t);
1547
1641
  if (!o)
1548
1642
  return;
1549
- const { newTop: i, newNodeObj: s } = o;
1643
+ const { newTop: s, newNodeObj: i } = o;
1550
1644
  this.bus.fire("operation", {
1551
1645
  name: "addChild",
1552
- obj: s
1553
- }), t || this.editTopic(i.firstChild), this.selectNode(i.firstChild, !0);
1554
- }, Yt = function(e, t) {
1555
- const n = me(e.nodeObj);
1556
- pe(n);
1646
+ obj: i
1647
+ }), t || this.editTopic(s.firstChild), this.selectNode(s.firstChild, !0);
1648
+ }, Jt = function(e, t) {
1649
+ const n = pe(e.nodeObj);
1650
+ fe(n);
1557
1651
  const o = ye(this, t, n);
1558
1652
  if (!o)
1559
1653
  return;
1560
- const { newNodeObj: i } = o;
1561
- this.selectNode(S(i.id)), this.bus.fire("operation", {
1654
+ const { newNodeObj: s } = o;
1655
+ this.selectNode(N(s.id)), this.bus.fire("operation", {
1562
1656
  name: "copyNode",
1563
- obj: i
1657
+ obj: s
1564
1658
  });
1565
- }, Xt = function(e, t) {
1566
- e = de(e);
1659
+ }, Zt = function(e, t) {
1660
+ e = ae(e);
1567
1661
  const n = [];
1568
1662
  for (let o = 0; o < e.length; o++) {
1569
- const i = e[o], s = me(i.nodeObj);
1570
- pe(s);
1571
- const r = ye(this, t, s);
1663
+ const s = e[o], i = pe(s.nodeObj);
1664
+ fe(i);
1665
+ const r = ye(this, t, i);
1572
1666
  if (!r)
1573
1667
  return;
1574
- const { newNodeObj: c } = r;
1575
- n.push(c);
1668
+ const { newNodeObj: l } = r;
1669
+ n.push(l);
1576
1670
  }
1577
- this.selectNodes(n.map((o) => S(o.id))), this.bus.fire("operation", {
1671
+ this.unselectNodes(this.currentNodes), this.selectNodes(n.map((o) => N(o.id))), this.bus.fire("operation", {
1578
1672
  name: "copyNodes",
1579
1673
  objs: n
1580
1674
  });
1581
- }, Gt = function(e) {
1675
+ }, Qt = function(e) {
1582
1676
  const t = e || this.currentNode;
1583
1677
  if (!t)
1584
1678
  return;
1585
1679
  const n = t.nodeObj;
1586
- Rt(n);
1680
+ Ft(n);
1587
1681
  const o = t.parentNode.parentNode;
1588
1682
  o.parentNode.insertBefore(o, o.previousSibling), this.linkDiv(), this.bus.fire("operation", {
1589
1683
  name: "moveUpNode",
1590
1684
  obj: n
1591
1685
  });
1592
- }, Jt = function(e) {
1686
+ }, en = function(e) {
1593
1687
  const t = e || this.currentNode;
1594
1688
  if (!t)
1595
1689
  return;
1596
1690
  const n = t.nodeObj;
1597
- zt(n);
1691
+ qt(n);
1598
1692
  const o = t.parentNode.parentNode;
1599
1693
  o.nextSibling ? o.nextSibling.insertAdjacentElement("afterend", o) : o.parentNode.prepend(o), this.linkDiv(), this.bus.fire("operation", {
1600
1694
  name: "moveDownNode",
1601
1695
  obj: n
1602
1696
  });
1603
- }, Zt = function(e) {
1604
- var r;
1605
- const t = e || this.currentNode;
1606
- if (!t)
1697
+ }, tn = function(e) {
1698
+ if (e.length === 0)
1607
1699
  return;
1608
- const n = t.nodeObj;
1609
- if (!n.parent)
1610
- throw new Error("Can not remove root node");
1611
- const o = n.parent.children, i = o.findIndex((c) => c === n), s = be(n);
1612
- if (Ye(t, s), o.length !== 0) {
1613
- const c = o[i] || o[i - 1];
1614
- this.selectNode(S(c.id));
1615
- } else
1616
- this.selectNode(S(n.parent.id));
1617
- this.linkDiv(), this.bus.fire("operation", {
1618
- name: "removeNode",
1619
- obj: n,
1620
- originIndex: i,
1621
- originParentId: (r = n == null ? void 0 : n.parent) == null ? void 0 : r.id
1622
- });
1623
- }, Qt = function(e) {
1624
- e = de(e);
1625
- for (const t of e) {
1626
- const n = t.nodeObj;
1627
- if (!n.parent)
1628
- continue;
1629
- const o = be(n);
1630
- Ye(t, o);
1700
+ e = ae(e);
1701
+ for (const n of e) {
1702
+ const o = n.nodeObj, s = Xe(o);
1703
+ Wt(n, s);
1631
1704
  }
1632
- this.linkDiv(), this.bus.fire("operation", {
1705
+ const t = e[e.length - 1];
1706
+ this.selectNode(N(t.nodeObj.parent.id)), this.linkDiv(), this.bus.fire("operation", {
1633
1707
  name: "removeNodes",
1634
- objs: e.map((t) => t.nodeObj)
1708
+ objs: e.map((n) => n.nodeObj)
1635
1709
  });
1636
- }, en = function(e, t) {
1637
- e = de(e);
1710
+ }, nn = function(e, t) {
1711
+ e = ae(e);
1638
1712
  const n = t.nodeObj;
1639
- n.expanded === !1 && (this.expandNode(t, !0), t = S(n.id));
1713
+ n.expanded === !1 && (this.expandNode(t, !0), t = N(n.id));
1640
1714
  for (const o of e) {
1641
- const i = o.nodeObj;
1642
- Ke("in", i, n), B(this.nodeData);
1643
- const s = o.parentElement;
1644
- Ue(this, t, s.parentElement);
1715
+ const s = o.nodeObj;
1716
+ Ge("in", s, n), B(this.nodeData);
1717
+ const i = o.parentElement;
1718
+ Je(this, t, i.parentElement);
1645
1719
  }
1646
1720
  this.linkDiv(), this.bus.fire("operation", {
1647
1721
  name: "moveNodeIn",
1648
1722
  objs: e.map((o) => o.nodeObj),
1649
1723
  toObj: n
1650
1724
  });
1651
- }, Ge = (e, t, n, o) => {
1652
- e = de(e), t === "after" && (e = e.reverse());
1653
- const i = n.nodeObj, s = [];
1725
+ }, Qe = (e, t, n, o) => {
1726
+ e = ae(e), t === "after" && (e = e.reverse());
1727
+ const s = n.nodeObj, i = [];
1654
1728
  for (const r of e) {
1655
- const c = r.nodeObj;
1656
- Ke(t, c, i), B(o.nodeData), Q(r);
1657
- const l = r.parentElement.parentNode;
1658
- s.includes(l.parentElement) || s.push(l.parentElement), n.parentElement.parentNode.insertAdjacentElement(Xe[t], l);
1729
+ const l = r.nodeObj;
1730
+ Ge(t, l, s), B(o.nodeData), Z(r);
1731
+ const c = r.parentElement.parentNode;
1732
+ i.includes(c.parentElement) || i.push(c.parentElement), n.parentElement.parentNode.insertAdjacentElement(Ze[t], c);
1659
1733
  }
1660
- for (const r of s)
1734
+ for (const r of i)
1661
1735
  r.childElementCount === 0 && r.tagName !== "ME-MAIN" && (r.previousSibling.children[1].remove(), r.remove());
1662
1736
  o.linkDiv(), o.bus.fire("operation", {
1663
1737
  name: t === "before" ? "moveNodeBefore" : "moveNodeAfter",
1664
1738
  objs: e.map((r) => r.nodeObj),
1665
- toObj: i
1739
+ toObj: s
1666
1740
  });
1667
- }, tn = function(e, t) {
1668
- Ge(e, "before", t, this);
1669
- }, nn = function(e, t) {
1670
- Ge(e, "after", t, this);
1671
- }, on = function(e) {
1741
+ }, on = function(e, t) {
1742
+ Qe(e, "before", t, this);
1743
+ }, sn = function(e, t) {
1744
+ Qe(e, "after", t, this);
1745
+ }, rn = function(e) {
1672
1746
  const t = e || this.currentNode;
1673
1747
  t && (t.nodeObj.dangerouslySetInnerHTML || this.editTopic(t));
1674
- }, sn = function(e, t) {
1748
+ }, ln = function(e, t) {
1675
1749
  e.text.textContent = t, e.nodeObj.topic = t, this.linkDiv();
1676
- }, Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1750
+ }, et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1677
1751
  __proto__: null,
1678
- addChild: Ut,
1679
- beginEdit: on,
1680
- copyNode: Yt,
1681
- copyNodes: Xt,
1682
- insertParent: Kt,
1683
- insertSibling: It,
1684
- moveDownNode: Jt,
1685
- moveNodeAfter: nn,
1686
- moveNodeBefore: tn,
1687
- moveNodeIn: en,
1688
- moveUpNode: Gt,
1689
- removeNode: Zt,
1690
- removeNodes: Qt,
1691
- reshapeNode: Wt,
1692
- rmSubline: Q,
1693
- setNodeTopic: sn
1752
+ addChild: Gt,
1753
+ beginEdit: rn,
1754
+ copyNode: Jt,
1755
+ copyNodes: Zt,
1756
+ insertParent: Xt,
1757
+ insertSibling: Ut,
1758
+ moveDownNode: en,
1759
+ moveNodeAfter: sn,
1760
+ moveNodeBefore: on,
1761
+ moveNodeIn: nn,
1762
+ moveUpNode: Qt,
1763
+ removeNodes: tn,
1764
+ reshapeNode: Yt,
1765
+ rmSubline: Z,
1766
+ setNodeTopic: ln
1694
1767
  }, Symbol.toStringTag, { value: "Module" }));
1695
- function Ze(e) {
1768
+ function cn(e) {
1696
1769
  return {
1697
1770
  nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
1698
1771
  arrows: e.arrows,
@@ -1701,118 +1774,92 @@ function Ze(e) {
1701
1774
  theme: e.theme
1702
1775
  };
1703
1776
  }
1704
- const rn = function(e, t, n) {
1705
- if (e) {
1706
- if (this.clearSelection(), typeof e == "string") {
1707
- const o = S(e);
1708
- return o ? this.selectNode(o) : void 0;
1709
- }
1710
- 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);
1711
- }
1712
- }, cn = function() {
1713
- this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode");
1714
- }, ln = function(e) {
1715
- this.clearSelection();
1716
- for (const t of e)
1717
- t.className = "selected";
1718
- this.currentNodes = e, this.bus.fire(
1719
- "selectNodes",
1720
- e.map((t) => t.nodeObj)
1721
- );
1722
- }, an = function() {
1723
- if (this.currentNodes)
1724
- for (const e of this.currentNodes)
1725
- e.classList.remove("selected");
1726
- this.currentNodes = null, this.bus.fire("unselectNodes");
1727
- }, dn = function() {
1728
- this.unselectNode(), this.unselectNodes(), this.unselectSummary(), this.unselectArrow();
1729
- }, hn = function() {
1730
- const e = Ze(this);
1777
+ const an = function(e, t, n) {
1778
+ this.clearSelection(), e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.selection.select(e), t && this.bus.fire("selectNewNode", e.nodeObj);
1779
+ }, dn = function(e) {
1780
+ this.selection.select(e);
1781
+ }, hn = function(e) {
1782
+ this.selection.deselect(e);
1783
+ }, un = function() {
1784
+ this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
1785
+ }, fn = function() {
1786
+ const e = cn(this);
1731
1787
  return JSON.stringify(e, (t, n) => {
1732
1788
  if (!(t === "parent" && typeof n != "string"))
1733
1789
  return n;
1734
1790
  });
1735
- }, un = function() {
1736
- return JSON.parse(this.getDataString());
1737
- }, fn = function() {
1738
- const e = Ze(this).nodeData;
1739
- let t = "# " + e.topic + `
1740
-
1741
- `;
1742
- function n(o, i) {
1743
- for (let s = 0; s < o.length; s++)
1744
- i <= 6 ? t += "".padStart(i, "#") + " " + o[s].topic + `
1745
-
1746
- ` : t += "".padStart(i - 7, " ") + "- " + o[s].topic + `
1747
- `, o[s].children && n(o[s].children || [], i + 1);
1748
- }
1749
- return n(e.children || [], 2), t;
1750
1791
  }, pn = function() {
1751
- this.editable = !0;
1792
+ return JSON.parse(this.getDataString());
1752
1793
  }, mn = function() {
1794
+ this.editable = !0;
1795
+ }, gn = function() {
1753
1796
  this.editable = !1;
1754
- }, gn = function(e) {
1755
- this.scaleVal = e, this.map.style.transform = "scale(" + e + ")", this.bus.fire("scale", e);
1797
+ }, yn = function(e, t = { x: 0, y: 0 }) {
1798
+ const n = this.container.getBoundingClientRect(), o = n.width / 2 - 1e4, s = n.height / 2 - 1e4, i = this.scaleVal, r = this.map.style.transform, { x: l, y: c } = qe(r), d = l - (t.x - n.left - n.width / 2), a = c - (t.y - n.top - n.height / 2), u = (o - d) * (1 - e / i), h = (s - a) * (1 - e / i);
1799
+ this.map.style.transform = `translate(${l + u}px, ${c + h}px) scale(${e})`, this.scaleVal = e, this.bus.fire("scale", e);
1756
1800
  }, vn = function() {
1757
1801
  const e = this.nodes.offsetHeight / this.container.offsetHeight, t = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(e, t));
1758
1802
  this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
1759
- }, bn = function() {
1760
- this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
1761
- }, yn = function(e) {
1803
+ }, bn = function(e, t) {
1804
+ const { map: n, scaleVal: o, container: s, bus: i } = this, r = n.style.transform, { x: l, y: c } = qe(r), d = l + e, a = c + t, u = (1 - o) * 1e4, h = 0 - u, m = -2e4 + s.offsetWidth + u, p = -2e4 + s.offsetHeight + u, y = Math.min(h, Math.max(m, d)), g = Math.min(h, Math.max(p, a));
1805
+ n.style.transform = `translate(${y}px, ${g}px) scale(${o})`, i.fire("move", { dx: e, dy: t });
1806
+ }, xn = function() {
1807
+ const e = this.container.getBoundingClientRect(), t = e.width / 2 - 1e4, n = e.height / 2 - 1e4;
1808
+ this.map.style.transform = `translate(${t}px, ${n}px) scale(${this.scaleVal})`;
1809
+ }, wn = function(e) {
1762
1810
  e(this);
1763
- }, xn = function(e) {
1811
+ }, En = function(e) {
1764
1812
  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());
1765
- }, wn = function() {
1813
+ }, Sn = function() {
1766
1814
  this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
1767
- }, En = function() {
1815
+ }, Cn = function() {
1768
1816
  this.direction = 0, this.refresh();
1769
1817
  }, Nn = function() {
1770
1818
  this.direction = 1, this.refresh();
1771
- }, Cn = function() {
1819
+ }, _n = function() {
1772
1820
  this.direction = 2, this.refresh();
1773
- }, Sn = function(e) {
1821
+ }, Mn = function(e) {
1774
1822
  this.locale = e, this.refresh();
1775
- }, _n = function(e, t) {
1823
+ }, kn = function(e, t) {
1776
1824
  const n = e.nodeObj;
1777
1825
  typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
1778
- const o = e.parentNode, i = o.children[1];
1779
- if (i.expanded = n.expanded, i.className = n.expanded ? "minus" : "", Q(e), n.expanded) {
1780
- const l = this.createChildren(
1826
+ const o = e.parentNode, s = o.children[1];
1827
+ if (s.expanded = n.expanded, s.className = n.expanded ? "minus" : "", Z(e), n.expanded) {
1828
+ const c = this.createChildren(
1781
1829
  n.children.map((d) => this.createWrapper(d).grp)
1782
1830
  );
1783
- o.parentNode.appendChild(l);
1831
+ o.parentNode.appendChild(c);
1784
1832
  } else
1785
1833
  o.parentNode.children[1].remove();
1786
1834
  this.linkDiv(e.closest("me-main > me-wrapper"));
1787
- const s = e.getBoundingClientRect(), r = this.container.getBoundingClientRect();
1788
- (s.bottom > r.bottom || s.top < r.top || s.right > r.right || s.left < r.left) && e.scrollIntoView({ block: "center", inline: "center" }), this.bus.fire("expandNode", n);
1835
+ const i = e.getBoundingClientRect(), r = this.container.getBoundingClientRect();
1836
+ (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);
1789
1837
  }, Ln = function(e) {
1790
1838
  e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || []), B(this.nodeData), this.layout(), this.linkDiv();
1791
- }, Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1839
+ }, Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1792
1840
  __proto__: null,
1793
- cancelFocus: wn,
1794
- clearSelection: dn,
1795
- disableEdit: mn,
1796
- enableEdit: pn,
1797
- expandNode: _n,
1798
- focusNode: xn,
1799
- getData: un,
1800
- getDataMd: fn,
1801
- getDataString: hn,
1802
- initLeft: En,
1841
+ cancelFocus: Sn,
1842
+ clearSelection: un,
1843
+ disableEdit: gn,
1844
+ enableEdit: mn,
1845
+ expandNode: kn,
1846
+ focusNode: En,
1847
+ getData: pn,
1848
+ getDataString: fn,
1849
+ initLeft: Cn,
1803
1850
  initRight: Nn,
1804
- initSide: Cn,
1805
- install: yn,
1851
+ initSide: _n,
1852
+ install: wn,
1853
+ move: bn,
1806
1854
  refresh: Ln,
1807
- scale: gn,
1855
+ scale: yn,
1808
1856
  scaleFit: vn,
1809
- selectNode: rn,
1810
- selectNodes: ln,
1811
- setLocale: Sn,
1812
- toCenter: bn,
1813
- unselectNode: cn,
1814
- unselectNodes: an
1815
- }, Symbol.toStringTag, { value: "Module" })), kn = function(e) {
1857
+ selectNode: an,
1858
+ selectNodes: dn,
1859
+ setLocale: Mn,
1860
+ toCenter: xn,
1861
+ unselectNodes: hn
1862
+ }, Symbol.toStringTag, { value: "Module" })), An = function(e) {
1816
1863
  return {
1817
1864
  dom: e,
1818
1865
  moved: !1,
@@ -1839,20 +1886,20 @@ const rn = function(e, t, n) {
1839
1886
  }
1840
1887
  };
1841
1888
  }, De = {
1842
- create: kn
1889
+ create: An
1843
1890
  };
1844
1891
  function le(e, t, n) {
1845
- const { offsetLeft: o, offsetTop: i } = R(e.nodes, t), s = t.offsetWidth, r = t.offsetHeight, c = o + s / 2, l = i + r / 2, d = c + n.x, a = l + n.y;
1892
+ const { offsetLeft: o, offsetTop: s } = R(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;
1846
1893
  return {
1847
- w: s,
1894
+ w: i,
1848
1895
  h: r,
1849
- cx: c,
1850
- cy: l,
1896
+ cx: l,
1897
+ cy: c,
1851
1898
  ctrlX: d,
1852
1899
  ctrlY: a
1853
1900
  };
1854
1901
  }
1855
- function I(e) {
1902
+ function W(e) {
1856
1903
  let t, n;
1857
1904
  const o = (e.cy - e.ctrlY) / (e.ctrlX - e.cx);
1858
1905
  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), {
@@ -1860,51 +1907,62 @@ function I(e) {
1860
1907
  y: n
1861
1908
  };
1862
1909
  }
1863
- const Tn = function(e, t, n, o) {
1864
- const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
1865
- return C(i, {
1910
+ const $n = function(e, t, n, o) {
1911
+ const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
1912
+ return C(s, {
1866
1913
  "text-anchor": "middle",
1867
1914
  x: t + "",
1868
1915
  y: n + "",
1869
1916
  fill: o || "#666"
1870
- }), i.dataset.type = "custom-link", i.innerHTML = e, i;
1871
- }, Qe = function(e, t, n, o, i) {
1917
+ }), s.dataset.type = "custom-link", s.innerHTML = e, s;
1918
+ }, ve = function(e, t, n, o, s) {
1872
1919
  if (!t || !n)
1873
1920
  return;
1874
1921
  performance.now();
1875
- const s = le(e, t, o.delta1), r = le(e, n, o.delta2), { x: c, y: l } = I(s), { ctrlX: d, ctrlY: a } = s, { ctrlX: u, ctrlY: h } = r, { x: p, y: g } = I(r), v = re(u, h, p, g), m = `M ${v.x1} ${v.y1} L ${p} ${g} L ${v.x2} ${v.y2}`;
1922
+ const i = le(e, t, o.delta1), r = le(e, n, o.delta2), { x: l, y: c } = W(i), { ctrlX: d, ctrlY: a } = i, { ctrlX: u, ctrlY: h } = r, { x: m, y: p } = W(r), y = ie(u, h, m, p);
1923
+ if (!y)
1924
+ return;
1925
+ const g = `M ${y.x1} ${y.y1} L ${m} ${p} L ${y.x2} ${y.y2}`;
1876
1926
  let f = "";
1877
1927
  if (o.bidirectional) {
1878
- const w = re(d, a, c, l);
1879
- f = `M ${w.x1} ${w.y1} L ${c} ${l} L ${w.x2} ${w.y2}`;
1928
+ const w = ie(d, a, l, c);
1929
+ if (!w)
1930
+ return;
1931
+ f = `M ${w.x1} ${w.y1} L ${l} ${c} L ${w.x2} ${w.y2}`;
1880
1932
  }
1881
- const b = ft(`M ${c} ${l} C ${d} ${a} ${u} ${h} ${p} ${g}`, m, f), x = c / 8 + d * 3 / 8 + u * 3 / 8 + p / 8, E = l / 8 + a * 3 / 8 + h * 3 / 8 + g / 8, y = Tn(o.label, x, E, e.theme.cssVar["--color"]);
1882
- b.appendChild(y), b.arrowObj = o, b.dataset.linkid = o.id, e.linkSvgGroup.appendChild(b), i || (e.arrows.push(o), e.currentArrow = b, et(e, o, s, r)), performance.now();
1883
- }, An = function(e, t, n = {}) {
1933
+ const v = gt(`M ${l} ${c} C ${d} ${a} ${u} ${h} ${m} ${p}`, g, f), x = l / 8 + d * 3 / 8 + u * 3 / 8 + m / 8, S = c / 8 + a * 3 / 8 + h * 3 / 8 + p / 8, b = $n(o.label, x, S, e.theme.cssVar["--color"]);
1934
+ v.appendChild(b), v.label = b, v.arrowObj = o, v.dataset.linkid = o.id, e.linkSvgGroup.appendChild(v), s || (e.arrows.push(o), e.currentArrow = v, tt(e, o, i, r)), performance.now();
1935
+ }, jn = function(e, t, n = {}) {
1884
1936
  const o = {
1885
- id: U(),
1937
+ id: I(),
1886
1938
  label: "Custom Link",
1887
1939
  from: e.nodeObj.id,
1888
1940
  to: t.nodeObj.id,
1889
1941
  delta1: {
1890
- x: 0,
1891
- y: -200
1942
+ x: e.offsetWidth / 2 + 100,
1943
+ y: 0
1892
1944
  },
1893
1945
  delta2: {
1894
- x: 0,
1895
- y: -200
1946
+ x: t.offsetWidth / 2 + 100,
1947
+ y: 0
1896
1948
  },
1897
1949
  ...n
1898
1950
  };
1899
- Qe(this, e, t, o), this.bus.fire("operation", {
1951
+ ve(this, e, t, o), this.bus.fire("operation", {
1900
1952
  name: "createArrow",
1901
1953
  obj: o
1902
1954
  });
1903
- }, $n = function(e) {
1955
+ }, On = function(e) {
1956
+ const t = { ...e, id: I() };
1957
+ ve(this, N(t.from), N(t.to), t), this.bus.fire("operation", {
1958
+ name: "createArrow",
1959
+ obj: t
1960
+ });
1961
+ }, Dn = function(e) {
1904
1962
  let t;
1905
1963
  if (e ? t = e : t = this.currentArrow, !t)
1906
1964
  return;
1907
- xe(this);
1965
+ be(this);
1908
1966
  const n = t.arrowObj.id;
1909
1967
  this.arrows = this.arrows.filter((o) => o.id !== n), t.remove(), this.bus.fire("operation", {
1910
1968
  name: "removeArrow",
@@ -1912,111 +1970,107 @@ const Tn = function(e, t, n, o) {
1912
1970
  id: n
1913
1971
  }
1914
1972
  });
1915
- }, jn = function(e) {
1973
+ }, Hn = function(e) {
1916
1974
  this.currentArrow = e;
1917
- const t = e.arrowObj, n = S(t.from), o = S(t.to), i = le(this, n, t.delta1), s = le(this, o, t.delta2);
1918
- et(this, t, i, s);
1919
- }, Dn = function() {
1920
- this.currentArrow = null, xe(this);
1921
- }, xe = function(e) {
1975
+ const t = e.arrowObj, n = N(t.from), o = N(t.to), s = le(this, n, t.delta1), i = le(this, o, t.delta2);
1976
+ tt(this, t, s, i);
1977
+ }, Pn = function() {
1978
+ this.currentArrow = null, be(this);
1979
+ }, be = function(e) {
1922
1980
  var t, n;
1923
1981
  (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";
1924
- }, et = function(e, t, n, o) {
1982
+ }, tt = function(e, t, n, o) {
1925
1983
  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);
1926
- let { x: i, y: s } = I(n), { ctrlX: r, ctrlY: c } = n, { ctrlX: l, ctrlY: d } = o, { x: a, y: u } = I(o);
1927
- e.P2.style.cssText = `top:${c}px;left:${r}px;`, e.P3.style.cssText = `top:${d}px;left:${l}px;`, C(e.line1, {
1928
- x1: i + "",
1929
- y1: s + "",
1984
+ let { x: s, y: i } = W(n), { ctrlX: r, ctrlY: l } = n, { ctrlX: c, ctrlY: d } = o, { x: a, y: u } = W(o);
1985
+ e.P2.style.cssText = `top:${l}px;left:${r}px;`, e.P3.style.cssText = `top:${d}px;left:${c}px;`, C(e.line1, {
1986
+ x1: s + "",
1987
+ y1: i + "",
1930
1988
  x2: r + "",
1931
- y2: c + ""
1989
+ y2: l + ""
1932
1990
  }), C(e.line2, {
1933
- x1: l + "",
1991
+ x1: c + "",
1934
1992
  y1: d + "",
1935
1993
  x2: a + "",
1936
1994
  y2: u + ""
1937
- }), e.helper1 = De.create(e.P2), e.helper2 = De.create(e.P3), e.helper1.init(e.map, (h, p) => {
1995
+ }), e.helper1 = De.create(e.P2), e.helper2 = De.create(e.P3), e.helper1.init(e.map, (h, m) => {
1938
1996
  if (!e.currentArrow)
1939
1997
  return;
1940
- r = r + h / e.scaleVal, c = c + p / e.scaleVal;
1941
- const g = I({ ...n, ctrlX: r, ctrlY: c });
1942
- i = g.x, s = g.y;
1943
- const v = i / 8 + r * 3 / 8 + l * 3 / 8 + a / 8, m = s / 8 + c * 3 / 8 + d * 3 / 8 + u / 8;
1944
- if (e.P2.style.top = c + "px", e.P2.style.left = r + "px", e.currentArrow.children[0].setAttribute("d", `M ${i} ${s} C ${r} ${c} ${l} ${d} ${a} ${u}`), t.bidirectional) {
1945
- const f = re(r, c, i, s);
1946
- e.currentArrow.children[2].setAttribute("d", `M ${f.x1} ${f.y1} L ${i} ${s} L ${f.x2} ${f.y2}`);
1998
+ r = r + h / e.scaleVal, l = l + m / e.scaleVal;
1999
+ const p = W({ ...n, ctrlX: r, ctrlY: l });
2000
+ s = p.x, i = p.y;
2001
+ const y = s / 8 + r * 3 / 8 + c * 3 / 8 + a / 8, g = i / 8 + l * 3 / 8 + d * 3 / 8 + u / 8;
2002
+ if (e.P2.style.top = l + "px", e.P2.style.left = r + "px", e.currentArrow.line.setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${d} ${a} ${u}`), t.bidirectional) {
2003
+ const f = ie(r, l, s, i);
2004
+ if (!f)
2005
+ return;
2006
+ e.currentArrow.arrow2.setAttribute("d", `M ${f.x1} ${f.y1} L ${s} ${i} L ${f.x2} ${f.y2}`);
1947
2007
  }
1948
- C(e.currentArrow.children[3], {
1949
- x: v + "",
1950
- y: m + ""
2008
+ C(e.currentArrow.label, {
2009
+ x: y + "",
2010
+ y: g + ""
1951
2011
  }), C(e.line1, {
1952
- x1: i + "",
1953
- y1: s + "",
2012
+ x1: s + "",
2013
+ y1: i + "",
1954
2014
  x2: r + "",
1955
- y2: c + ""
1956
- }), t.delta1.x = r - n.cx, t.delta1.y = c - n.cy, e.bus.fire("updateArrowDelta", t);
1957
- }), e.helper2.init(e.map, (h, p) => {
2015
+ y2: l + ""
2016
+ }), t.delta1.x = r - n.cx, t.delta1.y = l - n.cy, e.bus.fire("updateArrowDelta", t);
2017
+ }), e.helper2.init(e.map, (h, m) => {
1958
2018
  if (!e.currentArrow)
1959
2019
  return;
1960
- l = l + h / e.scaleVal, d = d + p / e.scaleVal;
1961
- const g = I({ ...o, ctrlX: l, ctrlY: d });
1962
- a = g.x, u = g.y;
1963
- const v = i / 8 + r * 3 / 8 + l * 3 / 8 + a / 8, m = s / 8 + c * 3 / 8 + d * 3 / 8 + u / 8, f = re(l, d, a, u);
1964
- e.P3.style.top = d + "px", e.P3.style.left = l + "px", e.currentArrow.children[0].setAttribute("d", `M ${i} ${s} C ${r} ${c} ${l} ${d} ${a} ${u}`), e.currentArrow.children[1].setAttribute("d", `M ${f.x1} ${f.y1} L ${a} ${u} L ${f.x2} ${f.y2}`), C(e.currentArrow.children[3], {
1965
- x: v + "",
1966
- y: m + ""
2020
+ c = c + h / e.scaleVal, d = d + m / e.scaleVal;
2021
+ const p = W({ ...o, ctrlX: c, ctrlY: d });
2022
+ a = p.x, u = p.y;
2023
+ const y = s / 8 + r * 3 / 8 + c * 3 / 8 + a / 8, g = i / 8 + l * 3 / 8 + d * 3 / 8 + u / 8, f = ie(c, d, a, u);
2024
+ f && (e.P3.style.top = d + "px", e.P3.style.left = c + "px", e.currentArrow.line.setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${d} ${a} ${u}`), e.currentArrow.arrow1.setAttribute("d", `M ${f.x1} ${f.y1} L ${a} ${u} L ${f.x2} ${f.y2}`), C(e.currentArrow.label, {
2025
+ x: y + "",
2026
+ y: g + ""
1967
2027
  }), C(e.line2, {
1968
- x1: l + "",
2028
+ x1: c + "",
1969
2029
  y1: d + "",
1970
2030
  x2: a + "",
1971
2031
  y2: u + ""
1972
- }), t.delta2.x = l - o.cx, t.delta2.y = d - o.cy, e.bus.fire("updateArrowDelta", t);
2032
+ }), t.delta2.x = c - o.cx, t.delta2.y = d - o.cy, e.bus.fire("updateArrowDelta", t));
1973
2033
  });
1974
2034
  };
1975
- function On() {
2035
+ function Bn() {
1976
2036
  this.linkSvgGroup.innerHTML = "";
1977
2037
  for (let e = 0; e < this.arrows.length; e++) {
1978
2038
  const t = this.arrows[e];
1979
2039
  try {
1980
- Qe(this, S(t.from), S(t.to), t, !0);
2040
+ ve(this, N(t.from), N(t.to), t, !0);
1981
2041
  } catch {
1982
2042
  }
1983
2043
  }
1984
2044
  this.nodes.appendChild(this.linkSvgGroup);
1985
2045
  }
1986
- function Hn(e) {
1987
- if (xe(this), !e)
2046
+ function Rn(e) {
2047
+ if (be(this), !e)
1988
2048
  return;
1989
- const t = e.children[3];
1990
- qe(this, t, (n) => {
1991
- var s;
1992
- const o = e.arrowObj, i = ((s = n.textContent) == null ? void 0 : s.trim()) || "";
1993
- i === "" ? o.label = origin : o.label = i, n.remove(), i !== origin && (t.innerHTML = o.label, this.linkDiv(), this.bus.fire("operation", {
1994
- name: "finishEditArrowLabel",
1995
- obj: o
1996
- }));
1997
- });
2049
+ const t = e.label;
2050
+ Ke(this, t, e.arrowObj);
1998
2051
  }
1999
- function Pn() {
2052
+ function zn() {
2000
2053
  this.arrows = this.arrows.filter((e) => se(e.from, this.nodeData) && se(e.to, this.nodeData));
2001
2054
  }
2002
- const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2055
+ const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2003
2056
  __proto__: null,
2004
- createArrow: An,
2005
- editArrowLabel: Hn,
2006
- removeArrow: $n,
2007
- renderArrow: On,
2008
- selectArrow: jn,
2009
- tidyArrow: Pn,
2010
- unselectArrow: Dn
2011
- }, Symbol.toStringTag, { value: "Module" })), Rn = function(e) {
2012
- var l, d;
2057
+ createArrow: jn,
2058
+ createArrowFrom: On,
2059
+ editArrowLabel: Rn,
2060
+ removeArrow: Dn,
2061
+ renderArrow: Bn,
2062
+ selectArrow: Hn,
2063
+ tidyArrow: zn,
2064
+ unselectArrow: Pn
2065
+ }, Symbol.toStringTag, { value: "Module" })), qn = function(e) {
2066
+ var c, d;
2013
2067
  if (e.length === 0)
2014
2068
  throw new Error("No selected node.");
2015
2069
  if (e.length === 1) {
2016
2070
  const a = e[0].nodeObj, u = e[0].nodeObj.parent;
2017
2071
  if (!u)
2018
2072
  throw new Error("Can not select root node.");
2019
- const h = u.children.findIndex((p) => a === p);
2073
+ const h = u.children.findIndex((m) => a === m);
2020
2074
  return {
2021
2075
  parent: u.id,
2022
2076
  start: h,
@@ -2028,33 +2082,33 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2028
2082
  let u = a.nodeObj;
2029
2083
  const h = [];
2030
2084
  for (; u.parent; ) {
2031
- const p = u.parent, g = p.children, v = g == null ? void 0 : g.indexOf(u);
2032
- u = p, h.unshift({ node: u, index: v });
2085
+ const m = u.parent, p = m.children, y = p == null ? void 0 : p.indexOf(u);
2086
+ u = m, h.unshift({ node: u, index: y });
2033
2087
  }
2034
2088
  return h.length > t && (t = h.length), h;
2035
2089
  });
2036
2090
  let o = 0;
2037
2091
  e:
2038
2092
  for (; o < t; o++) {
2039
- const a = (l = n[0][o]) == null ? void 0 : l.node;
2093
+ const a = (c = n[0][o]) == null ? void 0 : c.node;
2040
2094
  for (let u = 1; u < n.length; u++)
2041
2095
  if (((d = n[u][o]) == null ? void 0 : d.node) !== a)
2042
2096
  break e;
2043
2097
  }
2044
2098
  if (!o)
2045
2099
  throw new Error("Can not select root node.");
2046
- const i = n.map((a) => a[o - 1].index).sort(), s = i[0] || 0, r = i[i.length - 1] || 0, c = n[0][o - 1].node;
2047
- if (!c.parent)
2100
+ 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;
2101
+ if (!l.parent)
2048
2102
  throw new Error("Please select nodes in the same main topic.");
2049
2103
  return {
2050
- parent: c.id,
2051
- start: s,
2104
+ parent: l.id,
2105
+ start: i,
2052
2106
  end: r
2053
2107
  };
2054
- }, zn = function(e) {
2108
+ }, Vn = function(e) {
2055
2109
  const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
2056
2110
  return t.setAttribute("id", e), t;
2057
- }, Oe = function(e, t) {
2111
+ }, He = function(e, t) {
2058
2112
  const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
2059
2113
  return C(n, {
2060
2114
  d: e,
@@ -2063,58 +2117,58 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2063
2117
  "stroke-linecap": "round",
2064
2118
  "stroke-width": "2"
2065
2119
  }), n;
2066
- }, He = function(e, t, n, o, i) {
2067
- const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
2068
- return C(s, {
2120
+ }, Pe = function(e, t, n, o, s) {
2121
+ const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
2122
+ return C(i, {
2069
2123
  "text-anchor": o,
2070
2124
  x: t + "",
2071
2125
  y: n + "",
2072
- fill: i || "#666"
2073
- }), s.innerHTML = e, s;
2074
- }, Fn = (e) => S(e).parentElement.parentElement, qn = function({ parent: e, start: t }) {
2075
- const n = S(e), o = n.nodeObj;
2076
- let i;
2077
- return o.parent ? i = n.closest("me-main").className : i = S(o.children[t].id).closest("me-main").className, i;
2078
- }, we = function(e, t) {
2126
+ fill: s || "#666"
2127
+ }), i.innerHTML = e, i;
2128
+ }, In = (e) => N(e).parentElement.parentElement, Kn = function({ parent: e, start: t }) {
2129
+ const n = N(e), o = n.nodeObj;
2130
+ let s;
2131
+ return o.parent ? s = n.closest("me-main").className : s = N(o.children[t].id).closest("me-main").className, s;
2132
+ }, xe = function(e, t) {
2079
2133
  var w;
2080
- const { id: n, text: o, parent: i, start: s, end: r } = t, c = e.nodes, d = S(i).nodeObj, a = qn(t);
2081
- let u = 1 / 0, h = 0, p = 0, g = 0;
2082
- for (let _ = s; _ <= r; _++) {
2083
- const M = (w = d.children) == null ? void 0 : w[_];
2084
- if (!M)
2134
+ const { id: n, label: o, parent: s, start: i, end: r } = t, l = e.nodes, d = N(s).nodeObj, a = Kn(t);
2135
+ let u = 1 / 0, h = 0, m = 0, p = 0;
2136
+ for (let _ = i; _ <= r; _++) {
2137
+ const k = (w = d.children) == null ? void 0 : w[_];
2138
+ if (!k)
2085
2139
  return e.removeSummary(n), null;
2086
- const j = Fn(M.id), { offsetLeft: z, offsetTop: X } = R(c, j), Ee = s === r ? 10 : 20;
2087
- _ === s && (p = X + Ee), _ === r && (g = X + j.offsetHeight - Ee), z < u && (u = z), j.offsetWidth + z > h && (h = j.offsetWidth + z);
2088
- }
2089
- let v, m;
2090
- const f = p + 10, b = g + 10, x = (f + b) / 2, E = e.theme.cssVar["--color"];
2091
- a === L.LHS ? (v = Oe(`M ${u + 10} ${f} c -5 0 -10 5 -10 10 L ${u} ${b - 10} c 0 5 5 10 10 10 M ${u} ${x} h -10`, E), m = He(o, u - 20, x + 6, "end", E)) : (v = Oe(`M ${h - 10} ${f} c 5 0 10 5 10 10 L ${h} ${b - 10} c 0 5 -5 10 -10 10 M ${h} ${x} h 10`, E), m = He(o, h + 20, x + 6, "start", E));
2092
- const y = zn("s-" + n);
2093
- return y.appendChild(v), y.appendChild(m), y.summaryObj = t, e.summarySvg.appendChild(y), y;
2094
- }, Vn = function() {
2095
- let e = [];
2096
- this.currentNode ? e = [this.currentNode] : this.currentNodes && (e = this.currentNodes);
2097
- const { parent: t, start: n, end: o } = Rn(e), i = { id: U(), parent: t, start: n, end: o, text: "summary" }, s = we(this, i);
2098
- this.summaries.push(i), this.editSummary(s), this.bus.fire("operation", {
2140
+ const j = In(k.id), { offsetLeft: z, offsetTop: X } = R(l, j), we = i === r ? 10 : 20;
2141
+ _ === i && (m = X + we), _ === r && (p = X + j.offsetHeight - we), z < u && (u = z), j.offsetWidth + z > h && (h = j.offsetWidth + z);
2142
+ }
2143
+ let y, g;
2144
+ const f = m + 10, v = p + 10, x = (f + v) / 2, S = e.theme.cssVar["--color"];
2145
+ a === M.LHS ? (y = He(`M ${u + 10} ${f} c -5 0 -10 5 -10 10 L ${u} ${v - 10} c 0 5 5 10 10 10 M ${u} ${x} h -10`, S), g = Pe(o, u - 20, x + 6, "end", S)) : (y = He(`M ${h - 10} ${f} c 5 0 10 5 10 10 L ${h} ${v - 10} c 0 5 -5 10 -10 10 M ${h} ${x} h 10`, S), g = Pe(o, h + 20, x + 6, "start", S));
2146
+ const b = Vn("s-" + n);
2147
+ return b.appendChild(y), b.appendChild(g), b.summaryObj = t, e.summarySvg.appendChild(b), b;
2148
+ }, Wn = function() {
2149
+ if (!this.currentNodes)
2150
+ return;
2151
+ const e = this.currentNodes, { parent: t, start: n, end: o } = qn(e), s = { id: I(), parent: t, start: n, end: o, label: "summary" }, i = xe(this, s);
2152
+ this.summaries.push(s), this.editSummary(i), this.bus.fire("operation", {
2099
2153
  name: "createSummary",
2100
- obj: i
2154
+ obj: s
2101
2155
  });
2102
- }, Wn = function(e) {
2103
- const t = U(), n = { ...e, id: t };
2104
- we(this, n), this.summaries.push(n), this.bus.fire("operation", {
2156
+ }, Yn = function(e) {
2157
+ const t = I(), n = { ...e, id: t };
2158
+ xe(this, n), this.summaries.push(n), this.bus.fire("operation", {
2105
2159
  name: "createSummary",
2106
2160
  obj: n
2107
2161
  });
2108
- }, In = function(e) {
2162
+ }, Un = function(e) {
2109
2163
  var n;
2110
2164
  const t = this.summaries.findIndex((o) => o.id === e);
2111
2165
  t > -1 && (this.summaries.splice(t, 1), (n = document.querySelector("#s-" + e)) == null || n.remove()), this.bus.fire("operation", {
2112
2166
  name: "removeSummary",
2113
2167
  obj: { id: e }
2114
2168
  });
2115
- }, Kn = function(e) {
2116
- const t = e.children[1].getBBox(), n = 6, o = 3, i = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2117
- C(i, {
2169
+ }, Xn = function(e) {
2170
+ const t = e.children[1].getBBox(), n = 6, o = 3, s = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2171
+ C(s, {
2118
2172
  x: t.x - n + "",
2119
2173
  y: t.y - n + "",
2120
2174
  width: t.width + n * 2 + "",
@@ -2123,74 +2177,67 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2123
2177
  stroke: this.theme.cssVar["--selected"] || "#4dc4ff",
2124
2178
  "stroke-width": "2",
2125
2179
  fill: "none"
2126
- }), e.appendChild(i), this.currentSummary = e;
2127
- }, Un = function() {
2180
+ }), e.appendChild(s), this.currentSummary = e;
2181
+ }, Gn = function() {
2128
2182
  var e, t;
2129
2183
  (t = (e = this.currentSummary) == null ? void 0 : e.querySelector("rect")) == null || t.remove(), this.currentSummary = null;
2130
- }, Yn = function() {
2184
+ }, Jn = function() {
2131
2185
  this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
2132
2186
  try {
2133
- we(this, e);
2187
+ xe(this, e);
2134
2188
  } catch {
2135
2189
  }
2136
2190
  }), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
2137
- }, Xn = function(e) {
2191
+ }, Zn = function(e) {
2138
2192
  if (!e)
2139
2193
  return;
2140
2194
  const t = e.childNodes[1];
2141
- qe(this, t, (n) => {
2142
- var s;
2143
- const o = e.summaryObj, i = ((s = n.textContent) == null ? void 0 : s.trim()) || "";
2144
- i === "" ? o.text = origin : o.text = i, n.remove(), i !== origin && (t.innerHTML = o.text, this.linkDiv(), this.bus.fire("operation", {
2145
- name: "finishEditSummary",
2146
- obj: o
2147
- }));
2148
- });
2149
- }, Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2195
+ Ke(this, t, e.summaryObj);
2196
+ }, Qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2150
2197
  __proto__: null,
2151
- createSummary: Vn,
2152
- createSummaryFrom: Wn,
2153
- editSummary: Xn,
2154
- removeSummary: In,
2155
- renderSummary: Yn,
2156
- selectSummary: Kn,
2157
- unselectSummary: Un
2158
- }, Symbol.toStringTag, { value: "Module" })), A = "http://www.w3.org/2000/svg";
2159
- function Jn(e, t) {
2160
- const n = document.createElementNS(A, "svg");
2198
+ createSummary: Wn,
2199
+ createSummaryFrom: Yn,
2200
+ editSummary: Zn,
2201
+ removeSummary: Un,
2202
+ renderSummary: Jn,
2203
+ selectSummary: Xn,
2204
+ unselectSummary: Gn
2205
+ }, Symbol.toStringTag, { value: "Module" })), T = "http://www.w3.org/2000/svg";
2206
+ function eo(e, t) {
2207
+ const n = document.createElementNS(T, "svg");
2161
2208
  return C(n, {
2162
2209
  version: "1.1",
2163
- xmlns: A,
2210
+ xmlns: T,
2164
2211
  height: e,
2165
2212
  width: t
2166
2213
  }), n;
2167
2214
  }
2168
- function Zn(e, t) {
2215
+ function to(e, t) {
2169
2216
  return (parseInt(e) - parseInt(t)) / 2;
2170
2217
  }
2171
- function Qn(e, t, n, o) {
2172
- const i = document.createElementNS(A, "g");
2173
- let s = "";
2174
- return e.text ? s = e.text.textContent : s = e.childNodes[0].textContent, s.split(`
2175
- `).forEach((c, l) => {
2176
- const d = document.createElementNS(A, "text");
2218
+ function no(e, t, n, o) {
2219
+ const s = document.createElementNS(T, "g");
2220
+ let i = "";
2221
+ return e.text ? i = e.text.textContent : i = e.childNodes[0].textContent, i.split(`
2222
+ `).forEach((l, c) => {
2223
+ const d = document.createElementNS(T, "text");
2177
2224
  C(d, {
2178
2225
  x: n + parseInt(t.paddingLeft) + "",
2179
- y: o + parseInt(t.paddingTop) + Zn(t.lineHeight, t.fontSize) * (l + 1) + parseFloat(t.fontSize) * (l + 1) + "",
2226
+ y: o + parseInt(t.paddingTop) + to(t.lineHeight, t.fontSize) * (c + 1) + parseFloat(t.fontSize) * (c + 1) + "",
2180
2227
  "text-anchor": "start",
2181
2228
  "font-family": t.fontFamily,
2182
2229
  "font-size": `${t.fontSize}`,
2183
2230
  "font-weight": `${t.fontWeight}`,
2184
2231
  fill: `${t.color}`
2185
- }), d.innerHTML = c, i.appendChild(d);
2186
- }), i;
2232
+ }), d.innerHTML = l, s.appendChild(d);
2233
+ }), s;
2187
2234
  }
2188
- function eo(e, t, n, o) {
2189
- var c;
2190
- let i = "";
2191
- (c = e.nodeObj) != null && c.dangerouslySetInnerHTML ? i = e.nodeObj.dangerouslySetInnerHTML : e.text ? i = e.text.textContent : i = e.childNodes[0].textContent;
2192
- const s = document.createElementNS(A, "foreignObject");
2193
- C(s, {
2235
+ function oo(e, t, n, o) {
2236
+ var l;
2237
+ let s = "";
2238
+ (l = e.nodeObj) != null && l.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
2239
+ const i = document.createElementNS(T, "foreignObject");
2240
+ C(i, {
2194
2241
  x: n + parseInt(t.paddingLeft) + "",
2195
2242
  y: o + parseInt(t.paddingTop) + "",
2196
2243
  width: t.width,
@@ -2200,13 +2247,13 @@ function eo(e, t, n, o) {
2200
2247
  return C(r, {
2201
2248
  xmlns: "http://www.w3.org/1999/xhtml",
2202
2249
  style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
2203
- }), r.innerHTML = i, s.appendChild(r), s;
2250
+ }), r.innerHTML = s, i.appendChild(r), i;
2204
2251
  }
2205
- function to(e, t) {
2206
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = R(e.nodes, t), s = document.createElementNS(A, "rect");
2207
- return C(s, {
2252
+ function so(e, t) {
2253
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = R(e.nodes, t), i = document.createElementNS(T, "rect");
2254
+ return C(i, {
2208
2255
  x: o + "",
2209
- y: i + "",
2256
+ y: s + "",
2210
2257
  rx: n.borderRadius,
2211
2258
  ry: n.borderRadius,
2212
2259
  width: n.width,
@@ -2214,13 +2261,13 @@ function to(e, t) {
2214
2261
  fill: n.backgroundColor,
2215
2262
  stroke: n.borderColor,
2216
2263
  "stroke-width": n.borderWidth
2217
- }), s;
2264
+ }), i;
2218
2265
  }
2219
- function ne(e, t, n = !1) {
2220
- const o = getComputedStyle(t), { offsetLeft: i, offsetTop: s } = R(e.nodes, t), r = document.createElementNS(A, "rect");
2266
+ function te(e, t, n = !1) {
2267
+ const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = R(e.nodes, t), r = document.createElementNS(T, "rect");
2221
2268
  C(r, {
2222
- x: i + "",
2223
- y: s + "",
2269
+ x: s + "",
2270
+ y: i + "",
2224
2271
  rx: o.borderRadius,
2225
2272
  ry: o.borderRadius,
2226
2273
  width: o.width,
@@ -2229,197 +2276,226 @@ function ne(e, t, n = !1) {
2229
2276
  stroke: o.borderColor,
2230
2277
  "stroke-width": o.borderWidth
2231
2278
  });
2232
- const c = document.createElementNS(A, "g");
2233
- c.appendChild(r);
2234
- let l;
2235
- return n ? l = eo(t, o, i, s) : l = Qn(t, o, i, s), c.appendChild(l), c;
2279
+ const l = document.createElementNS(T, "g");
2280
+ l.appendChild(r);
2281
+ let c;
2282
+ return n ? c = oo(t, o, s, i) : c = no(t, o, s, i), l.appendChild(c), l;
2236
2283
  }
2237
- function no(e, t) {
2238
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = R(e.nodes, t), s = document.createElementNS(A, "a"), r = document.createElementNS(A, "text");
2284
+ function io(e, t) {
2285
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = R(e.nodes, t), i = document.createElementNS(T, "a"), r = document.createElementNS(T, "text");
2239
2286
  return C(r, {
2240
2287
  x: o + "",
2241
- y: i + parseInt(n.fontSize) + "",
2288
+ y: s + parseInt(n.fontSize) + "",
2242
2289
  "text-anchor": "start",
2243
2290
  "font-family": n.fontFamily,
2244
2291
  "font-size": `${n.fontSize}`,
2245
2292
  "font-weight": `${n.fontWeight}`,
2246
2293
  fill: `${n.color}`
2247
- }), r.innerHTML = t.textContent, s.appendChild(r), s.setAttribute("href", t.href), s;
2294
+ }), r.innerHTML = t.textContent, i.appendChild(r), i.setAttribute("href", t.href), i;
2248
2295
  }
2249
- function oo(e, t) {
2250
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = R(e.nodes, t), s = document.createElementNS(A, "image");
2251
- return C(s, {
2296
+ function ro(e, t) {
2297
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = R(e.nodes, t), i = document.createElementNS(T, "image");
2298
+ return C(i, {
2252
2299
  x: o + "",
2253
- y: i + "",
2300
+ y: s + "",
2254
2301
  width: n.width + "",
2255
2302
  height: n.height + "",
2256
2303
  href: t.src
2257
- }), s;
2304
+ }), i;
2258
2305
  }
2259
- const oe = 100, io = '<?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">', so = (e, t = !1) => {
2260
- var u, h, p;
2261
- const n = e.nodes, o = n.offsetHeight + oe * 2, i = n.offsetWidth + oe * 2, s = Jn(o + "px", i + "px"), r = document.createElementNS(A, "svg"), c = document.createElementNS(A, "rect");
2262
- C(c, {
2306
+ const ne = 100, lo = '<?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">', co = (e, t = !1) => {
2307
+ var u, h, m;
2308
+ const n = e.nodes, o = n.offsetHeight + ne * 2, s = n.offsetWidth + ne * 2, i = eo(o + "px", s + "px"), r = document.createElementNS(T, "svg"), l = document.createElementNS(T, "rect");
2309
+ C(l, {
2263
2310
  x: "0",
2264
2311
  y: "0",
2265
- width: `${i}`,
2312
+ width: `${s}`,
2266
2313
  height: `${o}`,
2267
2314
  fill: e.theme.cssVar["--bgcolor"]
2268
- }), s.appendChild(c), n.querySelectorAll(".subLines").forEach((g) => {
2269
- const v = g.cloneNode(!0), { offsetLeft: m, offsetTop: f } = R(n, g.parentElement);
2270
- v.setAttribute("x", `${m}`), v.setAttribute("y", `${f}`), r.appendChild(v);
2315
+ }), i.appendChild(l), n.querySelectorAll(".subLines").forEach((p) => {
2316
+ const y = p.cloneNode(!0), { offsetLeft: g, offsetTop: f } = R(n, p.parentElement);
2317
+ y.setAttribute("x", `${g}`), y.setAttribute("y", `${f}`), r.appendChild(y);
2271
2318
  });
2272
- const l = (u = n.querySelector(".lines")) == null ? void 0 : u.cloneNode(!0);
2273
- l && r.appendChild(l);
2319
+ const c = (u = n.querySelector(".lines")) == null ? void 0 : u.cloneNode(!0);
2320
+ c && r.appendChild(c);
2274
2321
  const d = (h = n.querySelector(".topiclinks")) == null ? void 0 : h.cloneNode(!0);
2275
2322
  d && r.appendChild(d);
2276
- const a = (p = n.querySelector(".summary")) == null ? void 0 : p.cloneNode(!0);
2277
- return a && r.appendChild(a), n.querySelectorAll("me-tpc").forEach((g) => {
2278
- g.nodeObj.dangerouslySetInnerHTML ? r.appendChild(ne(e, g, !t)) : (r.appendChild(to(e, g)), r.appendChild(ne(e, g.text, !t)));
2279
- }), n.querySelectorAll(".tags > span").forEach((g) => {
2280
- r.appendChild(ne(e, g));
2281
- }), n.querySelectorAll(".icons > span").forEach((g) => {
2282
- r.appendChild(ne(e, g));
2283
- }), n.querySelectorAll(".hyper-link").forEach((g) => {
2284
- r.appendChild(no(e, g));
2285
- }), n.querySelectorAll("img").forEach((g) => {
2286
- r.appendChild(oo(e, g));
2323
+ const a = (m = n.querySelector(".summary")) == null ? void 0 : m.cloneNode(!0);
2324
+ return a && r.appendChild(a), n.querySelectorAll("me-tpc").forEach((p) => {
2325
+ p.nodeObj.dangerouslySetInnerHTML ? r.appendChild(te(e, p, !t)) : (r.appendChild(so(e, p)), r.appendChild(te(e, p.text, !t)));
2326
+ }), n.querySelectorAll(".tags > span").forEach((p) => {
2327
+ r.appendChild(te(e, p));
2328
+ }), n.querySelectorAll(".icons > span").forEach((p) => {
2329
+ r.appendChild(te(e, p));
2330
+ }), n.querySelectorAll(".hyper-link").forEach((p) => {
2331
+ r.appendChild(io(e, p));
2332
+ }), n.querySelectorAll("img").forEach((p) => {
2333
+ r.appendChild(ro(e, p));
2287
2334
  }), C(r, {
2288
- x: oe + "",
2289
- y: oe + "",
2335
+ x: ne + "",
2336
+ y: ne + "",
2290
2337
  overflow: "visible"
2291
- }), s.appendChild(r), s;
2292
- }, ro = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), io + e.outerHTML);
2293
- function co(e) {
2338
+ }), i.appendChild(r), i;
2339
+ }, ao = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), lo + e.outerHTML);
2340
+ function ho(e) {
2294
2341
  return new Promise((t, n) => {
2295
2342
  const o = new FileReader();
2296
- o.onload = (i) => {
2297
- t(i.target.result);
2298
- }, o.onerror = (i) => {
2299
- n(i);
2343
+ o.onload = (s) => {
2344
+ t(s.target.result);
2345
+ }, o.onerror = (s) => {
2346
+ n(s);
2300
2347
  }, o.readAsDataURL(e);
2301
2348
  });
2302
2349
  }
2303
- const lo = function(e = !1, t) {
2304
- const n = so(this, e), o = ro(n, t);
2350
+ const uo = function(e = !1, t) {
2351
+ const n = co(this, e), o = ao(n, t);
2305
2352
  return new Blob([o], { type: "image/svg+xml" });
2306
- }, ao = async function(e = !1, t) {
2307
- const n = this.exportSvg(e, t), o = await co(n);
2308
- return new Promise((i, s) => {
2353
+ }, fo = async function(e = !1, t) {
2354
+ const n = this.exportSvg(e, t), o = await ho(n);
2355
+ return new Promise((s, i) => {
2309
2356
  const r = new Image();
2310
2357
  r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
2311
- const c = document.createElement("canvas");
2312
- c.width = r.width, c.height = r.height, c.getContext("2d").drawImage(r, 0, 0), c.toBlob(i, "image/png", 1);
2313
- }, r.src = o, r.onerror = s;
2358
+ const l = document.createElement("canvas");
2359
+ l.width = r.width, l.height = r.height, l.getContext("2d").drawImage(r, 0, 0), l.toBlob(s, "image/png", 1);
2360
+ }, r.src = o, r.onerror = i;
2314
2361
  });
2315
- }, ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2362
+ }, po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2316
2363
  __proto__: null,
2317
- exportPng: ao,
2318
- exportSvg: lo
2364
+ exportPng: fo,
2365
+ exportSvg: uo
2319
2366
  }, Symbol.toStringTag, { value: "Module" }));
2320
- function uo(e, t) {
2367
+ function mo(e, t) {
2321
2368
  return async function(...n) {
2322
2369
  const o = this.before[t];
2323
2370
  o && !await o.apply(this, n) || e.apply(this, n);
2324
2371
  };
2325
2372
  }
2326
- const Pe = Object.keys(Je), tt = {};
2327
- for (let e = 0; e < Pe.length; e++) {
2328
- const t = Pe[e];
2329
- tt[t] = uo(Je[t], t);
2373
+ const Be = Object.keys(et), nt = {};
2374
+ for (let e = 0; e < Be.length; e++) {
2375
+ const t = Be[e];
2376
+ nt[t] = mo(et[t], t);
2330
2377
  }
2331
- const fo = {
2378
+ const go = {
2332
2379
  getObjById: se,
2333
- generateNewObj: nt,
2334
- layout: st,
2335
- linkDiv: pt,
2336
- editTopic: ut,
2337
- createWrapper: lt,
2338
- createParent: at,
2339
- createChildren: dt,
2340
- createTopic: ht,
2341
- findEle: S,
2342
- changeTheme: Bt,
2343
- ...Mn,
2344
- ...tt,
2345
- ...Bn,
2346
- ...Gn,
2347
- ...ho,
2380
+ generateNewObj: it,
2381
+ layout: ct,
2382
+ linkDiv: yt,
2383
+ editTopic: mt,
2384
+ createWrapper: ht,
2385
+ createParent: ut,
2386
+ createChildren: ft,
2387
+ createTopic: pt,
2388
+ findEle: N,
2389
+ changeTheme: zt,
2390
+ ...Tn,
2391
+ ...nt,
2392
+ ...Fn,
2393
+ ...Qn,
2394
+ ...po,
2348
2395
  init(e) {
2349
2396
  if (e = JSON.parse(JSON.stringify(e)), !e || !e.nodeData)
2350
2397
  return new Error("MindElixir: `data` is required");
2351
- e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, B(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && kt(this), this.keypress && wt(this), this.editable && Pt(this), this.contextMenu && this.disposable.push(mt(this, this.contextMenuOption)), this.draggable && Ct(this), this.allowUndo && _t(this), this.toCenter(), this.layout(), this.linkDiv();
2398
+ e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, B(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && jt(this), this.keypress && Ct(this), this.editable && Rt(this), this.contextMenu && this.disposable.push(vt(this, this.contextMenuOption)), this.draggable && kt(this), this.allowUndo && Tt(this), this.toCenter(), this.layout(), this.linkDiv();
2352
2399
  },
2353
2400
  destroy() {
2354
2401
  var e;
2355
- 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;
2402
+ 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.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;
2356
2403
  }
2357
2404
  };
2358
- function po({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH: c, direction: l, containerHeight: d }) {
2405
+ function yo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: c, containerHeight: d }) {
2359
2406
  let a = t + n / 2;
2360
2407
  const u = e + o / 2;
2361
2408
  let h;
2362
- l === L.LHS ? h = s + r : h = s;
2363
- const p = i + c / 2, v = (1 - Math.abs(p - u) / d) * 0.25 * (n / 2);
2364
- return l === L.LHS ? a = a - n / 10 - v : a = a + n / 10 + v, `M ${a} ${u} Q ${a} ${p} ${h} ${p}`;
2409
+ c === M.LHS ? h = i + r : h = i;
2410
+ const m = s + l / 2, y = (1 - Math.abs(m - u) / d) * 0.25 * (n / 2);
2411
+ return c === M.LHS ? a = a - n / 10 - y : a = a + n / 10 + y, `M ${a} ${u} Q ${a} ${m} ${h} ${m}`;
2365
2412
  }
2366
- function mo({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH: c, direction: l, isFirst: d }) {
2413
+ function vo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: c, isFirst: d }) {
2367
2414
  const a = parseInt(this.container.style.getPropertyValue("--gap"));
2368
2415
  let u = 0, h = 0;
2369
2416
  d ? u = e + o / 2 : u = e + o;
2370
- const p = i + c;
2371
- let g = 0, v = 0, m = 0;
2372
- const f = Math.abs(u - p) / 300 * a;
2373
- return l === L.LHS ? (m = t, g = m + a, v = m - a, h = s + a, `M ${g} ${u} C ${m} ${u} ${m + f} ${p} ${v} ${p} H ${h}`) : (m = t + n, g = m - a, v = m + a, h = s + r - a, `M ${g} ${u} C ${m} ${u} ${m - f} ${p} ${v} ${p} H ${h}`);
2417
+ const m = s + l;
2418
+ let p = 0, y = 0, g = 0;
2419
+ const f = Math.abs(u - m) / 300 * a;
2420
+ return c === M.LHS ? (g = t, p = g + a, y = g - a, h = i + a, `M ${p} ${u} C ${g} ${u} ${g + f} ${m} ${y} ${m} H ${h}`) : (g = t + n, p = g - a, y = g + a, h = i + r - a, `M ${p} ${u} C ${g} ${u} ${g - f} ${m} ${y} ${m} H ${h}`);
2421
+ }
2422
+ const bo = "5.0.0-beta.10";
2423
+ function xo(e) {
2424
+ return {
2425
+ x: 0,
2426
+ y: 0,
2427
+ moved: !1,
2428
+ // diffrentiate click and move
2429
+ mousedown: !1,
2430
+ onMove(t) {
2431
+ if (this.mousedown) {
2432
+ this.moved = !0;
2433
+ const n = t.movementX, o = t.movementY;
2434
+ e.move(n, o);
2435
+ }
2436
+ },
2437
+ clear() {
2438
+ setTimeout(() => {
2439
+ this.moved = !1, this.mousedown = !1, e.map.style.transition = "transform 0.3s";
2440
+ }, 0);
2441
+ }
2442
+ };
2374
2443
  }
2375
- const go = "4.5.2", G = document;
2376
- function D({
2444
+ const G = document;
2445
+ function O({
2377
2446
  el: e,
2378
2447
  direction: t,
2379
2448
  locale: n,
2380
2449
  draggable: o,
2381
- editable: i,
2382
- contextMenu: s,
2450
+ editable: s,
2451
+ contextMenu: i,
2383
2452
  contextMenuOption: r,
2384
- toolBar: c,
2385
- keypress: l,
2453
+ toolBar: l,
2454
+ keypress: c,
2386
2455
  mouseSelectionButton: d,
2387
2456
  selectionContainer: a,
2388
2457
  before: u,
2389
2458
  newTopicName: h,
2390
- allowUndo: p,
2391
- generateMainBranch: g,
2392
- generateSubBranch: v,
2393
- overflowHidden: m,
2459
+ allowUndo: m,
2460
+ generateMainBranch: p,
2461
+ generateSubBranch: y,
2462
+ overflowHidden: g,
2394
2463
  theme: f,
2395
- alignment: b
2464
+ alignment: v
2396
2465
  }) {
2397
2466
  let x = null;
2398
- const E = Object.prototype.toString.call(e);
2399
- if (E === "[object HTMLDivElement]" ? x = e : E === "[object String]" && (x = document.querySelector(e)), !x)
2467
+ const S = Object.prototype.toString.call(e);
2468
+ if (S === "[object HTMLDivElement]" ? x = e : S === "[object String]" && (x = document.querySelector(e)), !x)
2400
2469
  throw new Error("MindElixir: el is not a valid element");
2401
- x.style.position = "relative", x.innerHTML = "", this.mindElixirBox = x, this.disposable = [], this.before = u || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = s === void 0 ? !0 : s, this.toolBar = c === void 0 ? !0 : c, this.keypress = l === void 0 ? !0 : l, 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 = i === void 0 ? !0 : i, this.allowUndo = p === void 0 ? !1 : p, this.currentNode = null, this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = g || po, this.generateSubBranch = v || mo, this.overflowHidden = m || !1, this.bus = it.create(), this.container = G.createElement("div"), this.selectionContainer = a || this.container, this.container.className = "map-container";
2402
- const y = window.matchMedia("(prefers-color-scheme: dark)");
2403
- this.theme = f || (y.matches ? Re : Be);
2470
+ x.style.position = "relative", x.innerHTML = "", this.mindElixirBox = x, 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 = m === void 0 ? !1 : m, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = p || yo, this.generateSubBranch = y || vo, this.overflowHidden = g || !1, this.dragMoveHelper = xo(this), this.bus = lt(), this.container = G.createElement("div"), this.selectionContainer = a || this.container, this.container.className = "map-container";
2471
+ const b = window.matchMedia("(prefers-color-scheme: dark)");
2472
+ this.theme = f || (b.matches ? ze : Re);
2404
2473
  const w = G.createElement("div");
2405
- w.className = "map-canvas", this.map = w, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = G.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = J("lines"), this.summarySvg = J("summary"), this.linkController = J("linkcontroller"), this.P2 = G.createElement("div"), this.P3 = G.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = Ne(), this.line2 = Ne(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = J("topiclinks"), this.alignment = b ?? "root", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : ot(this);
2474
+ w.className = "map-canvas", setTimeout(() => {
2475
+ w.style.transition = "all 0.3s";
2476
+ }, 300), this.map = w, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = G.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = J("lines"), this.summarySvg = J("summary"), this.linkController = J("linkcontroller"), this.P2 = G.createElement("div"), this.P3 = G.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = Ee(), this.line2 = Ee(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = J("topiclinks"), this.alignment = v ?? "root", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : rt(this);
2406
2477
  }
2407
- D.prototype = fo;
2408
- D.LEFT = $;
2409
- D.RIGHT = P;
2410
- D.SIDE = ae;
2411
- D.THEME = Be;
2412
- D.DARK_THEME = Re;
2413
- D.version = go;
2414
- D.E = S;
2415
- D.new = (e) => ({
2478
+ O.prototype = go;
2479
+ Object.defineProperty(O.prototype, "currentNode", {
2480
+ get() {
2481
+ return this.currentNodes.at(-1);
2482
+ },
2483
+ enumerable: !0
2484
+ });
2485
+ O.LEFT = A;
2486
+ O.RIGHT = P;
2487
+ O.SIDE = ce;
2488
+ O.THEME = Re;
2489
+ O.DARK_THEME = ze;
2490
+ O.version = bo;
2491
+ O.E = N;
2492
+ O.new = (e) => ({
2416
2493
  nodeData: {
2417
- id: U(),
2494
+ id: I(),
2418
2495
  topic: e || "new topic",
2419
2496
  children: []
2420
2497
  }
2421
2498
  });
2422
- D.dragMoveHelper = k;
2423
2499
  export {
2424
- D as default
2500
+ O as default
2425
2501
  };